]> diplodocus.org Git - nmh/blob - docs/historical/mh-jun-1982/MHL.Design
Remove final traces of TMA support
[nmh] / docs / historical / mh-jun-1982 / MHL.Design
1 MHL Design
2
3 Mhl is a formatted message listing program. It can be used as a
4 replacement for "c" (the default message lister). As with c, each of
5 the messages specified as arguments (or stdin) will be output. If more
6 than one message file is specified, the user will be prompted prior to
7 each one, and a <return> or <eot> will begin the output, with <return>
8 clearing the screen (if appropriate), and <eot> suppressing the screen
9 clear. An <interrupt> will abort the current message ouput, prompting
10 for the next message (if there is one), and a <quit> will terminate the
11 program (without core dump).
12
13 NOTE: This is a preliminary document and the design is VERY young.
14
15 Syntax: mhl [switches] [files]
16
17 As in all MH programs, mhl looks for a line "mhl: args" in the user's
18 profile, and thus allows tailored defaults. The switches are:
19
20 -clear /* Clear screen each page */
21 -noclear /* Don't clear screen each page */
22 -folder folder /* Use this "folder" name */
23 -form formfile /* Name of the format file */
24 -length /* Screen length */
25 -width /* Screen width */
26 -help /* Standard help message */
27
28 All of the functions these switches perform are affected or controlled
29 by information elsewhere. That is, the format file can specify "clear",
30 in which case, the command line switches will override. Also, the
31 length and width can be specified in the format file, or default to
32 40x80. The folder is used in constructing a message name (see special
33 component "MessageName" below). If it is not specified in a switch, it
34 is taken from the environment variable "mhfolder", which show, next,
35 prev, and pick initialize appropriately.
36
37 If the form file is not specified, it is taken from the file
38 "mhl.format" in the user's MH directory, and if that file doesn't exist,
39 it is taken from "/etc/mh/mhl.format". (Same evaluation hierarchy as the
40 compose form file.)
41
42 Mhl operates in two phases: 1) read and parse the format file, and 2)
43 process each message (file). During phase 1, an internal description of
44 the format is produced as a structured list. In phase 2, this list is
45 walked for each message, outputing message information under the format
46 constraints from the format file.
47
48 The "mhl.format" file contains information controlling screen clearing,
49 screen size, wraparound control, transparent text, component ordering,
50 and component formatting. Also, a list of components to ignore may be
51 specified, and a couple of "special" components are defined to provide
52 added functionality. Message output will be in the order specified by
53 the order in the format file.
54
55
56 Each line of mhl.format has one of the formats:
57
58 ;comment
59 :cleartext
60 variable[,variable...]
61 component:[variable,...]
62
63 A line beginning with a ";" is a comment, and is ignored. A line
64 beginning with a ":" is clear text, and is output exactly as is. (A line
65 containing only a ":" produces a blank line in the output.) A line
66 beginning with "component:" defines the format for the specified
67 component, and finally, remaining lines define the global environment.
68
69 For example, the line:
70
71 width=80,length=40,clearscreen,overflowtext=***,overflowoffset=5
72
73 defines the screen size to be 80 columns by 40 rows, specifies that the
74 screen should be cleared prior to each page, that the overflow
75 indentation is 5, and that overflow text should be flagged with "***".
76
77 Following are all of the current variables and their argmuments. If
78 they follow a component, they apply only to that component, otherwise,
79 their affect is global. Since the whole format is parsed before any
80 output processing, the last global switch setting for a variable applies
81 to the whole message.
82
83 width=# Screen width, component width
84 length=# Screen length, component line limit
85 offset=# Positions to indent text
86 overflowtext=t Text to use at the beginning of an overflow line
87 overflowoffset=# Positions to indent overflow lines
88 compwidth=# Positions to indent component text after first line
89 nocomponent Don't output "component: " for this component
90 uppercase Output text of this component in all upper case
91 center Center component on line (works for one-line components
92 only)
93 clearscreen Clear the screen (form feed) prior to each page
94 leftadjust Strip off leading spaces & tabs on each line of text
95 compress Change newlines in text to spaces
96
97 Where "=#" indicates a number must be specified, and "=t" indicates that
98 arbitrary text up to end of line or "," is required. The variables
99 without arguments are ON indicators, with the default in all cases OFF.
100 The variables "nocomponent", center, leftadjust and compress have no
101 affect globally, and clearscreen only affects the global environment.
102
103 A line of the form:
104
105 ignores=component,...
106
107 specifies a list of components which are never output.
108
109 The component "MessageName" (case is unimportant) will output the actual
110 message name (file name) preceded by "folder:" if one is specified or
111 found in the environment.
112
113 The component "Extras" will output all of the components of the message
114 which were not matched by explicit components, or included in the ignore
115 list. If this component is not specified, an ignore list is not needed
116 since all non-specified components will be ignored.
117
118 If "nocomponent" is NOT specified, then the component name will be output
119 as it appears in the format file.
120
121 The current default format is:
122
123 width=80,length=40,overflowtext=***,overflowoffset=5
124 ignores=msgid,message-id
125 Date:leftadjust,offset=40
126 To:leftadjust
127 Cc:leftadjust
128 :
129 From:leftadjust
130 Subject:leftadjust
131 :
132 extras:leftadjust,nocomponent
133 :
134 body:nocomponent
135
136
137 Future work:(?)
138
139 o Fancier address formatting (to, cc, from)
140 o Tests for "am i in this address list?" and what to do if yes/no
141 o Currently only one component per line--should be generalized
142 o Clear text and components intermixed on a line
143 o Intelligent fill/justify per component?
144
145
146
147 May 1980
148 Bruce