File: Scan-Line-Formats.html

package info (click to toggle)
mh-e 8.0.3-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 8,976 kB
  • ctags: 4,351
  • sloc: lisp: 18,183; makefile: 459; sh: 97
file content (416 lines) | stat: -rw-r--r-- 28,717 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
<html lang="en">
<head>
<title>Scan Line Formats - The MH-E Manual</title>
<meta http-equiv="Content-Type" content="text/html">
<meta name="description" content="The MH-E Manual">
<meta name="generator" content="makeinfo 4.8">
<link title="Top" rel="start" href="index.html#Top">
<link rel="prev" href="Miscellaneous.html#Miscellaneous" title="Miscellaneous">
<link rel="next" href="Procmail.html#Procmail" title="Procmail">
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
<!--
This is version 8.0.3 of `The MH-E
Manual', last updated 2006-11-12.

Copyright (C) 1995, 2001, 2002, 2003, 2005, 2006 Free
Software Foundation, Inc.

     The MH-E manual is free documentation; you can redistribute it
     and/or modify it under the terms of either:

       a. the GNU Free Documentation License, Version 1.2 or any later
          version published by the Free Software Foundation; with no
          Invariant Sections, no Front-Cover Texts, and no Back-Cover
          Texts.

       b. the GNU General Public License as published by the Free
          Software Foundation; either version 2, or (at your option)
          any later version.
     The MH-E manual is distributed in the hope that it will be useful,
     but WITHOUT ANY WARRANTY; without even the implied warranty of
     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
     General Public License or GNU Free Documentation License for more
     details.

     The GNU General Public License and the GNU Free Documentation
     License appear as appendices to this document. You may also
     request copies by writing to the Free Software Foundation, Inc.,
     51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
   -->
<meta http-equiv="Content-Style-Type" content="text/css">
<style type="text/css"><!--
  pre.display { font-family:inherit }
  pre.format  { font-family:inherit }
  pre.smalldisplay { font-family:inherit; font-size:smaller }
  pre.smallformat  { font-family:inherit; font-size:smaller }
  pre.smallexample { font-size:smaller }
  pre.smalllisp    { font-size:smaller }
  span.sc    { font-variant:small-caps }
  span.roman { font-family:serif; font-weight:normal; } 
  span.sansserif { font-family:sans-serif; font-weight:normal; } 
--></style>
</head>
<body>
<div class="node">
<p>
<a name="Scan-Line-Formats"></a>
Next:&nbsp;<a rel="next" accesskey="n" href="Procmail.html#Procmail">Procmail</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="Miscellaneous.html#Miscellaneous">Miscellaneous</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="index.html#Top">Top</a>
<hr>
</div>

<h2 class="appendix">Appendix A Scan Line Formats</h2>

<p><a name="index-scan-line-formats-2076"></a>
This appendix discusses how MH-E creates, parses, and manipulates scan
lines. If you have your own MH scan or inc format files, you
<strong>can</strong> teach MH-E how to handle them, but it isn't easy as
you'll see.

   <p><a name="index-g_t_0040samp_007bmh_002dscan_002dline_002dformats_007d-customization-group-2077"></a><a name="index-customization-group_002c-_0040samp_007bmh_002dscan_002dline_002dformats_007d-2078"></a>
This table lists the options in the `<samp><span class="samp">mh-scan-line-formats</span></samp>'
customization group.

     <dl>
