Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ mhl(1mh) — Ultrix/UWS 4.0 VAX

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

more(1)

show(1mh)

ap(8mh)

dp(8mh)

mhl(1mh)

Name

mhl − produce formatted listings of MH messages

Syntax

/usr/new/lib/mh/mhl [−bell] [−nobell] [−clear] [−noclear] [−folder +foldername] [−form formfile] [−length lines] [−width columns] [−moreproc program] [−nomoreproc] [files ...] [−help]

Description

The mhl command is a program for listing formatted messages and it can be used as a replacement for more (the default showproc).

As with more, each of the messages specified as arguments (or the standard input) are output. If more than one message file is specified, you are prompted prior to each one, and a <RETURN> or <EOT> begins the output, with <RETURN> clearing the screen (if appropriate), and <EOT> (usually CTRL−D) suppressing the screen clear. An <INTERRUPT> (usually CTRL−C) aborts the current message output, prompting for the next message, if there is one, and a <QUIT> (usually CTRL−E) terminates the program without generating a core dump.

Options

The −bell option tells mhl to ring the terminal bell at the end of each page, while the −clear option tells mhl to clear the screen at the end of each page, or output a formfeed after each message. Both of these switches, and their inverse counterparts, take effect only if the profile entry moreproc is defined but empty, and if mhl is outputting to a terminal. If the moreproc entry is defined and non-empty, and mhl is outputting to a terminal, then mhl causes the moreproc to be placed between the terminal and mhl, and the switches are ignored. Furthermore, if the −clear switch is used and mhl’s output is directed to a terminal, then mhl consults the $TERM and $TERMCAP environment variables to determine your terminal type in order to find out how to clear the screen. If the −clear switch is used and mhl’s output is not directed to a terminal (for example, a pipe or a file), then mhl sends a formfeed after each message.

To override the default moreproc and the profile entry, use the −moreproc program switch. Note that mhl never starts a moreproc if invoked on a hardcopy terminal.

The −length length and −width width switches set the screen length and width, respectively. These default to the values indicated by $TERMINFO, if appropriate; otherwise they default to 40 and 80, respectively.

The default format file used by mhl is called mhl.format (which is first searched for in your MH directory, and then sought in the /usr/new/lib/mh directory). This can be changed by using the −form formatfile switch.

Finally, the −folder +folder switch sets the MH folder name, which is used for the −messagename switch described below. The environment variable $mhfolder is consulted for the default value which show, next, and prev initialize appropriately.

The mhl command operates in two phases: read and parse the format file then process each message (file). During the first phase, an internal description of the format is produced as a structured list. In the second phase, this list is traversed for each message, outputting message information under the format constraints from the format file.

The “mhl.format” form file contains information controlling screen clearing, screen size, wrap-around control, transparent text, component ordering, and component formatting.  Also, a list of components that should be ignored may be specified, and a couple of special components are defined to provide added functionality.  Message output is in the order specified by the order in the format file. 

Each line of mhl.format has one of the formats:

     ;comment
     :cleartext
     variable[variable...]
     component:[variable,...]

A line beginning with a semi colon (;) is a comment, and is ignored. A line beginning with a colon (:) is clear text, and is output exactly as is. A line containing only a colon (:) produces a blank line in the output. A line beginning with “component:” defines the format for the specified component, and finally, remaining lines define the global environment.

For example, the line: width=80,length=40,clearscreen,overflowtext="***",overflowoffset=5 defines the screen size to be 80 columns by 40 rows, specifies that the screen should be cleared prior to each page, that the overflow indentation is 5, and that overflow text should be flagged with “***”.

If variables or arguments follow a component, they apply only to that component, otherwise, their affect is global.  Since the whole format is parsed before any output processing, the last global switch setting for a variable applies to the whole message if that variable is used in a global context (bell, clearscreen, width, length).  All of the current variables and their arguments are shown in the following table. 

Variable Type Semantics
width integer screen width or component width
length integer screen length or component length
offset integer positions to indent “component: ”
overflowtext string text to use at the beginning of an
overflow line
overflowoffset integer positions to indent overflow lines
compwidth integer positions to indent component text
after the first line is output
uppercase flag output text of this component in all
upper case
nouppercase flag do not use uppercase
clearscreen flag/G clear the screen prior to each page
noclearscreen flag/G do not clear the screen
bell flag/G ring the bell at the end of each page
nobell flag/G disable bell
component string/L name to use instead of “component” for
this component
nocomponent flag do not output “component: ” for this
component
center flag center component on line (works for
one-line components only)
nocenter flag do not center
leftadjust flag strip off leading white-space on each
line of text
noleftadjust flag do not leftadjust
compress flag change newlines in text to spaces
nocompress flag do not compress
formatfield string format string for this component
addrfield flag field contains addresses
datefield flag field contains dates

To specify the value of integer-valued and string-valued variables, follow their name with an equals-sign and the value.  Integer-valued variables are given decimal values, while string-valued variables are given arbitrary text bracketed by double-quotes.  If a value is suffixed by /G or /L, then its value is useful in a global-only or local-only context (respectively).  A line of the form:

    ignores=component,...

specifies a list of components which are never output.

The component “MessageName” (case-insensitive) outputs the actual message name (file name) preceded by the folder name if one is specified or found in the environment.  The format is identical to that produced by the −header option to show.

The component “Extras” outputs all of the components of the message which were not matched by explicit components, or included in the ignore list.  If this component is not specified, an ignore list is not needed since all non-specified components are ignored. 

If −nocomponent is not specified, then the component name is output as it appears in the format file.

The default format is:

: −− using template mhl.format − −
overflowtext="***",overflowoffset=5
leftadjust,compwidth=9
ignores=msid,msgid,message-id,received
Date;formatfield="%<(nodate{text})%{text}%|%(pretty{text})%>"
To:
cc;
:
From:
Subject:
:
extras:nocomponent
:
body:nocomponent,overflowtext=,overflowoffset=0,noleftadjust

The variable formatfield specifies a format string (see mh−format().)). The variables addrfield and datefield (which are mutually exclusive), control the interpretation of the escapes. 

By default, mhl does not apply any formatting string to fields containing address or dates (see mh-mail() for a list of these fields). Note that this results in faster operation since mhl must parse both addresses and dates in order to apply a format string to them. If desired, mhl can be given a default format string for either address or date fields (but not both). To do this, on a global line specify either the variable addrfield or the variable datefield, along with the variable formatfield. 

The defaults for mhl are:

−bell
−noclear
−length 40
−width 80

Files

/usr/new/lib/mh/mhl.format The message template
or <mh−dir>/mhl.format Rather than the standard template
$HOME/.mh_profile The user profile

Profile Components

Path: To determine your MH directory
moreproc: Program to use as interactive front-end

See Also

more(1), show(1mh), ap(8mh), dp(8mh)

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026