de444489e9e96d95c0fc71b00de0c7398e4f9114
[mmh] / man / mhl.man1
1 .\"
2 .\" %nmhwarning%
3 .\"
4 .TH MHL %manext1% "%nmhdate%" MH.6.8 [%nmhversion%]
5 .SH NAME
6 mhl \- produce formatted listings of nmh messages
7 .SH SYNOPSIS
8 .HP 5
9 .na
10 .B mhl
11 .RB [ \-clear " | " \-noclear ]
12 .RB [ \-folder
13 .IR +folder ]
14 .RB [ \-form
15 .IR formfile ]
16 .RB [ \-length
17 .IR lines ]
18 .RB [ \-width
19 .IR columns ]
20 .RB [ \-moreproc
21 .IR program ]
22 .RI [ files
23 .IR \&... ]
24 .RB [ \-version ]
25 .RB [ \-help ]
26 .ad
27 .SH DESCRIPTION
28 .B Mhl
29 is an
30 .B nmh
31 command for filtering and/or displaying text
32 messages.  It is the default method of displaying text messages for
33 .B nmh
34 (it is the default
35 .IR showproc ).
36 .PP
37 As with
38 .BR more ,
39 each of the messages specified as arguments (or
40 the standard input) will be output.  If more than one message file is
41 specified, the user will be prompted prior to each one, and a <RETURN>
42 or <EOT> will begin the output, with <RETURN> clearing the screen (if
43 appropriate), and <EOT> (usually CTRL\-D) suppressing the screen clear.
44 An <INTERRUPT> (usually CTRL\-C) will abort the current message output,
45 prompting for the next message (if there is one), and a <QUIT> (usually
46 CTRL-\\) will terminate the program (without core dump).
47 .PP
48 The
49 .B \-clear
50 option tells
51 .B mhl
52 to clear the
53 screen at the end of each page (or output a formfeed after each message).
54 This switches (and its inverse counterpart) take effect only
55 if the profile entry
56 .I moreproc
57 is defined but empty, and
58 .B mhl
59 is outputting to a terminal.  If the
60 .I moreproc
61 entry is defined and
62 non-empty, and
63 .B mhl
64 is outputting to a terminal, then
65 .B mhl
66 will
67 cause the
68 .I moreproc
69 to be placed between the terminal and
70 .B mhl
71 and the switches are ignored.  Furthermore, if the
72 .B \-clear
73 switch is
74 used and \fImhl's\fR output is directed to a terminal, then
75 .B mhl
76 will consult the
77 .B $TERM
78 and
79 .B $TERMCAP
80 environment variables
81 to determine the user's terminal type in order to find out how to clear
82 the screen.  If the
83 .B \-clear
84 switch is used and
85 .BR mhl 's
86 output is
87 not directed to a terminal (e.g., a pipe or a file), then
88 .B mhl
89 will
90 send a formfeed after each message.
91 .PP
92 To override the default
93 .I moreproc
94 and the profile entry, use the
95 .B \-moreproc
96 .I program
97 switch.  Note that
98 .B mhl
99 will never start a
100 .I moreproc
101 if invoked on a hardcopy terminal.
102 .PP
103 The
104 .B \-length
105 .I length
106 and
107 .B \-width
108 .I width
109 switches set the screen
110 length and width, respectively.  These default to the values indicated by
111 .BR $TERMCAP ,
112 if appropriate, otherwise they default to 40 and 80, respectively.
113 .PP
114 The default format file used by
115 .B mhl
116 is called
117 .RI \*(lq mhl.format \*(rq.
118 .B mhl
119 will first search for this file in the user's
120 .B mmh
121 directory, and will then search in the directory
122 .IR %etcdir% .
123 This default
124 can be changed by using the
125 .B \-form
126 .I formatfile
127 switch.
128 Note: In contrast to any other
129 .B mmh
130 tool, the
131 .B \-form
132 switch does only take file names, but no format strings with a prepended
133 equal sign `='.
134 .PP
135 Finally, the
136 .B \-folder
137 .I +folder
138 switch sets the
139 .B nmh
140 folder name,
141 which is used for the \*(lqmessagename:\*(rq field described below.  The
142 environment variable
143 .B $mhfolder
144 is consulted for the default value,
145 which
146 .BR show ,
147 .BR next ,
148 and
149 .B prev
150 initialize appropriately.
151 .PP
152 .B Mhl
153 operates in two phases: 1) read and parse the format file, and
154 2) process each message (file).  During phase 1, an internal description
155 of the format is produced as a structured list.  In phase 2, this list
156 is walked for each message, outputting message information under the
157 format constraints from the format file.
158 .PP
159 The format file can contain information controlling screen clearing,
160 screen size, wrap\-around control, transparent text, component ordering,
161 and component formatting.  Also, a list of components to ignore may be
162 specified, and a couple of \*(lqspecial\*(rq components are defined
163 to provide added functionality.  Message output will be in the order
164 specified by the order in the format file.
165 .PP
166 Each line of a format file has one of the following forms:
167 .PP
168 .RS 5
169 .nf
170 ;comment
171 :cleartext
172 variable[,variable...]
173 component:[variable,...]
174 .fi
175 .RE
176 .PP
177 .IP \(bu 4
178 A line beginning with a `;' is a comment, and is ignored.
179 .IP \(bu 4
180 A line beginning with a `:' is clear text, and is output exactly as is.
181 .IP \(bu 4
182 A line containing only a `:' produces a blank line in the output.
183 .IP \(bu 4
184 A line beginning with \*(lqcomponent:\*(rq defines the format for the specified
185 component,
186 .IP \(bu 4
187 Remaining lines define the global environment.
188 .PP
189 For example, the line:
190 .PP
191 .RS 5
192 width=80,length=40,clearscreen,overflowtext="***",overflowoffset=5
193 .RE
194 .PP
195 defines the screen size to be 80 columns by 40 rows, specifies that the
196 screen should be cleared prior to each page, that the overflow indentation
197 is 5, and that overflow text should be flagged with \*(lq***\*(rq.
198 .PP
199 Following are all of the current variables and their arguments.  If they
200 follow a component, they apply only to that component, otherwise, their
201 affect is global.  Since the whole format is parsed before any output
202 processing, the last global switch setting for a variable applies to
203 the whole message if that variable is used in a global context (i.e.,
204 clearscreen, width, length).
205 .PP
206 .RS 5
207 .nf
208 .ta \w'noclearscreen  'u +\w'integer/G  'u
209 .I variable     type    semantics
210 width   integer screen width or component width
211 length  integer screen length or component length
212 offset  integer positions to indent \*(lqcomponent: \*(rq
213 overflowtext    string  text to use at the beginning of an
214                 overflow line
215 overflowoffset  integer positions to indent overflow lines
216 compwidth       integer positions to indent component text
217                 after the first line is output
218 uppercase       flag    output text of this component in all
219                 upper case
220 nouppercase     flag    don't uppercase
221 clearscreen     flag/G  clear the screen prior to each page
222 noclearscreen   flag/G  don't clearscreen
223 component       string/L        name to use instead of \*(lqcomponent\*(rq for
224                 this component
225 nocomponent     flag    don't output \*(lqcomponent: \*(rq for this
226                 component
227 center  flag    center component on line (works for
228                 one\-line components only)
229 nocenter        flag    don't center
230 leftadjust      flag    strip off leading whitespace on each
231                 line of text
232 noleftadjust    flag    don't leftadjust
233 compress        flag    change newlines in text to spaces
234 nocompress      flag    don't compress
235 split   flag    don't combine multiple fields into
236                 a single field
237 nosplit flag    combine multiple fields into
238                 a single field
239 newline flag    print newline at end of components
240                 (this is the default)
241 nonewline       flag    don't print newline at end of components
242 formatfield     string  format string for this component
243                 (see below)
244 decode  flag    decode text as RFC-2047 encoded
245                 header field
246 addrfield       flag    field contains addresses
247 datefield       flag    field contains dates
248 .fi
249 .RE
250 .PP
251 To specify the value of integer\-valued and string\-valued variables,
252 follow their name with an equals\-sign and the value.  Integer\-valued
253 variables are given decimal values, while string\-valued variables
254 are given arbitrary text bracketed by double\-quotes.  If a value is
255 suffixed by \*(lq/G\*(rq or \*(lq/L\*(rq, then its value is useful in
256 a global\-only or local\-only context (respectively).
257 .PP
258 A line of the form:
259 .PP
260 .RS 5
261 ignores=component,...
262 .RE
263 .PP
264 specifies a list of components which are never output.
265 .PP
266 The component \*(lqMessageName\*(rq (case\-insensitive) will output the
267 actual message name (file name) preceded by the folder name if one is
268 specified or found in the environment.  The format is identical to that
269 produced by the
270 .B \-header
271 option to
272 .BR show .
273 .PP
274 The component \*(lqExtras\*(rq will output all of the components of the
275 message which were not matched by explicit components, or included in
276 the ignore list.  If this component is not specified, an ignore list is
277 not needed since all non\-specified components will be ignored.
278 .PP
279 If \*(lqnocomponent\*(rq is NOT specified, then the component name will
280 be output as it appears in the format file.
281 .PP
282 The default format file is:
283 .PP
284 .RS 5
285 .nf
286 %mhl_format%
287 .fi
288 .RE
289 .PP
290 The variable \*(lqformatfield\*(rq specifies a format string (see
291 .BR mh\-format (5)).
292 The flag variables \*(lqaddrfield\*(rq and
293 \*(lqdatefield\*(rq (which are mutually exclusive), tell
294 .B mhl
295 to interpret the escapes in the format string as either addresses or
296 dates, respectively.
297 .PP
298 By default,
299 .B mhl
300 does not apply any formatting string to fields
301 containing address or dates (see
302 .BR mh\-mail (5)
303 for a list of these
304 fields).  Note that this results in faster operation since
305 .B mhl
306 must parse both addresses and dates in order to apply a format string
307 to them.  If desired,
308 .B mhl
309 can be given a default format string for
310 either address or date fields (but not both).  To do this, on a global
311 line specify: either the flag addrfield or datefield, along with the
312 appropriate formatfield variable string.
313
314 .SH FILES
315 .fc ^ ~
316 .nf
317 .ta \w'%etcdir%/ExtraBigFileName  'u
318 ^%etcdir%/mhl.format~^The message template
319 ^or $HOME/.mmh/mhl.format~^Rather than the standard template
320 ^$HOME/.mh/profile~^The user profile
321 .fi
322
323 .SH "PROFILE COMPONENTS"
324 .fc ^ ~
325 .nf
326 .ta 2.4i
327 .ta \w'ExtraBigProfileName  'u
328 ^moreproc:~^Program to use as interactive front\-end
329 .fi
330
331 .SH "SEE ALSO"
332 show(1), ap(8), dp(8)
333
334 .SH DEFAULTS
335 .nf
336 .RB ` \-noclear '
337 .RB ` \-length 40 '
338 .RB ` \-width 80 '
339 .fi
340
341 .SH CONTEXT
342 None
343
344 .SH BUGS
345 In contrast to any other
346 .B mmh
347 tool, the
348 .B \-form
349 switch does only take file names, but no format strings with a prepended
350 equal sign `='.
351 .PP
352 There should be some way to pass `clear' information to the
353 front\-end.
354 .PP
355 The \*(lqnonewline\*(rq option interacts badly with \*(lqcompress\*(rq
356 and \*(lqsplit\*(rq.