]> code.delx.au - gnu-emacs/blob - doc/misc/mh-e.texi
Change all occurrences of "Mouse-[0-9]" to "mouse-[0-9]"
[gnu-emacs] / doc / misc / mh-e.texi
1 \input texinfo @c -*- mode: texinfo; coding: utf-8; -*-
2 @c
3 @c Note: This document requires makeinfo version 4.6 or greater to build.
4 @c
5 @c %**start of header
6 @setfilename ../../info/mh-e.info
7 @settitle The MH-E Manual
8 @include docstyle.texi
9 @c %**end of header
10
11 @c Version of the software and manual.
12 @set VERSION 8.5
13 @c Edition of the manual. It is either empty for the first edition or
14 @c has the form ", nth Edition" (without the quotes).
15 @set EDITION
16 @set UPDATED 2013-03-02
17 @set UPDATE-MONTH March, 2013
18
19 @c Other variables.
20 @set MH-BOOK-HOME http://rand-mh.sourceforge.net/book/mh
21 @set MH-E-HOME http://mh-e.sourceforge.net/
22
23 @c Copyright
24 @copying
25 This is version @value{VERSION}@value{EDITION} of @cite{The MH-E
26 Manual}, last updated @value{UPDATED}.
27
28 Copyright @copyright{} 1995, 2001--2003, 2005--2016 Free Software
29 Foundation, Inc.
30
31 @c This dual license has been agreed upon by the FSF.
32
33 @quotation
34 Permission is granted to copy, distribute and/or modify this document
35 under the terms of either:
36
37 @enumerate a
38 @item
39 the GNU Free Documentation License, Version 1.3 or any later version
40 published by the Free Software Foundation; with no Invariant Sections,
41 with the Front-Cover Texts being ``A GNU Manual,'' and with the
42 Back-Cover Texts as in (a) below. A copy of the license is included in
43 the section entitled ``GNU Free Documentation License.''
44
45 (a) The FSF's Back-Cover Text is: ``You have the freedom to copy and
46 modify this GNU manual.''
47
48 @item
49 the GNU General Public License as published by the Free Software
50 Foundation; either version 3, or (at your option) any later version. A
51 copy of the license is included in the section entitled ``GNU General
52 Public License.''
53 @end enumerate
54
55 @end quotation
56 @end copying
57
58 @c Info Directory Entry
59 @dircategory Emacs network features
60 @direntry
61 * MH-E: (mh-e). Emacs interface to the MH mail system.
62 @end direntry
63
64 @c Title Page
65 @titlepage
66 @title The MH-E Manual
67 @subtitle Version @value{VERSION}@value{EDITION}
68 @subtitle @value{UPDATE-MONTH}
69 @author Bill Wohler
70
71 @c Copyright Page
72 @page
73 @vskip 0pt plus 1filll
74 @insertcopying
75 @end titlepage
76
77 @ifnottex
78 @html
79 <!--
80 @end html
81 @node Top, Preface, (dir), (dir)
82 @top The MH-E Manual
83 @html
84 -->
85 @end html
86 @insertcopying
87 @end ifnottex
88
89 @c Table of Contents
90 @contents
91
92 @html
93 <!--
94 @end html
95
96 @menu
97 * Preface:: Preface
98 * Conventions:: GNU Emacs Terms and Conventions
99 * Getting Started:: Getting Started
100 * Tour Through MH-E:: Tour Through MH-E
101 * Using This Manual:: Using This Manual
102 * Incorporating Mail:: Incorporating Mail
103 * Reading Mail:: Reading Mail
104 * Folders:: Organizing Your Mail with Folders
105 * Sending Mail:: Sending Mail
106 * Editing Drafts:: Editing a Draft
107 * Aliases:: Aliases
108 * Identities:: Identities
109 * Speedbar:: The Speedbar
110 * Menu Bar:: The Menu Bar
111 * Tool Bar:: The Tool Bar
112 * Searching:: Searching Through Messages
113 * Threading:: Viewing Message Threads
114 * Limits:: Limiting Display
115 * Sequences:: Using Sequences
116 * Junk:: Dealing With Junk Mail
117 * Miscellaneous:: Miscellaneous Commands, Variables, and Buffers
118 * Scan Line Formats:: Scan Line Formats
119 * Procmail:: Reading Mailing Lists Effectively
120 * Odds and Ends:: Odds and Ends
121 * History:: History of MH-E
122 * GFDL:: GNU Free Documentation License
123 * GPL:: GNU General Public License
124 * Key Index:: Key (Character) Index
125 * Command Index:: Command Index
126 * Option Index:: Option (Variable) Index
127 * Concept Index:: Concept Index
128
129 @detailmenu
130 --- The Detailed Node Listing ---
131
132 Tour Through MH-E
133
134 * Sending Mail Tour::
135 * Reading Mail Tour::
136 * Processing Mail Tour::
137 * Leaving MH-E::
138 * More About MH-E::
139
140 Using This Manual
141
142 * Options::
143 * Ranges::
144 * Folder Selection::
145
146 Reading Your Mail
147
148 * Viewing::
149 * Viewing Attachments::
150 * HTML::
151 * Digests::
152 * Reading PGP::
153 * Printing::
154 * Files and Pipes::
155 * Navigating::
156 * Miscellaneous Commands and Options::
157
158 Sending Mail
159
160 * Composing::
161 * Replying::
162 * Forwarding::
163 * Redistributing::
164 * Editing Again::
165
166 Editing a Draft
167
168 * Editing Message::
169 * Inserting Letter::
170 * Inserting Messages::
171 * Signature::
172 * Picture::
173 * Adding Attachments::
174 * Sending PGP::
175 * Checking Recipients::
176 * Sending Message::
177 * Killing Draft::
178
179 Odds and Ends
180
181 * Bug Reports::
182 * Mailing Lists::
183 * MH FAQ and Support::
184 * Getting MH-E::
185
186 History of MH-E
187
188 * From Brian Reid::
189 * From Jim Larus::
190 * From Stephen Gildea::
191 * From Bill Wohler::
192
193 @end detailmenu
194 @end menu
195
196 @html
197 -->
198 @end html
199
200 @node Preface, Conventions, Top, Top
201 @unnumbered Preface
202
203 @cindex Emacs
204 @cindex Unix commands, Emacs
205 @cindex preface
206
207 This manual introduces another interface to the MH mail system that is
208 accessible through the GNU Emacs editor, namely, @emph{MH-E}. MH-E is
209 easy to use. I don't assume that you know GNU Emacs or even MH at this
210 point, since I didn't know either of them when I discovered MH-E@.
211 However, MH-E was the tip of the iceberg, and I discovered more and
212 more niceties about GNU Emacs and MH@. Now I'm fully hooked on both of
213 them.
214
215 The MH-E package is distributed with Emacs@footnote{Version
216 @value{VERSION} of MH-E appeared in Emacs 24.4. It is supported in GNU
217 Emacs 23 and higher, as well as XEmacs 21.4.22 and 21.5.31. MH-E is
218 known not to work with GNU Emacs versions 20 and below, and XEmacs
219 version 21.5.9--21.5.16. It is compatible with MH versions 6.8.4 and
220 higher, all versions of nmh, and GNU mailutils 1.0 and higher}, so you
221 shouldn't have to do anything special to use it. Gnus is also
222 required; version 5.10 or higher is recommended. This manual covers
223 MH-E version @value{VERSION}. To help you decide which version you
224 have, see @ref{Getting Started}.
225
226 @findex help-with-tutorial
227 @kindex C-h t
228
229 If you don't already use GNU Emacs but want to learn more, you can
230 read a built-in tutorial by starting GNU Emacs and typing @kbd{C-h t}
231 (@code{help-with-tutorial}). (To learn about this notation, see
232 @ref{Conventions}.) If you want to take the plunge, consult the
233 @iftex
234 @cite{GNU Emacs Manual},
235 @end iftex
236 @ifinfo
237 @ref{Top, , GNU Emacs Manual, emacs, GNU Emacs Manual},
238 @end ifinfo
239 @ifhtml
240 @uref{http://www.gnu.org/software/emacs/manual/html_node/emacs/,
241 @cite{GNU Emacs Manual}},
242 @end ifhtml
243 from the Free Software Foundation.
244
245 If more information is needed, you can go to the Unix manual pages of
246 the individual MH commands. When the name is not obvious, I'll guide
247 you to a relevant MH manual page that describes the action more fully.
248
249 @c ":" does not work in index entries in Info.
250 @cindex @cite{MH & nmh - Email for Users & Programmers}
251 @cindex MH book
252 @cindex info
253 @kindex C-h i
254
255 This manual is available in both Info and online formats. The Info
256 version is distributed with Emacs and can be accessed with the
257 @command{info} command (@samp{info mh-e}) or within Emacs (@kbd{C-h i
258 m mh-e @key{RET}}). The online version is available at
259 @uref{http://mh-e.sourceforge.net/manual/, SourceForge}. Another great
260 online resource is the book
261 @uref{http://rand-mh.sourceforge.net/book/, @cite{MH & nmh: Email for
262 Users & Programmers}} (also known as @dfn{the MH book}).
263
264 I hope you enjoy this manual! If you have any comments, or suggestions
265 for this document, please let me know.
266
267 @cindex Bill Wohler
268 @cindex Wohler, Bill
269
270 @noindent
271 Bill Wohler <@i{wohler at newt.com}>@*
272 8 February 1995@*
273 24 February 2006
274
275 @node Conventions, Getting Started, Preface, Top
276 @chapter GNU Emacs Terms and Conventions
277
278 @cindex Emacs
279 @cindex Emacs, conventions
280 @cindex Emacs, terms
281 @cindex Unix commands, Emacs
282 @cindex conventions, Emacs
283 @cindex terms, Emacs
284
285 If you're an experienced Emacs user, you can skip the following
286 conventions and definition of terms and go directly to the next
287 section (@pxref{Getting Started}).
288
289 @cindex Emacs commands
290 @cindex MH commands
291 @cindex Unix commands
292 @cindex commands
293 @cindex commands, MH
294 @cindex commands, Unix
295 @cindex commands, shell
296 @cindex functions
297 @cindex shell commands
298
299 In general, @dfn{functions} in this text refer to Emacs Lisp functions
300 that one would call from within Emacs Lisp programs (for example,
301 @code{(mh-inc-folder)}). On the other hand, @dfn{commands} are those
302 things that are run by the user, such as @kbd{i} or @kbd{M-x
303 mh-inc-folder}. Programs outside of Emacs are specifically called MH
304 commands, shell commands, or Unix commands.
305
306 @cindex conventions, key names
307 @cindex key names
308
309 The conventions for key names are as follows:
310
311 @table @kbd
312 @item C-x
313 Hold down the @key{CTRL} (Control) key and press the @kbd{x} key.
314 @c -------------------------
315 @item M-x
316 Hold down the @key{META} or @key{ALT} key and press the @kbd{x} key.
317
318 Since some keyboards don't have a @key{META} key, you can generate
319 @kbd{M-x}, for example, by pressing @key{ESC} (Escape),
320 @emph{releasing it}, and then pressing the @kbd{x} key.
321 @c -------------------------
322 @item @key{RET}
323 Press the @key{RETURN} or @key{ENTER} key. This is normally used to
324 complete a command.
325 @c -------------------------
326 @item @key{SPC}
327 Press the space bar.
328 @c -------------------------
329 @item @key{TAB}
330 Press the @key{TAB} key.
331 @c -------------------------
332 @item @key{DEL}
333 Press the @key{DELETE} key.
334 @c -------------------------
335 @item @key{BS}
336 Press the @key{BACKSPACE} key@footnote{If you are using Version 20 or
337 earlier of Emacs, you will need to use the @key{DEL} key.}.
338 @end table
339
340 @cindex Emacs, prefix argument
341 @cindex prefix argument
342 @kindex C-u
343
344 A @dfn{prefix argument} allows you to pass an argument to any Emacs
345 function. To pass an argument, type @kbd{C-u} before the Emacs command
346 or keystroke. Numeric arguments can be passed as well. For example, to
347 insert five f's, use @kbd{C-u 5 f}. There is a default of four when
348 using @kbd{C-u}, and you can use multiple prefix arguments to provide
349 arguments of powers of four. To continue our example, you could insert
350 four f's with @kbd{C-u f}, 16 f's with @kbd{C-u C-u f}, 64 f's with
351 @kbd{C-u C-u C-u f}, and so on. Numeric and valueless negative
352 arguments can also be inserted with the @key{META} key. Examples
353 include @kbd{M-5} to specify an argument of 5, or @kbd{M--} which
354 specifies a negative argument with no particular value.
355
356 @sp 1
357 @center @strong{NOTE}
358
359 @quotation
360 The prefix @kbd{C-u} or @kbd{M-} is not necessary in MH-E's MH-Folder
361 mode (@pxref{Reading Mail Tour}). In this mode, simply enter the
362 numerical argument before entering the command.
363 @end quotation
364 @sp 1
365
366 @cindex @file{.emacs}
367 @cindex Emacs, variables
368 @cindex files, @file{.emacs}
369 @cindex variables
370 @findex setq
371
372 Emacs uses @dfn{variables} to hold values. These can be changed via
373 calls to the function @code{setq} in @file{~/.emacs}.
374
375 @cindex Emacs, options
376 @cindex options
377 @findex customize-group
378 @findex customize-option
379
380 Variables in MH-E that are normally modified by the user are called
381 @dfn{options} and are modified through the customize functions (such
382 as @kbd{M-x customize-option} or @kbd{M-x customize-group}).
383 @ifnothtml
384 @xref{Easy Customization,,,emacs,The GNU Emacs Manual}, in @cite{The
385 GNU Emacs Manual}.
386 @end ifnothtml
387 @ifhtml
388 See section
389 @uref{http://www.gnu.org/software/emacs/manual/html_node/emacs/Easy-Customization.html,
390 Easy Customization} in @cite{The GNU Emacs Manual}.
391 @end ifhtml
392 @xref{Options}.
393
394 @cindex Emacs, faces
395 @cindex faces
396 @cindex highlighting
397 @findex customize-face
398
399 You can specify various styles for displaying text using @dfn{faces}.
400 MH-E provides a set of faces that you can use to personalize the look
401 of your MH-E buffers. Use the command @kbd{M-x customize-face} to do
402 this.
403 @ifnothtml
404 @xref{Face Customization,,,emacs,The GNU Emacs Manual}, in @cite{The
405 GNU Emacs Manual}.
406 @end ifnothtml
407 @ifhtml
408 See section
409 @uref{http://www.gnu.org/software/emacs/manual/html_node/emacs/Face-Customization.html,
410 Face Customization} in @cite{The GNU Emacs Manual}.
411 @end ifhtml
412
413 @cindex abnormal hooks
414 @cindex hooks
415 @cindex normal hooks
416 @findex add-hook
417 @findex customize-option
418
419 Commands often offer @dfn{hooks} which enable you to extend or modify
420 the way a command works.
421 @ifnothtml
422 @ref{Hooks, , Hooks, emacs, The GNU Emacs Manual}, in @cite{The GNU
423 Emacs Manual}
424 @end ifnothtml
425 @ifhtml
426 See section
427 @uref{http://www.gnu.org/software/emacs/manual/html_node/emacs/Hooks.html,
428 Hooks} in @cite{The GNU Emacs Manual}
429 @end ifhtml
430 for a description about @dfn{normal hooks} and @dfn{abnormal hooks}.
431 MH-E uses normal hooks in nearly all cases, so you can assume that we
432 are talking about normal hooks unless we explicitly mention that a
433 hook is abnormal. We also follow the conventions described in that
434 section: the name of the abnormal hooks end in @code{-functions} and all
435 the rest of the MH-E hooks end in @code{-hook}. You can add hooks with
436 either @code{customize-option} or @code{add-hook}.
437
438 @cindex Emacs, mark
439 @cindex Emacs, point
440 @cindex Emacs, region
441 @cindex mark
442 @cindex point
443 @cindex region
444 @kindex C-@@
445 @kindex C-@key{SPC}
446
447 There are several other terms that are used in Emacs that you should
448 know. The @dfn{point} is where the cursor currently is. You can save
449 your current place in the file by setting a @dfn{mark}. This operation
450 is useful in several ways. The mark can be later used when defining a
451 @dfn{region}, which is the text between the point and mark. Many
452 commands operate on regions, such as those for deleting text or
453 filling paragraphs. A mark can be set with @kbd{C-@@} (or
454 @kbd{C-@key{SPC}}).
455
456 @cindex completion
457 @cindex Emacs, completion
458 @cindex Emacs, file completion
459 @cindex Emacs, folder completion
460 @cindex Emacs, minibuffer
461 @cindex file completion
462 @cindex folder completion
463 @cindex minibuffer
464 @kindex SPC
465 @kindex TAB
466
467 The @dfn{minibuffer} is the bottom line of the Emacs window, where all
468 prompting and multiple-character input is directed. You can use
469 @dfn{completion} to enter values such as folders. Completion means
470 that Emacs fills in text for you when you type @key{SPC} or @key{TAB}.
471 A second @key{SPC} or @key{TAB} will list all possibilities at that
472 point.
473 @ifnothtml
474 @xref{Completion, , Completion, emacs, The GNU Emacs Manual}.
475 @end ifnothtml
476 @ifhtml
477 See the section
478 @uref{http://www.gnu.org/software/emacs/manual/html_node/emacs/Completion.html,
479 Completion} in @cite{The GNU Emacs Manual}.
480 @end ifhtml
481 Note that @key{SPC} cannot be used for completing filenames and
482 folders.
483
484 @findex help-with-tutorial
485 @kindex C-h t
486 @kindex M-x
487
488 The minibuffer is also where you enter Emacs function names after
489 typing @kbd{M-x}. For example, in the preface, I mentioned that you
490 could obtain help with @kbd{C-h t} (@code{help-with-tutorial}). What
491 this means is that you can get a tutorial by typing either @kbd{C-h t}
492 or @kbd{M-x help-with-tutorial}. In the latter case, you are prompted
493 for @samp{help-with-tutorial} in the minibuffer after typing
494 @kbd{M-x}.
495
496 @cindex ~
497
498 The @samp{~} notation in filenames represents your home directory.
499 This notation is used by many shells including @command{bash},
500 @code{tcsh}, and @command{csh}. It is analogous to the environment
501 variable @samp{$HOME}. For example, @file{~/.emacs} can be written
502 @file{$HOME/.emacs} or using the absolute path as in
503 @file{/home/wohler/.emacs} instead.
504
505 @cindex Emacs, interrupting
506 @cindex Emacs, quitting
507 @cindex interrupting
508 @cindex quitting
509
510 @i{In case of trouble:} Emacs can be interrupted at any time with
511 @kbd{C-g}. For example, if you've started a command that requests that
512 you enter something in the minibuffer, but then you change your mind,
513 type @kbd{C-g} and you'll be back where you started. If you want to
514 exit Emacs entirely, use @kbd{C-x C-c}.
515
516 @node Getting Started, Tour Through MH-E, Conventions, Top
517 @chapter Getting Started
518
519 @cindex MH-E, versions
520 @cindex history
521 @cindex versions of MH-E
522
523 Because there are many old versions of MH-E out there, it is important
524 to know which version you have. I'll be talking about @w{Version 8}
525 which is pretty close to @w{Version 6} and @w{Version 7}. It differs
526 from @w{Version 4} and @w{Version 5} and is vastly different from
527 @w{Version 3}. @xref{History}.
528
529 @findex mh-version
530
531 To determine which version of MH-E that you have, enter @kbd{M-x
532 mh-version @key{RET}}. Hopefully it says that you're running
533 @w{Version @value{VERSION}} which is the latest version as of this
534 printing.
535
536 If your version is much older than this, please consider upgrading.
537 You can have your system administrator upgrade the system-wide
538 version, or you can install your own personal version. It's really
539 quite easy. @xref{Getting MH-E}, for instructions for getting and
540 installing MH-E.
541
542 If the @code{mh-version} command displays @samp{No MH variant
543 detected}@footnote{In very old versions of MH-E, you may get the error
544 message, @samp{Cannot find the commands `inc' and `mhl' and the file
545 `components'} if MH-E can't find MH@. In this case, you need to update
546 MH-E, and you may need to install MH too. However, newer versions of
547 MH-E are better at finding MH if it is on your system.}, then you need
548 to install MH or tell MH-E where to find MH.
549
550 @cindex Debian
551 @cindex nmh
552 @cindex GNU mailutils MH
553
554 If you don't have MH on your system already, you must install a
555 variant of MH@. The Debian mh-e package does this for you
556 automatically (@pxref{Getting MH-E}). Most people use
557 @uref{http://www.nongnu.org/nmh/, nmh}, but you may be interested in
558 trying out @uref{http://mailutils.org/, GNU mailutils MH}, which
559 supports IMAP@. Your GNU/Linux distribution probably has packages for
560 both of these.
561
562 @cindex @command{install-mh}
563 @cindex MH commands, @command{install-mh}
564 @cindex MH book
565
566 If you've never run MH before, you need to run @command{install-mh}
567 from the shell before you continue. This sets up your personal MH
568 environment@footnote{See the section
569 @uref{@value{MH-BOOK-HOME}/../overall/setup.html, Setting Up MH} in the
570 MH book.}. If you don't, you'll be greeted with the error message:
571 @samp{Install MH and run install-mh before running MH-E}. This is all
572 you need to know about MH to use MH-E, but the more you know about MH,
573 the more you can leverage its power. See the
574 @uref{@value{MH-BOOK-HOME}/../, MH book} to learn more about MH.
575
576 @cindex @samp{Path} MH profile component
577 @cindex MH profile
578 @cindex MH profile component
579 @cindex MH profile component, @samp{Path}
580
581 Your MH environment includes your @dfn{MH profile} which is found in
582 the file @file{~/.mh_profile}, or the file named in the environment
583 variable @samp{$MH}. This file contains a number of @dfn{MH
584 profile components}. For example, the @samp{Path:} MH profile
585 component contains the path to your mail directory, which is
586 @file{~/Mail} by default.
587
588 @cindex @command{mhparam}
589 @cindex MH commands, @command{mhparam}
590 @vindex exec-path
591 @vindex mh-path
592 @vindex mh-sys-path
593 @vindex mh-variant
594 @vindex mh-variant-in-use
595
596 There are several options MH-E uses to interact with your MH
597 installation. The option @code{mh-variant} specifies the variant used
598 by MH-E (@pxref{Options}). The default setting of this option is
599 @samp{Auto-detect} which means that MH-E will automatically choose the
600 first of nmh, MH, or GNU mailutils MH that it finds in the directories
601 listed in @code{mh-path} (which you can customize),
602 @code{mh-sys-path}, and @code{exec-path}. If MH-E can't find MH at
603 all, you may have to customize @code{mh-path} and add the directory in
604 which the command @command{mhparam} is located. If, on the other hand,
605 you have both nmh and GNU mailutils MH installed (for example) and
606 @code{mh-variant-in-use} was initialized to nmh but you want to use
607 GNU mailutils MH, then you can set @code{mh-variant} to
608 @samp{gnu-mh}.
609
610 @vindex mh-flists-present-flag
611 @vindex mh-lib
612 @vindex mh-lib-progs
613 @vindex mh-progs
614
615 When @code{mh-variant} is changed, MH-E resets @code{mh-progs},
616 @code{mh-lib}, @code{mh-lib-progs}, @code{mh-flists-present-flag}, and
617 @code{mh-variant-in-use} accordingly.
618
619 @cindex @file{.emacs}
620 @cindex files, @file{.emacs}
621
622 @sp 1
623 @center @strong{NOTE}
624
625 @quotation
626 Prior to version 8, it was often necessary to set some of these
627 variables in @file{~/.emacs}; now it is no longer necessary and can
628 actually cause problems.
629 @end quotation
630 @sp 1
631
632 @cindex MH profile component, @samp{Draft-Folder}
633 @cindex MH profile component, @samp{Path}
634 @cindex MH profile component, @samp{Previous-Sequence}
635 @cindex MH profile component, @samp{Unseen-Sequence}
636 @cindex @samp{Draft-Folder} MH profile component
637 @cindex @samp{Path} MH profile component
638 @cindex @samp{Previous-Sequence} MH profile component
639 @cindex @samp{Unseen-Sequence} MH profile component
640 @findex mh-find-path
641 @vindex mh-draft-folder
642 @vindex mh-find-path-hook
643 @vindex mh-inbox
644 @vindex mh-previous-seq
645 @vindex mh-unseen-seq
646 @vindex mh-user-path
647
648 In addition to setting variables that point to MH itself, MH-E also
649 sets a handful of variables that point to where you keep your mail.
650 During initialization, the function @code{mh-find-path} sets
651 @code{mh-user-path} from your @samp{Path:} MH profile component (but
652 defaults to @samp{Mail} if one isn't present), @code{mh-draft-folder}
653 from @samp{Draft-Folder:}, @code{mh-unseen-seq} from
654 @samp{Unseen-Sequence:}, @code{mh-previous-seq} from
655 @samp{Previous-Sequence:}, and @code{mh-inbox} from @samp{Inbox:}
656 (defaults to @samp{+inbox}). The hook @code{mh-find-path-hook} is run
657 after these variables have been set. This hook can be used the change
658 the value of these variables if you need to run with different values
659 between MH and MH-E.
660
661 @node Tour Through MH-E, Using This Manual, Getting Started, Top
662 @chapter Tour Through MH-E
663
664 @cindex introduction
665 @cindex tour
666 @cindex tutorial
667
668 This chapter introduces some of the terms you'll need to know and then
669 takes you on a tour of MH-E@footnote{The keys mentioned in these
670 chapters refer to the default key bindings. If you've changed the
671 bindings, refer to the command summaries at the beginning of each
672 chapter for a mapping between default key bindings and function
673 names.}. When you're done, you'll be able to send, read, and file
674 mail, which is all that a lot of people ever do. But if you're the
675 curious or adventurous type, read the rest of the manual to be able to
676 use all the features of MH-E@. I suggest you read this chapter first to
677 get the big picture, and then you can read the manual as you wish.
678
679 @menu
680 * Sending Mail Tour::
681 * Reading Mail Tour::
682 * Processing Mail Tour::
683 * Leaving MH-E::
684 * More About MH-E::
685 @end menu
686
687 @node Sending Mail Tour, Reading Mail Tour, Tour Through MH-E, Tour Through MH-E
688 @section Sending Mail
689
690 @cindex MH-Letter mode
691 @cindex mode
692 @cindex modes, MH-Letter
693 @cindex sending mail
694 @findex mh-smail
695 @kindex M-x mh-smail
696
697 Let's start our tour by sending ourselves a message which we can later
698 read and process. Enter @kbd{M-x mh-smail} to invoke the MH-E program
699 to send messages. Your message appears in an Emacs buffer whose
700 mode@footnote{A @dfn{mode} changes Emacs to make it easier to edit a
701 particular type of text.} is MH-Letter.
702
703 Enter your login name in the @samp{To:} header field. Press the
704 @key{TAB} twice to move the cursor past the @samp{Cc:} field, since no
705 carbon copies are to be sent, and on to the @samp{Subject:} field.
706 Enter @kbd{Test} or anything else that comes to mind.
707
708 Press @key{TAB} again to move the cursor to the body of the message.
709 Enter some text, using normal Emacs commands. You should now have
710 something like this@footnote{If you're running Emacs under the X
711 Window System, then you would also see a menu bar and a tool bar. I've
712 left out the menu bar and tool bar in all of the example screens.}:
713
714 @cartouche
715 @smallexample
716
717
718
719
720
721
722 --:-- *scratch* All L1 (Lisp Interaction)-------------------------
723 To: wohler
724 cc:
725 Subject: Test
726 X-Mailer: MH-E 8.1; nmh 1.1; GNU Emacs 23.1
727 --------
728 This is a test message to get the wheels churning...#
729
730
731 --:** @{draft@} All L5 (MH-Letter)----------------------------------
732 Type C-c C-c to send message, C-C ? for help
733 @end smallexample
734 @end cartouche
735 @i{MH-E message composition window}
736
737 Note the line of dashes that separates the header and the body of the
738 message. It is essential that these dashes (or a blank line) are
739 present or the body of your message will be considered to be part of
740 the header.
741
742 @cindex help
743 @findex describe-mode
744 @kindex C-c ?
745 @kindex C-c C-c
746 @kindex C-h m
747
748 There are several commands specific to MH-Letter mode@footnote{You can
749 get quick help for the commands used most often with @kbd{C-c ?} or
750 more complete help with the @kbd{C-h m} (@code{describe-mode})
751 command.}, but at this time we'll only use @kbd{C-c C-c} to send your
752 message. Type @kbd{C-c C-c} now. That's all there is to it!
753
754 @node Reading Mail Tour, Processing Mail Tour, Sending Mail Tour, Tour Through MH-E
755 @section Receiving Mail
756
757 @cindex @command{inc}
758 @cindex @command{scan}
759 @cindex MH commands, @command{inc}
760 @cindex MH commands, @command{scan}
761 @cindex MH-Folder mode
762 @cindex modes, MH-Folder
763 @cindex reading mail
764 @findex mh-rmail
765 @kindex M-x mh-rmail
766
767 To read the mail you've just sent yourself, enter @kbd{M-x mh-rmail}.
768 This incorporates the new mail and puts the output from
769 @command{inc}@footnote{See the section
770 @uref{@value{MH-BOOK-HOME}/reapre.html, Reading Mail: inc show next
771 prev} in the MH book.} (called @dfn{scan lines} after the MH program
772 @command{scan}@footnote{See the section
773 @uref{@value{MH-BOOK-HOME}/faswsprs.html, Find and Specify with scan
774 pick Ranges Sequences} in the MH book.} which prints a one-line
775 summary of each message) into a buffer called @samp{+inbox} whose
776 major mode is MH-Folder.
777
778 @findex mh-rmail
779 @kindex F r
780 @kindex M-x mh-rmail
781
782 @sp 1
783 @center @strong{NOTE}
784
785 @quotation
786
787 The @kbd{M-x mh-rmail} command will show you only new mail, not mail
788 you have already read. If you were to run this tour again, you would
789 use @kbd{F r} to pull all your messages into MH-E.
790 @end quotation
791 @sp 1
792
793 @kindex @key{RET}
794 @kindex n
795 @kindex p
796
797 You should see the scan line for your message, and perhaps others. Use
798 @kbd{n} or @kbd{p} to move the cursor to your test message and type
799 @key{RET} to read your message. You should see something like:
800
801 @cartouche
802 @smallexample
803 3 t08/24 root received fax files on Wed Aug 24 11:00:13 PDT 1
804 # 4+t08/24 To:wohler Test<<This is a test message to get the wheels
805
806 -:%% @{+inbox/select@} 4 msgs (1-4) Bot L4 (MH-Folder Show)---------
807 To: wohler
808 Subject: Test
809 X-Mailer: MH-E 8.1; nmh 1.1; GNU Emacs 23.1
810 Date: Fri, 17 Mar 2006 10:49:11 -0800
811 From: Bill Wohler <wohler@@stop.mail-abuse.org>
812
813 This is a test message to get the wheels churning...
814
815
816
817 --:-- @{show-+inbox@} 4 All L1 (MH-Show)----------------------------
818
819 @end smallexample
820 @end cartouche
821 @i{After incorporating new messages}
822
823 @kindex @key{DEL}
824 @kindex @key{SPC}
825
826 If you typed a long message, you can view subsequent pages with
827 @key{SPC} and previous pages with @key{DEL}.
828
829 @node Processing Mail Tour, Leaving MH-E, Reading Mail Tour, Tour Through MH-E
830 @section Processing Mail
831
832 @cindex processing mail
833 @kindex @key{RET}
834 @kindex r
835
836 The first thing we want to do is reply to the message that we sent
837 ourselves. Ensure that the cursor is still on the same line as your
838 test message and type @kbd{r}. You are prompted in the minibuffer with
839 @samp{Reply to whom:}. Here MH-E is asking whether you'd like to reply
840 to the original sender only, to the sender and primary recipients, or
841 to the sender and all recipients. You can press @key{TAB} to see these
842 choices. If you simply press @key{RET}, you'll reply only to the
843 sender. Press @key{RET} now.
844
845 You'll find yourself in an Emacs buffer similar to that when you were
846 sending the original message, like this:
847
848 @cartouche
849 @smallexample
850 To:
851 cc:
852 Subject: Re: Test
853 In-reply-to: <31054.1142621351@@stop.mail-abuse.org>
854 References: <31054.1142621351@@stop.mail-abuse.org>
855 Comments: In-reply-to Bill Wohler <wohler@@stop.mail-abuse.org>
856 message dated "Fri, 17 Mar 2006 10:49:11 -0800."
857 X-Mailer: MH-E 8.1; nmh 1.1; GNU Emacs 23.1
858 --------
859 #
860
861 --:-- @{draft@} All L10 (MH-Letter)----------------------------------
862 To: wohler
863 Subject: Test
864 X-Mailer: MH-E 8.1; nmh 1.1; GNU Emacs 23.1
865 Date: Fri, 17 Mar 2006 10:49:11 -0800
866 From: Bill Wohler <wohler@@stop.mail-abuse.org>
867
868 This is a test message to get the wheels churning...
869
870 --:-- @{show-+inbox@} 4 All L1 (MH-Show)----------------------------
871 Type C-c C-c to send message, C-c ? for help
872 @end smallexample
873 @end cartouche
874 @i{Composition window during reply}
875
876 @findex backward-char
877 @findex forward-char
878 @findex next-line
879 @findex previous-line
880 @kindex C-b
881 @kindex C-c C-c
882 @kindex C-c C-f C-t
883 @kindex C-f
884 @kindex C-n
885 @kindex C-p
886 @kindex @key{BS}
887
888 By default, MH will not add you to the address list of your replies,
889 so if you find that the @samp{To:} header field is missing, don't
890 worry. In this case, type @kbd{C-c C-f C-t} to create and go to the
891 @samp{To:} field, where you can type your login name again. You can
892 move around with the arrow keys or with @kbd{C-p}
893 (@code{previous-line}), @kbd{C-n} (@code{next-line}), @kbd{C-b}
894 (@code{backward-char}), and @kbd{C-f} (@code{forward-char}) and can
895 delete the previous character with @key{BS}. When you're finished
896 editing your message, send it with @kbd{C-c C-c} as before.
897
898 @cindex @command{refile}
899 @cindex MH commands, @command{refile}
900 @cindex folders
901 @kindex @key{SPC}
902 @kindex o
903
904 You'll often want to save messages that were sent to you in an
905 organized fashion. This is done with @dfn{folders}. You can use
906 folders to keep messages from your friends, or messages related to a
907 particular topic. With your cursor in the MH-Folder buffer and
908 positioned on the message you sent to yourself, type @kbd{o} to output
909 (@command{refile} in MH parlance) that message to a folder. Enter
910 @kbd{test} at the @samp{Destination folder:} prompt and type @kbd{y}
911 (or @key{SPC}) when MH-E asks to create the folder @samp{+test}. Note
912 that a @samp{^} (caret) appears next to the message number, which
913 means that the message has been marked for refiling but has not yet
914 been refiled. We'll talk about how the refile is actually carried out
915 in a moment.
916
917 @cindex MH-Folder mode
918 @cindex modes, MH-Folder
919 @kindex d
920 @kindex i
921 @kindex @key{RET}
922 @kindex n
923 @kindex p
924 @kindex x
925
926 Your previous reply is now waiting in the system mailbox. You
927 incorporate this mail into your MH-Folder buffer named @samp{+inbox}
928 with the @kbd{i} command. Do this now. After the mail is incorporated,
929 use @kbd{n} or @kbd{p} to move the cursor to the new message, and read
930 it with @key{RET}. Let's delete this message by typing @kbd{d}. Note
931 that a @samp{D} appears next to the message number. This means that
932 the message is marked for deletion but is not yet deleted. To perform
933 the deletion (and the refile we did previously), use the @kbd{x}
934 command.
935
936 @findex mh-smail
937 @kindex m
938 @kindex M-x mh-smail
939
940 If you want to send another message you can use @kbd{m} instead of
941 @kbd{M-x mh-smail}. So go ahead, send some mail to your friends!
942
943 @cindex help
944 @cindex prefix characters
945 @findex describe-mode
946 @kindex ?
947 @kindex C-h m
948 @kindex F ?
949
950 You can get a quick reminder about these commands by typing @kbd{?}.
951 This lists several @dfn{prefix characters}. To list the commands
952 available via the prefix characters, type the prefix character
953 followed by a @kbd{?}, for example, @kbd{F ?}. More complete help is
954 available with the @kbd{C-h m} (@code{describe-mode}) command.
955
956 @node Leaving MH-E, More About MH-E, Processing Mail Tour, Tour Through MH-E
957 @section Leaving MH-E
958
959 @cindex Emacs, quitting
960 @cindex quitting
961 @kindex C-x C-c
962 @kindex x
963
964 You may now wish to exit @command{emacs} entirely. Use @kbd{C-x C-c}
965 to exit @command{emacs}. If you exited without running @kbd{x} in the
966 @samp{+inbox} buffer, Emacs will offer to save it for you. Type
967 @kbd{y} or @key{SPC} to save @samp{+inbox} changes, which means to
968 perform any refiles and deletes that you did there.
969
970 @findex mh-rmail
971 @kindex C-x b
972 @kindex C-x k
973 @kindex M-x mh-rmail
974 @kindex q
975
976 If you don't want to leave Emacs, you can type @kbd{q} to bury (hide)
977 the MH-E folder or delete it entirely with @kbd{C-x k}. You can then
978 later recall it with @kbd{C-x b} or @kbd{M-x mh-rmail}.
979
980 @cindex @command{packf}
981 @cindex MH commands, @command{packf}
982 @cindex exporting folders
983 @cindex folders, exporting
984 @cindex mbox-style folder
985
986 On the other hand, if you no longer want to use MH and MH-E, you can
987 take your mail with you. You can copy all of your mail into a single
988 file, mbox-style, by using the MH command @command{packf}. For
989 example, to create a file called @file{msgbox} with the messages in
990 your @samp{+inbox} folder, use @samp{packf +inbox}. The
991 @command{packf} command will append the messages to the file if it
992 already exists, so you can use @samp{folders -recurse -fast} in a
993 script to copy all of your messages into a single file, or using the
994 @samp{-file} argument, a file for each folder.
995
996 @node More About MH-E, , Leaving MH-E, Tour Through MH-E
997 @section More About MH-E
998
999 These are the basic commands to get you going, but there are plenty
1000 more. If you think that MH-E is for you, read the rest of the manual
1001 to find out how you can:
1002
1003 @itemize @bullet
1004 @item
1005 Print your messages (@pxref{Printing}).
1006 @c -------------------------
1007 @item
1008 Edit messages and include your signature (@pxref{Editing Drafts}).
1009 @c -------------------------
1010 @item
1011 Forward messages (@pxref{Forwarding}).
1012 @c -------------------------
1013 @item
1014 Read digests (@pxref{Digests}).
1015 @c -------------------------
1016 @item
1017 Edit bounced messages (@pxref{Editing Again}).
1018 @c -------------------------
1019 @item
1020 Send multimedia messages (@pxref{Adding Attachments}).
1021 @c -------------------------
1022 @item
1023 Read HTML messages (@pxref{HTML}).
1024 @c -------------------------
1025 @item
1026 Use aliases and identities (see @ref{Aliases}, @pxref{Identities}).
1027 @c -------------------------
1028 @item
1029 Create different views of your mail (see @ref{Threading}, @pxref{Limits}).
1030 @c -------------------------
1031 @item
1032 Deal with junk mail (@pxref{Junk}).
1033 @c -------------------------
1034 @item
1035 Handle signed and encrypted messages (see @ref{Reading PGP},
1036 @pxref{Sending PGP}).
1037 @c -------------------------
1038 @item
1039 Process mail that was sent with @command{shar} or @command{uuencode}
1040 (@pxref{Files and Pipes}).
1041 @c -------------------------
1042 @item
1043 Use sequences conveniently (@pxref{Sequences}).
1044 @c -------------------------
1045 @item
1046 Use the speedbar, tool bar, and menu bar (see @ref{Speedbar}, see @ref{Tool
1047 Bar}, @pxref{Menu Bar}).
1048 @c -------------------------
1049 @item
1050 Show header fields in different fonts (@pxref{Reading Mail}).
1051 @c -------------------------
1052 @item
1053 Find previously refiled messages (@pxref{Searching}).
1054 @c -------------------------
1055 @item
1056 Place messages in a file (@pxref{Files and Pipes}).
1057 @end itemize
1058
1059 Remember that you can also use MH commands when you're not running
1060 MH-E (and when you are!).
1061
1062 @node Using This Manual, Incorporating Mail, Tour Through MH-E, Top
1063 @chapter Using This Manual
1064
1065 This chapter begins the meat of the manual which goes into more detail
1066 about every MH-E command and option.
1067
1068 @cindex Emacs, info
1069 @cindex Emacs, built-in help
1070 @cindex info
1071 @cindex built-in help
1072 @findex describe-mode
1073 @findex mh-help
1074 @kindex ?
1075 @kindex C-c ?
1076 @kindex C-h C-h
1077 @kindex C-h C-k i
1078 @kindex C-h i
1079 @kindex C-h m
1080
1081 There are many commands, but don't get intimidated. There are command
1082 summaries at the beginning of each chapter. In case you have or would
1083 like to rebind the keys, the command summaries also list the
1084 associated Emacs Lisp function. Furthermore, even if you're stranded
1085 on a desert island with a laptop and are without your manuals, you can
1086 get a summary of all these commands with GNU Emacs built-in help: use
1087 @kbd{C-h m} (@code{describe-mode}) for a brief summary of commands,
1088 @kbd{?} (@code{mh-help}) for an even briefer summary@footnote{This
1089 help appears in a buffer called @file{*MH-E Help*}
1090 (@pxref{Miscellaneous}).} (@kbd{C-c ?} in MH-Letter mode), or @kbd{C-h
1091 i} to read this manual via Info. The built-in help is quite good; try
1092 running @kbd{C-h C-h}. This brings up a list of available help topics,
1093 one of which displays the documentation for a given key (like @kbd{C-h
1094 k C-n}). Another useful help feature is to view the manual section
1095 that describes a given key (such as @kbd{C-h K i}). In addition,
1096 review @ref{Conventions}, if any of the GNU Emacs conventions are
1097 strange to you.
1098
1099 In addition to all of the commands, it is also possible to reconfigure
1100 MH-E to fit the needs of even the most demanding user. The following
1101 chapters also describe all of the options, show the defaults, and make
1102 recommendations for customization.
1103
1104 However, when customizing your mail environment, first try to change
1105 what you want in MH, and only change MH-E if changing MH is not
1106 possible. That way you will get the same behavior inside and outside
1107 GNU Emacs. Note that MH-E does not provide hooks for customizations
1108 that can be done in MH; this omission is intentional.
1109
1110 @cindex Emacs Lisp Manual
1111 @cindex Emacs, Emacs Lisp Manual
1112 @cindex Emacs, info
1113 @cindex Emacs, online help
1114 @cindex info
1115 @cindex online help
1116
1117 I hope I've included enough examples here to get you well on your way.
1118 If you want to explore Emacs Lisp further, a programming manual does
1119 exist,
1120 @c Yes, some of the stuff in the following sections is redundant, but
1121 @c TeX barfs if the @ifs are inside the @footnote.
1122 @iftex
1123 @footnote{The @cite{GNU Emacs Lisp Reference Manual} should be available
1124 via the Info system by typing @kbd{C-h i m Emacs Lisp
1125 @key{RET}}. It is also available online at @*
1126 @uref{http://www.gnu.org/software/emacs/manual/elisp.html}.}
1127 @end iftex
1128 @ifinfo
1129 @footnote{@xref{Top, The GNU Emacs Lisp Reference Manual, , elisp, GNU
1130 Emacs Lisp Reference Manual}, which should be available via the
1131 Info system. It is also available online at
1132 @uref{http://www.gnu.org/software/emacs/manual/elisp.html}.}
1133 @end ifinfo
1134 @ifhtml
1135 @footnote{The
1136 @uref{http://www.gnu.org/software/emacs/manual/elisp.html,
1137 The GNU Emacs Lisp Reference Manual} should be available via
1138 the Info system by typing @kbd{C-h i m Emacs Lisp @key{RET}}.}
1139 @end ifhtml
1140 and you can look at the code itself for examples. Look in the Emacs
1141 Lisp directory on your system (such as
1142 @file{/usr/local/share/emacs/lisp/mh-e}) and find all the @file{mh-*.el}
1143 files there. When calling MH-E and other Emacs Lisp functions directly
1144 from Emacs Lisp code, you'll need to know the correct arguments. Use
1145 the built-in help for this. For example, try @kbd{C-h f
1146 mh-execute-commands @key{RET}}. If you write your own functions,
1147 please do not prefix your symbols (variables and functions) with
1148 @samp{mh-}. This prefix is reserved for the MH-E package. To avoid
1149 conflicts with existing MH-E symbols, use a prefix like @samp{my-} or
1150 your initials. (Unless, of course, your initials happen to be @emph{mh}!)
1151
1152 @menu
1153 * Options::
1154 * Ranges::
1155 * Folder Selection::
1156 @end menu
1157
1158 @node Options, Ranges, Using This Manual, Using This Manual
1159 @section Options
1160
1161 @cindex Emacs, customizing
1162 @cindex Emacs, setting options
1163 @cindex customizing MH-E
1164 @cindex setting options
1165 @findex customize-option
1166 @vindex mh-lpr-command-format, example
1167
1168 Many string or integer options are easy to modify using @kbd{M-x
1169 customize-option}. For example, to modify the option that controls
1170 printing, you would run @kbd{M-x customize-option @key{RET}
1171 mh-lpr-command-format @key{RET}}. In the buffer that appears, modify
1172 the string to the right of the variable. For example, you may change
1173 the @command{lpr} command with @samp{nenscript -G -r -2 -i'%s'}. Then
1174 use the @samp{State} combo box and select @samp{Save for Future
1175 Sessions}. To read more about @code{mh-lpr-command-format}, see
1176 @ref{Printing}.
1177
1178 @cindex nil
1179 @cindex off, option
1180 @cindex on, option
1181 @cindex option, turning on and off
1182 @cindex t
1183 @findex customize-option
1184 @vindex mh-bury-show-buffer-flag, example
1185
1186 Options can also hold boolean values. In Emacs Lisp, the boolean
1187 values are @code{nil}, which means false, and @code{t}, which means
1188 true. The @code{customize-option} function makes it easy to change
1189 boolean values; simply click on the toggle button in the customize
1190 buffer to switch between @samp{on} (@code{t}) and @samp{off}
1191 (@code{nil}). For example, try setting @code{mh-bury-show-buffer-flag}
1192 to @samp{off} to keep the MH-Show buffer at the top of the buffer
1193 stack. Use the @samp{State} combo box and choose @samp{Set for Current
1194 Session} to see how the option affects the show buffer. Then choose
1195 the @samp{Erase Customization} menu item to reset the option to the
1196 default, which places the MH-Show buffer at the bottom of the buffer
1197 stack.
1198
1199 @vindex mh-mhl-format-file, example
1200
1201 The text usually says to turn on an option by setting it to a
1202 @emph{non-@code{nil}} value, because sometimes values other than
1203 @samp{on} are meaningful. An example of this is the variable
1204 @code{mh-mhl-format-file} (@pxref{Viewing}). Other options, such as
1205 hooks, involve a little more Emacs Lisp programming expertise.
1206
1207 @cindex customization group, @samp{mh}
1208 @cindex @samp{mh} customization group
1209 @findex customize-group
1210 @findex mh-customize
1211
1212 You can browse all of the MH-E options with the @code{customize-group}
1213 function. Try entering @kbd{M-x customize-group @key{RET} mh
1214 @key{RET}} to view the top-level options as well as buttons for all of
1215 the MH-E customization groups. Another way to view the MH-E
1216 customization group is to use @kbd{M-x mh-customize @key{RET}}.
1217
1218 @node Ranges, Folder Selection, Options, Using This Manual
1219 @section Ranges
1220
1221 @c Sync with mh-folder-mode docstring.
1222
1223 @cindex message abbreviations
1224 @cindex message ranges
1225 @cindex ranges
1226
1227 Many commands that operate on individual messages, such as
1228 @code{mh-forward} or @code{mh-refile-msg} take a @code{RANGE}
1229 argument. This argument can be used in several ways.
1230
1231 @kindex C-u, with ranges
1232
1233 If you provide the prefix argument @kbd{C-u} to these commands, then
1234 you will be prompted for the message range. This can be any valid MH
1235 range which can include messages, sequences (@pxref{Sequences}), and
1236 the abbreviations (described in the @command{mh}(1) man page):
1237
1238 @table @samp
1239 @item <num1>-<num2>
1240 Indicates all messages in the range <num1> to <num2>, inclusive. The
1241 range must be nonempty.
1242 @c -------------------------
1243 @item <num>:N
1244 @itemx <num>:+N
1245 @itemx <num>:-N
1246 Up to N messages beginning with (or ending with) message num. Num may
1247 be any of the predefined symbols: first, prev, cur, next or last.
1248 @c -------------------------
1249 @item first:N
1250 @itemx prev:N
1251 @itemx next:N
1252 @itemx last:N
1253 The first, previous, next or last messages, if they exist.
1254 @c -------------------------
1255 @item all
1256 All of the messages.
1257 @end table
1258
1259 For example, a range that shows all of these things is @samp{1 2 3
1260 5-10 last:5 unseen}.
1261
1262 @vindex transient-mark-mode
1263
1264 If the option @code{transient-mark-mode} is turned on and you set a
1265 region in the MH-Folder buffer, then the MH-E command will perform the
1266 operation on all messages in that region.
1267
1268 @cindex @samp{mh-range} customization group
1269 @cindex customization group, @samp{mh-range}
1270
1271 The @samp{mh-range} customization group contains a single option which
1272 affects how ranges are interpreted.
1273
1274 @vtable @code
1275 @item mh-interpret-number-as-range-flag
1276 On means interpret a number as a range (default: @samp{on}).
1277 @end vtable
1278
1279 @vindex mh-interpret-number-as-range-flag
1280
1281 Since one of the most frequent ranges used is @samp{last:N}, MH-E will
1282 interpret input such as @samp{200} as @samp{last:200} if the
1283 @code{mh-interpret-number-as-range-flag} option is on (which is the
1284 default). If you need to scan just the message 200, then use the range
1285 @samp{200:1} or @samp{200-200}.
1286
1287 @node Folder Selection, , Ranges, Using This Manual
1288 @section Folder Selection
1289
1290 @cindex completion, folders
1291 @cindex folders, completion
1292 @cindex folders, selecting
1293
1294 When you choose a folder in MH-E via a command such as @kbd{o}
1295 (@code{mh-refile-msg}), completion is used to enter the folder
1296 @ifnothtml
1297 (@pxref{Completion, , , emacs, The GNU Emacs Manual}).
1298 @end ifnothtml
1299 @ifhtml
1300 (see the section
1301 @uref{http://www.gnu.org/software/emacs/manual/html_node/emacs/Completion.html,
1302 Completion} in @cite{The GNU Emacs Manual}).
1303 @end ifhtml
1304 In addition, MH-E has several ways of choosing a suitable default so
1305 that the folder can often be selected with a single @key{RET} key.
1306
1307 @cindex customization group, @samp{mh-folder-selection}
1308 @cindex @samp{mh-folder-selection} customization group
1309
1310 The @samp{mh-folder-selection} customization group contains some
1311 options which are used to help with this.
1312
1313 @vtable @code
1314 @item mh-default-folder-for-message-function
1315 Function to select a default folder for refiling or @samp{Fcc:}
1316 (default: @code{nil}).
1317 @c -------------------------
1318 @item mh-default-folder-list
1319 List of addresses and folders (default: @code{nil}).
1320 @c -------------------------
1321 @item mh-default-folder-must-exist-flag
1322 On means guessed folder name must exist to be used (default:
1323 @samp{on}).
1324 @c -------------------------
1325 @item mh-default-folder-prefix
1326 Prefix used for folder names generated from aliases (default: @code{""}).
1327 @end vtable
1328
1329 @vindex mh-default-folder-for-message-function
1330
1331 You can set the option @code{mh-default-folder-for-message-function}
1332 to a function that provides a default folder for the message to be
1333 refiled. When this function is called, the current buffer contains the
1334 message being refiled and point is at the start of the message. This
1335 function should return the default folder as a string with a leading
1336 @samp{+} sign. It can also return @code{nil} so that the last folder
1337 name is used as the default, or an empty string to suppress the
1338 default entirely.
1339
1340 Otherwise, the name of the destination folder is derived from the
1341 sender as follows:
1342
1343 @enumerate
1344 @vindex mh-default-folder-list
1345 @item
1346 The folder name associated with the first address found in the list
1347 @code{mh-default-folder-list} is used. Each element in this list
1348 contains a @samp{Check Recipient} item. If this item is turned on,
1349 then the address is checked against the recipient instead of the
1350 sender. This is useful for mailing lists.
1351 @c -------------------------
1352 @vindex mh-default-folder-prefix
1353 @item
1354 An alias prefixed by @code{mh-default-folder-prefix} corresponding to
1355 the address is used. The prefix is used to prevent clutter in your
1356 mail directory. @xref{Aliases}.
1357 @end enumerate
1358
1359 @vindex mh-default-folder-must-exist-flag
1360
1361 If the derived folder does not exist, and
1362 @code{mh-default-folder-must-exist-flag} is @code{t}, then the last
1363 folder name used is suggested. This is useful if you get mail from
1364 various people for whom you have an alias, but file them all in the
1365 same project folder.
1366
1367 @node Incorporating Mail, Reading Mail, Using This Manual, Top
1368 @chapter Incorporating Your Mail
1369
1370 @cindex @samp{Folder} menu
1371 @cindex incorporating
1372 @cindex menu, @samp{Folder}
1373
1374 This chapter talks about getting mail from your system mailbox into
1375 your MH @samp{+inbox} folder. The following command accomplishes that
1376 and is found in the @samp{Folder} menu.
1377
1378 @table @kbd
1379 @cindex @samp{Folder > Incorporate New Mail} menu item
1380 @cindex menu item, @samp{Folder > Incorporate New Mail}
1381 @findex mh-inc-folder
1382 @kindex i
1383 @item i
1384 Incorporate new mail into a folder (@code{mh-inc-folder}).
1385 @end table
1386
1387 @cindex @samp{mh-inc} customization group
1388 @cindex customization group, @samp{mh-inc}
1389
1390 The following options in the @samp{mh-inc} customization group are
1391 used.
1392
1393 @vtable @code
1394 @item mh-inc-prog
1395 Program to incorporate mail (default: @code{"inc"}).
1396 @c -------------------------
1397 @item mh-inc-spool-list
1398 Alternate spool files (default: @code{nil}).
1399 @end vtable
1400
1401 The following hook is available.
1402
1403 @vtable @code
1404 @findex mh-inc-folder
1405 @item mh-inc-folder-hook
1406 Hook run by @code{mh-inc-folder} after incorporating mail into a
1407 folder (default: @code{nil}).
1408 @end vtable
1409
1410 @cindex @samp{+inbox}
1411 @findex mh-inc-folder
1412 @kindex i
1413
1414 If at any time you receive new mail, incorporate the new mail into
1415 your @samp{+inbox} buffer with @kbd{i} (@code{mh-inc-folder}). Note
1416 that @kbd{i} will display the @samp{+inbox} buffer, even if there
1417 isn't any new mail. You can incorporate mail from any file into the
1418 current folder by specifying a prefix argument; you'll be prompted for
1419 the name of the file to use as well as the destination folder (for
1420 example, @kbd{C-u i ~/mbox @key{RET} +tmp @key{RET}}).
1421
1422 @cindex @file{.emacs}
1423 @cindex Emacs, notification of new mail
1424 @cindex files, @file{.emacs}
1425 @cindex new mail
1426 @cindex notification of new mail
1427
1428 Emacs can notify you when you have new mail by displaying @samp{Mail}
1429 in the mode line. To enable this behavior, and to have a clock in the
1430 mode line as well, add the following to @file{~/.emacs}:
1431
1432 @findex display-time
1433
1434 @smalllisp
1435 (display-time)
1436 @end smalllisp
1437
1438 @cindex @command{inc}
1439 @cindex incorporating
1440 @cindex MH commands, @command{inc}
1441 @vindex mh-inc-prog
1442 @vindex mh-progs
1443
1444 The name of the program that incorporates new mail is stored in
1445 @code{mh-inc-prog}; it is @code{"inc"} by default. This program
1446 generates a one-line summary for each of the new messages. Unless it
1447 is an absolute pathname, the file is assumed to be in the
1448 @code{mh-progs} directory (@pxref{Getting Started}). You may also link
1449 a file to @command{inc} that uses a different format (see
1450 @samp{mh-profile}(5), and sections
1451 @uref{@value{MH-BOOK-HOME}/reapre.html, Reading Mail: inc show next
1452 prev} and @uref{@value{MH-BOOK-HOME}/mhstr.html, MH Format Strings} in
1453 the MH book). You'll then need to modify several variables
1454 appropriately (@pxref{Scan Line Formats}).
1455
1456 @vindex mh-inc-spool-list
1457
1458 You can use the @code{mh-inc-spool-list} variable to direct MH-E to
1459 retrieve mail from arbitrary spool files other than your system
1460 mailbox, file it in folders other than your @samp{+inbox}, and assign
1461 key bindings to incorporate this mail.
1462
1463 @cindex @command{procmail}
1464 @cindex @file{.procmailrc}
1465 @cindex Unix commands, @command{procmail}
1466 @cindex files, @file{.procmailrc}
1467
1468 Suppose you are subscribed to the @i{mh-e-devel} mailing list and you
1469 use @command{procmail} to filter this mail into @file{~/mail/mh-e}
1470 with the following recipe in @file{.procmailrc}:
1471
1472 @smallexample
1473 PATH=$PATH:/usr/bin/mh
1474 MAILDIR=$HOME/`mhparam Path`
1475 :0:
1476 * ^From mh-e-devel-admin@@stop.mail-abuse.org
1477 mh-e
1478 @end smallexample
1479
1480 @findex mh-inc-spool-*
1481 @kindex I *
1482
1483 In order to incorporate @file{~/mail/mh-e} into @samp{+mh-e} with an
1484 @kbd{I m} (@code{mh-inc-spool-mh-e}) command, customize this option,
1485 and click on the @samp{INS} button. Enter a @samp{Spool File} of
1486 @samp{~/mail/mh-e}, a @samp{Folder} of @samp{mh-e}, and a @samp{Key
1487 Binding} of @samp{m}.
1488
1489 @cindex @command{emacsclient}
1490 @cindex @command{gnuclient}
1491 @cindex @command{xbuffy}
1492 @cindex @samp{gnuserv}
1493 @cindex Unix commands, @command{emacsclient}
1494 @cindex Unix commands, @command{gnuclient}
1495 @cindex Unix commands, @command{xbuffy}
1496
1497 You can use @command{xbuffy} to automate the incorporation of this
1498 mail using the Emacs 23 command @command{emacsclient} as follows:
1499
1500 @smallexample
1501 box ~/mail/mh-e
1502 title mh-e
1503 origMode
1504 polltime 10
1505 headertime 0
1506 command emacsclient --eval '(mh-inc-spool-mh-e)'
1507 @end smallexample
1508
1509 In XEmacs, the command @command{gnuclient} is used in a similar
1510 fashion.
1511
1512 @findex mh-inc-folder
1513 @kindex i
1514 @vindex mh-inc-folder-hook
1515
1516 You can set the hook @code{mh-inc-folder-hook}, which is called after
1517 new mail is incorporated by the @kbd{i} (@code{mh-inc-folder})
1518 command. A good use of this hook is to rescan the whole folder either
1519 after running @kbd{M-x mh-rmail} the first time or when you've changed
1520 the message numbers from outside of MH-E.
1521
1522 @findex mh-execute-commands
1523 @findex mh-rescan-folder, example
1524 @findex mh-show, example
1525 @vindex mh-inc-folder-hook, example
1526
1527 @smalllisp
1528 @group
1529 (defun my-mh-inc-folder-hook ()
1530 "Hook to rescan folder after incorporating mail."
1531 (if (buffer-modified-p) ; @r{if outstanding refiles and deletes,}
1532 (mh-execute-commands)) ; @r{carry them out}
1533 (mh-rescan-folder) ; @r{synchronize with +inbox}
1534 (mh-show)) ; @r{show the current message}
1535
1536 (add-hook 'mh-inc-folder-hook 'my-mh-inc-folder-hook)
1537
1538 @i{Rescan folder after incorporating new mail via mh-inc-folder-hook}
1539
1540 @end group
1541 @end smalllisp
1542
1543 @node Reading Mail, Folders, Incorporating Mail, Top
1544 @chapter Reading Your Mail
1545
1546 @cindex @samp{+inbox}
1547 @cindex MH-Folder mode
1548 @cindex MH-Show mode
1549 @cindex modes, MH-Folder
1550 @cindex modes, MH-Show
1551 @cindex reading mail
1552 @findex mh-rmail
1553 @kindex F r
1554 @kindex F v
1555 @kindex M-x mh-rmail
1556
1557 The MH-E entry point for reading mail is @kbd{M-x mh-rmail}. This
1558 command incorporates your mail and creates a buffer called
1559 @samp{+inbox} in MH-Folder mode. The command @kbd{M-x mh-rmail} shows
1560 you only new mail, not mail you have already read@footnote{If you want
1561 to see your old mail as well, use @kbd{F r} to pull all your messages
1562 into MH-E@. Or, give a prefix argument to @code{mh-rmail} so it will
1563 prompt you for folder to visit like @kbd{F v} (for example, @kbd{C-u
1564 M-x mh-rmail @key{RET} bob @key{RET}}). @xref{Folders}.}.
1565
1566 @findex display-time
1567 @vindex read-mail-command
1568
1569 There are some commands that need to read mail, such as @kbd{mouse-2}
1570 over the @samp{Mail} button that @code{display-time} adds to the mode
1571 line. You can configure Emacs to have these commands use MH-E by
1572 setting the option @code{read-mail-command} to @samp{mh-rmail}.
1573
1574 @cindex @command{scan}
1575 @cindex @samp{Message} menu
1576 @cindex MH commands, @command{scan}
1577 @cindex menu, @samp{Message}
1578 @cindex scan lines
1579
1580 The @samp{+inbox} buffer contains @dfn{scan lines}, which are one-line
1581 summaries of each incorporated message. You can perform most MH
1582 commands on these messages via one- or two-letter commands in either
1583 the MH-Folder or MH-Show buffers or by using the @samp{Message} menu.
1584 See @command{scan}(1) for a description of the contents of the scan
1585 lines, and see the Figure in @ref{Reading Mail Tour}, for an example.
1586
1587 @table @kbd
1588 @kindex ?
1589 @findex mh-help
1590 @item ?
1591 Display cheat sheet for the MH-E commands (@code{mh-help}).
1592 @c -------------------------
1593 @cindex @samp{Message > Show Message} menu item
1594 @cindex menu item, @samp{Message > Show Message}
1595 @kindex @key{RET}
1596 @findex mh-show
1597 @item @key{RET}
1598 Display message (@code{mh-show}).
1599 @c -------------------------
1600 @cindex @samp{Message > Show Message with Header} menu item
1601 @cindex menu item, @samp{Message > Show Message with Header}
1602 @kindex , (comma)
1603 @findex mh-header-display
1604 @item , (comma)
1605 Display message with all header fields (@code{mh-header-display}).
1606 @c -------------------------
1607 @cindex @samp{Message > Show Message with Preferred Alternative} menu item
1608 @cindex menu item, @samp{Message > Show Message with Preferred Alternative}
1609 @kindex : (colon)
1610 @findex mh-show-preferred-alternative
1611 @item : (colon)
1612 Display message with the default preferred alternative
1613 (@code{mh-show-preferred-alternative}).
1614 @c -------------------------
1615 @kindex ; (semicolon)
1616 @findex mh-toggle-mh-decode-mime-flag
1617 @item ; (semicolon)
1618 Toggle the value of @code{mh-decode-mime-flag}
1619 (@code{mh-toggle-mh-decode-mime-flag}).
1620 @c -------------------------
1621 @kindex @key{SPC}
1622 @findex mh-page-msg
1623 @item @key{SPC}
1624 Display next page in message (@code{mh-page-msg}).
1625 @c -------------------------
1626 @kindex @key{BS}
1627 @findex mh-previous-page
1628 @item @key{BS}
1629 Display previous page in message (@code{mh-previous-page}).
1630 @c -------------------------
1631 @cindex @samp{Message > Write Message to File...} menu item
1632 @cindex menu item, @samp{Message > Write Message to File...}
1633 @kindex >
1634 @findex mh-write-msg-to-file
1635 @item >
1636 Append message to end of file (@code{mh-write-msg-to-file}).
1637 @c -------------------------
1638 @cindex @samp{Message > Pipe Message to Command...} menu item
1639 @cindex menu item, @samp{Message > Pipe Message to Command...}
1640 @kindex |
1641 @findex mh-pipe-msg
1642 @item |
1643 Pipe message through shell command (@code{mh-pipe-msg}).
1644 @c -------------------------
1645 @kindex C-d
1646 @findex mh-delete-msg-no-motion
1647 @item C-d
1648 Delete range, don't move to next message
1649 (@code{mh-delete-msg-no-motion}).
1650 @c -------------------------
1651 @cindex @samp{Message > Delete Message} menu item
1652 @cindex menu item, @samp{Message > Delete Message}
1653 @kindex d
1654 @findex mh-delete-msg
1655 @item d
1656 Delete range (@code{mh-delete-msg}).
1657 @c -------------------------
1658 @kindex D ?
1659 @findex mh-prefix-help
1660 @item D ?
1661 Display cheat sheet for the commands of the current prefix in
1662 minibuffer (@code{mh-prefix-help}).
1663 @c -------------------------
1664 @kindex D @key{SPC}
1665 @findex mh-page-digest
1666 @item D @key{SPC}
1667 Display next message in digest (@code{mh-page-digest}).
1668 @c -------------------------
1669 @kindex D @key{BS}
1670 @findex mh-page-digest-backwards
1671 @item D @key{BS}
1672 Display previous message in digest (@code{mh-page-digest-backwards}).
1673 @c -------------------------
1674 @cindex @samp{Message > Burst Digest Message} menu item
1675 @cindex menu item, @samp{Message > Burst Digest Message}
1676 @kindex D b
1677 @findex mh-burst-digest
1678 @item D b
1679 Break up digest into separate messages (@code{mh-burst-digest}).
1680 @c -------------------------
1681 @cindex @samp{Message > Go to Message by Number...} menu item
1682 @cindex menu item, @samp{Message > Go to Message by Number...}
1683 @kindex g
1684 @findex mh-goto-msg
1685 @item g
1686 Go to a message (@code{mh-goto-msg}).
1687 @c -------------------------
1688 @kindex k
1689 @findex mh-delete-subject-or-thread
1690 @item k
1691 Delete messages with same subject or thread
1692 (@code{mh-delete-subject-or-thread}).
1693 @c -------------------------
1694 @kindex K ?
1695 @findex mh-prefix-help
1696 @item K ?
1697 Display cheat sheet for the commands of the current prefix in
1698 minibuffer (@code{mh-prefix-help}).
1699 @c -------------------------
1700 @kindex K @key{TAB}
1701 @findex mh-next-button
1702 @item K @key{TAB}
1703 Go to the next button (@code{mh-next-button}).
1704 @c -------------------------
1705 @kindex K S-@key{TAB}
1706 @findex mh-prev-button
1707 @item K S-@key{TAB}
1708 Go to the previous button (@code{mh-prev-button}).
1709 @c -------------------------
1710 @kindex K a
1711 @findex mh-mime-save-parts
1712 @item K a
1713 Save attachments (@code{mh-mime-save-parts}).
1714 @c -------------------------
1715 @kindex K e
1716 @findex mh-display-with-external-viewer
1717 @item K e
1718 View attachment externally (@code{mh-display-with-external-viewer}).
1719 @c -------------------------
1720 @kindex K i
1721 @findex mh-folder-inline-mime-part
1722 @item K i
1723 Show attachment verbatim (@code{mh-folder-inline-mime-part}).
1724 @c -------------------------
1725 @kindex K o
1726 @findex mh-folder-save-mime-part
1727 @item K o
1728 Save (output) attachment (@code{mh-folder-save-mime-part}).
1729 @c -------------------------
1730 @kindex K t
1731 @findex mh-toggle-mime-buttons
1732 @item K t
1733 Toggle option @code{mh-display-buttons-for-inline-parts-flag}
1734 (@code{mh-toggle-mime-buttons}).
1735 @c -------------------------
1736 @kindex K v
1737 @findex mh-folder-toggle-mime-part
1738 @item K v
1739 View attachment (@code{mh-folder-toggle-mime-part}).
1740 @c -------------------------
1741 @cindex @samp{Message > Modify Message} menu item
1742 @cindex menu item, @samp{Message > Modify Message}
1743 @kindex M
1744 @findex mh-modify
1745 @item M
1746 Edit message (@code{mh-modify}).
1747 @c -------------------------
1748 @cindex @samp{Message > Go to First Message} menu item
1749 @cindex menu item, @samp{Message > Go to First Message}
1750 @kindex M-<
1751 @findex mh-first-msg
1752 @item M-<
1753 Display first message (@code{mh-first-msg}).
1754 @c -------------------------
1755 @cindex @samp{Message > Go to Last Message} menu item
1756 @cindex menu item, @samp{Message > Go to Last Message}
1757 @kindex M->
1758 @findex mh-last-msg
1759 @item M->
1760 Display last message (@code{mh-last-msg}).
1761 @c -------------------------
1762 @kindex M-n
1763 @findex mh-next-unread-msg
1764 @item M-n
1765 Display next unread message (@code{mh-next-unread-msg}).
1766 @c -------------------------
1767 @kindex M-p
1768 @findex mh-previous-unread-msg
1769 @item M-p
1770 Display previous unread message (@code{mh-previous-unread-msg}).
1771 @c -------------------------
1772 @cindex @samp{Message > Next Message} menu item
1773 @cindex menu item, @samp{Message > Next Message}
1774 @kindex n
1775 @findex mh-next-undeleted-msg
1776 @item n
1777 Display next message (@code{mh-next-undeleted-msg}).
1778 @c -------------------------
1779 @cindex @samp{Message > Previous Message} menu item
1780 @cindex menu item, @samp{Message > Previous Message}
1781 @kindex p
1782 @findex mh-previous-undeleted-msg
1783 @item p
1784 Display previous message (@code{mh-previous-undeleted-msg}).
1785 @c -------------------------
1786 @kindex P ?
1787 @findex mh-prefix-help
1788 @item P ?
1789 Display cheat sheet for the commands of the current prefix in
1790 minibuffer (@code{mh-prefix-help}).
1791 @c -------------------------
1792 @kindex P C
1793 @findex mh-ps-print-toggle-color
1794 @item P C
1795 Toggle whether color is used in printing messages
1796 (@code{mh-ps-print-toggle-color}).
1797 @c -------------------------
1798 @kindex P F
1799 @findex mh-ps-print-toggle-faces
1800 @item P F
1801 Toggle whether printing is done with faces or not
1802 (@code{mh-ps-print-toggle-faces}).
1803 @c -------------------------
1804 @kindex P f
1805 @findex mh-ps-print-msg-file
1806 @item P f
1807 Print range to file (@code{mh-ps-print-msg-file}).
1808 @c -------------------------
1809 @cindex @samp{Message > Print Message} menu item
1810 @cindex menu item, @samp{Message > Print Message}
1811 @kindex P l
1812 @findex mh-print-msg
1813 @item P l
1814 Print range the old fashioned way
1815 (@code{mh-print-msg}).
1816 @c -------------------------
1817 @kindex P p
1818 @findex mh-ps-print-msg
1819 @item P p
1820 Print range (@code{mh-ps-print-msg}).
1821 @c -------------------------
1822 @kindex X ?
1823 @findex mh-prefix-help
1824 @item X ?
1825 Display cheat sheet for the commands of the current prefix in
1826 minibuffer (@code{mh-prefix-help}).
1827 @c -------------------------
1828 @cindex @samp{Message > Unpack Uuencoded Message...} menu item
1829 @cindex menu item, @samp{Message > Unpack Uuencoded Message...}
1830 @kindex X s
1831 @kindex X u
1832 @findex mh-store-msg
1833 @item X s
1834 @itemx X u
1835 Unpack message created with @command{uudecode} or @command{shar}
1836 (@code{mh-store-msg}).
1837 @c -------------------------
1838 @kindex mouse-2
1839 @findex mh-show-mouse
1840 @item mouse-2
1841 Move point to mouse event and show message (@code{mh-show-mouse}).
1842 @end table
1843
1844 Within the MH-Show buffer, the following command is defined.
1845
1846 @table @kbd
1847 @kindex @key{RET}
1848 @kindex mouse-1
1849 @kindex mouse-2
1850 @findex mh-press-button
1851 @item @key{RET}
1852 @itemx mouse-1
1853 @itemx mouse-2
1854 View contents of button (@code{mh-press-button}).
1855 @end table
1856
1857 @cindex @samp{mh-show} customization group
1858 @cindex customization group, @samp{mh-show}
1859
1860 The following table lists options in the @samp{mh-show} customization
1861 group that are used while reading mail.
1862
1863 @vtable @code
1864 @item mh-bury-show-buffer-flag
1865 On means show buffer is buried (default: @samp{on}).
1866 @c -------------------------
1867 @item mh-clean-message-header-flag
1868 On means remove extraneous header fields (default: @samp{on}).
1869 @c -------------------------
1870 @item mh-decode-mime-flag
1871 On means attachments are handled (default: @samp{on} if the Gnus
1872 @samp{mm-decode} package is present).
1873 @c -------------------------
1874 @item mh-display-buttons-for-alternatives-flag
1875 On means display buttons for all alternative attachments (default:
1876 @samp{off}).
1877 @c -------------------------
1878 @item mh-display-buttons-for-inline-parts-flag
1879 On means display buttons for all inline attachments (default:
1880 @samp{off}).
1881 @c -------------------------
1882 @item mh-do-not-confirm-flag
1883 On means non-reversible commands do not prompt for confirmation
1884 (default: @samp{off}).
1885 @c -------------------------
1886 @item mh-fetch-x-image-url
1887 Control fetching of @samp{X-Image-URL:} header field image (default:
1888 @samp{Never Fetch}).
1889 @c -------------------------
1890 @item mh-graphical-smileys-flag
1891 On means graphical smileys are displayed (default: @samp{on}).
1892 @c -------------------------
1893 @item mh-graphical-emphasis-flag
1894 On means graphical emphasis is displayed (default: @samp{on}).
1895 @c -------------------------
1896 @item mh-highlight-citation-style
1897 Style for highlighting citations (default: @samp{Multicolor}).
1898 @c -------------------------
1899 @item mh-invisible-header-fields-default
1900 List of hidden header fields (default: a checklist too long to list
1901 here).
1902 @c -------------------------
1903 @item mh-invisible-header-fields
1904 Additional header fields to hide (default: @code{nil}).
1905 @c -------------------------
1906 @item mh-lpr-command-format
1907 Command used to print (default: @code{"lpr -J '%s'"}).
1908 @c -------------------------
1909 @item mh-max-inline-image-height
1910 Maximum inline image height if @samp{Content-Disposition:} is not
1911 present (default: 0).
1912 @c -------------------------
1913 @item mh-max-inline-image-width
1914 Maximum inline image width if @samp{Content-Disposition:} is not
1915 present(default: 0).
1916 @c -------------------------
1917 @item mh-mhl-format-file
1918 Specifies the format file to pass to the @command{mhl} program
1919 (default: @samp{Use Default mhl Format (Printing Only)}).
1920 @c -------------------------
1921 @item mh-mime-save-parts-default-directory
1922 Default directory to use for @kbd{K a}.
1923 @c -------------------------
1924 @item mh-print-background-flag
1925 On means messages should be printed in the background (default:
1926 @samp{off}).
1927 @c -------------------------
1928 @item mh-show-buffer-mode-line-buffer-id
1929 Format string to produce @code{mode-line-buffer-identification} for
1930 show buffers (default: @code{" @{show-%s@} %d"}).
1931 @c -------------------------
1932 @item mh-show-maximum-size
1933 Maximum size of message (in bytes) to display automatically (default:
1934 0).
1935 @c -------------------------
1936 @item mh-show-use-xface-flag
1937 On means display face images in MH-Show buffers (default: @samp{on}).
1938 @c -------------------------
1939 @item mh-store-default-directory
1940 Default directory for @kbd{X s} (default: @samp{Current}).
1941 @c -------------------------
1942 @item mh-summary-height
1943 Number of lines in MH-Folder buffer (including the mode line)
1944 (default: depends on size of frame).
1945 @end vtable
1946
1947 The following hooks are available.
1948
1949 @vtable @code
1950 @item mh-delete-msg-hook
1951 Hook run after marking each message for deletion (default: @code{nil}).
1952 @c -------------------------
1953 @item mh-show-hook
1954 Hook run after @key{RET} shows a message (default: @code{nil}).
1955 @c -------------------------
1956 @item mh-show-mode-hook
1957 Hook run upon entry to @code{mh-show-mode} (default: @code{nil}).
1958 @end vtable
1959
1960 The following faces are available.
1961
1962 @vtable @code
1963 @item mh-show-cc
1964 Face used to highlight @samp{cc:} header fields.
1965 @c -------------------------
1966 @item mh-show-date
1967 Face used to highlight @samp{Date:} header fields.
1968 @c -------------------------
1969 @item mh-show-from
1970 Face used to highlight @samp{From:} header fields.
1971 @c -------------------------
1972 @item mh-show-header
1973 Face used to deemphasize less interesting header fields.
1974 @c -------------------------
1975 @item mh-show-pgg-bad
1976 Bad PGG signature face.
1977 @c -------------------------
1978 @item mh-show-pgg-good
1979 Good PGG signature face.
1980 @c -------------------------
1981 @item mh-show-pgg-unknown
1982 Unknown or untrusted PGG signature face.
1983 @c -------------------------
1984 @item mh-show-signature
1985 Signature face.
1986 @c -------------------------
1987 @item mh-show-subject
1988 Face used to highlight @samp{Subject:} header fields.
1989 @c -------------------------
1990 @item mh-show-to
1991 Face used to highlight @samp{To:} header fields.
1992 @c -------------------------
1993 @item mh-show-xface
1994 X-Face image face.
1995 @end vtable
1996
1997 The functions and variables introduced here are explained in more
1998 detail in the following sections.
1999
2000 @menu
2001 * Viewing::
2002 * Viewing Attachments::
2003 * HTML::
2004 * Digests::
2005 * Reading PGP::
2006 * Printing::
2007 * Files and Pipes::
2008 * Navigating::
2009 * Miscellaneous Commands and Options::
2010 @end menu
2011
2012 @node Viewing, Viewing Attachments, Reading Mail, Reading Mail
2013 @section Viewing Your Mail
2014
2015 @findex mh-header-display
2016 @findex mh-page-msg
2017 @findex mh-previous-page
2018 @findex mh-show
2019 @findex mh-show-mouse
2020 @kindex , (comma)
2021 @kindex . (period)
2022 @kindex @key{BS}
2023 @kindex @key{RET}
2024 @kindex @key{SPC}
2025 @kindex mouse-2
2026
2027 The command @key{RET} (@code{mh-show}) displays the message that the
2028 cursor is on while @kbd{mouse-2} (@code{mh-show-mouse}) displays the
2029 message that the mouse cursor is on. If the message is already
2030 displayed, it scrolls to the beginning of the message. Use @key{SPC}
2031 (@code{mh-page-msg}) and @key{BS} (@code{mh-previous-page}) to move
2032 forwards and backwards one page at a time through the message. You can
2033 give either of these commands a prefix argument that specifies the
2034 number of lines to scroll (such as @kbd{10 @key{SPC}}). The @key{SPC}
2035 command will also show the next undeleted message if it is used at the
2036 bottom of a message. MH-E normally hides a lot of the superfluous
2037 header fields that mailers add to a message, but if you wish to see
2038 all of them, use the command @kbd{,} (comma;
2039 @code{mh-header-display}).
2040
2041 @vindex mh-show-maximum-size
2042
2043 The option @code{mh-show-maximum-size} provides an opportunity to skip
2044 over large messages which may be slow to load. The default value of 0
2045 means that all message are shown regardless of size.
2046
2047 A litany of options control what displayed messages look like.
2048
2049 @vindex mh-show-cc
2050 @vindex mh-show-date
2051 @vindex mh-show-from
2052 @vindex mh-show-header
2053 @vindex mh-show-subject
2054 @vindex mh-show-to
2055
2056 First, the appearance of the header fields can be modified by
2057 customizing the associated face: @code{mh-show-to}, @code{mh-show-cc},
2058 @code{mh-show-from}, @code{mh-show-date}, and @code{mh-show-subject}.
2059 The face @code{mh-show-header} is used to deemphasize the other, less
2060 interesting, header fields.
2061
2062 @cindex regular expressions, @code{mh-invisible-header-fields}
2063 @vindex mh-clean-message-header-flag
2064 @vindex mh-invisible-header-fields
2065 @vindex mh-invisible-header-fields-default
2066
2067 Normally messages are delivered with a handful of uninteresting header
2068 fields. These are hidden by turning on the option
2069 @code{mh-clean-message-header-flag} (which it is by default). The
2070 header fields listed in the option
2071 @code{mh-invisible-header-fields-default} are hidden, although you can
2072 check off any field that you would like to see. Header fields that you
2073 would like to hide that aren't listed can be added to the option
2074 @code{mh-invisible-header-fields} with a couple of caveats. Regular
2075 expressions are not allowed. Unique fields should have a @samp{:}
2076 suffix; otherwise, the element can be used to render invisible an
2077 entire class of fields that start with the same prefix. If you think a
2078 header field should be generally ignored, please update
2079 @uref{https://sourceforge.net/p/mh-e/bugs/245/, SF #245}.
2080
2081 @cindex header field, @samp{Face}
2082 @cindex header field, @samp{X-Face}
2083 @cindex header field, @samp{X-Image-URL}
2084 @cindex @samp{Face} header field
2085 @cindex @samp{X-Face} header field
2086 @cindex @samp{X-Image-URL} header field
2087 @vindex mh-show-use-xface-flag
2088
2089 MH-E can display the content of @samp{Face:}, @samp{X-Face:}, and
2090 @samp{X-Image-URL:} header fields. If any of these fields occur in the
2091 header of your message, the sender's face will appear in the
2092 @samp{From:} header field. If more than one of these fields appear,
2093 then the first field found in the order @samp{Face:}, @samp{X-Face:},
2094 and @samp{X-Image-URL:} will be used. The option
2095 @code{mh-show-use-xface-flag} is used to turn this feature on and off.
2096 This feature will be turned on by default if your system supports it.
2097
2098 The first header field used, if present, is the Gnus-specific
2099 @samp{Face:} field@footnote{The @samp{Face:} field appeared in GNU
2100 Emacs 21 and XEmacs. For more information, see
2101 @uref{http://quimby.gnus.org/circus/face/}.}.
2102
2103 @cindex @command{uncompface}
2104 @cindex Emacs, packages, x-face
2105 @cindex Unix commands, @command{uncompface}
2106 @cindex x-face package
2107 @vindex mh-show-xface
2108
2109 Next is the traditional @samp{X-Face:} header field@footnote{The
2110 display of this field requires the
2111 @uref{ftp://ftp.cs.indiana.edu/pub/faces/compface/compface.tar.Z,
2112 @command{uncompface} program}. Recent versions of XEmacs have internal
2113 support for @samp{X-Face:} images. If your version of XEmacs does not,
2114 then you'll need both @command{uncompface} and the
2115 @uref{ftp://ftp.jpl.org/pub/elisp/, @samp{x-face} package}.}. MH-E
2116 renders the foreground and background of the image using the
2117 associated attributes of the face @code{mh-show-xface}.
2118
2119 @cindex @command{convert}
2120 @cindex @command{wget}
2121 @cindex ImageMagick
2122 @cindex Unix commands, @command{convert}
2123 @cindex Unix commands, @command{wget}
2124 @vindex mh-fetch-x-image-url
2125
2126 Finally, MH-E will display images referenced by the
2127 @samp{X-Image-URL:} header field if neither the @samp{Face:} nor the
2128 @samp{X-Face:} fields are present@footnote{The display of the images
2129 requires the @uref{http://www.gnu.org/software/wget/wget.html,
2130 @command{wget} program} to fetch the image and the @command{convert}
2131 program from the @uref{http://www.imagemagick.org/script/index.php,
2132 ImageMagick suite}.}. Of the three header fields this is the most
2133 efficient in terms of network usage since the image doesn't need to be
2134 transmitted with every single mail. The option
2135 @code{mh-fetch-x-image-url} controls the fetching of the
2136 @samp{X-Image-URL:} header field image with the following values:
2137
2138 @table @samp
2139 @item Ask Before Fetching
2140 You are prompted before the image is fetched. MH-E will remember your
2141 reply and will either use the already fetched image the next time the
2142 same URL is encountered or silently skip it if you didn't fetch it the
2143 first time. This is a good setting.
2144 @c -------------------------
2145 @item Never Fetch
2146 Images are never fetched and only displayed if they are already
2147 present in the cache. This is the default.
2148 @end table
2149
2150 There isn't a value of @samp{Always Fetch} for privacy and DOS (denial
2151 of service) reasons. For example, fetching a URL can tip off a spammer
2152 that you've read his email (which is why you shouldn't blindly answer
2153 yes if you've set this option to @samp{Ask Before Fetching}). Someone
2154 may also flood your network and fill your disk drive by sending a
2155 torrent of messages, each specifying a unique URL to a very large
2156 file.
2157
2158 @cindex @file{.mhe-x-image-cache}
2159 @cindex files, @file{.mhe-x-image-cache}
2160
2161 The cache of images is found in the directory
2162 @file{.mhe-x-image-cache} within your MH directory. You can add your
2163 own face to the @samp{From:} field too. @xref{Picture}.
2164
2165 @cindex @command{mhl}
2166 @cindex MH commands, @command{mhl}
2167 @vindex mh-mhl-format-file
2168
2169 Normally MH-E takes care of displaying messages itself (rather than
2170 calling an MH program to do the work). If you'd rather have
2171 @command{mhl} display the message (within MH-E), change the option
2172 @code{mh-mhl-format-file} from its default value of @samp{Use Default
2173 mhl Format (Printing Only)}. You can set this option to @samp{Use
2174 Default mhl Format} to get the same output as you would get if you ran
2175 @command{mhl} from the shell. If you have a format file that you want
2176 MH-E to use, you can set this option to @samp{Specify an mhl Format
2177 File} and enter the name of your format file (@command{mhl}(1) or
2178 section @uref{@value{MH-BOOK-HOME}/shomes.html#Usisho, Using mhl} in
2179 the MH book tells you how to write one). Your format file should
2180 specify a non-zero value for @samp{overflowoffset} to allow MH-E to
2181 parse the header. Note that @command{mhl} is always used for printing
2182 and forwarding; in this case, the value of @code{mh-mhl-format-file}
2183 is consulted if you have specified a format file.
2184
2185 @cindex citations, highlighting
2186 @cindex highlighting citations
2187 @vindex mh-highlight-citation-style
2188
2189 If the sender of the message has cited other messages in his message,
2190 then MH-E will highlight these citations to emphasize the sender's
2191 actual response. The option @code{mh-highlight-citation-style} can be
2192 customized to change the highlighting style. The @samp{Multicolor}
2193 method uses a different color for each indentation while the
2194 @samp{Monotone} method highlights all citations in red. To disable
2195 highlighting of citations entirely, choose @samp{None}.
2196
2197 @cindex URLs, highlighting
2198 @cindex email addresses, highlighting
2199 @cindex highlighting URLs
2200 @cindex highlighting email addresses
2201 @cindex links, following
2202 @findex goto-address-at-point
2203 @kindex C-c @key{RET}
2204 @kindex mouse-2
2205 @vindex goto-address-highlight-p
2206
2207 Email addresses and URLs in the message are highlighted if the option
2208 @code{goto-address-highlight-p} is on, which it is by default. To view
2209 the web page for a highlighted URL or to send a message using a
2210 highlighted email address, use @kbd{mouse-2} or @kbd{C-c @key{RET}}
2211 (@code{goto-address-at-point}). @xref{Sending Mail}, to see how to
2212 configure Emacs to send the message using MH-E.
2213
2214 @cindex boldface, showing
2215 @cindex emphasis
2216 @cindex italics, showing
2217 @cindex smileys
2218 @cindex typesetting
2219 @cindex underline, showing
2220 @vindex gnus-emphasis-alist
2221 @vindex mh-decode-mime-flag
2222 @vindex mh-graphical-emphasis-flag
2223 @vindex mh-graphical-smileys-flag
2224
2225 It is a long standing custom to inject body language using a
2226 cornucopia of punctuation, also known as the @dfn{smileys}. MH-E can
2227 render these as graphical widgets if the option
2228 @code{mh-graphical-smileys-flag} is turned on, which it is by default.
2229 Smileys include patterns such as :-) and ;-). Similarly, a few
2230 typesetting features are indicated in ASCII text with certain
2231 characters. If your terminal supports it, MH-E can render these
2232 typesetting directives naturally if the option
2233 @code{mh-graphical-emphasis-flag} is turned on, which it is by
2234 default. For example, _underline_ will be
2235 @ifhtml
2236 @html
2237 <u>underlined</u>,
2238 @end html
2239 @end ifhtml
2240 @ifnothtml
2241 underlined,
2242 @end ifnothtml
2243 *bold* will appear in @b{bold}, /italics/ will appear in @i{italics},
2244 and so on. See the option @code{gnus-emphasis-alist} for the whole
2245 list. Both of these options are disabled if the option
2246 @code{mh-decode-mime-flag} is turned off. @xref{Viewing Attachments}.
2247
2248 @cindex signature separator
2249 @cindex vCard
2250 @vindex mh-show-signature
2251
2252 MH-E normally renders signatures and vCards in italics so that the
2253 body of the message stands out more. MH-E depends on the presence of
2254 the @dfn{signature separator} (@code{"-- "}) to do this. You can also
2255 customize the face @code{mh-show-signature} so the appearance of the
2256 signature block is more to your liking.
2257
2258 @vindex mh-show-hook
2259 @vindex mh-show-mode-hook
2260
2261 Two hooks can be used to control how messages are displayed. The first
2262 hook, @code{mh-show-mode-hook}, is called early on in the process of
2263 the message display. It is usually used to perform some action on the
2264 message's content. The second hook, @code{mh-show-hook}, is the last
2265 thing called after messages are displayed. It's used to affect the
2266 behavior of MH-E in general or when @code{mh-show-mode-hook} is too
2267 early.
2268
2269 @cindex MH-Show mode
2270 @cindex modes, MH-Show
2271 @vindex mh-show-buffer-mode-line-buffer-id
2272
2273 For those who like to modify their mode lines, use
2274 @code{mh-show-buffer-mode-line-buffer-id} to modify the mode line in
2275 the MH-Show buffers. Place the two escape strings @samp{%s} and
2276 @samp{%d}, which will display the folder name and the message number,
2277 respectively, somewhere in the string in that order. The default value
2278 of @code{"@{show-%s@} %d"} yields a mode line of
2279
2280 @smallexample
2281 -----@{show-+inbox@} 4 (MH-Show)--Bot--------------------------------
2282 @end smallexample
2283
2284 @node Viewing Attachments, HTML, Viewing, Reading Mail
2285 @section Viewing Attachments
2286
2287 @cindex attachments
2288 @cindex body parts
2289 @cindex @command{mhshow}
2290 @cindex @command{show}
2291 @cindex MH commands, @command{mhshow}
2292 @cindex MH commands, @command{show}
2293 @cindex MIME
2294 @cindex multimedia mail
2295
2296 MH has the ability to display @dfn{@sc{mime}} (Multipurpose Internet
2297 Mail Extensions) messages which are simply messages with additional
2298 @dfn{body parts} or @dfn{attachments}. You can use the MH commands
2299 @command{show}@footnote{See the section
2300 @uref{@value{MH-BOOK-HOME}/reapre.html, Reading Mail: inc show next
2301 prev} in the MH book.} or @command{mhshow}@footnote{See the section
2302 @uref{@value{MH-BOOK-HOME}/usimim.html#ReMIMa, Reading MIME Mail} in
2303 the MH book.} from the shell to read @sc{mime} messages@footnote{You
2304 can call them directly from Emacs if you're running the X Window
2305 System: type @kbd{M-! xterm -e mhshow @var{message-number}}. You can
2306 leave out the @samp{xterm -e} if you use @command{mhlist} or
2307 @command{mhstore}.}.
2308
2309 @cindex Emacs, packages, mm-decode
2310 @cindex mm-decode package
2311 @findex mh-toggle-mh-decode-mime-flag
2312 @kindex ; (semicolon)
2313 @vindex mh-decode-mime-flag
2314
2315 MH-E can handle attachments as well if the Gnus @samp{mm-decode}
2316 package is present. If so, the option @code{mh-decode-mime-flag} will
2317 be on. Otherwise, you'll see the @sc{mime} body parts rather than text
2318 or attachments. There isn't much point in turning off the option
2319 @code{mh-decode-mime-flag}; however, you can inspect it if it appears
2320 that the body parts are not being interpreted correctly or toggle it
2321 with the command @kbd{;} (semicolon;
2322 @code{mh-toggle-mh-decode-mime-flag}) to view the raw message. This
2323 option also controls the display of quoted-printable messages and
2324 other graphical widgets. @xref{Viewing}.
2325
2326 @cindex buttons
2327
2328 Attachments in MH-E are indicated by @dfn{buttons} like this:
2329
2330 @smallexample
2331 [1. image/jpeg; foo.jpg]...
2332 @end smallexample
2333
2334 @findex mh-next-button
2335 @findex mh-press-button
2336 @findex mh-prev-button
2337 @kindex @key{RET}
2338 @kindex K @key{TAB}
2339 @kindex K S-@key{TAB}
2340 @kindex mouse-1
2341 @kindex mouse-2
2342
2343 To view the contents of the button, use either @kbd{mouse-1} or
2344 @kbd{mouse-2} on the button or @key{RET} (@code{mh-press-button}) when
2345 the cursor is over the button. This command is a toggle so if you use
2346 it again on the same attachment, it is hidden. If Emacs does not know
2347 how to display the attachment, then Emacs offers to save the
2348 attachment in a file. To move the cursor to the next button, use the
2349 command @kbd{K @key{TAB}} (@code{mh-next-button}). If the end of the
2350 buffer is reached then the search wraps over to the start of the
2351 buffer. To move the cursor to the previous button, use the command
2352 @kbd{K S-@key{TAB}} (@code{mh-prev-button}). If the beginning of the
2353 buffer is reached then the search wraps over to the end of the buffer.
2354
2355 @cindex attachments, viewing
2356 @cindex viewing attachments
2357 @findex mh-folder-toggle-mime-part
2358 @kindex K v
2359
2360 Another way to view the contents of a button is to use the command
2361 @kbd{K v} (@code{mh-folder-toggle-mime-part}). This command displays
2362 (or hides) the attachment associated with the button under the cursor.
2363 If the cursor is not located over a button, then the cursor first
2364 moves to the next button, wrapping to the beginning of the message if
2365 necessary. This command has the advantage over the previous commands
2366 of working from the MH-Folder buffer. You can also provide a numeric
2367 prefix argument (as in @kbd{4 K v}) to view the attachment labeled
2368 with that number. If Emacs does not know how to display the
2369 attachment, then Emacs offers to save the attachment in a file.
2370
2371 @cindex @file{/etc/mailcap}
2372 @cindex files, @file{/etc/mailcap}
2373 @findex mailcap-mime-info
2374 @findex mh-display-with-external-viewer
2375 @kindex K e
2376
2377 If Emacs does not know how to view an attachment, you could save it
2378 into a file and then run some program to open it. It is easier,
2379 however, to launch the program directly from MH-E with the command
2380 @kbd{K e} (@code{mh-display-with-external-viewer}). While you'll most
2381 likely use this to view spreadsheets and documents, it is also useful
2382 to use your browser to view HTML attachments with higher fidelity than
2383 what Emacs can provide. This command displays the attachment
2384 associated with the button under the cursor. If the cursor is not
2385 located over a button, then the cursor first moves to the next button,
2386 wrapping to the beginning of the message if necessary. You can provide
2387 a numeric prefix argument (as in @kbd{4 K e}) to view the attachment
2388 labeled with that number. This command tries to provide a reasonable
2389 default for the viewer by calling the Emacs function
2390 @code{mailcap-mime-info}. This function usually reads the file
2391 @file{/etc/mailcap}.
2392
2393 @cindex attachments, saving
2394 @cindex saving attachments
2395 @findex mh-folder-save-mime-part
2396 @kindex K o
2397
2398 Use the command @kbd{K o} (@code{mh-folder-save-mime-part}) to save
2399 attachments (the mnemonic is ``output''). This command saves the
2400 attachment associated with the button under the cursor. If the cursor
2401 is not located over a button, then the cursor first moves to the next
2402 button, wrapping to the beginning of the message if necessary. You can
2403 also provide a numeric prefix argument (as in @kbd{3 K o}) to save the
2404 attachment labeled with that number. This command prompts you for a
2405 filename and suggests a specific name if it is available.
2406
2407 @cindex @command{mhn}
2408 @cindex @command{mhstore}
2409 @cindex MH commands, @command{mhn}
2410 @cindex MH commands, @command{mhstore}
2411 @findex mh-mime-save-parts
2412 @kindex K a
2413 @vindex mh-mime-save-parts-default-directory
2414
2415 You can save all of the attachments at once with the command @kbd{K a}
2416 (@code{mh-mime-save-parts}). The attachments are saved in the
2417 directory specified by the option
2418 @code{mh-mime-save-parts-default-directory} unless you use a prefix
2419 argument (as in @kbd{C-u K a}) in which case you are prompted for the
2420 directory. These directories may be superseded by MH profile
2421 components, since this function calls on @command{mhstore}
2422 (@command{mhn}) to do the work.
2423
2424 @vindex mh-mime-save-parts-default-directory
2425
2426 The default value for the option
2427 @code{mh-mime-save-parts-default-directory} is @samp{Prompt Always} so
2428 that you are always prompted for the directory in which to save the
2429 attachments. However, if you usually use the same directory within a
2430 session, then you can set this option to @samp{Prompt the First Time}
2431 to avoid the prompt each time. you can make this directory permanent
2432 by choosing @samp{Directory} and entering the directory's name.
2433
2434 @cindex attachments, inline
2435 @cindex inline attachments
2436 @findex mh-toggle-mime-buttons
2437 @kindex K t
2438 @vindex mh-display-buttons-for-inline-parts-flag
2439
2440 The sender can request that attachments should be viewed inline so
2441 that they do not really appear like an attachment at all to the
2442 reader. Most of the time, this is desirable, so by default MH-E
2443 suppresses the buttons for inline attachments. On the other hand, you
2444 may receive code or HTML which the sender has added to his message as
2445 inline attachments so that you can read them in MH-E@. In this case, it
2446 is useful to see the buttons so that you know you don't have to cut
2447 and paste the code into a file; you can simply save the attachment. If
2448 you want to make the buttons visible for inline attachments, you can
2449 use the command @kbd{K t} (@code{mh-toggle-mime-buttons}) to toggle
2450 the visibility of these buttons. You can turn on these buttons
2451 permanently by turning on the option
2452 @code{mh-display-buttons-for-inline-parts-flag}.
2453
2454 MH-E cannot display all attachments inline however. It can display
2455 text (including @sc{html}) and images.
2456
2457 @cindex header field, @samp{Content-Disposition}
2458 @cindex inline images
2459 @cindex @samp{Content-Disposition} header field
2460 @vindex mh-max-inline-image-height
2461 @vindex mh-max-inline-image-width
2462
2463 Some older mail programs do not insert the needed
2464 plumbing@footnote{This plumbing is the @samp{Content-Disposition:}
2465 header field.} to tell MH-E whether to display the attachments inline
2466 or not. If this is the case, MH-E will display these images inline if
2467 they are smaller than the window. However, you might want to allow
2468 larger images to be displayed inline. To do this, you can change the
2469 options @code{mh-max-inline-image-width} and
2470 @code{mh-max-inline-image-height} from their default value of zero to
2471 a large number. The size of your screen is a good choice for these
2472 numbers.
2473
2474 @cindex alternatives
2475 @cindex attachments, alternatives
2476 @vindex mh-display-buttons-for-alternatives-flag
2477
2478 Sometimes, a mail program will produce multiple alternatives of an
2479 attachment in increasing degree of faithfulness to the original
2480 content. By default, only the preferred alternative is displayed. If
2481 the option @code{mh-display-buttons-for-alternatives-flag} is on, then
2482 the preferred part is shown inline and buttons are shown for each of
2483 the other alternatives.
2484
2485 @vindex mm-discouraged-alternatives
2486
2487 Many people prefer to see the @samp{text/plain} alternative rather
2488 than the @samp{text/html} alternative. To do this in MH-E, customize
2489 the option @code{mm-discouraged-alternatives}, and add
2490 @samp{text/html}. The next best alternative, if any, will be shown.
2491
2492 @findex mh-show-preferred-alternative
2493 @kindex : (colon)
2494
2495 Occasionally, though, you might want to see the preferred alternative.
2496 The command @kbd{:} (@code{mh-show-preferred-alternative}) displays
2497 the message with the default preferred alternative. This is as if
2498 @code{mm-discouraged-alternatives} is set to @samp{nil}. Use the
2499 command @key{RET} (@code{mh-show}) to show the message normally again.
2500
2501 @kindex K i
2502 @findex mh-folder-inline-mime-part
2503
2504 You can view the raw contents of an attachment with the command @kbd{K
2505 i} (@code{mh-folder-inline-mime-part}). This command displays (or
2506 hides) the contents of the attachment associated with the button under
2507 the cursor verbatim. If the cursor is not located over a button, then
2508 the cursor first moves to the next button, wrapping to the beginning
2509 of the message if necessary. You can also provide a numeric prefix
2510 argument (as in @kbd{4 K i}) to view the attachment labeled with that
2511 number.
2512
2513 For additional information on buttons, see
2514 @ifinfo
2515 @ref{Article Buttons,,,gnus}, and @ref{MIME Commands,,,gnus}.
2516 @end ifinfo
2517 @ifnotinfo
2518 the chapters @uref{http://www.gnus.org/manual/gnus_101.html#SEC101,
2519 Article Buttons} and
2520 @uref{http://www.gnus.org/manual/gnus_108.html#SEC108, MIME Commands}
2521 in the @cite{The Gnus Manual}.
2522 @end ifnotinfo
2523
2524 @node HTML, Digests, Viewing Attachments, Reading Mail
2525 @section HTML
2526
2527 @cindex HTML
2528 @cindex Gnus
2529
2530 MH-E can display messages that have been sent in HTML@footnote{This
2531 feature depends on a version of Gnus that is at least 5.10.}. The
2532 content of the message will appear in the MH-Show buffer as you would
2533 expect if the entire message is HTML, or there is an inline HTML body
2534 part. However, if there is an HTML body part that is an attachment,
2535 then you'll see a button like this:
2536
2537 @smallexample
2538 [1. text/html; foo.html]...
2539 @end smallexample
2540
2541 To see how to read the contents of this body part, see @ref{Viewing
2542 Attachments}.
2543
2544 @vindex mm-text-html-renderer
2545
2546 The browser that MH-E uses is determined by the option
2547 @code{mm-text-html-renderer}. The default setting is set automatically
2548 based upon the presence of a known browser on your system. If you wish
2549 to use a different browser, then set this option accordingly. See the
2550 documentation for the browser you use for additional information on
2551 how to use it. In particular, find and disable the option to render
2552 images as this can tip off spammers that the email address they have
2553 used is valid.
2554
2555 @vindex mm-text-html-renderer
2556
2557 If you're confused about which @code{mm-text-html-renderer} to use,
2558 here's a brief description of each, sorted by popularity, that
2559 includes the results of a quick poll of MH-E users from 2005-12-23.
2560
2561 @table @asis
2562 @cindex browser, @samp{w3m}
2563 @cindex @samp{w3m}
2564 @kindex mouse-2
2565 @item @samp{w3m} 7
2566 The @samp{w3m} browser requires an external program. It's quick,
2567 produces pretty nice output, and best of all, it's the only browser
2568 that highlights links. These can be clicked with @kbd{mouse-2} to view
2569 the content of the link in @samp{w3m}. The @samp{w3m} browser handles
2570 tables well and actually respects the table's width parameter (which
2571 can cause text to wrap if the author didn't anticipate that the page
2572 would be viewed in Emacs).
2573 @c -------------------------
2574 @cindex browser, @samp{w3m-standalone}
2575 @cindex @samp{w3m-standalone}
2576 @item @samp{w3m-standalone} 3
2577 This browser, along with @samp{nil} for the external browser, are the
2578 only choices that work without having to download a separate lisp
2579 package or external program. This browser is quick, but does not show
2580 links. It handles simple tables but some tables get rendered much
2581 wider than the Emacs frame. This browser was the only one not to
2582 handle the escape @samp{&ndash;} (it printed a @samp{?}), but it did
2583 render @samp{&reg;}.
2584 @c -------------------------
2585 @cindex browser, @samp{links}
2586 @cindex @samp{links}
2587 @item @samp{links} 1
2588 The @samp{links} browser requires an external program. It's quick, and
2589 produces nicer output than @samp{lynx} on single column mails in
2590 tables. However, it doesn't show links and it doesn't do as nice a job
2591 on multi-column tables as some lines wrap. At least it fits in 80
2592 columns and thus seems better than @samp{w3} and
2593 @samp{w3m-standalone}. Converts escapes such as @samp{&reg;} to (R).
2594 @c -------------------------
2595 @cindex browser, @samp{lynx}
2596 @cindex @samp{lynx}
2597 @item @samp{lynx} 1
2598 The @samp{lynx} browser requires an external program. It's quick and
2599 produces pretty decent output but it doesn't show links. It doesn't
2600 seem to do multi-column tables which makes output much cleaner. It
2601 centers the output and wraps long lines more than most. Handles
2602 @samp{&reg;}.
2603 @c -------------------------
2604 @item @samp{nil} 1
2605 This choice obviously requires an external browser. Like
2606 @samp{w3m-standalone}, it works out of the box. With this setting,
2607 HTML messages have a button for the body part which you can view with
2608 @kbd{K v} (@code{mh-folder-toggle-mime-part}).
2609 @c -------------------------
2610 @cindex browser, @samp{w3}
2611 @cindex @samp{w3}
2612 @item @samp{w3} 0
2613 This choice does not require an external program as all of the
2614 rendering is done in lisp. You do need to get the package separately.
2615 This browser is @strong{slow}, and doesn't appear to have been updated
2616 since 2001 and the author hasn't responded to my emails. It displays
2617 unknown tags instead of hiding them, so you get to see all the
2618 Microsoft crap in certain messages. Tends to make multi-column tables
2619 wider than even a full-screen Emacs can handle. Like @samp{w3m}, you
2620 can follow links, but you have to find them first as they are not
2621 highlighted. Performs well on single-column tables and handles escapes
2622 such as @samp{&reg;}.
2623 @c -------------------------
2624 @cindex browser, @samp{html2text}
2625 @cindex @samp{html2text}
2626 @item @samp{html2text} 0
2627 The @samp{html2text} browser requires an external program. I noticed
2628 that it can do some nasty things with simple HTML mails (like filling
2629 the entire message as if it were one paragraph, including signature).
2630 On another message, it displayed half of the HTML tags for some
2631 reason.
2632 @end table
2633
2634 @vindex mm-text-html-renderer
2635
2636 For a couple more sources of information about
2637 @code{mm-text-html-renderer},
2638 @ifinfo
2639 @xref{Display Customization,,,emacs-mime}, and the documentation for
2640 the Gnus command @kbd{W h} (@pxref{Article Washing,,,gnus},).
2641 @end ifinfo
2642 @ifnotinfo
2643 see section @uref{http://www.gnus.org/manual/emacs-mime_6.html,
2644 Display Customization} in the @cite{The Emacs MIME Manual} and the
2645 documentation for the Gnus command @kbd{W h} (see section
2646 @uref{http://www.gnus.org/manual/gnus_99.html, Article Washing} in the
2647 @cite{The Gnus Manual}).
2648 @end ifnotinfo
2649
2650 @cindex @file{.emacs}
2651 @cindex files, @file{.emacs}
2652 @findex browse-url-at-mouse
2653 @kindex S-mouse-2
2654
2655 A useful key binding that you can add to @file{~/.emacs} is the
2656 following which displays an HTML link or textual URL in an external
2657 browser when clicked with @kbd{S-mouse-2}. This binding works in any
2658 buffer, including HTML buffers.
2659
2660 @smalllisp
2661 (global-set-key [S-mouse-2] 'browse-url-at-mouse)
2662 @end smalllisp
2663
2664 @node Digests, Reading PGP, HTML, Reading Mail
2665 @section Digests
2666
2667 @cindex digests
2668 @findex mh-page-digest
2669 @findex mh-page-digest-backwards
2670 @kindex D @key{BS}
2671 @kindex D @key{SPC}
2672 @kindex @key{BS}
2673 @kindex @key{SPC}
2674
2675 A digest is a message that contains other messages. Special MH-E
2676 commands let you read digests conveniently. You can use @key{SPC} and
2677 @key{BS} to page through the digest as if it were a normal message,
2678 but if you wish to skip to the next message in the digest, use
2679 @kbd{D @key{SPC}} (@code{mh-page-digest}). To return to a previous message,
2680 use @kbd{D @key{BS}} (@code{mh-page-digest-backwards}).
2681
2682 @cindex @command{burst}
2683 @cindex MH commands, @command{burst}
2684 @cindex MH-Folder Show mode
2685 @cindex modes, MH-Folder Show
2686 @findex mh-burst-digest
2687 @kindex d
2688 @kindex D b
2689 @kindex t
2690
2691 Another handy command is @kbd{D b} (@code{mh-burst-digest}). This
2692 command uses the MH command @command{burst}@footnote{See the section
2693 @uref{@value{MH-BOOK-HOME}/burdig.html, Bursting Messages} in the MH
2694 book.} to break out each message in the digest into its own message.
2695 Using this command, you can quickly delete unwanted messages, like
2696 this: Once the digest is split up, toggle out of MH-Folder Show mode
2697 with @kbd{t} (@pxref{Folders}) so that the scan lines fill the screen
2698 and messages aren't displayed. Then use @kbd{d} (@pxref{Reading Mail})
2699 to quickly delete messages that you don't want to read (based on the
2700 @samp{Subject:} header field). You can also burst the digest to reply
2701 directly to the people who posted the messages in the digest. One
2702 problem you may encounter is that the @samp{From:} header fields are
2703 preceded with a @samp{>} so that your reply can't create the
2704 @samp{To:} field correctly. In this case, you must correct the
2705 @samp{To:} field yourself. This is described later (@pxref{Editing
2706 Drafts}).
2707
2708 @node Reading PGP, Printing, Digests, Reading Mail
2709 @section Signed and Encrypted Messages
2710
2711 @cindex GPG
2712 @cindex GnuPG
2713 @cindex Gnus
2714 @cindex OpenPGP
2715 @cindex PGP
2716 @cindex RFC 3156
2717 @cindex encrypted messages
2718 @cindex security
2719 @cindex signed messages
2720
2721 You can read encrypted or signed PGP or GPG messages with
2722 MH-E@footnote{This feature depends on post-5.10 versions of Gnus.
2723 @cite{MIME Security with OpenPGP} is documented in
2724 @uref{http://www.rfc-editor.org/rfc/rfc3156.txt, RFC 3156}. However,
2725 MH-E can also decrypt old-style PGP messages that are not in MIME
2726 format.}. This section assumes that you already have a good
2727 understanding of GPG and have set up your keys appropriately.
2728
2729 If someone sends you a signed message, here is what you'll see:
2730
2731 @smallexample
2732 @group
2733 [[PGP Signed Part:Bill Wohler <wohler@@stop.mail-abuse.org>]]
2734 This is a signed message.
2735
2736 [[End of PGP Signed Part]]
2737 @end group
2738 @end smallexample
2739
2740 @cindex keychain
2741 @cindex key server
2742 @cindex signed messages
2743
2744 If the key for the given signature is not in your keychain, you'll be
2745 given the opportunity to fetch the key from a key server and verify
2746 the key. If the message is really large, the verification process can
2747 take a long time. You can press @kbd{C-g} at any time to
2748 cancel@footnote{Unfortunately in the current version, the validation
2749 process doesn't display a message so it appears that MH-E has hung. We
2750 hope that this will be fixed in the future.}.
2751
2752 If the signature doesn't check out, you might see something like this:
2753
2754 @smallexample
2755 @group
2756 [[PGP Signed Part:Failed]]
2757 This is a signed message.
2758 This is garbage added after the signature was made.
2759
2760 [[End of PGP Signed Part]]
2761 @end group
2762 @end smallexample
2763
2764 @cindex decrypting messages
2765
2766 If someone sends you an encrypted message, MH-E will ask for your
2767 passphrase to decrypt the message. You should see something like this:
2768
2769 @smallexample
2770 @group
2771 [[PGP Encrypted Part:OK]]
2772
2773 [[PGP Signed Part:Bill Wohler <wohler@@stop.mail-abuse.org>]]
2774 This is the secret message.
2775
2776 [[End of PGP Signed Part]]
2777
2778 [[End of PGP Encrypted Part]]
2779 @end group
2780 @end smallexample
2781
2782 If there is a problem decrypting the message, the button will say:
2783
2784 @smallexample
2785 [[PGP Encrypted Part:Failed]]
2786 @end smallexample
2787
2788 You can read the contents of this button using the methods described in
2789 @ref{Viewing Attachments}. If the message were corrupted, you'd see
2790 this:
2791
2792 @smallexample
2793 [[PGP Encrypted Part:Failed]
2794 Invalid base64 data]
2795 @end smallexample
2796
2797 If your passphrase were incorrect, you'd see something like this:
2798
2799 @smallexample
2800 [GNUPG:] ENC_TO CD9C88BB610BD9AD 1 0
2801 [GNUPG:] USERID_HINT CD9C88BB610BD9AD Bill Wohler <wohler@@stop.mail-abuse.org>
2802 [GNUPG:] NEED_PASSPHRASE CD9C88BB610BD9AD CD9C88BB610BD9AD 1 0
2803 [GNUPG:] BAD_PASSPHRASE CD9C88BB610BD9AD
2804 gpg: encrypted with 1024-bit RSA key, ID 610BD9AD, created 1997-09-09
2805 "Bill Wohler <wohler@@stop.mail-abuse.org>"
2806 gpg: public key decryption failed: bad passphrase
2807 [GNUPG:] BEGIN_DECRYPTION
2808 [GNUPG:] DECRYPTION_FAILED
2809 gpg: decryption failed: secret key not available
2810 [GNUPG:] END_DECRYPTION
2811
2812 gpg exited abnormally: '2'
2813 @end smallexample
2814
2815 @vindex mh-show-pgg-bad
2816 @vindex mh-show-pgg-good
2817 @vindex mh-show-pgg-unknown
2818
2819 The appearance of the buttons is controlled by the faces
2820 @code{mh-show-pgg-good}, @code{mh-show-pgg-bad}, and
2821 @code{mh-show-pgg-unknown} depending on the validity of the signature.
2822 The latter is used whether the signature is unknown or untrusted.
2823
2824 @cindex @samp{pgg} customization group
2825 @cindex PGG
2826 @cindex customization group, @samp{pgg}
2827
2828 The @samp{pgg} customization group may have some settings which may
2829 interest you.
2830 @iftex
2831 See @cite{The PGG Manual}.
2832 @end iftex
2833 @ifinfo
2834 @xref{Top, , The PGG Manual, pgg, The PGG Manual}.
2835 @end ifinfo
2836 @ifhtml
2837 See
2838 @uref{http://www.gnu.org/software/emacs/manual/pgg.html,
2839 @cite{The PGG Manual}}.
2840 @end ifhtml
2841
2842 @node Printing, Files and Pipes, Reading PGP, Reading Mail
2843 @section Printing Your Mail
2844
2845 @cindex printing
2846 @findex mh-ps-print-msg
2847 @findex mh-ps-print-msg-file
2848 @kindex P f
2849 @kindex P p
2850 @vindex mh-lpr-command-format
2851 @vindex mh-print-background-flag
2852
2853 To print messages in MH-E, use the command @kbd{P p}
2854 (@code{mh-ps-print-msg}). You can print all the messages in a range
2855 (as in @kbd{C-u P p 1 3 5-7 last:5 frombob @key{RET}},
2856 @pxref{Ranges}). You can also send the output to a file with @kbd{P f}
2857 (@code{mh-ps-print-msg-file}). This command will print inline text
2858 attachments but will not decrypt messages. However, when a message is
2859 displayed in an MH-Show buffer, then that buffer is used verbatim for
2860 printing with the caveat that only text attachments, if opened inline,
2861 are printed. Therefore, encrypted messages can be printed by showing
2862 and decrypting them first. The commands @kbd{P p} and @kbd{P f} do not
2863 use the options @code{mh-lpr-command-format} or
2864 @code{mh-print-background-flag}, described below.
2865
2866 @findex mh-ps-print-toggle-color
2867 @kindex P C
2868 @vindex ps-print-color-p
2869
2870 Colors are emulated on black-and-white printers with shades of gray.
2871 This might produce illegible output, even if your screen colors only
2872 use shades of gray. If this is the case, try using the command @kbd{P
2873 C} (@code{mh-ps-print-toggle-color}) to toggle between color, no
2874 color, and a black and white representation of the colors and see
2875 which works best. You change this setting permanently by customizing
2876 the option @code{ps-print-color-p}.
2877
2878 @findex mh-ps-print-toggle-faces
2879 @kindex P F
2880
2881 Another related function is the command @kbd{P F}
2882 (@code{mh-ps-print-toggle-faces}). This command toggles between using
2883 faces and not. When faces are enabled, the printed message will look
2884 very similar to the message in the MH-Show buffer.
2885
2886 @cindex ps-print package
2887 @cindex Emacs, packages, ps-print
2888
2889 MH-E uses the @samp{ps-print} package to do the printing, so you can
2890 customize the printing further by going to the @samp{ps-print}
2891 customization group.
2892
2893 @cindex @command{lpr}
2894 @cindex @command{mhl}
2895 @cindex MH commands, @command{mhl}
2896 @cindex Unix commands, @command{lpr}
2897 @findex mh-print-msg
2898 @kindex P l
2899
2900 An alternative to using the @samp{ps-print} package is the command
2901 @kbd{P l} (@code{mh-print-msg}) (the @i{l} is for @i{l}ine printer or
2902 @i{l}pr). You can print all the messages in a range. The message is
2903 formatted with @command{mhl}@footnote{See the section
2904 @uref{@value{MH-BOOK-HOME}/shomes.html#Usisho, Using mhl} in the MH
2905 book.} and printed with the @command{lpr} command.
2906
2907 @kindex P f
2908 @kindex P l
2909 @kindex P p
2910 @vindex mh-lpr-command-format
2911 @vindex mh-print-background-flag
2912
2913 The command @kbd{P l} uses two options. The option
2914 @code{mh-lpr-command-format} contains the Unix command line which
2915 performs the actual printing. The string can contain one escape,
2916 @samp{%s}, which is replaced by the name of the folder and the message
2917 number and is useful for print job names. The default setting is
2918 @code{"lpr -J '%s'"}. I use @code{"mpage -h'%s' -b Letter -H1of -mlrtb
2919 -P"} which produces a nice header and adds a bit of margin so the text
2920 fits within my printer's margins. Normally messages are printed in the
2921 foreground. If this is slow on your system, you may elect to turn on
2922 the option @code{mh-print-background-flag} to print in the background.
2923 If you do this, do not delete the message until it is printed or else
2924 the output may be truncated. These options are not used by the
2925 commands @kbd{P p} or @kbd{P f}.
2926
2927 @node Files and Pipes, Navigating, Printing, Reading Mail
2928 @section Files and Pipes
2929
2930 @cindex files
2931 @cindex pipes
2932 @findex mh-refile-or-write-again
2933 @findex mh-write-msg-to-file
2934 @kindex >
2935 @kindex !
2936
2937 MH-E does offer a couple of commands that are not a part of MH@. The
2938 first one, @kbd{>} (@code{mh-write-msg-to-file}), writes a message to
2939 a file. You are prompted for the filename. If the file already exists,
2940 the message is appended to it. You can also write the message to the
2941 file without the header by specifying a prefix argument (such as
2942 @kbd{C-u > /tmp/foobar @key{RET}}). Subsequent writes to the same file
2943 can be made with the command @kbd{!}
2944 (@code{mh-refile-or-write-again}).
2945
2946 @findex mh-pipe-msg
2947 @kindex |
2948 @kindex l
2949
2950 You can also pipe the message through a Unix shell command with the
2951 command @kbd{|} (@code{mh-pipe-msg}). You are prompted for the Unix
2952 command through which you wish to run your message. If you give a
2953 prefix argument to this command, the message header is included in the
2954 text passed to the command (the contrived example @kbd{C-u | lpr}
2955 would be done with the @kbd{l} command instead).
2956
2957 @cindex @command{shar}
2958 @cindex @command{uuencode}
2959 @cindex Unix commands, @command{shar}
2960 @cindex Unix commands, @command{uuencode}
2961 @findex mh-store-msg
2962 @kindex X s
2963 @vindex mh-store-default-directory
2964
2965 If the message is a shell archive @command{shar} or has been run
2966 through @command{uuencode} use @kbd{X s} (@code{mh-store-msg}) to
2967 extract the body of the message. The default directory for extraction
2968 is the current directory; however, you have a chance to specify a
2969 different extraction directory. The next time you use this command,
2970 the default directory is the last directory you used. If you would
2971 like to change the initial default directory, customize the option
2972 @code{mh-store-default-directory}, change the value from
2973 @samp{Current} to @samp{Directory}, and then enter the name of the
2974 directory for storing the content of these messages.
2975
2976 @findex mh-store-buffer
2977 @kindex @key{RET}
2978 @kindex X s
2979
2980 By the way, @kbd{X s} calls the Emacs Lisp function
2981 @code{mh-store-buffer}. I mention this because you can use it directly
2982 if you're editing a buffer that contains a file that has been run
2983 through @command{uuencode} or @command{shar}. For example, you can
2984 extract the contents of the current buffer in your home directory by
2985 typing @kbd{M-x mh-store-buffer @key{RET} ~ @key{RET}}.
2986
2987 @node Navigating, Miscellaneous Commands and Options, Files and Pipes, Reading Mail
2988 @section Navigating
2989
2990 @cindex moving between messages
2991 @cindex navigation
2992 @findex mh-first-msg
2993 @findex mh-goto-msg
2994 @findex mh-last-msg
2995 @findex mh-next-undeleted-msg
2996 @findex mh-next-unread-msg
2997 @findex mh-previous-undeleted-msg
2998 @findex mh-previous-unread-msg
2999 @kindex g
3000 @kindex M-<
3001 @kindex M->
3002 @kindex M-n
3003 @kindex M-p
3004 @kindex n
3005 @kindex p
3006
3007 To move on to the next message, use the command @kbd{n}
3008 (@code{mh-next-undeleted-msg}); use @kbd{p}
3009 (@code{mh-previous-undeleted-msg}) to read the previous message. To
3010 move to the next unread message, use @kbd{M-n}
3011 (@code{mh-next-unread-msg}); use @kbd{M-p}
3012 (@code{mh-previous-unread-msg}) to move to the previous unread
3013 message. These commands can be given a prefix argument to specify how
3014 many messages to skip (for example, @kbd{5 n}). You can also move to a
3015 specific message with @kbd{g} (@code{mh-goto-msg}). You can enter the
3016 message number either before or after typing @kbd{g}. In the latter
3017 case, Emacs prompts you. Finally, you can go to the first or last
3018 message with @kbd{M-<} (@code{mh-first-msg}) and @kbd{M->}
3019 (@code{mh-last-msg}) respectively.
3020
3021 @cindex MH-Folder mode
3022 @cindex modes, MH-Folder
3023 @findex next-line
3024 @findex previous-line
3025 @kindex C-n
3026 @kindex C-p
3027 @kindex @key{RET}
3028
3029 You can also use the Emacs commands @kbd{C-p} (@code{previous-line})
3030 and @kbd{C-n} (@code{next-line}) to move up and down the scan lines in
3031 the MH-Folder window. These commands can be used in conjunction with
3032 @key{RET} to look at deleted or refiled messages.
3033
3034 @cindex deleting messages
3035 @findex mh-delete-msg
3036 @kindex d
3037 @kindex n
3038 @kindex p
3039
3040 To mark a message for deletion, use the command @kbd{d}
3041 (@code{mh-delete-msg}). A @samp{D} is placed by the message in the
3042 scan window, and the next undeleted message is displayed. If the
3043 previous command had been @kbd{p}, then the next message displayed is
3044 the first undeleted message previous to the message just deleted. Use
3045 @kbd{n} to force subsequent @kbd{d} commands to move forward to the
3046 next undeleted message after deleting the message under the cursor.
3047 You may also specify a range (for example, @kbd{C-u d 1 3 5-7 last:5
3048 frombob @key{RET}}, @pxref{Ranges}).
3049
3050 @findex mh-delete-msg-no-motion
3051 @kindex C-d
3052
3053 The command @kbd{C-d} (@code{mh-delete-msg-no-motion}) marks the
3054 message (or messages in range) for deletion but leaves the cursor at
3055 the current message in case you wish to perform other operations on
3056 the message.
3057
3058 @findex mh-delete-subject
3059 @findex mh-delete-subject-or-thread
3060 @findex mh-thread-delete
3061 @findex mh-undo
3062 @kindex k
3063 @kindex T d
3064 @kindex u
3065
3066 And to delete more messages faster, you can use @kbd{k}
3067 (@code{mh-delete-subject-or-thread}) to delete all the messages with
3068 the same subject as the current message. This command puts these
3069 messages in a sequence named @samp{subject}. You can undo this action
3070 by using @kbd{u} (@code{mh-undo}) with a prefix argument and then
3071 specifying the @samp{subject} sequence. However, if the buffer is
3072 displaying a threaded view of the folder then @kbd{k} behaves like
3073 @kbd{T d} (@code{mh-thread-delete}). @xref{Threading}.
3074
3075 @findex mh-execute-commands
3076 @kindex x
3077
3078 However you mark a message for deletion, the command @kbd{x}
3079 (@code{mh-execute-commands}) actually carries out the deletion
3080 (@pxref{Folders}).
3081
3082 @vindex mh-delete-msg-hook
3083
3084 The hook @code{mh-delete-msg-hook} is called after you mark a message
3085 for deletion. For example, a past maintainer of MH-E used this once
3086 when he kept statistics on his mail usage.
3087
3088 @node Miscellaneous Commands and Options, , Navigating, Reading Mail
3089 @section Miscellaneous Commands and Options
3090
3091 This section contains a few more miscellaneous commands and options.
3092
3093 @cindex editing message
3094 @findex mh-modify
3095 @kindex M
3096
3097 There are times when you need to edit a message. For example, you may
3098 need to fix a broken Content-Type header field. You can do this with
3099 the command @kbd{M} (@code{mh-modify}). It displays the raw message in
3100 an editable buffer. When you are done editing, save and kill the
3101 buffer as you would any other.
3102
3103 @findex mh-kill-folder
3104 @findex mh-pack-folder
3105 @vindex mh-do-not-confirm-flag
3106
3107 Commands such as @code{mh-pack-folder} prompt to confirm whether to
3108 process outstanding moves and deletes or not before continuing.
3109 Turning on the option @code{mh-do-not-confirm-flag} means that these
3110 actions will be performed---which is usually desired but cannot be
3111 retracted---without question@footnote{In previous versions of MH-E,
3112 this option suppressed the confirmation in @code{mh-kill-folder}.
3113 Since this kept most users from setting this option,
3114 @code{mh-kill-folder} was modified in version 6.0 to always ask for
3115 confirmation subject to @code{mh-kill-folder-suppress-prompt-hook}.
3116 @xref{Folders}.}.
3117
3118 @cindex MH-Folder mode
3119 @cindex modes, MH-Folder
3120 @vindex mh-summary-height
3121
3122 The option @code{mh-summary-height} controls the number of scan lines
3123 displayed in the MH-Folder window, including the mode line. The
3124 default value of this option is @samp{Automatic} which means that the
3125 MH-Folder buffer will maintain the same proportional size if the frame
3126 is resized. If you'd prefer a fixed height, then choose the
3127 @samp{Fixed Size} option and enter the number of lines you'd like to
3128 see.
3129
3130 @vindex mh-bury-show-buffer-flag
3131
3132 Normally the buffer for displaying messages is buried at the bottom at
3133 the buffer stack. You may wish to disable this feature by turning off
3134 the option @code{mh-bury-show-buffer-flag}. One advantage of not
3135 burying the show buffer is that one can delete the show buffer more
3136 easily in an electric buffer list because of its proximity to its
3137 associated MH-Folder buffer. Try running @kbd{M-x
3138 electric-buffer-list} to see what I mean.
3139
3140 @cindex @file{.emacs}
3141 @cindex files, @file{.emacs}
3142 @cindex reading mail
3143
3144 Before we leave this section, I'll include a function that I use as a
3145 front end to MH-E@footnote{Stephen Gildea's favorite binding is
3146 @kbd{(global-set-key "\C-cr" 'mh-rmail)}.}. It toggles between your
3147 working window configuration, which may be quite involved---windows
3148 filled with source, compilation output, man pages, and other
3149 documentation---and your MH-E window configuration. Like the rest of
3150 the customization described in this section, simply add the following
3151 code to @file{~/.emacs}.
3152
3153 @iftex
3154 @filbreak
3155 @end iftex
3156
3157 @findex mh-rmail, example
3158
3159 @smalllisp
3160 @group
3161 (defvar my-mh-screen-saved nil
3162 "Set to non-nil when MH-E window configuration shown.")
3163 (defvar my-normal-screen nil "Normal window configuration.")
3164 (defvar my-mh-screen nil "MH-E window configuration.")
3165
3166 (defun my-mh-rmail (&optional arg)
3167 "Toggle between MH-E and normal screen configurations.
3168 With non-nil or prefix argument, include mailbox as well
3169 when going into mail."
3170 (interactive "P") ; @r{user callable function, P=prefix arg}
3171 (setq my-mh-screen-saved ; @r{save state}
3172 (cond
3173 ;; @r{Bring up MH-E screen if arg or normal window configuration.}
3174 ;; @r{If arg or +inbox buffer doesn't exist, run mh-rmail.}
3175 ((or arg (null my-mh-screen-saved))
3176 (setq my-normal-screen (current-window-configuration))
3177 (if (or arg (null (get-buffer "+inbox")))
3178 (mh-rmail)
3179 (set-window-configuration my-mh-screen))
3180 t) ; @r{set my-mh-screen-saved to @code{t}}
3181 ;; @r{Otherwise, save MH-E screen and restore normal screen.}
3182 (t
3183 (setq my-mh-screen (current-window-configuration))
3184 (set-window-configuration my-normal-screen)
3185 nil)))) ; @r{set my-mh-screen-saved to nil}
3186
3187 (global-set-key "\C-x\r" 'my-mh-rmail) ;@r{ call with C-x @key{RET}}
3188
3189 @i{Starting MH-E}
3190
3191 @end group
3192 @end smalllisp
3193
3194 If you type an argument (@kbd{C-u}) or if @code{my-mh-screen-saved} is
3195 @code{nil} (meaning a non-MH-E window configuration), the current
3196 window configuration is saved, either the @samp{+inbox} buffer is
3197 displayed or @code{mh-rmail} is run, and the MH-E window configuration
3198 is shown. Otherwise, the MH-E window configuration is saved and the
3199 original configuration is displayed.
3200
3201 @node Folders, Sending Mail, Reading Mail, Top
3202 @chapter Organizing Your Mail with Folders
3203
3204 @cindex @samp{Folder} menu
3205 @cindex @samp{Message} menu
3206 @cindex folders
3207 @cindex menu, @samp{Folder}
3208 @cindex menu, @samp{Message}
3209 @cindex using folders
3210
3211 This chapter discusses the things you can do with folders within MH-E@.
3212 The commands in this chapter are also found in the @samp{Folder} and
3213 @samp{Message} menus.
3214
3215 @table @kbd
3216 @kindex ?
3217 @findex mh-help
3218 @item ?
3219 Display cheat sheet for the MH-E commands (@code{mh-help}).
3220 @c -------------------------
3221 @kindex !
3222 @findex mh-refile-or-write-again
3223 @item !
3224 Repeat last output command (@code{mh-refile-or-write-again}).
3225 @c -------------------------
3226 @cindex @samp{Message > Copy Message to Folder...} menu item
3227 @cindex menu item, @samp{Message > Copy Message to Folder...}
3228 @kindex c
3229 @findex mh-copy-msg
3230 @item c
3231 Copy range to folder (@code{mh-copy-msg}).
3232 @c -------------------------
3233 @kindex F ?
3234 @findex mh-prefix-help
3235 @item F ?
3236 Display cheat sheet for the commands of the current prefix in
3237 minibuffer (@code{mh-prefix-help}).
3238 @c -------------------------
3239 @kindex F '
3240 @findex mh-index-ticked-messages
3241 @item F '
3242 Display ticked messages (@code{mh-index-ticked-messages}).
3243 @c -------------------------
3244 @kindex F c
3245 @findex mh-catchup
3246 @item F c
3247 Delete range from the @samp{unseen} sequence (@code{mh-catchup}).
3248 @c -------------------------
3249 @kindex F k
3250 @findex mh-kill-folder
3251 @item F k
3252 Remove folder (@code{mh-kill-folder}).
3253 @c -------------------------
3254 @cindex @samp{Folder > List Folders} menu item
3255 @cindex menu item, @samp{Folder > List Folders}
3256 @kindex F l
3257 @findex mh-list-folders
3258 @item F l
3259 List all folders (@code{mh-list-folders}).
3260 @c -------------------------
3261 @cindex @samp{Folder > View New Messages} menu item
3262 @cindex menu item, @samp{Folder > View New Messages}
3263 @kindex F n
3264 @findex mh-index-new-messages
3265 @item F n
3266 Display unseen messages (@code{mh-index-new-messages}).
3267 @c -------------------------
3268 @cindex @samp{Folder > Pack Folder} menu item
3269 @cindex menu item, @samp{Folder > Pack Folder}
3270 @kindex F p
3271 @findex mh-pack-folder
3272 @item F p
3273 Pack folder (@code{mh-pack-folder}).
3274 @c -------------------------
3275 @kindex F q
3276 @findex mh-index-sequenced-messages
3277 @item F q
3278 Display messages in any sequence (@code{mh-index-sequenced-messages}).
3279 @c -------------------------
3280 @cindex @samp{Folder > Rescan Folder} menu item
3281 @cindex menu item, @samp{Folder > Rescan Folder}
3282 @kindex F r
3283 @findex mh-rescan-folder
3284 @item F r
3285 Rescan folder (@code{mh-rescan-folder}).
3286 @c -------------------------
3287 @cindex @samp{Folder > Search...} menu item
3288 @cindex menu item, @samp{Folder > Search...}
3289 @kindex F s
3290 @findex mh-search
3291 @item F s
3292 Search your MH mail (@code{mh-search}).
3293 @c -------------------------
3294 @cindex @samp{Folder > Sort Folder} menu item
3295 @cindex menu item, @samp{Folder > Sort Folder}
3296 @kindex F S
3297 @findex mh-sort-folder
3298 @item F S
3299 Sort folder (@code{mh-sort-folder}).
3300 @c -------------------------
3301 @kindex F u
3302 @findex mh-undo-folder
3303 @item F u
3304 Undo all refiles and deletes in the current folder (@code{mh-undo-folder}).
3305 @c -------------------------
3306 @cindex @samp{Folder > Visit a Folder...} menu item
3307 @cindex menu item, @samp{Folder > Visit a Folder...}
3308 @kindex F v
3309 @findex mh-visit-folder
3310 @item F v
3311 Visit folder (@code{mh-visit-folder}).
3312 @c -------------------------
3313 @cindex @samp{Message > Refile Message} menu item
3314 @cindex menu item, @samp{Message > Refile Message}
3315 @kindex o
3316 @findex mh-refile-msg
3317 @item o
3318 Refile (output) range into folder (@code{mh-refile-msg}).
3319 @c -------------------------
3320 @cindex @samp{Folder > Quit MH-E} menu item
3321 @cindex menu item, @samp{Folder > Quit MH-E}
3322 @kindex q
3323 @findex mh-quit
3324 @item q
3325 Quit the current MH-E folder (@code{mh-quit}).
3326 @c -------------------------
3327 @cindex @samp{Folder > Toggle Show/Folder} menu item
3328 @cindex menu item, @samp{Folder > Toggle Show/Folder}
3329 @kindex t
3330 @findex mh-toggle-showing
3331 @item t
3332 Toggle between MH-Folder and MH-Folder Show modes
3333 (@code{mh-toggle-showing}).
3334 @c -------------------------
3335 @cindex @samp{Message > Undo Delete/Refile} menu item
3336 @cindex menu item, @samp{Message > Undo Delete/Refile}
3337 @kindex u
3338 @findex mh-undo
3339 @item u
3340 Undo pending deletes or refiles in range (@code{mh-undo}).
3341 @c -------------------------
3342 @cindex @samp{Message > Execute Delete/Refile} menu item
3343 @cindex menu item, @samp{Message > Execute Delete/Refile}
3344 @kindex x
3345 @findex mh-execute-commands
3346 @item x
3347 Process outstanding delete and refile requests
3348 (@code{mh-execute-commands}).
3349 @end table
3350
3351 @cindex @samp{mh-folder} customization group
3352 @cindex customization group, @samp{mh-folder}
3353
3354 The @samp{mh-folder} customization group is used to tune these
3355 commands.
3356
3357 @vtable @code
3358 @item mh-new-messages-folders
3359 Folders searched for the @samp{unseen} sequence (default:
3360 @code{Inbox}).
3361 @c -------------------------
3362 @item mh-ticked-messages-folders
3363 Folders searched for @code{mh-tick-seq} (default: @code{t}).
3364 @c -------------------------
3365 @item mh-large-folder
3366 The number of messages that indicates a large folder (default: 200).
3367 @c -------------------------
3368 @item mh-recenter-summary-flag
3369 On means to recenter the summary window (default: @samp{off}).
3370 @c -------------------------
3371 @item mh-recursive-folders-flag
3372 On means that commands which operate on folders do so recursively
3373 (default: @samp{off}).
3374 @c -------------------------
3375 @item mh-sortm-args
3376 Additional arguments for @command{sortm} (default: @code{nil}).
3377 @end vtable
3378
3379 The following hooks are available.
3380
3381 @vtable @code
3382 @item mh-after-commands-processed-hook
3383 Hook run by @kbd{x} after performing outstanding refile and delete
3384 requests (default: @code{nil}).
3385 @c -------------------------
3386 @item mh-before-commands-processed-hook
3387 Hook run by @kbd{x} before performing outstanding refile and delete
3388 requests (default: @code{nil}).
3389 @c -------------------------
3390 @item mh-before-quit-hook
3391 Hook run by q before quitting MH-E (default: @code{nil}).
3392 @c -------------------------
3393 @item mh-folder-mode-hook
3394 Hook run by @code{mh-folder-mode} when visiting a new folder (default:
3395 @code{nil}).
3396 @c -------------------------
3397 @item mh-kill-folder-suppress-prompt-hook
3398 Abnormal hook run at the beginning of @code{mh-kill-folder} (default:
3399 @code{'mh-search-p}).
3400 @c -------------------------
3401 @item mh-pack-folder-hook
3402 Hook run by @code{mh-pack-folder} after renumbering the messages
3403 (default: @code{nil}).
3404 @c -------------------------
3405 @item mh-quit-hook
3406 Hook run by q after quitting MH-E (default: @code{nil}).
3407 @c -------------------------
3408 @item mh-refile-msg-hook
3409 Hook run by o after marking each message for refiling (default:
3410 @code{nil}).
3411 @end vtable
3412
3413 The following faces are available for customizing the appearance of
3414 the MH-Folder buffer. @xref{Scan Line Formats}.
3415
3416 @vtable @code
3417 @item mh-folder-address
3418 Recipient face.
3419 @c -------------------------
3420 @item mh-folder-body
3421 Body text face.
3422 @c -------------------------
3423 @item mh-folder-cur-msg-number
3424 Current message number face.
3425 @c -------------------------
3426 @item mh-folder-date
3427 Date face.
3428 @c -------------------------
3429 @item mh-folder-deleted
3430 Deleted message face.
3431 @c -------------------------
3432 @item mh-folder-followup
3433 @samp{Re:} face.
3434 @c -------------------------
3435 @item mh-folder-msg-number
3436 Message number face.
3437 @c -------------------------
3438 @item mh-folder-refiled
3439 Refiled message face.
3440 @c -------------------------
3441 @vindex mh-scan-format-nmh
3442 @vindex mh-scan-sent-to-me-sender-regexp
3443 @item mh-folder-sent-to-me-hint
3444 Fontification hint face in messages sent directly to us. The detection
3445 of messages sent to us is governed by the scan format
3446 @code{mh-scan-format-nmh} and regular expression
3447 @code{mh-scan-sent-to-me-sender-regexp}.
3448 @c -------------------------
3449 @vindex mh-scan-format-nmh
3450 @vindex mh-scan-sent-to-me-sender-regexp
3451 @item mh-folder-scan-format
3452 Sender face in messages sent directly to us. The detection of messages
3453 sent to us is governed by the scan format @code{mh-scan-format-nmh}
3454 and regular expression @code{mh-scan-sent-to-me-sender-regexp}.
3455 @c -------------------------
3456 @item mh-folder-subject
3457 Subject face.
3458 @c -------------------------
3459 @item mh-folder-tick
3460 Ticked message face.
3461 @c -------------------------
3462 @item mh-folder-to
3463 @samp{To:} face.
3464 @end vtable
3465
3466 @vindex mh-folder-mode-hook
3467
3468 The hook @code{mh-folder-mode-hook} is called when visiting a new
3469 folder in MH-Folder mode. This could be used to set your own key
3470 bindings, for example:
3471
3472 @vindex mh-folder-mode-hook, example
3473
3474 @smalllisp
3475 @group
3476 (defvar my-mh-init-done nil
3477 "Non-nil when one-time MH-E settings made.")
3478
3479 (defun my-mh-folder-mode-hook ()
3480 "Hook to set key bindings in MH-Folder mode."
3481 (if (not my-mh-init-done) ; @r{only need to bind the keys once }
3482 (progn
3483 (local-set-key "//" 'my-search-msg)
3484 (local-set-key "b" 'mh-burst-digest) ; @r{better use of @kbd{b}}
3485 (setq my-mh-init-done t))))
3486
3487 (add-hook 'mh-folder-mode-hook 'my-mh-folder-mode-hook)
3488
3489 (defun my-search-msg ()
3490 "Search for a regexp in the current message."
3491 (interactive) ; @r{user function}
3492 (save-window-excursion
3493 (other-window 1) ; @r{go to next window}
3494 (isearch-forward-regexp))) ; @r{string search; hit return}
3495 ; @r{ when done}
3496
3497 @i{Create additional key bindings via mh-folder-mode-hook}
3498
3499 @end group
3500 @end smalllisp
3501
3502 @cindex @command{folder}
3503 @cindex @command{refile}
3504 @cindex MH commands, @command{folder}
3505 @cindex MH commands, @command{refile}
3506 @findex mh-refile-msg
3507 @kindex o
3508 @vindex mh-refile-msg-hook
3509
3510 MH-E has analogies for each of the MH @command{folder} and
3511 @command{refile} commands@footnote{See the sections
3512 @uref{@value{MH-BOOK-HOME}/fol.html#Youfol, Your Current Folder:
3513 folder} and @uref{@value{MH-BOOK-HOME}/fol.html#Movref, Moving and
3514 Linking Messages: refile} in the MH book.}. To refile a message in
3515 another folder, use the command @kbd{o} (@code{mh-refile-msg})
3516 (mnemonic: ``output''). You are prompted for the folder name
3517 (@pxref{Folder Selection}). Note that this command can also be used to
3518 create folders. If you specify a folder that does not exist, you will
3519 be prompted to create it. The hook @code{mh-refile-msg-hook} is called
3520 after a message is marked to be refiled.
3521
3522 @findex mh-write-msg-to-file
3523 @kindex !
3524
3525 If you are refiling several messages into the same folder, you can use
3526 the command @kbd{!} (@code{mh-refile-or-write-again}) to repeat the
3527 last refile or write (for the description of @kbd{>}
3528 (@code{mh-write-msg-to-file}), @pxref{Files and Pipes}). You can use a
3529 range in either case (for example, @kbd{C-u o 1 3 5-7 last:5 frombob
3530 @key{RET}}, @pxref{Ranges}).
3531
3532 @cindex expunging refiles and deletes
3533 @cindex undoing refiles and deletes
3534 @findex mh-undo
3535 @kindex u
3536
3537 If you've deleted a message or refiled it, but changed your mind, you
3538 can cancel the action before you've executed it. Use @kbd{u}
3539 (@code{mh-undo}) to undo a refile on or deletion of a single message.
3540 You can also undo refiles and deletes for messages that are found in a
3541 given range (@pxref{Ranges}).
3542
3543 @findex mh-undo-folder
3544 @kindex F u
3545
3546 Alternatively, you can use @kbd{F u} (@code{mh-undo-folder}) to undo
3547 all refiles and deletes in the current folder.
3548
3549 @findex mh-execute-commands
3550 @kindex x
3551
3552 If you've marked messages to be deleted or refiled and you want to go
3553 ahead and delete or refile the messages, use @kbd{x}
3554 (@code{mh-execute-commands}). Many MH-E commands that may affect the
3555 numbering of the messages (such as @kbd{F r} or @kbd{F p}) will ask if
3556 you want to process refiles or deletes first and then either run
3557 @kbd{x} for you or undo the pending refiles and deletes.
3558
3559 @kindex x
3560 @vindex mh-after-commands-processed-hook
3561 @vindex mh-before-commands-processed-hook
3562 @vindex mh-current-folder
3563
3564 The command @kbd{x} runs @code{mh-before-commands-processed-hook}
3565 before the commands are processed and
3566 @code{mh-after-commands-processed-hook} after the commands are
3567 processed. Variables that are useful with the former hook include
3568 @code{mh-delete-list} and @code{mh-refile-list} which can be used to
3569 see which changes will be made to the current folder,
3570 @code{mh-current-folder}. Variables that are useful with the latter
3571 hook include @code{mh-folders-changed}, which lists which folders were
3572 affected by deletes and refiles. This list will always include the
3573 current folder @code{mh-current-folder}.
3574
3575 @findex mh-copy-msg
3576 @kindex c
3577 @kindex o
3578
3579 If you wish to copy a message to another folder, you can use the
3580 command @kbd{c} (@code{mh-copy-msg}) (see the @option{-link} argument
3581 to @command{refile}(1)). Like the command @kbd{o}, this command
3582 prompts you for the name of the target folder and you can specify a
3583 range (@pxref{Ranges}). Note that unlike the command @kbd{o}, the copy
3584 takes place immediately. The original copy remains in the current
3585 folder.
3586
3587 @cindex junk mail
3588 @cindex MH-Folder mode
3589 @cindex MH-Folder Show mode
3590 @cindex modes, MH-Folder
3591 @cindex modes, MH-Folder Show
3592 @cindex spam
3593 @findex mh-toggle-showing
3594 @kindex t
3595
3596 The command @kbd{t} (@code{mh-toggle-showing}) switches between
3597 MH-Folder mode and MH-Folder Show mode@footnote{For you Emacs wizards,
3598 this is implemented as an Emacs minor mode.}. MH-Folder mode turns off
3599 the associated show buffer so that you can perform operations on the
3600 messages quickly without reading them. This is an excellent way to
3601 prune out your junk mail or to refile a group of messages to another
3602 folder for later examination.
3603
3604 @cindex MH-Folder mode
3605 @cindex MH-Show mode
3606 @cindex modes, MH-Folder
3607 @cindex modes, MH-Show
3608 @cindex moving between messages
3609 @kindex t
3610 @vindex mh-recenter-summary-flag
3611
3612 When you use @kbd{t} to toggle from MH-Folder Show mode to MH-Folder
3613 mode, the MH-Show buffer is hidden and the MH-Folder buffer is left
3614 alone. Setting @code{mh-recenter-summary-flag} to a non-@code{nil}
3615 value causes the toggle to display as many scan lines as possible,
3616 with the cursor at the middle. The effect of
3617 @code{mh-recenter-summary-flag} is rather useful, but it can be
3618 annoying on a slow network connection.
3619
3620 @findex mh-visit-folder
3621 @kindex F v
3622 @vindex mh-large-folder
3623
3624 When you want to read the messages that you have refiled into folders,
3625 use the command @kbd{F v} (@code{mh-visit-folder}) to visit the
3626 folder. You are prompted for the folder name. The folder buffer will
3627 show just unseen messages if there are any; otherwise, it will show
3628 all the messages in the buffer as long there are fewer than
3629 @code{mh-large-folder} messages. If there are more, then you are
3630 prompted for a range of messages to scan. You can provide a prefix
3631 argument in order to specify a range of messages to show when you
3632 visit the folder (@pxref{Ranges}). In this case, regions are not used
3633 to specify the range and @code{mh-large-folder} is ignored. Note that
3634 this command can also be used to create folders. If you specify a
3635 folder that does not exist, you will be prompted to create it.
3636
3637 @findex mh-search
3638 @kindex F s
3639
3640 If you forget where you've refiled your messages, you can find them
3641 using @kbd{F s} (@code{mh-search}). @xref{Searching}.
3642
3643 @cindex @command{procmail}
3644 @cindex @samp{unseen} sequence
3645 @cindex sequence, @samp{unseen}
3646 @cindex Unix commands, @command{procmail}
3647 @cindex unseen messages, viewing
3648 @findex mh-index-new-messages
3649 @kindex F n
3650 @vindex mh-new-messages-folders
3651
3652 If you use a program such as @command{procmail} to file your incoming
3653 mail automatically, you can display new, unseen, messages using the
3654 command @kbd{F n} (@code{mh-index-new-messages}). All messages in the
3655 @samp{unseen} sequence from the folders in
3656 @code{mh-new-messages-folders} are listed. However, this list of
3657 folders can be overridden with a prefix argument: with a prefix
3658 argument, enter a space-separated list of folders, or nothing to
3659 search all folders.
3660
3661 @cindex @samp{tick} sequence
3662 @cindex sequence, @samp{tick}
3663 @cindex ticked messages, viewing
3664 @findex mh-index-ticked-messages
3665 @kindex F '
3666 @vindex mh-ticked-messages-folders
3667
3668 If you have ticked messages (@pxref{Sequences}), you can display them
3669 using the command @kbd{F '} (@code{mh-index-ticked-messages}). All
3670 messages in the @samp{tick} sequence from the folders in
3671 @code{mh-ticked-messages-folders} are listed. With a prefix argument,
3672 enter a space-separated list of folders, or nothing to search all
3673 folders.
3674
3675 @findex mh-index-sequenced-messages
3676 @kindex F q
3677 @vindex mh-new-messages-folders
3678
3679 You can display messages in any sequence with the command @kbd{F q}
3680 (@code{mh-index-sequenced-messages}). All messages from the folders in
3681 @code{mh-new-messages-folders} in the sequence you provide are listed.
3682 With a prefix argument, enter a space-separated list of folders at the
3683 prompt, or nothing to search all folders.
3684
3685 @vindex mh-new-messages-folders
3686 @vindex mh-recursive-folders-flag
3687 @vindex mh-ticked-messages-folders
3688
3689 Set the options @code{mh-new-messages-folders} and
3690 @code{mh-ticked-messages-folders} to @samp{Inbox} to search the
3691 @samp{+inbox} folder or @samp{All} to search all of the top level
3692 folders. Otherwise, list the folders that should be searched with the
3693 @samp{Choose Folders} menu item. See @code{mh-recursive-folders-flag}.
3694
3695 @cindex buffers, @file{*MH-E Folders*}
3696 @cindex @file{*MH-E Folders*}
3697 @findex mh-kill-folder
3698 @findex mh-list-folders
3699 @findex mh-pack-folder
3700 @findex mh-rescan-folder
3701 @findex mh-sort-folder
3702 @kindex F k
3703 @kindex F l
3704 @kindex F p
3705 @kindex F r
3706 @kindex F S
3707
3708 Other commands you can perform on folders include: @kbd{F l}
3709 (@code{mh-list-folders}), to place a listing of all the folders in
3710 your mail directory in a buffer called @file{*MH-E Folders*}
3711 (@pxref{Miscellaneous}); @kbd{F k} (@code{mh-kill-folder}), to remove
3712 a folder; @kbd{F S} (@code{mh-sort-folder}), to sort the messages by
3713 date (see @command{sortm}(1) to see how to sort by other criteria);
3714 @kbd{F p} (@code{mh-pack-folder}), to pack a folder, removing gaps
3715 from the numbering sequence; and @kbd{F r} (@code{mh-rescan-folder}),
3716 to rescan the folder, which is useful to grab all messages in your
3717 @samp{+inbox} after processing your new mail for the first time. If
3718 you don't want to rescan the entire folder, the commands @kbd{F r} or
3719 @kbd{F p} will accept a range (@pxref{Ranges}).
3720
3721 @kindex F p
3722 @vindex mh-pack-folder-hook
3723
3724 The command @kbd{F p} runs @code{mh-pack-folder-hook} after
3725 renumbering the messages. A variable that is useful with this hook
3726 is @code{mh-current-folder}.
3727
3728 @kindex @key{TAB}
3729 @vindex mh-recursive-folders-flag
3730
3731 By default, operations on folders work only one level at a time. Set
3732 @code{mh-recursive-folders-flag} to non-@code{nil} to operate on all
3733 folders. This mostly means that you'll be able to see all your folders
3734 when you press @key{TAB} when prompted for a folder name.
3735
3736 @findex mh-search-p
3737 @kindex k
3738 @vindex mh-kill-folder-suppress-prompt-functions
3739
3740 The hook @code{mh-kill-folder-suppress-prompt-functions} is an abnormal
3741 hook run at the beginning of the command @kbd{k}. The hook functions
3742 are called with no arguments and should return a non-@code{nil} value to
3743 suppress the normal prompt when you remove a folder. This is useful
3744 for folders that are easily regenerated. The default value of
3745 @code{mh-search-p} suppresses the prompt on folders generated by
3746 searching.
3747
3748 @sp 1
3749 @center @strong{NOTE}
3750
3751 @quotation
3752 Use this hook with care. If there is a bug in your hook which returns
3753 @code{t} on @samp{+inbox} and you press @kbd{k} by accident in the
3754 @code{+inbox} folder, you will not be happy.
3755 @end quotation
3756 @sp 1
3757
3758 @cindex @command{sortm}
3759 @cindex @file{.mh_profile}
3760 @cindex files, @file{.mh_profile}
3761 @cindex MH commands, @command{sortm}
3762 @cindex MH profile component, @samp{sortm}
3763 @cindex @samp{sortm} MH profile component
3764 @kindex F S
3765 @vindex mh-sortm-args
3766
3767 The option @code{mh-sortm-args} holds extra arguments to pass on to
3768 the command @command{sortm}@footnote{See the section
3769 @uref{@value{MH-BOOK-HOME}/sorsor.html, Sorting Messages: sortm} in the
3770 MH book.} when a prefix argument is used with @kbd{F S}. Normally
3771 default arguments to @command{sortm} are specified in the MH profile.
3772 This option may be used to provide an alternate view. For example,
3773 @samp{'(\"-nolimit\" \"-textfield\" \"subject\")} is a useful setting.
3774
3775 @cindex exiting
3776 @cindex quitting
3777 @findex mh-quit
3778 @kindex q
3779
3780 When you want to quit using MH-E and go back to editing, you can use
3781 the @kbd{q} (@code{mh-quit}) command. This buries the buffers of the
3782 current MH-E folder and restores the buffers that were present when
3783 you first ran @kbd{M-x mh-rmail}. It also removes any MH-E working
3784 buffers whose name begins with @samp{ *mh-} or @file{*MH-E }
3785 (@pxref{Miscellaneous}). You can later restore your MH-E session by
3786 selecting the @samp{+inbox} buffer or by running @kbd{M-x mh-rmail}
3787 again.
3788
3789 @findex mh-execute-commands
3790 @kindex q
3791 @vindex mh-before-quit-hook
3792 @vindex mh-before-quit-hook, example
3793 @vindex mh-quit-hook
3794 @vindex mh-quit-hook, example
3795
3796 The two hooks @code{mh-before-quit-hook} and @code{mh-quit-hook} are
3797 called by @kbd{q}. The former one is called before the quit occurs, so
3798 you might use it to perform any MH-E operations; you could perform
3799 some query and abort the quit or call @code{mh-execute-commands}, for
3800 example. The latter is not run in an MH-E context, so you might use it
3801 to modify the window setup. If you find that @kbd{q} buries a lot of
3802 buffers that you would rather remove, you can use both
3803 @code{mh-before-quit-hook} and @code{mh-quit-hook} to accomplish that.
3804
3805 @smalllisp
3806 @group
3807 (defvar my-mh-folder-buffer-to-delete nil
3808 "Folder buffer that is being quit.")
3809
3810 (defun my-mh-before-quit-hook ()
3811 "Save folder buffer that is to be deleted."
3812 (setq my-mh-folder-buffer-to-delete (current-buffer)))
3813
3814 (defun my-mh-quit-hook ()
3815 "Kill folder buffer rather than just bury it."
3816 (set-buffer my-mh-folder-buffer-to-delete)
3817 (if (get-buffer mh-show-buffer)
3818 (kill-buffer mh-show-buffer))
3819 (kill-buffer (current-buffer)))
3820
3821 @i{Kill MH-Folder buffer instead of burying it}
3822 @end group
3823 @end smalllisp
3824
3825 @cindex folders, renaming
3826 @cindex renaming folders
3827 @findex dired
3828 @findex dired-do-rename
3829
3830 You can use dired to manipulate the folders themselves. For example, I
3831 renamed my @samp{+out} folder to the more common @samp{+outbox} by
3832 running dired on my mail directory (@kbd{M-x dired RET ~/Mail RET}),
3833 moving my cursor to @samp{out} and using the command @kbd{R}
3834 (@code{dired-do-rename}).
3835
3836 @node Sending Mail, Editing Drafts, Folders, Top
3837 @chapter Sending Mail
3838
3839 @cindex sending mail
3840 @findex mh-smail
3841 @kindex M-x mh-smail
3842
3843 You can send a mail message in several ways. You can call @kbd{M-x
3844 mh-smail} directly, or from the command line like this:
3845
3846 @cindex starting from command line
3847
3848 @smallexample
3849 $ @kbd{emacs -f mh-smail}
3850 @end smallexample
3851
3852 @findex goto-address-at-point
3853 @vindex mail-user-agent
3854
3855 There are some commands that need to send a mail message, such as
3856 @code{goto-address-at-point}. You can configure Emacs to have these
3857 commands use MH-E by setting the option @code{mail-user-agent} to
3858 @samp{Emacs interface to MH}.
3859
3860 @cindex @samp{Message} menu
3861 @cindex menu, @samp{Message}
3862
3863 From within MH-E's MH-Folder mode, other methods of sending mail are
3864 available as well. These can also be found in the @samp{Message} menu.
3865
3866 @table @kbd
3867 @cindex @samp{Message > Edit Message Again} menu item
3868 @cindex menu item, @samp{Message > Edit Message Again}
3869 @kindex e
3870 @findex mh-edit-again
3871 @item e
3872 Edit a message to send it again (@code{mh-edit-again}).
3873 @c -------------------------
3874 @cindex @samp{Message > Re-edit a Bounced Message} menu item
3875 @cindex menu item, @samp{Message > Re-edit a Bounced Message}
3876 @kindex E
3877 @findex mh-extract-rejected-mail
3878 @item E
3879 Edit a message that was returned by the mail system
3880 (@code{mh-extract-rejected-mail}).
3881 @c -------------------------
3882 @cindex @samp{Message > Forward Message...} menu item
3883 @cindex menu item, @samp{Message > Forward Message...}
3884 @kindex f
3885 @findex mh-forward
3886 @item f
3887 Forward message (@code{mh-forward}).
3888 @c -------------------------
3889 @cindex @samp{Message > Reply to Message...} menu item
3890 @cindex menu item, @samp{Message > Reply to Message...}
3891 @kindex r
3892 @findex mh-reply
3893 @item r
3894 Reply to a message (@code{mh-reply}).
3895 @c -------------------------
3896 @cindex @samp{Message > Compose a New Message} menu item
3897 @cindex menu item, @samp{Message > Compose a New Message}
3898 @kindex s
3899 @findex mh-send
3900 @item s
3901 Compose a message (@code{mh-send}).
3902 @c -------------------------
3903 @cindex @samp{Message > Redistribute Message...} menu item
3904 @cindex menu item, @samp{Message > Redistribute Message...}
3905 @kindex M-d
3906 @findex mh-redistribute
3907 @item M-d
3908 Redistribute a message (@code{mh-redistribute}).
3909 @c -------------------------
3910 @findex mh-smail
3911 @item M-x mh-smail
3912 Compose a message with the MH mail system.
3913 @c -------------------------
3914 @findex mh-smail-other-window
3915 @item M-x mh-smail-other-window
3916 Compose a message with the MH mail system in other window.
3917 @end table
3918
3919 @cindex @samp{mh-sending-mail} customization group
3920 @cindex customization group, @samp{mh-sending-mail}
3921
3922 In addition, several options from the @samp{mh-sending-mail}
3923 customization group are useful when sending mail or replying to mail.
3924 They are summarized in the following table.
3925
3926 @vtable @code
3927 @item mh-compose-forward-as-mime-flag
3928 On means that messages are forwarded as attachments (default:
3929 @samp{on}).
3930 @c -------------------------
3931 @item mh-compose-letter-function
3932 Hook run when starting a new draft (default: @code{nil}).
3933 @c -------------------------
3934 @item mh-compose-prompt-flag
3935 On means prompt for header fields when composing a new draft (default:
3936 @samp{off}).
3937 @c -------------------------
3938 @item mh-forward-subject-format
3939 Format string for forwarded message subject (default: @code{"%s:
3940 %s"}).
3941 @c -------------------------
3942 @item mh-insert-x-mailer-flag
3943 On means append an @samp{X-Mailer:} header field to the header
3944 (default: @samp{on}).
3945 @c -------------------------
3946 @item mh-redist-full-contents-flag
3947 On means the @command{dist} command needs entire letter for
3948 redistribution (default: @samp{off}).
3949 @c -------------------------
3950 @item mh-reply-default-reply-to
3951 Sets the person or persons to whom a reply will be sent (default:
3952 @samp{Prompt}).
3953 @c -------------------------
3954 @item mh-reply-show-message-flag
3955 On means the MH-Show buffer is displayed using @kbd{r}
3956 (@code{mh-reply}) (default: @samp{on}).
3957 @end vtable
3958
3959 The following hooks are available.
3960
3961 @vtable @code
3962 @item mh-annotate-msg-hook
3963 Hook run by @code{mh-annotate-msg} after annotation (default:
3964 @code{nil}).
3965 @c -------------------------
3966 @item mh-forward-hook
3967 Hook run by @code{mh-forward} on a forwarded letter (default:
3968 @code{nil}).
3969 @c -------------------------
3970 @item mh-letter-mode-hook
3971 Hook run by @code{mh-letter-mode} on a new letter (default:
3972 @code{nil}).
3973 @end vtable
3974
3975 @findex mh-annotate-msg
3976 @vindex mh-annotate-list
3977 @vindex mh-annotate-msg-hook
3978 @vindex mh-current-folder
3979
3980 A hook that is called whenever a message is sent and after the scan
3981 lines and message are annotated is @code{mh-annotate-msg-hook}. Hook
3982 functions can access the current folder name with
3983 @code{mh-current-folder} and obtain the message numbers of the
3984 annotated messages with @code{mh-annotate-list}.
3985
3986 The rest of the functions and options introduced here are explained in
3987 more detail in the following sections.
3988
3989 @menu
3990 * Composing::
3991 * Replying::
3992 * Forwarding::
3993 * Redistributing::
3994 * Editing Again::
3995 @end menu
3996
3997 @node Composing, Replying, Sending Mail, Sending Mail
3998 @section Composing
3999
4000 @cindex @file{.emacs}
4001 @cindex MH-Folder mode
4002 @cindex composing mail
4003 @cindex draft
4004 @cindex files, @file{.emacs}
4005 @cindex modes, MH-Folder
4006 @cindex sending mail
4007 @findex mh-smail
4008 @findex mh-smail-other-window
4009 @kindex M-x mh-smail
4010 @kindex M-x mh-smail-other-window
4011
4012 Outside of an MH-Folder buffer, you must call either @kbd{M-x
4013 mh-smail} or @kbd{M-x mh-smail-other-window} to compose a new message.
4014 The former command always creates a two-window layout with the current
4015 buffer on top and the draft on the bottom. Use the latter command if
4016 you would rather preserve the window layout. You may find adding the
4017 following key bindings to @file{~/.emacs} useful:
4018
4019 @smalllisp
4020 (global-set-key "\C-xm" 'mh-smail)
4021 (global-set-key "\C-x4m" 'mh-smail-other-window)
4022 @end smalllisp
4023
4024 @cindex draft folder
4025 @cindex MH-Letter mode
4026 @cindex modes, MH-Letter
4027 @findex mh-send
4028 @kindex m
4029
4030 From within a MH-Folder buffer, you can simply use the command @kbd{m}
4031 (@code{mh-send}). However you invoke @code{mh-send}, your letter
4032 appears in an Emacs buffer whose mode is MH-Letter (to see what the
4033 buffer looks like, @pxref{Sending Mail Tour}). MH-Letter mode allows
4034 you to edit your message, to check the validity of the recipients, to
4035 insert attachments and other messages into your message, and to send
4036 the message. We'll go more into depth about editing a
4037 @dfn{draft}@footnote{I highly recommend that you use a @dfn{draft
4038 folder} so that you can edit several drafts in parallel. To do so,
4039 create a folder named @samp{+drafts} for example, and add the profile
4040 component @samp{Draft-Folder: drafts} (see @code{mh-profile}(5)).} (a
4041 message you're composing) in just a moment (@pxref{Editing Drafts}).
4042
4043 @vindex mh-compose-prompt-flag
4044
4045 If you prefer to be prompted for the recipient and subject fields
4046 before the MH-Letter buffer appears, turn on the option
4047 @code{mh-compose-prompt-flag}.
4048
4049 @cindex header field, @samp{X-Mailer}
4050 @cindex @samp{X-Mailer} header field
4051 @vindex mh-insert-x-mailer-flag
4052
4053 MH-E adds an @samp{X-Mailer:} header field to the header that includes
4054 the version of MH-E and Emacs that you are using. If you don't want to
4055 participate in our marketing, you can turn off the option
4056 @code{mh-insert-x-mailer-flag}.
4057
4058 @cindex @command{repl}
4059 @cindex @file{components}
4060 @cindex MH commands, @command{repl}
4061 @cindex MH-Letter mode
4062 @cindex Mail mode
4063 @cindex files, @file{components}
4064 @cindex modes, MH-Letter
4065 @cindex modes, Mail
4066 @vindex mail-mode-hook
4067 @vindex mh-letter-mode-hook
4068 @vindex text-mode-hook
4069
4070 Two hooks are provided to run commands on your freshly created draft.
4071 The first hook, @code{mh-letter-mode-hook}, allows you to do some
4072 processing before editing a letter@footnote{Actually, because
4073 MH-Letter mode inherits from Mail mode, the hooks
4074 @code{text-mode-hook} and @code{mail-mode-hook} are run (in that
4075 order) before @code{mh-letter-mode-hook}.}. For example, you may wish
4076 to modify the header after @command{repl} has done its work, or you
4077 may have a complicated @file{components} file and need to tell MH-E
4078 where the cursor should go. Here's an example of how you would use
4079 this hook.
4080
4081 @findex mh-insert-signature, example
4082
4083 @smalllisp
4084 @group
4085 (defvar letter-mode-init-done-flag nil
4086 "Non-nil means one-time MH-E settings have been made.")
4087
4088 (defun my-mh-letter-mode-hook ()
4089 "Prepare letter for editing."
4090 (when (not letter-mode-init-done) ; @r{only need to bind the keys once}
4091 (local-set-key "\C-ctb" 'add-enriched-text)
4092 (local-set-key "\C-cti" 'add-enriched-text)
4093 (local-set-key "\C-ctf" 'add-enriched-text)
4094 (local-set-key "\C-cts" 'add-enriched-text)
4095 (local-set-key "\C-ctB" 'add-enriched-text)
4096 (local-set-key "\C-ctu" 'add-enriched-text)
4097 (local-set-key "\C-ctc" 'add-enriched-text)
4098 (setq letter-mode-init-done t))
4099 (save-excursion
4100 (goto-char (point-max)) ; @r{go to end of message to}
4101 (mh-insert-signature))) ; @r{insert signature}
4102
4103 @i{Prepare draft for editing via mh-letter-mode-hook}
4104
4105 @end group
4106 @end smalllisp
4107
4108 The function, @code{add-enriched-text} is defined in the example in
4109 @ref{Adding Attachments}.
4110
4111 @vindex mh-compose-letter-function
4112 @vindex mh-letter-mode-hook
4113
4114 The second hook, a function really, is
4115 @code{mh-compose-letter-function}. Like @code{mh-letter-mode-hook}, it
4116 is called just before editing a new message; however, it is the last
4117 function called before you edit your message. The consequence of this
4118 is that you can write a function to write and send the message for
4119 you. This function is passed three arguments: the contents of the
4120 @samp{To:}, @samp{Subject:}, and @samp{Cc:} header fields.
4121
4122 @node Replying, Forwarding, Composing, Sending Mail
4123 @section Replying to Mail
4124
4125 @cindex @command{mhl}
4126 @cindex @file{mhl.reply}
4127 @cindex MH commands, @command{mhl}
4128 @cindex files, @file{mhl.reply}
4129 @cindex replying
4130 @findex mh-reply
4131 @kindex r
4132
4133 To compose a reply to a message, use the @kbd{r} (@code{mh-reply})
4134 command.
4135
4136 When you reply to a message, you are first prompted with @samp{Reply
4137 to whom?}. You have several choices here.
4138
4139 @quotation
4140 @multitable @columnfractions .20 .80
4141 @c @headitem Response @tab Reply Goes To
4142 @c XXX @headitem not yet supported by SourceForge's texi2pdf.
4143 @item @b{Response} @tab @b{Reply Goes To}
4144 @c -------------------------
4145 @item @kbd{from}
4146 @tab
4147 The person who sent the message. This is the default, so @key{RET} is
4148 sufficient.
4149 @c -------------------------
4150 @item @kbd{to}
4151 @tab
4152 Replies to the sender, plus all recipients in the @samp{To:} header field.
4153 @c -------------------------
4154 @item @kbd{cc}@*@kbd{all}
4155 @tab
4156 Forms a reply to the addresses in the @samp{Mail-Followup-To:} header
4157 field if one exists; otherwise forms a reply to the sender, plus all
4158 recipients.
4159 @end multitable
4160 @end quotation
4161
4162 @cindex @command{repl}
4163 @cindex MH commands, @command{repl}
4164 @vindex mh-reply-default-reply-to
4165
4166 Depending on your answer, @command{repl}@footnote{See the section
4167 @uref{@value{MH-BOOK-HOME}/reprep.html, Replying to Messages: repl} in
4168 the MH book.} is given a different argument to form your reply.
4169 Specifically, a choice of @kbd{from} or none at all runs @samp{repl
4170 -nocc all}, and a choice of @kbd{to} runs @samp{repl -cc to}. Finally,
4171 either @kbd{cc} or @kbd{all} runs @samp{repl -cc all -nocc me}. If you
4172 find that most of the time you specify one of these choices when you
4173 reply to a message, you can change the option
4174 @code{mh-reply-default-reply-to} from its default value of
4175 @samp{Prompt} to one of the choices listed above. You can always edit
4176 the recipients in the draft.
4177
4178 @cindex @samp{repl} MH profile component
4179 @cindex MH profile component, @samp{repl}
4180 @cindex MH-Letter mode
4181 @cindex MH-Show mode
4182 @cindex draft
4183 @cindex modes, MH-Letter
4184 @cindex modes, MH-Show
4185
4186 Two windows are then created. One window contains the message to which
4187 you are replying in an MH-Show buffer. Your draft, in MH-Letter mode
4188 (@pxref{Editing Drafts}), is in the other window. If the reply draft
4189 was not one that you expected, check the things that affect the
4190 behavior of @command{repl} which include the @samp{repl:} profile
4191 component and the @file{replcomps} and @file{replgroupcomps} files.
4192
4193 If you supply a prefix argument (as in @kbd{C-u r}), the message you
4194 are replying to is inserted in your reply after having first been run
4195 through @command{mhl} with the format file @file{mhl.reply}. See
4196 @command{mhl}(1) or the section
4197 @uref{@value{MH-BOOK-HOME}/shomes.html#Usisho, Using mhl} in the MH
4198 book to see how you can modify the default @file{mhl.reply} file.
4199
4200 @vindex mh-yank-behavior
4201
4202 Alternatively, you can customize the option @code{mh-yank-behavior}
4203 and choose one of its @samp{Automatically} variants to do the same
4204 thing. @xref{Inserting Letter}. If you do so, the prefix argument has
4205 no effect.
4206
4207 Another way to include the message automatically in your draft is to
4208 use @samp{repl: -filter repl.filter} in your MH profile.
4209
4210 @vindex mh-reply-show-message-flag
4211
4212 If you include the message automatically, you can hide the MH-Show
4213 buffer by turning off the option @code{mh-reply-show-message-flag}.
4214
4215 If you wish to customize the header or other parts of the reply draft,
4216 please see @command{repl}(1) and @code{mh-format}(5).
4217
4218 @node Forwarding, Redistributing, Replying, Sending Mail
4219 @section Forwarding Mail
4220
4221 @cindex @command{forw}
4222 @cindex draft
4223 @cindex forwarding
4224 @cindex MH commands, @command{forw}
4225 @findex mh-forward
4226 @kindex f
4227 @vindex mh-forward-hook
4228
4229 To forward a message, use the @kbd{f} (@code{mh-forward}) command. You
4230 are prompted for the @samp{To:} and @samp{cc:} recipients. You are
4231 given a draft to edit that looks like it would if you had run the MH
4232 command @command{forw}@footnote{See the section
4233 @uref{@value{MH-BOOK-HOME}/forfor.html, Forwarding Messages: forw} in
4234 the MH book.}. You can then add some text (@pxref{Editing Drafts}).
4235 You can forward several messages by using a range (@pxref{Ranges}).
4236 All of the messages in the range are inserted into your draft. The
4237 hook @code{mh-forward-hook} is called on the draft.
4238
4239 @cindex @file{.mh_profile}
4240 @cindex files, @file{.mh_profile}
4241 @cindex MH profile component, @samp{forw}
4242 @cindex @samp{forw} MH profile component
4243 @vindex mh-compose-forward-as-mime-flag
4244
4245 By default, the option @code{mh-compose-forward-as-mime-flag} is on
4246 which means that the forwarded messages are included as attachments.
4247 These are inline attachments so the forwarded message should appear in
4248 the body of your recipient's mail program. If you would prefer to
4249 forward your messages verbatim (as text, inline), then turn off this
4250 option. Forwarding messages verbatim works well for short, textual
4251 messages, but your recipient won't be able to view any non-textual
4252 attachments that were in the forwarded message. Be aware that if you
4253 have @samp{forw: -mime} in your MH profile, then forwarded messages
4254 will always be included as attachments regardless of the settings of
4255 @code{mh-compose-forward-as-mime-flag}.
4256
4257 @vindex mh-forward-subject-format
4258
4259 The format of the @samp{Subject:} header field for forwarded messages
4260 is controlled by the option @code{mh-forward-subject-format}. This
4261 option is a string which includes two escapes (@samp{%s}). The first
4262 @samp{%s} is replaced with the sender of the original message, and the
4263 second one is replaced with the original @samp{Subject:}. The default
4264 value of @code{"%s: %s"} takes a message with the header:
4265
4266 @smallexample
4267 @group
4268 To: Bill Wohler <wohler@@stop.mail-abuse.org>
4269 Subject: Re: 49er football
4270 From: Greg DesBrisay <gd@@stop.mail-abuse.org>
4271 @end group
4272 @end smallexample
4273
4274 and creates a subject header field of:
4275
4276 @smallexample
4277 Subject: Greg DesBrisay: Re: 49er football
4278 @end smallexample
4279
4280 @node Redistributing, Editing Again, Forwarding, Sending Mail
4281 @section Redistributing Your Mail
4282
4283 @cindex @command{dist}
4284 @cindex MH commands, @command{dist}
4285 @cindex redistributing
4286 @findex mh-redistribute
4287 @kindex M-d
4288
4289 The command @kbd{M-d} (@code{mh-redistribute}) is similar in function
4290 to forwarding mail, but it does not allow you to edit the message, nor
4291 does it add your name to the @samp{From:} header field. It appears to
4292 the recipient as if the message had come from the original sender.
4293 When you run this command, you are prompted for the recipients.
4294
4295 @findex mh-edit-again
4296 @kindex e
4297
4298 For more information on redistributing messages, see
4299 @command{dist}(1). Also investigate the command @kbd{e}
4300 (@code{mh-edit-again}) for another way to redistribute messages
4301 (@pxref{Editing Again}).
4302
4303 @cindex @command{send}
4304 @cindex MH commands, @command{send}
4305 @vindex mh-redist-full-contents-flag
4306
4307 The option @code{mh-redist-full-contents-flag} must be turned on if
4308 @command{dist}@footnote{See the section
4309 @uref{@value{MH-BOOK-HOME}/disdis.html, Distributing Messages with
4310 dist} in the MH book.} requires the whole letter for redistribution,
4311 which is the case if @command{send}@footnote{See the section
4312 @uref{@value{MH-BOOK-HOME}/sensen.html, Sending Some Mail: comp send}
4313 in the MH book.} is compiled with the @sc{berk} option (which many
4314 people abhor). If you find that MH will not allow you to redistribute
4315 a message that has been redistributed before, turn off this option.
4316
4317 The hook @code{mh-annotate-msg-hook} is run after annotating the
4318 message and scan line (@pxref{Sending Mail}).
4319
4320 @node Editing Again, , Redistributing, Sending Mail
4321 @section Editing Old Drafts and Bounced Messages
4322
4323 @cindex @file{draft}
4324 @cindex files, @file{draft}
4325 @cindex re-editing drafts
4326 @findex mh-edit-again
4327 @kindex F v drafts
4328 @kindex e
4329 @kindex n
4330
4331 If you don't complete a draft for one reason or another, and if the
4332 draft buffer is no longer available, you can pick your draft up again
4333 with @kbd{e} (@code{mh-edit-again}). If you don't use a draft
4334 folder, your last @file{draft} file will be used. If you use draft
4335 folders, you'll need to visit the draft folder with @kbd{F v drafts
4336 @key{RET}}, use @kbd{n} to move to the appropriate message, and then
4337 use @kbd{e} to prepare the message for editing.
4338
4339 @kindex e
4340
4341 The @kbd{e} command can also be used to take messages that were sent
4342 to you and to send them to more people.
4343
4344 @cindex Mailer-Daemon
4345 @findex mh-extract-rejected-mail
4346 @kindex C-c C-c
4347 @kindex E
4348
4349 Don't use @kbd{e} to re-edit a message from a @i{Mailer-Daemon} who
4350 complained that your mail wasn't posted for some reason or another. In
4351 this case, use @kbd{E} (@code{mh-extract-rejected-mail}) to prepare
4352 the message for editing by removing the @i{Mailer-Daemon} envelope and
4353 unneeded header fields. Fix whatever addressing problem you had, and
4354 send the message again with @kbd{C-c C-c}.
4355
4356 @node Editing Drafts, Aliases, Sending Mail, Top
4357 @chapter Editing a Draft
4358
4359 @cindex @samp{Letter} menu
4360 @cindex MH-Letter mode
4361 @cindex draft
4362 @cindex editing draft
4363 @cindex menu, @samp{Letter}
4364 @cindex modes, MH-Letter
4365
4366 When you edit a message that you want to send (called a @dfn{draft} in
4367 this case), the mode used is MH-Letter. This mode provides several
4368 commands in addition to the normal Emacs editing commands to help you
4369 edit your draft. These can also be found in the @samp{Letter} menu.
4370
4371 @table @kbd
4372 @kindex @key{SPC}
4373 @findex mh-letter-complete-or-space
4374 @item @key{SPC}
4375 Perform completion or insert space (@code{mh-letter-complete-or-space}).
4376 @c -------------------------
4377 @kindex M-@key{TAB}
4378 @findex mh-letter-complete
4379 @item M-@key{TAB}
4380 Perform completion on header field or word preceding point
4381 (@code{mh-letter-complete}).
4382 @c -------------------------
4383 @kindex , (comma)
4384 @findex mh-letter-confirm-address
4385 @item , (comma)
4386 Flash alias expansion (@code{mh-letter-confirm-address}).
4387 @c -------------------------
4388 @kindex @key{TAB}
4389 @findex mh-letter-next-header-field-or-indent
4390 @item @key{TAB}
4391 Cycle to next field (@code{mh-letter-next-header-field-or-indent}).
4392 @c -------------------------
4393 @kindex S-@key{TAB}
4394 @findex mh-letter-previous-header-field
4395 @item S-@key{TAB}
4396 Cycle to the previous header field
4397 (@code{mh-letter-previous-header-field}).
4398 @c -------------------------
4399 @kindex C-c ?
4400 @findex mh-help
4401 @item C-c ?
4402 Display cheat sheet for the MH-E commands (@code{mh-help}).
4403 @c -------------------------
4404 @cindex @samp{Letter > Send This Draft} menu item
4405 @cindex menu item, @samp{Letter > Send This Draft}
4406 @kindex C-c C-c
4407 @findex mh-send-letter
4408 @item C-c C-c
4409 Save draft and send message (@code{mh-send-letter}).
4410 @c -------------------------
4411 @kindex C-c C-d
4412 @findex mh-insert-identity
4413 @item C-c C-d
4414 Insert fields specified by the given identity
4415 (@code{mh-insert-identity}). @xref{Identities}.
4416 @c -------------------------
4417 @cindex @samp{Letter > Pull in All Compositions (MH)} menu item
4418 @cindex menu item, @samp{Letter > Pull in All Compositions (MH)}
4419 @kindex C-c C-e
4420 @findex mh-mh-to-mime
4421 @item C-c C-e
4422 Compose @sc{mime} message from MH-style directives
4423 (@code{mh-mh-to-mime}).
4424 @c -------------------------
4425 @kindex C-c C-f C-a
4426 @kindex C-c C-f a
4427 @findex mh-to-field
4428 @item C-c C-f C-a
4429 @itemx C-c C-f a
4430 Move to @samp{Mail-Reply-To:} header field (@code{mh-to-field}).
4431 @c -------------------------
4432 @kindex C-c C-f C-b
4433 @kindex C-c C-f b
4434 @item C-c C-f C-b
4435 @itemx C-c C-f b
4436 Move to @samp{Bcc:} header field (@code{mh-to-field}).
4437 @c -------------------------
4438 @kindex C-c C-f C-c
4439 @kindex C-c C-f c
4440 @item C-c C-f C-c
4441 @itemx C-c C-f c
4442 Move to @samp{Cc:} header field (@code{mh-to-field}).
4443 @c -------------------------
4444 @kindex C-c C-f C-d
4445 @kindex C-c C-f d
4446 @item C-c C-f C-d
4447 @itemx C-c C-f d
4448 Move to @samp{Dcc:} header field (@code{mh-to-field}).
4449 @c -------------------------
4450 @kindex C-c C-f C-f
4451 @kindex C-c C-f f
4452 @findex mh-to-fcc
4453 @item C-c C-f C-f
4454 @itemx C-c C-f f
4455 Move to @samp{Fcc:} header field (@code{mh-to-fcc}).
4456 @c -------------------------
4457 @kindex C-c C-f C-l
4458 @kindex C-c C-f l
4459 @item C-c C-f C-l
4460 @itemx C-c C-f l
4461 Move to @samp{Mail-Followup-To:} header field (@code{mh-to-field}).
4462 @c -------------------------
4463 @kindex C-c C-f C-m
4464 @kindex C-c C-f m
4465 @item C-c C-f C-m
4466 @itemx C-c C-f m
4467 Move to @samp{From:} header field (@code{mh-to-field}).
4468 @c -------------------------
4469 @kindex C-c C-f C-r
4470 @kindex C-c C-f r
4471 @item C-c C-f C-r
4472 @itemx C-c C-f r
4473 Move to @samp{Reply-To:} header field (@code{mh-to-field}).
4474 @c -------------------------
4475 @kindex C-c C-f C-s
4476 @kindex C-c C-f s
4477 @item C-c C-f C-s
4478 @itemx C-c C-f s
4479 Move to @samp{Subject:} header field (@code{mh-to-field}).
4480 @c -------------------------
4481 @kindex C-c C-f C-t
4482 @kindex C-c C-f t
4483 @item C-c C-f C-t
4484 @itemx C-c C-f t
4485 Move to @samp{To:} header field (@code{mh-to-field}).
4486 @c -------------------------
4487 @cindex @samp{Letter > Insert a Message...} menu item
4488 @cindex menu item, @samp{Letter > Insert a Message...}
4489 @kindex C-c C-i
4490 @findex mh-insert-letter
4491 @item C-c C-i
4492 Insert a message (@code{mh-insert-letter}).
4493 @c -------------------------
4494 @kindex C-c C-m C-e
4495 @findex mh-mml-secure-message-encrypt
4496 @item C-c C-m C-e
4497 Add tag to encrypt the message (@code{mh-mml-secure-message-encrypt}).
4498 @c -------------------------
4499 @cindex @samp{Letter > Compose Forward...} menu item
4500 @cindex menu item, @samp{Letter > Compose Forward...}
4501 @kindex C-c C-m C-f
4502 @kindex C-c C-m f
4503 @findex mh-compose-forward
4504 @item C-c C-m C-f
4505 @itemx C-c C-m f
4506 Add tag to forward a message (@code{mh-compose-forward}).
4507 @c -------------------------
4508 @cindex @samp{Letter > Compose Get File (MH)...} menu item
4509 @cindex menu item, @samp{Letter > Compose Get File (MH)...}
4510 @kindex C-c C-m C-g
4511 @kindex C-c C-m g
4512 @findex mh-mh-compose-anon-ftp
4513 @item C-c C-m C-g
4514 @itemx C-c C-m g
4515 Add tag to include anonymous ftp reference to a file
4516 (@code{mh-mh-compose-anon-ftp}).
4517 @c -------------------------
4518 @cindex @samp{Letter > Compose Insertion...} menu item
4519 @cindex menu item, @samp{Letter > Compose Insertion...}
4520 @kindex C-c C-m C-i
4521 @kindex C-c C-m i
4522 @findex mh-compose-insertion
4523 @item C-c C-m C-i
4524 @itemx C-c C-m i
4525 Add tag to include a file such as an image or sound
4526 (@code{mh-compose-insertion}).
4527 @c -------------------------
4528 @cindex @samp{Letter > Pull in All Compositions (MML)} menu item
4529 @cindex menu item, @samp{Letter > Pull in All Compositions (MML)}
4530 @kindex C-c C-m C-m
4531 @kindex C-c C-m m
4532 @findex mh-mml-to-mime
4533 @item C-c C-m C-m
4534 @itemx C-c C-m m
4535 Compose @sc{mime} message from MML tags (@code{mh-mml-to-mime}).
4536 @c -------------------------
4537 @kindex C-c C-m C-n
4538 @kindex C-c C-m n
4539 @findex mh-mml-unsecure-message
4540 @item C-c C-m C-n
4541 @itemx C-c C-m n
4542 Remove any secure message tags (@code{mh-mml-unsecure-message}).
4543 @c -------------------------
4544 @kindex C-c C-m C-s
4545 @findex mh-mml-secure-message-sign
4546 @item C-c C-m C-s
4547 Add tag to sign the message (@code{mh-mml-secure-message-sign}).
4548 @c -------------------------
4549 @cindex @samp{Letter > Compose Compressed tar (MH)...} menu item
4550 @cindex menu item, @samp{Letter > Compose Compressed tar (MH)...}
4551 @kindex C-c C-m C-t
4552 @kindex C-c C-m t
4553 @findex mh-mh-compose-external-compressed-tar
4554 @item C-c C-m C-t
4555 @itemx C-c C-m t
4556 Add tag to include anonymous ftp reference to a compressed tar file
4557 (@code{mh-mh-compose-external-compressed-tar}).
4558 @c -------------------------
4559 @cindex @samp{Letter > Revert to Non-MIME Edit (MH)} menu item
4560 @cindex menu item, @samp{Letter > Revert to Non-MIME Edit (MH)}
4561 @kindex C-c C-m C-u
4562 @kindex C-c C-m u
4563 @findex mh-mh-to-mime-undo
4564 @item C-c C-m C-u
4565 @itemx C-c C-m u
4566 Undo effects of @kbd{C-c C-e} (@code{mh-mh-to-mime-undo}).
4567 @c -------------------------
4568 @kindex C-c C-m C-x
4569 @kindex C-c C-m x
4570 @findex mh-mh-compose-external-type
4571 @item C-c C-m C-x
4572 @itemx C-c C-m x
4573 Add tag to refer to a remote file
4574 (@code{mh-mh-compose-external-type}).
4575 @c -------------------------
4576 @kindex C-c C-m e e
4577 @findex mh-mml-secure-message-encrypt
4578 @item C-c C-m e e
4579 Add tag to encrypt the message (@code{mh-mml-secure-message-encrypt}).
4580 @c -------------------------
4581 @kindex C-c C-m e s
4582 @findex mh-mml-secure-message-signencrypt
4583 @item C-c C-m e s
4584 Add tag to encrypt and sign the message@*
4585 (@code{mh-mml-secure-message-signencrypt}).
4586 @c -------------------------
4587 @kindex C-c C-m s e
4588 @findex mh-mml-secure-message-signencrypt
4589 @item C-c C-m s e
4590 Add tag to encrypt and sign the message@*
4591 (@code{mh-mml-secure-message-signencrypt}).
4592 @c -------------------------
4593 @kindex C-c C-m s s
4594 @findex mh-mml-secure-message-sign
4595 @item C-c C-m s s
4596 Add tag to sign the message (@code{mh-mml-secure-message-sign}).
4597 @c -------------------------
4598 @cindex @samp{Letter > Split Current Line} menu item
4599 @cindex menu item, @samp{Letter > Split Current Line}
4600 @kindex C-c C-o
4601 @findex mh-open-line
4602 @item C-c C-o
4603 Insert a newline and leave point before it (@code{mh-open-line}).
4604 @c -------------------------
4605 @cindex @samp{Letter > Kill This Draft} menu item
4606 @cindex menu item, @samp{Letter > Kill This Draft}
4607 @kindex C-c C-q
4608 @findex mh-fully-kill-draft
4609 @item C-c C-q
4610 Quit editing and delete draft message (@code{mh-fully-kill-draft}).
4611 @c -------------------------
4612 @cindex @samp{Letter > Insert Signature} menu item
4613 @cindex menu item, @samp{Letter > Insert Signature}
4614 @kindex C-c C-s
4615 @findex mh-insert-signature
4616 @item C-c C-s
4617 Insert signature in message (@code{mh-insert-signature}).
4618 @c -------------------------
4619 @kindex C-c C-t
4620 @findex mh-letter-toggle-header-field-display
4621 @item C-c C-t
4622 Toggle display of header field at point
4623 (@code{mh-letter-toggle-header-field-display}).
4624 @c -------------------------
4625 @cindex @samp{Letter > Check Recipient} menu item
4626 @cindex menu item, @samp{Letter > Check Recipient}
4627 @kindex C-c C-w
4628 @findex mh-check-whom
4629 @item C-c C-w
4630 Verify recipients, showing expansion of any aliases
4631 (@code{mh-check-whom}).
4632 @c -------------------------
4633 @cindex @samp{Letter > Yank Current Message} menu item
4634 @cindex menu item, @samp{Letter > Yank Current Message}
4635 @kindex C-c C-y
4636 @findex mh-yank-cur-msg
4637 @item C-c C-y
4638 Insert the current message into the draft buffer
4639 (@code{mh-yank-cur-msg}).
4640 @c -------------------------
4641 @kindex C-c M-d
4642 @findex mh-insert-auto-fields
4643 @item C-c M-d
4644 Insert custom fields if recipient is found in
4645 @code{mh-auto-fields-list} (@code{mh-insert-auto-fields}).
4646 @xref{Identities}.
4647 @end table
4648
4649 @cindex @samp{mh-letter} customization group
4650 @cindex customization group, @samp{mh-letter}
4651
4652 Several options from the @samp{mh-letter} customization group are used
4653 while editing a draft.
4654
4655 @vtable @code
4656 @item mh-compose-insertion
4657 Type of @sc{mime} message tags in messages (default: @samp{MML} if
4658 available; otherwise @samp{MH}).
4659 @c -------------------------
4660 @item mh-compose-skipped-header-fields
4661 List of header fields to skip over when navigating in draft (default:
4662 @code{'("From"} @code{"Organization"} @code{"References"}
4663 @code{"In-Reply-To"} @code{"X-Face"} @code{"Face"}
4664 @code{"X-Image-URL"} @code{"X-Mailer")}.
4665 @c -------------------------
4666 @item mh-compose-space-does-completion-flag
4667 On means @key{SPC} does completion in message header (default:
4668 @samp{off}).
4669 @c -------------------------
4670 @item mh-delete-yanked-msg-window-flag
4671 On means delete any window displaying the message (default: @samp{off}).
4672 @c -------------------------
4673 @item mh-extract-from-attribution-verb
4674 Verb to use for attribution when a message is yanked by @kbd{C-c C-y}
4675 (default: @code{"wrote:"}).
4676 @c -------------------------
4677 @item mh-ins-buf-prefix
4678 String to put before each line of a yanked or inserted message
4679 (default: @code{"> "}).
4680 @c -------------------------
4681 @item mh-letter-complete-function
4682 Function to call when completing outside of address or folder fields
4683 (default: @code{ispell-complete-word}).
4684 @c -------------------------
4685 @item mh-letter-fill-column
4686 Fill column to use in MH-Letter mode (default: 72).
4687 @c -------------------------
4688 @item mh-mml-method-default
4689 Default method to use in security tags (default: @samp{PGP (MIME)} if
4690 support for it is available; otherwise @samp{None}).
4691 @c -------------------------
4692 @item mh-signature-file-name
4693 Source of user's signature (default: @code{"~/.signature"}).
4694 @c -------------------------
4695 @item mh-signature-separator-flag
4696 On means a signature separator should be inserted (default:
4697 @samp{on}).
4698 @c -------------------------
4699 @item mh-x-face-file
4700 File containing X-Face or Face header field to insert in outgoing mail.
4701 (default: @code{"~/.face"}).
4702 @c -------------------------
4703 @item mh-yank-behavior
4704 Controls which part of a message is yanked by @kbd{C-c C-y} (default:
4705 @samp{Body With Attribution}).
4706 @end vtable
4707
4708 The following hooks are available.
4709
4710 @vtable @code
4711 @item mail-citation-hook
4712 Hook for modifying a citation just inserted in the mail buffer
4713 (default: @code{nil}).
4714 @c -------------------------
4715 @item mh-before-send-letter-hook
4716 Hook run at the beginning of the @kbd{C-c C-c} command (default:
4717 @samp{nil}).
4718 @c -------------------------
4719 @item mh-mh-to-mime-hook
4720 Hook run on the formatted letter by @kbd{C-c C-e} (default:
4721 @samp{nil}).
4722 @c -------------------------
4723 @item mh-insert-signature-hook
4724 Hook run by @kbd{C-c C-s} after signature has been inserted (default:
4725 @code{nil}).
4726 @end vtable
4727
4728 The following face is available.
4729
4730 @vtable @code
4731 @item mh-letter-header-field
4732 Editable header field value face in draft buffers.
4733 @end vtable
4734
4735 The commands and options introduced here are explained in more
4736 detail in the following sections.
4737
4738 @menu
4739 * Editing Message::
4740 * Inserting Letter::
4741 * Inserting Messages::
4742 * Signature::
4743 * Picture::
4744 * Adding Attachments::
4745 * Sending PGP::
4746 * Checking Recipients::
4747 * Sending Message::
4748 * Killing Draft::
4749 @end menu
4750
4751 @node Editing Message, Inserting Letter, Editing Drafts, Editing Drafts
4752 @section Editing the Message
4753
4754 @cindex @samp{Bcc} header field
4755 @cindex @samp{Cc} header field
4756 @cindex @samp{Dcc} header field
4757 @cindex @samp{From} header field
4758 @cindex @samp{Mail-Followup-To} header field
4759 @cindex @samp{Mail-Reply-To} header field
4760 @cindex @samp{Reply-To} header field
4761 @cindex @samp{Subject} header field
4762 @cindex @samp{To} header field
4763 @cindex editing header
4764 @cindex header field, @samp{Bcc}
4765 @cindex header field, @samp{Cc}
4766 @cindex header field, @samp{Dcc}
4767 @cindex header field, @samp{From}
4768 @cindex header field, @samp{Mail-Followup-To}
4769 @cindex header field, @samp{Mail-Reply-To}
4770 @cindex header field, @samp{Reply-To}
4771 @cindex header field, @samp{Subject}
4772 @cindex header field, @samp{To}
4773 @findex mh-to-field
4774 @kindex C-c C-f C-t
4775 @kindex C-c C-f t
4776
4777 Because the header is part of the message, you can edit the header
4778 fields as you wish. However, several convenience commands exist to
4779 help you create and edit them. For example, the command @kbd{C-c C-f
4780 C-t} (@code{mh-to-field}; alternatively, @kbd{C-c C-f t}) moves the
4781 cursor to the @samp{To:} header field, creating it if necessary. The
4782 commands for moving to the @samp{Cc:}, @samp{Subject:}, @samp{From:},
4783 @samp{Reply-To:}, @samp{Mail-Reply-To:}, @samp{Mail-Followup-To},
4784 @samp{Bcc:}, and @samp{Dcc:} header fields are similar.
4785
4786 @findex mh-to-fcc
4787 @kindex C-c C-f C-f
4788 @kindex C-c C-f f
4789
4790 One command behaves differently from the others, namely, @kbd{C-c C-f
4791 C-f} (@code{mh-to-fcc}; alternatively, @kbd{C-c C-f f}). This command
4792 will prompt you for the folder name in which to file a copy of the
4793 draft. @xref{Folder Selection}.
4794
4795 @findex indent-relative
4796 @findex mh-letter-next-header-field-or-indent
4797 @findex mh-letter-previous-header-field
4798 @kindex @key{TAB}
4799 @kindex S-@key{TAB}
4800 @vindex mh-compose-skipped-header-fields
4801 @vindex mh-letter-header-field
4802
4803 Within the header of the message, the command@* @key{TAB}
4804 (@code{mh-letter-next-header-field-or-indent}) moves between fields
4805 that are highlighted with the face @code{mh-letter-header-field},
4806 skipping those fields listed in
4807 @code{mh-compose-skipped-header-fields}. After the last field, this
4808 command then moves point to the message body before cycling back to
4809 the first field. If point is already past the first line of the
4810 message body, then this command indents by calling
4811 @code{indent-relative} with the given prefix argument. The command
4812 @kbd{S-@key{TAB}} (@code{mh-letter-previous-header-field}) moves
4813 backwards between the fields and cycles to the body of the message
4814 after the first field. Unlike the command @key{TAB}, it will always
4815 take point to the last field from anywhere in the body.
4816
4817 @cindex alias completion
4818 @cindex completion
4819 @cindex spell check
4820 @findex ispell-complete-word
4821 @findex mh-letter-complete
4822 @findex mh-letter-complete-or-space
4823 @findex mh-letter-confirm-address
4824 @kindex , (comma)
4825 @kindex @key{SPC}
4826 @kindex M-@key{TAB}
4827 @vindex mh-alias-flash-on-comma
4828 @vindex mh-compose-space-does-completion-flag
4829 @vindex mh-letter-complete-function
4830
4831 If the field contains addresses (for example, @samp{To:} or
4832 @samp{Cc:}) or folders (for example, @samp{Fcc:}) then the command
4833 @kbd{M-@key{TAB}} (@code{mh-letter-complete}) will provide alias
4834 completion (@pxref{Aliases}). In the body of the message,
4835 @kbd{M-@key{TAB}} runs @code{mh-letter-complete-function} instead,
4836 which is set to @samp{'ispell-complete-word} by default. The command
4837 @kbd{M-@key{TAB}} (@code{mh-letter-complete}) takes a prefix argument
4838 that is passed to the @code{mh-letter-complete-function}. In addition,
4839 turn on the option @code{mh-compose-space-does-completion-flag} to use
4840 the command @key{SPC} (@code{mh-letter-complete-or-space}) to perform
4841 completion in the header as well; use a prefix argument to specify
4842 more than one space. Addresses are separated by a comma; when you
4843 press the comma, the command @code{mh-letter-confirm-address} flashes
4844 the alias expansion in the minibuffer if
4845 @code{mh-alias-flash-on-comma} is turned on.
4846
4847 @c XXX Document the replacement for the inaccessible 'long argument.
4848
4849 @findex mh-letter-toggle-header-field-display
4850 @kindex C-c C-t
4851
4852 Use the command @kbd{C-c C-t}
4853 @code{mh-letter-toggle-header-field-display} to display truncated
4854 header fields. This command is a toggle so entering it again will hide
4855 the field. This command takes a prefix argument: if negative then the
4856 field is hidden, if positive then the field is displayed (for example,
4857 @kbd{C-u C-c C-t}).
4858
4859 Be sure to leave a row of dashes or a blank line between the header
4860 and the body of the message.
4861
4862 @vindex mh-letter-fill-column
4863
4864 The body of the message is edited as you would edit any Emacs buffer
4865 although there are a few commands and options to assist you. You can
4866 change the fill column in MH-Letter mode with the option
4867 @code{mh-letter-fill-column}. By default, this option is 72 to allow
4868 others to quote your message without line wrapping.
4869
4870 @cindex filling paragraphs
4871 @cindex paragraphs, filling
4872 @findex fill-paragraph
4873 @kindex M-q
4874 @vindex mh-ins-buf-prefix
4875
4876 You'll often include messages that were sent from user agents that
4877 haven't yet realized that paragraphs consist of more than a single
4878 line. This makes for long lines that wrap in an ugly fashion. You'll
4879 find that @kbd{M-q} (@code{fill-paragraph}) works well even on these
4880 quoted messages, even if they are nested, just as long as all of the
4881 quotes match the value of @code{mh-ins-buf-prefix} (@pxref{Inserting
4882 Letter}). For example, let's assume you have the following in your
4883 draft:
4884
4885 @smallexample
4886 @group
4887 > Hopefully this gives you an idea of what I'm currently doing. I'm \
4888 not sure yet whether I'm completely satisfied with my setup, but \
4889 it's worked okay for me so far.
4890 @end group
4891 @end smallexample
4892
4893 Running @kbd{M-q} on this paragraph produces:
4894
4895 @smallexample
4896 @group
4897 > Hopefully this gives you an idea of what I'm currently doing. I'm not
4898 > sure yet whether I'm completely satisfied with my setup, but it's
4899 > worked okay for me so far.
4900 @end group
4901 @end smallexample
4902
4903 @findex mh-open-line
4904 @findex open-line
4905 @kindex C-c C-o
4906 @kindex C-o
4907
4908 The command @kbd{C-c C-o} (@code{mh-open-line}) is similar to the
4909 command @kbd{C-o} (@code{open-line}) in that it inserts a newline
4910 after point. It differs in that it also inserts the right number of
4911 quoting characters and spaces so that the next line begins in the same
4912 column as it was. This is useful when breaking up paragraphs in
4913 replies. For example, if this command was used when point was after
4914 the first period in the paragraph above, the result would be this:
4915
4916 @smallexample
4917 @group
4918 > Hopefully this gives you an idea of what I'm currently doing.
4919
4920 > I'm not
4921 > sure yet whether I'm completely satisfied with my setup, but it's
4922 > worked okay for me so far.
4923 @end group
4924 @end smallexample
4925
4926 @node Inserting Letter, Inserting Messages, Editing Message, Editing Drafts
4927 @section Inserting Letter to Which You're Replying
4928
4929 @cindex inserting messages
4930 @cindex replying to messages
4931 @cindex yanking messages
4932 @findex mh-yank-cur-msg
4933 @kindex C-c C-y
4934 @vindex mh-ins-buf-prefix
4935
4936 It is often useful to insert a snippet of text from a letter that
4937 someone mailed to provide some context for your reply. The command
4938 @kbd{C-c C-y} (@code{mh-yank-cur-msg}) does this by adding an
4939 attribution, yanking a portion of text from the message to which
4940 you're replying, and inserting @code{mh-ins-buf-prefix} (@samp{> })
4941 before each line.
4942
4943 @smallexample
4944 @group
4945 Michael W Thelen <thelenm@@stop.mail-abuse.org> wrote:
4946
4947 > Hopefully this gives you an idea of what I'm currently doing. I'm not
4948 > sure yet whether I'm completely satisfied with my setup, but it's
4949 > worked okay for me so far.
4950 @end group
4951 @end smallexample
4952
4953 @vindex mh-extract-from-attribution-verb
4954
4955 The attribution consists of the sender's name and email address
4956 followed by the content of the option
4957 @code{mh-extract-from-attribution-verb}. This option can be set to
4958 @samp{wrote:}, @samp{a écrit:}, and @samp{schrieb:}. You can also use
4959 the @samp{Custom String} menu item to enter your own verb.
4960
4961 @vindex mail-citation-hook
4962 @vindex mh-ins-buf-prefix
4963 @vindex mh-yank-behavior
4964
4965 The prefix @code{"> "} is the default setting for the option
4966 @code{mh-ins-buf-prefix}. I suggest that you not modify this option
4967 since it is used by many mailers and news readers: messages are far
4968 easier to read if several included messages have all been indented by
4969 the same string. This prefix is not inserted if you use one of the
4970 supercite flavors of @code{mh-yank-behavior} or you have added a
4971 @code{mail-citation-hook} as described below.
4972
4973 @vindex mh-delete-yanked-msg-window-flag
4974
4975 You can also turn on the @code{mh-delete-yanked-msg-window-flag}
4976 option to delete the window containing the original message after
4977 yanking it to make more room on your screen for your reply.
4978
4979 @cindex Emacs, packages, supercite
4980 @cindex supercite package
4981 @kindex r
4982 @vindex mail-citation-hook
4983 @vindex mh-yank-behavior
4984
4985 You can control how the message to which you are replying is yanked
4986 into your reply using @code{mh-yank-behavior}. To include the entire
4987 message, including the entire header, use @samp{Body and
4988 Header}@footnote{If you'd rather have the header cleaned up, use
4989 @kbd{C-u r} instead of @kbd{r} when replying
4990 (@pxref{Replying}).}@footnote{In the past you would use this setting
4991 and set @code{mail-citation-hook} to @samp{supercite}, but this usage
4992 is now deprecated in favor of the @samp{Invoke supercite} setting.}.
4993 Use @samp{Body} to yank just the body without the header. To yank only
4994 the portion of the message following the point, set this option to
4995 @samp{Below Point}.
4996
4997 Choose @samp{Invoke supercite}@footnote{@emph{Supercite} is a
4998 full-bodied, full-featured, citation package that comes standard with
4999 Emacs.} to pass the entire message and header through supercite.
5000
5001 @vindex mh-extract-from-attribution-verb
5002
5003 If the @samp{Body With Attribution} setting is used, then the message
5004 minus the header is yanked and a simple attribution line is added at
5005 the top using the value of the option
5006 @code{mh-extract-from-attribution-verb}. This is the default.
5007
5008 @kindex C-c C-y
5009 @vindex mh-delete-yanked-msg-window-flag
5010
5011 If the @samp{Invoke supercite} or @samp{Body With Attribution}
5012 settings are used, the @samp{-noformat} argument is passed to the
5013 @command{repl} program to override a @samp{-filter} or @samp{-format}
5014 argument. These settings also have @samp{Automatically} variants that
5015 perform the action automatically when you reply so that you don't need
5016 to use @kbd{C-c C-y} at all. Note that this automatic action is only
5017 performed if the show buffer matches the message being replied to.
5018 People who use the automatic variants tend to turn on the option
5019 @code{mh-delete-yanked-msg-window-flag} as well so that the show
5020 window is never displayed.
5021
5022 @vindex mh-yank-behavior
5023
5024 If the show buffer has a region, the option @code{mh-yank-behavior} is
5025 ignored unless its value is one of @samp{Attribution} variants in
5026 which case the attribution is added to the yanked region.
5027
5028 @findex trivial-cite
5029 @vindex mail-citation-hook
5030 @vindex mh-ins-buf-prefix
5031 @vindex mh-yank-behavior
5032
5033 If this isn't enough, you can gain full control over the appearance of
5034 the included text by setting @code{mail-citation-hook} to a function
5035 that modifies it. This hook is ignored if the option
5036 @code{mh-yank-behavior} is set to one of the supercite flavors.
5037 Otherwise, this option controls how much of the message is passed to
5038 the hook. The function can find the citation between point and mark
5039 and it should leave point and mark around the modified citation text
5040 for the next hook function. The standard prefix
5041 @code{mh-ins-buf-prefix} is not added if this hook is set.
5042
5043 @cindex Emacs, packages, trivial-cite
5044 @cindex trivial-cite package
5045 @vindex mh-yank-behavior
5046
5047 For example, if you use the hook function
5048 @uref{http://www.emacswiki.org/emacs/TrivialCite,
5049 @code{trivial-cite}} (which is NOT part of Emacs), set
5050 @code{mh-yank-behavior} to @samp{Body and Header}.
5051
5052 @node Inserting Messages, Signature, Inserting Letter, Editing Drafts
5053 @section Inserting Messages
5054
5055 @cindex inserting messages
5056 @findex mh-insert-letter
5057 @findex mh-yank-behavior
5058 @kindex C-c C-i
5059 @vindex mh-ins-buf-prefix
5060 @vindex mh-invisible-header-fields-compiled
5061 @vindex mh-yank-behavior
5062
5063 Messages can be inserted with @kbd{C-c C-i} (@code{mh-insert-letter}).
5064 This command prompts you for the folder and message number, which
5065 defaults to the current message in that folder. It then inserts the
5066 messages, indented by @code{mh-ins-buf-prefix} (@samp{> }) unless
5067 @code{mh-yank-behavior} is set to one of the supercite flavors in
5068 which case supercite is used to format the message. Certain
5069 undesirable header fields (see
5070 @code{mh-invisible-header-fields-compiled}) are removed before
5071 insertion.
5072
5073 If given a prefix argument (like @kbd{C-u C-c C-i}), the header is
5074 left intact, the message is not indented, and @samp{> } is not
5075 inserted before each line. This command leaves the mark before the
5076 letter and point after it.
5077
5078 @node Signature, Picture, Inserting Messages, Editing Drafts
5079 @section Inserting Your Signature
5080
5081 @cindex signature
5082 @findex mh-insert-signature
5083 @kindex C-c C-s
5084
5085 You can insert your signature at the current cursor location with the
5086 command @kbd{C-c C-s} (@code{mh-insert-signature}).
5087
5088 @cindex files, @file{.signature}
5089 @cindex @file{.signature}
5090 @cindex vCard
5091 @vindex mh-signature-file-name
5092
5093 By default, the text of your signature is taken from the file
5094 @file{~/.signature}. You can read from other sources by changing the
5095 option @code{mh-signature-file-name}. This file may contain a
5096 @dfn{vCard} in which case an attachment is added with the vCard.
5097
5098 @findex mh-signature-separator-p
5099 @vindex mh-signature-file-name
5100 @vindex mh-signature-separator
5101 @vindex mh-signature-separator-regexp
5102
5103 The option @code{mh-signature-file-name} may also be a symbol, in
5104 which case that function is called. You may not want a signature
5105 separator to be added for you; instead you may want to insert one
5106 yourself. Options that you may find useful to do this include
5107 @code{mh-signature-separator} (when inserting a signature separator)
5108 and @code{mh-signature-separator-regexp} (for finding said separator).
5109 The function @code{mh-signature-separator-p}, which reports @code{t}
5110 if the buffer contains a separator, may be useful as well.
5111
5112 @cindex signature separator
5113 @vindex mh-signature-separator-flag
5114
5115 A signature separator (@code{"-- "}) will be added if the signature
5116 block does not contain one and @code{mh-signature-separator-flag} is
5117 on. It is not recommended that you change this option since various
5118 mail user agents, including MH-E, use the separator to present the
5119 signature differently, and to suppress the signature when replying or
5120 yanking a letter into a draft.
5121
5122 @vindex mh-insert-signature-hook
5123 @vindex mh-signature-file-name
5124
5125 The hook @code{mh-insert-signature-hook} is run after the signature is
5126 inserted. Hook functions may access the actual name of the file or the
5127 function used to insert the signature with
5128 @code{mh-signature-file-name}.
5129
5130 The signature can also be inserted using Identities.
5131 @xref{Identities}.
5132
5133 @node Picture, Adding Attachments, Signature, Editing Drafts
5134 @section Inserting Your Picture
5135
5136 @cindex @file{.face}
5137 @cindex files, @file{.face}
5138 @vindex mh-x-face-file
5139
5140 You can insert your picture in the header of your mail message so that
5141 recipients see your face in the @samp{From:} header field if their
5142 mail user agent is sophisticated enough. In MH-E, this is done by
5143 placing your image in the file named by the option
5144 @code{mh-x-face-file} which is @file{~/.face} by default.
5145
5146 @cindex @samp{Face} header field
5147 @cindex @samp{X-Face} header field
5148 @cindex @samp{X-Image-URL} header field
5149 @cindex header field, @samp{Face}
5150 @cindex header field, @samp{X-Face}
5151 @cindex header field, @samp{X-Image-URL}
5152
5153 If the file starts with either of the strings @samp{X-Face:},
5154 @samp{Face:} or @samp{X-Image-URL:} then the contents are added to the
5155 message header verbatim. Otherwise it is assumed that the file
5156 contains the value of the @samp{X-Face:} header field.
5157
5158 @cindex @command{compface}
5159 @cindex Unix commands, @command{compface}
5160
5161 The @samp{X-Face:} header field, which is a low-resolution, black and
5162 white image, can be generated using the
5163 @uref{ftp://ftp.cs.indiana.edu/pub/faces/compface/compface.tar.Z,
5164 @command{compface}} command. The @uref{http://www.dairiki.org/xface/,
5165 @cite{Online X-Face Converter}} is a useful resource for quick
5166 conversion of images into @samp{X-Face:} header fields.
5167
5168 Use the @uref{http://quimby.gnus.org/circus/face/make-face,
5169 @command{make-face}} script to convert a JPEG image to the higher
5170 resolution, color, @samp{Face:} header field.
5171
5172 The URL of any image can be used for the @samp{X-Image-URL:} field and
5173 no processing of the image is required.
5174
5175 @vindex mh-x-face-file
5176
5177 To prevent the setting of any of these header fields, either set
5178 @code{mh-x-face-file} to @code{nil}, or simply ensure that the file
5179 defined by this option doesn't exist.
5180
5181 @xref{Viewing}, to see how these header fields are displayed in MH-E.
5182
5183 @node Adding Attachments, Sending PGP, Picture, Editing Drafts
5184 @section Adding Attachments
5185
5186 @cindex @command{mhbuild}
5187 @cindex @command{mhn}
5188 @cindex MH commands, @command{mhbuild}
5189 @cindex MH commands, @command{mhn}
5190 @cindex MIME
5191 @cindex multimedia mail
5192
5193 MH-E has the capability to create multimedia messages. It uses the
5194 @sc{mime} (Multipurpose Internet Mail Extensions)
5195 protocol@footnote{@sc{mime} is defined in
5196 @uref{http://www.rfc-editor.org/rfc/rfc2045.txt, RFC 2045}.} The
5197 @sc{mime} protocol allows you to incorporate images, sound, video,
5198 binary files, and even commands that fetch a file with @samp{ftp} when
5199 your recipient reads the message!
5200
5201 @kindex C-c C-m
5202
5203 If you were to create a multimedia message with plain MH commands, you
5204 would insert @command{mhbuild} or @command{mhn} directives (henceforth
5205 called @dfn{MH-style directives} into your draft and use the
5206 @command{mhbuild} command in nmh or @command{mhn} command in MH and
5207 GNU mailutils to expand them. MH-E works in much the same way,
5208 although it provides a handful of commands prefixed with @kbd{C-c C-m}
5209 to insert the directives so you don't need to remember the syntax of
5210 them. Remember: you can always add MH-style directives by
5211 hand@footnote{See the section
5212 @uref{@value{MH-BOOK-HOME}/usimim.html#SeMIMa, Sending MIME Mail} in
5213 the MH book.}.
5214
5215 @cindex MIME Meta Language (MML)
5216 @cindex MML
5217 @vindex mh-compose-insertion
5218
5219 In addition to MH-style directives, MH-E also supports MML (@sc{mime}
5220 Meta Language) tags@footnote{
5221 @ifinfo
5222 @c Although the third argument should default to the
5223 @c first, makeinfo goes to the wrong Info file without it being
5224 @c different--it seems to be getting our own Composing node.
5225 @xref{Composing,,Composing with MML,emacs-mime}.
5226 @end ifinfo
5227 @ifnotinfo
5228 See the section Composing in
5229 @uref{http://www.gnus.org/manual/emacs-mime.html, @cite{The Emacs MIME
5230 Manual}}.
5231 @end ifnotinfo
5232 }. The option @code{mh-compose-insertion} can be used to choose
5233 between them. By default, this option is set to @samp{MML} if it is
5234 supported since it provides a lot more functionality. This option can
5235 also be set to @samp{MH} if MH-style directives are preferred.
5236
5237 @cindex media types
5238 @cindex MIME, media types
5239
5240 The MH-E @sc{mime} commands require a @dfn{media type} for each body
5241 part or attachment. For example, a PDF document is of type
5242 @samp{application/pdf} and an HTML document is of type
5243 @samp{text/html}. Some commands fill in the media type for you,
5244 whereas others require you to enter one.
5245
5246 @cindex @command{file}
5247 @cindex @file{/etc/mime.types}
5248 @cindex files, @file{/etc/mime.types}
5249 @cindex Unix commands, @command{file}
5250 @findex mailcap-mime-types
5251
5252 In the cases where MH-E can do so, it will determine the media type
5253 automatically. It uses the @command{file} command to do this. Failing
5254 that, the Emacs function @code{mailcap-mime-types} is used to provide
5255 a list from which to choose. This function usually reads the file
5256 @file{/etc/mime.types}.
5257
5258 Whether the media type is chosen automatically, or you choose it from
5259 a list, use the type that seems to match best the file that you are
5260 including. In the case of binaries, the media type
5261 @samp{application/x-executable} can be useful. If you can't find an
5262 appropriate media type, use @samp{text/plain} for text messages and
5263 @samp{application/octet-stream} for everything else.
5264
5265 @cindex content description
5266 @cindex MIME, content description
5267
5268 You are also sometimes asked for a @dfn{content description}. This is
5269 simply an optional brief phrase, in your own words, that describes the
5270 object. If you don't care to enter a content description, just press
5271 return and none will be included; however, a reader may skip over
5272 multimedia fields unless the content description is compelling.
5273
5274 You can also create your own @sc{mime} body parts. In the following
5275 example, I describe how you can create and edit a @samp{text/enriched}
5276 body part to liven up your plain text messages with boldface,
5277 underlining, and italics. I include an Emacs function which inserts
5278 enriched text tags.
5279
5280 @smalllisp
5281 @group
5282 (defvar enriched-text-types '(("b" . "bold") ("i" . "italic")
5283 ("u" . "underline")
5284 ("s" . "smaller") ("B" . "bigger")
5285 ("f" . "fixed")
5286 ("c" . "center"))
5287 "Alist of (final-character . tag) choices for add-enriched-text.
5288 Additional types can be found in RFC 1563.")
5289
5290 (defun add-enriched-text (begin end)
5291 "Add enriched text tags around region.
5292 The tag used comes from the list enriched-text-types and is
5293 specified by the last keystroke of the command. When called from Lisp,
5294 arguments are BEGIN and END@."
5295 (interactive "r")
5296 ;; @r{Set type to the tag indicated by the last keystroke.}
5297 (let ((type (cdr (assoc (char-to-string (logior last-input-char ?@w{`}))
5298 enriched-text-types))))
5299 (save-restriction ; @r{restores state from narrow-to-region}
5300 (narrow-to-region begin end) ; @r{narrow view to region}
5301 (goto-char (point-min)) ; @r{move to beginning of text}
5302 (insert "<" type ">") ; @r{insert beginning tag}
5303 (goto-char (point-max)) ; @r{move to end of text}
5304 (insert "</" type ">")))) ; @r{insert terminating tag}
5305 @i{Emacs function for entering enriched text}
5306
5307 @end group
5308 @end smalllisp
5309
5310 To use the function @code{add-enriched-text}, first add it to
5311 @file{~/.emacs} and create key bindings for it (@pxref{Composing}).
5312
5313 Then, in your plain text message, set the mark with @kbd{C-@@} or
5314 @kbd{C-@key{SPC}}, type in the text to be highlighted, and type @kbd{C-c t
5315 b}. This adds @samp{<bold>} where you set the mark and adds
5316 @samp{</bold>} at the location of your cursor, giving you something
5317 like: @samp{You should be <bold>very</bold>}.
5318
5319 Before sending this message, use @kbd{C-c C-m C-m}
5320 (@code{mh-mml-to-mime})@footnote{Use @kbd{C-c C-e}
5321 (@code{mh-mh-to-mime}) if you're using MH-style directives.} to add
5322 MIME header fields. Then replace @samp{text/plain} with
5323 @samp{text/enriched} in the @samp{Content-Type:} header field.
5324
5325 You may also be interested in investigating @code{sgml-mode}.
5326
5327 @subheading Including Files
5328
5329 @cindex attachments, inserting
5330 @cindex images
5331 @cindex MIME, images
5332 @cindex MIME, sound
5333 @cindex MIME, video
5334 @cindex sound
5335 @cindex video
5336 @findex mh-compose-insertion
5337 @kindex C-c C-m C-i
5338 @kindex C-c C-m i
5339 @vindex mh-compose-insertion
5340
5341 Binaries, images, sound, and video can be inserted in your message
5342 with the command @kbd{C-c C-m C-i} (@code{mh-compose-insertion}). You
5343 are prompted for the filename containing the object, the media type if
5344 it cannot be determined automatically, and a content description. If
5345 you're using MH-style directives, you will also be prompted for
5346 additional attributes.
5347
5348 @subheading Forwarding Multimedia Messages
5349
5350 @findex mh-compose-forward
5351 @kindex C-c C-m C-f
5352 @kindex C-c C-m f
5353
5354 Mail may be forwarded with @sc{mime} using the command @kbd{C-c C-m
5355 C-f} (@code{mh-compose-forward}). You are prompted for a content
5356 description, the name of the folder in which the messages to forward
5357 are located, and a range of messages, which defaults to the current
5358 message in that folder. @xref{Ranges}.
5359
5360 @subheading Including an FTP Reference
5361
5362 @cindex @command{ftp}
5363 @cindex MIME, @command{ftp}
5364 @cindex Unix commands, @command{ftp}
5365 @findex mh-mh-compose-anon-ftp
5366 @kindex C-c C-m C-g
5367 @kindex C-c C-m g
5368
5369 You can have your message initiate an @command{ftp} transfer when the
5370 recipient reads the message. To do this, use the command @kbd{C-c C-m
5371 C-g} (@code{mh-mh-compose-anon-ftp}). You are prompted for the remote
5372 host and filename, the media type, and the content description.
5373
5374 @subheading Including tar Files
5375
5376 @cindex @command{ftp}
5377 @cindex @command{tar}
5378 @cindex MIME, @command{ftp}
5379 @cindex MIME, @command{tar}
5380 @cindex Unix commands, @command{ftp}
5381 @cindex Unix commands, @command{tar}
5382 @findex mh-mh-compose-anon-ftp
5383 @findex mh-mh-compose-external-compressed-tar
5384 @kindex C-c C-m C-g
5385 @kindex C-c C-m C-t
5386 @kindex C-c C-m t
5387
5388 If the remote file is a compressed tar file, you can use @kbd{C-c C-m
5389 C-t} (@code{mh-mh-compose-external-compressed-tar}). Then, in addition
5390 to retrieving the file via anonymous @emph{ftp} as per the command
5391 @kbd{C-c C-m C-g} (@code{mh-mh-compose-anon-ftp}), the file will also
5392 be uncompressed and untarred. You are prompted for the remote host and
5393 filename and the content description.
5394
5395 @subheading Including Other External Files
5396
5397 @findex mh-mh-compose-external-type
5398 @kindex C-c C-m C-x
5399 @kindex C-c C-m x
5400
5401 The command @kbd{C-c C-m C-x} (@code{mh-mh-compose-external-type}) is
5402 a general utility for referencing external files. In fact, all of the
5403 other commands that insert tags to access external files call this
5404 command. You are prompted for the access type, remote host and
5405 filename, and content type. If you provide a prefix argument, you are
5406 also prompted for a content description, attributes, parameters, and a
5407 comment.
5408
5409 @subheading Previewing Multimedia Messages
5410
5411 When you are finished editing a @sc{mime} message, it might look like this:
5412
5413 @cartouche
5414 @smallexample
5415 3 t08/24 root received fax files on Wed Aug 24 11:00:
5416 4+t08/24 To:wohler Test<<This is a test message to get the
5417
5418
5419
5420
5421
5422 --:%% @{+inbox@} 4 msgs (1-4) Bot L4 (MH-Folder Show)---------------
5423 To: wohler
5424 cc:
5425 Subject: Test of MIME
5426 --------
5427 Here is the SETI@@Home logo:
5428
5429 <#part type="image/x-xpm" filename="~/lib/images/setiathome.xpm"
5430 disposition=inline description="SETI@@home logo">
5431 <#/part>
5432 --:** @{draft@} All L8 (MH-Letter)----------------------------------
5433
5434 @end smallexample
5435 @end cartouche
5436 @i{MH-E @sc{mime} draft}
5437
5438 @findex mh-mml-to-mime
5439 @kindex C-c C-m C-m
5440 @kindex C-c C-m m
5441
5442 Typically, you send a message with attachments just like any other
5443 message (@pxref{Sending Message}).
5444
5445 @findex mh-mml-to-mime
5446 @kindex C-c C-m C-m
5447
5448 However, you may take a sneak preview of the @sc{mime} encoding if you
5449 wish by running the command @kbd{C-c C-m C-m} (@code{mh-mml-to-mime}).
5450 The following screen shows the @sc{mime} encoding specified by the
5451 tags. You can see why mail user agents are usually built to hide these
5452 details from the user.
5453
5454 @cartouche
5455 @smallexample
5456 To: wohler
5457 cc:
5458 Subject: Test of MIME
5459 X-Mailer: MH-E 8.1; nmh 1.1; GNU Emacs 23.1
5460 MIME-Version: 1.0
5461 Content-Type: multipart/mixed; boundary="=-=-="
5462 --------
5463 --=-=-=
5464
5465 Here is the SETI@@Home logo:
5466
5467
5468 --=-=-=
5469 Content-Type: image/x-xpm
5470 Content-Disposition: inline; filename=setiathome.xpm
5471 Content-Transfer-Encoding: base64
5472 Content-Description: SETI@@home logo
5473
5474 LyogWFBNICovCnN0YXRpYyBjaGFyICogc2V0aWF0aG9tZV94cG1bXSA9IHsKIjQ1IDQ1IDc2N
5475 --:-- @{draft@} Top L1 (MH-Letter)----------------------------------
5476
5477 @end smallexample
5478 @end cartouche
5479 @i{MH-E @sc{mime} draft ready to send}
5480
5481 @cindex undo effects of mh-mml-to-mime
5482
5483 This action can be undone by running @kbd{C-_} (@code{undo}).
5484
5485 @cindex @command{mhbuild}
5486 @cindex @command{mhn}
5487 @cindex MH commands, @command{mhbuild}
5488 @cindex MH commands, @command{mhn}
5489 @cindex undo effects of mh-mh-to-mime
5490 @findex mh-mh-to-mime
5491 @findex mh-mh-to-mime-undo
5492 @kindex C-c C-e
5493 @kindex C-c C-m C-m
5494 @kindex C-c C-m C-u
5495 @kindex C-c C-m u
5496
5497 If you're using MH-style directives, use @kbd{C-c C-e}
5498 (@code{mh-mh-to-mime}) instead of @kbd{C-c C-m C-m}. This runs the
5499 command @command{mhbuild} (@command{mhn}) on the message which expands
5500 the tags@footnote{See the section
5501 @uref{@value{MH-BOOK-HOME}/usimim.html#SeMIMa, Sending MIME Mail} in
5502 the MH book.}. This action can be undone by running @kbd{C-c C-m C-u}
5503 (@code{mh-mh-to-mime-undo}), which works by reverting to a backup
5504 file. You are prompted to confirm this action, but you can avoid the
5505 confirmation by adding an argument (for example, @kbd{C-u C-c C-m
5506 C-u}).
5507
5508 @kindex C-c C-e
5509 @vindex mh-mh-to-mime-args
5510
5511 If you wish to pass additional arguments to @command{mhbuild}
5512 (@command{mhn}) to affect how it builds your message, use the option
5513 @code{mh-mh-to-mime-args}. For example, you can build a consistency
5514 check into the message by setting @code{mh-mh-to-mime-args} to
5515 @samp{-check}. The recipient of your message can then run
5516 @samp{mhbuild -check} on the message---@command{mhbuild}
5517 (@command{mhn}) will complain if the message has been corrupted on the
5518 way. The command @kbd{C-c C-e} only consults this option when given a
5519 prefix argument (as in @kbd{C-u C-c C-e}).
5520
5521 @kindex C-c C-e
5522 @vindex mh-mh-to-mime-hook
5523
5524 The hook @code{mh-mh-to-mime-hook} is called after the message has
5525 been formatted by @kbd{C-c C-e}.
5526
5527 @node Sending PGP, Checking Recipients, Adding Attachments, Editing Drafts
5528 @section Signing and Encrypting Messages
5529
5530 @cindex signing messages
5531 @cindex encrypting messages
5532 @cindex RFC 3156
5533
5534 MH-E can sign and encrypt messages as defined in
5535 @uref{http://www.rfc-editor.org/rfc/rfc3156.txt, RFC 3156}. If you
5536 should choose to sign or encrypt your message, use one of the
5537 following commands to do so any time before sending your message.
5538
5539 @findex mh-mml-secure-message-encrypt
5540 @findex mh-mml-secure-message-sign
5541 @findex mh-mml-secure-message-signencrypt
5542 @kindex C-c C-m C-e
5543 @kindex C-c C-m C-s
5544 @kindex C-c C-m e e
5545 @kindex C-c C-m e s
5546 @kindex C-c C-m s e
5547 @kindex C-c C-m s s
5548
5549 The command @kbd{C-c C-m C-s} (@code{mh-mml-secure-message-sign})
5550 inserts the following tag:
5551
5552 @smallexample
5553 <#secure method=pgpmime mode=sign>
5554 @end smallexample
5555
5556 This is used to sign your message digitally. Likewise, the command
5557 @kbd{C-c C-m C-e} (@code{mh-mml-secure-message-encrypt}) inserts the
5558 following tag:
5559
5560 @smallexample
5561 <#secure method=pgpmime mode=encrypt>
5562 @end smallexample
5563
5564 This is used to encrypt your message. Finally, the command @kbd{C-c
5565 C-m s e} (@code{mh-mml-secure-message-signencrypt}) inserts the
5566 following tag:
5567
5568 @smallexample
5569 <#secure method=pgpmime mode=signencrypt>
5570 @end smallexample
5571
5572 @findex mh-mml-unsecure-message
5573 @kindex C-c C-m C-n
5574 @kindex C-c C-m n
5575 @vindex mh-mml-method-default
5576
5577 This is used to sign and encrypt your message. In each of these cases,
5578 a proper multipart message is created for you when you send the
5579 message. Use the command @kbd{C-c C-m C-n}
5580 (@code{mh-mml-unsecure-message}) to remove these tags. Use a prefix
5581 argument (as in @kbd{C-u C-c C-m s e}) to be prompted for one of the
5582 possible security methods (see @code{mh-mml-method-default}).
5583
5584 @vindex mh-mml-method-default
5585
5586 The option @code{mh-mml-method-default} is used to select between a
5587 variety of mail security mechanisms. The default is @samp{PGP (MIME)}
5588 if it is supported; otherwise, the default is @samp{None}. Other
5589 mechanisms include vanilla @samp{PGP} and @samp{S/MIME}.
5590
5591 @cindex @samp{pgg} customization group
5592 @cindex PGG
5593 @cindex customization group, @samp{pgg}
5594
5595 The @samp{pgg} customization group may have some settings which may
5596 interest you.
5597 @iftex
5598 See @cite{The PGG Manual}.
5599 @end iftex
5600 @ifinfo
5601 @xref{Top, , The PGG Manual, pgg, The PGG Manual}.
5602 @end ifinfo
5603 @ifhtml
5604 See
5605 @uref{http://www.gnu.org/software/emacs/manual/pgg.html,
5606 @cite{The PGG Manual}}.
5607 @end ifhtml
5608
5609 @cindex header field, @samp{Fcc}
5610 @cindex @samp{Fcc} header field
5611 @vindex pgg-encrypt-for-me
5612
5613 In particular, I turn on the option @code{pgg-encrypt-for-me} so that
5614 all messages I encrypt are encrypted with my public key as well. If
5615 you keep a copy of all of your outgoing mail with a @samp{Fcc:} header
5616 field, this setting is vital so that you can read the mail you write!
5617
5618 @node Checking Recipients, Sending Message, Sending PGP, Editing Drafts
5619 @section Checking Recipients
5620
5621 @cindex @file{*MH-E Recipients*}
5622 @cindex @command{whom}
5623 @cindex MH commands, @command{whom}
5624 @cindex buffers, @file{*MH-E Recipients*}
5625 @cindex checking recipients
5626 @cindex recipients, checking
5627 @findex mh-check-whom
5628 @kindex C-c C-w
5629
5630 The command @kbd{C-c C-w} (@code{mh-check-whom}) expands aliases so
5631 you can check the actual address(es) in the alias. A new buffer named
5632 @file{*MH-E Recipients*} is created with the output of @command{whom}
5633 (@pxref{Miscellaneous})@footnote{See the section
5634 @uref{@value{MH-BOOK-HOME}/senove.html#WhaPro, What now?---and the
5635 whatnow Program} in the MH book.}.
5636
5637 @node Sending Message, Killing Draft, Checking Recipients, Editing Drafts
5638 @section Sending a Message
5639
5640 @cindex buffers, @file{*MH-E Mail Delivery*}
5641 @cindex @file{*MH-E Mail Delivery*}
5642 @cindex sending mail
5643 @findex mh-send-letter
5644 @kindex C-c C-c
5645
5646 When you are all through editing a message, you send it with the
5647 command @kbd{C-c C-c} (@code{mh-send-letter}). You can give a prefix
5648 argument (as in @kbd{C-u C-c C-c}) to monitor the first stage of the
5649 delivery; this output can be found in a buffer called @file{*MH-E Mail
5650 Delivery*} (@pxref{Miscellaneous}).
5651
5652 @cindex sending mail
5653 @cindex spell check
5654 @findex ispell-message
5655 @kindex C-c C-c
5656 @vindex mh-before-send-letter-hook
5657
5658 The hook @code{mh-before-send-letter-hook} is run at the beginning of
5659 the command @kbd{C-c C-c}. For example, if you want to check your
5660 spelling in your message before sending, add the function
5661 @code{ispell-message}.
5662
5663 @cindex @command{send}
5664 @cindex MH commands, @command{send}
5665 @vindex mh-send-prog
5666
5667 In case the MH @command{send} program@footnote{See the section
5668 @uref{@value{MH-BOOK-HOME}/sensen.html, Sending Some Mail: comp send}
5669 in the MH book.} is installed under a different name, use
5670 @code{mh-send-prog} to tell MH-E the name.
5671
5672 The hook @code{mh-annotate-msg-hook} is run after annotating the
5673 message and scan line (@pxref{Sending Mail}).
5674
5675 @node Killing Draft, , Sending Message, Editing Drafts
5676 @section Killing the Draft
5677
5678 @cindex killing draft
5679 @findex kill-buffer
5680 @findex mh-fully-kill-draft
5681 @kindex C-c C-q
5682 @kindex C-x k
5683
5684 If for some reason you are not happy with the draft, you can use the
5685 command @kbd{C-c C-q} (@code{mh-fully-kill-draft}) to kill the draft
5686 buffer and delete the draft message. Use the command @kbd{C-x k}
5687 (@code{kill-buffer}) if you don't want to delete the draft message.
5688
5689 @node Aliases, Identities, Editing Drafts, Top
5690 @chapter Aliases
5691
5692 @cindex aliases
5693
5694 MH aliases are used in the same way in MH-E as they are in MH@. Any
5695 alias listed as a recipient will be expanded when the message is sent.
5696 This chapter discusses other things you can do with aliases in MH-E.
5697
5698 @cindex MH-Letter mode
5699 @cindex modes, MH-Letter
5700
5701 The following commands are available in MH-Letter mode with the
5702 exception of @code{mh-alias-reload} which can be called from anywhere.
5703
5704 @table @kbd
5705 @kindex @key{SPC}
5706 @findex mh-letter-complete-or-space
5707 @item @key{SPC}
5708 Perform completion or insert space (@code{mh-letter-complete-or-space}).
5709 @c -------------------------
5710 @kindex M-@key{TAB}
5711 @findex mh-letter-complete
5712 @item M-@key{TAB}
5713 Perform completion on header field or word preceding point
5714 (@code{mh-letter-complete}).
5715 @c -------------------------
5716 @findex mh-alias-apropos
5717 @item mh-alias-apropos
5718 Show all aliases or addresses that match a regular expression.
5719 @c -------------------------
5720 @findex mh-alias-grab-from-field
5721 @item mh-alias-grab-from-field
5722 Add alias for the sender of the current message
5723 @c -------------------------
5724 @findex mh-alias-reload
5725 @item mh-alias-reload
5726 Reload MH aliases.
5727 @end table
5728
5729 @cindex @samp{mh-alias} customization group
5730 @cindex customization group, @samp{mh-alias}
5731
5732 The @samp{mh-alias} customization group contains options associated
5733 with aliases.
5734
5735 @vtable @code
5736 @item mh-alias-completion-ignore-case-flag
5737 On means don't consider case significant in MH alias completion
5738 (default: @samp{on}).
5739 @c -------------------------
5740 @item mh-alias-expand-aliases-flag
5741 On means to expand aliases entered in the minibuffer (default:
5742 @samp{off}).
5743 @c -------------------------
5744 @item mh-alias-flash-on-comma
5745 Specify whether to flash address or warn on translation (default: @samp{Flash
5746 but Don't Warn If No Alias}).
5747 @c -------------------------
5748 @item mh-alias-insert-file
5749 Filename used to store a new MH-E alias (default: @samp{Use Aliasfile
5750 Profile Component}).
5751 @c -------------------------
5752 @item mh-alias-insertion-location
5753 Specifies where new aliases are entered in alias files (default:
5754 @samp{Alphabetical}).
5755 @c -------------------------
5756 @item mh-alias-local-users
5757 If @samp{on}, local users are added to alias completion (default:
5758 @samp{on}).
5759 @c -------------------------
5760 @item mh-alias-local-users-prefix
5761 String prefixed to the real names of users from the password file
5762 (default: @code{"local."}.
5763 @c -------------------------
5764 @item mh-alias-passwd-gecos-comma-separator-flag
5765 On means the GECOS field in the password file uses a comma separator
5766 (default: @samp{on}).
5767 @end vtable
5768
5769 The following hook is available.
5770
5771 @vtable @code
5772 @item mh-alias-reloaded-hook
5773 Hook run by @code{mh-alias-reload} after loading aliases (default:
5774 @code{nil}).
5775 @end vtable
5776
5777 @subheading Adding Addresses to Draft
5778
5779 You can use aliases when you are adding recipients to a message.
5780
5781 @findex minibuffer-complete
5782 @kindex @key{TAB}
5783 @vindex mh-alias-expand-aliases-flag
5784 @vindex mh-compose-prompt-flag
5785
5786 In order to use minibuffer prompting for recipients and the subject
5787 line in the minibuffer, turn on the option
5788 @code{mh-compose-prompt-flag} (@pxref{Composing}), and use the
5789 @key{TAB} (@code{minibuffer-complete}) command to complete aliases
5790 (and optionally local logins) when prompted for the recipients. Turn
5791 on the option @code{mh-alias-expand-aliases-flag} if you want these
5792 aliases to be expanded to their respective addresses in the draft.
5793
5794 @findex mh-letter-complete
5795 @findex mh-letter-complete-or-space
5796 @kindex @key{SPC}
5797 @kindex M-@key{TAB}
5798
5799 Otherwise, you can complete aliases in the header of the draft with
5800 @kbd{M-@key{TAB}} (@code{mh-letter-complete}) or @key{SPC}
5801 (@code{mh-letter-complete-or-space}).
5802
5803 @vindex mh-alias-completion-ignore-case-flag
5804
5805 As MH ignores case in the aliases, so too does MH-E@. However, you may
5806 turn off the option @code{mh-alias-completion-ignore-case-flag} to
5807 make case significant which can be used to segregate completion of
5808 your aliases. You might use uppercase for mailing lists and lowercase
5809 for people. For example, you might have:
5810
5811 @smallexample
5812 mark.baushke: Mark Baushke <mdb@@stop.mail-abuse.org>
5813 MH-E: MH-E Mailing List <mh-e-devel@@stop.mail-abuse.org>
5814 @end smallexample
5815
5816 When this option is turned off, if you were to type @kbd{M} in the
5817 @samp{To:} field and then @kbd{M-@key{TAB}}, then you'd get the list;
5818 if you started with @kbd{m} and then entered @kbd{M-@key{TAB}}, then
5819 you'd get Mark's address. Note that this option affects completion
5820 only. If you were to enter @kbd{Mark.Baushke}, it would still be
5821 identified with your @samp{mark.baushke} alias.
5822
5823 @findex mh-alias-minibuffer-confirm-address
5824 @findex mh-letter-confirm-address
5825 @vindex mh-alias-flash-on-comma
5826 @vindex mh-compose-prompt-flag
5827
5828 To verify that the alias you've entered is valid, the alias will be
5829 displayed in the minibuffer when you type a comma
5830 (@code{mh-letter-confirm-address} or
5831 @code{mh-alias-minibuffer-confirm-address} if the option
5832 @code{mh-compose-prompt-flag} is turned on). @xref{Composing}. This
5833 behavior can be controlled with the option
5834 @code{mh-alias-flash-on-comma} which provides three choices:
5835 @samp{Flash but Don't Warn If No Alias}, @samp{Flash and Warn If No
5836 Alias}, and @samp{Don't Flash Nor Warn If No Alias}.
5837
5838 For another way to verify the alias expansion, see @ref{Checking
5839 Recipients}.
5840
5841 @subheading Loading Aliases
5842
5843 @cindex @command{ali}
5844 @cindex @file{/etc/nmh/MailAliases}
5845 @cindex @samp{Aliasfile} MH profile component
5846 @cindex MH commands, @command{ali}
5847 @cindex MH profile component, @samp{Aliasfile}
5848 @cindex files, @file{/etc/nmh/MailAliases}
5849
5850 MH-E loads aliases for completion and folder name hints from various
5851 places. It uses the MH command @command{ali}@footnote{See the section
5852 @uref{@value{MH-BOOK-HOME}/mh.html, MH Aliases} in the MH book.} to
5853 read aliases from the files listed in the profile component
5854 @samp{Aliasfile:} as well as system-wide aliases (for example,
5855 @file{/etc/nmh/MailAliases}).
5856
5857 @cindex @file{/etc/passwd}
5858 @cindex files, @file{/etc/passwd}
5859
5860 In addition, aliases are created from @file{/etc/passwd} entries with
5861 a user ID larger than a magical number, typically 200. This can be a
5862 handy tool on a machine where you and co-workers exchange messages.
5863 These aliases have the form @samp{local.@var{first.last}} if a real
5864 name is present in the password file. Otherwise, the alias will have
5865 the form @samp{local.@var{login}}.
5866
5867 @vindex mh-alias-local-users-prefix
5868
5869 The prefix @samp{local.} can be modified via the option
5870 @code{mh-alias-local-users-prefix}. This option can also be set to
5871 @samp{Use Login}.
5872
5873 For example, consider the following password file entry:
5874
5875 @smallexample
5876 psg:x:1000:1000:Peter S Galbraith,,,:/home/psg:/bin/tcsh
5877 @end smallexample
5878
5879 @vindex mh-alias-local-users-prefix
5880
5881 The following settings of option @code{mh-alias-local-users-prefix}
5882 will produce the associated aliases:
5883
5884 @table @code
5885 @item "local."
5886 local.peter.galbraith
5887 @c -------------------------
5888 @item ""
5889 peter.galbraith
5890 @c -------------------------
5891 @item Use Login
5892 psg
5893 @end table
5894
5895 @vindex mh-alias-passwd-gecos-comma-separator-flag
5896
5897 In the example above, commas are used to separate different values
5898 within the so-called GECOS field. This is a fairly common usage.
5899 However, in the rare case that the GECOS field in your password file
5900 is not separated by commas and whose contents may contain commas, you
5901 can turn the option @code{mh-alias-passwd-gecos-comma-separator-flag}
5902 off.
5903
5904 @cindex NIS, obtaining local aliases from
5905 @cindex @samp{ypcat passwd}
5906 @vindex mh-alias-local-users
5907
5908 If you're on a system with thousands of users you don't know, and the
5909 loading of local aliases slows MH-E down noticeably, then the local
5910 alias feature can be disabled by turning off the option
5911 @code{mh-alias-local-users}. This option also takes a string which is
5912 executed to generate the password file. For example, use @samp{ypcat
5913 passwd} to obtain the NIS password file.
5914
5915 @findex mh-alias-reload
5916 @kindex M-x mh-alias-reload
5917 @vindex mh-alias-reloaded-hook
5918
5919 Since aliases are updated frequently, MH-E reloads aliases
5920 automatically whenever an alias lookup occurs if an alias source has
5921 changed. However, you can reload your aliases manually by calling the
5922 command @kbd{M-x mh-alias-reload} directly. This command runs
5923 @code{mh-alias-reloaded-hook} after the aliases have been loaded.
5924
5925 @subheading Adding Aliases
5926
5927 In the past, you have manually added aliases to your alias file(s)
5928 listed in your @samp{Aliasfile:} profile component. MH-E provides
5929 other methods for maintaining your alias file(s).
5930
5931 @findex mh-alias-add-alias
5932 @kindex M-x mh-alias-add-alias
5933
5934 You can use the @kbd{M-x mh-alias-add-alias} command which will prompt
5935 you for the alias and address that you would like to add. If the alias
5936 exists already, you will have the choice of inserting the new alias
5937 before or after the old alias. In the former case, this alias will be
5938 used when sending mail to this alias. In the latter case, the alias
5939 serves as an additional folder name hint when filing messages
5940 (@pxref{Folder Selection}).
5941
5942 Earlier, the alias prefix @samp{local} was presented. You can use
5943 other prefixes to organize your aliases or disambiguate entries. You
5944 might use prefixes for locales, jobs, or activities. For example, I
5945 have:
5946
5947 @smallexample
5948 @group
5949 ; Work
5950 attensity.don.mitchell: Don Mitchell <dmitchell@@stop.mail-abuse.com>
5951 isharp.don.mitchell: Don Mitchell <donaldsmitchell@@stop.mail-abuse.com>
5952 ...
5953 ; Sport
5954 diving.ken.mayer: Ken Mayer <kmayer@@stop.mail-abuse.com>
5955 sailing.mike.maloney: Mike Maloney <mmaloney@@stop.mail-abuse.com>
5956 ...
5957 ; Personal
5958 ariane.kolkmann: Ariane Kolkmann <ArianeKolkmann@@stop.mail-abuse.com>
5959 ...
5960 @end group
5961 @end smallexample
5962
5963 Using prefixes instead of postfixes helps you explore aliases during
5964 completion. If you forget the name of an old dive buddy, you can enter
5965 @samp{div} and then @key{SPC} to get a listing of all your dive buddies.
5966
5967 @kindex M-x mh-alias-add-address-under-point
5968 @kindex M-x mh-alias-grab-from-field
5969
5970 An alias for the sender of the current message is added automatically
5971 by clicking on the @samp{Grab From alias} tool bar button or by running
5972 the @kbd{M-x mh-alias-grab-from-field} command. Aliases for other
5973 recipients of the current message are added by placing your cursor
5974 over the desired recipient and giving the @kbd{M-x
5975 mh-alias-add-address-under-point} command.
5976
5977 @vindex mh-alias-insert-file
5978 @vindex mh-alias-insertion-location
5979
5980 The options @code{mh-alias-insert-file} and
5981 @code{mh-alias-insertion-location} controls how and where these aliases
5982 are inserted.
5983
5984 @vindex mh-alias-insert-file
5985
5986 The default setting of option @code{mh-alias-insert-file} is @samp{Use
5987 Aliasfile Profile Component}. This option can also hold the name of a
5988 file or a list a file names. If this option is set to a list of file
5989 names, or the @samp{Aliasfile:} profile component contains more than
5990 one file name, MH-E will prompt for one of them.
5991
5992 @vindex mh-alias-insertion-location
5993
5994 The option @code{mh-alias-insertion-location} is set to
5995 @samp{Alphabetical} by default. If you organize your alias file in
5996 other ways, then the settings @samp{Top} and @samp{Bottom} might be
5997 more appropriate.
5998
5999 @subheading Querying Aliases
6000
6001 @cindex regular expressions, @code{mh-alias-apropos}
6002 @findex mh-alias-apropos
6003 @kindex M-x mh-alias-apropos
6004
6005 If you can't quite remember an alias, you can use @kbd{M-x
6006 mh-alias-apropos} to show all aliases or addresses that match a
6007 regular expression
6008 @ifnothtml
6009 (@pxref{Regexps, , Syntax of Regular Expressions, emacs, The
6010 GNU Emacs Manual}).
6011 @end ifnothtml
6012 @ifhtml
6013 (see the section
6014 @uref{http://www.gnu.org/software/emacs/manual/html_node/emacs/Regexps.html,
6015 Syntax of Regular Expressions} in
6016 @cite{The GNU Emacs Manual}).
6017 @end ifhtml
6018
6019 @node Identities, Speedbar, Aliases, Top
6020 @chapter Identities
6021
6022 @cindex identities
6023 @cindex multiple personalities
6024
6025 MH-E supports the concept of multiple personalities or identities.
6026 This means that you can easily have a different header and signature
6027 at home and at work.
6028
6029 @cindex @samp{Identity} menu
6030 @cindex menu, @samp{Identity}
6031
6032 A couple of commands are used to insert identities in MH-Letter mode
6033 which are also found in the @samp{Identity} menu.
6034
6035 @table @kbd
6036 @kindex C-c C-d
6037 @findex mh-insert-identity
6038 @item C-c C-d
6039 Insert fields specified by given identity (@code{mh-insert-identity}).
6040 @c -------------------------
6041 @cindex @samp{Identity > Insert Auto Fields} menu item
6042 @cindex menu item, @samp{Identity > Insert Auto Fields}
6043 @kindex C-c M-d
6044 @findex mh-insert-auto-fields
6045 @item C-c M-d
6046 Insert custom fields if recipient found in @code{mh-auto-fields-list}
6047 (@code{mh-insert-auto-fields}).
6048 @end table
6049
6050 @cindex @samp{mh-identity} customization group
6051 @cindex customization group, @samp{mh-identity}
6052
6053 The @samp{mh-identity} customization group contains the following
6054 options.
6055
6056 @vtable @code
6057 @item mh-auto-fields-list
6058 List of recipients for which header lines are automatically inserted
6059 (default: @code{nil}).
6060 @c -------------------------
6061 @item mh-auto-fields-prompt-flag
6062 On means to prompt before sending if fields inserted (default:
6063 @samp{on})
6064 @c -------------------------
6065 @item mh-identity-default
6066 Default identity to use when @code{mh-letter-mode} is called (default:
6067 @samp{None}).
6068 @c -------------------------
6069 @item mh-identity-handlers
6070 Handler functions for fields in @code{mh-identity-list}.
6071 @c -------------------------
6072 @item mh-identity-list
6073 List of identities (default: @code{nil}).
6074 @end vtable
6075
6076 Some of the common header fields that people change depending on the
6077 context are the @samp{From:} and @samp{Organization:} fields, as well
6078 as the signature.
6079
6080 @vindex mh-identity-list
6081
6082 This is done by customizing the option @code{mh-identity-list}. In the
6083 customization buffer for this option, click on the @samp{INS} button
6084 and enter a label such as @samp{Home} or @samp{Work}. Then click on
6085 the @samp{INS} button with the label @samp{Add at least one item
6086 below}. The @samp{Value Menu} has the following menu items:
6087
6088 @table @samp
6089 @cindex header field, @samp{From}
6090 @cindex @samp{From} header field
6091 @item From Field
6092 Specify an alternate @samp{From:} header field. You must include a
6093 valid email address. A standard format is @samp{First Last
6094 <login@@host.domain>}. If you use an initial with a period, then you
6095 must quote your name as in @samp{"First I. Last"
6096 <login@@host.domain>}.
6097 @c -------------------------
6098 @cindex header field, @samp{Organization}
6099 @cindex @samp{Organization} header field
6100 @item Organization Field
6101 People usually list the name of the company where they work here.
6102 @c -------------------------
6103 @item Other Field
6104 Set any arbitrary header field and value here. Unless the header field
6105 is a standard one, precede the name of your field's label with
6106 @samp{X-}, as in @samp{X-Fruit-of-the-Day:}.
6107 @c -------------------------
6108 @item Attribution Verb
6109 This value overrides the setting of
6110 @code{mh-extract-from-attribution-verb}. @xref{Inserting Letter}.
6111 @c -------------------------
6112 @cindex signature
6113 @vindex mh-signature-file-name
6114 @item Signature
6115 Set your signature with this item. You can specify the contents of
6116 @code{mh-signature-file-name}, a file, or a function.
6117 @xref{Signature}.
6118 @c -------------------------
6119 @item GPG Key ID
6120 Specify a different key to sign or encrypt messages.
6121 @end table
6122
6123 @cindex Identity menu
6124 @cindex menu, Identity
6125 @findex mh-insert-identity
6126 @kindex C-c C-d
6127
6128 You can select the identities you have added via the menu called
6129 @samp{Identity} in the MH-Letter buffer. You can also use @kbd{C-c
6130 C-d} (@code{mh-insert-identity}). To clear the fields and signature
6131 added by the identity, select the @samp{None} identity.
6132
6133 @cindex menu item, @samp{Identity > Customize Identities}
6134 @cindex menu item, @samp{Identity > Save as Default}
6135 @cindex menu item, @samp{Identity > Set Default for Session}
6136 @cindex @samp{Identity > Customize Identities} menu item
6137 @cindex @samp{Identity > Save as Default} menu item
6138 @cindex @samp{Identity > Set Default for Session} menu item
6139 @vindex mh-identity-default
6140
6141 The @samp{Identity} menu contains two other items to save you from
6142 having to set the identity on every message. The menu item @samp{Set
6143 Default for Session} can be used to set the default identity to the
6144 current identity until you exit Emacs. The menu item @samp{Save as
6145 Default} sets the option @code{mh-identity-default} to the current
6146 identity setting. You can also customize the option
6147 @code{mh-identity-default} in the usual fashion. If you find that you
6148 need to add another identity, the menu item @samp{Customize
6149 Identities} is available for your convenience.
6150
6151 @cindex regular expressions, @code{mh-auto-fields-list}
6152 @vindex mh-auto-fields-list
6153
6154 The option @code{mh-auto-fields-list} can also be used to set the
6155 identity depending on the recipient to provide even more control. To
6156 customize @code{mh-auto-fields-list}, click on the @samp{INS} button
6157 and enter a regular expression for the recipient's address
6158 @ifnothtml
6159 (@pxref{Regexps, , Syntax of Regular Expressions, emacs, The
6160 GNU Emacs Manual}).
6161 @end ifnothtml
6162 @ifhtml
6163 (see the section
6164 @uref{http://www.gnu.org/software/emacs/manual/html_node/emacs/Regexps.html,
6165 Syntax of Regular Expressions} in
6166 @cite{The GNU Emacs Manual}).
6167 @end ifhtml
6168 Click on the @samp{INS} button with the @samp{Add at least one item
6169 below} label. The @samp{Value Menu} contains the following menu items:
6170
6171 @table @samp
6172 @item Identity
6173 Select an identity from those configured in @code{mh-identity-list}.
6174 All of the information for that identity will be added if the
6175 recipient matches.
6176 @c -------------------------
6177 @cindex @samp{Fcc} header field
6178 @cindex header field, @samp{Fcc}
6179 @item Fcc Field
6180 Insert an @samp{Fcc:} header field with the folder you provide. When
6181 you send the message, MH will put a copy of your message in this
6182 folder.
6183 @c -------------------------
6184 @cindex @samp{Mail-Followup-To} header field
6185 @cindex header field, @samp{Mail-Followup-To}
6186 @item Mail-Followup-To Field
6187 Insert an @samp{Mail-Followup-To:} header field with the recipients
6188 you provide. If the recipient's mail user agent supports this header
6189 field@footnote{@samp{Mail-Followup-To:} is supported by nmh.}, then
6190 their replies will go to the addresses listed. This is useful if their
6191 replies go both to the list and to you and you don't have a mechanism
6192 to suppress duplicates. If you reply to someone not on the list, you
6193 must either remove the @samp{Mail-Followup-To:} field, or ensure the
6194 recipient is also listed there so that he receives replies to your
6195 reply.
6196 @c -------------------------
6197 @item Other Field
6198 Other header fields may be added using this menu item.
6199 @end table
6200
6201 @findex mh-insert-auto-fields
6202 @kindex C-c M-d
6203 @vindex mh-auto-fields-prompt-flag
6204
6205 These fields can only be added after the recipient is known. Because
6206 you can continue to add recipients as you edit the draft, MH-E waits
6207 until the message is sent to perform the auto-insertions. This seems
6208 strange at first, but you'll get used to it. There are two ways to
6209 help you feel that the desired fields are added. The first is the
6210 action when the message is sent: if any fields are added
6211 automatically, you are given a chance to see and to confirm these
6212 fields before the message is actually sent. You can do away with this
6213 confirmation by turning off the option
6214 @code{mh-auto-fields-prompt-flag}. The second method is manual: once
6215 the header contains one or more recipients, you may run the command
6216 @kbd{C-c M-d} (@code{mh-insert-auto-fields}) or choose the
6217 @samp{Identity -> Insert Auto Fields} menu item to insert these fields
6218 manually. However, if you use this command, the automatic insertion
6219 when the message is sent is disabled.
6220
6221 @vindex mh-auto-fields-list
6222 @vindex mh-identity-list
6223
6224 You should avoid using the same header field in
6225 @code{mh-auto-fields-list} and @code{mh-identity-list} definitions
6226 that may apply to the same message as the result is undefined.
6227
6228 @vindex mh-identity-handlers
6229 @vindex mh-identity-list
6230
6231 The option @code{mh-identity-handlers} is used to change the way that
6232 fields, signatures, and attributions in @code{mh-identity-list} are
6233 added. To customize @code{mh-identity-handlers}, replace the name of
6234 an existing handler function associated with the field you want to
6235 change with the name of a function you have written. You can also
6236 click on an @samp{INS} button and insert a field of your choice and
6237 the name of the function you have written to handle it.
6238
6239 @vindex mh-identity-list
6240
6241 The @samp{Field} field can be any field that you've used in your
6242 @code{mh-identity-list}. The special fields @samp{:attribution-verb},
6243 @samp{:signature}, or @samp{:pgg-default-user-id} are used for the
6244 @code{mh-identity-list} choices @samp{Attribution Verb},
6245 @samp{Signature}, and @samp{GPG Key ID} respectively.
6246
6247 The handler associated with the @samp{:default} field is used when no
6248 other field matches.
6249
6250 The handler functions are passed two or three arguments: the field
6251 itself (for example, @samp{From}), or one of the special fields (for
6252 example, @samp{:signature}), and the action @samp{'remove} or
6253 @samp{'add}. If the action is @samp{'add}, an additional argument
6254 containing the value for the field is given.
6255
6256 @node Speedbar, Menu Bar, Identities, Top
6257 @chapter The Speedbar
6258
6259 @cindex folder navigation
6260 @cindex speedbar
6261 @findex mh-visit-folder
6262 @kindex F v
6263 @kindex M-x speedbar
6264 @kindex mouse-2
6265
6266 You can also use the speedbar
6267 @ifnothtml
6268 (@pxref{Speedbar, , Speedbar Frames, emacs, The GNU Emacs Manual},)
6269 @end ifnothtml
6270 @ifhtml
6271 (see the section
6272 @uref{http://www.gnu.org/software/emacs/manual/html_node/emacs/Speedbar.html,
6273 Speedbar Frames} in @cite{The GNU Emacs Manual})
6274 @end ifhtml
6275 to view your folders. To bring up the speedbar, run @kbd{M-x speedbar
6276 @key{RET}}. You will see a new frame appear with all of your MH
6277 folders. Folders with unseen messages appear in boldface. Click on a
6278 folder name with @kbd{mouse-2} to visit that folder in a similar
6279 fashion to the command @kbd{F v} (@code{mh-visit-folder})
6280 (@pxref{Folders}). Click on the @samp{+} icon to expand and view the
6281 sub-folders of that folder.
6282
6283 The speedbar can be manipulated with the keyboard as well. Use the
6284 Emacs navigational keys (like the arrow keys, or @kbd{C-n}) to move
6285 the cursor over the desired folder and then use the shortcuts for the
6286 menu items listed in the table below.
6287
6288 @table @samp
6289 @findex mh-speed-view
6290 @item Visit Folder (@key{RET})
6291 Visits the selected folder just as if you had used @kbd{F v}
6292 (@code{mh-speed-view}).
6293 @c -------------------------
6294 @findex mh-speed-expand-folder
6295 @item Expand Nested Folders (@kbd{+})
6296 Expands the selected folder in the speedbar, exposing the children
6297 folders inside it (@code{mh-speed-expand-folder}).
6298 @c -------------------------
6299 @findex mh-speed-contract-folder
6300 @item Contract Nested Folders (@kbd{-})
6301 Contracts or collapses the selected folder in the speedbar, hiding the
6302 children folders inside it (@code{mh-speed-contract-folder}).
6303 @c -------------------------
6304 @findex mh-speed-refresh
6305 @item Refresh Speedbar (@kbd{r})
6306 Regenerates the list of folders in the speedbar. Run this command if
6307 you've added or deleted a folder, or want to update the unseen message
6308 count before the next automatic update (@code{mh-speed-refresh}).
6309 @end table
6310
6311 @findex delete-frame
6312 @kindex C-x 5 0
6313 @kindex mouse-3
6314
6315 You can click on @kbd{mouse-3} to bring up a context menu that
6316 contains these items. Dismiss the speedbar with @kbd{C-x 5 0}
6317 (@code{delete-frame}).
6318
6319 @cindex @command{flists}
6320 @cindex MH commands, @command{flists}
6321 @cindex @samp{mh-speedbar} customization group
6322 @cindex customization group, @samp{mh-speedbar}
6323
6324 The MH-E speedbar uses the MH command @command{flists}@footnote{See
6325 the section @uref{@value{MH-BOOK-HOME}/morseq.html#flist, Searching for
6326 Sequences with flist} in the MH book.} to generate the list of
6327 folders. The @samp{mh-speedbar} customization group contains the
6328 following option which controls how often the speedbar calls
6329 @command{flists}.
6330
6331 @vtable @code
6332 @item mh-speed-update-interval
6333 Time between speedbar updates in seconds (default: 60). Set to 0 to
6334 disable automatic update.
6335 @end vtable
6336
6337 You can modify the appearance of the folders in the speedbar by
6338 customizing the following faces.
6339
6340 @vtable @code
6341 @item mh-speedbar-folder
6342 Basic folder face.
6343 @c -------------------------
6344 @item mh-speedbar-folder-with-unseen-messages
6345 Folder face when folder contains unread messages.
6346 @c -------------------------
6347 @item mh-speedbar-selected-folder
6348 Selected folder face.
6349 @c -------------------------
6350 @item mh-speedbar-selected-folder-with-unseen-messages
6351 Selected folder face when folder contains unread messages.
6352 @end vtable
6353
6354 @node Menu Bar, Tool Bar, Speedbar, Top
6355 @chapter The Menu Bar
6356
6357 @cindex @samp{Folder} menu
6358 @cindex @samp{Identity} menu
6359 @cindex @samp{Letter} menu
6360 @cindex @samp{Message} menu
6361 @cindex @samp{Search} menu
6362 @cindex @samp{Sequence} menu
6363 @cindex Folder menu
6364 @cindex Identity menu
6365 @cindex Letter menu
6366 @cindex MH-Folder mode
6367 @cindex MH-Letter mode
6368 @cindex MH-Search mode
6369 @cindex Message menu
6370 @cindex Search menu
6371 @cindex Sequence menu
6372 @cindex menu bar
6373 @cindex menu, Folder
6374 @cindex menu, Identity
6375 @cindex menu, Letter
6376 @cindex menu, Message
6377 @cindex menu, Search
6378 @cindex menu, Sequence
6379 @cindex menu, @samp{Folder}
6380 @cindex menu, @samp{Identity}
6381 @cindex menu, @samp{Letter}
6382 @cindex menu, @samp{Message}
6383 @cindex menu, @samp{Search}
6384 @cindex menu, @samp{Sequence}
6385 @cindex modes, MH-Folder
6386 @cindex modes, MH-Letter
6387 @cindex modes, MH-Search
6388
6389 For those of you who prefer to mouse and menu instead of using the
6390 meta-coke-bottle-bucky keys, MH-E provides menu items for most of its
6391 functions. The MH-Folder buffer adds the @samp{Folder},
6392 @samp{Message}, and @samp{Sequence} menus. The MH-Letter buffer adds
6393 the @samp{Identity} and @samp{Letter} menus. The MH-Search buffer adds
6394 the @samp{Search} menu. There's no need to list the actual items here,
6395 as you can more easily see them for yourself, and the functions are
6396 already described elsewhere in this manual.
6397
6398 For a description of the menu bar, please
6399 @ifnothtml
6400 @xref{Menu Bar, , The Menu Bar, emacs, The GNU Emacs Manual}.
6401 @end ifnothtml
6402 @ifhtml
6403 see the section
6404 @uref{http://www.gnu.org/software/emacs/manual/html_node/emacs/Menu-Bar.html,
6405 The Menu Bar} in @cite{The GNU Emacs Manual}.
6406 @end ifhtml
6407
6408 The Emacs manual describes how to get help for a particular
6409 menu item. You can also look up a menu item in the index of this
6410 manual in two ways: all of the menu items are listed alphabetically,
6411 and you can also browse all of the items under the index entry
6412 @samp{menu item}.
6413
6414 @node Tool Bar, Searching, Menu Bar, Top
6415 @chapter The Tool Bar
6416
6417 @cindex tool bar
6418
6419 Emacs also provides a graphical tool bar. For a description of the
6420 tool bar, please
6421 @ifnothtml
6422 @xref{Tool Bars, , Tool Bars, emacs, The GNU Emacs Manual}.
6423 @end ifnothtml
6424 @ifhtml
6425 see the section
6426 @uref{http://www.gnu.org/software/emacs/manual/html_node/emacs/Tool-Bars.html,
6427 Tool Bars} in @cite{The GNU Emacs Manual}.
6428 @end ifhtml
6429
6430 @cindex @samp{mh-tool-bar} customization group
6431 @cindex customization group, @samp{mh-tool-bar}
6432
6433 MH-E adds several icons to this tool bar; you can modify the MH-E
6434 aspects of the tool bar via the @samp{mh-tool-bar} customization group.
6435
6436 @vtable @code
6437 @item mh-tool-bar-folder-buttons
6438 List of buttons to include in MH-Folder tool bar (default: a checklist
6439 too long to list here).
6440 @c -------------------------
6441 @item mh-tool-bar-letter-buttons
6442 List of buttons to include in MH-Letter tool bar (default: a checklist
6443 too long to list here).
6444 @c -------------------------
6445 @item mh-tool-bar-search-function
6446 Function called by the tool bar search button (default:
6447 @code{mh-search}).
6448 @c -------------------------
6449 @item mh-xemacs-tool-bar-position
6450 Tool bar location (default: @samp{Same As Default Tool Bar}).
6451 @c -------------------------
6452 @item mh-xemacs-use-tool-bar-flag
6453 If @samp{on}, use tool bar (default: @samp{on}, if supported).
6454 @end vtable
6455
6456 In GNU Emacs, icons for some of MH-E's functions are added to the tool
6457 bar. In XEmacs, you have the opportunity to create a separate tool bar for
6458 the MH-E icons.
6459
6460 @vindex mh-tool-bar-folder-buttons
6461 @vindex mh-tool-bar-letter-buttons
6462
6463 In either case, you can select which of these functions you'd like to
6464 see by customizing the options @code{mh-tool-bar-folder-buttons} and
6465 @code{mh-tool-bar-letter-buttons}. As you probably guessed, the former
6466 customizes the tool bar in MH-Folder mode and the latter in MH-Letter
6467 mode. Both of these options present you with a list of functions;
6468 check the functions whose icons you want to see and clear the check
6469 boxes for those you don't.
6470
6471 @findex mh-search
6472 @vindex mh-tool-bar-search-function
6473
6474 The function associated with the searching icon can be set via the
6475 option @code{mh-tool-bar-search-function}. By default, this is set to
6476 @code{mh-search}. @xref{Searching}. You can also choose @samp{Other
6477 Function} from the @samp{Value Menu} and enter a function of your own
6478 choosing.
6479
6480 @vindex mh-xemacs-use-tool-bar-flag
6481
6482 XEmacs provides a couple of extra options. The first,
6483 @code{mh-xemacs-use-tool-bar-flag}, controls whether to show the MH-E
6484 icons at all. By default, this option is turned on if the window
6485 system supports tool bars. If your system doesn't support tool bars,
6486 then you won't be able to turn on this option.
6487
6488 @vindex mh-xemacs-tool-bar-position
6489
6490 The second extra option is @code{mh-xemacs-tool-bar-position} which
6491 controls the placement of the tool bar along the four edges of the
6492 frame. You can choose from one of @samp{Same As Default Tool Bar},
6493 @samp{Top}, @samp{Bottom}, @samp{Left}, or @samp{Right}. If this
6494 variable is set to anything other than @samp{Same As Default Tool Bar}
6495 and the default tool bar is in a different location, then two tool
6496 bars will be displayed: the MH-E tool bar and the default tool bar.
6497
6498 @node Searching, Threading, Tool Bar, Top
6499 @chapter Searching Through Messages
6500
6501 @cindex @samp{Search} menu
6502 @cindex menu, @samp{Search}
6503 @cindex searching
6504 @findex mh-search
6505 @kindex F s
6506
6507 Earlier, the command @kbd{F s} (@code{mh-search}) was introduced which
6508 helps you find messages that lie buried in your folders
6509 (@pxref{Folders}). This chapter covers this command in more detail.
6510 Several commands are used to compose the search criteria and to start
6511 searching. A couple of them can be found in the @samp{Search} menu.
6512
6513 @table @kbd
6514 @kindex C-c ?
6515 @findex mh-help
6516 @item C-c ?
6517 Display cheat sheet for the MH-E commands (@code{mh-help}).
6518 @c -------------------------
6519 @cindex @samp{Search > Perform Search} menu item
6520 @cindex menu item, @samp{Search > Perform Search}
6521 @kindex C-c C-c
6522 @findex mh-index-do-search
6523 @item C-c C-c
6524 Find messages using @code{mh-search-program}
6525 (@code{mh-index-do-search}).
6526 @c -------------------------
6527 @cindex @samp{Search > Search with pick} menu item
6528 @cindex menu item, @samp{Search > Search with pick}
6529 @kindex C-c C-p
6530 @findex mh-pick-do-search
6531 @item C-c C-p
6532 Find messages using @command{pick} (@code{mh-pick-do-search}).
6533 @c -------------------------
6534 @kindex C-c ?
6535 @findex mh-help
6536 @item C-c ?
6537 Display cheat sheet for the MH-E commands (@code{mh-help}).
6538 @c -------------------------
6539 @kindex C-c C-f C-a
6540 @kindex C-c C-f a
6541 @findex mh-to-field
6542 @item C-c C-f a
6543 @itemx C-c C-f C-a
6544 Move to @samp{Mail-Reply-To:} header field (@code{mh-to-field}).
6545 @c -------------------------
6546 @kindex C-c C-f C-b
6547 @kindex C-c C-f b
6548 @item C-c C-f b
6549 @itemx C-c C-f C-b
6550 Move to @samp{Bcc:} header field (@code{mh-to-field}).
6551 @c -------------------------
6552 @kindex C-c C-f C-c
6553 @kindex C-c C-f c
6554 @item C-c C-f c
6555 @itemx C-c C-f C-c
6556 Move to @samp{Cc:} header field (@code{mh-to-field}).
6557 @c -------------------------
6558 @kindex C-c C-f C-d
6559 @kindex C-c C-f d
6560 @item C-c C-f d
6561 @itemx C-c C-f C-d
6562 Move to @samp{Dcc:} header field (@code{mh-to-field}).
6563 @c -------------------------
6564 @kindex C-c C-f C-f
6565 @kindex C-c C-f f
6566 @item C-c C-f f
6567 @itemx C-c C-f C-f
6568 Move to @samp{Fcc:} header field (@code{mh-to-field}).
6569 @c -------------------------
6570 @kindex C-c C-f C-l
6571 @kindex C-c C-f l
6572 @item C-c C-f l
6573 @itemx C-c C-f C-l
6574 Move to @samp{Mail-Followup-To:} header field (@code{mh-to-field}).
6575 @c -------------------------
6576 @kindex C-c C-f C-m
6577 @kindex C-c C-f m
6578 @item C-c C-f m
6579 @itemx C-c C-f C-m
6580 Move to @samp{From:} header field (@code{mh-to-field}).
6581 @c -------------------------
6582 @kindex C-c C-f C-r
6583 @kindex C-c C-f r
6584 @item C-c C-f r
6585 @itemx C-c C-f C-r
6586 Move to @samp{Reply-To:} header field (@code{mh-to-field}).
6587 @c -------------------------
6588 @kindex C-c C-f C-s
6589 @kindex C-c C-f s
6590 @item C-c C-f s
6591 @itemx C-c C-f C-s
6592 Move to @samp{Subject:} header field (@code{mh-to-field}).
6593 @c -------------------------
6594 @kindex C-c C-f C-t
6595 @kindex C-c C-f t
6596 @item C-c C-f t
6597 @itemx C-c C-f C-t
6598 Move to @samp{To:} header field (@code{mh-to-field}).
6599 @end table
6600
6601 Another few commands are available in the MH-Folder buffer resulting
6602 from a search.
6603
6604 @table @kbd
6605 @kindex @key{TAB}
6606 @findex mh-index-next-folder
6607 @item @key{TAB}
6608 Jump to the next folder marker (@code{mh-index-next-folder}).
6609 @c -------------------------
6610 @kindex S-@key{TAB}
6611 @findex mh-index-previous-folder
6612 @item S-@key{TAB}
6613 Jump to the previous folder marker (@code{mh-index-previous-folder}).
6614 @c -------------------------
6615 @kindex v
6616 @findex mh-index-visit-folder
6617 @item v
6618 Visit original folder from where the message at point was found
6619 (@code{mh-index-visit-folder}).
6620 @end table
6621
6622 @cindex @samp{mh-search} customization group
6623 @cindex customization group, @samp{mh-search}
6624
6625 There is one option from the @samp{mh-search} customization group used
6626 in searching.
6627
6628 @vtable @code
6629 @item mh-search-program
6630 Search program that MH-E shall use (default: @samp{Auto-detect}).
6631 @end vtable
6632
6633 The following hook is available.
6634
6635 @vtable @code
6636 @item mh-search-mode-hook
6637 Hook run upon entry to @code{mh-search-mode} (default: @code{nil}).
6638 @end vtable
6639
6640 The following face is available.
6641
6642 @vtable @code
6643 @item mh-search-folder
6644 Folder heading face in MH-Folder buffers created by searches.
6645 @end vtable
6646
6647 @findex mh-search-folder
6648 @kindex F s
6649
6650 The command @kbd{F s} (@code{mh-search-folder}) helps you find
6651 messages in your entire corpus of mail. You can search for messages to
6652 or from a particular person or about a particular subject. In fact,
6653 you can also search for messages containing selected strings in any
6654 arbitrary header field or any string found within the messages.
6655
6656 @cindex @command{pick}
6657 @cindex MH commands, @command{pick}
6658
6659 Out of the box, MH-E uses @command{pick} to find messages. With a
6660 little extra effort, you can set an indexing program which rewards you
6661 with extremely quick results. The drawback is that sometimes the index
6662 does not contain the words you're looking for. You can still use
6663 @command{pick} in these situations.
6664
6665 You are prompted for the folder to search. This can be @samp{all} to
6666 search all folders. Note that the search works recursively on the
6667 listed folder.
6668
6669 @cindex MH-Search mode
6670 @cindex modes, MH-Search
6671
6672 Next, an MH-Search buffer appears where you can enter search criteria.
6673
6674 @cartouche
6675 @smallexample
6676 From:
6677 To:
6678 Cc:
6679 Date:
6680 Subject:
6681 --------
6682 #
6683
6684
6685
6686
6687
6688
6689
6690
6691 --:** search-pattern All L7 (MH-Search)---------------------------
6692 Type C-c C-c to search messages, C-c C-p to use pick, C-c ? for help
6693 @end smallexample
6694 @end cartouche
6695 @i{Search window}
6696
6697 @cindex @command{pick}
6698 @cindex MH commands, @command{pick}
6699
6700 Edit this template by entering your search criteria in an appropriate
6701 header field that is already there, or create a new field yourself. If
6702 the string you're looking for could be anywhere in a message, then
6703 place the string underneath the row of dashes.
6704
6705 As an example, let's say that we want to find messages from Ginnean
6706 about horseback riding in the Kosciusko National Park (Australia)
6707 during January, 1994. Normally we would start with a broad search and
6708 narrow it down if necessary to produce a manageable amount of data,
6709 but we'll cut to the chase and create a fairly restrictive set of
6710 criteria as follows:
6711
6712 @smallexample
6713 @group
6714 From: ginnean
6715 To:
6716 Cc:
6717 Date: Jan 1994
6718 Subject:
6719 --------
6720 horse
6721 kosciusko
6722 @end group
6723 @end smallexample
6724
6725 @findex mh-to-field
6726 @kindex C-c C-f C-t
6727
6728 As with MH-Letter mode, MH-Search provides commands like @kbd{C-c C-f
6729 C-t} (@code{mh-to-field}) to help you fill in the blanks.
6730 @xref{Editing Message}.
6731
6732 @kindex F s
6733 @vindex mh-search-mode-hook
6734
6735 If you find that you do the same thing over and over when editing the
6736 search template, you may wish to bind some shortcuts to keys. This can
6737 be done with the variable @code{mh-search-mode-hook}, which is called
6738 when @kbd{F s} is run on a new pattern.
6739
6740 @findex mh-index-do-search
6741 @findex mh-pick-do-search
6742 @kindex C-c C-c
6743 @kindex C-c C-p
6744
6745 To perform the search, type @kbd{C-c C-c} (@code{mh-index-do-search}).
6746 Sometimes you're searching for text that is either not indexed, or
6747 hasn't been indexed yet. In this case you can override the default
6748 method with the pick method by running the command @kbd{C-c C-p}
6749 (@code{mh-pick-do-search}).
6750
6751 @cindex folders, @samp{+mhe-index}
6752 @cindex @samp{+mhe-index}
6753 @findex mh-index-next-folder
6754 @findex mh-index-previous-folder
6755 @kindex @key{TAB}
6756 @kindex S-@key{TAB}
6757 @vindex mh-search-folder
6758
6759 The messages that are found are put in a temporary sub-folder of
6760 @samp{+mhe-index} and are displayed in an MH-Folder buffer. This
6761 buffer is special because it displays messages from multiple folders;
6762 each set of messages from a given folder has a heading with the folder
6763 name. The appearance of the heading can be modified by customizing the
6764 face @code{mh-search-folder}. You can jump back and forth between the
6765 headings using the commands @kbd{@key{TAB}}
6766 (@code{mh-index-next-folder}) and @kbd{S-@key{TAB}}
6767 (@code{mh-index-previous-folder}).
6768
6769 @findex mh-index-visit-folder
6770 @findex mh-rescan-folder
6771 @kindex F r
6772 @kindex v
6773
6774 In addition, the command @kbd{v} (@code{mh-index-visit-folder}) can be
6775 used to visit the folder of the message at point. Initially, only the
6776 messages that matched the search criteria are displayed in the folder.
6777 While the temporary buffer has its own set of message numbers, the
6778 actual messages numbers are shown in the visited folder. Thus, the
6779 command @kbd{v} is useful to find the actual message number of an
6780 interesting message, or to view surrounding messages with the command
6781 @kbd{F r} @code{mh-rescan-folder}. @xref{Folders}.
6782
6783 @findex mh-kill-folder
6784 @kindex F k
6785
6786 Because this folder is temporary, you'll probably get in the habit of
6787 killing it when you're done with @kbd{F k} (@code{mh-kill-folder}).
6788 @xref{Folders}.
6789
6790 @kindex F s
6791
6792 You can regenerate the results by running @kbd{F s} with a prefix
6793 argument.
6794
6795 @cindex @command{procmail}
6796 @cindex Unix commands, @command{procmail}
6797 @cindex @samp{X-MHE-Checksum} header field
6798 @cindex header field, @samp{X-MHE-Checksum}
6799
6800 Note: This command uses an @samp{X-MHE-Checksum:} header field to
6801 cache the MD5 checksum of a message. This means that if an incoming
6802 message already contains an @samp{X-MHE-Checksum:} field, that message
6803 might not be found by this command. The following @command{procmail}
6804 recipe avoids this problem by renaming the existing header field:
6805
6806 @smallexample
6807 @group
6808 :0 wf
6809 | formail -R "X-MHE-Checksum" "X-Old-MHE-Checksum"
6810 @end group
6811 @end smallexample
6812
6813 @xref{Limits}, for an alternative interface to searching.
6814
6815 @section Configuring Indexed Searches
6816
6817 @cindex @command{grep}
6818 @cindex @command{mairix}
6819 @cindex @command{namazu}
6820 @cindex @command{pick}
6821 @cindex @command{swish++}
6822 @cindex @command{swish-e}
6823 @cindex Unix commands, @command{grep}
6824 @cindex Unix commands, @command{mairix}
6825 @cindex Unix commands, @command{namazu}
6826 @cindex Unix commands, @command{pick}
6827 @cindex Unix commands, @command{swish++}
6828 @cindex Unix commands, @command{swish-e}
6829 @findex mh-search
6830 @kindex F s
6831 @vindex mh-search-program
6832
6833 The command @kbd{F s} (@code{mh-search}) runs the command defined by
6834 the option @code{mh-search-program}. The default value is
6835 @samp{Auto-detect} which means that MH-E will automatically choose one
6836 of @command{swish++}, @command{swish-e}, @command{mairix},
6837 @command{namazu}, @command{pick} and @command{grep} in that order. If,
6838 for example, you have both @command{swish++} and @command{mairix}
6839 installed and you want to use @command{mairix}, then you can set this
6840 option to @samp{mairix}.
6841
6842 The following sub-sections describe how to set up the various indexing
6843 programs to use with MH-E.
6844
6845 @subsection swish++
6846
6847 @cindex @command{swish++}
6848 @cindex Unix commands, @command{swish++}
6849
6850 In the examples below, replace @file{/home/user/Mail} with the path to
6851 your MH directory.
6852
6853 First create the directory @file{/home/user/Mail/.swish++}. Then
6854 create the file @file{/home/user/Mail/.swish++/swish++.conf} with the
6855 following contents:
6856
6857 @smallexample
6858 @group
6859 IncludeMeta Bcc Cc Comments Content-Description From Keywords
6860 IncludeMeta Newsgroups Resent-To Subject To
6861 IncludeMeta Message-Id References In-Reply-To
6862 IncludeFile Mail *
6863 IndexFile /home/user/Mail/.swish++/swish++.index
6864 @end group
6865 @end smallexample
6866
6867 Use the following command line to generate the swish index. Run this
6868 daily from cron:
6869
6870 @smallexample
6871 @group
6872 find /home/user/Mail -path /home/user/Mail/mhe-index -prune \
6873 -o -path /home/user/Mail/.swish++ -prune \
6874 -o -name "[0-9]*" -print \
6875 | index -c /home/user/Mail/.swish++/swish++.conf -
6876 @end group
6877 @end smallexample
6878
6879 This command does not index the folders that hold the results of your
6880 searches in @samp{+mhe-index} since they tend to be ephemeral and the
6881 original messages are indexed anyway.
6882
6883 @cindex @command{index}
6884 @cindex Unix commands, @command{index}
6885 @cindex @command{index++}
6886 @cindex Unix commands, @command{index++}
6887
6888 On some systems (Debian GNU/Linux, for example), use @command{index++}
6889 instead of @command{index}.
6890
6891 @subsection swish
6892
6893 @cindex @command{swish-e}
6894 @cindex Unix commands, @command{swish-e}
6895
6896 In the examples below, replace @file{/home/user/Mail} with the path to
6897 your MH directory.
6898
6899 First create the directory @file{/home/user/Mail/.swish}. Then create
6900 the file @file{/home/user/Mail/.swish/config} with the following
6901 contents:
6902
6903 @smallexample
6904 @group
6905 DefaultContents TXT*
6906 IndexDir /home/user/Mail
6907 IndexFile /home/user/Mail/.swish/index
6908 IndexName "Mail Index"
6909 IndexDescription "Mail Index"
6910 IndexPointer "http://nowhere"
6911 IndexAdmin "nobody"
6912 #MetaNames automatic
6913 IndexReport 3
6914 FollowSymLinks no
6915 UseStemming no
6916 IgnoreTotalWordCountWhenRanking yes
6917 WordCharacters abcdefghijklmnopqrstuvwxyz0123456789-
6918 BeginCharacters abcdefghijklmnopqrstuvwxyz
6919 EndCharacters abcdefghijklmnopqrstuvwxyz0123456789
6920 IgnoreLimit 50 1000
6921 IndexComments 0
6922 FileRules filename contains \D
6923 FileRules pathname contains /home/user/Mail/.swish
6924 FileRules pathname contains /home/user/Mail/mhe-index
6925 FileRules filename is index
6926 @end group
6927 @end smallexample
6928
6929 This configuration does not index the folders that hold the results of
6930 your searches in @samp{+mhe-index} since they tend to be ephemeral and
6931 the original messages are indexed anyway.
6932
6933 If there are any directories you would like to ignore, append lines
6934 like the following to @file{config}:
6935
6936 @smallexample
6937 FileRules pathname contains /home/user/Mail/scripts
6938 @end smallexample
6939
6940 @cindex @command{swish-e}
6941 @cindex Unix commands, @command{swish-e}
6942
6943 Use the following command line to generate the swish index. Run this
6944 daily from cron:
6945
6946 @smallexample
6947 swish-e -c /home/user/Mail/.swish/config
6948 @end smallexample
6949
6950 @subsection mairix
6951
6952 @cindex @command{mairix}
6953 @cindex Unix commands, @command{mairix}
6954
6955 In the examples below, replace @file{~/Mail} with the path to your MH
6956 directory.
6957
6958 First create the directory @file{~/Mail/.mairix}. Then create the file
6959 @file{~/Mail/.mairix/config} with the following contents:
6960
6961 @smallexample
6962 @group
6963 base=~/Mail
6964
6965 # List of folders that should be indexed. 3 dots at the end means there
6966 # are subfolders within the folder
6967 mh=archive...:inbox:drafts:news:sent:trash
6968
6969 mformat=mh
6970 database=~/Mail/.mairix/database
6971 @end group
6972 @end smallexample
6973
6974 Use the following command line to generate the mairix index. Run this daily
6975 from cron:
6976
6977 @smallexample
6978 mairix -f ~/Mail/.mairix/config
6979 @end smallexample
6980
6981 @subsection namazu
6982
6983 @cindex @command{namazu}
6984 @cindex Unix commands, @command{namazu}
6985
6986 In the examples below, replace @file{/home/user/Mail} with the path to
6987 your MH directory.
6988
6989 First create the directory @file{/home/user/Mail/.namazu}. Then create
6990 the file @file{/home/user/Mail/.namazu/mknmzrc} with the following
6991 contents:
6992
6993 @smallexample
6994 @group
6995 package conf; # Don't remove this line!
6996 $ADDRESS = 'user@@localhost';
6997 $ALLOW_FILE = "[0-9]*";
6998 $EXCLUDE_PATH = "^/home/user/Mail/(mhe-index|spam)";
6999 @end group
7000 @end smallexample
7001
7002 This configuration does not index the folders that hold the results of
7003 your searches in @samp{+mhe-index} since they tend to be ephemeral and
7004 the original messages are indexed anyway.
7005
7006 Use the following command line to generate the namazu index. Run this
7007 daily from cron:
7008
7009 @smallexample
7010 mknmz -f /home/user/Mail/.namazu/mknmzrc -O /home/user/Mail/.namazu \
7011 -q /home/user/Mail
7012 @end smallexample
7013
7014 @subsection pick
7015
7016 @cindex @command{pick}
7017 @cindex MH commands, @command{pick}
7018
7019 This search method does not require any setup.
7020
7021 Read @command{pick}(1) or the section
7022 @uref{@value{MH-BOOK-HOME}/finpic.html, Finding Messages with pick} in
7023 the MH book to find out more about how to enter the criteria.
7024
7025 @subsection grep
7026
7027 @cindex @command{grep}
7028 @cindex Unix commands, @command{grep}
7029
7030 This search method does not require any setup.
7031
7032 Unlike the other search methods, this method does not use the
7033 MH-Search buffer. Instead, you simply enter a regular expression in
7034 the minibuffer. For help in constructing regular expressions, see your
7035 man page for @command{grep}.
7036
7037 @node Threading, Limits, Searching, Top
7038 @chapter Viewing Message Threads
7039
7040 @cindex threading
7041
7042 MH-E groups messages by @dfn{threads} which are messages that are part
7043 of the same discussion and usually all have the same @samp{Subject:}
7044 header field. Other ways to organize messages in a folder include
7045 limiting (@pxref{Limits}) or using full-text indexed searches
7046 (@pxref{Searching}).
7047
7048 @cindex root, in threads
7049 @cindex siblings, in threads
7050 @cindex ancestor, in threads
7051
7052 A thread begins with a single message called a @dfn{root}. All replies
7053 to the same message are @dfn{siblings} of each other. Any message that
7054 has replies to it is an @dfn{ancestor} of those replies.
7055
7056 There are several commands that you can use to navigate and operate on
7057 threads.
7058
7059 @table @kbd
7060 @kindex T ?
7061 @findex mh-prefix-help
7062 @item T ?
7063 Display cheat sheet for the commands of the current prefix in
7064 minibuffer (@code{mh-prefix-help}).
7065 @c -------------------------
7066 @kindex T o
7067 @findex mh-thread-refile
7068 @item T o
7069 Refile (output) thread into folder (@code{mh-thread-refile}).
7070 @c -------------------------
7071 @kindex T d
7072 @findex mh-thread-delete
7073 @item T d
7074 Delete thread (@code{mh-thread-delete}).
7075 @c -------------------------
7076 @kindex T t
7077 @findex mh-toggle-threads
7078 @item T t
7079 Toggle threaded view of folder (@code{mh-toggle-threads}).
7080 @c -------------------------
7081 @kindex T n
7082 @findex mh-thread-next-sibling
7083 @item T n
7084 Display next sibling (@code{mh-thread-next-sibling}).
7085 @c -------------------------
7086 @kindex T p
7087 @findex mh-thread-previous-sibling
7088 @item T p
7089 Display previous sibling (@code{mh-thread-previous-sibling}).
7090 @c -------------------------
7091 @kindex T u
7092 @findex mh-thread-ancestor
7093 @item T u
7094 Display ancestor of current message (@code{mh-thread-ancestor}).
7095 @end table
7096
7097 @cindex @samp{mh-thread} customization group
7098 @cindex customization group, @samp{mh-thread}
7099
7100 The @samp{mh-thread} customization group contains one option.
7101
7102 @vtable @code
7103 @item mh-show-threads-flag
7104 On means new folders start in threaded mode (default: @samp{off}).
7105 @end vtable
7106
7107 @findex mh-toggle-threads
7108 @kindex T t
7109 @vindex mh-large-folder
7110 @vindex mh-show-threads-flag
7111
7112 Threading large number of messages can be time consuming so the option
7113 @code{mh-show-threads-flag} is turned off by default. If you turn on
7114 this option, then threading will be done only if the number of
7115 messages being threaded is less than @code{mh-large-folder}. In any
7116 event, threading can be turned on (and off) with the command @kbd{T t}
7117 (@code{mh-toggle-threads}).
7118
7119 @findex mh-thread-ancestor
7120 @findex mh-thread-next-sibling
7121 @findex mh-thread-previous-sibling
7122 @kindex T n
7123 @kindex T p
7124 @kindex T u
7125
7126 There are a few commands to help you navigate threads. If you do not
7127 care for the way a particular thread has turned, you can move up the
7128 chain of messages with the command @kbd{T u}
7129 (@code{mh-thread-ancestor}. At any point you can use @kbd{T n}
7130 (@code{mh-thread-next-sibling} or @kbd{T p}
7131 (@code{mh-thread-previous-sibling}) to jump to the next or previous
7132 sibling, skipping the sub-threads. The command @kbd{T u} can also take
7133 a prefix argument to jump to the message that started everything.
7134
7135 @findex mh-delete-subject-or-thread
7136 @findex mh-thread-delete
7137 @findex mh-thread-refile
7138 @kindex k
7139 @kindex T d
7140 @kindex T o
7141
7142 There are threaded equivalents for the commands that delete and refile
7143 messages. For example, @kbd{T o} (@code{mh-thread-refile}) refiles the
7144 current message and all its children. Similarly, the command @kbd{T d}
7145 (@code{mh-thread-delete}) deletes the current message and all its
7146 children. These commands do not refile or delete sibling messages.
7147 @xref{Navigating}, for a description of the similar command @kbd{k}
7148 (@code{mh-delete-subject-or-thread}).
7149
7150 @vindex mh-large-folder
7151
7152 If you find that threading is too slow, it may be that you have
7153 @code{mh-large-folder} set too high. Also, threading is one of the few
7154 features of MH-E that really benefits from compiling. If you haven't
7155 compiled MH-E, I encourage you to do so@footnote{If you're not sure if
7156 MH-E has been byte-compiled, you could try running @samp{locate
7157 mh-thread.elc} or otherwise find MH-E on your system and ensure that
7158 @file{mh-thread.elc} exists. If you have multiple versions and you
7159 find that one is compiled but the other is not, then go into your
7160 @file{*scratch*} buffer in Emacs, enter @kbd{load-path C-j}, and
7161 ensure that the byte-compiled version appears first in the
7162 @code{load-path}. If you find that MH-E is not compiled and you
7163 installed MH-E yourself, please refer to the installation directions
7164 in the file @file{README} in the distribution.}.
7165
7166 @node Limits, Sequences, Threading, Top
7167 @chapter Limiting Display
7168
7169 @cindex limits
7170 @cindex filters
7171
7172 Another way to organize messages in a folder besides threading
7173 (@pxref{Threading}) or using full-text indexed searches
7174 (@pxref{Searching}) is by limiting the folder display to messages that
7175 are similar to the current message.
7176
7177 @table @kbd
7178 @kindex / ?
7179 @findex mh-prefix-help
7180 @item / ?
7181 Display cheat sheet for the commands of the current prefix in
7182 minibuffer (@code{mh-prefix-help}).
7183 @c -------------------------
7184 @cindex @samp{Sequence > Narrow to Tick Sequence} menu item
7185 @cindex menu item, @samp{Sequence > Narrow to Tick Sequence}
7186 @kindex / '
7187 @findex mh-narrow-to-tick
7188 @item / '
7189 Limit to messages in the @samp{tick} sequence
7190 (@code{mh-narrow-to-tick}).
7191 @c -------------------------
7192 @kindex / c
7193 @findex mh-narrow-to-cc
7194 @item / c
7195 Limit to messages with the same @samp{Cc:} field
7196 (@code{mh-narrow-to-cc}).
7197 @c -------------------------
7198 @kindex / m
7199 @findex mh-narrow-to-from
7200 @item / m
7201 Limit to messages with the same @samp{From:} field
7202 (@code{mh-narrow-to-from}).
7203 @c -------------------------
7204 @kindex / g
7205 @findex mh-narrow-to-range
7206 @item / g
7207 Limit to range (@code{mh-narrow-to-range}).
7208 @c -------------------------
7209 @cindex @samp{Sequence > Narrow to Subject Sequence} menu item
7210 @cindex menu item, @samp{Sequence > Narrow to Subject Sequence}
7211 @kindex / s
7212 @findex mh-narrow-to-subject
7213 @item / s
7214 Limit to messages with the same @samp{Subject:} field
7215 (@code{mh-narrow-to-subject}).
7216 @c -------------------------
7217 @kindex / t
7218 @findex mh-narrow-to-to
7219 @item / t
7220 Limit to messages with the same @samp{To:} field
7221 (@code{mh-narrow-to-to}).
7222 @c -------------------------
7223 @cindex @samp{Sequence > Widen from Sequence} menu item
7224 @cindex menu item, @samp{Sequence > Widen from Sequence}
7225 @kindex / w
7226 @findex mh-widen
7227 @item / w
7228 Remove last restriction (@code{mh-widen}).
7229 @end table
7230
7231 All of the limiting commands above refine the display in some way.
7232
7233 @cindex @command{pick}
7234 @cindex MH commands, @command{pick}
7235 @findex mh-narrow-to-cc
7236 @findex mh-narrow-to-from
7237 @findex mh-narrow-to-subject
7238 @findex mh-narrow-to-to
7239 @kindex / c
7240 @kindex / m
7241 @kindex / s
7242 @kindex / t
7243
7244 The commands @kbd{/ c} (@code{mh-narrow-to-cc}), @kbd{/ m}
7245 (@code{mh-narrow-to-from}), @kbd{/ s} (@code{mh-narrow-to-subject}),
7246 and @kbd{/ t} (@code{mh-narrow-to-to}) restrict the display to
7247 messages matching the content of the respective field in the current
7248 message. However, you can give any of these a prefix argument to edit
7249 the @command{pick} expression used to narrow the view@footnote{See
7250 @command{pick}(1) or the section
7251 @uref{@value{MH-BOOK-HOME}/finpic.html, Finding Messages with pick} in
7252 the MH book.}.
7253
7254 @cindex @samp{tick} sequence
7255 @cindex sequence, @samp{tick}
7256 @cindex ticked messages, viewing
7257 @findex mh-narrow-to-range
7258 @findex mh-narrow-to-tick
7259 @kindex / '
7260 @kindex / g
7261
7262 You can also limit the display to messages in the @samp{tick} sequence
7263 with the command @kbd{/ '} (@code{mh-narrow-to-tick}).
7264 @xref{Sequences}, for information on putting message into the
7265 @samp{tick} sequence. Use the @kbd{/ g} (@code{mh-narrow-to-range})
7266 command to limit the display to messages in a range (@pxref{Ranges}).
7267
7268 @findex mh-widen
7269 @kindex / w
7270
7271 Each limit can be undone in turn with the @kbd{/ w} (@code{mh-widen})
7272 command. Give this command a prefix argument to remove all limits.
7273
7274 @node Sequences, Junk, Limits, Top
7275 @chapter Using Sequences
7276
7277 @cindex @samp{Sequence} menu
7278 @cindex menu, @samp{Sequence}
7279 @cindex sequences
7280
7281 For the whole scoop on MH sequences, refer to
7282 @samp{mh-sequence}(5)@footnote{See the section
7283 @uref{@value{MH-BOOK-HOME}/morseq.html, More About Sequences} in the MH
7284 book.}. As you've read, several of the MH-E commands can operate on a
7285 sequence, which is a shorthand for a range or group of messages. For
7286 example, you might want to forward several messages to a friend or
7287 colleague. Here's how to manipulate sequences. These commands are also
7288 available in the @samp{Sequence} menu.
7289
7290 @table @kbd
7291 @cindex @samp{Sequence > Toggle Tick Mark} menu item
7292 @cindex menu item, @samp{Sequence > Toggle Tick Mark}
7293 @kindex '
7294 @findex mh-toggle-tick
7295 @item '
7296 Toggle tick mark of range (@code{mh-toggle-tick}).
7297 @c -------------------------
7298 @kindex S ?
7299 @findex mh-prefix-help
7300 @item S ?
7301 Display cheat sheet for the commands of the current prefix in
7302 minibuffer (@code{mh-prefix-help}).
7303 @c -------------------------
7304 @cindex @samp{Sequence > Narrow to Tick Sequence} menu item
7305 @cindex menu item, @samp{Sequence > Narrow to Tick Sequence}
7306 @kindex S '
7307 @findex mh-narrow-to-tick
7308 @item S '
7309 Limit to ticked messages (@code{mh-narrow-to-tick}).
7310 @c -------------------------
7311 @cindex @samp{Sequence > Delete Message from Sequence...} menu item
7312 @cindex menu item, @samp{Sequence > Delete Message from Sequence...}
7313 @kindex S d
7314 @findex mh-delete-msg-from-seq
7315 @item S d
7316 Delete range from sequence (@code{mh-delete-msg-from-seq}).
7317 @c -------------------------
7318 @cindex @samp{Sequence > Delete Sequence...} menu item
7319 @cindex menu item, @samp{Sequence > Delete Sequence...}
7320 @kindex S k
7321 @findex mh-delete-seq
7322 @item S k
7323 Delete sequence (@code{mh-delete-seq}).
7324 @c -------------------------
7325 @cindex @samp{Sequence > List Sequences in Folder...} menu item
7326 @cindex menu item, @samp{Sequence > List Sequences in Folder...}
7327 @kindex S l
7328 @findex mh-list-sequences
7329 @item S l
7330 List all sequences in folder (@code{mh-list-sequences}).
7331 @c -------------------------
7332 @cindex @samp{Sequence > Narrow to Sequence...} menu item
7333 @cindex menu item, @samp{Sequence > Narrow to Sequence...}
7334 @kindex S n
7335 @findex mh-narrow-to-seq
7336 @item S n
7337 Restrict display to messages in sequence (@code{mh-narrow-to-seq}).
7338 @c -------------------------
7339 @cindex @samp{Sequence > Add Message to Sequence...} menu item
7340 @cindex menu item, @samp{Sequence > Add Message to Sequence...}
7341 @kindex S p
7342 @findex mh-put-msg-in-seq
7343 @item S p
7344 Add range to sequence (@code{mh-put-msg-in-seq}).
7345 @c -------------------------
7346 @cindex @samp{Sequence > List Sequences for Message} menu item
7347 @cindex menu item, @samp{Sequence > List Sequences for Message}
7348 @kindex S s
7349 @findex mh-msg-is-in-seq
7350 @item S s
7351 Display the sequences in which the current message appears
7352 (@code{mh-msg-is-in-seq}).
7353 @c -------------------------
7354 @cindex @samp{Sequence > Widen from Sequence} menu item
7355 @cindex menu item, @samp{Sequence > Widen from Sequence}
7356 @kindex S w
7357 @findex mh-widen
7358 @item S w
7359 Remove last restriction (@code{mh-widen}).
7360 @c -------------------------
7361 @findex mh-update-sequences
7362 @item M-x mh-update-sequences
7363 Flush MH-E's state out to MH@.
7364 @end table
7365
7366 @cindex @samp{mh-sequences} customization group
7367 @cindex customization group, @samp{mh-sequences}
7368
7369 The @samp{mh-sequences} customization group contains the options
7370 associated with sequences.
7371
7372 @vtable @code
7373 @item mh-refile-preserves-sequences-flag
7374 On means that sequences are preserved when messages are refiled
7375 (default: @samp{on}).
7376 @c -------------------------
7377 @item mh-tick-seq
7378 The name of the MH sequence for ticked messages (default: @samp{'tick}).
7379 @c -------------------------
7380 @item mh-update-sequences-after-mh-show-flag
7381 On means flush MH sequences to disk after message is shown (default:
7382 @samp{on}).
7383 @item mh-whitelist-preserves-sequences-flag
7384 On means that sequences are preserved when messages are whitelisted
7385 (default: @samp{on}).
7386 @end vtable
7387
7388 The following hook is available.
7389
7390 @vtable @code
7391 @item mh-unseen-updated-hook
7392 Hook run after the unseen sequence has been updated (default: @code{nil}).
7393 @end vtable
7394
7395 @cindex @command{pick}
7396 @cindex MH commands, @command{pick}
7397 @findex mh-put-msg-in-seq
7398 @kindex S p
7399
7400 To place a message in a sequence, use @kbd{S p}
7401 (@code{mh-put-msg-in-seq}). Give @kbd{S p} a range and you can add all
7402 the messages in a sequence to another sequence (for example, @kbd{C-u
7403 S p SourceSequence @key{RET} DestSequence @key{RET}}, @pxref{Ranges}).
7404
7405 @cindex @samp{tick} sequence
7406 @cindex sequence, @samp{tick}
7407 @cindex ticking messages
7408 @findex mh-index-ticked-messages
7409 @findex mh-toggle-tick
7410 @kindex '
7411 @kindex F '
7412 @kindex S p
7413
7414 One specific use of the @kbd{S p} command is @kbd{'}
7415 (@code{mh-toggle-tick}) which adds messages to the @samp{tick}
7416 sequence. This sequence can be viewed later with the @kbd{F '}
7417 (@code{mh-index-ticked-messages}) command (@pxref{Folders}).
7418
7419 @vindex mh-tick-seq
7420
7421 You can customize the option @code{mh-tick-seq} if you already use the
7422 @samp{tick} sequence for your own use. You can also disable all of the
7423 ticking functions by choosing the @samp{Disable Ticking} item but
7424 there isn't much advantage to that.
7425
7426 @cindex MH-Folder mode
7427 @cindex modes, MH-Folder
7428 @findex mh-narrow-to-seq
7429 @findex mh-narrow-to-tick
7430 @findex mh-widen
7431 @kindex S '
7432 @kindex S n
7433 @kindex S w
7434
7435 Once you've placed some messages in a sequence, you may wish to narrow
7436 the field of view to just those messages in the sequence you've
7437 created. To do this, use @kbd{S n} (@code{mh-narrow-to-seq}). You are
7438 prompted for the name of the sequence. What this does is show only
7439 those messages that are in the selected sequence in the MH-Folder
7440 buffer. In addition, it limits further MH-E searches to just those
7441 messages. To narrow the view to the messages in the @samp{tick}
7442 sequence, use @kbd{S '} (@code{mh-narrow-to-tick}). When you want to
7443 widen the view to all your messages again, use @kbd{S w}
7444 (@code{mh-widen}).
7445
7446 @cindex buffers, @file{*MH-E Sequences*}
7447 @cindex @file{*MH-E Sequences*}
7448 @findex mh-list-sequences
7449 @findex mh-msg-is-in-seq
7450 @kindex S l
7451 @kindex S s
7452
7453 You can see which sequences in which a message appears with the
7454 command @kbd{S s} (@code{mh-msg-is-in-seq}). Use a prefix argument to
7455 display the sequences in which another message appears (as in @kbd{C-u
7456 42 S s @key{RET}}). Or, you can list all sequences in a selected
7457 folder (default is current folder) with @kbd{S l}
7458 (@code{mh-list-sequences}). The list appears in a buffer named
7459 @file{*MH-E Sequences*} (@pxref{Miscellaneous}).
7460
7461 @cindex MH profile component, @samp{Previous-Sequence}
7462 @cindex @samp{cur} sequence
7463 @cindex @samp{Previous-Sequence} MH profile component
7464 @cindex sequence, @samp{cur}
7465 @cindex sequence, @samp{Previous-Sequence}
7466 @vindex mh-refile-preserves-sequences-flag
7467
7468 If a message is in any sequence (except
7469 @samp{Previous-Sequence:}@footnote{See @samp{mh-profile}(5)).} and
7470 @samp{cur}) when it is refiled, then it will still be in those
7471 sequences in the destination folder. If this behavior is not desired,
7472 then turn off the option @code{mh-refile-preserves-sequences-flag}.
7473
7474 @findex mh-delete-msg-from-seq
7475 @findex mh-delete-seq
7476 @kindex d
7477 @kindex S d
7478 @kindex S k
7479
7480 If you want to remove a message (or range, @pxref{Ranges}) from a
7481 sequence, use @kbd{S d} (@code{mh-delete-msg-from-seq}). If you want
7482 to delete an entire sequence, use @kbd{S k} (@code{mh-delete-seq}). In
7483 the latter case you are prompted for the sequence to delete. Note that
7484 this deletes only the sequence, not the messages in the sequence. If
7485 you want to delete the messages, use @kbd{C-u d} (@pxref{Reading
7486 Mail}).
7487
7488 @cindex @samp{Unseen-Sequence} MH profile component
7489 @cindex @samp{cur} sequence
7490 @cindex @samp{tick} sequence
7491 @cindex MH profile component, @samp{Unseen-Sequence}
7492 @cindex sequence, @samp{Unseen-Sequence}
7493 @cindex sequence, @samp{cur}
7494 @cindex sequence, @samp{tick}
7495 @findex mh-update-sequences
7496 @kindex M-x mh-update-sequences
7497 @kindex q
7498 @kindex x
7499 @vindex mh-tick-seq
7500 @vindex mh-update-sequences-after-mh-show-flag
7501
7502 Three sequences are maintained internally by MH-E and pushed out to MH
7503 when a message is shown. They include the sequence specified by your
7504 @samp{Unseen-Sequence:} profile component, @samp{cur}, and the
7505 sequence listed by the option @code{mh-tick-seq} which is @samp{tick}
7506 by default. If you do not like this behavior, turn off the option
7507 @code{mh-update-sequences-after-mh-show-flag}. You can then update the
7508 state manually with the @kbd{x}, @kbd{q}, or @kbd{M-x
7509 mh-update-sequences} commands.
7510
7511 @vindex mh-seen-list
7512 @vindex mh-unseen-updated-hook
7513
7514 The hook @code{mh-unseen-updated-hook} is run after the unseen
7515 sequence has been updated. The variable @code{mh-seen-list} can be
7516 used by this hook to obtain the list of messages which were removed
7517 from the unseen sequence.
7518
7519 @cindex @command{mark}
7520 @cindex MH commands, @command{mark}
7521 @kindex S n
7522 @kindex S w
7523
7524 With the exceptions of @kbd{S n} and @kbd{S w}, the underlying MH
7525 command dealing with sequences is @command{mark}@footnote{See the
7526 section @uref{@value{MH-BOOK-HOME}/mmbwm.html, Make Message Bookmarks
7527 with mark} in the MH book.}.
7528
7529 @node Junk, Miscellaneous, Sequences, Top
7530 @chapter Dealing With Junk Mail
7531
7532 @cindex Marshall Rose
7533 @cindex junk mail
7534 @cindex spam
7535
7536 Marshall Rose once wrote a paper on MH entitled, @cite{How to process
7537 200 messages a day and still get some real work done}. This chapter
7538 could be entitled, @cite{How to process 1000 spams a day and still get
7539 some real work done}.
7540
7541 @cindex blacklisting
7542 @cindex ham
7543 @cindex viruses
7544 @cindex whitelisting
7545 @cindex worms
7546
7547 We use the terms @dfn{junk mail} and @dfn{spam} interchangeably for
7548 any unwanted message which includes spam, @dfn{viruses}, and
7549 @dfn{worms}. The opposite of spam is @dfn{ham}. The act of classifying
7550 a sender as one who sends junk mail is called @dfn{blacklisting}; the
7551 opposite is called @dfn{whitelisting}.
7552
7553 @table @kbd
7554 @kindex J ?
7555 @findex mh-prefix-help
7556 @item J ?
7557 Display cheat sheet for the commands of the current prefix in
7558 minibuffer (@code{mh-prefix-help}).
7559 @c -------------------------
7560 @kindex J b
7561 @findex mh-junk-blacklist
7562 @item J b
7563 Blacklist range as spam (@code{mh-junk-blacklist}).
7564 @c -------------------------
7565 @kindex J w
7566 @findex mh-junk-whitelist
7567 @item J w
7568 Whitelist range as ham (@code{mh-junk-whitelist}).
7569 @c -------------------------
7570 @item @code{mh-spamassassin-identify-spammers}
7571 Identify spammers who are repeat offenders.
7572 @end table
7573
7574 @cindex @samp{mh-junk} customization group
7575 @cindex customization group, @samp{mh-junk}
7576
7577 The following table lists the options from the @samp{mh-junk}
7578 customization group.
7579
7580 @vtable @code
7581 @item mh-junk-background
7582 If on, spam programs are run in background (default: @samp{off}).
7583 @c -------------------------
7584 @item mh-junk-disposition
7585 Disposition of junk mail (default: @samp{Delete Spam}).
7586 @c -------------------------
7587 @item mh-junk-program
7588 Spam program that MH-E should use (default: @samp{Auto-detect}).
7589 @end vtable
7590
7591 @cindex @samp{mh-sequences} customization group
7592 @cindex customization group, @samp{mh-sequences}
7593
7594 The following option in the @samp{mh-sequences} customization group is
7595 also available.
7596
7597 @vtable @code
7598 @item mh-whitelist-preserves-sequences-flag
7599 On means that sequences are preserved when messages are whitelisted
7600 (default: @samp{on}).
7601 @end vtable
7602
7603 The following hooks are available.
7604
7605 @vtable @code
7606 @item mh-blacklist-msg-hook
7607 Hook run by @kbd{J b} (@code{mh-junk-blacklist}) after marking each
7608 message for blacklisting (default: @code{nil}).
7609 @c -------------------------
7610 @item mh-whitelist-msg-hook
7611 Hook run by @kbd{J w} (@code{mh-junk-whitelist}) after marking each
7612 message for whitelisting (default @samp{nil}).
7613 @end vtable
7614
7615 The following faces are available.
7616
7617 @vtable @code
7618 @item mh-folder-blacklisted
7619 Blacklisted message face.
7620 @c -------------------------
7621 @item mh-folder-whitelisted
7622 Whitelisted message face
7623 @end vtable
7624
7625 @cindex SpamProbe
7626 @cindex Spamassassin
7627 @cindex bogofilter
7628 @cindex spam filters, SpamProbe
7629 @cindex spam filters, Spamassassin
7630 @cindex spam filters, bogofilter
7631
7632 MH-E depends on @uref{http://spamassassin.apache.org/, SpamAssassin},
7633 @uref{http://bogofilter.sourceforge.net/, bogofilter}, or
7634 @uref{http://spamprobe.sourceforge.net/, SpamProbe} to throw the dreck
7635 away. This chapter describes briefly how to configure these programs
7636 to work well with MH-E and how to use MH-E's interface that provides
7637 continuing education for these programs.
7638
7639 @vindex mh-junk-program
7640
7641 The default setting of the option @code{mh-junk-program} is
7642 @samp{Auto-detect} which means that MH-E will automatically choose one
7643 of SpamAssassin, bogofilter, or SpamProbe in that order. If, for
7644 example, you have both SpamAssassin and bogofilter installed and you
7645 want to use bogofilter, then you can set this option to
7646 @samp{Bogofilter}.
7647
7648 @findex mh-junk-blacklist
7649 @kindex J b
7650 @vindex mh-junk-disposition
7651
7652 The command @kbd{J b} (@code{mh-junk-blacklist}) trains the spam
7653 program in use with the content of the range (@pxref{Ranges}) and then
7654 handles the message(s) as specified by the option
7655 @code{mh-junk-disposition}. By default, this option is set to
7656 @samp{Delete Spam} but you can also specify the name of the folder
7657 which is useful for building a corpus of spam for training purposes.
7658
7659 @findex mh-junk-whitelist
7660 @kindex J w
7661
7662 In contrast, the command @kbd{J w} (@code{mh-junk-whitelist})
7663 reclassifies a range of messages (@pxref{Ranges}) as ham if it were
7664 incorrectly classified as spam. It then refiles the message into the
7665 @file{+inbox} folder.
7666
7667 @cindex MH profile component, @samp{Previous-Sequence}
7668 @cindex @samp{cur} sequence
7669 @cindex @samp{Previous-Sequence} MH profile component
7670 @cindex sequence, @samp{cur}
7671 @cindex sequence, @samp{Previous-Sequence}
7672 @vindex mh-whitelist-preserves-sequences-flag
7673
7674 If a message is in any sequence (except @samp{Previous-Sequence:} and
7675 @samp{cur}) when it is whitelisted, then it will still be in those
7676 sequences in the destination folder. If this behavior is not desired,
7677 then turn off the option @code{mh-whitelist-preserves-sequences-flag}.
7678
7679 @cindex @file{*MH-E Log*}
7680 @cindex buffers, @file{*MH-E Log*}
7681 @findex call-process
7682 @vindex mh-junk-background
7683
7684 By default, the programs are run in the foreground, but this can be
7685 slow when junking large numbers of messages. If you have enough memory
7686 or don't junk that many messages at the same time, you might try
7687 turning on the option @code{mh-junk-background}. @footnote{Note that
7688 the option @code{mh-junk-background} is used as the @code{display}
7689 argument in the call to @code{call-process}. Therefore, turning on
7690 this option means setting its value to @samp{0}. You can also set its
7691 value to @samp{t} to direct the programs' output to the @file{*MH-E
7692 Log*} buffer; this may be useful for debugging.}
7693
7694 The following sections discuss the various counter-spam measures that
7695 MH-E can work with.
7696
7697 @cindex @file{.procmailrc}
7698 @cindex files, @file{.procmailrc}
7699
7700 @subheading SpamAssassin
7701
7702 @cindex Spamassassin
7703 @cindex spam filters, Spamassassin
7704
7705 SpamAssassin is one of the more popular spam filtering programs. Get
7706 it from your local distribution or from the
7707 @uref{http://spamassassin.apache.org/, SpamAssassin web site}.
7708
7709 To use SpamAssassin, add the following recipes to @file{~/.procmailrc}:
7710
7711 @cindex @command{spamc}
7712 @cindex @samp{X-Spam-Level} header field
7713 @cindex @samp{X-Spam-Status} header field
7714 @cindex header field, @samp{X-Spam-Level}
7715 @cindex header field, @samp{X-Spam-Status}
7716
7717 @smallexample
7718 PATH=$PATH:/usr/bin/mh
7719 MAILDIR=$HOME/`mhparam Path`
7720
7721 # Fight spam with SpamAssassin.
7722 :0fw
7723 | spamc
7724
7725 # Anything with a spam level of 10 or more is junked immediately.
7726 :0:
7727 * ^X-Spam-Level: ..........
7728 /dev/null
7729
7730 :0:
7731 * ^X-Spam-Status: Yes
7732 spam/.
7733 @end smallexample
7734
7735 If you don't use @command{spamc}, use @samp{spamassassin -P -a}.
7736
7737 Note that one of the recipes above throws away messages with a score
7738 greater than or equal to 10. Here's how you can determine a value that
7739 works best for you.
7740
7741 First, run @samp{spamassassin -t} on every mail message in your
7742 archive and use @command{gnumeric} to verify that the average plus the
7743 standard deviation of good mail is under 5, the SpamAssassin default
7744 for ``spam''.
7745
7746 Using @command{gnumeric}, sort the messages by score and view the
7747 messages with the highest score. Determine the score which encompasses
7748 all of your interesting messages and add a couple of points to be
7749 conservative. Add that many dots to the @samp{X-Spam-Level:} header
7750 field above to send messages with that score down the drain.
7751
7752 In the example above, messages with a score of 5--9 are set aside in
7753 the @samp{+spam} folder for later review. The major weakness of
7754 rules-based filters is a plethora of false positives so it is
7755 worthwhile to check.
7756
7757 @findex mh-junk-blacklist
7758 @findex mh-junk-whitelist
7759 @kindex J b
7760 @kindex J w
7761
7762 If SpamAssassin classifies a message incorrectly, or is unsure, you can
7763 use the MH-E commands @kbd{J b} (@code{mh-junk-blacklist}) and
7764 @kbd{J w} (@code{mh-junk-whitelist}).
7765
7766 @cindex @command{sa-learn}
7767 @cindex @file{.spamassassin/user_prefs}
7768 @cindex files, @file{.spamassassin/user_prefs}
7769
7770 The command @kbd{J b} (@code{mh-junk-blacklist}) adds a
7771 @samp{blacklist_from} entry to @file{~/spamassassin/user_prefs},
7772 deletes the message, and sends the message to the Razor, so that
7773 others might not see this spam. If the @command{sa-learn} command is
7774 available, the message is also recategorized as spam.
7775
7776 The command@kbd{J w} (@code{mh-junk-whitelist}) adds a
7777 @samp{whitelist_from} rule to @samp{~/.spamassassin/user_prefs}. If
7778 the @command{sa-learn} command is available, the message is also
7779 recategorized as ham.
7780
7781 Over time, you'll observe that the same host or domain occurs
7782 repeatedly in the @samp{blacklist_from} entries, so you might think
7783 that you could avoid future spam by blacklisting all mail from a
7784 particular domain. The utility function
7785 @code{mh-spamassassin-identify-spammers} helps you do precisely that.
7786 This function displays a frequency count of the hosts and domains in
7787 the @samp{blacklist_from} entries from the last blank line in
7788 @file{~/.spamassassin/user_prefs} to the end of the file. This
7789 information can be used so that you can replace multiple
7790 @samp{blacklist_from} entries with a single wildcard entry such as:
7791
7792 @smallexample
7793 blacklist_from *@@*amazingoffersdirect2u.com
7794 @end smallexample
7795
7796 In versions of SpamAssassin (2.50 and on) that support a Bayesian
7797 classifier, @kbd{J b} @code{(mh-junk-blacklist}) uses the program
7798 @command{sa-learn} to recategorize the message as spam. Neither MH-E,
7799 nor SpamAssassin, rebuilds the database after adding words, so you
7800 will need to run @samp{sa-learn --rebuild} periodically. This can be
7801 done by adding the following to your @file{crontab}:
7802
7803 @smallexample
7804 0 * * * * sa-learn --rebuild > /dev/null 2>&1
7805 @end smallexample
7806
7807 @subheading Bogofilter
7808
7809 @cindex bogofilter
7810 @cindex spam filters, bogofilter
7811
7812 Bogofilter is a Bayesian spam filtering program. Get it from your
7813 local distribution or from the
7814 @uref{http://bogofilter.sourceforge.net/, bogofilter web site}.
7815
7816 Bogofilter is taught by running:
7817
7818 @smallexample
7819 bogofilter -n < good-message
7820 @end smallexample
7821
7822 on every good message, and
7823
7824 @smallexample
7825 bogofilter -s < spam-message
7826 @end smallexample
7827
7828 @cindex full training
7829
7830 on every spam message. This is called a @dfn{full training}; three
7831 other training methods are described in the FAQ that is distributed
7832 with bogofilter. Note that most Bayesian filters need 1000 to 5000 of
7833 each type of message to start doing a good job.
7834
7835 To use bogofilter, add the following recipes to @file{~/.procmailrc}:
7836
7837 @cindex @samp{X-Bogosity} header field
7838 @cindex header field, @samp{X-Bogosity}
7839
7840 @smallexample
7841 PATH=$PATH:/usr/bin/mh
7842 MAILDIR=$HOME/`mhparam Path`
7843
7844 # Fight spam with Bogofilter.
7845 :0fw
7846 | bogofilter -3 -e -p
7847
7848 :0:
7849 * ^X-Bogosity: Yes, tests=bogofilter
7850 spam/.
7851
7852 :0:
7853 * ^X-Bogosity: Unsure, tests=bogofilter
7854 spam/unsure/.
7855 @end smallexample
7856
7857 @findex mh-junk-blacklist
7858 @findex mh-junk-whitelist
7859 @kindex J b
7860 @kindex J w
7861
7862 If bogofilter classifies a message incorrectly, or is unsure, you can
7863 use the MH-E commands @kbd{J b} (@code{mh-junk-blacklist}) and @kbd{J
7864 w} (@code{mh-junk-whitelist}) to update bogofilter's training.
7865
7866 The @cite{Bogofilter FAQ} suggests that you run the following
7867 occasionally to shrink the database:
7868
7869 @smallexample
7870 bogoutil -d wordlist.db | bogoutil -l wordlist.db.new
7871 mv wordlist.db wordlist.db.prv
7872 mv wordlist.db.new wordlist.db
7873 @end smallexample
7874
7875 The @cite{Bogofilter tuning HOWTO} describes how you can fine-tune
7876 bogofilter.
7877
7878 @subheading SpamProbe
7879
7880 @cindex SpamProbe
7881 @cindex spam filters, SpamProbe
7882
7883 SpamProbe is a Bayesian spam filtering program. Get it from your local
7884 distribution or from the @uref{http://spamprobe.sourceforge.net,
7885 SpamProbe web site}.
7886
7887 To use SpamProbe, add the following recipes to @file{~/.procmailrc}:
7888
7889 @cindex @command{formail}
7890 @cindex @samp{X-SpamProbe} header field
7891 @cindex header field, @samp{X-SpamProbe}
7892
7893 @smallexample
7894 PATH=$PATH:/usr/bin/mh
7895 MAILDIR=$HOME/`mhparam Path`
7896
7897 # Fight spam with SpamProbe.
7898 :0
7899 SCORE=| spamprobe receive
7900
7901 :0 wf
7902 | formail -I "X-SpamProbe: $SCORE"
7903
7904 :0:
7905 *^X-SpamProbe: SPAM
7906 spam/.
7907 @end smallexample
7908
7909 @findex mh-junk-blacklist
7910 @findex mh-junk-whitelist
7911 @kindex J b
7912 @kindex J w
7913
7914 If SpamProbe classifies a message incorrectly, you can use the MH-E
7915 commands @kbd{J b} (@code{mh-junk-blacklist}) and @kbd{J w}
7916 (@code{mh-junk-whitelist}) to update SpamProbe's training.
7917
7918 @subheading Other Things You Can Do
7919
7920 There are a couple of things that you can add to @file{~/.procmailrc}
7921 in order to filter out a lot of spam and viruses. The first is to
7922 eliminate any message with a Windows executable (which is most likely
7923 a virus). The second is to eliminate mail in character sets that you
7924 can't read.
7925
7926 @cindex @samp{Content-Transfer-Encoding} header field
7927 @cindex @samp{Content-Type} header field
7928 @cindex @samp{Subject} header field
7929 @cindex header field, @samp{Content-Transfer-Encoding}
7930 @cindex header field, @samp{Content-Type}
7931 @cindex header field, @samp{Subject}
7932
7933 @smallexample
7934 PATH=$PATH:/usr/bin/mh
7935 MAILDIR=$HOME/`mhparam Path`
7936
7937 #
7938 # Filter messages with w32 executables/virii.
7939 #
7940 # These attachments are base64 and have a TVqQAAMAAAAEAAAA//8AALg
7941 # pattern. The string "this program cannot be run in MS-DOS mode"
7942 # encoded in base64 is 4fug4AtAnNIbg and helps to avoid false
7943 # positives (Roland Smith via Pete from the bogofilter mailing list).
7944 #
7945 :0 B:
7946 * ^Content-Transfer-Encoding:.*base64
7947 * ^TVqQAAMAAAAEAAAA//8AALg
7948 * 4fug4AtAnNIbg
7949 spam/exe/.
7950
7951 #
7952 # Filter mail in unreadable character sets (from the Bogofilter FAQ).
7953 #
7954 UNREADABLE='[^?"]*big5|iso-2022-jp|ISO-2022-KR|euc-kr|gb2312|ks_c_5601-1987'
7955
7956 :0:
7957 * 1^0 $ ^Subject:.*=\?($UNREADABLE)
7958 * 1^0 $ ^Content-Type:.*charset="?($UNREADABLE)
7959 spam/unreadable/.
7960
7961 :0:
7962 * ^Content-Type:.*multipart
7963 * B ?? $ ^Content-Type:.*^?.*charset="?($UNREADABLE)
7964 spam/unreadable/.
7965 @end smallexample
7966
7967 @node Miscellaneous, Scan Line Formats, Junk, Top
7968 @chapter Miscellaneous Commands, Variables, and Buffers
7969
7970 This chapter covers the following command and the various MH-E
7971 buffers,
7972
7973 @ftable @code
7974 @item mh-version
7975 Display version information about MH-E and the MH mail handling
7976 system.
7977 @end ftable
7978
7979 @cindex buffers, @file{*MH-E Info*}
7980 @cindex MH-E version
7981 @cindex @file{*MH-E Info*}
7982 @cindex version
7983 @kindex M-x mh-version
7984
7985 One command worth noting is @kbd{M-x mh-version}. You can compare the
7986 version this command prints to the latest release (@pxref{Getting
7987 MH-E}). The output of @kbd{M-x mh-version}, found in a buffer named
7988 @file{*MH-E Info*}, should usually be included with any bug report you
7989 submit (@pxref{Bug Reports}).
7990
7991 @subheading MH-E Buffers
7992
7993 Besides the MH-Folder, MH-Show, and MH-Letter buffers, MH-E creates
7994 several other buffers. They are:
7995
7996 @table @samp
7997 @cindex @file{*MH-E Folders*}
7998 @cindex buffers, @file{*MH-E Folders*}
7999 @findex mh-list-folders
8000 @item *MH-E Folders*
8001 @kindex F l
8002 This buffer contains the output of @kbd{F l} (@code{mh-list-folders}).
8003 @xref{Folders}.
8004 @c -------------------------
8005 @cindex @file{*MH-E Help*}
8006 @cindex buffers, @file{*MH-E Help*}
8007 @findex mh-help
8008 @item *MH-E Help*
8009 @kindex ?
8010 @kindex C-c ?
8011 This buffer contains the output of @kbd{?} (@code{mh-help}) and
8012 @kbd{C-c ?} in MH-Letter mode. @xref{Using This Manual}.
8013 @c -------------------------
8014 @cindex @file{*MH-E Info*}
8015 @cindex buffers, @file{*MH-E Info*}
8016 @item *MH-E Info*
8017 This buffer contains the output of @kbd{M-x mh-version @key{RET}}.
8018 @c -------------------------
8019 @cindex @file{*MH-E Log*}
8020 @cindex buffers, @file{*MH-E Log*}
8021 @item *MH-E Log*
8022 This buffer contains the last 100 lines of the output of the various
8023 MH commands.
8024 @c -------------------------
8025 @cindex @file{*MH-E Mail Delivery*}
8026 @cindex buffers, @file{*MH-E Mail Delivery*}
8027 @item *MH-E Mail Delivery*
8028 This buffer contains the transcript of a mail delivery. @xref{Sending
8029 Message}.
8030 @c -------------------------
8031 @cindex @file{*MH-E Recipients*}
8032 @cindex buffers, @file{*MH-E Recipients*}
8033 @findex mh-check-whom
8034 @item *MH-E Recipients*
8035 @kindex C-c C-w
8036 This buffer contains the output of @kbd{C-c C-w}
8037 (@code{mh-check-whom}) and is killed when draft is sent.
8038 @xref{Checking Recipients}.
8039 @c -------------------------
8040 @cindex @file{*MH-E Sequences*}
8041 @cindex buffers, @file{*MH-E Sequences*}
8042 @item *MH-E Sequences*
8043 This buffer contains the output of @kbd{S l}
8044 (@code{mh-list-sequences}). @xref{Sequences}.
8045 @c -------------------------
8046 @cindex @file{*mh-temp*}
8047 @cindex buffers, @file{*mh-temp*}
8048 @item *mh-temp*
8049 This is a scratch, ephemeral, buffer used by MH-E functions. Note that
8050 it is hidden because the first character in the name is a space.
8051 You'll generally not have any need for this buffer.
8052 @end table
8053
8054 @node Scan Line Formats, Procmail, Miscellaneous, Top
8055 @appendix Scan Line Formats
8056
8057 @cindex scan line formats
8058
8059 This appendix discusses how MH-E creates, parses, and manipulates scan
8060 lines. If you have your own MH scan or inc format files, you
8061 @strong{can} teach MH-E how to handle them, but it isn't easy as
8062 you'll see.
8063
8064 @cindex @samp{mh-scan-line-formats} customization group
8065 @cindex customization group, @samp{mh-scan-line-formats}
8066
8067 This table lists the options in the @samp{mh-scan-line-formats}
8068 customization group.
8069
8070 @vtable @code
8071 @item mh-adaptive-cmd-note-flag
8072 On means that the message number width is determined dynamically
8073 (default: @samp{on}).
8074 @c -------------------------
8075 @item mh-scan-format-file
8076 Specifies the format file to pass to the scan program (default:
8077 @samp{Use MH-E scan Format}).
8078 @c -------------------------
8079 @item mh-scan-prog
8080 Program used to scan messages (default: @code{"scan"}).
8081 @end vtable
8082
8083 @vindex mh-adaptive-cmd-note-flag
8084
8085 There are a couple of caveats when creating your own scan format file.
8086 First, MH-E will not work if your scan lines do not include message
8087 numbers. It will work poorly if you don't dedicate a column for
8088 showing the current message and notations. It is also best to keep the
8089 first column empty to make room for the cursor and so that text isn't
8090 obscured by the current message's overlay arrow when running in a
8091 terminal. You won't be able to use the option
8092 @code{mh-adaptive-cmd-note-flag} or the threading features
8093 (@pxref{Threading}).
8094
8095 @cindex message numbers
8096 @findex mh-set-cmd-note
8097 @vindex mh-adaptive-cmd-note-flag
8098 @vindex mh-scan-format-file
8099
8100 If you've created your own format to handle long message numbers,
8101 you'll be pleased to know you no longer need it since MH-E adapts its
8102 internal format based upon the largest message number if
8103 @code{mh-adaptive-cmd-note-flag} is on (the default). If you prefer
8104 fixed-width message numbers, turn off @code{mh-adaptive-cmd-note-flag}
8105 and call @code{mh-set-cmd-note} with the width specified by your
8106 format file (see @code{mh-scan-format-file}). For example, the default
8107 width is 4, so you would use @samp{(mh-set-cmd-note 4)}.
8108
8109 @vindex mh-adaptive-cmd-note-flag
8110 @vindex mh-scan-format-file
8111 @vindex mh-scan-format-mh
8112 @vindex mh-scan-format-nmh
8113
8114 The default setting for @code{mh-scan-format-file} is @samp{Use MH-E
8115 scan Format}. This means that the format string will be taken from the
8116 either @code{mh-scan-format-mh} or @code{mh-scan-format-nmh} depending
8117 on whether MH or nmh (or GNU mailutils MH) is in use. This setting
8118 also enables you to turn on the option
8119 @code{mh-adaptive-cmd-note-flag}. You can also set this option to
8120 @samp{Use Default scan Format} to get the same output as you would get
8121 if you ran @command{scan} from the shell. If you have a format file
8122 that you want MH-E to use but not MH, you can set this option to
8123 @samp{Specify a scan Format File} and enter the name of your format
8124 file.
8125
8126 @vindex mh-scan-format-file
8127 @vindex mh-scan-format-mh
8128 @vindex mh-scan-format-nmh
8129
8130 The scan format that MH-E uses when @code{mh-scan-format-file} is set
8131 to its default of @samp{Use MH-E scan Format} is held in the variables
8132 @code{mh-scan-format-nmh} and @code{mh-scan-format-mh} depending on
8133 whether you are using nmh (or GNU mailutils MH) or not. Typically, you
8134 create your own format files rather than modifying these variables.
8135 The value of @code{mh-scan-format-nmh} is:
8136
8137 @smallexample
8138 (concat
8139 "%4(msg)"
8140 "%<(cur)+%| %>"
8141 "%<@{replied@}-"
8142 "%?(nonnull(comp@{to@}))%<(mymbox@{to@})t%>"
8143 "%?(nonnull(comp@{cc@}))%<(mymbox@{cc@})c%>"
8144 "%?(nonnull(comp@{bcc@}))%<(mymbox@{bcc@})b%>"
8145 "%?(nonnull(comp@{newsgroups@}))n%>"
8146 "%<(zero) %>"
8147 "%02(mon@{date@})/%02(mday@{date@})%<@{date@} %|*%>"
8148 "%<(mymbox@{from@})%<@{to@}To:%14(decode(friendly@{to@}))%>%>"
8149 "%<(zero)%17(decode(friendly@{from@}))%> "
8150 "%(decode@{subject@})%<@{body@}<<%@{body@}%>")
8151 @end smallexample
8152
8153 @cindex decoding RFC 2047
8154 @cindex RFC 2047, decoding
8155 @vindex mh-scan-format-mh
8156
8157 The setting for @code{mh-scan-format-mh} is similar, except that MH
8158 doesn't have the function @code{decode} (which is used to decode RFC
8159 2047 encodings).
8160
8161 @cindex notations, scan line
8162 @cindex scan line notations
8163
8164 These strings are passed to the @command{scan} program via the
8165 @option{-format} argument. The formats are identical to the defaults
8166 except that additional hints for fontification have been added to the
8167 existing notations in the fifth column (remember that in Emacs, the
8168 columns start at 0). The values of the fifth column, in priority
8169 order, are: @samp{-} if the message has been replied to, @samp{t} if
8170 an address in the @samp{To:} field matches one of the mailboxes of the
8171 current user, @samp{c} if the @samp{Cc:} field matches, @samp{b} if
8172 the @samp{Bcc:} field matches, and @samp{n} if a non-empty
8173 @samp{Newsgroups:} field is present.
8174
8175 @cindex @command{scan}
8176 @cindex MH commands, @command{scan}
8177 @vindex mh-progs
8178 @vindex mh-scan-prog
8179
8180 The name of the program that generates a listing of one line per
8181 message is held in @code{mh-scan-prog} (default: @code{"scan"}).
8182 Unless this variable contains an absolute pathname, it is assumed to
8183 be in the @code{mh-progs} directory (@pxref{Getting Started}). You may
8184 link another program to @command{scan} (see @samp{mh-profile}(5)) to
8185 produce a different type of listing@footnote{See the section
8186 @uref{@value{MH-BOOK-HOME}/faswsprs.html, Find and Specify with scan
8187 pick Ranges Sequences} in the MH book.}.
8188
8189 @cindex regular expressions, scan line formats
8190 @findex mh-set-cmd-note
8191 @findex setq
8192
8193 If you change the format of the scan lines you'll need to tell MH-E
8194 how to parse the new format. As you will see, quite a lot of variables
8195 are involved to do that. Use @kbd{M-x apropos @key{RET}
8196 mh-scan.*regexp @key{RET}} to obtain a list of these variables. You
8197 will also have to call @code{mh-set-cmd-note} if your notations are
8198 not in column 4 (columns in Emacs start with 0). Note that unlike most
8199 of the user options described in this manual, these are variables and
8200 must be set with @code{setq} instead of in a customization buffer. For
8201 help with regular expressions, see
8202 @ifnothtml
8203 @ref{Regexps, , Syntax of Regular Expressions, emacs, The
8204 GNU Emacs Manual}.
8205 @end ifnothtml
8206 @ifhtml
8207 section
8208 @uref{http://www.gnu.org/software/emacs/manual/html_node/emacs/Regexps.html,
8209 Syntax of Regular Expressions} in @cite{The GNU Emacs Manual}.
8210 @end ifhtml
8211
8212 The first variable has to do with pruning out garbage.
8213
8214 @vtable @code
8215 @cindex @command{inc}
8216 @cindex MH commands, @command{inc}
8217 @cindex @command{scan}
8218 @cindex MH commands, @command{scan}
8219 @item mh-scan-valid-regexp
8220 This regular expression describes a valid scan line. This is used to
8221 eliminate error messages that are occasionally produced by
8222 @command{inc}@footnote{See the section
8223 @uref{@value{MH-BOOK-HOME}/reapre.html, Reading Mail: inc show next
8224 prev} in the MH book.} or @command{scan} (default: @code{"^ *[0-9]"}).
8225 @end vtable
8226
8227 Next, many variables control how the scan lines are parsed.
8228
8229 @vtable @code
8230 @vindex mh-folder-body
8231 @vindex mh-folder-font-lock-keywords
8232 @item mh-scan-body-regexp
8233 This regular expression matches the message body fragment. Note that
8234 the default setting of @code{mh-folder-font-lock-keywords} expects
8235 this expression to contain at least one parenthesized expression which
8236 matches the body text as in the default of
8237 @code{"\\(<<\\([^\n]+\\)?\\)"}. If this regular expression is not
8238 correct, the body fragment will not be highlighted with the face
8239 @code{mh-folder-body}.
8240 @c -------------------------
8241 @vindex mh-folder-cur-msg-number
8242 @vindex mh-folder-font-lock-keywords
8243 @vindex mh-note-cur
8244 @item mh-scan-cur-msg-number-regexp
8245 This regular expression matches the current message. It must match
8246 from the beginning of the line. Note that the default setting of
8247 @code{mh-folder-font-lock-keywords} expects this expression to contain
8248 at least one parenthesized expression which matches the message number
8249 as in the default of @w{@code{"^\\( *[0-9]+\\+\\).*"}}. This
8250 expression includes the leading space and current message marker
8251 @samp{+} within the parenthesis since it looks better to highlight
8252 these items as well. The highlighting is done with the face
8253 @code{mh-folder-cur-msg-number}. This regular expression should be
8254 correct as it is needed by non-fontification functions. See also
8255 @code{mh-note-cur}.
8256 @c -------------------------
8257 @vindex mh-folder-date
8258 @vindex mh-folder-font-lock-keywords
8259 @vindex mh-scan-sent-to-me-sender-regexp
8260 @item mh-scan-date-regexp
8261 This regular expression matches a valid date. It must @strong{not} be
8262 anchored to the beginning or the end of the line. Note that the
8263 default setting of @code{mh-folder-font-lock-keywords} expects this
8264 expression to contain only one parenthesized expression which matches
8265 the date field as in the default of
8266 @code{"\\([0-9][0-9]/[0-9][0-9]\\)"}. If this regular expression is
8267 not correct, the date will not be highlighted with the face
8268 @code{mh-folder-date}.
8269 @c -------------------------
8270 @vindex mh-folder-deleted
8271 @vindex mh-folder-font-lock-keywords
8272 @vindex mh-note-deleted
8273 @item mh-scan-deleted-msg-regexp
8274 This regular expression matches deleted messages. It must match from
8275 the beginning of the line. Note that the default setting of
8276 @code{mh-folder-font-lock-keywords} expects this expression to contain
8277 at least one parenthesized expression which matches the message number
8278 as in the default of @code{"^\\( *[0-9]+\\)D"}. This expression
8279 includes the leading space within the parenthesis since it looks
8280 better to highlight it as well. The highlighting is done with the face
8281 @code{mh-folder-deleted}. This regular expression should be correct as
8282 it is needed by non-fontification functions. See also
8283 @code{mh-note-deleted}.
8284 @c -------------------------
8285 @vindex mh-folder-font-lock-keywords
8286 @vindex mh-folder-msg-number
8287 @item mh-scan-good-msg-regexp
8288 This regular expression matches ``good'' messages. It must match from
8289 the beginning of the line. Note that the default setting of
8290 @code{mh-folder-font-lock-keywords} expects this expression to contain
8291 at least one parenthesized expression which matches the message number
8292 as in the default of @w{@code{"^\\( *[0-9]+\\)[^D^0-9]"}}. This
8293 expression includes the leading space within the parenthesis since it
8294 looks better to highlight it as well. The highlighting is done with
8295 the face @code{mh-folder-msg-number}. This regular expression should
8296 be correct as it is needed by non-fontification functions.
8297 @c -------------------------
8298 @vindex mh-scan-format-file
8299 @item mh-scan-msg-format-regexp
8300 This regular expression finds the message number width in a scan
8301 format. Note that the message number must be placed in a parenthesized
8302 expression as in the default of @code{"%\\([0-9]*\\)(msg)"}. This
8303 variable is only consulted if @code{mh-scan-format-file} is set to
8304 @samp{Use MH-E scan Format}.
8305 @c -------------------------
8306 @vindex mh-scan-format-file
8307 @item mh-scan-msg-format-string
8308 This is a format string for the width of the message number in a scan
8309 format. Use @samp{0%d} for zero-filled message numbers. This variable
8310 is only consulted if @code{mh-scan-format-file} is set to @samp{Use
8311 MH-E scan Format} (default: @code{"%d"}).
8312 @c -------------------------
8313 @item mh-scan-msg-number-regexp
8314 This regular expression extracts the message number. It must match
8315 from the beginning of the line. Note that the message number must be
8316 placed in a parenthesized expression as in the default of @w{@code{"^
8317 *\\([0-9]+\\)"}}.
8318 @c -------------------------
8319 @item mh-scan-msg-overflow-regexp
8320 This regular expression matches overflowed message numbers (default:
8321 @code{"^[?0-9][0-9]"}).
8322 @c -------------------------
8323 @item mh-scan-msg-search-regexp
8324 This regular expression matches a particular message. It is a format
8325 string; use @samp{%d} to represent the location of the message number
8326 within the expression as in the default of @code{"^[^0-9]*%d[^0-9]"}.
8327 @c -------------------------
8328 @vindex mh-folder-address
8329 @vindex mh-folder-font-lock-keywords
8330 @vindex mh-folder-to
8331 @item mh-scan-rcpt-regexp
8332 This regular expression specifies the recipient in messages you sent.
8333 Note that the default setting of @code{mh-folder-font-lock-keywords}
8334 expects this expression to contain two parenthesized expressions. The
8335 first is expected to match the @samp{To:} that the default scan format
8336 file generates. The second is expected to match the recipient's name
8337 as in the default of @code{"\\(To:\\)\\(..............\\)"}. If this
8338 regular expression is not correct, the @samp{To:} string will not be
8339 highlighted with the face @code{mh-folder-to} and the recipient will not be
8340 highlighted with the face @code{mh-folder-address}.
8341 @c -------------------------
8342 @vindex mh-folder-font-lock-keywords
8343 @vindex mh-folder-refiled
8344 @vindex mh-note-refiled
8345 @item mh-scan-refiled-msg-regexp
8346 This regular expression matches refiled messages. It must match from
8347 the beginning of the line. Note that the default setting of
8348 @code{mh-folder-font-lock-keywords} expects this expression to contain
8349 at least one parenthesized expression which matches the message number
8350 as in the default of @w{@code{"^\\( *[0-9]+\\)\\^"}}. This expression
8351 includes the leading space within the parenthesis since it looks
8352 better to highlight it as well. The highlighting is done with the face
8353 @code{mh-folder-refiled}. This regular expression should be correct as
8354 it is needed by non-fontification functions. See also
8355 @code{mh-note-refiled}.
8356 @c -------------------------
8357 @vindex mh-folder-font-lock-keywords
8358 @vindex mh-folder-sent-to-me-sender
8359 @vindex mh-mh-folder-sent-to-me-hint
8360 @vindex mh-scan-format-nmh
8361 @item mh-scan-sent-to-me-sender-regexp
8362 This regular expression matches messages sent to us. Note that the
8363 default setting of @code{mh-folder-font-lock-keywords} expects this
8364 expression to contain at least two parenthesized expressions. The
8365 first should match the fontification hint (see
8366 @code{mh-scan-format-nmh}) and the second should match the user name
8367 as in the default of
8368 @w{@code{"^ *[0-9]+.\\([bct]\\).....[ ]*\\(..................\\)"}}.
8369 If this regular expression is not correct, the notation hints will not
8370 be highlighted with the face @code{mh-mh-folder-sent-to-me-hint} and
8371 the sender will not be highlighted with the face
8372 @code{mh-folder-sent-to-me-sender}.
8373 @c -------------------------
8374 @vindex mh-folder-followup
8375 @vindex mh-folder-font-lock-keywords
8376 @vindex mh-folder-subject
8377 @item mh-scan-subject-regexp
8378 This regular expression matches the subject. It must match from the
8379 beginning of the line. Note that the default setting of
8380 @samp{mh-folder-font-lock-keywords} expects this expression to contain
8381 at least three parenthesized expressions. The first is expected to
8382 match the @samp{Re:} string, if any, and is highlighted with the face
8383 @code{mh-folder-followup}. The second matches an optional bracketed
8384 number after @samp{Re:}, such as in @samp{Re[2]:} (and is thus a
8385 sub-expression of the first expression). The third is expected to
8386 match the subject line itself which is highlighted with the face
8387 @code{mh-folder-subject}. For example, the default is
8388 @w{@code{"^ *[0-9]+........[ ]*...................}}@*
8389 @w{@code{\\([Rr][Ee]\\(\\[[0-9]+\\]\\)?:\\s-*\\)*\\([^<\n]*\\)"}}.
8390 This regular expression should be correct as it is needed by
8391 non-fontification functions. Note that this example is broken up on
8392 two lines for readability, but is actually a single string.
8393 @end vtable
8394
8395 Finally, there are a slew of variables that control how MH-E annotates
8396 the scan lines.
8397
8398 @vtable @code
8399 @findex mh-set-cmd-note
8400 @vindex mh-adaptive-cmd-note-flag
8401 @item mh-cmd-note
8402 Column for notations (default: 4). This variable should be set with
8403 the function @code{mh-set-cmd-note}. This variable may be updated
8404 dynamically if @code{mh-adaptive-cmd-note-flag} is on. The following
8405 variables contain the notational characters. Note that columns in
8406 Emacs start with 0.
8407 @c -------------------------
8408 @item mh-note-copied
8409 Messages that have been copied are marked by this character (default:
8410 @code{?C}).
8411 @c -------------------------
8412 @vindex mh-scan-cur-msg-number-regexp
8413 @item mh-note-cur
8414 The current message (in MH, not in MH-E) is marked by this character
8415 (default: @code{?+}). See also @code{mh-scan-cur-msg-number-regexp}.
8416 @c -------------------------
8417 @vindex mh-scan-deleted-msg-regexp
8418 @item mh-note-deleted
8419 Messages that have been deleted are marked by this character (default:
8420 @code{?D}). See also @code{mh-scan-deleted-msg-regexp}.
8421 @c -------------------------
8422 @item mh-note-dist
8423 Messages that have been redistributed are marked by this character
8424 (default: @code{?R}).
8425 @c -------------------------
8426 @item mh-note-forw
8427 Messages that have been forwarded are marked by this character
8428 (default: @code{?F}).
8429 @c -------------------------
8430 @item mh-note-printed
8431 Messages that have been printed are marked by this character (default:
8432 @code{?P}).
8433 @c -------------------------
8434 @vindex mh-scan-refiled-msg-regexp
8435 @item mh-note-refiled
8436 Messages that have been refiled are marked by this character (default:
8437 @code{?^}). See also @code{mh-scan-refiled-msg-regexp}.
8438 @c -------------------------
8439 @item mh-note-repl
8440 Messages that have been replied to are marked by this character
8441 (default: @code{?-}).
8442 @c -------------------------
8443 @item mh-note-seq
8444 Messages in a user-defined sequence are marked by this character
8445 (default: @code{?%}). Messages in the @samp{search} sequence are
8446 marked by this character as well.
8447 @end vtable
8448
8449 For example, let's say I have the following in @file{scan.format}
8450 which displays the sender, the subject, and the message number. This
8451 format places a @samp{+} after the message number for the current
8452 message according to MH; it also uses that column for notations.
8453
8454 @smallexample
8455 %20(decode(friendly@{from@})) %50(decode@{subject@}) %4(msg)%<(cur)+%| %>
8456 @end smallexample
8457
8458 @vindex mh-adaptive-cmd-note-flag
8459 @vindex mh-scan-format-file
8460 @vindex mh-scan-format-file, example
8461
8462 The first thing you have to do is tell MH-E to use this file.
8463 Customize @code{mh-scan-format-file} and set its value to @samp{Use
8464 Default scan Format}. If you didn't get already turn off
8465 @code{mh-adaptive-cmd-note-flag}, you'll need to do that first.
8466
8467 Next, tell MH-E what a valid scan line looks like so that you can at
8468 least display the output of scan in your MH-Folder buffer.
8469
8470 @vindex mh-scan-valid-regexp, example
8471
8472 @smalllisp
8473 (setq mh-scan-valid-regexp "[0-9]+[+D^ ]$")
8474 @end smalllisp
8475
8476 Now, in order to get rid of the @samp{Cursor not pointing to message}
8477 message, you need to tell MH-E how to access the message number. You
8478 should also see why MH-E requires that you include a message number in
8479 the first place.
8480
8481 @vindex mh-scan-msg-number-regexp, example
8482 @vindex mh-scan-msg-search-regexp, example
8483
8484 @smalllisp
8485 (setq mh-scan-msg-number-regexp "^.* \\([0-9]+\\)[+D^ ]$")
8486 (setq mh-scan-msg-search-regexp " %d[+D^ ]$")
8487 @end smalllisp
8488
8489 In order to get the next and previous commands working, add this.
8490
8491 @vindex mh-scan-good-msg-regexp, example
8492
8493 @smalllisp
8494 (setq mh-scan-good-msg-regexp "^.* \\([0-9]+\\)[+D^ ]$")
8495 @end smalllisp
8496
8497 Note that the current message isn't marked with a @samp{+} when moving
8498 between the next and previous messages. Here is the code required to
8499 get this working.
8500
8501 @vindex set-mh-cmd-note, example
8502 @vindex mh-scan-cur-msg-number-regexp, example
8503
8504 @smalllisp
8505 (set-mh-cmd-note 76)
8506 (setq mh-scan-cur-msg-number-regexp "^.* \\([0-9]+\\)\\+$")
8507 @end smalllisp
8508
8509 Finally, add the following to delete and refile messages.
8510
8511 @vindex mh-scan-deleted-msg-regexp, example
8512 @vindex mh-scan-refiled-msg-regexp, example
8513
8514 @smalllisp
8515 (setq mh-scan-deleted-msg-regexp "^.* \\([0-9]+\\)D$")
8516 (setq mh-scan-refiled-msg-regexp "^.* \\([0-9]+\\)\\^$")
8517 @end smalllisp
8518
8519 This is just a bare minimum; it's best to adjust all of the regular
8520 expressions to ensure that MH-E and highlighting perform well.
8521
8522 @node Procmail, Odds and Ends, Scan Line Formats, Top
8523 @appendix Reading Mailing Lists Effectively
8524
8525 @cindex @command{procmail}
8526 @cindex @command{slocal}
8527 @cindex Gnus
8528 @cindex MH commands, @command{slocal}
8529 @cindex Unix commands, @command{procmail}
8530 @cindex mailing lists, reading
8531
8532 This appendix explains how to use @uref{http://www.procmail.org/,
8533 procmail} to file mail from mailing lists into folders which can then
8534 be read easily with MH-E@footnote{The MH equivalent, @command{slocal},
8535 can be used as well, but procmail is more flexible and more packages
8536 exist for procmail than for slocal.}. Some mailing lists have such
8537 high traffic that Gnus must be used and I discuss how to use Gnus
8538 side-by-side with MH-E.
8539
8540 @cindex @file{.procmailrc}
8541 @cindex files, @file{.procmailrc}
8542
8543 First, I'll describe how to put mail from your mailing lists directly
8544 into an MH folder using @command{procmail}. First, add the following
8545 to @file{~/.procmailrc}. While the logging variables aren't strictly
8546 necessary, they are extremely useful.
8547
8548 @smallexample
8549 [1] # Update PATH so procmail can find myrcvstore, rcvstore and mhparam.
8550 [2] PATH=$PATH:/usr/lib/mh:/usr/bin/mh:$HOME/bin
8551 [3]
8552 [4] # Point LOGFILE at the actual log file.
8553 [5] LOGFILE=$HOME/.procmail.log
8554 [6]
8555 [7] # This setting provides just the right amount of information.
8556 [8] LOGABSTRACT=all
8557 [9]
8558 [10] # Uncomment the following line to see how your patterns match.
8559 [11] #VERBOSE=yes
8560 [12]
8561 [13] # Place mail sent to any MH-E mailing list in +mh-e.
8562 [14] :0 w: mh-e$LOCKEXT
8563 [15] * ^TO.*mh-e-.*@@.*sourceforge.net
8564 [16] | myrcvstore -create +mh-e
8565 @end smallexample
8566
8567 @cindex @command{rcvstore}
8568 @cindex MH commands, @command{rcvstore}
8569
8570 Line 14 creates a lock file in your mail directory based upon the name
8571 of the folder. This is done because @command{rcvstore} does not
8572 perform locking. While this lock file will prevent @command{procmail}
8573 from writing to a folder concurrently, there is a slight chance that
8574 you might lose a message if you're performing operations on a folder
8575 at the same time @command{rcvstore} is placing a message there. You
8576 have been warned. Now that that disclaimer is out of the way, note
8577 that I've been using this set-up for over a decade and haven't lost
8578 anything to my knowledge@footnote{See
8579 @uref{https://savannah.nongnu.org/bugs/?func=detailbug&bug_id=4361&group_id=2166,
8580 Savannah issue #4361} to see if @command{rcvstore} locking is still an
8581 issue.}.
8582
8583 @cindex @samp{Unseen-Sequence} MH profile component
8584 @cindex MH profile component, @samp{Unseen-Sequence}
8585
8586 Line 16 uses the following script, @code{myrcvstore}, to massage the
8587 message as described in the comment and file the message in the given
8588 folder@footnote{The @samp{-create} argument wasn't always the default
8589 to @command{rcvstore}.}.
8590
8591 @smallexample
8592 #! /bin/sh
8593
8594 # Accepts a message on standard input and passes it through rcvstore
8595 # after first passing it through any filters. All arguments are passed
8596 # on to rcvstore.
8597
8598 # Force the "From user date" to become part of header. One reason this
8599 # is done is because the presence of the From field confuses dist so
8600 # that dist adds a new header, rather than using the existing header.
8601 # Note that this should not be done for any message that goes into a
8602 # Gnus incoming file (Gnus will thrown an error) nor should it be
8603 # applied to any message that goes to the system mailbox because the
8604 # entire mailbox will be incorporated as a single message.
8605 formail -c -z -R 'From ' X-Envelope-From: |
8606 rcvstore $@@
8607 @end smallexample
8608
8609 If your version of @command{rcvstore} doesn't add messages to the
8610 @samp{unseen} sequence by default, add the following line to your MH
8611 profile:
8612
8613 @smallexample
8614 Unseen-Sequence: unseen
8615 @end smallexample
8616
8617 Now view your new messages with the speedbar (@pxref{Speedbar}) or with
8618 @kbd{F n} (@code{mh-index-new-messages}). @xref{Folders}.
8619
8620 If you're on a mailing list that is so voluminous that it is
8621 impossible to read every message, it usually better to read the
8622 mailing list like a newsgroup in a news reader. Emacs has a built-in
8623 newsreader called Gnus. The remainder of this appendix talks about how
8624 to use Gnus with an MH message store. The version of Gnus that was
8625 used to prepare this manual was 5.10. Versions 5.8 through 5.10 should
8626 work but versions prior to 5.8 use different options.
8627
8628 This table contains a list of Gnus options that you will have to
8629 modify. Note that for them to become accessible, you'll have to load
8630 @file{nnml.el} first. This can be done with @kbd{M-x load-library
8631 @key{RET} nnml @key{RET}}.
8632
8633 @vtable @code
8634 @item gnus-secondary-select-methods
8635 Select the @samp{nnml} value. This select method uses directories for
8636 folders and individual files for messages, just like MH@. You do not
8637 have to set an address.
8638 @c -------------------------
8639 @item mail-sources
8640 Select the @samp{Several files in a directory} value, check the
8641 @samp{Path} box and enter @file{~/Mail} to tell Gnus where to find
8642 your mail.
8643 @c -------------------------
8644 @vindex mail-user-agent
8645 @item message-mail-user-agent
8646 In order to send mail within Gnus using MH-E, set this option to
8647 @samp{mail-user-agent} and set the @code{mail-user-agent} option to
8648 @samp{Emacs interface to MH}.
8649 @c -------------------------
8650 @item nnmail-keep-last-article
8651 Since Gnus keeps track of which messages you have read, it would be
8652 bad if Gnus expired the last message, for example, message 100, and
8653 @command{rcvstore} gave the next new message number 1. Gnus would then
8654 ignore it since it thinks that you've read messages 1--100. Turning on
8655 this option ensures that the last message is never removed thereby
8656 eliminating this problem.
8657 @end vtable
8658
8659 Next add the following to @file{~/.procmailrc}. If you don't subscribe
8660 to the GnuCash mailing list, substitute one to which you are
8661 subscribed.
8662
8663 @smallexample
8664 PATH=$PATH:/usr/bin/mh
8665 MAILDIR=$HOME/`mhparam Path`
8666 # Place mail sent to the GnuCash mailing list in gnucash.spool, where
8667 # Gnus will pick it up.
8668 :0:
8669 * ^TO.*gnucash.*@@.*gnucash.org
8670 gnucash.spool
8671 @end smallexample
8672
8673 Wait for some messages to appear in @file{gnucash.spool} and run Gnus
8674 with @kbd{M-x gnus @key{RET}}. To view the folder created in the
8675 example above, you would tell Gnus about it the first time only with
8676 @kbd{G m gnucash @key{RET} nnml @key{RET}}. In MH-E, this folder is
8677 known as @samp{+gnucash}.
8678
8679 @node Odds and Ends, History, Procmail, Top
8680 @appendix Odds and Ends
8681
8682 This appendix covers a few topics that don't fit elsewhere. Here I
8683 tell you how to report bugs and how to get on the MH-E mailing lists.
8684 I also point out some additional sources of information.
8685
8686 @menu
8687 * Bug Reports::
8688 * Mailing Lists::
8689 * MH FAQ and Support::
8690 * Getting MH-E::
8691 @end menu
8692
8693 @node Bug Reports, Mailing Lists, Odds and Ends, Odds and Ends
8694 @appendixsec Bug Reports
8695
8696 @cindex bugs
8697 @cindex SourceForge
8698 @kindex M-x mh-version
8699
8700 Bug reports should be filed at
8701 @uref{https://sourceforge.net/p/mh-e/bugs/, SourceForge}. You need to
8702 be a SourceForge user to submit bug reports, but this is easy enough
8703 to do that it shouldn't be a restriction for you. Please include the
8704 output of @kbd{M-x mh-version} (@pxref{Miscellaneous}) in any bug
8705 report you send unless you're 110% positive we won't ask for it.
8706
8707 @node Mailing Lists, MH FAQ and Support, Bug Reports, Odds and Ends
8708 @appendixsec MH-E Mailing Lists
8709
8710 @cindex SourceForge
8711 @cindex mailing lists
8712
8713 There are several mailing lists for MH-E@. They are @i{mh-e-users at
8714 lists.sourceforge.net}, @i{mh-e-announce at lists.sourceforge.net},
8715 and @i{mh-e-devel at lists.sourceforge.net}. You can subscribe or view
8716 the archives at @uref{https://sourceforge.net/p/mh-e/mailman/,
8717 SourceForge}. Do not report bugs on these lists; please submit them
8718 via SourceForge (@pxref{Bug Reports}).
8719
8720 @node MH FAQ and Support, Getting MH-E, Mailing Lists, Odds and Ends
8721 @appendixsec MH FAQ and Support
8722
8723 @cindex FAQ
8724 @cindex MH FAQ
8725
8726 The article @uref{http://www.newt.com/faq/mh.html, @cite{MH Frequently
8727 Asked Questions (FAQ) with Answers}} appears monthly in the newsgroup
8728 @samp{comp.mail.mh}. While very little is there that deals with MH-E
8729 specifically, there is an incredible wealth of material about MH
8730 itself which you will find useful.
8731
8732 @cindex support
8733
8734 You can find FAQs on MH-E by searching for @i{labels:support} on the
8735 @uref{https://sourceforge.net/p/mh-e/bugs/search/?q=labels%3Asupport,
8736 Tickets} page on SourceForge. If you don't find the answer to your
8737 question, file a ticket and your question will become a new FAQ!
8738
8739 @node Getting MH-E, , MH FAQ and Support, Odds and Ends
8740 @appendixsec Getting MH-E
8741
8742 @cindex MH-E, obtaining
8743 @cindex getting MH-E
8744 @cindex obtaining MH-E
8745
8746 Because MH-E is undergoing a phase of sustained growth, the version of
8747 MH-E in your Emacs is likely to be out of date although it is most
8748 likely to be more up to date than the copy that comes with the MH
8749 distribution in @file{miscellany/mh-e}.
8750
8751 @cindex change log
8752 @cindex release notes
8753
8754 New MH-E releases are always available for downloading at
8755 @uref{https://sourceforge.net/projects/mh-e/files/, SourceForge}
8756 before they appear in an Emacs release. You can read the release notes
8757 on that page to determine if the given release of MH-E is already
8758 installed in your version of Emacs. You can also read the change log
8759 to see if you are interested in what the given release of MH-E has to
8760 offer (although we have no doubt that you will be extremely interested
8761 in all new releases).
8762
8763 @cindex Debian
8764
8765 If you use Debian, you can install the Debian
8766 @uref{http://packages.debian.org/unstable/mail/mh-e, mh-e package}
8767 instead.
8768
8769 @cindex files, @samp{MH-E-NEWS}
8770 @cindex files, @samp{README}
8771 @cindex news
8772 @cindex @samp{MH-E-NEWS}
8773 @cindex @samp{README}
8774 @kindex M-x mh-version
8775
8776 After you download and extract the MH-E tarball, read the
8777 @file{README} file and @file{MH-E-NEWS}. These correspond to the
8778 release notes and change log mentioned above. The file @file{README}
8779 contains instructions on installing MH-E@. If you're already running
8780 Emacs, please quit that session and start again to load in the new
8781 MH-E@. Check that you're running the new version with the command
8782 @kbd{M-x mh-version}.
8783
8784 @cindex contributed software
8785 @cindex manual
8786 @cindex documentation
8787
8788 In addition to the mh-e package, the
8789 @uref{https://sourceforge.net/projects/mh-e/files/, SourceForge} site
8790 also contains doc and contrib packages. The former is the latest
8791 release of this manual, and the latter contains a few contributed
8792 packages you might find useful.
8793
8794 @node History, GFDL, Odds and Ends, Top
8795 @appendix History of MH-E
8796
8797 @cindex Bill Wohler
8798 @cindex Brian Reid
8799 @cindex Gildea, Stephen
8800 @cindex Jim Larus
8801 @cindex Larus, Jim
8802 @cindex MH-E, versions
8803 @cindex Reid, Brian
8804 @cindex SourceForge
8805 @cindex Stephen Gildea
8806 @cindex Wohler, Bill
8807 @cindex history of MH-E
8808 @cindex versions of MH-E
8809
8810 MH-E was originally written by Brian Reid in 1983 and has changed
8811 hands several times since then. Jim Larus wanted to do something
8812 similar for GNU Emacs, and ended up completely rewriting it that same
8813 year. In 1989, Stephen Gildea picked it up and added many
8814 improvements. Bill Wohler then took over in 2000 and moved its
8815 development to @uref{http://sourceforge.net/, SourceForge} where it
8816 lives today.
8817
8818 @menu
8819 * From Brian Reid::
8820 * From Jim Larus::
8821 * From Stephen Gildea::
8822 * From Bill Wohler::
8823 @end menu
8824
8825 @node From Brian Reid, From Jim Larus, History, History
8826 @appendixsec From Brian Reid
8827
8828 @cindex Brian Reid
8829 @cindex Reid, Brian
8830
8831 One day in 1983 I got the flu and had to stay home from work for three
8832 days with nothing to do. I used that time to write MHE@. The
8833 fundamental idea behind MHE was that it was a ``puppeteer'' driving
8834 the MH programs underneath it. MH had a model that the editor was
8835 supposed to run as a sub-process of the mailer, which seemed to me at
8836 the time to be the tail wagging the dog. So I turned it around and
8837 made the editor drive the MH programs. I made sure that the UCI people
8838 (who were maintaining MH at the time) took in my changes and made them
8839 stick.
8840
8841 Today, I still use my own version of MHE because I don't at all like
8842 the way that GNU MH-E works and I've never gotten to be good enough at
8843 hacking Emacs Lisp to make GNU MH-E do what I want. The Gosling-emacs
8844 version of MHE and the GNU Emacs version of MH-E have almost nothing
8845 in common except similar names. They work differently, have different
8846 conceptual models, and have different key bindings@footnote{After
8847 reading this article, I questioned Brian about his version of MHE, and
8848 received some great ideas for improving MH-E such as a dired-like
8849 method of selecting folders; and removing the prompting when sending
8850 mail, filling in the blanks in the draft buffer instead. I passed them
8851 on to Stephen Gildea, the current maintainer, and he was excited about
8852 the ideas as well. Perhaps one day, MH-E will again resemble MHE
8853 (draft form editing was introduced in version 7.4).}.
8854
8855 Brian Reid, June 1994
8856
8857 @node From Jim Larus, From Stephen Gildea, From Brian Reid, History
8858 @appendixsec From Jim Larus
8859
8860 @cindex Jim Larus
8861 @cindex Larus, Jim
8862
8863 Brian Reid, while at CMU or shortly after going to Stanford wrote a
8864 mail reading program called MHE for Gosling Emacs. It had much the
8865 same structure as MH-E (i.e., invoked MH programs), though it was
8866 simpler and the commands were slightly different. Unfortunately, I no
8867 longer have a copy so the differences are lost in the mists of time.
8868
8869 In '82--83, I was working at BBN and wrote a lot of mlisp code in
8870 Gosling Emacs to make it look more like Tennex Emacs. One of the
8871 packages that I picked up and improved was Reid's mail system. In '83,
8872 I went back to Berkeley. About that time, Stallman's first version of
8873 GNU Emacs came out and people started to move to it from Gosling Emacs
8874 (as I recall, the transition took a year or two). I decided to port
8875 Reid's MHE and used the mlisp to Emacs Lisp translator that came with
8876 GNU Emacs. It did a lousy job and the resulting code didn't work, so I
8877 bit the bullet and rewrote the code by hand (it was a lot smaller and
8878 simpler then, so it took only a day or two).
8879
8880 Soon after that, MH-E became part of the standard Emacs distribution
8881 and suggestions kept dribbling in for improvements. MH-E soon reached
8882 sufficient functionality to keep me happy, but I kept on improving it
8883 because I was a graduate student with plenty of time on my hands and
8884 it was more fun than my dissertation. In retrospect, the one thing
8885 that I regret is not writing any documentation, which seriously
8886 limited the use and appeal of the package.
8887
8888 @cindex @command{xmh}, in MH-E history
8889
8890 In '89, I came to Wisconsin as a professor and decided not to work on
8891 MH-E@. It was stable, except for minor bugs, and had enough
8892 functionality, so I let it be for a few years. Stephen Gildea of BBN
8893 began to pester me about the bugs, but I ignored them. In 1990, he
8894 went off to the X Consortium, said good bye, and said that he would
8895 now be using @command{xmh}. A few months later, he came back and said
8896 that he couldn't stand @command{xmh} and could I put a few more bug fixes
8897 into MH-E@. At that point, I had no interest in fixing MH-E, so I gave
8898 the responsibility of maintenance to him and he has done a fine job
8899 since then.
8900
8901 Jim Larus, June 1994
8902
8903 @node From Stephen Gildea, From Bill Wohler, From Jim Larus, History
8904 @appendixsec From Stephen Gildea
8905
8906 @cindex Gildea, Stephen
8907 @cindex Stephen Gildea
8908
8909 In 1987 I went to work for Bolt Beranek and Newman, as Jim had before
8910 me. In my previous job, I had been using RMAIL, but as my folders tend
8911 to run large, I was frustrated with the speed of RMAIL@. However, I
8912 stuck with it because I wanted the GNU Emacs interface. I am very
8913 familiar and comfortable with the Emacs interface (with just a few
8914 modifications of my own) and dislike having to use applications with
8915 embedded editors; they never live up to Emacs.
8916
8917 MH is the mail reader of choice at BBN, so I converted to it. Since I
8918 didn't want to give up using an Emacs interface, I started using MH-E@.
8919 As is my wont, I started hacking on it almost immediately. I first
8920 used version 3.4m. One of the first features I added was to treat the
8921 folder buffer as a file-visiting buffer: you could lock it, save it,
8922 and be warned of unsaved changes when killing it. I also worked to
8923 bring its functionality a little closer to RMAIL@. Jim Larus was very
8924 cooperative about merging in my changes, and my efforts first appeared
8925 in version 3.6, distributed with Emacs 18.52 in 1988. Next I decided
8926 MH-E was too slow and optimized it a lot. Version, 3.7, distributed
8927 with Emacs 18.56 in 1990, was noticeably faster.
8928
8929 When I moved to the X Consortium I became the first person there to
8930 not use xmh. (There is now one other engineer there using MH-E@.) About
8931 this point I took over maintenance of MH-E from Jim and was finally
8932 able to add some features Jim hadn't accepted, such as the backward
8933 searching undo. My first release was 3.8 (Emacs 18.58) in 1992.
8934
8935 Now, in 1994, we see a flurry of releases, with both 4.0 and 5.0.
8936 Version 4.0 added many new features, including background folder
8937 collection and support for composing @sc{mime} messages. (Reading
8938 @sc{mime} messages remains to be done, alas.) While writing this book,
8939 Bill Wohler gave MH-E its closest examination ever, uncovering bugs
8940 and inconsistencies that required a new major version to fix, and so
8941 version 5 was released.
8942
8943 Stephen Gildea, June 1994
8944
8945 @node From Bill Wohler, , From Stephen Gildea, History
8946 @appendixsec From Bill Wohler
8947
8948 @cindex Wohler, Bill
8949 @cindex Bill Wohler
8950
8951 The preface originally included the following text which I use to
8952 begin my story:
8953
8954 @quotation
8955 But it's important to note a brief history of MH-E.
8956
8957 @w{Version 3} was prevalent through the @w{Emacs 18} and early
8958 @w{Emacs 19} years. Then @w{Version 4} came out (@w{Emacs 19.23}),
8959 which introduced several new and changed commands. Next, @w{Version
8960 5.0} was released, which fixed some bugs and incompatibilities, and
8961 was incorporated into @w{Emacs 19.29}.
8962 @end quotation
8963
8964 After a long break, Stephen handed the reins over to me in 2000. I
8965 moved the project to a new site called SourceForge and organized a
8966 great team of developers. Our first release in late 2001 was version
8967 6. It appeared around the time of Emacs 21.2 and had menus and tool
8968 bar buttons.
8969
8970 Then, indexed searches, improved MIME handling, a speedbar, multiple
8971 identities, alias completion, an index view of unseen messages, spam
8972 software support, Face and X-Image-URL header field support, Fcc
8973 completion, arbitrary range handling, and draft form editing were
8974 introduced in the version 7 series around the time of Emacs 21.4
8975 (2004). Still, Emacs itself contained version 5 of MH-E released back
8976 in 1994.
8977
8978 Version 8 development was mostly driven by the rewrite of the manual.
8979 It also brought GNU mailutils MH support, S/MIME support, picon
8980 support, and an improved interface for hiding header fields. The CVS
8981 repository was migrated from SourceForge to Savannah (only for those
8982 files that were already part of Emacs) and the software was completely
8983 reorganized to push back two decades of entropy. Version 8 appeared in
8984 Emacs 22.1 in 2006.
8985
8986 Development was then quiet for a couple of years. Emacs 23.1, which is
8987 due out in 2009, will contain version 8.1. This version includes a few
8988 new features and several bug fixes.
8989
8990 Bill Wohler, August 2008
8991
8992 @node GFDL, GPL, History, Top
8993 @appendix GNU Free Documentation License
8994 @include doclicense.texi
8995
8996 @node GPL, Key Index, GFDL, Top
8997 @appendix GNU General Public License
8998 @include gpl.texi
8999
9000 @node Key Index, Command Index, GPL, Top
9001 @unnumbered Key (Character) Index
9002 @printindex ky
9003
9004 @node Command Index, Option Index, Key Index, Top
9005 @unnumbered Command Index
9006 @printindex fn
9007
9008 @node Option Index, Concept Index, Command Index, Top
9009 @unnumbered Option (Variable) Index
9010 @printindex vr
9011
9012 @node Concept Index, , Option Index, Top
9013 @unnumbered Concept Index
9014 @printindex cp
9015
9016 @bye
9017
9018 @c Ispell Helpers
9019 @c
9020 @c The following are words that ispell should ignore that would not
9021 @c normally be in a dictionary (global or personal). Be careful not to
9022 @c include words here that could potentially be typos of other words
9023 @c (such as url, elisp, or MHE).
9024 @c
9025 @c LocalWords: CTRL ESC SPC f's
9026 @c LocalWords: addr Aliasfile alist
9027 @c LocalWords: Baushke Bcc BBN Beranek bogofilter bogofilter's
9028 @c LocalWords: cmd CMU contrib cron
9029 @c LocalWords: DesBrisay Dcc devel dir dired docstring filll forw
9030 @c LocalWords: GECOS Gildea Gildea's Ginnean GnuCash goto gnuserv htm
9031 @c LocalWords: ImageMagick inbox ispell keychain
9032 @c LocalWords: Larus licensor LocalWords lookup lpr
9033 @c LocalWords: makeinfo mairix mbox mh mhbuild mhl mhpath mlisp
9034 @c LocalWords: MML msg multipart
9035 @c LocalWords: Namazu NIS nenscript nnml num
9036 @c LocalWords: packmbox passphrase pathname prev procmail prog repl
9037 @c LocalWords: slocal sortm SpamAssassin spammers SpamProbe SpamProbe's
9038 @c LocalWords: sublicense supercite speedbar
9039 @c LocalWords: Tennex texi texinfo Thelen thelenm
9040 @c LocalWords: UCI undeleted whatnow wohler xmh ypcat
9041 @c
9042 @c See http://www.oreilly.com/oreilly/author/stylesheet.html.
9043 @c See http://en.wikipedia.org/.
9044 @c
9045 @c Note the lowercase mh which is needed to avoid hits in the
9046 @c functions and variables. Occasionally, check for accidental
9047 @c inclusion of mh in text by uncommenting the following and executing
9048 @c it with C-x C-e. You want to see "Search failed"
9049 @c (let ((case-fold-search nil))
9050 @c (goto-char (point-min))
9051 @c (search-forward-regexp "^mh\\( \\|$\\)"))
9052 @c
9053 @c An extremely useful setting for texinfo-mode-hook is:
9054 @c (add-to-list
9055 @c 'ispell-skip-region-alist
9056 @c (list
9057 @c (concat "\\(@\\(small\\)?\\(example\\|lisp\\)"
9058 @c "\\(@\\([irw]\\|code\\|var\\){[^}]+}\\|"
9059 @c "@[@{}.]\\|"
9060 @c "[^@]\\|"
9061 @c "@\\(end \\)?group\\|"
9062 @c "@\\(end \\)?cartouche\\)+"
9063 @c "@end \\(small\\)?\\(example\\|lisp\\)\\|"
9064 @c "@\\(code\\|command\\|file\\|kbd\\|sc\\){[^}]+}\\|"
9065 @c "^@end [a-z]+$\\|"
9066 @c "^@\\([fv]\\|print\\)index .*$\\|"
9067 @c "@uref{[^,]+,\\|"
9068 @c "@[a-z]+\\|"
9069 @c "/[a-z.]+[/}]\\)")))))
9070 @c
9071 @c Cross References
9072 @c
9073 @c See existing cross-references to the Emacs manual and the Emacs
9074 @c Lisp manual (search for ``GNU Emacs Manual'' and ``GNU
9075 @c Emacs Lisp Reference Manual'' respectively).
9076
9077 @c @ftable Sorting
9078 @c
9079 @c As per index (sort of): Punctuation, keyboard characters (such as
9080 @c RET and BS) upper and lowercase mixed (lower comes before
9081 @c uppercase), control characters go with uppercase C, meta characters
9082 @c go with uppercase M.
9083 @c In some cases, the sort isn't strictly ASCII.
9084 @c For example, SPC (mh-page-msg) reads better before BS
9085 @c (mh-previous-page) and . (mh-show) is better before ,
9086 @c (mh-header-display).
9087
9088 @c @vtable Sorting
9089 @c
9090 @c Alphabetical, pull hooks into their own table.
9091
9092 @c Local Variables:
9093 @c sentence-end-double-space: nil
9094 @c End: