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