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