Create "nowrap" flag to turn off all line wrapping.
[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 wrap    flag    Wrap lines that exceed width (default)
239 nowrap  flag    Do not perform line wrapping
240 split   flag    don't combine multiple fields into
241                 a single field
242 nosplit flag    combine multiple fields into
243                 a single field
244 newline flag    print newline at end of components
245                 (this is the default)
246 nonewline       flag    don't print newline at end of components
247 formatfield     string  format string for this component
248                 (see below)
249 decode  flag    decode text as RFC-2047 encoded
250                 header field
251 addrfield       flag    field contains addresses
252 datefield       flag    field contains dates
253 .fi
254 .RE
255 .PP
256 To specify the value of integer\-valued and string\-valued variables,
257 follow their name with an equals\-sign and the value.  Integer\-valued
258 variables are given decimal values, while string\-valued variables
259 are given arbitrary text bracketed by double\-quotes.  If a value is
260 suffixed by \*(lq/G\*(rq or \*(lq/L\*(rq, then its value is useful in
261 a global\-only or local\-only context (respectively).
262 .PP
263 A line of the form:
264 .PP
265 .RS 5
266 ignores=component,...
267 .RE
268 .PP
269 specifies a list of components which are never output.
270 .PP
271 The component \*(lqMessageName\*(rq (case\-insensitive) will output the
272 actual message name (file name) preceded by the folder name if one is
273 specified or found in the environment.  The format is identical to that
274 produced by the
275 .B \-header
276 option to
277 .BR show .
278 .PP
279 The component \*(lqExtras\*(rq will output all of the components of the
280 message which were not matched by explicit components, or included in
281 the ignore list.  If this component is not specified, an ignore list is
282 not needed since all non\-specified components will be ignored.
283 .PP
284 If \*(lqnocomponent\*(rq is NOT specified, then the component name will
285 be output as it appears in the format file.
286 .PP
287 The default format file is:
288 .PP
289 .RS 5
290 .nf
291 %mhl_format%
292 .fi
293 .RE
294 .PP
295 The variable \*(lqformatfield\*(rq specifies a format string (see
296 .BR mh\-format (5)).
297 The flag variables \*(lqaddrfield\*(rq and
298 \*(lqdatefield\*(rq (which are mutually exclusive), tell
299 .B mhl
300 to interpret the escapes in the format string as either addresses or
301 dates, respectively.
302 .PP
303 By default,
304 .B mhl
305 does not apply any formatting string to fields
306 containing address or dates (see
307 .BR mh\-mail (5)
308 for a list of these
309 fields).  Note that this results in faster operation since
310 .B mhl
311 must parse both addresses and dates in order to apply a format string
312 to them.  If desired,
313 .B mhl
314 can be given a default format string for
315 either address or date fields (but not both).  To do this, on a global
316 line specify: either the flag addrfield or datefield, along with the
317 appropriate formatfield variable string.
318
319 .SH FILES
320 .fc ^ ~
321 .nf
322 .ta \w'%etcdir%/ExtraBigFileName  'u
323 ^%etcdir%/mhl.format~^The message template
324 ^or <mh\-dir>/mhl.format~^Rather than the standard template
325 ^$HOME/\&.mh\(ruprofile~^The user profile
326 .fi
327
328 .SH "PROFILE COMPONENTS"
329 .fc ^ ~
330 .nf
331 .ta 2.4i
332 .ta \w'ExtraBigProfileName  'u
333 ^moreproc:~^Program to use as interactive front\-end
334 .fi
335
336 .SH "SEE ALSO"
337 show(1), ap(8), dp(8)
338
339 .SH DEFAULTS
340 .nf
341 .RB ` \-bell '
342 .RB ` \-noclear '
343 .RB ` \-length 40 '
344 .RB ` \-width 80 '
345 .fi
346
347 .SH CONTEXT
348 None
349
350 .SH BUGS
351 There should be some way to pass `bell' and `clear' information to the 
352 front\-end.
353 .PP
354 The \*(lqnonewline\*(rq option interacts badly with \*(lqcompress\*(rq
355 and \*(lqsplit\*(rq.