<dt><code>mh-adaptive-cmd-note-flag</code><a name="index-mh_002dadaptive_002dcmd_002dnote_002dflag-2079"></a><dd>On means that the message number width is determined dynamically
(default: `<samp><span class="samp">on</span></samp>'). 
<!--  -->
<br><dt><code>mh-scan-format-file</code><a name="index-mh_002dscan_002dformat_002dfile-2080"></a><dd>Specifies the format file to pass to the scan program (default:
`<samp><span class="samp">Use MH-E scan Format</span></samp>'). 
<!--  -->
<br><dt><code>mh-scan-prog</code><a name="index-mh_002dscan_002dprog-2081"></a><dd>Program used to scan messages (default: <code>"scan"</code>). 
</dl>

   <p><a name="index-mh_002dadaptive_002dcmd_002dnote_002dflag-2082"></a>
There are a couple of caveats when creating your own scan format file. 
First, MH-E will not work if your scan lines do not include message
numbers. It will work poorly if you don't dedicate a column for
showing the current message and notations. You won't be able to use
the option <code>mh-adaptive-cmd-note-flag</code> or the threading features
(see <a href="Threading.html#Threading">Threading</a>).

   <p><a name="index-message-numbers-2083"></a><a name="index-mh_002dset_002dcmd_002dnote-2084"></a><a name="index-mh_002dadaptive_002dcmd_002dnote_002dflag-2085"></a><a name="index-mh_002dscan_002dformat_002dfile-2086"></a>
If you've created your own format to handle long message numbers,
you'll be pleased to know you no longer need it since MH-E adapts its
internal format based upon the largest message number if
<code>mh-adaptive-cmd-note-flag</code> is on (the default). If you prefer
fixed-width message numbers, turn off <code>mh-adaptive-cmd-note-flag</code>
and call <code>mh-set-cmd-note</code> with the width specified by your
format file (see <code>mh-scan-format-file</code>). For example, the default
width is 4, so you would use `<samp><span class="samp">(mh-set-cmd-note 4)</span></samp>'.

   <p><a name="index-mh_002dadaptive_002dcmd_002dnote_002dflag-2087"></a><a name="index-mh_002dscan_002dformat_002dfile-2088"></a><a name="index-mh_002dscan_002dformat_002dmh-2089"></a><a name="index-mh_002dscan_002dformat_002dnmh-2090"></a>
The default setting for <code>mh-scan-format-file</code> is `<samp><span class="samp">Use MH-E
scan Format</span></samp>'. This means that the format string will be taken from the
either <code>mh-scan-format-mh</code> or <code>mh-scan-format-nmh</code> depending
on whether MH or nmh (or GNU mailutils) is in use. This setting also
enables you to turn on the option <code>mh-adaptive-cmd-note-flag</code>. 
You can also set this option to `<samp><span class="samp">Use Default scan Format</span></samp>' to get
the same output as you would get if you ran <samp><span class="command">scan</span></samp> from the
shell. If you have a format file that you want MH-E to use but not MH,
you can set this option to `<samp><span class="samp">Specify a scan Format File</span></samp>' and enter
the name of your format file.

   <p><a name="index-mh_002dscan_002dformat_002dfile-2091"></a><a name="index-mh_002dscan_002dformat_002dmh-2092"></a><a name="index-mh_002dscan_002dformat_002dnmh-2093"></a>
The scan format that MH-E uses when <code>mh-scan-format-file</code> is set
to its default of `<samp><span class="samp">Use MH-E scan Format</span></samp>' is held in the variables
<code>mh-scan-format-nmh</code> and <code>mh-scan-format-mh</code> depending on
whether you are using nmh (or GNU mailutils) or not. Typically, you
create your own format files rather than modifying these variables. 
The value of <code>mh-scan-format-nmh</code> is:

<pre class="smallexample">     (concat
      "%4(msg)"
      "%&lt;(cur)+%| %&gt;"
      "%&lt;{replied}-"
      "%?(nonnull(comp{to}))%&lt;(mymbox{to})t%&gt;"
      "%?(nonnull(comp{cc}))%&lt;(mymbox{cc})c%&gt;"
      "%?(nonnull(comp{bcc}))%&lt;(mymbox{bcc})b%&gt;"
      "%?(nonnull(comp{newsgroups}))n%&gt;"
      "%&lt;(zero) %&gt;"
      "%02(mon{date})/%02(mday{date})%&lt;{date} %|*%&gt;"
      "%&lt;(mymbox{from})%&lt;{to}To:%14(decode(friendly{to}))%&gt;%&gt;"
      "%&lt;(zero)%17(decode(friendly{from}))%&gt;  "
      "%(decode{subject})%&lt;{body}&lt;&lt;%{body}%&gt;")
</pre>
   <p><a name="index-decoding-RFC-2047-2094"></a><a name="index-RFC-2047_002c-decoding-2095"></a><a name="index-mh_002dscan_002dformat_002dmh-2096"></a>
The setting for <code>mh-scan-format-mh</code> is similar, except that MH
doesn't have the function <code>decode</code> (which is used to decode RFC
2047 encodings).

   <p><a name="index-notations_002c-scan-line-2097"></a><a name="index-scan-line-notations-2098"></a>
These strings are passed to the <samp><span class="command">scan</span></samp> program via the
<samp><span class="option">-format</span></samp> argument. The formats are identical to the defaults
except that additional hints for fontification have been added to the
existing notations in the fifth column (remember that in Emacs, the
columns start at 0). The values of the fifth column, in priority
order, are: `<samp><span class="samp">-</span></samp>' if the message has been replied to, `<samp><span class="samp">t</span></samp>' if
an address in the `<samp><span class="samp">To:</span></samp>' field matches one of the mailboxes of the
current user, `<samp><span class="samp">c</span></samp>' if the `<samp><span class="samp">Cc:</span></samp>' field matches, `<samp><span class="samp">b</span></samp>' if
the `<samp><span class="samp">Bcc:</span></samp>' field matches, and `<samp><span class="samp">n</span></samp>' if a non-empty
`<samp><span class="samp">Newsgroups:</span></samp>' field is present.

   <p><a name="index-g_t_0040command_007bscan_007d-2099"></a><a name="index-MH-commands_002c-_0040command_007bscan_007d-2100"></a><a name="index-mh_002dprogs-2101"></a><a name="index-mh_002dscan_002dprog-2102"></a>
The name of the program that generates a listing of one line per
message is held in <code>mh-scan-prog</code> (default: <code>"scan"</code>). 
Unless this variable contains an absolute pathname, it is assumed to
be in the <code>mh-progs</code> directory (see <a href="Getting-Started.html#Getting-Started">Getting Started</a>). You may
link another program to <samp><span class="command">scan</span></samp> (see `<samp><span class="samp">mh-profile</span></samp>'(5)) to
produce a different type of listing<a rel="footnote" href="#fn-1" name="fnd-1"><sup>1</sup></a>.

   <p><a name="index-regular-expressions_002c-scan-line-formats-2103"></a><a name="index-mh_002dset_002dcmd_002dnote-2104"></a><a name="index-setq-2105"></a>
If you change the format of the scan lines you'll need to tell MH-E
how to parse the new format. As you will see, quite a lot of variables
are involved to do that. Use <kbd>M-x apropos &lt;RET&gt;
mh-scan.*regexp &lt;RET&gt;</kbd> to obtain a list of these variables. You
will also have to call <code>mh-set-cmd-note</code> if your notations are
not in column 4 (columns in Emacs start with 0). Note that unlike most
of the user options described in this manual, these are variables and
must be set with <code>setq</code> instead of in a customization buffer. For
help with regular expressions, see
section
<a href="http://www.gnu.org/software/emacs/manual/html_node/Regexps.html">Syntax of Regular Expressions</a> in <cite>The GNU Emacs Manual</cite>.

   <p>The first variable has to do with pruning out garbage.

     
<a name="index-g_t_0040command_007binc_007d-2106"></a>
<a name="index-MH-commands_002c-_0040command_007binc_007d-2107"></a>
<a name="index-g_t_0040command_007bscan_007d-2108"></a>
<a name="index-MH-commands_002c-_0040command_007bscan_007d-2109"></a>
<dl><dt><code>mh-scan-valid-regexp</code><a name="index-mh_002dscan_002dvalid_002dregexp-2110"></a><dd>This regular expression describes a valid scan line. This is used to
eliminate error messages that are occasionally produced by
<samp><span class="command">inc</span></samp><a rel="footnote" href="#fn-2" name="fnd-2"><sup>2</sup></a> or <samp><span class="command">scan</span></samp> (default: <code>"^ *[0-9]"</code>). 
</dl>

   <p>Next, many variables control how the scan lines are parsed.

     
<a name="index-mh_002dfolder_002dbody-2111"></a>
<a name="index-mh_002dfolder_002dfont_002dlock_002dkeywords-2112"></a>
<dl><dt><code>mh-scan-body-regexp</code><a name="index-mh_002dscan_002dbody_002dregexp-2113"></a><dd>This regular expression matches the message body fragment. Note that
the default setting of <code>mh-folder-font-lock-keywords</code> expects
this expression to contain at least one parenthesized expression which
matches the body text as in the default of
<code>"\\(&lt;&lt;\\([^\n]+\\)?\\)"</code>. If this regular expression is not
correct, the body fragment will not be highlighted with the face
<code>mh-folder-body</code>. 
<!--  -->
<a name="index-mh_002dfolder_002dcur_002dmsg_002dnumber-2114"></a><a name="index-mh_002dfolder_002dfont_002dlock_002dkeywords-2115"></a><a name="index-mh_002dnote_002dcur-2116"></a><br><dt><code>mh-scan-cur-msg-number-regexp</code><a name="index-mh_002dscan_002dcur_002dmsg_002dnumber_002dregexp-2117"></a><dd>This regular expression matches the current message. It must match
from the beginning of the line. Note that the default setting of
<code>mh-folder-font-lock-keywords</code> expects this expression to contain
at least one parenthesized expression which matches the message number
as in the default of <code>"^\\(&nbsp;*[0-9]+\\+\\).*"</code><!-- /@w -->. This
expression includes the leading space and current message marker
`<samp><span class="samp">+</span></samp>' within the parenthesis since it looks better to highlight
these items as well. The highlighting is done with the face
<code>mh-folder-cur-msg-number</code>. This regular expression should be
correct as it is needed by non-fontification functions. See also
<code>mh-note-cur</code>. 
<!--  -->
<a name="index-mh_002dfolder_002ddate-2118"></a><a name="index-mh_002dfolder_002dfont_002dlock_002dkeywords-2119"></a><a name="index-mh_002dscan_002dsent_002dto_002dme_002dsender_002dregexp-2120"></a><br><dt><code>mh-scan-date-regexp</code><a name="index-mh_002dscan_002ddate_002dregexp-2121"></a><dd>This regular expression matches a valid date. It must <strong>not</strong> be
anchored to the beginning or the end of the line. Note that the
default setting of <code>mh-folder-font-lock-keywords</code> expects this
expression to contain only one parenthesized expression which matches
the date field as in the default of
<code>"\\([0-9][0-9]/[0-9][0-9]\\)"</code>. If this regular expression is
not correct, the date will not be highlighted with the face
<code>mh-folder-date</code>. 
<!--  -->
<a name="index-mh_002dfolder_002ddeleted-2122"></a><a name="index-mh_002dfolder_002dfont_002dlock_002dkeywords-2123"></a><a name="index-mh_002dnote_002ddeleted-2124"></a><br><dt><code>mh-scan-deleted-msg-regexp</code><a name="index-mh_002dscan_002ddeleted_002dmsg_002dregexp-2125"></a><dd>This regular expression matches deleted messages. It must match from
the beginning of the line. Note that the default setting of
<code>mh-folder-font-lock-keywords</code> expects this expression to contain
at least one parenthesized expression which matches the message number
as in the default of <code>"^\\( *[0-9]+\\)D"</code>. This expression
includes the leading space within the parenthesis since it looks
better to highlight it as well. The highlighting is done with the face
<code>mh-folder-deleted</code>. This regular expression should be correct as
it is needed by non-fontification functions. See also
<code>mh-note-deleted</code>. 
<!--  -->
<a name="index-mh_002dfolder_002dfont_002dlock_002dkeywords-2126"></a><a name="index-mh_002dfolder_002dmsg_002dnumber-2127"></a><br><dt><code>mh-scan-good-msg-regexp</code><a name="index-mh_002dscan_002dgood_002dmsg_002dregexp-2128"></a><dd>This regular expression matches &ldquo;good&rdquo; messages. It must match from
the beginning of the line. Note that the default setting of
<code>mh-folder-font-lock-keywords</code> expects this expression to contain
at least one parenthesized expression which matches the message number
as in the default of <code>"^\\(&nbsp;*[0-9]+\\)[^D^0-9]"</code><!-- /@w -->. This
expression includes the leading space within the parenthesis since it
looks better to highlight it as well. The highlighting is done with
the face <code>mh-folder-msg-number</code>. This regular expression should
be correct as it is needed by non-fontification functions. 
<!--  -->
<a name="index-mh_002dscan_002dformat_002dfile-2129"></a><br><dt><code>mh-scan-msg-format-regexp</code><a name="index-mh_002dscan_002dmsg_002dformat_002dregexp-2130"></a><dd>This regular expression finds the message number width in a scan
format. Note that the message number must be placed in a parenthesized
expression as in the default of <code>"%\\([0-9]*\\)(msg)"</code>. This
variable is only consulted if <code>mh-scan-format-file</code> is set to
`<samp><span class="samp">Use MH-E scan Format</span></samp>'. 
<!--  -->
<a name="index-mh_002dscan_002dformat_002dfile-2131"></a><br><dt><code>mh-scan-msg-format-string</code><a name="index-mh_002dscan_002dmsg_002dformat_002dstring-2132"></a><dd>This is a format string for the width of the message number in a scan
format. Use `<samp><span class="samp">0%d</span></samp>' for zero-filled message numbers. This variable
is only consulted if <code>mh-scan-format-file</code> is set to `<samp><span class="samp">Use
MH-E scan Format</span></samp>' (default: <code>"%d"</code>). 
<!--  -->
<br><dt><code>mh-scan-msg-number-regexp</code><a name="index-mh_002dscan_002dmsg_002dnumber_002dregexp-2133"></a><dd>This regular expression extracts the message number. It must match
from the beginning of the line. Note that the message number must be
placed in a parenthesized expression as in the default of <code>"^&nbsp;*\\([0-9]+\\)"</code><!-- /@w -->. 
<!--  -->
<br><dt><code>mh-scan-msg-overflow-regexp</code><a name="index-mh_002dscan_002dmsg_002doverflow_002dregexp-2134"></a><dd>This regular expression matches overflowed message numbers (default:
<code>"^[?0-9][0-9]"</code>). 
<!--  -->
<br><dt><code>mh-scan-msg-search-regexp</code><a name="index-mh_002dscan_002dmsg_002dsearch_002dregexp-2135"></a><dd>This regular expression matches a particular message. It is a format
string; use `<samp><span class="samp">%d</span></samp>' to represent the location of the message number
within the expression as in the default of <code>"^[^0-9]*%d[^0-9]"</code>. 
<!--  -->
<a name="index-mh_002dfolder_002daddress-2136"></a><a name="index-mh_002dfolder_002dfont_002dlock_002dkeywords-2137"></a><a name="index-mh_002dfolder_002dto-2138"></a><br><dt><code>mh-scan-rcpt-regexp</code><a name="index-mh_002dscan_002drcpt_002dregexp-2139"></a><dd>This regular expression specifies the recipient in messages you sent. 
Note that the default setting of <code>mh-folder-font-lock-keywords</code>
expects this expression to contain two parenthesized expressions. The
first is expected to match the `<samp><span class="samp">To:</span></samp>' that the default scan format
file generates. The second is expected to match the recipient's name
as in the default of <code>"\\(To:\\)\\(..............\\)"</code>. If this
regular expression is not correct, the `<samp><span class="samp">To:</span></samp>' string will not be
highlighted with the face <code>mh-folder-to</code> and the recipient will not be
highlighted with the face <code>mh-folder-address</code>. 
<!--  -->
<a name="index-mh_002dfolder_002dfont_002dlock_002dkeywords-2140"></a><a name="index-mh_002dfolder_002drefiled-2141"></a><a name="index-mh_002dnote_002drefiled-2142"></a><br><dt><code>mh-scan-refiled-msg-regexp</code><a name="index-mh_002dscan_002drefiled_002dmsg_002dregexp-2143"></a><dd>This regular expression matches refiled messages. It must match from
the beginning of the line. Note that the default setting of
<code>mh-folder-font-lock-keywords</code> expects this expression to contain
at least one parenthesized expression which matches the message number
as in the default of <code>"^\\(&nbsp;*[0-9]+\\)\\^"</code><!-- /@w -->. This expression
includes the leading space within the parenthesis since it looks
better to highlight it as well. The highlighting is done with the face
<code>mh-folder-refiled</code>. This regular expression should be correct as
it is needed by non-fontification functions. See also
<code>mh-note-refiled</code>. 
<!--  -->
<a name="index-mh_002dfolder_002dfont_002dlock_002dkeywords-2144"></a><a name="index-mh_002dfolder_002dsent_002dto_002dme_002dsender-2145"></a><a name="index-mh_002dmh_002dfolder_002dsent_002dto_002dme_002dhint-2146"></a><a name="index-mh_002dscan_002dformat_002dnmh-2147"></a><br><dt><code>mh-scan-sent-to-me-sender-regexp</code><a name="index-mh_002dscan_002dsent_002dto_002dme_002dsender_002dregexp-2148"></a><dd>This regular expression matches messages sent to us. Note that the
default setting of <code>mh-folder-font-lock-keywords</code> expects this
expression to contain at least two parenthesized expressions. The
first should match the fontification hint (see
<code>mh-scan-format-nmh</code>) and the second should match the user name
as in the default of
<code>"^&nbsp;*[0-9]+.\\([bct]\\).....[&nbsp;]*\\(..................\\)"</code><!-- /@w -->. 
If this regular expression is not correct, the notation hints will not
be highlighted with the face <code>mh-mh-folder-sent-to-me-hint</code> and
the sender will not be highlighted with the face
<code>mh-folder-sent-to-me-sender</code>. 
<!--  -->
<a name="index-mh_002dfolder_002dfollowup-2149"></a><a name="index-mh_002dfolder_002dfont_002dlock_002dkeywords-2150"></a><a name="index-mh_002dfolder_002dsubject-2151"></a><br><dt><code>mh-scan-subject-regexp</code><a name="index-mh_002dscan_002dsubject_002dregexp-2152"></a><dd>This regular expression matches the subject. It must match from the
beginning of the line. Note that the default setting of
`<samp><span class="samp">mh-folder-font-lock-keywords</span></samp>' expects this expression to contain
at least three parenthesized expressions. The first is expected to
match the `<samp><span class="samp">Re:</span></samp>' string, if any, and is highlighted with the face
<code>mh-folder-followup</code>. The second matches an optional bracketed
number after `<samp><span class="samp">Re:</span></samp>', such as in `<samp><span class="samp">Re[2]:</span></samp>' (and is thus a
sub-expression of the first expression). The third is expected to
match the subject line itself which is highlighted with the face
<code>mh-folder-subject</code>. For example, the default is
<code>"^&nbsp;*[0-9]+........[&nbsp;]*...................</code><!-- /@w --><br>
<code>\\([Rr][Ee]\\(\\[[0-9]+\\]\\)?:\\s-*\\)*\\([^&lt;\n]*\\)"</code><!-- /@w -->. 
This regular expression should be correct as it is needed by
non-fontification functions. Note that this example is broken up on
two lines for readability, but is actually a single string. 
</dl>

   <p>Finally, there are a slew of variables that control how MH-E annotates
the scan lines.

     
<a name="index-mh_002dset_002dcmd_002dnote-2153"></a>
<a name="index-mh_002dadaptive_002dcmd_002dnote_002dflag-2154"></a>
<dl><dt><code>mh-cmd-note</code><a name="index-mh_002dcmd_002dnote-2155"></a><dd>Column for notations (default: 4). This variable should be set with
the function <code>mh-set-cmd-note</code>. This variable may be updated
dynamically if <code>mh-adaptive-cmd-note-flag</code> is on. The following
variables contain the notational characters. Note that columns in
Emacs start with 0. 
<!--  -->
<br><dt><code>mh-note-copied</code><a name="index-mh_002dnote_002dcopied-2156"></a><dd>Messages that have been copied are marked by this character (default:
<code>?C</code>). 
<!--  -->
<a name="index-mh_002dscan_002dcur_002dmsg_002dnumber_002dregexp-2157"></a><br><dt><code>mh-note-cur</code><a name="index-mh_002dnote_002dcur-2158"></a><dd>The current message (in MH, not in MH-E) is marked by this character
(default: <code>?+</code>). See also <code>mh-scan-cur-msg-number-regexp</code>. 
<!--  -->
<a name="index-mh_002dscan_002ddeleted_002dmsg_002dregexp-2159"></a><br><dt><code>mh-note-deleted</code><a name="index-mh_002dnote_002ddeleted-2160"></a><dd>Messages that have been deleted are marked by this character (default:
<code>?D</code>). See also <code>mh-scan-deleted-msg-regexp</code>. 
<!--  -->
<br><dt><code>mh-note-dist</code><a name="index-mh_002dnote_002ddist-2161"></a><dd>Messages that have been redistributed are marked by this character
(default: <code>?R</code>). 
<!--  -->
<br><dt><code>mh-note-forw</code><a name="index-mh_002dnote_002dforw-2162"></a><dd>Messages that have been forwarded are marked by this character
(default: <code>?F</code>). 
<!--  -->
<br><dt><code>mh-note-printed</code><a name="index-mh_002dnote_002dprinted-2163"></a><dd>Messages that have been printed are marked by this character (default:
<code>?P</code>). 
<!--  -->
<a name="index-mh_002dscan_002drefiled_002dmsg_002dregexp-2164"></a><br><dt><code>mh-note-refiled</code><a name="index-mh_002dnote_002drefiled-2165"></a><dd>Messages that have been refiled are marked by this character (default:
<code>?^</code>). See also <code>mh-scan-refiled-msg-regexp</code>. 
<!--  -->
<br><dt><code>mh-note-repl</code><a name="index-mh_002dnote_002drepl-2166"></a><dd>Messages that have been replied to are marked by this character
(default: <code>?-</code>). 
<!--  -->
<br><dt><code>mh-note-seq</code><a name="index-mh_002dnote_002dseq-2167"></a><dd>Messages in a user-defined sequence are marked by this character
(default: <code>?%</code>). Messages in the `<samp><span class="samp">search</span></samp>' sequence are
marked by this character as well. 
</dl>

   <p>For example, let's say I have the following in <samp><span class="file">scan.format</span></samp>
which displays the sender, the subject, and the message number. This
format places a `<samp><span class="samp">+</span></samp>' after the message number for the current
message according to MH; it also uses that column for notations.

<pre class="smallexample">     %20(decode(friendly{from})) %50(decode{subject})  %4(msg)%&lt;(cur)+%| %&gt;
</pre>
   <p><a name="index-mh_002dadaptive_002dcmd_002dnote_002dflag-2168"></a><a name="index-mh_002dscan_002dformat_002dfile-2169"></a><a name="index-mh_002dscan_002dformat_002dfile_002c-example-2170"></a>
The first thing you have to do is tell MH-E to use this file. 
Customize <code>mh-scan-format-file</code> and set its value to `<samp><span class="samp">Use
Default scan Format</span></samp>'. If you didn't get already turn off
<code>mh-adaptive-cmd-note-flag</code>, you'll need to do that first.

   <p>Next, tell MH-E what a valid scan line looks like so that you can at
least display the output of scan in your MH-Folder buffer.

   <p><a name="index-mh_002dscan_002dvalid_002dregexp_002c-example-2171"></a>
<pre class="smalllisp">     (setq mh-scan-valid-regexp "[0-9]+[+D^ ]$")
</pre>
   <p>Now, in order to get rid of the `<samp><span class="samp">Cursor not pointing to message</span></samp>'
message, you need to tell MH-E how to access the message number. You
should also see why MH-E requires that you include a message number in
the first place.

   <p><a name="index-mh_002dscan_002dmsg_002dnumber_002dregexp_002c-example-2172"></a><a name="index-mh_002dscan_002dmsg_002dsearch_002dregexp_002c-example-2173"></a>
<pre class="smalllisp">     (setq mh-scan-msg-number-regexp "^.* \\([0-9]+\\)[+D^ ]$")
     (setq mh-scan-msg-search-regexp " %d[+D^ ]$")
</pre>
   <p>In order to get the next and previous commands working, add this.

   <p><a name="index-mh_002dscan_002dgood_002dmsg_002dregexp_002c-example-2174"></a>
<pre class="smalllisp">     (setq mh-scan-good-msg-regexp "^.* \\([0-9]+\\)[+D^ ]$")
</pre>
   <p>Note that the current message isn't marked with a `<samp><span class="samp">+</span></samp>' when moving
between the next and previous messages. Here is the code required to
get this working.

   <p><a name="index-set_002dmh_002dcmd_002dnote_002c-example-2175"></a><a name="index-mh_002dscan_002dcur_002dmsg_002dnumber_002dregexp_002c-example-2176"></a>
<pre class="smalllisp">     (set-mh-cmd-note 76)
     (setq mh-scan-cur-msg-number-regexp "^.* \\([0-9]+\\)\\+$")
</pre>
   <p>Finally, add the following to delete and refile messages.

   <p><a name="index-mh_002dscan_002ddeleted_002dmsg_002dregexp_002c-example-2177"></a><a name="index-mh_002dscan_002drefiled_002dmsg_002dregexp_002c-example-2178"></a>
<pre class="smalllisp">     (setq mh-scan-deleted-msg-regexp "^.* \\([0-9]+\\)D$")
     (setq mh-scan-refiled-msg-regexp "^.* \\([0-9]+\\)\\^$")
</pre>
   <p>This is just a bare minimum; it's best to adjust all of the regular
expressions to ensure that MH-E and highlighting perform well.

   <div class="footnote">
<hr>
<h4>Footnotes</h4><p class="footnote"><small>[<a name="fn-1" href="#fnd-1">1</a>]</small> See the section
<a href="http://rand-mh.sourceforge.net/book/mh/faswsprs.html">Find and Specify with scan pick Ranges Sequences</a> in the MH book.</p>

   <p class="footnote"><small>[<a name="fn-2" href="#fnd-2">2</a>]</small> See the section
<a href="http://rand-mh.sourceforge.net/book/mh/reapre.html">Reading Mail: inc show next prev</a> in the MH book.</p>

   <p><hr></div>

   </body></html>