f8546c31e89f2f777cdbcf98ef3edd22fd337819
[mmh] / man / mhl.man
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 %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 .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 nmh
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 .PP
136 Finally, the
137 .B \-folder
138 .I +folder
139 switch sets the
140 .B nmh
141 folder name,
142 which is used for the \*(lqmessagename:\*(rq field described below.  The
143 environment variable
144 .B $mhfolder
145 is consulted for the default value,
146 which
147 .BR show ,
148 .BR next ,
149 and
150 .B prev
151 initialize appropriately.
152 .PP
153 .B Mhl
154 operates in two phases: 1) read and parse the format file, and
155 2) process each message (file).  During phase 1, an internal description
156 of the format is produced as a structured list.  In phase 2, this list
157 is walked for each message, outputting message information under the
158 format constraints from the format file.
159 .PP
160 The format file can contain information controlling screen clearing,
161 screen size, wrap\-around control, transparent text, component ordering,
162 and component formatting.  Also, a list of components to ignore may be
163 specified, and a couple of \*(lqspecial\*(rq components are defined
164 to provide added functionality.  Message output will be in the order
165 specified by the order in the format file.
166 .PP
167 Each line of a format file has one of the following forms:
168 .PP
169 .RS 5
170 .nf
171 ;comment
172 :cleartext
173 variable[,variable...]
174 component:[variable,...]
175 .fi
176 .RE
177 .PP
178 .IP \(bu 4
179 A line beginning with a `;' is a comment, and is ignored.
180 .IP \(bu 4
181 A line beginning with a `:' is clear text, and is output exactly as is.
182 .IP \(bu 4
183 A line containing only a `:' produces a blank line in the output.
184 .IP \(bu 4
185 A line beginning with \*(lqcomponent:\*(rq defines the format for the specified
186 component,
187 .IP \(bu 4
188 Remaining lines define the global environment.
189 .PP
190 For example, the line:
191 .PP
192 .RS 5
193 width=80,length=40,clearscreen,overflowtext="***",overflowoffset=5
194 .RE
195 .PP
196 defines the screen size to be 80 columns by 40 rows, specifies that the
197 screen should be cleared prior to each page, that the overflow indentation
198 is 5, and that overflow text should be flagged with \*(lq***\*(rq.
199 .PP
200 Following are all of the current variables and their arguments.  If they
201 follow a component, they apply only to that component, otherwise, their
202 affect is global.  Since the whole format is parsed before any output
203 processing, the last global switch setting for a variable applies to
204 the whole message if that variable is used in a global context (i.e.,
205 bell, clearscreen, width, length).
206 .PP
207 .RS 5
208 .nf
209 .ta \w'noclearscreen  'u +\w'integer/G  'u
210 .I variable     type    semantics
211 width   integer screen width or component width
212 length  integer screen length or component length
213 offset  integer positions to indent \*(lqcomponent: \*(rq
214 overflowtext    string  text to use at the beginning of an
215                 overflow line
216 overflowoffset  integer positions to indent overflow lines
217 compwidth       integer positions to indent component text
218                 after the first line is output
219 uppercase       flag    output text of this component in all
220                 upper case
221 nouppercase     flag    don't uppercase
222 clearscreen     flag/G  clear the screen prior to each page
223 noclearscreen   flag/G  don't clearscreen
224 bell    flag/G  ring the bell at the end of each page
225 nobell  flag/G  don't bell
226 component       string/L        name to use instead of \*(lqcomponent\*(rq for
227                 this component
228 nocomponent     flag    don't output \*(lqcomponent: \*(rq for this
229                 component
230 center  flag    center component on line (works for
231                 one\-line components only)
232 nocenter        flag    don't center
233 leftadjust      flag    strip off leading whitespace on each
234                 line of text
235 noleftadjust    flag    don't leftadjust
236 compress        flag    change newlines in text to spaces
237 nocompress      flag    don't compress
238 split   flag    don't combine multiple fields into
239                 a single field
240 nosplit flag    combine multiple fields into
241                 a single field
242 newline flag    print newline at end of components
243                 (this is the default)
244 nonewline       flag    don't print newline at end of components
245 formatfield     string  format string for this component
246                 (see below)
247 decode  flag    decode text as RFC-2047 encoded
248                 header field
249 addrfield       flag    field contains addresses
250 datefield       flag    field contains dates
251 .fi
252 .RE
253 .PP
254 To specify the value of integer\-valued and string\-valued variables,
255 follow their name with an equals\-sign and the value.  Integer\-valued
256 variables are given decimal values, while string\-valued variables
257 are given arbitrary text bracketed by double\-quotes.  If a value is
258 suffixed by \*(lq/G\*(rq or \*(lq/L\*(rq, then its value is useful in
259 a global\-only or local\-only context (respectively).
260 .PP
261 A line of the form:
262 .PP
263 .RS 5
264 ignores=component,...
265 .RE
266 .PP
267 specifies a list of components which are never output.
268 .PP
269 The component \*(lqMessageName\*(rq (case\-insensitive) will output the
270 actual message name (file name) preceded by the folder name if one is
271 specified or found in the environment.  The format is identical to that
272 produced by the
273 .B \-header
274 option to
275 .BR show .
276 .PP
277 The component \*(lqExtras\*(rq will output all of the components of the
278 message which were not matched by explicit components, or included in
279 the ignore list.  If this component is not specified, an ignore list is
280 not needed since all non\-specified components will be ignored.
281 .PP
282 If \*(lqnocomponent\*(rq is NOT specified, then the component name will
283 be output as it appears in the format file.
284 .PP
285 The default format file is:
286 .PP
287 .RS 5
288 .nf
289 %mhl_format%
290 .fi
291 .RE
292 .PP
293 The variable \*(lqformatfield\*(rq specifies a format string (see
294 .BR mh\-format (5)).
295 The flag variables \*(lqaddrfield\*(rq and
296 \*(lqdatefield\*(rq (which are mutually exclusive), tell
297 .B mhl
298 to interpret the escapes in the format string as either addresses or
299 dates, respectively.
300 .PP
301 By default,
302 .B mhl
303 does not apply any formatting string to fields
304 containing address or dates (see
305 .BR mh\-mail (5)
306 for a list of these
307 fields).  Note that this results in faster operation since
308 .B mhl
309 must parse both addresses and dates in order to apply a format string
310 to them.  If desired,
311 .B mhl
312 can be given a default format string for
313 either address or date fields (but not both).  To do this, on a global
314 line specify: either the flag addrfield or datefield, along with the
315 appropriate formatfield variable string.
316
317 .SH FILES
318 .fc ^ ~
319 .nf
320 .ta \w'%etcdir%/ExtraBigFileName  'u
321 ^%etcdir%/mhl.format~^The message template
322 ^or <mh\-dir>/mhl.format~^Rather than the standard template
323 ^$HOME/\&.mh\(ruprofile~^The user profile
324 .fi
325
326 .SH "PROFILE COMPONENTS"
327 .fc ^ ~
328 .nf
329 .ta 2.4i
330 .ta \w'ExtraBigProfileName  'u
331 ^moreproc:~^Program to use as interactive front\-end
332 .fi
333
334 .SH "SEE ALSO"
335 show(1), ap(8), dp(8)
336
337 .SH DEFAULTS
338 .nf
339 .RB ` \-bell '
340 .RB ` \-noclear '
341 .RB ` \-length 40 '
342 .RB ` \-width 80 '
343 .fi
344
345 .SH CONTEXT
346 None
347
348 .SH BUGS
349 There should be some way to pass `bell' and `clear' information to the 
350 front\-end.
351 .PP
352 The \*(lqnonewline\*(rq option interacts badly with \*(lqcompress\*(rq
353 and \*(lqsplit\*(rq.