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