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