]> code.delx.au - gnu-emacs/blob - doc/misc/mh-e.texi
(Getting Started): Describe $MH.
[gnu-emacs] / doc / misc / mh-e.texi
1 \input texinfo @c -*-texinfo-*-
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
7 @settitle The MH-E Manual
8 @c %**end of header
9
10 @c Version of the software and manual.
11 @set VERSION 8.1
12 @c Edition of the manual. It is either empty for the first edition or
13 @c has the form ", nth Edition" (without the quotes).
14 @set EDITION
15 @set UPDATED 2009-01-02
16 @set UPDATE-MONTH January, 2009
17
18 @c Other variables.
19 @set MH-BOOK-HOME http://rand-mh.sourceforge.net/book/mh
20 @set MH-E-HOME http://mh-e.sourceforge.net/
21
22 @c Copyright
23 @copying
24 This is version @value{VERSION}@value{EDITION} of @cite{The MH-E
25 Manual}, last updated @value{UPDATED}.
26
27 Copyright @copyright{} 1995, 2001, 2002, 2003, 2005, 2006, 2007, 2008, 2009
28 Free Software Foundation, Inc.
29
30 @c This dual license has been agreed upon by the FSF.
31
32 @quotation
33 Permission is granted to copy, distribute and/or modify this document
34 under the terms of either:
35
36 @enumerate a
37 @item
38 the GNU Free Documentation License, Version 1.3 or any later version
39 published by the Free Software Foundation; with no Invariant Sections,
40 with the Front-Cover texts being ``A GNU Manual,'' and with the
41 Back-Cover Texts as in (a) below. A copy of the license is included in
42 the section entitled ``GNU Free Documentation License.''
43
44 (a) The FSF's Back-Cover Text is: ``You have the freedom to copy and
45 modify this GNU manual. Buying copies from the FSF supports it in
46 developing GNU and promoting software freedom.''
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
60 @direntry
61 * MH-E: (mh-e). Emacs interface to the MH mail system.
62 @end direntry
63
64 @c Title Page
65 @setchapternewpage odd
66 @titlepage
67 @title The MH-E Manual
68 @subtitle Version @value{VERSION}@value{EDITION}
69 @subtitle @value{UPDATE-MONTH}
70 @author Bill Wohler
71
72 @c Copyright Page
73 @page
74 @vskip 0pt plus 1filll
75 @insertcopying
76 @end titlepage
77
78 @ifnottex
79 @html
80 <!--
81 @end html
82 @node Top, Preface, (dir), (dir)
83 @top The MH-E Manual
84 @html
85 -->
86 @end html
87 @insertcopying
88 @end ifnottex
89
90 @c Table of Contents
91 @contents
92
93 @html
94 <!--
95 @end html
96
97 @menu
98 * Preface:: Preface
99 * Conventions:: GNU Emacs Terms and Conventions
100 * Getting Started:: Getting Started
101 * Tour Through MH-E:: Tour Through MH-E
102 * Using This Manual:: Using This Manual
103 * Incorporating Mail:: Incorporating Mail
104 * Reading Mail:: Reading Mail
105 * Folders:: Organizing Your Mail with Folders
106 * Sending Mail:: Sending Mail
107 * Editing Drafts:: Editing a Draft
108 * Aliases:: Aliases
109 * Identities:: Identities
110 * Speedbar:: The Speedbar
111 * Menu Bar:: The Menu Bar
112 * Tool Bar:: The Tool Bar
113 * Searching:: Searching Through Messages
114 * Threading:: Viewing Message Threads
115 * Limits:: Limiting Display
116 * Sequences:: Using Sequences
117 * Junk:: Dealing With Junk Mail
118 * Miscellaneous:: Miscellaneous Commands, Variables, and Buffers
119 * Scan Line Formats:: Scan Line Formats
120 * Procmail:: Reading Mailing Lists Effectively
121 * Odds and Ends:: Odds and Ends
122 * History:: History of MH-E
123 * GFDL:: GNU Free Documentation License
124 * GPL:: GNU General Public License
125 * Key Index:: Key (Character) Index
126 * Command Index:: Command Index
127 * Option Index:: Option (Variable) Index
128 * Concept Index:: Concept Index
129
130 @detailmenu
131 --- The Detailed Node Listing ---
132
133 Tour Through MH-E
134
135 * Sending Mail Tour::
136 * Reading Mail Tour::
137 * Processing Mail Tour::
138 * Leaving MH-E::
139 * More About MH-E::
140
141 Using This Manual
142
143 * Options::
144 * Ranges::
145 * Folder Selection::
146
147 Reading Your Mail
148
149 * Viewing::
150 * Viewing Attachments::
151 * HTML::
152 * Digests::
153 * Reading PGP::
154 * Printing::
155 * Files and Pipes::
156 * Navigating::
157 * Miscellaneous Commands and Options::
158
159 Sending Mail
160
161 * Composing::
162 * Replying::
163 * Forwarding::
164 * Redistributing::
165 * Editing Again::
166
167 Editing a Draft
168
169 * Editing Message::
170 * Inserting Letter::
171 * Inserting Messages::
172 * Signature::
173 * Picture::
174 * Adding Attachments::
175 * Sending PGP::
176 * Checking Recipients::
177 * Sending Message::
178 * Killing Draft::
179
180 Odds and Ends
181
182 * Bug Reports::
183 * Mailing Lists::
184 * MH FAQ and Support::
185 * Getting MH-E::
186
187 History of MH-E
188
189 * From Brian Reid::
190 * From Jim Larus::
191 * From Stephen Gildea::
192 * From Bill Wohler::
193
194 @end detailmenu
195 @end menu
196
197 @html
198 -->
199 @end html
200
201 @node Preface, Conventions, Top, Top
202 @unnumbered Preface
203
204 @cindex Emacs
205 @cindex Unix commands, Emacs
206 @cindex preface
207
208 This manual introduces another interface to the MH mail system that is
209 accessible through the GNU Emacs editor, namely, @emph{MH-E}. MH-E is
210 easy to use. I don't assume that you know GNU Emacs or even MH at this
211 point, since I didn't know either of them when I discovered MH-E.
212 However, MH-E was the tip of the iceberg, and I discovered more and
213 more niceties about GNU Emacs and MH@. Now I'm fully hooked on both of
214 them.
215
216 The MH-E package is distributed with GNU Emacs@footnote{Version
217 @value{VERSION} of MH-E will appear in GNU Emacs 23.1. It is supported
218 in GNU Emacs 21 and 22, as well as XEmacs 21 (except for versions
219 21.5.9-21.5.16). It is compatible with MH versions 6.8.4 and higher,
220 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 an online 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/,
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 @cindex @cite{MH & nmh: Email for Users & Programmers}
250 @cindex MH book
251 @cindex info
252 @kindex C-h i
253
254 This manual is available in both Info and online formats. The Info
255 version is distributed with Emacs and can be accessed with the
256 @command{info} command (@samp{info mh-e}) or within Emacs (@kbd{C-h i
257 m mh-e @key{RET}}). The online version is available at
258 @uref{http://mh-e.sourceforge.net/manual/, SourceForge}. Another great
259 online resource is the book @uref{http://www.ics.uci.edu/~mh/book/,
260 @cite{MH & nmh: Email for Users & Programmers}} (also known as
261 @dfn{the MH book}).
262
263 I hope you enjoy this manual! If you have any comments, or suggestions
264 for this document, please let me know.
265
266 @cindex Bill Wohler
267 @cindex Wohler, Bill
268
269 @noindent
270 Bill Wohler <@i{wohler at newt.com}>@*
271 8 February 1995@*
272 24 February 2006
273
274 @node Conventions, Getting Started, Preface, Top
275 @chapter GNU Emacs Terms and Conventions
276
277 @cindex Emacs
278 @cindex Emacs, conventions
279 @cindex Emacs, terms
280 @cindex Unix commands, Emacs
281 @cindex conventions, Emacs
282 @cindex terms, Emacs
283
284 If you're an experienced Emacs user, you can skip the following
285 conventions and definition of terms and go directly to the next
286 section (@pxref{Getting Started}).
287
288 @cindex Emacs commands
289 @cindex MH commands
290 @cindex Unix commands
291 @cindex commands
292 @cindex commands, MH
293 @cindex commands, Unix
294 @cindex commands, shell
295 @cindex functions
296 @cindex shell commands
297
298 In general, @dfn{functions} in this text refer to Emacs Lisp functions
299 that one would call from within Emacs Lisp programs (for example,
300 @code{(mh-inc-folder)}). On the other hand, @dfn{commands} are those
301 things that are run by the user, such as @kbd{i} or @kbd{M-x
302 mh-inc-folder}. Programs outside of Emacs are specifically called MH
303 commands, shell commands, or Unix commands.
304
305 @cindex conventions, key names
306 @cindex key names
307
308 The conventions for key names are as follows:
309
310 @table @kbd
311 @item C-x
312 Hold down the @key{CTRL} (Control) key and press the @kbd{x} key.
313 @c -------------------------
314 @item M-x
315 Hold down the @key{META} or @key{ALT} key and press the @kbd{x} key.
316
317 Since some keyboards don't have a @key{META} key, you can generate
318 @kbd{M-x}, for example, by pressing @key{ESC} (Escape),
319 @emph{releasing it}, and then pressing the @kbd{x} key.
320 @c -------------------------
321 @item @key{RET}
322 Press the @key{RETURN} or @key{ENTER} key. This is normally used to
323 complete a command.
324 @c -------------------------
325 @item @key{SPC}
326 Press the space bar.
327 @c -------------------------
328 @item @key{TAB}
329 Press the @key{TAB} key.
330 @c -------------------------
331 @item @key{DEL}
332 Press the @key{DELETE} key.
333 @c -------------------------
334 @item @key{BS}
335 Press the @key{BACKSPACE} key@footnote{If you are using Version 20 or
336 earlier of Emacs, you will need to use the @key{DEL} key.}.
337 @end table
338
339 @cindex Emacs, prefix argument
340 @cindex prefix argument
341 @kindex C-u
342
343 A @dfn{prefix argument} allows you to pass an argument to any Emacs
344 function. To pass an argument, type @kbd{C-u} before the Emacs command
345 or keystroke. Numeric arguments can be passed as well. For example, to
346 insert five f's, use @kbd{C-u 5 f}. There is a default of four when
347 using @kbd{C-u}, and you can use multiple prefix arguments to provide
348 arguments of powers of four. To continue our example, you could insert
349 four f's with @kbd{C-u f}, 16 f's with @kbd{C-u C-u f}, 64 f's with
350 @kbd{C-u C-u C-u f}, and so on. Numeric and valueless negative
351 arguments can also be inserted with the @key{META} key. Examples
352 include @kbd{M-5} to specify an argument of 5, or @kbd{M--} which
353 specifies a negative argument with no particular value.
354
355 @sp 1
356 @center @strong{NOTE}
357
358 @quotation
359 The prefix @kbd{C-u} or @kbd{M-} is not necessary in MH-E's MH-Folder
360 mode (@pxref{Reading Mail Tour}). In this mode, simply enter the
361 numerical argument before entering the command.
362 @end quotation
363 @sp 1
364
365 @cindex @file{.emacs}
366 @cindex Emacs, variables
367 @cindex files, @file{.emacs}
368 @cindex variables
369 @findex setq
370
371 Emacs uses @dfn{variables} to hold values. These can be changed via
372 calls to the function @code{setq} in @file{~/.emacs}.
373
374 @cindex Emacs, options
375 @cindex options
376 @findex customize-group
377 @findex customize-option
378
379 Variables in MH-E that are normally modified by the user are called
380 @dfn{options} and are modified through the customize functions (such
381 as @kbd{M-x customize-option} or @kbd{M-x customize-group}).
382 @ifnothtml
383 @xref{Easy Customization,,,emacs,The GNU Emacs Manual}, in @cite{The
384 GNU Emacs Manual}.
385 @end ifnothtml
386 @ifhtml
387 See section
388 @uref{http://www.gnu.org/software/emacs/manual/html_node/Easy-Customization.html,
389 Easy Customization} in @cite{The GNU Emacs Manual}.
390 @end ifhtml
391 @xref{Options}.
392
393 @cindex Emacs, faces
394 @cindex faces
395 @cindex highlighting
396 @findex customize-face
397
398 You can specify various styles for displaying text using @dfn{faces}.
399 MH-E provides a set of faces that you can use to personalize the look
400 of your MH-E buffers. Use the command @kbd{M-x customize-face} to do
401 this.
402 @ifnothtml
403 @xref{Face Customization,,,emacs,The GNU Emacs Manual}, in @cite{The
404 GNU Emacs Manual}.
405 @end ifnothtml
406 @ifhtml
407 See section
408 @uref{http://www.gnu.org/software/emacs/manual/html_node/Face-Customization.html,
409 Face Customization} in @cite{The GNU Emacs Manual}.
410 @end ifhtml
411
412 @cindex abnormal hooks
413 @cindex hooks
414 @cindex normal hooks
415 @findex add-hook
416 @findex customize-option
417
418 Commands often offer @dfn{hooks} which enable you to extend or modify
419 the way a command works.
420 @ifnothtml
421 @ref{Hooks, , Hooks, emacs, The GNU Emacs Manual}, in @cite{The GNU
422 Emacs Manual}
423 @end ifnothtml
424 @ifhtml
425 See section
426 @uref{http://www.gnu.org/software/emacs/manual/html_node/Hooks.html,
427 Hooks} in @cite{The GNU Emacs Manual}
428 @end ifhtml
429 for a description about @dfn{normal hooks} and @dfn{abnormal hooks}.
430 MH-E uses normal hooks in nearly all cases, so you can assume that we
431 are talking about normal hooks unless we explicitly mention that a
432 hook is abnormal. We also follow the conventions described in that
433 section: the name of the abnormal hooks end in @code{-hooks} and all
434 the rest of the MH-E hooks end in @code{-hook}. You can add hooks with
435 either @code{customize-option} or @code{add-hook}.
436
437 @cindex Emacs, mark
438 @cindex Emacs, point
439 @cindex Emacs, region
440 @cindex mark
441 @cindex point
442 @cindex region
443 @kindex C-@@
444 @kindex C-@key{SPC}
445
446 There are several other terms that are used in Emacs that you should
447 know. The @dfn{point} is where the cursor currently is. You can save
448 your current place in the file by setting a @dfn{mark}. This operation
449 is useful in several ways. The mark can be later used when defining a
450 @dfn{region}, which is the text between the point and mark. Many
451 commands operate on regions, such as those for deleting text or
452 filling paragraphs. A mark can be set with @kbd{C-@@} (or
453 @kbd{C-@key{SPC}}).
454
455 @cindex completion
456 @cindex Emacs, completion
457 @cindex Emacs, file completion
458 @cindex Emacs, folder completion
459 @cindex Emacs, minibuffer
460 @cindex file completion
461 @cindex folder completion
462 @cindex minibuffer
463 @kindex SPC
464 @kindex TAB
465
466 The @dfn{minibuffer} is the bottom line of the Emacs window, where all
467 prompting and multiple-character input is directed. You can use
468 @dfn{completion} to enter values such as folders. Completion means
469 that Emacs fills in text for you when you type @key{SPC} or @key{TAB}.
470 A second @key{SPC} or @key{TAB} will list all possibilities at that
471 point.
472 @ifnothtml
473 @xref{Completion, , Completion, emacs, The GNU Emacs Manual}.
474 @end ifnothtml
475 @ifhtml
476 See the section
477 @uref{http://www.gnu.org/software/emacs/manual/html_node/Completion.html,
478 Completion} in @cite{The GNU Emacs Manual}.
479 @end ifhtml
480 Note that @key{SPC} cannot be used for completing filenames and
481 folders.
482
483 @findex help-with-tutorial
484 @kindex C-h t
485 @kindex M-x
486
487 The minibuffer is also where you enter Emacs function names after
488 typing @kbd{M-x}. For example, in the preface, I mentioned that you
489 could obtain help with @kbd{C-h t} (@code{help-with-tutorial}). What
490 this means is that you can get a tutorial by typing either @kbd{C-h t}
491 or @kbd{M-x help-with-tutorial}. In the latter case, you are prompted
492 for @samp{help-with-tutorial} in the minibuffer after typing
493 @kbd{M-x}.
494
495 @cindex ~
496
497 The @samp{~} notation in filenames represents your home directory.
498 This notation is used by many shells including @command{bash},
499 @code{tcsh}, and @command{csh}. It is analogous to the environment
500 variable @samp{$HOME}. For example, @file{~/.emacs} can be written
501 @file{$HOME/.emacs} or using the absolute path as in
502 @file{/home/wohler/.emacs} instead.
503
504 @cindex Emacs, interrupting
505 @cindex Emacs, quitting
506 @cindex interrupting
507 @cindex quitting
508
509 @i{In case of trouble:} Emacs can be interrupted at any time with
510 @kbd{C-g}. For example, if you've started a command that requests that
511 you enter something in the minibuffer, but then you change your mind,
512 type @kbd{C-g} and you'll be back where you started. If you want to
513 exit Emacs entirely, use @kbd{C-x C-c}.
514
515 @node Getting Started, Tour Through MH-E, Conventions, Top
516 @chapter Getting Started
517
518 @cindex MH-E, versions
519 @cindex history
520 @cindex versions of MH-E
521
522 Because there are many old versions of MH-E out there, it is important
523 to know which version you have. I'll be talking about @w{Version 8}
524 which is pretty close to @w{Version 6} and @w{Version 7}. It differs
525 from @w{Version 4} and @w{Version 5} and is vastly different from
526 @w{Version 3}. @xref{History}.
527
528 @findex mh-version
529
530 To determine which version of MH-E that you have, enter @kbd{M-x
531 mh-version @key{RET}}. Hopefully it says that you're running
532 @w{Version @value{VERSION}} which is the latest version as of this
533 printing.
534
535 If your version is much older than this, please consider upgrading.
536 You can have your system administrator upgrade the system-wide
537 version, or you can install your own personal version. It's really
538 quite easy. @xref{Getting MH-E}, for instructions for getting and
539 installing MH-E.
540
541 If the @code{mh-version} command displays @samp{No MH variant
542 detected}@footnote{In very old versions of MH-E, you may get the error
543 message, @samp{Cannot find the commands `inc' and `mhl' and the file
544 `components'} if MH-E can't find MH. In this case, you need to update
545 MH-E, and you may need to install MH too. However, newer versions of
546 MH-E are better at finding MH if it is on your system.}, then you need
547 to install MH or tell MH-E where to find MH.
548
549 @cindex Debian
550 @cindex nmh
551 @cindex GNU mailutils MH
552
553 If you don't have MH on your system already, you must install a
554 variant of MH. The Debian mh-e package does this for you automatically
555 (@pxref{Getting MH-E}). Most people use
556 @uref{http://www.nongnu.org/nmh/, nmh}, but you may be interested in
557 trying out @uref{http://www.gnu.org/software/mailutils/, GNU mailutils
558 MH}, which supports IMAP. Your GNU/Linux distribution probably has
559 packages for both of these.
560
561 @cindex @command{install-mh}
562 @cindex MH commands, @command{install-mh}
563 @cindex MH book
564
565 If you've never run MH before, you need to run @command{install-mh}
566 from the shell before you continue. This sets up your personal MH
567 environment@footnote{See the section
568 @uref{@value{MH-BOOK-HOME}/../overall/setup.html, Setting Up MH} in the
569 MH book.}. If you don't, you'll be greeted with the error message:
570 @samp{Install MH and run install-mh before running MH-E}. This is all
571 you need to know about MH to use MH-E, but the more you know about MH,
572 the more you can leverage its power. See the
573 @uref{@value{MH-BOOK-HOME}/../, MH book} to learn more about MH.
574
575 @cindex @samp{Path:} MH profile component
576 @cindex MH profile
577 @cindex MH profile component
578 @cindex MH profile component, @samp{Path:}
579
580 Your MH environment includes your @dfn{MH profile} which is found in
581 the file @file{~/.mh_profile}, or the file named in the environment
582 variable @samp{$MH}. This file contains a number of @dfn{MH
583 profile components}. For example, the @samp{Path:} MH profile
584 component contains the path to your mail directory, which is
585 @file{~/Mail} by default.
586
587 @cindex @command{mhparam}
588 @cindex MH commands, @command{mhparam}
589 @vindex exec-path
590 @vindex mh-path
591 @vindex mh-sys-path
592 @vindex mh-variant
593 @vindex mh-variant-in-use
594
595 There are several options MH-E uses to interact with your MH
596 installation. The option @code{mh-variant} specifies the variant used
597 by MH-E (@pxref{Options}). The default setting of this option is
598 @samp{Auto-detect} which means that MH-E will automatically choose the
599 first of nmh, MH, or GNU mailutils MH that it finds in the directories
600 listed in @code{mh-path} (which you can customize),
601 @code{mh-sys-path}, and @code{exec-path}. If MH-E can't find MH at
602 all, you may have to customize @code{mh-path} and add the directory in
603 which the command @command{mhparam} is located. If, on the other hand,
604 you have both nmh and GNU mailutils MH installed (for example) and
605 @code{mh-variant-in-use} was initialized to nmh but you want to use
606 GNU mailutils MH, then you can set @code{mh-variant} to
607 @samp{gnu-mh}.
608
609 @vindex mh-flists-present-flag
610 @vindex mh-lib
611 @vindex mh-lib-progs
612 @vindex mh-progs
613
614 When @code{mh-variant} is changed, MH-E resets @code{mh-progs},
615 @code{mh-lib}, @code{mh-lib-progs}, @code{mh-flists-present-flag}, and
616 @code{mh-variant-in-use} accordingly.
617
618 @cindex @file{.emacs}
619 @cindex files, @file{.emacs}
620
621 @sp 1
622 @center @strong{NOTE}
623
624 @quotation
625 Prior to version 8, it was often necessary to set some of these
626 variables in @file{~/.emacs}; now it is no longer necessary and can
627 actually cause problems.
628 @end quotation
629 @sp 1
630
631 @cindex MH profile component, @samp{Draft-Folder:}
632 @cindex MH profile component, @samp{Path:}
633 @cindex MH profile component, @samp{Previous-Sequence:}
634 @cindex MH profile component, @samp{Unseen-Sequence:}
635 @cindex @samp{Draft-Folder:} MH profile component
636 @cindex @samp{Path:} MH profile component
637 @cindex @samp{Previous-Sequence:} MH profile component
638 @cindex @samp{Unseen-Sequence:} MH profile component
639 @findex mh-find-path
640 @vindex mh-draft-folder
641 @vindex mh-find-path-hook
642 @vindex mh-inbox
643 @vindex mh-previous-seq
644 @vindex mh-unseen-seq
645 @vindex mh-user-path
646
647 In addition to setting variables that point to MH itself, MH-E also
648 sets a handful of variables that point to where you keep your mail.
649 During initialization, the function @code{mh-find-path} sets
650 @code{mh-user-path} from your @samp{Path:} MH profile component (but
651 defaults to @samp{Mail} if one isn't present), @code{mh-draft-folder}
652 from @samp{Draft-Folder:}, @code{mh-unseen-seq} from
653 @samp{Unseen-Sequence:}, @code{mh-previous-seq} from
654 @samp{Previous-Sequence:}, and @code{mh-inbox} from @samp{Inbox:}
655 (defaults to @samp{+inbox}). The hook @code{mh-find-path-hook} is run
656 after these variables have been set. This hook can be used the change
657 the value of these variables if you need to run with different values
658 between MH and MH-E.
659
660 @node Tour Through MH-E, Using This Manual, Getting Started, Top
661 @chapter Tour Through MH-E
662
663 @cindex introduction
664 @cindex tour
665 @cindex tutorial
666
667 This chapter introduces some of the terms you'll need to know and then
668 takes you on a tour of MH-E@footnote{The keys mentioned in these
669 chapters refer to the default key bindings. If you've changed the
670 bindings, refer to the command summaries at the beginning of each
671 chapter for a mapping between default key bindings and function
672 names.}. When you're done, you'll be able to send, read, and file
673 mail, which is all that a lot of people ever do. But if you're the
674 curious or adventurous type, read the rest of the manual to be able to
675 use all the features of MH-E. I suggest you read this chapter first to
676 get the big picture, and then you can read the manual as you wish.
677
678 @menu
679 * Sending Mail Tour::
680 * Reading Mail Tour::
681 * Processing Mail Tour::
682 * Leaving MH-E::
683 * More About MH-E::
684 @end menu
685
686 @node Sending Mail Tour, Reading Mail Tour, Tour Through MH-E, Tour Through MH-E
687 @section Sending Mail
688
689 @cindex MH-Letter mode
690 @cindex mode
691 @cindex modes, MH-Letter
692 @cindex sending mail
693 @findex mh-smail
694 @kindex M-x mh-smail
695
696 Let's start our tour by sending ourselves a message which we can later
697 read and process. Enter @kbd{M-x mh-smail} to invoke the MH-E program
698 to send messages. Your message appears in an Emacs buffer whose
699 mode@footnote{A @dfn{mode} changes Emacs to make it easier to edit a
700 particular type of text.} is MH-Letter.
701
702 Enter your login name in the @samp{To:} header field. Press the
703 @key{TAB} twice to move the cursor past the @samp{Cc:} field, since no
704 carbon copies are to be sent, and on to the @samp{Subject:} field.
705 Enter @kbd{Test} or anything else that comes to mind.
706
707 Press @key{TAB} again to move the cursor to the body of the message.
708 Enter some text, using normal Emacs commands. You should now have
709 something like this@footnote{If you're running Emacs under the X
710 Window System, then you would also see a menu bar and a tool bar. I've
711 left out the menu bar and tool bar in all of the example screens.}:
712
713 @cartouche
714 @smallexample
715
716
717
718
719
720
721 --:-- *scratch* All L1 (Lisp Interaction)-------------------------
722 To: wohler
723 cc:
724 Subject: Test
725 X-Mailer: MH-E 8.1; nmh 1.1; GNU Emacs 23.1
726 --------
727 This is a test message to get the wheels churning...#
728
729
730 --:** @{draft@} All L5 (MH-Letter)----------------------------------
731 Type C-c C-c to send message, C-C ? for help
732 @end smallexample
733 @end cartouche
734 @i{MH-E message composition window}
735
736 Note the line of dashes that separates the header and the body of the
737 message. It is essential that these dashes (or a blank line) are
738 present or the body of your message will be considered to be part of
739 the header.
740
741 @cindex help
742 @findex describe-mode
743 @kindex C-c ?
744 @kindex C-c C-c
745 @kindex C-h m
746
747 There are several commands specific to MH-Letter mode@footnote{You can
748 get quick help for the commands used most often with @kbd{C-c ?} or
749 more complete help with the @kbd{C-h m} (@code{describe-mode})
750 command.}, but at this time we'll only use @kbd{C-c C-c} to send your
751 message. Type @kbd{C-c C-c} now. That's all there is to it!
752
753 @node Reading Mail Tour, Processing Mail Tour, Sending Mail Tour, Tour Through MH-E
754 @section Receiving Mail
755
756 @cindex @command{inc}
757 @cindex @command{scan}
758 @cindex MH commands, @command{inc}
759 @cindex MH commands, @command{scan}
760 @cindex MH-Folder mode
761 @cindex modes, MH-Folder
762 @cindex reading mail
763 @findex mh-rmail
764 @kindex M-x mh-rmail
765
766 To read the mail you've just sent yourself, enter @kbd{M-x mh-rmail}.
767 This incorporates the new mail and puts the output from
768 @command{inc}@footnote{See the section
769 @uref{@value{MH-BOOK-HOME}/reapre.html, Reading Mail: inc show next
770 prev} in the MH book.} (called @dfn{scan lines} after the MH program
771 @command{scan}@footnote{See the section
772 @uref{@value{MH-BOOK-HOME}/faswsprs.html, Find and Specify with scan
773 pick Ranges Sequences} in the MH book.} which prints a one-line
774 summary of each message) into a buffer called @samp{+inbox} whose
775 major mode is MH-Folder.
776
777 @findex mh-rmail
778 @kindex F r
779 @kindex M-x mh-rmail
780
781 @sp 1
782 @center @strong{NOTE}
783
784 @quotation
785
786 The @kbd{M-x mh-rmail} command will show you only new mail, not mail
787 you have already read. If you were to run this tour again, you would
788 use @kbd{F r} to pull all your messages into MH-E.
789 @end quotation
790 @sp 1
791
792 @kindex @key{RET}
793 @kindex n
794 @kindex p
795
796 You should see the scan line for your message, and perhaps others. Use
797 @kbd{n} or @kbd{p} to move the cursor to your test message and type
798 @key{RET} to read your message. You should see something like:
799
800 @cartouche
801 @smallexample
802 3 t08/24 root received fax files on Wed Aug 24 11:00:13 PDT 1
803 # 4+t08/24 To:wohler Test<<This is a test message to get the wheels
804
805 -:%% @{+inbox/select@} 4 msgs (1-4) Bot L4 (MH-Folder Show)---------
806 To: wohler
807 Subject: Test
808 X-Mailer: MH-E 8.1; nmh 1.1; GNU Emacs 23.1
809 Date: Fri, 17 Mar 2006 10:49:11 -0800
810 From: Bill Wohler <wohler@@stop.mail-abuse.org>
811
812 This is a test message to get the wheels churning...
813
814
815
816 --:-- @{show-+inbox@} 4 All L1 (MH-Show)----------------------------
817
818 @end smallexample
819 @end cartouche
820 @i{After incorporating new messages}
821
822 @kindex @key{DEL}
823 @kindex @key{SPC}
824
825 If you typed a long message, you can view subsequent pages with
826 @key{SPC} and previous pages with @key{DEL}.
827
828 @node Processing Mail Tour, Leaving MH-E, Reading Mail Tour, Tour Through MH-E
829 @section Processing Mail
830
831 @cindex processing mail
832 @kindex @key{RET}
833 @kindex r
834
835 The first thing we want to do is reply to the message that we sent
836 ourselves. Ensure that the cursor is still on the same line as your
837 test message and type @kbd{r}. You are prompted in the minibuffer with
838 @samp{Reply to whom:}. Here MH-E is asking whether you'd like to reply
839 to the original sender only, to the sender and primary recipients, or
840 to the sender and all recipients. You can press @key{TAB} to see these
841 choices. If you simply press @key{RET}, you'll reply only to the
842 sender. Press @key{RET} now.
843
844 You'll find yourself in an Emacs buffer similar to that when you were
845 sending the original message, like this:
846
847 @cartouche
848 @smallexample
849 To:
850 cc:
851 Subject: Re: Test
852 In-reply-to: <31054.1142621351@@stop.mail-abuse.org>
853 References: <31054.1142621351@@stop.mail-abuse.org>
854 Comments: In-reply-to Bill Wohler <wohler@@stop.mail-abuse.org>
855 message dated "Fri, 17 Mar 2006 10:49:11 -0800."
856 X-Mailer: MH-E 8.1; nmh 1.1; GNU Emacs 23.1
857 --------
858 #
859
860 --:-- @{draft@} All L10 (MH-Letter)----------------------------------
861 To: wohler
862 Subject: Test
863 X-Mailer: MH-E 8.1; nmh 1.1; GNU Emacs 23.1
864 Date: Fri, 17 Mar 2006 10:49:11 -0800
865 From: Bill Wohler <wohler@@stop.mail-abuse.org>
866
867 This is a test message to get the wheels churning...
868
869 --:-- @{show-+inbox@} 4 All L1 (MH-Show)----------------------------
870 Type C-c C-c to send message, C-c ? for help
871 @end smallexample
872 @end cartouche
873 @i{Composition window during reply}
874
875 @findex backward-char
876 @findex forward-char
877 @findex next-line
878 @findex previous-line
879 @kindex C-b
880 @kindex C-c C-c
881 @kindex C-c C-f C-t
882 @kindex C-f
883 @kindex C-n
884 @kindex C-p
885 @kindex @key{BS}
886
887 By default, MH will not add you to the address list of your replies,
888 so if you find that the @samp{To:} header field is missing, don't
889 worry. In this case, type @kbd{C-c C-f C-t} to create and go to the
890 @samp{To:} field, where you can type your login name again. You can
891 move around with the arrow keys or with @kbd{C-p}
892 (@code{previous-line}), @kbd{C-n} (@code{next-line}), @kbd{C-b}
893 (@code{backward-char}), and @kbd{C-f} (@code{forward-char}) and can
894 delete the previous character with @key{BS}. When you're finished
895 editing your message, send it with @kbd{C-c C-c} as before.
896
897 @cindex @command{refile}
898 @cindex MH commands, @command{refile}
899 @cindex folders
900 @kindex @key{SPC}
901 @kindex o
902
903 You'll often want to save messages that were sent to you in an
904 organized fashion. This is done with @dfn{folders}. You can use
905 folders to keep messages from your friends, or messages related to a
906 particular topic. With your cursor in the MH-Folder buffer and
907 positioned on the message you sent to yourself, type @kbd{o} to output
908 (@command{refile} in MH parlance) that message to a folder. Enter
909 @kbd{test} at the @samp{Destination folder:} prompt and type @kbd{y}
910 (or @key{SPC}) when MH-E asks to create the folder @samp{+test}. Note
911 that a @samp{^} (caret) appears next to the message number, which
912 means that the message has been marked for refiling but has not yet
913 been refiled. We'll talk about how the refile is actually carried out
914 in a moment.
915
916 @cindex MH-Folder mode
917 @cindex modes, MH-Folder
918 @kindex d
919 @kindex i
920 @kindex @key{RET}
921 @kindex n
922 @kindex p
923 @kindex x
924
925 Your previous reply is now waiting in the system mailbox. You
926 incorporate this mail into your MH-Folder buffer named @samp{+inbox}
927 with the @kbd{i} command. Do this now. After the mail is incorporated,
928 use @kbd{n} or @kbd{p} to move the cursor to the new message, and read
929 it with @key{RET}. Let's delete this message by typing @kbd{d}. Note
930 that a @samp{D} appears next to the message number. This means that
931 the message is marked for deletion but is not yet deleted. To perform
932 the deletion (and the refile we did previously), use the @kbd{x}
933 command.
934
935 @findex mh-smail
936 @kindex m
937 @kindex M-x mh-smail
938
939 If you want to send another message you can use @kbd{m} instead of
940 @kbd{M-x mh-smail}. So go ahead, send some mail to your friends!
941
942 @cindex help
943 @cindex prefix characters
944 @findex describe-mode
945 @kindex ?
946 @kindex C-h m
947 @kindex F ?
948
949 You can get a quick reminder about these commands by typing @kbd{?}.
950 This lists several @dfn{prefix characters}. To list the commands
951 available via the prefix characters, type the prefix character
952 followed by a @kbd{?}, for example, @kbd{F ?}. More complete help is
953 available with the @kbd{C-h m} (@code{describe-mode}) command.
954
955 @node Leaving MH-E, More About MH-E, Processing Mail Tour, Tour Through MH-E
956 @section Leaving MH-E
957
958 @cindex Emacs, quitting
959 @cindex quitting
960 @kindex C-x C-c
961 @kindex x
962
963 You may now wish to exit @command{emacs} entirely. Use @kbd{C-x C-c}
964 to exit @command{emacs}. If you exited without running @kbd{x} in the
965 @samp{+inbox} buffer, Emacs will offer to save it for you. Type
966 @kbd{y} or @key{SPC} to save @samp{+inbox} changes, which means to
967 perform any refiles and deletes that you did there.
968
969 @findex mh-rmail
970 @kindex C-x b
971 @kindex C-x k
972 @kindex M-x mh-rmail
973 @kindex q
974
975 If you don't want to leave Emacs, you can type @kbd{q} to bury (hide)
976 the MH-E folder or delete it entirely with @kbd{C-x k}. You can then
977 later recall it with @kbd{C-x b} or @kbd{M-x mh-rmail}.
978
979 @cindex @command{packf}
980 @cindex MH commands, @command{packf}
981 @cindex exporting folders
982 @cindex folders, exporting
983 @cindex mbox-style folder
984
985 On the other hand, if you no longer want to use MH and MH-E, you can
986 take your mail with you. You can copy all of your mail into a single
987 file, mbox-style, by using the MH command @command{packf}. For
988 example, to create a file called @file{msgbox} with the messages in
989 your @samp{+inbox} folder, use @samp{packf +inbox}. The
990 @command{packf} command will append the messages to the file if it
991 already exists, so you can use @samp{folders -recurse -fast} in a
992 script to copy all of your messages into a single file, or using the
993 @samp{-file} argument, a file for each folder.
994
995 @node More About MH-E, , Leaving MH-E, Tour Through MH-E
996 @section More About MH-E
997
998 These are the basic commands to get you going, but there are plenty
999 more. If you think that MH-E is for you, read the rest of the manual
1000 to find out how you can:
1001
1002 @itemize @bullet
1003 @item
1004 Print your messages (@pxref{Printing}).
1005 @c -------------------------
1006 @item
1007 Edit messages and include your signature (@pxref{Editing Drafts}).
1008 @c -------------------------
1009 @item
1010 Forward messages (@pxref{Forwarding}).
1011 @c -------------------------
1012 @item
1013 Read digests (@pxref{Digests}).
1014 @c -------------------------
1015 @item
1016 Edit bounced messages (@pxref{Editing Again}).
1017 @c -------------------------
1018 @item
1019 Send multimedia messages (@pxref{Adding Attachments}).
1020 @c -------------------------
1021 @item
1022 Read HTML messages (@pxref{HTML}).
1023 @c -------------------------
1024 @item
1025 Use aliases and identities (see @ref{Aliases}, @pxref{Identities}).
1026 @c -------------------------
1027 @item
1028 Create different views of your mail (see @ref{Threading}, @pxref{Limits}).
1029 @c -------------------------
1030 @item
1031 Deal with junk mail (@pxref{Junk}).
1032 @c -------------------------
1033 @item
1034 Handle signed and encrypted messages (see @ref{Reading PGP},
1035 @pxref{Sending PGP}).
1036 @c -------------------------
1037 @item
1038 Process mail that was sent with @command{shar} or @command{uuencode}
1039 (@pxref{Files and Pipes}).
1040 @c -------------------------
1041 @item
1042 Use sequences conveniently (@pxref{Sequences}).
1043 @c -------------------------
1044 @item
1045 Use the speedbar, tool bar, and menu bar (see @ref{Speedbar}, see @ref{Tool
1046 Bar}, @pxref{Menu Bar}).
1047 @c -------------------------
1048 @item
1049 Show header fields in different fonts (@pxref{Reading Mail}).
1050 @c -------------------------
1051 @item
1052 Find previously refiled messages (@pxref{Searching}).
1053 @c -------------------------
1054 @item
1055 Place messages in a file (@pxref{Files and Pipes}).
1056 @end itemize
1057
1058 Remember that you can also use MH commands when you're not running
1059 MH-E (and when you are!).
1060
1061 @node Using This Manual, Incorporating Mail, Tour Through MH-E, Top
1062 @chapter Using This Manual
1063
1064 This chapter begins the meat of the manual which goes into more detail
1065 about every MH-E command and option.
1066
1067 @cindex Emacs, info
1068 @cindex Emacs, online help
1069 @cindex info
1070 @cindex online help
1071 @findex describe-mode
1072 @findex mh-help
1073 @kindex ?
1074 @kindex C-c ?
1075 @kindex C-h C-h
1076 @kindex C-h C-k i
1077 @kindex C-h i
1078 @kindex C-h m
1079
1080 There are many commands, but don't get intimidated. There are command
1081 summaries at the beginning of each chapter. In case you have or would
1082 like to rebind the keys, the command summaries also list the
1083 associated Emacs Lisp function. Furthermore, even if you're stranded
1084 on a desert island with a laptop and are without your manuals, you can
1085 get a summary of all these commands with GNU Emacs online help: use
1086 @kbd{C-h m} (@code{describe-mode}) for a brief summary of commands,
1087 @kbd{?} (@code{mh-help}) for an even briefer summary@footnote{This
1088 help appears in a buffer called @samp{*MH-E Help*}
1089 (@pxref{Miscellaneous}).} (@kbd{C-c ?} in MH-Letter mode), or @kbd{C-h
1090 i} to read this manual via Info. The online help is quite good; try
1091 running @kbd{C-h C-h}. This brings up a list of available help topics,
1092 one of which displays the documentation for a given key (like @kbd{C-h
1093 k C-n}). Another useful help feature is to view the manual section
1094 that describes a given key (such as @kbd{C-h K i}). In addition,
1095 review @ref{Conventions}, if any of the GNU Emacs conventions are
1096 strange to you.
1097
1098 In addition to all of the commands, it is also possible to reconfigure
1099 MH-E to fit the needs of even the most demanding user. The following
1100 chapters also describe all of the options, show the defaults, and make
1101 recommendations for customization.
1102
1103 However, when customizing your mail environment, first try to change
1104 what you want in MH, and only change MH-E if changing MH is not
1105 possible. That way you will get the same behavior inside and outside
1106 GNU Emacs. Note that MH-E does not provide hooks for customizations
1107 that can be done in MH; this omission is intentional.
1108
1109 @cindex Emacs Lisp Manual
1110 @cindex Emacs, Emacs Lisp Manual
1111 @cindex Emacs, info
1112 @cindex Emacs, online help
1113 @cindex info
1114 @cindex online help
1115
1116 I hope I've included enough examples here to get you well on your way.
1117 If you want to explore Emacs Lisp further, a programming manual does
1118 exist,
1119 @c Yes, some of the stuff in the following sections is redundant, but
1120 @c TeX barfs if the @ifs are inside the @footnote.
1121 @iftex
1122 @footnote{The @cite{GNU Emacs Lisp Reference Manual} may be available
1123 online in the Info system by typing @kbd{C-h i m Emacs Lisp
1124 @key{RET}}. It is also available online at @*
1125 @uref{http://www.gnu.org/software/emacs/elisp-manual/html_node/}. You
1126 can also order a printed manual, which has the desirable side-effect
1127 of helping to support the Free Software Foundation which made all this
1128 great software available. You can find an order form by running
1129 @kbd{C-h C-d}, or you can request an order form from @i{gnu at
1130 gnu.org}.}
1131 @end iftex
1132 @ifinfo
1133 @footnote{@xref{Top, The GNU Emacs Lisp Reference Manual, , elisp, GNU
1134 Emacs Lisp Reference Manual}, which may be available online in the
1135 Info system. It is also available online at
1136 @uref{http://www.gnu.org/software/emacs/elisp-manual/html_node/}. You
1137 can also order a printed manual, which has the desirable side-effect
1138 of helping to support the Free Software Foundation which made all this
1139 great software available. You can find an order form by running
1140 @kbd{C-h C-d}, or you can request an order form from @i{gnu at
1141 gnu.org}.}
1142 @end ifinfo
1143 @ifhtml
1144 @footnote{The
1145 @uref{http://www.gnu.org/software/emacs/elisp-manual/html_node/,
1146 The GNU Emacs Lisp Reference Manual} may also be available online in
1147 the Info system by typing @kbd{C-h i m Emacs Lisp @key{RET}}. You can
1148 also order a printed manual, which has the desirable side-effect of
1149 helping to support the Free Software Foundation which made all this
1150 great software available. You can find an order form by running
1151 @kbd{C-h C-d}, or you can request an order form from @i{gnu at
1152 gnu.org}.}
1153 @end ifhtml
1154 and you can look at the code itself for examples. Look in the Emacs
1155 Lisp directory on your system (such as
1156 @file{/usr/local/lib/emacs/lisp/mh-e}) and find all the @file{mh-*.el}
1157 files there. When calling MH-E and other Emacs Lisp functions directly
1158 from Emacs Lisp code, you'll need to know the correct arguments. Use
1159 the online help for this. For example, try @kbd{C-h f
1160 mh-execute-commands @key{RET}}. If you write your own functions,
1161 please do not prefix your symbols (variables and functions) with
1162 @samp{mh-}. This prefix is reserved for the MH-E package. To avoid
1163 conflicts with existing MH-E symbols, use a prefix like @samp{my-} or
1164 your initials. (Unless, of course, your initials happen to be @emph{mh}!)
1165
1166 @menu
1167 * Options::
1168 * Ranges::
1169 * Folder Selection::
1170 @end menu
1171
1172 @node Options, Ranges, Using This Manual, Using This Manual
1173 @section Options
1174
1175 @cindex Emacs, customizing
1176 @cindex Emacs, setting options
1177 @cindex customizing MH-E
1178 @cindex setting options
1179 @findex customize-option
1180 @vindex mh-lpr-command-format, example
1181
1182 Many string or integer options are easy to modify using @kbd{M-x
1183 customize-option}. For example, to modify the option that controls
1184 printing, you would run @kbd{M-x customize-option @key{RET}
1185 mh-lpr-command-format @key{RET}}. In the buffer that appears, modify
1186 the string to the right of the variable. For example, you may change
1187 the @command{lpr} command with @samp{nenscript -G -r -2 -i'%s'}. Then
1188 use the @samp{State} combo box and select @samp{Save for Future
1189 Sessions}. To read more about @code{mh-lpr-command-format}, see
1190 @ref{Printing}.
1191
1192 @cindex nil
1193 @cindex off, option
1194 @cindex on, option
1195 @cindex option, turning on and off
1196 @cindex t
1197 @findex customize-option
1198 @vindex mh-bury-show-buffer-flag, example
1199
1200 Options can also hold boolean values. In Emacs Lisp, the boolean
1201 values are @code{nil}, which means false, and @code{t}, which means
1202 true. The @code{customize-option} function makes it easy to change
1203 boolean values; simply click on the toggle button in the customize
1204 buffer to switch between @samp{on} (@code{t}) and @samp{off}
1205 (@code{nil}). For example, try setting @code{mh-bury-show-buffer-flag}
1206 to @samp{off} to keep the MH-Show buffer at the top of the buffer
1207 stack. Use the @samp{State} combo box and choose @samp{Set for Current
1208 Session} to see how the option affects the show buffer. Then choose
1209 the @samp{Erase Customization} menu item to reset the option to the
1210 default, which places the MH-Show buffer at the bottom of the buffer
1211 stack.
1212
1213 @vindex mh-mhl-format-file, example
1214
1215 The text usually says to turn on an option by setting it to a
1216 @emph{non-@code{nil}} value, because sometimes values other than
1217 @samp{on} are meaningful. An example of this is the variable
1218 @code{mh-mhl-format-file} (@pxref{Viewing}). Other options, such as
1219 hooks, involve a little more Emacs Lisp programming expertise.
1220
1221 @cindex customization group, @samp{mh}
1222 @cindex @samp{mh} customization group
1223 @findex customize-group
1224 @findex mh-customize
1225
1226 You can browse all of the MH-E options with the @code{customize-group}
1227 function. Try entering @kbd{M-x customize-group @key{RET} mh
1228 @key{RET}} to view the top-level options as well as buttons for all of
1229 the MH-E customization groups. Another way to view the MH-E
1230 customization group is to use @kbd{M-x mh-customize @key{RET}}.
1231
1232 @node Ranges, Folder Selection, Options, Using This Manual
1233 @section Ranges
1234
1235 @c Sync with mh-folder-mode docstring.
1236
1237 @cindex message abbreviations
1238 @cindex message ranges
1239 @cindex ranges
1240
1241 Many commands that operate on individual messages, such as
1242 @code{mh-forward} or @code{mh-refile-msg} take a @code{RANGE}
1243 argument. This argument can be used in several ways.
1244
1245 @kindex C-u, with ranges
1246
1247 If you provide the prefix argument @kbd{C-u} to these commands, then
1248 you will be prompted for the message range. This can be any valid MH
1249 range which can include messages, sequences (@pxref{Sequences}), and
1250 the abbreviations (described in the @command{mh}(1) man page):
1251
1252 @table @samp
1253 @item <num1>-<num2>
1254 Indicates all messages in the range <num1> to <num2>, inclusive. The
1255 range must be nonempty.
1256 @c -------------------------
1257 @item <num>:N
1258 @itemx <num>:+N
1259 @itemx <num>:-N
1260 Up to N messages beginning with (or ending with) message num. Num may
1261 be any of the predefined symbols: first, prev, cur, next or last.
1262 @c -------------------------
1263 @item first:N
1264 @itemx prev:N
1265 @itemx next:N
1266 @itemx last:N
1267 The first, previous, next or last messages, if they exist.
1268 @c -------------------------
1269 @item all
1270 All of the messages.
1271 @end table
1272
1273 For example, a range that shows all of these things is @samp{1 2 3
1274 5-10 last:5 unseen}.
1275
1276 @vindex transient-mark-mode
1277
1278 If the option @code{transient-mark-mode} is turned on and you set a
1279 region in the MH-Folder buffer, then the MH-E command will perform the
1280 operation on all messages in that region.
1281
1282 @cindex @samp{mh-range} customization group
1283 @cindex customization group, @samp{mh-range}
1284
1285 The @samp{mh-range} customization group contains a single option which
1286 affects how ranges are interpreted.
1287
1288 @vtable @code
1289 @item mh-interpret-number-as-range-flag
1290 On means interpret a number as a range (default: @samp{on}).
1291 @end vtable
1292
1293 @vindex mh-interpret-number-as-range-flag
1294
1295 Since one of the most frequent ranges used is @samp{last:N}, MH-E will
1296 interpret input such as @samp{200} as @samp{last:200} if the
1297 @code{mh-interpret-number-as-range-flag} option is on (which is the
1298 default). If you need to scan just the message 200, then use the range
1299 @samp{200:1} or @samp{200-200}.
1300
1301 @node Folder Selection, , Ranges, Using This Manual
1302 @section Folder Selection
1303
1304 @cindex completion, folders
1305 @cindex folders, completion
1306 @cindex folders, selecting
1307
1308 When you choose a folder in MH-E via a command such as @kbd{o}
1309 (@code{mh-refile-msg}), completion is used to enter the folder
1310 @ifnothtml
1311 (@pxref{Completion, , , emacs, The GNU Emacs Manual}).
1312 @end ifnothtml
1313 @ifhtml
1314 (see the section
1315 @uref{http://www.gnu.org/software/emacs/manual/html_node/Completion.html,
1316 Completion} in @cite{The GNU Emacs Manual}).
1317 @end ifhtml
1318 In addition, MH-E has several ways of choosing a suitable default so
1319 that the folder can often be selected with a single @key{RET} key.
1320
1321 @cindex customization group, @samp{mh-folder-selection}
1322 @cindex @samp{mh-folder-selection} customization group
1323
1324 The @samp{mh-folder-selection} customization group contains some
1325 options which are used to help with this.
1326
1327 @vtable @code
1328 @item mh-default-folder-for-message-function
1329 Function to select a default folder for refiling or @samp{Fcc:}
1330 (default: @code{nil}).
1331 @c -------------------------
1332 @item mh-default-folder-list
1333 List of addresses and folders (default: @code{nil}).
1334 @c -------------------------
1335 @item mh-default-folder-must-exist-flag
1336 On means guessed folder name must exist to be used (default:
1337 @samp{on}).
1338 @c -------------------------
1339 @item mh-default-folder-prefix
1340 Prefix used for folder names generated from aliases (default: @code{""}).
1341 @end vtable
1342
1343 @vindex mh-default-folder-for-message-function
1344
1345 You can set the option @code{mh-default-folder-for-message-function}
1346 to a function that provides a default folder for the message to be
1347 refiled. When this function is called, the current buffer contains the
1348 message being refiled and point is at the start of the message. This
1349 function should return the default folder as a string with a leading
1350 @samp{+} sign. It can also return @code{nil} so that the last folder
1351 name is used as the default, or an empty string to suppress the
1352 default entirely.
1353
1354 Otherwise, the name of the destination folder is derived from the
1355 sender as follows:
1356
1357 @enumerate
1358 @vindex mh-default-folder-list
1359 @item
1360 The folder name associated with the first address found in the list
1361 @code{mh-default-folder-list} is used. Each element in this list
1362 contains a @samp{Check Recipient} item. If this item is turned on,
1363 then the address is checked against the recipient instead of the
1364 sender. This is useful for mailing lists.
1365 @c -------------------------
1366 @vindex mh-default-folder-prefix
1367 @item
1368 An alias prefixed by @code{mh-default-folder-prefix} corresponding to
1369 the address is used. The prefix is used to prevent clutter in your
1370 mail directory. @xref{Aliases}.
1371 @end enumerate
1372
1373 @vindex mh-default-folder-must-exist-flag
1374
1375 If the derived folder does not exist, and
1376 @code{mh-default-folder-must-exist-flag} is @code{t}, then the last
1377 folder name used is suggested. This is useful if you get mail from
1378 various people for whom you have an alias, but file them all in the
1379 same project folder.
1380
1381 @node Incorporating Mail, Reading Mail, Using This Manual, Top
1382 @chapter Incorporating Your Mail
1383
1384 @cindex @samp{Folder} menu
1385 @cindex incorporating
1386 @cindex menu, @samp{Folder}
1387
1388 This chapter talks about getting mail from your system mailbox into
1389 your MH @samp{+inbox} folder. The following command accomplishes that
1390 and is found in the @samp{Folder} menu.
1391
1392 @table @kbd
1393 @cindex @samp{Folder > Incorporate New Mail} menu item
1394 @cindex menu item, @samp{Folder > Incorporate New Mail}
1395 @findex mh-inc-folder
1396 @kindex i
1397 @item i
1398 Incorporate new mail into a folder (@code{mh-inc-folder}).
1399 @end table
1400
1401 @cindex @samp{mh-inc} customization group
1402 @cindex customization group, @samp{mh-inc}
1403
1404 The following options in the @samp{mh-inc} customization group are
1405 used.
1406
1407 @vtable @code
1408 @item mh-inc-prog
1409 Program to incorporate mail (default: @code{"inc"}).
1410 @c -------------------------
1411 @item mh-inc-spool-list
1412 Alternate spool files (default: @code{nil}).
1413 @end vtable
1414
1415 The following hook is available.
1416
1417 @vtable @code
1418 @findex mh-inc-folder
1419 @item mh-inc-folder-hook
1420 Hook run by @code{mh-inc-folder} after incorporating mail into a
1421 folder (default: @code{nil}).
1422 @end vtable
1423
1424 @cindex @samp{+inbox}
1425 @findex mh-inc-folder
1426 @kindex i
1427
1428 If at any time you receive new mail, incorporate the new mail into
1429 your @samp{+inbox} buffer with @kbd{i} (@code{mh-inc-folder}). Note
1430 that @kbd{i} will display the @samp{+inbox} buffer, even if there
1431 isn't any new mail. You can incorporate mail from any file into the
1432 current folder by specifying a prefix argument; you'll be prompted for
1433 the name of the file to use as well as the destination folder (for
1434 example, @kbd{C-u i ~/mbox @key{RET} +tmp @key{RET}}).
1435
1436 @cindex @file{.emacs}
1437 @cindex Emacs, notification of new mail
1438 @cindex files, @file{.emacs}
1439 @cindex new mail
1440 @cindex notification of new mail
1441
1442 Emacs can notify you when you have new mail by displaying @samp{Mail}
1443 in the mode line. To enable this behavior, and to have a clock in the
1444 mode line as well, add the following to @file{~/.emacs}:
1445
1446 @findex display-time
1447
1448 @smalllisp
1449 (display-time)
1450 @end smalllisp
1451
1452 @cindex @command{inc}
1453 @cindex incorporating
1454 @cindex MH commands, @command{inc}
1455 @vindex mh-inc-prog
1456 @vindex mh-progs
1457
1458 The name of the program that incorporates new mail is stored in
1459 @code{mh-inc-prog}; it is @code{"inc"} by default. This program
1460 generates a one-line summary for each of the new messages. Unless it
1461 is an absolute pathname, the file is assumed to be in the
1462 @code{mh-progs} directory (@pxref{Getting Started}). You may also link
1463 a file to @command{inc} that uses a different format (see
1464 @samp{mh-profile}(5), and sections
1465 @uref{@value{MH-BOOK-HOME}/reapre.html, Reading Mail: inc show next
1466 prev} and @uref{@value{MH-BOOK-HOME}/mhstr.html, MH Format Strings} in
1467 the MH book). You'll then need to modify several variables
1468 appropriately (@pxref{Scan Line Formats}).
1469
1470 @vindex mh-inc-spool-list
1471
1472 You can use the @code{mh-inc-spool-list} variable to direct MH-E to
1473 retrieve mail from arbitrary spool files other than your system
1474 mailbox, file it in folders other than your @samp{+inbox}, and assign
1475 key bindings to incorporate this mail.
1476
1477 @cindex @command{procmail}
1478 @cindex @file{.procmailrc}
1479 @cindex Unix commands, @command{procmail}
1480 @cindex files, @file{.procmailrc}
1481
1482 Suppose you are subscribed to the @i{mh-e-devel} mailing list and you
1483 use @command{procmail} to filter this mail into @file{~/mail/mh-e}
1484 with the following recipe in @file{.procmailrc}:
1485
1486 @smallexample
1487 PATH=$PATH:/usr/bin/mh
1488 MAILDIR=$HOME/`mhparam Path`
1489 :0:
1490 * ^From mh-e-devel-admin@@stop.mail-abuse.org
1491 mh-e
1492 @end smallexample
1493
1494 @findex mh-inc-spool-*
1495 @kindex I *
1496
1497 In order to incorporate @file{~/mail/mh-e} into @samp{+mh-e} with an
1498 @kbd{I m} (@code{mh-inc-spool-mh-e}) command, customize this option,
1499 and click on the @samp{INS} button. Enter a @samp{Spool File} of
1500 @samp{~/mail/mh-e}, a @samp{Folder} of @samp{mh-e}, and a @samp{Key
1501 Binding} of @samp{m}.
1502
1503 @cindex @command{emacsclient}
1504 @cindex @command{gnuclient}
1505 @cindex @command{xbuffy}
1506 @cindex @samp{gnuserv}
1507 @cindex Unix commands, @command{emacsclient}
1508 @cindex Unix commands, @command{gnuclient}
1509 @cindex Unix commands, @command{xbuffy}
1510
1511 You can use @command{xbuffy} to automate the incorporation of this
1512 mail using the Emacs 23 command @command{emacsclient} as follows:
1513
1514 @smallexample
1515 box ~/mail/mh-e
1516 title mh-e
1517 origMode
1518 polltime 10
1519 headertime 0
1520 command emacsclient --eval '(mh-inc-spool-mh-e)'
1521 @end smallexample
1522
1523 In XEmacs, the command @command{gnuclient} is used in a similar
1524 fashion.
1525
1526 @findex mh-inc-folder
1527 @kindex i
1528 @vindex mh-inc-folder-hook
1529
1530 You can set the hook @code{mh-inc-folder-hook}, which is called after
1531 new mail is incorporated by the @kbd{i} (@code{mh-inc-folder})
1532 command. A good use of this hook is to rescan the whole folder either
1533 after running @kbd{M-x mh-rmail} the first time or when you've changed
1534 the message numbers from outside of MH-E.
1535
1536 @findex mh-execute-commands
1537 @findex mh-rescan-folder, example
1538 @findex mh-show, example
1539 @vindex mh-inc-folder-hook, example
1540
1541 @smalllisp
1542 @group
1543 (defun my-mh-inc-folder-hook ()
1544 "Hook to rescan folder after incorporating mail."
1545 (if (buffer-modified-p) ; @r{if outstanding refiles and deletes,}
1546 (mh-execute-commands)) ; @r{carry them out}
1547 (mh-rescan-folder) ; @r{synchronize with +inbox}
1548 (mh-show)) ; @r{show the current message}
1549
1550 (add-hook 'mh-inc-folder-hook 'my-mh-inc-folder-hook)
1551
1552 @i{Rescan folder after incorporating new mail via mh-inc-folder-hook}
1553
1554 @end group
1555 @end smalllisp
1556
1557 @node Reading Mail, Folders, Incorporating Mail, Top
1558 @chapter Reading Your Mail
1559
1560 @cindex @samp{+inbox}
1561 @cindex MH-Folder mode
1562 @cindex MH-Show mode
1563 @cindex modes, MH-Folder
1564 @cindex modes, MH-Show
1565 @cindex reading mail
1566 @findex mh-rmail
1567 @kindex F r
1568 @kindex F v
1569 @kindex M-x mh-rmail
1570
1571 The MH-E entry point for reading mail is @kbd{M-x mh-rmail}. This
1572 command incorporates your mail and creates a buffer called
1573 @samp{+inbox} in MH-Folder mode. The command @kbd{M-x mh-rmail} shows
1574 you only new mail, not mail you have already read@footnote{If you want
1575 to see your old mail as well, use @kbd{F r} to pull all your messages
1576 into MH-E. Or, give a prefix argument to @code{mh-rmail} so it will
1577 prompt you for folder to visit like @kbd{F v} (for example, @kbd{C-u
1578 M-x mh-rmail @key{RET} bob @key{RET}}). @xref{Folders}.}.
1579
1580 @findex display-time
1581 @vindex read-mail-command
1582
1583 There are some commands that need to read mail, such as @kbd{Mouse-2}
1584 over the @samp{Mail} button that @code{display-time} adds to the mode
1585 line. You can configure Emacs to have these commands use MH-E by
1586 setting the option @code{read-mail-command} to @samp{mh-rmail}.
1587
1588 @cindex @command{scan}
1589 @cindex @samp{Message} menu
1590 @cindex MH commands, @command{scan}
1591 @cindex menu, @samp{Message}
1592 @cindex scan lines
1593
1594 The @samp{+inbox} buffer contains @dfn{scan lines}, which are one-line
1595 summaries of each incorporated message. You can perform most MH
1596 commands on these messages via one- or two-letter commands in either
1597 the MH-Folder or MH-Show buffers or by using the @samp{Message} menu.
1598 See @command{scan}(1) for a description of the contents of the scan
1599 lines, and see the Figure in @ref{Reading Mail Tour}, for an example.
1600
1601 @table @kbd
1602 @kindex ?
1603 @findex mh-help
1604 @item ?
1605 Display cheat sheet for the MH-E commands (@code{mh-help}).
1606 @c -------------------------
1607 @cindex @samp{Message > Show Message} menu item
1608 @cindex menu item, @samp{Message > Show Message}
1609 @kindex @key{RET}
1610 @findex mh-show
1611 @item @key{RET}
1612 Display message (@code{mh-show}).
1613 @c -------------------------
1614 @cindex @samp{Message > Show Message with Header} menu item
1615 @cindex menu item, @samp{Message > Show Message with Header}
1616 @kindex , (comma)
1617 @findex mh-header-display
1618 @item , (comma)
1619 Display message with all header fields (@code{mh-header-display}).
1620 @c -------------------------
1621 @cindex @samp{Message > Show Message with Preferred Alternative} menu item
1622 @cindex menu item, @samp{Message > Show Message with Preferred Alternative}
1623 @kindex : (colon)
1624 @findex mh-show-preferred-alternative
1625 @item : (colon)
1626 Display message with the default preferred alternative
1627 (@code{mh-show-preferred-alternative}).
1628 @c -------------------------
1629 @kindex ; (semicolon)
1630 @findex mh-toggle-mh-decode-mime-flag
1631 @item ; (semicolon)
1632 Toggle the value of @code{mh-decode-mime-flag}
1633 (@code{mh-toggle-mh-decode-mime-flag}).
1634 @c -------------------------
1635 @kindex @key{SPC}
1636 @findex mh-page-msg
1637 @item @key{SPC}
1638 Display next page in message (@code{mh-page-msg}).
1639 @c -------------------------
1640 @kindex @key{BS}
1641 @findex mh-previous-page
1642 @item @key{BS}
1643 Display previous page in message (@code{mh-previous-page}).
1644 @c -------------------------
1645 @cindex @samp{Message > Write Message to File...} menu item
1646 @cindex menu item, @samp{Message > Write Message to File...}
1647 @kindex >
1648 @findex mh-write-msg-to-file
1649 @item >
1650 Append message to end of file (@code{mh-write-msg-to-file}).
1651 @c -------------------------
1652 @cindex @samp{Message > Pipe Message to Command...} menu item
1653 @cindex menu item, @samp{Message > Pipe Message to Command...}
1654 @kindex |
1655 @findex mh-pipe-msg
1656 @item |
1657 Pipe message through shell command (@code{mh-pipe-msg}).
1658 @c -------------------------
1659 @kindex C-d
1660 @findex mh-delete-msg-no-motion
1661 @item C-d
1662 Delete range, don't move to next message
1663 (@code{mh-delete-msg-no-motion}).
1664 @c -------------------------
1665 @cindex @samp{Message > Delete Message} menu item
1666 @cindex menu item, @samp{Message > Delete Message}
1667 @kindex d
1668 @findex mh-delete-msg
1669 @item d
1670 Delete range (@code{mh-delete-msg}).
1671 @c -------------------------
1672 @kindex D ?
1673 @findex mh-prefix-help
1674 @item D ?
1675 Display cheat sheet for the commands of the current prefix in
1676 minibuffer (@code{mh-prefix-help}).
1677 @c -------------------------
1678 @kindex D @key{SPC}
1679 @findex mh-page-digest
1680 @item D @key{SPC}
1681 Display next message in digest (@code{mh-page-digest}).
1682 @c -------------------------
1683 @kindex D @key{BS}
1684 @findex mh-page-digest-backwards
1685 @item D @key{BS}
1686 Display previous message in digest (@code{mh-page-digest-backwards}).
1687 @c -------------------------
1688 @cindex @samp{Message > Burst Digest Message} menu item
1689 @cindex menu item, @samp{Message > Burst Digest Message}
1690 @kindex D b
1691 @findex mh-burst-digest
1692 @item D b
1693 Break up digest into separate messages (@code{mh-burst-digest}).
1694 @c -------------------------
1695 @cindex @samp{Message > Go to Message by Number...} menu item
1696 @cindex menu item, @samp{Message > Go to Message by Number...}
1697 @kindex g
1698 @findex mh-goto-msg
1699 @item g
1700 Go to a message (@code{mh-goto-msg}).
1701 @c -------------------------
1702 @kindex k
1703 @findex mh-delete-subject-or-thread
1704 @item k
1705 Delete messages with same subject or thread
1706 (@code{mh-delete-subject-or-thread}).
1707 @c -------------------------
1708 @kindex K ?
1709 @findex mh-prefix-help
1710 @item K ?
1711 Display cheat sheet for the commands of the current prefix in
1712 minibuffer (@code{mh-prefix-help}).
1713 @c -------------------------
1714 @kindex K @key{TAB}
1715 @findex mh-next-button
1716 @item K @key{TAB}
1717 Go to the next button (@code{mh-next-button}).
1718 @c -------------------------
1719 @kindex K S-@key{TAB}
1720 @findex mh-prev-button
1721 @item K S-@key{TAB}
1722 Go to the previous button (@code{mh-prev-button}).
1723 @c -------------------------
1724 @kindex K a
1725 @findex mh-mime-save-parts
1726 @item K a
1727 Save attachments (@code{mh-mime-save-parts}).
1728 @c -------------------------
1729 @kindex K e
1730 @findex mh-display-with-external-viewer
1731 @item K e
1732 View attachment externally (@code{mh-display-with-external-viewer}).
1733 @c -------------------------
1734 @kindex K i
1735 @findex mh-folder-inline-mime-part
1736 @item K i
1737 Show attachment verbatim (@code{mh-folder-inline-mime-part}).
1738 @c -------------------------
1739 @kindex K o
1740 @findex mh-folder-save-mime-part
1741 @item K o
1742 Save (output) attachment (@code{mh-folder-save-mime-part}).
1743 @c -------------------------
1744 @kindex K t
1745 @findex mh-toggle-mime-buttons
1746 @item K t
1747 Toggle option @code{mh-display-buttons-for-inline-parts-flag}
1748 (@code{mh-toggle-mime-buttons}).
1749 @c -------------------------
1750 @kindex K v
1751 @findex mh-folder-toggle-mime-part
1752 @item K v
1753 View attachment (@code{mh-folder-toggle-mime-part}).
1754 @c -------------------------
1755 @cindex @samp{Message > Modify Message} menu item
1756 @cindex menu item, @samp{Message > Modify Message}
1757 @kindex M
1758 @findex mh-modify
1759 @item M
1760 Edit message (@code{mh-modify}).
1761 @c -------------------------
1762 @cindex @samp{Message > Go to First Message} menu item
1763 @cindex menu item, @samp{Message > Go to First Message}
1764 @kindex M-<
1765 @findex mh-first-msg
1766 @item M-<
1767 Display first message (@code{mh-first-msg}).
1768 @c -------------------------
1769 @cindex @samp{Message > Go to Last Message} menu item
1770 @cindex menu item, @samp{Message > Go to Last Message}
1771 @kindex M->
1772 @findex mh-last-msg
1773 @item M->
1774 Display last message (@code{mh-last-msg}).
1775 @c -------------------------
1776 @kindex M-n
1777 @findex mh-next-unread-msg
1778 @item M-n
1779 Display next unread message (@code{mh-next-unread-msg}).
1780 @c -------------------------
1781 @kindex M-p
1782 @findex mh-previous-unread-msg
1783 @item M-p
1784 Display previous unread message (@code{mh-previous-unread-msg}).
1785 @c -------------------------
1786 @cindex @samp{Message > Next Message} menu item
1787 @cindex menu item, @samp{Message > Next Message}
1788 @kindex n
1789 @findex mh-next-undeleted-msg
1790 @item n
1791 Display next message (@code{mh-next-undeleted-msg}).
1792 @c -------------------------
1793 @cindex @samp{Message > Previous Message} menu item
1794 @cindex menu item, @samp{Message > Previous Message}
1795 @kindex p
1796 @findex mh-previous-undeleted-msg
1797 @item p
1798 Display previous message (@code{mh-previous-undeleted-msg}).
1799 @c -------------------------
1800 @kindex P ?
1801 @findex mh-prefix-help
1802 @item P ?
1803 Display cheat sheet for the commands of the current prefix in
1804 minibuffer (@code{mh-prefix-help}).
1805 @c -------------------------
1806 @kindex P C
1807 @findex mh-ps-print-toggle-color
1808 @item P C
1809 Toggle whether color is used in printing messages
1810 (@code{mh-ps-print-toggle-color}).
1811 @c -------------------------
1812 @kindex P F
1813 @findex mh-ps-print-toggle-faces
1814 @item P F
1815 Toggle whether printing is done with faces or not
1816 (@code{mh-ps-print-toggle-faces}).
1817 @c -------------------------
1818 @kindex P f
1819 @findex mh-ps-print-msg-file
1820 @item P f
1821 Print range to file (@code{mh-ps-print-msg-file}).
1822 @c -------------------------
1823 @cindex @samp{Message > Print Message} menu item
1824 @cindex menu item, @samp{Message > Print Message}
1825 @kindex P l
1826 @findex mh-print-msg
1827 @item P l
1828 Print range the old fashioned way
1829 (@code{mh-print-msg}).
1830 @c -------------------------
1831 @kindex P p
1832 @findex mh-ps-print-msg
1833 @item P p
1834 Print range (@code{mh-ps-print-msg}).
1835 @c -------------------------
1836 @kindex X ?
1837 @findex mh-prefix-help
1838 @item X ?
1839 Display cheat sheet for the commands of the current prefix in
1840 minibuffer (@code{mh-prefix-help}).
1841 @c -------------------------
1842 @cindex @samp{Message > Unpack Uuencoded Message...} menu item
1843 @cindex menu item, @samp{Message > Unpack Uuencoded Message...}
1844 @kindex X s
1845 @kindex X u
1846 @findex mh-store-msg
1847 @item X s
1848 @itemx X u
1849 Unpack message created with @command{uudecode} or @command{shar}
1850 (@code{mh-store-msg}).
1851 @c -------------------------
1852 @kindex Mouse-2
1853 @findex mh-show-mouse
1854 @item Mouse-2
1855 Move point to mouse event and show message (@code{mh-show-mouse}).
1856 @end table
1857
1858 Within the MH-Show buffer, the following command is defined.
1859
1860 @table @kbd
1861 @kindex @key{RET}
1862 @kindex Mouse-1
1863 @kindex Mouse-2
1864 @findex mh-press-button
1865 @item @key{RET}
1866 @itemx Mouse-1
1867 @itemx Mouse-2
1868 View contents of button (@code{mh-press-button}).
1869 @end table
1870
1871 @cindex @samp{mh-show} customization group
1872 @cindex customization group, @samp{mh-show}
1873
1874 The following table lists options in the @samp{mh-show} customization
1875 group that are used while reading mail.
1876
1877 @vtable @code
1878 @item mh-bury-show-buffer-flag
1879 On means show buffer is buried (default: @samp{on}).
1880 @c -------------------------
1881 @item mh-clean-message-header-flag
1882 On means remove extraneous header fields (default: @samp{on}).
1883 @c -------------------------
1884 @item mh-decode-mime-flag
1885 On means attachments are handled (default: @samp{on} if the Gnus
1886 @samp{mm-decode} package is present).
1887 @c -------------------------
1888 @item mh-display-buttons-for-alternatives-flag
1889 On means display buttons for all alternative attachments (default:
1890 @samp{off}).
1891 @c -------------------------
1892 @item mh-display-buttons-for-inline-parts-flag
1893 On means display buttons for all inline attachments (default:
1894 @samp{off}).
1895 @c -------------------------
1896 @item mh-do-not-confirm-flag
1897 On means non-reversible commands do not prompt for confirmation
1898 (default: @samp{off}).
1899 @c -------------------------
1900 @item mh-fetch-x-image-url
1901 Control fetching of @samp{X-Image-URL:} header field image (default:
1902 @samp{Never Fetch}).
1903 @c -------------------------
1904 @item mh-graphical-smileys-flag
1905 On means graphical smileys are displayed (default: @samp{on}).
1906 @c -------------------------
1907 @item mh-graphical-emphasis-flag
1908 On means graphical emphasis is displayed (default: @samp{on}).
1909 @c -------------------------
1910 @item mh-highlight-citation-style
1911 Style for highlighting citations (default: @samp{Multicolor}).
1912 @c -------------------------
1913 @item mh-invisible-header-fields-default
1914 List of hidden header fields (default: a checklist too long to list
1915 here).
1916 @c -------------------------
1917 @item mh-invisible-header-fields
1918 Additional header fields to hide (default: @code{nil}).
1919 @c -------------------------
1920 @item mh-lpr-command-format
1921 Command used to print (default: @code{"lpr -J '%s'"}).
1922 @c -------------------------
1923 @item mh-max-inline-image-height
1924 Maximum inline image height if @samp{Content-Disposition:} is not
1925 present (default: 0).
1926 @c -------------------------
1927 @item mh-max-inline-image-width
1928 Maximum inline image width if @samp{Content-Disposition:} is not
1929 present(default: 0).
1930 @c -------------------------
1931 @item mh-mhl-format-file
1932 Specifies the format file to pass to the @command{mhl} program
1933 (default: @samp{Use Default mhl Format (Printing Only)}).
1934 @c -------------------------
1935 @item mh-mime-save-parts-default-directory
1936 Default directory to use for @kbd{K a}.
1937 @c -------------------------
1938 @item mh-print-background-flag
1939 On means messages should be printed in the background (default:
1940 @samp{off}).
1941 @c -------------------------
1942 @item mh-show-buffer-mode-line-buffer-id
1943 Format string to produce @code{mode-line-buffer-identification} for
1944 show buffers (default: @code{" @{show-%s@} %d"}).
1945 @c -------------------------
1946 @item mh-show-maximum-size
1947 Maximum size of message (in bytes) to display automatically (default:
1948 0).
1949 @c -------------------------
1950 @item mh-show-use-xface-flag
1951 On means display face images in MH-Show buffers (default: @samp{on}).
1952 @c -------------------------
1953 @item mh-store-default-directory
1954 Default directory for @kbd{X s} (default: @samp{Current}).
1955 @c -------------------------
1956 @item mh-summary-height
1957 Number of lines in MH-Folder buffer (including the mode line)
1958 (default: depends on size of frame).
1959 @end vtable
1960
1961 The following hooks are available.
1962
1963 @vtable @code
1964 @item mh-delete-msg-hook
1965 Hook run after marking each message for deletion (default: @code{nil}).
1966 @c -------------------------
1967 @item mh-show-hook
1968 Hook run after @key{RET} shows a message (default: @code{nil}).
1969 @c -------------------------
1970 @item mh-show-mode-hook
1971 Hook run upon entry to @code{mh-show-mode} (default: @code{nil}).
1972 @end vtable
1973
1974 The following faces are available.
1975
1976 @vtable @code
1977 @item mh-show-cc
1978 Face used to highlight @samp{cc:} header fields.
1979 @c -------------------------
1980 @item mh-show-date
1981 Face used to highlight @samp{Date:} header fields.
1982 @c -------------------------
1983 @item mh-show-from
1984 Face used to highlight @samp{From:} header fields.
1985 @c -------------------------
1986 @item mh-show-header
1987 Face used to deemphasize less interesting header fields.
1988 @c -------------------------
1989 @item mh-show-pgg-bad
1990 Bad PGG signature face.
1991 @c -------------------------
1992 @item mh-show-pgg-good
1993 Good PGG signature face.
1994 @c -------------------------
1995 @item mh-show-pgg-unknown
1996 Unknown or untrusted PGG signature face.
1997 @c -------------------------
1998 @item mh-show-signature
1999 Signature face.
2000 @c -------------------------
2001 @item mh-show-subject
2002 Face used to highlight @samp{Subject:} header fields.
2003 @c -------------------------
2004 @item mh-show-to
2005 Face used to highlight @samp{To:} header fields.
2006 @c -------------------------
2007 @item mh-show-xface
2008 X-Face image face.
2009 @end vtable
2010
2011 The functions and variables introduced here are explained in more
2012 detail in the following sections.
2013
2014 @menu
2015 * Viewing::
2016 * Viewing Attachments::
2017 * HTML::
2018 * Digests::
2019 * Reading PGP::
2020 * Printing::
2021 * Files and Pipes::
2022 * Navigating::
2023 * Miscellaneous Commands and Options::
2024 @end menu
2025
2026 @node Viewing, Viewing Attachments, Reading Mail, Reading Mail
2027 @section Viewing Your Mail
2028
2029 @findex mh-header-display
2030 @findex mh-page-msg
2031 @findex mh-previous-page
2032 @findex mh-show
2033 @findex mh-show-mouse
2034 @kindex , (comma)
2035 @kindex . (period)
2036 @kindex @key{BS}
2037 @kindex @key{RET}
2038 @kindex @key{SPC}
2039 @kindex Mouse-2
2040
2041 The command @key{RET} (@code{mh-show}) displays the message that the
2042 cursor is on while @kbd{Mouse-2} (@code{mh-show-mouse}) displays the
2043 message that the mouse cursor is on. If the message is already
2044 displayed, it scrolls to the beginning of the message. Use @key{SPC}
2045 (@code{mh-page-msg}) and @key{BS} (@code{mh-previous-page}) to move
2046 forwards and backwards one page at a time through the message. You can
2047 give either of these commands a prefix argument that specifies the
2048 number of lines to scroll (such as @kbd{10 @key{SPC}}). The @key{SPC}
2049 command will also show the next undeleted message if it is used at the
2050 bottom of a message. MH-E normally hides a lot of the superfluous
2051 header fields that mailers add to a message, but if you wish to see
2052 all of them, use the command @kbd{,} (comma;
2053 @code{mh-header-display}).
2054
2055 @vindex mh-show-maximum-size
2056
2057 The option @code{mh-show-maximum-size} provides an opportunity to skip
2058 over large messages which may be slow to load. The default value of 0
2059 means that all message are shown regardless of size.
2060
2061 A litany of options control what displayed messages look like.
2062
2063 @vindex mh-show-cc
2064 @vindex mh-show-date
2065 @vindex mh-show-from
2066 @vindex mh-show-header
2067 @vindex mh-show-subject
2068 @vindex mh-show-to
2069
2070 First, the appearance of the header fields can be modified by
2071 customizing the associated face: @code{mh-show-to}, @code{mh-show-cc},
2072 @code{mh-show-from}, @code{mh-show-date}, and @code{mh-show-subject}.
2073 The face @code{mh-show-header} is used to deemphasize the other, less
2074 interesting, header fields.
2075
2076 @cindex regular expressions, @code{mh-invisible-header-fields}
2077 @vindex mh-clean-message-header-flag
2078 @vindex mh-invisible-header-fields
2079 @vindex mh-invisible-header-fields-default
2080
2081 Normally messages are delivered with a handful of uninteresting header
2082 fields. These are hidden by turning on the option
2083 @code{mh-clean-message-header-flag} (which it is by default). The
2084 header fields listed in the option
2085 @code{mh-invisible-header-fields-default} are hidden, although you can
2086 check off any field that you would like to see. Header fields that you
2087 would like to hide that aren't listed can be added to the option
2088 @code{mh-invisible-header-fields} with a couple of caveats. Regular
2089 expressions are not allowed. Unique fields should have a @samp{:}
2090 suffix; otherwise, the element can be used to render invisible an
2091 entire class of fields that start with the same prefix. If you think a
2092 header field should be generally ignored, please update
2093 @uref{https://sourceforge.net/tracker/index.php?func=detail&aid=1916032&group_id=13357&atid=113357,
2094 SF #1916032}.
2095
2096 @cindex header field, @samp{Face:}
2097 @cindex header field, @samp{X-Face:}
2098 @cindex header field, @samp{X-Image-URL:}
2099 @cindex @samp{Face:} header field
2100 @cindex @samp{X-Face:} header field
2101 @cindex @samp{X-Image-URL:} header field
2102 @vindex mh-show-use-xface-flag
2103
2104 MH-E can display the content of @samp{Face:}, @samp{X-Face:}, and
2105 @samp{X-Image-URL:} header fields. If any of these fields occur in the
2106 header of your message, the sender's face will appear in the
2107 @samp{From:} header field. If more than one of these fields appear,
2108 then the first field found in the order @samp{Face:}, @samp{X-Face:},
2109 and @samp{X-Image-URL:} will be used. The option
2110 @code{mh-show-use-xface-flag} is used to turn this feature on and off.
2111 This feature will be turned on by default if your system supports it.
2112
2113 The first header field used, if present, is the Gnus-specific
2114 @samp{Face:} field@footnote{The @samp{Face:} field appeared in GNU
2115 Emacs 21 and XEmacs. For more information, see
2116 @uref{http://quimby.gnus.org/circus/face/}.}.
2117
2118 @cindex @command{uncompface}
2119 @cindex Emacs, packages, x-face
2120 @cindex Unix commands, @command{uncompface}
2121 @cindex x-face package
2122 @vindex mh-show-xface
2123
2124 Next is the traditional @samp{X-Face:} header field@footnote{The
2125 display of this field requires the
2126 @uref{ftp://ftp.cs.indiana.edu/pub/faces/compface/compface.tar.Z,
2127 @command{uncompface} program}. Recent versions of XEmacs have internal
2128 support for @samp{X-Face:} images. If your version of XEmacs does not,
2129 then you'll need both @command{uncompface} and the
2130 @uref{ftp://ftp.jpl.org/pub/elisp/, @samp{x-face} package}.}. MH-E
2131 renders the foreground and background of the image using the
2132 associated attributes of the face @code{mh-show-xface}.
2133
2134 @cindex @command{convert}
2135 @cindex @command{wget}
2136 @cindex ImageMagick
2137 @cindex Unix commands, @command{convert}
2138 @cindex Unix commands, @command{wget}
2139 @vindex mh-fetch-x-image-url
2140
2141 Finally, MH-E will display images referenced by the
2142 @samp{X-Image-URL:} header field if neither the @samp{Face:} nor the
2143 @samp{X-Face:} fields are present@footnote{The display of the images
2144 requires the @uref{http://www.gnu.org/software/wget/wget.html,
2145 @command{wget} program} to fetch the image and the @command{convert}
2146 program from the @uref{http://www.imagemagick.org/, ImageMagick
2147 suite}.}. Of the three header fields this is the most efficient in
2148 terms of network usage since the image doesn't need to be transmitted
2149 with every single mail. The option @code{mh-fetch-x-image-url}
2150 controls the fetching of the @samp{X-Image-URL:} header field image
2151 with the following values:
2152
2153 @table @samp
2154 @item Ask Before Fetching
2155 You are prompted before the image is fetched. MH-E will remember your
2156 reply and will either use the already fetched image the next time the
2157 same URL is encountered or silently skip it if you didn't fetch it the
2158 first time. This is a good setting.
2159 @c -------------------------
2160 @item Never Fetch
2161 Images are never fetched and only displayed if they are already
2162 present in the cache. This is the default.
2163 @end table
2164
2165 There isn't a value of @samp{Always Fetch} for privacy and DOS (denial
2166 of service) reasons. For example, fetching a URL can tip off a spammer
2167 that you've read his email (which is why you shouldn't blindly answer
2168 yes if you've set this option to @samp{Ask Before Fetching}). Someone
2169 may also flood your network and fill your disk drive by sending a
2170 torrent of messages, each specifying a unique URL to a very large
2171 file.
2172
2173 @cindex @file{.mhe-x-image-cache}
2174 @cindex files, @file{.mhe-x-image-cache}
2175
2176 The cache of images is found in the directory
2177 @file{.mhe-x-image-cache} within your MH directory. You can add your
2178 own face to the @samp{From:} field too. @xref{Picture}.
2179
2180 @cindex @command{mhl}
2181 @cindex MH commands, @command{mhl}
2182 @vindex mh-mhl-format-file
2183
2184 Normally MH-E takes care of displaying messages itself (rather than
2185 calling an MH program to do the work). If you'd rather have
2186 @command{mhl} display the message (within MH-E), change the option
2187 @code{mh-mhl-format-file} from its default value of @samp{Use Default
2188 mhl Format (Printing Only)}. You can set this option to @samp{Use
2189 Default mhl Format} to get the same output as you would get if you ran
2190 @command{mhl} from the shell. If you have a format file that you want
2191 MH-E to use, you can set this option to @samp{Specify an mhl Format
2192 File} and enter the name of your format file (@command{mhl}(1) or
2193 section @uref{@value{MH-BOOK-HOME}/shomes.html#Usisho, Using mhl} in
2194 the MH book tells you how to write one). Your format file should
2195 specify a non-zero value for @samp{overflowoffset} to allow MH-E to
2196 parse the header. Note that @command{mhl} is always used for printing
2197 and forwarding; in this case, the value of @code{mh-mhl-format-file}
2198 is consulted if you have specified a format file.
2199
2200 @cindex citations, highlighting
2201 @cindex highlighting citations
2202 @vindex mh-highlight-citation-style
2203
2204 If the sender of the message has cited other messages in his message,
2205 then MH-E will highlight these citations to emphasize the sender's
2206 actual response. The option @code{mh-highlight-citation-style} can be
2207 customized to change the highlighting style. The @samp{Multicolor}
2208 method uses a different color for each indentation while the
2209 @samp{Monotone} method highlights all citations in red. To disable
2210 highlighting of citations entirely, choose @samp{None}.
2211
2212 @cindex URLs, highlighting
2213 @cindex email addresses, highlighting
2214 @cindex highlighting URLs
2215 @cindex highlighting email addresses
2216 @cindex links, following
2217 @findex goto-address-at-point
2218 @kindex C-c @key{RET}
2219 @kindex Mouse-2
2220 @vindex goto-address-highlight-p
2221
2222 Email addresses and URLs in the message are highlighted if the option
2223 @code{goto-address-highlight-p} is on, which it is by default. To view
2224 the web page for a highlighted URL or to send a message using a
2225 highlighted email address, use @kbd{Mouse-2} or @kbd{C-c @key{RET}}
2226 (@code{goto-address-at-point}). @xref{Sending Mail}, to see how to
2227 configure Emacs to send the message using MH-E.
2228
2229 @cindex boldface, showing
2230 @cindex emphasis
2231 @cindex italics, showing
2232 @cindex smileys
2233 @cindex typesetting
2234 @cindex underline, showing
2235 @vindex gnus-emphasis-alist
2236 @vindex mh-decode-mime-flag
2237 @vindex mh-graphical-emphasis-flag
2238 @vindex mh-graphical-smileys-flag
2239
2240 It is a long standing custom to inject body language using a
2241 cornucopia of punctuation, also known as the @dfn{smileys}. MH-E can
2242 render these as graphical widgets if the option
2243 @code{mh-graphical-smileys-flag} is turned on, which it is by default.
2244 Smileys include patterns such as :-) and ;-). Similarly, a few
2245 typesetting features are indicated in ASCII text with certain
2246 characters. If your terminal supports it, MH-E can render these
2247 typesetting directives naturally if the option
2248 @code{mh-graphical-emphasis-flag} is turned on, which it is by
2249 default. For example, _underline_ will be
2250 @ifhtml
2251 @html
2252 <u>underlined</u>,
2253 @end html
2254 @end ifhtml
2255 @ifnothtml
2256 underlined,
2257 @end ifnothtml
2258 *bold* will appear in @b{bold}, /italics/ will appear in @i{italics},
2259 and so on. See the option @code{gnus-emphasis-alist} for the whole
2260 list. Both of these options are disabled if the option
2261 @code{mh-decode-mime-flag} is turned off. @xref{Viewing Attachments}.
2262
2263 @cindex signature separator
2264 @cindex vCard
2265 @vindex mh-show-signature
2266
2267 MH-E normally renders signatures and vCards in italics so that the
2268 body of the message stands out more. MH-E depends on the presence of
2269 the @dfn{signature separator} (@code{"-- "}) to do this. You can also
2270 customize the face @code{mh-show-signature} so the appearance of the
2271 signature block is more to your liking.
2272
2273 @vindex mh-show-hook
2274 @vindex mh-show-mode-hook
2275
2276 Two hooks can be used to control how messages are displayed. The first
2277 hook, @code{mh-show-mode-hook}, is called early on in the process of
2278 the message display. It is usually used to perform some action on the
2279 message's content. The second hook, @code{mh-show-hook}, is the last
2280 thing called after messages are displayed. It's used to affect the
2281 behavior of MH-E in general or when @code{mh-show-mode-hook} is too
2282 early.
2283
2284 @cindex MH-Show mode
2285 @cindex modes, MH-Show
2286 @vindex mh-show-buffer-mode-line-buffer-id
2287
2288 For those who like to modify their mode lines, use
2289 @code{mh-show-buffer-mode-line-buffer-id} to modify the mode line in
2290 the MH-Show buffers. Place the two escape strings @samp{%s} and
2291 @samp{%d}, which will display the folder name and the message number,
2292 respectively, somewhere in the string in that order. The default value
2293 of @code{"@{show-%s@} %d"} yields a mode line of
2294
2295 @smallexample
2296 -----@{show-+inbox@} 4 (MH-Show)--Bot--------------------------------
2297 @end smallexample
2298
2299 @node Viewing Attachments, HTML, Viewing, Reading Mail
2300 @section Viewing Attachments
2301
2302 @cindex attachments
2303 @cindex body parts
2304 @cindex @command{mhshow}
2305 @cindex @command{show}
2306 @cindex MH commands, @command{mhshow}
2307 @cindex MH commands, @command{show}
2308 @cindex MIME
2309 @cindex multimedia mail
2310
2311 MH has the ability to display @dfn{@sc{mime}} (Multipurpose Internet
2312 Mail Extensions) messages which are simply messages with additional
2313 @dfn{body parts} or @dfn{attachments}. You can use the MH commands
2314 @command{show}@footnote{See the section
2315 @uref{@value{MH-BOOK-HOME}/reapre.html, Reading Mail: inc show next
2316 prev} in the MH book.} or @command{mhshow}@footnote{See the section
2317 @uref{@value{MH-BOOK-HOME}/usimim.html#ReMIMa, Reading MIME Mail} in
2318 the MH book.} from the shell to read @sc{mime} messages@footnote{You
2319 can call them directly from Emacs if you're running the X Window
2320 System: type @kbd{M-! xterm -e mhshow @var{message-number}}. You can
2321 leave out the @samp{xterm -e} if you use @command{mhlist} or
2322 @command{mhstore}.}.
2323
2324 @cindex Emacs, packages, mm-decode
2325 @cindex mm-decode package
2326 @findex mh-toggle-mh-decode-mime-flag
2327 @kindex ; (semicolon)
2328 @vindex mh-decode-mime-flag
2329
2330 MH-E can handle attachments as well if the Gnus @samp{mm-decode}
2331 package is present. If so, the option @code{mh-decode-mime-flag} will
2332 be on. Otherwise, you'll see the @sc{mime} body parts rather than text
2333 or attachments. There isn't much point in turning off the option
2334 @code{mh-decode-mime-flag}; however, you can inspect it if it appears
2335 that the body parts are not being interpreted correctly or toggle it
2336 with the command @kbd{;} (semicolon;
2337 @code{mh-toggle-mh-decode-mime-flag}) to view the raw message. This
2338 option also controls the display of quoted-printable messages and
2339 other graphical widgets. @xref{Viewing}.
2340
2341 @cindex buttons
2342
2343 Attachments in MH-E are indicated by @dfn{buttons} like this:
2344
2345 @smallexample
2346 [1. image/jpeg; foo.jpg]...
2347 @end smallexample
2348
2349 @findex mh-next-button
2350 @findex mh-press-button
2351 @findex mh-prev-button
2352 @kindex @key{RET}
2353 @kindex K @key{TAB}
2354 @kindex K S-@key{TAB}
2355 @kindex Mouse-1
2356 @kindex Mouse-2
2357
2358 To view the contents of the button, use either @kbd{Mouse-1} or
2359 @kbd{Mouse-2} on the button or @key{RET} (@code{mh-press-button}) when
2360 the cursor is over the button. This command is a toggle so if you use
2361 it again on the same attachment, it is hidden. If Emacs does not know
2362 how to display the attachment, then Emacs offers to save the
2363 attachment in a file. To move the cursor to the next button, use the
2364 command @kbd{K @key{TAB}} (@code{mh-next-button}). If the end of the
2365 buffer is reached then the search wraps over to the start of the
2366 buffer. To move the cursor to the previous button, use the command
2367 @kbd{K S-@key{TAB}} (@code{mh-prev-button}). If the beginning of the
2368 buffer is reached then the search wraps over to the end of the buffer.
2369
2370 @cindex attachments, viewing
2371 @cindex viewing attachments
2372 @findex mh-folder-toggle-mime-part
2373 @kindex K v
2374
2375 Another way to view the contents of a button is to use the command
2376 @kbd{K v} (@code{mh-folder-toggle-mime-part}). This command displays
2377 (or hides) the attachment associated with the button under the cursor.
2378 If the cursor is not located over a button, then the cursor first
2379 moves to the next button, wrapping to the beginning of the message if
2380 necessary. This command has the advantage over the previous commands
2381 of working from the MH-Folder buffer. You can also provide a numeric
2382 prefix argument (as in @kbd{4 K v}) to view the attachment labeled
2383 with that number. If Emacs does not know how to display the
2384 attachment, then Emacs offers to save the attachment in a file.
2385
2386 @cindex @file{/etc/mailcap}
2387 @cindex files, @file{/etc/mailcap}
2388 @findex mailcap-mime-info
2389 @findex mh-display-with-external-viewer
2390 @kindex K e
2391
2392 If Emacs does not know how to view an attachment, you could save it
2393 into a file and then run some program to open it. It is easier,
2394 however, to launch the program directly from MH-E with the command
2395 @kbd{K e} (@code{mh-display-with-external-viewer}). While you'll most
2396 likely use this to view spreadsheets and documents, it is also useful
2397 to use your browser to view HTML attachments with higher fidelity than
2398 what Emacs can provide. This command displays the attachment
2399 associated with the button under the cursor. If the cursor is not
2400 located over a button, then the cursor first moves to the next button,
2401 wrapping to the beginning of the message if necessary. You can provide
2402 a numeric prefix argument (as in @kbd{4 K e}) to view the attachment
2403 labeled with that number. This command tries to provide a reasonable
2404 default for the viewer by calling the Emacs function
2405 @code{mailcap-mime-info}. This function usually reads the file
2406 @file{/etc/mailcap}.
2407
2408 @cindex attachments, saving
2409 @cindex saving attachments
2410 @findex mh-folder-save-mime-part
2411 @kindex K o
2412
2413 Use the command @kbd{K o} (@code{mh-folder-save-mime-part}) to save
2414 attachments (the mnemonic is ``output''). This command saves the
2415 attachment associated with the button under the cursor. If the cursor
2416 is not located over a button, then the cursor first moves to the next
2417 button, wrapping to the beginning of the message if necessary. You can
2418 also provide a numeric prefix argument (as in @kbd{3 K o}) to save the
2419 attachment labeled with that number. This command prompts you for a
2420 filename and suggests a specific name if it is available.
2421
2422 @cindex @command{mhn}
2423 @cindex @command{mhstore}
2424 @cindex MH commands, @command{mhn}
2425 @cindex MH commands, @command{mhstore}
2426 @findex mh-mime-save-parts
2427 @kindex K a
2428 @vindex mh-mime-save-parts-default-directory
2429
2430 You can save all of the attachments at once with the command @kbd{K a}
2431 (@code{mh-mime-save-parts}). The attachments are saved in the
2432 directory specified by the option
2433 @code{mh-mime-save-parts-default-directory} unless you use a prefix
2434 argument (as in @kbd{C-u K a}) in which case you are prompted for the
2435 directory. These directories may be superseded by MH profile
2436 components, since this function calls on @command{mhstore}
2437 (@command{mhn}) to do the work.
2438
2439 @vindex mh-mime-save-parts-default-directory
2440
2441 The default value for the option
2442 @code{mh-mime-save-parts-default-directory} is @samp{Prompt Always} so
2443 that you are always prompted for the directory in which to save the
2444 attachments. However, if you usually use the same directory within a
2445 session, then you can set this option to @samp{Prompt the First Time}
2446 to avoid the prompt each time. you can make this directory permanent
2447 by choosing @samp{Directory} and entering the directory's name.
2448
2449 @cindex attachments, inline
2450 @cindex inline attachments
2451 @findex mh-toggle-mime-buttons
2452 @kindex K t
2453 @vindex mh-display-buttons-for-inline-parts-flag
2454
2455 The sender can request that attachments should be viewed inline so
2456 that they do not really appear like an attachment at all to the
2457 reader. Most of the time, this is desirable, so by default MH-E
2458 suppresses the buttons for inline attachments. On the other hand, you
2459 may receive code or HTML which the sender has added to his message as
2460 inline attachments so that you can read them in MH-E. In this case, it
2461 is useful to see the buttons so that you know you don't have to cut
2462 and paste the code into a file; you can simply save the attachment. If
2463 you want to make the buttons visible for inline attachments, you can
2464 use the command @kbd{K t} (@code{mh-toggle-mime-buttons}) to toggle
2465 the visibility of these buttons. You can turn on these buttons
2466 permanently by turning on the option
2467 @code{mh-display-buttons-for-inline-parts-flag}.
2468
2469 MH-E cannot display all attachments inline however. It can display
2470 text (including @sc{html}) and images.
2471
2472 @cindex header field, @samp{Content-Disposition:}
2473 @cindex inline images
2474 @cindex @samp{Content-Disposition:} header field
2475 @vindex mh-max-inline-image-height
2476 @vindex mh-max-inline-image-width
2477
2478 Some older mail programs do not insert the needed
2479 plumbing@footnote{This plumbing is the @samp{Content-Disposition:}
2480 header field.} to tell MH-E whether to display the attachments inline
2481 or not. If this is the case, MH-E will display these images inline if
2482 they are smaller than the window. However, you might want to allow
2483 larger images to be displayed inline. To do this, you can change the
2484 options @code{mh-max-inline-image-width} and
2485 @code{mh-max-inline-image-height} from their default value of zero to
2486 a large number. The size of your screen is a good choice for these
2487 numbers.
2488
2489 @cindex alternatives
2490 @cindex attachments, alternatives
2491 @vindex mh-display-buttons-for-alternatives-flag
2492
2493 Sometimes, a mail program will produce multiple alternatives of an
2494 attachment in increasing degree of faithfulness to the original
2495 content. By default, only the preferred alternative is displayed. If
2496 the option @code{mh-display-buttons-for-alternatives-flag} is on, then
2497 the preferred part is shown inline and buttons are shown for each of
2498 the other alternatives.
2499
2500 @vindex mm-discouraged-alternatives
2501
2502 Many people prefer to see the @samp{text/plain} alternative rather
2503 than the @samp{text/html} alternative. To do this in MH-E, customize
2504 the option @code{mm-discouraged-alternatives}, and add
2505 @samp{text/html}. The next best alternative, if any, will be shown.
2506
2507 @findex mh-show-preferred-alternative
2508 @kindex : (colon)
2509
2510 Occasionally, though, you might want to see the preferred alternative.
2511 The command @kbd{:} (@code{mh-show-preferred-alternative}) displays
2512 the message with the default preferred alternative. This is as if
2513 @code{mm-discouraged-alternatives} is set to @samp{nil}. Use the
2514 command @key{RET} (@code{mh-show}) to show the message normally again.
2515
2516 @kindex K i
2517 @findex mh-folder-inline-mime-part
2518
2519 You can view the raw contents of an attachment with the command @kbd{K
2520 i} (@code{mh-folder-inline-mime-part}). This command displays (or
2521 hides) the contents of the attachment associated with the button under
2522 the cursor verbatim. If the cursor is not located over a button, then
2523 the cursor first moves to the next button, wrapping to the beginning
2524 of the message if necessary. You can also provide a numeric prefix
2525 argument (as in @kbd{4 K i}) to view the attachment labeled with that
2526 number.
2527
2528 For additional information on buttons, see
2529 @ifinfo
2530 @ref{Article Buttons,,,gnus}, and @ref{MIME Commands,,,gnus}.
2531 @end ifinfo
2532 @ifnotinfo
2533 the chapters @uref{http://www.gnus.org/manual/gnus_101.html#SEC101,
2534 Article Buttons} and
2535 @uref{http://www.gnus.org/manual/gnus_108.html#SEC108, MIME Commands}
2536 in the @cite{The Gnus Manual}.
2537 @end ifnotinfo
2538
2539 @node HTML, Digests, Viewing Attachments, Reading Mail
2540 @section HTML
2541
2542 @cindex HTML
2543 @cindex Gnus
2544
2545 MH-E can display messages that have been sent in HTML@footnote{This
2546 feature depends on a version of Gnus that is at least 5.10.}. The
2547 content of the message will appear in the MH-Show buffer as you would
2548 expect if the entire message is HTML, or there is an inline HTML body
2549 part. However, if there is an HTML body part that is an attachment,
2550 then you'll see a button like this:
2551
2552 @smallexample
2553 [1. text/html; foo.html]...
2554 @end smallexample
2555
2556 To see how to read the contents of this body part, see @ref{Viewing
2557 Attachments}.
2558
2559 @vindex mm-text-html-renderer
2560
2561 The browser that MH-E uses is determined by the option
2562 @code{mm-text-html-renderer}. The default setting is set automatically
2563 based upon the presence of a known browser on your system. If you wish
2564 to use a different browser, then set this option accordingly. See the
2565 documentation for the browser you use for additional information on
2566 how to use it. In particular, find and disable the option to render
2567 images as this can tip off spammers that the email address they have
2568 used is valid.
2569
2570 @vindex mm-text-html-renderer
2571
2572 If you're confused about which @code{mm-text-html-renderer} to use,
2573 here's a brief description of each, sorted by popularity, that
2574 includes the results of a quick poll of MH-E users from 2005-12-23.
2575
2576 @table @asis
2577 @cindex browser, @samp{w3m}
2578 @cindex @samp{w3m}
2579 @kindex Mouse-2
2580 @item @samp{w3m} 7
2581 The @samp{w3m} browser requires an external program. It's quick,
2582 produces pretty nice output, and best of all, it's the only browser
2583 that highlights links. These can be clicked with @kbd{Mouse-2} to view
2584 the content of the link in @samp{w3m}. The @samp{w3m} browser handles
2585 tables well and actually respects the table's width parameter (which
2586 can cause text to wrap if the author didn't anticipate that the page
2587 would be viewed in Emacs).
2588 @c -------------------------
2589 @cindex browser, @samp{w3m-standalone}
2590 @cindex @samp{w3m-standalone}
2591 @item @samp{w3m-standalone} 3
2592 This browser, along with @samp{nil} for the external browser, are the
2593 only choices that work without having to download a separate lisp
2594 package or external program. This browser is quick, but does not show
2595 links. It handles simple tables but some tables get rendered much
2596 wider than the Emacs frame. This browser was the only one not to
2597 handle the escape @samp{&ndash;} (it printed a @samp{?}), but it did
2598 render @samp{&reg;}.
2599 @c -------------------------
2600 @cindex browser, @samp{links}
2601 @cindex @samp{links}
2602 @item @samp{links} 1
2603 The @samp{links} browser requires an external program. It's quick, and
2604 produces nicer output than @samp{lynx} on single column mails in
2605 tables. However, it doesn't show links and it doesn't do as nice a job
2606 on multi-column tables as some lines wrap. At least it fits in 80
2607 columns and thus seems better than @samp{w3} and
2608 @samp{w3m-standalone}. Converts escapes such as @samp{&reg;} to (R).
2609 @c -------------------------
2610 @cindex browser, @samp{lynx}
2611 @cindex @samp{lynx}
2612 @item @samp{lynx} 1
2613 The @samp{lynx} browser requires an external program. It's quick and
2614 produces pretty decent output but it doesn't show links. It doesn't
2615 seem to do multi-column tables which makes output much cleaner. It
2616 centers the output and wraps long lines more than most. Handles
2617 @samp{&reg;}.
2618 @c -------------------------
2619 @item @samp{nil} 1
2620 This choice obviously requires an external browser. Like
2621 @samp{w3m-standalone}, it works out of the box. With this setting,
2622 HTML messages have a button for the body part which you can view with
2623 @kbd{K v} (@code{mh-folder-toggle-mime-part}).
2624 @c -------------------------
2625 @cindex browser, @samp{w3}
2626 @cindex @samp{w3}
2627 @item @samp{w3} 0
2628 This choice does not require an external program as all of the
2629 rendering is done in lisp. You do need to get the package separately.
2630 This browser is @strong{slow}, and doesn't appear to have been updated
2631 since 2001 and the author hasn't responded to my emails. It displays
2632 unknown tags instead of hiding them, so you get to see all the
2633 Microsoft crap in certain messages. Tends to make multi-column tables
2634 wider than even a full-screen Emacs can handle. Like @samp{w3m}, you
2635 can follow links, but you have to find them first as they are not
2636 highlighted. Performs well on single-column tables and handles escapes
2637 such as @samp{&reg;}.
2638 @c -------------------------
2639 @cindex browser, @samp{html2text}
2640 @cindex @samp{html2text}
2641 @item @samp{html2text} 0
2642 The @samp{html2text} browser requires an external program. I noticed
2643 that it can do some nasty things with simple HTML mails (like filling
2644 the entire message as if it were one paragraph, including signature).
2645 On another message, it displayed half of the HTML tags for some
2646 reason.
2647 @end table
2648
2649 @vindex mm-text-html-renderer
2650
2651 For a couple more sources of information about
2652 @code{mm-text-html-renderer},
2653 @ifinfo
2654 @xref{Display Customization,,,emacs-mime}, and the documentation for
2655 the Gnus command @kbd{W h} (@pxref{Article Washing,,,gnus},).
2656 @end ifinfo
2657 @ifnotinfo
2658 see section @uref{http://www.gnus.org/manual/emacs-mime_6.html,
2659 Display Customization} in the @cite{The Emacs MIME Manual} and the
2660 documentation for the Gnus command @kbd{W h} (see section
2661 @uref{http://www.gnus.org/manual/gnus_99.html, Article Washing} in the
2662 @cite{The Gnus Manual}).
2663 @end ifnotinfo
2664
2665 @cindex @file{.emacs}
2666 @cindex files, @file{.emacs}
2667 @findex browse-url-at-mouse
2668 @kindex S-Mouse-2
2669
2670 A useful key binding that you can add to to @file{~/.emacs} is the
2671 following which displays an HTML link or textual URL in an external
2672 browser when clicked with @kbd{S-mouse-2}. This binding works in any
2673 buffer, including HTML buffers.
2674
2675 @smalllisp
2676 (global-set-key [S-mouse-2] 'browse-url-at-mouse)
2677 @end smalllisp
2678
2679 @node Digests, Reading PGP, HTML, Reading Mail
2680 @section Digests
2681
2682 @cindex digests
2683 @findex mh-page-digest
2684 @findex mh-page-digest-backwards
2685 @kindex D @key{BS}
2686 @kindex D @key{SPC}
2687 @kindex @key{BS}
2688 @kindex @key{SPC}
2689
2690 A digest is a message that contains other messages. Special MH-E
2691 commands let you read digests conveniently. You can use @key{SPC} and
2692 @key{BS} to page through the digest as if it were a normal message,
2693 but if you wish to skip to the next message in the digest, use
2694 @kbd{D @key{SPC}} (@code{mh-page-digest}). To return to a previous message,
2695 use @kbd{D @key{BS}} (@code{mh-page-digest-backwards}).
2696
2697 @cindex @command{burst}
2698 @cindex MH commands, @command{burst}
2699 @cindex MH-Folder Show mode
2700 @cindex modes, MH-Folder Show
2701 @findex mh-burst-digest
2702 @kindex d
2703 @kindex D b
2704 @kindex t
2705
2706 Another handy command is @kbd{D b} (@code{mh-burst-digest}). This
2707 command uses the MH command @command{burst}@footnote{See the section
2708 @uref{@value{MH-BOOK-HOME}/burdig.html, Bursting Messages} in the MH
2709 book.} to break out each message in the digest into its own message.
2710 Using this command, you can quickly delete unwanted messages, like
2711 this: Once the digest is split up, toggle out of MH-Folder Show mode
2712 with @kbd{t} (@pxref{Folders}) so that the scan lines fill the screen
2713 and messages aren't displayed. Then use @kbd{d} (@pxref{Reading Mail})
2714 to quickly delete messages that you don't want to read (based on the
2715 @samp{Subject:} header field). You can also burst the digest to reply
2716 directly to the people who posted the messages in the digest. One
2717 problem you may encounter is that the @samp{From:} header fields are
2718 preceded with a @samp{>} so that your reply can't create the
2719 @samp{To:} field correctly. In this case, you must correct the
2720 @samp{To:} field yourself. This is described later (@pxref{Editing
2721 Drafts}).
2722
2723 @node Reading PGP, Printing, Digests, Reading Mail
2724 @section Signed and Encrypted Messages
2725
2726 @cindex GPG
2727 @cindex GnuPG
2728 @cindex Gnus
2729 @cindex OpenPGP
2730 @cindex PGP
2731 @cindex RFC 3156
2732 @cindex encrypted messages
2733 @cindex security
2734 @cindex signed messages
2735
2736 You can read encrypted or signed PGP or GPG messages with
2737 MH-E@footnote{This feature depends on post-5.10 versions of Gnus.
2738 @cite{MIME Security with OpenPGP} is documented in
2739 @uref{http://www.rfc-editor.org/rfc/rfc3156.txt, RFC 3156}. However,
2740 MH-E can also decrypt old-style PGP messages that are not in MIME
2741 format.}. This section assumes that you already have a good
2742 understanding of GPG and have set up your keys appropriately.
2743
2744 If someone sends you a signed message, here is what you'll see:
2745
2746 @smallexample
2747 @group
2748 [[PGP Signed Part:Bill Wohler <wohler@@stop.mail-abuse.org>]]
2749 This is a signed message.
2750
2751 [[End of PGP Signed Part]]
2752 @end group
2753 @end smallexample
2754
2755 @cindex keychain
2756 @cindex key server
2757 @cindex signed messages
2758
2759 If the key for the given signature is not in your keychain, you'll be
2760 given the opportunity to fetch the key from a key server and verify
2761 the key. If the message is really large, the verification process can
2762 take a long time. You can press @kbd{C-g} at any time to
2763 cancel@footnote{Unfortunately in the current version, the validation
2764 process doesn't display a message so it appears that MH-E has hung. We
2765 hope that this will be fixed in the future.}.
2766
2767 If the signature doesn't check out, you might see something like this:
2768
2769 @smallexample
2770 @group
2771 [[PGP Signed Part:Failed]]
2772 This is a signed message.
2773 This is garbage added after the signature was made.
2774
2775 [[End of PGP Signed Part]]
2776 @end group
2777 @end smallexample
2778
2779 @cindex decrypting messages
2780
2781 If someone sends you an encrypted message, MH-E will ask for your
2782 passphrase to decrypt the message. You should see something like this:
2783
2784 @smallexample
2785 @group
2786 [[PGP Encrypted Part:OK]]
2787
2788 [[PGP Signed Part:Bill Wohler <wohler@@stop.mail-abuse.org>]]
2789 This is the secret message.
2790
2791 [[End of PGP Signed Part]]
2792
2793 [[End of PGP Encrypted Part]]
2794 @end group
2795 @end smallexample
2796
2797 If there is a problem decrypting the message, the button will say:
2798
2799 @smallexample
2800 [[PGP Encrypted Part:Failed]]
2801 @end smallexample
2802
2803 You can read the contents of this button using the methods described in
2804 @ref{Viewing Attachments}. If the message were corrupted, you'd see
2805 this:
2806
2807 @smallexample
2808 [[PGP Encrypted Part:Failed]
2809 Invalid base64 data]
2810 @end smallexample
2811
2812 If your passphrase were incorrect, you'd see something like this:
2813
2814 @smallexample
2815 [GNUPG:] ENC_TO CD9C88BB610BD9AD 1 0
2816 [GNUPG:] USERID_HINT CD9C88BB610BD9AD Bill Wohler <wohler@@stop.mail-abuse.org>
2817 [GNUPG:] NEED_PASSPHRASE CD9C88BB610BD9AD CD9C88BB610BD9AD 1 0
2818 [GNUPG:] BAD_PASSPHRASE CD9C88BB610BD9AD
2819 gpg: encrypted with 1024-bit RSA key, ID 610BD9AD, created 1997-09-09
2820 "Bill Wohler <wohler@@stop.mail-abuse.org>"
2821 gpg: public key decryption failed: bad passphrase
2822 [GNUPG:] BEGIN_DECRYPTION
2823 [GNUPG:] DECRYPTION_FAILED
2824 gpg: decryption failed: secret key not available
2825 [GNUPG:] END_DECRYPTION
2826
2827 gpg exited abnormally: '2'
2828 @end smallexample
2829
2830 @vindex mh-show-pgg-bad
2831 @vindex mh-show-pgg-good
2832 @vindex mh-show-pgg-unknown
2833
2834 The appearance of the buttons is controlled by the faces
2835 @code{mh-show-pgg-good}, @code{mh-show-pgg-bad}, and
2836 @code{mh-show-pgg-unknown} depending on the validity of the signature.
2837 The latter is used whether the signature is unknown or untrusted.
2838
2839 @cindex @samp{pgg} customization group
2840 @cindex PGG
2841 @cindex customization group, @samp{pgg}
2842
2843 The @samp{pgg} customization group may have some settings which may
2844 interest you.
2845 @iftex
2846 See @cite{The PGG Manual}.
2847 @end iftex
2848 @ifinfo
2849 @xref{Top, , The PGG Manual, pgg, The PGG Manual}.
2850 @end ifinfo
2851 @ifhtml
2852 See
2853 @uref{http://www.dk.xemacs.org/Documentation/packages/html/pgg.html,
2854 @cite{The PGG Manual}}.
2855 @end ifhtml
2856
2857 @node Printing, Files and Pipes, Reading PGP, Reading Mail
2858 @section Printing Your Mail
2859
2860 @cindex printing
2861 @findex mh-ps-print-msg
2862 @findex mh-ps-print-msg-file
2863 @kindex P f
2864 @kindex P p
2865 @vindex mh-lpr-command-format
2866 @vindex mh-print-background-flag
2867
2868 To print messages in MH-E, use the command @kbd{P p}
2869 (@code{mh-ps-print-msg}). You can print all the messages in a range
2870 (as in @kbd{C-u P p 1 3 5-7 last:5 frombob @key{RET}},
2871 @pxref{Ranges}). You can also send the output to a file with @kbd{P f}
2872 (@code{mh-ps-print-msg-file}). This command will print inline text
2873 attachments but will not decrypt messages. However, when a message is
2874 displayed in an MH-Show buffer, then that buffer is used verbatim for
2875 printing with the caveat that only text attachments, if opened inline,
2876 are printed. Therefore, encrypted messages can be printed by showing
2877 and decrypting them first. The commands @kbd{P p} and @kbd{P f} do not
2878 use the options @code{mh-lpr-command-format} or
2879 @code{mh-print-background-flag}, described below.
2880
2881 @findex mh-ps-print-toggle-color
2882 @kindex P C
2883 @vindex ps-print-color-p
2884
2885 Colors are emulated on black-and-white printers with shades of gray.
2886 This might produce illegible output, even if your screen colors only
2887 use shades of gray. If this is the case, try using the command @kbd{P
2888 C} (@code{mh-ps-print-toggle-color}) to toggle between color, no
2889 color, and a black and white representation of the colors and see
2890 which works best. You change this setting permanently by customizing
2891 the option @code{ps-print-color-p}.
2892
2893 @findex mh-ps-print-toggle-faces
2894 @kindex P F
2895
2896 Another related function is the command @kbd{P F}
2897 (@code{mh-ps-print-toggle-faces}). This command toggles between using
2898 faces and not. When faces are enabled, the printed message will look
2899 very similar to the message in the MH-Show buffer.
2900
2901 @cindex ps-print package
2902 @cindex Emacs, packages, ps-print
2903
2904 MH-E uses the @samp{ps-print} package to do the printing, so you can
2905 customize the printing further by going to the @samp{ps-print}
2906 customization group.
2907
2908 @cindex @command{lpr}
2909 @cindex @command{mhl}
2910 @cindex MH commands, @command{mhl}
2911 @cindex Unix commands, @command{lpr}
2912 @findex mh-print-msg
2913 @kindex P l
2914
2915 An alternative to using the @samp{ps-print} package is the command
2916 @kbd{P l} (@code{mh-print-msg}) (the @i{l} is for @i{l}ine printer or
2917 @i{l}pr). You can print all the messages in a range. The message is
2918 formatted with @command{mhl}@footnote{See the section
2919 @uref{@value{MH-BOOK-HOME}/shomes.html#Usisho, Using mhl} in the MH
2920 book.} and printed with the @command{lpr} command.
2921
2922 @kindex P f
2923 @kindex P l
2924 @kindex P p
2925 @vindex mh-lpr-command-format
2926 @vindex mh-print-background-flag
2927
2928 The command @kbd{P l} uses two options. The option
2929 @code{mh-lpr-command-format} contains the Unix command line which
2930 performs the actual printing. The string can contain one escape,
2931 @samp{%s}, which is replaced by the name of the folder and the message
2932 number and is useful for print job names. The default setting is
2933 @code{"lpr -J '%s'"}. I use @code{"mpage -h'%s' -b Letter -H1of -mlrtb
2934 -P"} which produces a nice header and adds a bit of margin so the text
2935 fits within my printer's margins. Normally messages are printed in the
2936 foreground. If this is slow on your system, you may elect to turn on
2937 the option @code{mh-print-background-flag} to print in the background.
2938 If you do this, do not delete the message until it is printed or else
2939 the output may be truncated. These options are not used by the
2940 commands @kbd{P p} or @kbd{P f}.
2941
2942 @node Files and Pipes, Navigating, Printing, Reading Mail
2943 @section Files and Pipes
2944
2945 @cindex files
2946 @cindex pipes
2947 @findex mh-refile-or-write-again
2948 @findex mh-write-msg-to-file
2949 @kindex >
2950 @kindex !
2951
2952 MH-E does offer a couple of commands that are not a part of MH@. The
2953 first one, @kbd{>} (@code{mh-write-msg-to-file}), writes a message to
2954 a file. You are prompted for the filename. If the file already exists,
2955 the message is appended to it. You can also write the message to the
2956 file without the header by specifying a prefix argument (such as
2957 @kbd{C-u > /tmp/foobar @key{RET}}). Subsequent writes to the same file
2958 can be made with the command @kbd{!}
2959 (@code{mh-refile-or-write-again}).
2960
2961 @findex mh-pipe-msg
2962 @kindex |
2963 @kindex l
2964
2965 You can also pipe the message through a Unix shell command with the
2966 command @kbd{|} (@code{mh-pipe-msg}). You are prompted for the Unix
2967 command through which you wish to run your message. If you give a
2968 prefix argument to this command, the message header is included in the
2969 text passed to the command (the contrived example @kbd{C-u | lpr}
2970 would be done with the @kbd{l} command instead).
2971
2972 @cindex @command{shar}
2973 @cindex @command{uuencode}
2974 @cindex Unix commands, @command{shar}
2975 @cindex Unix commands, @command{uuencode}
2976 @findex mh-store-msg
2977 @kindex X s
2978 @vindex mh-store-default-directory
2979
2980 If the message is a shell archive @command{shar} or has been run
2981 through @command{uuencode} use @kbd{X s} (@code{mh-store-msg}) to
2982 extract the body of the message. The default directory for extraction
2983 is the current directory; however, you have a chance to specify a
2984 different extraction directory. The next time you use this command,
2985 the default directory is the last directory you used. If you would
2986 like to change the initial default directory, customize the option
2987 @code{mh-store-default-directory}, change the value from
2988 @samp{Current} to @samp{Directory}, and then enter the name of the
2989 directory for storing the content of these messages.
2990
2991 @findex mh-store-buffer
2992 @kindex @key{RET}
2993 @kindex X s
2994
2995 By the way, @kbd{X s} calls the Emacs Lisp function
2996 @code{mh-store-buffer}. I mention this because you can use it directly
2997 if you're editing a buffer that contains a file that has been run
2998 through @command{uuencode} or @command{shar}. For example, you can
2999 extract the contents of the current buffer in your home directory by
3000 typing @kbd{M-x mh-store-buffer @key{RET} ~ @key{RET}}.
3001
3002 @node Navigating, Miscellaneous Commands and Options, Files and Pipes, Reading Mail
3003 @section Navigating
3004
3005 @cindex moving between messages
3006 @cindex navigation
3007 @findex mh-first-msg
3008 @findex mh-goto-msg
3009 @findex mh-last-msg
3010 @findex mh-next-undeleted-msg
3011 @findex mh-next-unread-msg
3012 @findex mh-previous-undeleted-msg
3013 @findex mh-previous-unread-msg
3014 @kindex g
3015 @kindex M-<
3016 @kindex M->
3017 @kindex M-n
3018 @kindex M-p
3019 @kindex n
3020 @kindex p
3021
3022 To move on to the next message, use the command @kbd{n}
3023 (@code{mh-next-undeleted-msg}); use @kbd{p}
3024 (@code{mh-previous-undeleted-msg}) to read the previous message. To
3025 move to the next unread message, use @kbd{M-n}
3026 (@code{mh-next-unread-msg}); use @kbd{M-p}
3027 (@code{mh-previous-unread-msg}) to move to the previous unread
3028 message. These commands can be given a prefix argument to specify how
3029 many messages to skip (for example, @kbd{5 n}). You can also move to a
3030 specific message with @kbd{g} (@code{mh-goto-msg}). You can enter the
3031 message number either before or after typing @kbd{g}. In the latter
3032 case, Emacs prompts you. Finally, you can go to the first or last
3033 message with @kbd{M-<} (@code{mh-first-msg}) and @kbd{M->}
3034 (@code{mh-last-msg}) respectively.
3035
3036 @cindex MH-Folder mode
3037 @cindex modes, MH-Folder
3038 @findex next-line
3039 @findex previous-line
3040 @kindex C-n
3041 @kindex C-p
3042 @kindex @key{RET}
3043
3044 You can also use the Emacs commands @kbd{C-p} (@code{previous-line})
3045 and @kbd{C-n} (@code{next-line}) to move up and down the scan lines in
3046 the MH-Folder window. These commands can be used in conjunction with
3047 @key{RET} to look at deleted or refiled messages.
3048
3049 @cindex deleting messages
3050 @findex mh-delete-msg
3051 @kindex d
3052 @kindex n
3053 @kindex p
3054
3055 To mark a message for deletion, use the command @kbd{d}
3056 (@code{mh-delete-msg}). A @samp{D} is placed by the message in the
3057 scan window, and the next undeleted message is displayed. If the
3058 previous command had been @kbd{p}, then the next message displayed is
3059 the first undeleted message previous to the message just deleted. Use
3060 @kbd{n} to force subsequent @kbd{d} commands to move forward to the
3061 next undeleted message after deleting the message under the cursor.
3062 You may also specify a range (for example, @kbd{C-u d 1 3 5-7 last:5
3063 frombob @key{RET}}, @pxref{Ranges}).
3064
3065 @findex mh-delete-msg-no-motion
3066 @kindex C-d
3067
3068 The command @kbd{C-d} (@code{mh-delete-msg-no-motion}) marks the
3069 message (or messages in range) for deletion but leaves the cursor at
3070 the current message in case you wish to perform other operations on
3071 the message.
3072
3073 @findex mh-delete-subject
3074 @findex mh-delete-subject-or-thread
3075 @findex mh-thread-delete
3076 @findex mh-undo
3077 @kindex k
3078 @kindex T d
3079 @kindex u
3080
3081 And to delete more messages faster, you can use @kbd{k}
3082 (@code{mh-delete-subject-or-thread}) to delete all the messages with
3083 the same subject as the current message. This command puts these
3084 messages in a sequence named @samp{subject}. You can undo this action
3085 by using @kbd{u} (@code{mh-undo}) with a prefix argument and then
3086 specifying the @samp{subject} sequence. However, if the buffer is
3087 displaying a threaded view of the folder then @kbd{k} behaves like
3088 @kbd{T d} (@code{mh-thread-delete}). @xref{Threading}.
3089
3090 @findex mh-execute-commands
3091 @kindex x
3092
3093 However you mark a message for deletion, the command @kbd{x}
3094 (@code{mh-execute-commands}) actually carries out the deletion
3095 (@pxref{Folders}).
3096
3097 @vindex mh-delete-msg-hook
3098
3099 The hook @code{mh-delete-msg-hook} is called after you mark a message
3100 for deletion. For example, a past maintainer of MH-E used this once
3101 when he kept statistics on his mail usage.
3102
3103 @node Miscellaneous Commands and Options, , Navigating, Reading Mail
3104 @section Miscellaneous Commands and Options
3105
3106 This section contains a few more miscellaneous commands and options.
3107
3108 @cindex editing message
3109 @findex mh-modify
3110 @kindex M
3111
3112 There are times when you need to edit a message. For example, you may
3113 need to fix a broken Content-Type header field. You can do this with
3114 the command @kbd{M} (@code{mh-modify}). It displays the raw message in
3115 an editable buffer. When you are done editing, save and kill the
3116 buffer as you would any other.
3117
3118 @findex mh-kill-folder
3119 @findex mh-pack-folder
3120 @vindex mh-do-not-confirm-flag
3121
3122 Commands such as @code{mh-pack-folder} prompt to confirm whether to
3123 process outstanding moves and deletes or not before continuing.
3124 Turning on the option @code{mh-do-not-confirm-flag} means that these
3125 actions will be performed---which is usually desired but cannot be
3126 retracted---without question@footnote{In previous versions of MH-E,
3127 this option suppressed the confirmation in @code{mh-kill-folder}.
3128 Since this kept most users from setting this option,
3129 @code{mh-kill-folder} was modified in version 6.0 to always ask for
3130 confirmation subject to @code{mh-kill-folder-suppress-prompt-hook}.
3131 @xref{Folders}.}.
3132
3133 @cindex MH-Folder mode
3134 @cindex modes, MH-Folder
3135 @vindex mh-summary-height
3136
3137 The option @code{mh-summary-height} controls the number of scan lines
3138 displayed in the MH-Folder window, including the mode line. The
3139 default value of this option is @samp{Automatic} which means that the
3140 MH-Folder buffer will maintain the same proportional size if the frame
3141 is resized. If you'd prefer a fixed height, then choose the
3142 @samp{Fixed Size} option and enter the number of lines you'd like to
3143 see.
3144
3145 @vindex mh-bury-show-buffer-flag
3146
3147 Normally the buffer for displaying messages is buried at the bottom at
3148 the buffer stack. You may wish to disable this feature by turning off
3149 the option @code{mh-bury-show-buffer-flag}. One advantage of not
3150 burying the show buffer is that one can delete the show buffer more
3151 easily in an electric buffer list because of its proximity to its
3152 associated MH-Folder buffer. Try running @kbd{M-x
3153 electric-buffer-list} to see what I mean.
3154
3155 @cindex @file{.emacs}
3156 @cindex files, @file{.emacs}
3157 @cindex reading mail
3158
3159 Before we leave this section, I'll include a function that I use as a
3160 front end to MH-E@footnote{Stephen Gildea's favorite binding is
3161 @kbd{(global-set-key "\C-cr" 'mh-rmail)}.}. It toggles between your
3162 working window configuration, which may be quite involved---windows
3163 filled with source, compilation output, man pages, and other
3164 documentation---and your MH-E window configuration. Like the rest of
3165 the customization described in this section, simply add the following
3166 code to @file{~/.emacs}.
3167
3168 @iftex
3169 @filbreak
3170 @end iftex
3171
3172 @findex mh-rmail, example
3173
3174 @smalllisp
3175 @group
3176 (defvar my-mh-screen-saved nil
3177 "Set to non-@code{nil} when MH-E window configuration shown.")
3178 (defvar my-normal-screen nil "Normal window configuration.")
3179 (defvar my-mh-screen nil "MH-E window configuration.")
3180
3181 (defun my-mh-rmail (&optional arg)
3182 "Toggle between MH-E and normal screen configurations.
3183 With non-@code{nil} or prefix argument, @i{inc} mailbox as well
3184 when going into mail."
3185 (interactive "P") ; @r{user callable function, P=prefix arg}
3186 (setq my-mh-screen-saved ; @r{save state}
3187 (cond
3188 ;; @r{Bring up MH-E screen if arg or normal window configuration.}
3189 ;; @r{If arg or +inbox buffer doesn't exist, run mh-rmail.}
3190 ((or arg (null my-mh-screen-saved))
3191 (setq my-normal-screen (current-window-configuration))
3192 (if (or arg (null (get-buffer "+inbox")))
3193 (mh-rmail)
3194 (set-window-configuration my-mh-screen))
3195 t) ; @r{set my-mh-screen-saved to @code{t}}
3196 ;; @r{Otherwise, save MH-E screen and restore normal screen.}
3197 (t
3198 (setq my-mh-screen (current-window-configuration))
3199 (set-window-configuration my-normal-screen)
3200 nil)))) ; @r{set my-mh-screen-saved to nil}
3201
3202 (global-set-key "\C-x\r" 'my-mh-rmail) ;@r{ call with C-x @key{RET}}
3203
3204 @i{Starting MH-E}
3205
3206 @end group
3207 @end smalllisp
3208
3209 If you type an argument (@kbd{C-u}) or if @code{my-mh-screen-saved} is
3210 @code{nil} (meaning a non-MH-E window configuration), the current
3211 window configuration is saved, either the @samp{+inbox} buffer is
3212 displayed or @code{mh-rmail} is run, and the MH-E window configuration
3213 is shown. Otherwise, the MH-E window configuration is saved and the
3214 original configuration is displayed.
3215
3216 @node Folders, Sending Mail, Reading Mail, Top
3217 @chapter Organizing Your Mail with Folders
3218
3219 @cindex @samp{Folder} menu
3220 @cindex @samp{Message} menu
3221 @cindex folders
3222 @cindex menu, @samp{Folder}
3223 @cindex menu, @samp{Message}
3224 @cindex using folders
3225
3226 This chapter discusses the things you can do with folders within MH-E.
3227 The commands in this chapter are also found in the @samp{Folder} and
3228 @samp{Message} menus.
3229
3230 @table @kbd
3231 @kindex ?
3232 @findex mh-help
3233 @item ?
3234 Display cheat sheet for the MH-E commands (@code{mh-help}).
3235 @c -------------------------
3236 @kindex !
3237 @findex mh-refile-or-write-again
3238 @item !
3239 Repeat last output command (@code{mh-refile-or-write-again}).
3240 @c -------------------------
3241 @cindex @samp{Message > Copy Message to Folder...} menu item
3242 @cindex menu item, @samp{Message > Copy Message to Folder...}
3243 @kindex c
3244 @findex mh-copy-msg
3245 @item c
3246 Copy range to folder (@code{mh-copy-msg}).
3247 @c -------------------------
3248 @kindex F ?
3249 @findex mh-prefix-help
3250 @item F ?
3251 Display cheat sheet for the commands of the current prefix in
3252 minibuffer (@code{mh-prefix-help}).
3253 @c -------------------------
3254 @kindex F '
3255 @findex mh-index-ticked-messages
3256 @item F '
3257 Display ticked messages (@code{mh-index-ticked-messages}).
3258 @c -------------------------
3259 @kindex F c
3260 @findex mh-catchup
3261 @item F c
3262 Delete range from the @samp{unseen} sequence (@code{mh-catchup}).
3263 @c -------------------------
3264 @kindex F k
3265 @findex mh-kill-folder
3266 @item F k
3267 Remove folder (@code{mh-kill-folder}).
3268 @c -------------------------
3269 @cindex @samp{Folder > List Folders} menu item
3270 @cindex menu item, @samp{Folder > List Folders}
3271 @kindex F l
3272 @findex mh-list-folders
3273 @item F l
3274 List all folders (@code{mh-list-folders}).
3275 @c -------------------------
3276 @cindex @samp{Folder > View New Messages} menu item
3277 @cindex menu item, @samp{Folder > View New Messages}
3278 @kindex F n
3279 @findex mh-index-new-messages
3280 @item F n
3281 Display unseen messages (@code{mh-index-new-messages}).
3282 @c -------------------------
3283 @cindex @samp{Folder > Pack Folder} menu item
3284 @cindex menu item, @samp{Folder > Pack Folder}
3285 @kindex F p
3286 @findex mh-pack-folder
3287 @item F p
3288 Pack folder (@code{mh-pack-folder}).
3289 @c -------------------------
3290 @kindex F q
3291 @findex mh-index-sequenced-messages
3292 @item F q
3293 Display messages in any sequence (@code{mh-index-sequenced-messages}).
3294 @c -------------------------
3295 @cindex @samp{Folder > Rescan Folder} menu item
3296 @cindex menu item, @samp{Folder > Rescan Folder}
3297 @kindex F r
3298 @findex mh-rescan-folder
3299 @item F r
3300 Rescan folder (@code{mh-rescan-folder}).
3301 @c -------------------------
3302 @cindex @samp{Folder > Search...} menu item
3303 @cindex menu item, @samp{Folder > Search...}
3304 @kindex F s
3305 @findex mh-search
3306 @item F s
3307 Search your MH mail (@code{mh-search}).
3308 @c -------------------------
3309 @cindex @samp{Folder > Sort Folder} menu item
3310 @cindex menu item, @samp{Folder > Sort Folder}
3311 @kindex F S
3312 @findex mh-sort-folder
3313 @item F S
3314 Sort folder (@code{mh-sort-folder}).
3315 @c -------------------------
3316 @kindex F u
3317 @findex mh-undo-folder
3318 @item F u
3319 Undo all refiles and deletes in the current folder (@code{mh-undo-folder}).
3320 @c -------------------------
3321 @cindex @samp{Folder > Visit a Folder...} menu item
3322 @cindex menu item, @samp{Folder > Visit a Folder...}
3323 @kindex F v
3324 @findex mh-visit-folder
3325 @item F v
3326 Visit folder (@code{mh-visit-folder}).
3327 @c -------------------------
3328 @cindex @samp{Message > Refile Message} menu item
3329 @cindex menu item, @samp{Message > Refile Message}
3330 @kindex o
3331 @findex mh-refile-msg
3332 @item o
3333 Refile (output) range into folder (@code{mh-refile-msg}).
3334 @c -------------------------
3335 @cindex @samp{Folder > Quit MH-E} menu item
3336 @cindex menu item, @samp{Folder > Quit MH-E}
3337 @kindex q
3338 @findex mh-quit
3339 @item q
3340 Quit the current MH-E folder (@code{mh-quit}).
3341 @c -------------------------
3342 @cindex @samp{Folder > Toggle Show/Folder} menu item
3343 @cindex menu item, @samp{Folder > Toggle Show/Folder}
3344 @kindex t
3345 @findex mh-toggle-showing
3346 @item t
3347 Toggle between MH-Folder and MH-Folder Show modes
3348 (@code{mh-toggle-showing}).
3349 @c -------------------------
3350 @cindex @samp{Message > Undo Delete/Refile} menu item
3351 @cindex menu item, @samp{Message > Undo Delete/Refile}
3352 @kindex u
3353 @findex mh-undo
3354 @item u
3355 Undo pending deletes or refiles in range (@code{mh-undo}).
3356 @c -------------------------
3357 @cindex @samp{Message > Execute Delete/Refile} menu item
3358 @cindex menu item, @samp{Message > Execute Delete/Refile}
3359 @kindex x
3360 @findex mh-execute-commands
3361 @item x
3362 Process outstanding delete and refile requests
3363 (@code{mh-execute-commands}).
3364 @end table
3365
3366 @cindex @samp{mh-folder} customization group
3367 @cindex customization group, @samp{mh-folder}
3368
3369 The @samp{mh-folder} customization group is used to tune these
3370 commands.
3371
3372 @vtable @code
3373 @item mh-new-messages-folders
3374 Folders searched for the @samp{unseen} sequence (default:
3375 @code{Inbox}).
3376 @c -------------------------
3377 @item mh-ticked-messages-folders
3378 Folders searched for @code{mh-tick-seq} (default: @code{t}).
3379 @c -------------------------
3380 @item mh-large-folder
3381 The number of messages that indicates a large folder (default: 200).
3382 @c -------------------------
3383 @item mh-recenter-summary-flag
3384 On means to recenter the summary window (default: @samp{off}).
3385 @c -------------------------
3386 @item mh-recursive-folders-flag
3387 On means that commands which operate on folders do so recursively
3388 (default: @samp{off}).
3389 @c -------------------------
3390 @item mh-sortm-args
3391 Additional arguments for @command{sortm} (default: @code{nil}).
3392 @end vtable
3393
3394 The following hooks are available.
3395
3396 @vtable @code
3397 @item mh-after-commands-processed-hook
3398 Hook run by @kbd{x} after performing outstanding refile and delete
3399 requests (default: @code{nil}).
3400 @c -------------------------
3401 @item mh-before-commands-processed-hook
3402 Hook run by @kbd{x} before performing outstanding refile and delete
3403 requests (default: @code{nil}).
3404 @c -------------------------
3405 @item mh-before-quit-hook
3406 Hook run by q before quitting MH-E (default: @code{nil}).
3407 @c -------------------------
3408 @item mh-folder-mode-hook
3409 Hook run by @code{mh-folder-mode} when visiting a new folder (default:
3410 @code{nil}).
3411 @c -------------------------
3412 @item mh-kill-folder-suppress-prompt-hook
3413 Abnormal hook run at the beginning of @code{mh-kill-folder} (default:
3414 @code{'mh-search-p}).
3415 @c -------------------------
3416 @item mh-quit-hook
3417 Hook run by q after quitting MH-E (default: @code{nil}).
3418 @c -------------------------
3419 @item mh-refile-msg-hook
3420 Hook run by o after marking each message for refiling (default:
3421 @code{nil}).
3422 @end vtable
3423
3424 The following faces are available for customizing the appearance of
3425 the MH-Folder buffer. @xref{Scan Line Formats}.
3426
3427 @vtable @code
3428 @item mh-folder-address
3429 Recipient face.
3430 @c -------------------------
3431 @item mh-folder-body
3432 Body text face.
3433 @c -------------------------
3434 @item mh-folder-cur-msg-number
3435 Current message number face.
3436 @c -------------------------
3437 @item mh-folder-date
3438 Date face.
3439 @c -------------------------
3440 @item mh-folder-deleted
3441 Deleted message face.
3442 @c -------------------------
3443 @item mh-folder-followup
3444 @samp{Re:} face.
3445 @c -------------------------
3446 @item mh-folder-msg-number
3447 Message number face.
3448 @c -------------------------
3449 @item mh-folder-refiled
3450 Refiled message face.
3451 @c -------------------------
3452 @vindex mh-scan-format-nmh
3453 @vindex mh-scan-sent-to-me-sender-regexp
3454 @item mh-folder-sent-to-me-hint
3455 Fontification hint face in messages sent directly to us. The detection
3456 of messages sent to us is governed by the scan format
3457 @code{mh-scan-format-nmh} and regular expression
3458 @code{mh-scan-sent-to-me-sender-regexp}.
3459 @c -------------------------
3460 @vindex mh-scan-format-nmh
3461 @vindex mh-scan-sent-to-me-sender-regexp
3462 @item mh-folder-scan-format
3463 Sender face in messages sent directly to us. The detection of messages
3464 sent to us is governed by the scan format @code{mh-scan-format-nmh}
3465 and regular expression @code{mh-scan-sent-to-me-sender-regexp}.
3466 @c -------------------------
3467 @item mh-folder-subject
3468 Subject face.
3469 @c -------------------------
3470 @item mh-folder-tick
3471 Ticked message face.
3472 @c -------------------------
3473 @item mh-folder-to
3474 @samp{To:} face.
3475 @end vtable
3476
3477 @vindex mh-folder-mode-hook
3478
3479 The hook @code{mh-folder-mode-hook} is called when visiting a new
3480 folder in MH-Folder mode. This could be used to set your own key
3481 bindings, for example:
3482
3483 @vindex mh-folder-mode-hook, example
3484
3485 @smalllisp
3486 @group
3487 (defvar my-mh-init-done nil
3488 "Non-@code{nil} when one-time MH-E settings made.")
3489
3490 (defun my-mh-folder-mode-hook ()
3491 "Hook to set key bindings in MH-Folder mode."
3492 (if (not my-mh-init-done) ; @r{only need to bind the keys once }
3493 (progn
3494 (local-set-key "//" 'my-search-msg)
3495 (local-set-key "b" 'mh-burst-digest) ; @r{better use of @kbd{b}}
3496 (setq my-mh-init-done t))))
3497
3498 (add-hook 'mh-folder-mode-hook 'my-mh-folder-mode-hook)
3499
3500 (defun my-search-msg ()
3501 "Search for a regexp in the current message."
3502 (interactive) ; @r{user function}
3503 (save-window-excursion
3504 (other-window 1) ; @r{go to next window}
3505 (isearch-forward-regexp))) ; @r{string search; hit return}
3506 ; @r{ when done}
3507
3508 @i{Create additional key bindings via mh-folder-mode-hook}
3509
3510 @end group
3511 @end smalllisp
3512
3513 @cindex @command{folder}
3514 @cindex @command{refile}
3515 @cindex MH commands, @command{folder}
3516 @cindex MH commands, @command{refile}
3517 @findex mh-refile-msg
3518 @kindex o
3519 @vindex mh-refile-msg-hook
3520
3521 MH-E has analogies for each of the MH @command{folder} and
3522 @command{refile} commands@footnote{See the sections
3523 @uref{@value{MH-BOOK-HOME}/fol.html#Youfol, Your Current Folder:
3524 folder} and @uref{@value{MH-BOOK-HOME}/fol.html#Movref, Moving and
3525 Linking Messages: refile} in the MH book.}. To refile a message in
3526 another folder, use the command @kbd{o} (@code{mh-refile-msg})
3527 (mnemonic: ``output''). You are prompted for the folder name
3528 (@pxref{Folder Selection}). Note that this command can also be used to
3529 create folders. If you specify a folder that does not exist, you will
3530 be prompted to create it. The hook @code{mh-refile-msg-hook} is called
3531 after a message is marked to be refiled.
3532
3533 @findex mh-write-msg-to-file
3534 @kindex !
3535
3536 If you are refiling several messages into the same folder, you can use
3537 the command @kbd{!} (@code{mh-refile-or-write-again}) to repeat the
3538 last refile or write (for the description of @kbd{>}
3539 (@code{mh-write-msg-to-file}), @pxref{Files and Pipes}). You can use a
3540 range in either case (for example, @kbd{C-u o 1 3 5-7 last:5 frombob
3541 @key{RET}}, @pxref{Ranges}).
3542
3543 @cindex expunging refiles and deletes
3544 @cindex undoing refiles and deletes
3545 @findex mh-undo
3546 @kindex u
3547
3548 If you've deleted a message or refiled it, but changed your mind, you
3549 can cancel the action before you've executed it. Use @kbd{u}
3550 (@code{mh-undo}) to undo a refile on or deletion of a single message.
3551 You can also undo refiles and deletes for messages that are found in a
3552 given range (@pxref{Ranges}).
3553
3554 @findex mh-undo-folder
3555 @kindex F u
3556
3557 Alternatively, you can use @kbd{F u} (@code{mh-undo-folder}) to undo
3558 all refiles and deletes in the current folder.
3559
3560 @findex mh-execute-commands
3561 @kindex x
3562
3563 If you've marked messages to be deleted or refiled and you want to go
3564 ahead and delete or refile the messages, use @kbd{x}
3565 (@code{mh-execute-commands}). Many MH-E commands that may affect the
3566 numbering of the messages (such as @kbd{F r} or @kbd{F p}) will ask if
3567 you want to process refiles or deletes first and then either run
3568 @kbd{x} for you or undo the pending refiles and deletes.
3569
3570 @kindex x
3571 @vindex mh-after-commands-processed-hook
3572 @vindex mh-before-commands-processed-hook
3573 @vindex mh-current-folder
3574
3575 The command @kbd{x} runs @code{mh-before-commands-processed-hook}
3576 before the commands are processed and
3577 @code{mh-after-commands-processed-hook} after the commands are
3578 processed. Variables that are useful with the former hook include
3579 @code{mh-delete-list} and @code{mh-refile-list} which can be used to
3580 see which changes will be made to the current folder,
3581 @code{mh-current-folder}. Variables that are useful with the latter
3582 hook include @code{mh-folders-changed}, which lists which folders were
3583 affected by deletes and refiles. This list will always include the
3584 current folder @code{mh-current-folder}.
3585
3586 @findex mh-copy-msg
3587 @kindex c
3588 @kindex o
3589
3590 If you wish to copy a message to another folder, you can use the
3591 command @kbd{c} (@code{mh-copy-msg}) (see the @option{-link} argument
3592 to @command{refile}(1)). Like the command @kbd{o}, this command
3593 prompts you for the name of the target folder and you can specify a
3594 range (@pxref{Ranges}). Note that unlike the command @kbd{o}, the copy
3595 takes place immediately. The original copy remains in the current
3596 folder.
3597
3598 @cindex junk mail
3599 @cindex MH-Folder mode
3600 @cindex MH-Folder Show mode
3601 @cindex modes, MH-Folder
3602 @cindex modes, MH-Folder Show
3603 @cindex spam
3604 @findex mh-toggle-showing
3605 @kindex t
3606
3607 The command @kbd{t} (@code{mh-toggle-showing}) switches between
3608 MH-Folder mode and MH-Folder Show mode@footnote{For you Emacs wizards,
3609 this is implemented as an Emacs minor mode.}. MH-Folder mode turns off
3610 the associated show buffer so that you can perform operations on the
3611 messages quickly without reading them. This is an excellent way to
3612 prune out your junk mail or to refile a group of messages to another
3613 folder for later examination.
3614
3615 @cindex MH-Folder mode
3616 @cindex MH-Show mode
3617 @cindex modes, MH-Folder
3618 @cindex modes, MH-Show
3619 @cindex moving between messages
3620 @kindex t
3621 @vindex mh-recenter-summary-flag
3622
3623 When you use @kbd{t} to toggle from MH-Folder Show mode to MH-Folder
3624 mode, the MH-Show buffer is hidden and the MH-Folder buffer is left
3625 alone. Setting @code{mh-recenter-summary-flag} to a non-@code{nil}
3626 value causes the toggle to display as many scan lines as possible,
3627 with the cursor at the middle. The effect of
3628 @code{mh-recenter-summary-flag} is rather useful, but it can be
3629 annoying on a slow network connection.
3630
3631 @findex mh-visit-folder
3632 @kindex F v
3633 @vindex mh-large-folder
3634
3635 When you want to read the messages that you have refiled into folders,
3636 use the command @kbd{F v} (@code{mh-visit-folder}) to visit the
3637 folder. You are prompted for the folder name. The folder buffer will
3638 show just unseen messages if there are any; otherwise, it will show
3639 all the messages in the buffer as long there are fewer than
3640 @code{mh-large-folder} messages. If there are more, then you are
3641 prompted for a range of messages to scan. You can provide a prefix
3642 argument in order to specify a range of messages to show when you
3643 visit the folder (@pxref{Ranges}). In this case, regions are not used
3644 to specify the range and @code{mh-large-folder} is ignored. Note that
3645 this command can also be used to create folders. If you specify a
3646 folder that does not exist, you will be prompted to create it.
3647
3648 @findex mh-search
3649 @kindex F s
3650
3651 If you forget where you've refiled your messages, you can find them
3652 using @kbd{F s} (@code{mh-search}). @xref{Searching}.
3653
3654 @cindex @command{procmail}
3655 @cindex @samp{unseen} sequence
3656 @cindex sequence, @samp{unseen}
3657 @cindex Unix commands, @command{procmail}
3658 @cindex unseen messages, viewing
3659 @findex mh-index-new-messages
3660 @kindex F n
3661 @vindex mh-new-messages-folders
3662
3663 If you use a program such as @command{procmail} to file your incoming
3664 mail automatically, you can display new, unseen, messages using the
3665 command @kbd{F n} (@code{mh-index-new-messages}). All messages in the
3666 @samp{unseen} sequence from the folders in
3667 @code{mh-new-messages-folders} are listed. However, this list of
3668 folders can be overridden with a prefix argument: with a prefix
3669 argument, enter a space-separated list of folders, or nothing to
3670 search all folders.
3671
3672 @cindex @samp{tick} sequence
3673 @cindex sequence, @samp{tick}
3674 @cindex ticked messages, viewing
3675 @findex mh-index-ticked-messages
3676 @kindex F '
3677 @vindex mh-ticked-messages-folders
3678
3679 If you have ticked messages (@pxref{Sequences}), you can display them
3680 using the command @kbd{F '} (@code{mh-index-ticked-messages}). All
3681 messages in the @samp{tick} sequence from the folders in
3682 @code{mh-ticked-messages-folders} are listed. With a prefix argument,
3683 enter a space-separated list of folders, or nothing to search all
3684 folders.
3685
3686 @findex mh-index-sequenced-messages
3687 @kindex F q
3688 @vindex mh-new-messages-folders
3689
3690 You can display messages in any sequence with the command @kbd{F q}
3691 (@code{mh-index-sequenced-messages}). All messages from the folders in
3692 @code{mh-new-messages-folders} in the sequence you provide are listed.
3693 With a prefix argument, enter a space-separated list of folders at the
3694 prompt, or nothing to search all folders.
3695
3696 @vindex mh-new-messages-folders
3697 @vindex mh-recursive-folders-flag
3698 @vindex mh-ticked-messages-folders
3699
3700 Set the options @code{mh-new-messages-folders} and
3701 @code{mh-ticked-messages-folders} to @samp{Inbox} to search the
3702 @samp{+inbox} folder or @samp{All} to search all of the top level
3703 folders. Otherwise, list the folders that should be searched with the
3704 @samp{Choose Folders} menu item. See @code{mh-recursive-folders-flag}.
3705
3706 @cindex buffers, @samp{*MH-E Folders*}
3707 @cindex @samp{*MH-E Folders*}
3708 @findex mh-kill-folder
3709 @findex mh-list-folders
3710 @findex mh-pack-folder
3711 @findex mh-rescan-folder
3712 @findex mh-sort-folder
3713 @kindex F k
3714 @kindex F l
3715 @kindex F p
3716 @kindex F r
3717 @kindex F S
3718
3719 Other commands you can perform on folders include: @kbd{F l}
3720 (@code{mh-list-folders}), to place a listing of all the folders in
3721 your mail directory in a buffer called @samp{*MH-E Folders*}
3722 (@pxref{Miscellaneous}); @kbd{F k} (@code{mh-kill-folder}), to remove
3723 a folder; @kbd{F S} (@code{mh-sort-folder}), to sort the messages by
3724 date (see @command{sortm}(1) to see how to sort by other criteria);
3725 @kbd{F p} (@code{mh-pack-folder}), to pack a folder, removing gaps
3726 from the numbering sequence; and @kbd{F r} (@code{mh-rescan-folder}),
3727 to rescan the folder, which is useful to grab all messages in your
3728 @samp{+inbox} after processing your new mail for the first time. If
3729 you don't want to rescan the entire folder, the commands @kbd{F r} or
3730 @kbd{F p} will accept a range (@pxref{Ranges}).
3731
3732 @kindex @key{TAB}
3733 @vindex mh-recursive-folders-flag
3734
3735 By default, operations on folders work only one level at a time. Set
3736 @code{mh-recursive-folders-flag} to non-@code{nil} to operate on all
3737 folders. This mostly means that you'll be able to see all your folders
3738 when you press @key{TAB} when prompted for a folder name.
3739
3740 @findex mh-search-p
3741 @kindex k
3742 @vindex mh-kill-folder-suppress-prompt-hooks
3743
3744 The hook @code{mh-kill-folder-suppress-prompt-hooks} is an abnormal
3745 hook run at the beginning of the command @kbd{k}. The hook functions
3746 are called with no arguments and should return a non-nil value to
3747 suppress the normal prompt when you remove a folder. This is useful
3748 for folders that are easily regenerated. The default value of
3749 @code{mh-search-p} suppresses the prompt on folders generated by
3750 searching.
3751
3752 @sp 1
3753 @center @strong{NOTE}
3754
3755 @quotation
3756 Use this hook with care. If there is a bug in your hook which returns
3757 @code{t} on @samp{+inbox} and you press @kbd{k} by accident in the
3758 @code{+inbox} folder, you will not be happy.
3759 @end quotation
3760 @sp 1
3761
3762 @cindex @command{sortm}
3763 @cindex @file{.mh_profile}
3764 @cindex files, @file{.mh_profile}
3765 @cindex MH commands, @command{sortm}
3766 @cindex MH profile component, @samp{sortm:}
3767 @cindex @samp{sortm:} MH profile component
3768 @kindex F S
3769 @vindex mh-sortm-args
3770
3771 The option @code{mh-sortm-args} holds extra arguments to pass on to
3772 the command @command{sortm}@footnote{See the section
3773 @uref{@value{MH-BOOK-HOME}/sorsor.html, Sorting Messages: sortm} in the
3774 MH book.} when a prefix argument is used with @kbd{F S}. Normally
3775 default arguments to @command{sortm} are specified in the MH profile.
3776 This option may be used to provide an alternate view. For example,
3777 @samp{'(\"-nolimit\" \"-textfield\" \"subject\")} is a useful setting.
3778
3779 @cindex exiting
3780 @cindex quitting
3781 @findex mh-quit
3782 @kindex q
3783
3784 When you want to quit using MH-E and go back to editing, you can use
3785 the @kbd{q} (@code{mh-quit}) command. This buries the buffers of the
3786 current MH-E folder and restores the buffers that were present when
3787 you first ran @kbd{M-x mh-rmail}. It also removes any MH-E working
3788 buffers whose name begins with @samp{ *mh-} or @samp{*MH-E }
3789 (@pxref{Miscellaneous}). You can later restore your MH-E session by
3790 selecting the @samp{+inbox} buffer or by running @kbd{M-x mh-rmail}
3791 again.
3792
3793 @findex mh-execute-commands
3794 @kindex q
3795 @vindex mh-before-quit-hook
3796 @vindex mh-before-quit-hook, example
3797 @vindex mh-quit-hook
3798 @vindex mh-quit-hook, example
3799
3800 The two hooks @code{mh-before-quit-hook} and @code{mh-quit-hook} are
3801 called by @kbd{q}. The former one is called before the quit occurs, so
3802 you might use it to perform any MH-E operations; you could perform
3803 some query and abort the quit or call @code{mh-execute-commands}, for
3804 example. The latter is not run in an MH-E context, so you might use it
3805 to modify the window setup. If you find that @kbd{q} buries a lot of
3806 buffers that you would rather remove, you can use both
3807 @code{mh-before-quit-hook} and @code{mh-quit-hook} to accomplish that.
3808
3809 @smalllisp
3810 @group
3811 (defvar my-mh-folder-buffer-to-delete nil
3812 "Folder buffer that is being quit.")
3813
3814 (defun my-mh-before-quit-hook ()
3815 "Save folder buffer that is to be deleted."
3816 (setq my-mh-folder-buffer-to-delete (current-buffer)))
3817
3818 (defun my-mh-quit-hook ()
3819 "Kill folder buffer rather than just bury it."
3820 (set-buffer my-mh-folder-buffer-to-delete)
3821 (if (get-buffer mh-show-buffer)
3822 (kill-buffer mh-show-buffer))
3823 (kill-buffer (current-buffer)))
3824
3825 @i{Kill MH-Folder buffer instead of burying it}
3826 @end group
3827 @end smalllisp
3828
3829 @cindex folders, renaming
3830 @cindex renaming folders
3831 @findex dired
3832 @findex dired-do-rename
3833
3834 You can use dired to manipulate the folders themselves. For example, I
3835 renamed my @samp{+out} folder to the more common @samp{+outbox} by
3836 running dired on my mail directory (@kbd{M-x dired RET ~/Mail RET}),
3837 moving my cursor to @samp{out} and using the command @kbd{R}
3838 (@code{dired-do-rename}).
3839
3840 @node Sending Mail, Editing Drafts, Folders, Top
3841 @chapter Sending Mail
3842
3843 @cindex sending mail
3844 @findex mh-smail
3845 @kindex M-x mh-smail
3846
3847 You can send a mail message in several ways. You can call @kbd{M-x
3848 mh-smail} directly, or from the command line like this:
3849
3850 @cindex starting from command line
3851
3852 @smallexample
3853 $ @kbd{emacs -f mh-smail}
3854 @end smallexample
3855
3856 @findex goto-address-at-point
3857 @vindex mail-user-agent
3858
3859 There are some commands that need to send a mail message, such as
3860 @code{goto-address-at-point}. You can configure Emacs to have these
3861 commands use MH-E by setting the option @code{mail-user-agent} to
3862 @samp{Emacs interface to MH}.
3863
3864 @cindex @samp{Message} menu
3865 @cindex menu, @samp{Message}
3866
3867 From within MH-E's MH-Folder mode, other methods of sending mail are
3868 available as well. These can also be found in the @samp{Message} menu.
3869
3870 @table @kbd
3871 @cindex @samp{Message > Edit Message Again} menu item
3872 @cindex menu item, @samp{Message > Edit Message Again}
3873 @kindex e
3874 @findex mh-edit-again
3875 @item e
3876 Edit a message to send it again (@code{mh-edit-again}).
3877 @c -------------------------
3878 @cindex @samp{Message > Re-edit a Bounced Message} menu item
3879 @cindex menu item, @samp{Message > Re-edit a Bounced Message}
3880 @kindex E
3881 @findex mh-extract-rejected-mail
3882 @item E
3883 Edit a message that was returned by the mail system
3884 (@code{mh-extract-rejected-mail}).
3885 @c -------------------------
3886 @cindex @samp{Message > Forward Message...} menu item
3887 @cindex menu item, @samp{Message > Forward Message...}
3888 @kindex f
3889 @findex mh-forward
3890 @item f
3891 Forward message (@code{mh-forward}).
3892 @c -------------------------
3893 @cindex @samp{Message > Reply to Message...} menu item
3894 @cindex menu item, @samp{Message > Reply to Message...}
3895 @kindex r
3896 @findex mh-reply
3897 @item r
3898 Reply to a message (@code{mh-reply}).
3899 @c -------------------------
3900 @cindex @samp{Message > Compose a New Message} menu item
3901 @cindex menu item, @samp{Message > Compose a New Message}
3902 @kindex s
3903 @findex mh-send
3904 @item s
3905 Compose a message (@code{mh-send}).
3906 @c -------------------------
3907 @cindex @samp{Message > Redistribute Message...} menu item
3908 @cindex menu item, @samp{Message > Redistribute Message...}
3909 @kindex M-d
3910 @findex mh-redistribute
3911 @item M-d
3912 Redistribute a message (@code{mh-redistribute}).
3913 @c -------------------------
3914 @findex mh-smail
3915 @item M-x mh-smail
3916 Compose a message with the MH mail system.
3917 @c -------------------------
3918 @findex mh-smail-other-window
3919 @item M-x mh-smail-other-window
3920 Compose a message with the MH mail system in other window.
3921 @end table
3922
3923 @cindex @samp{mh-sending-mail} customization group
3924 @cindex customization group, @samp{mh-sending-mail}
3925
3926 In addition, several options from the @samp{mh-sending-mail}
3927 customization group are useful when sending mail or replying to mail.
3928 They are summarized in the following table.
3929
3930 @vtable @code
3931 @item mh-compose-forward-as-mime-flag
3932 On means that messages are forwarded as attachments (default:
3933 @samp{on}).
3934 @c -------------------------
3935 @item mh-compose-letter-function
3936 Hook run when starting a new draft (default: @code{nil}).
3937 @c -------------------------
3938 @item mh-compose-prompt-flag
3939 On means prompt for header fields when composing a new draft (default:
3940 @samp{off}).
3941 @c -------------------------
3942 @item mh-forward-subject-format
3943 Format string for forwarded message subject (default: @code{"%s:
3944 %s"}).
3945 @c -------------------------
3946 @item mh-insert-x-mailer-flag
3947 On means append an @samp{X-Mailer:} header field to the header
3948 (default: @samp{on}).
3949 @c -------------------------
3950 @item mh-redist-full-contents-flag
3951 On means the @command{dist} command needs entire letter for
3952 redistribution (default: @samp{off}).
3953 @c -------------------------
3954 @item mh-reply-default-reply-to
3955 Sets the person or persons to whom a reply will be sent (default:
3956 @samp{Prompt}).
3957 @c -------------------------
3958 @item mh-reply-show-message-flag
3959 On means the MH-Show buffer is displayed using @kbd{r}
3960 (@code{mh-reply}) (default: @samp{on}).
3961 @end vtable
3962
3963 The following hooks are available.
3964
3965 @vtable @code
3966 @item mh-annotate-msg-hook
3967 Hook run by @code{mh-annotate-msg} after annotation (default:
3968 @code{nil}).
3969 @c -------------------------
3970 @item mh-forward-hook
3971 Hook run by @code{mh-forward} on a forwarded letter (default:
3972 @code{nil}).
3973 @c -------------------------
3974 @item mh-letter-mode-hook
3975 Hook run by @code{mh-letter-mode} on a new letter (default:
3976 @code{nil}).
3977 @end vtable
3978
3979 @findex mh-annotate-msg
3980 @vindex mh-annotate-list
3981 @vindex mh-annotate-msg-hook
3982 @vindex mh-current-folder
3983
3984 A hook that is called whenever a message is sent and after the scan
3985 lines and message are annotated is @code{mh-annotate-msg-hook}. Hook
3986 functions can access the current folder name with
3987 @code{mh-current-folder} and obtain the message numbers of the
3988 annotated messages with @code{mh-annotate-list}.
3989
3990 The rest of the functions and options introduced here are explained in
3991 more detail in the following sections.
3992
3993 @menu
3994 * Composing::
3995 * Replying::
3996 * Forwarding::
3997 * Redistributing::
3998 * Editing Again::
3999 @end menu
4000
4001 @node Composing, Replying, Sending Mail, Sending Mail
4002 @section Composing
4003
4004 @cindex @file{.emacs}
4005 @cindex MH-Folder mode
4006 @cindex composing mail
4007 @cindex draft
4008 @cindex files, @file{.emacs}
4009 @cindex modes, MH-Folder
4010 @cindex sending mail
4011 @findex mh-smail
4012 @findex mh-smail-other-window
4013 @kindex M-x mh-smail
4014 @kindex M-x mh-smail-other-window
4015
4016 Outside of an MH-Folder buffer, you must call either @kbd{M-x
4017 mh-smail} or @kbd{M-x mh-smail-other-window} to compose a new message.
4018 The former command always creates a two-window layout with the current
4019 buffer on top and the draft on the bottom. Use the latter command if
4020 you would rather preserve the window layout. You may find adding the
4021 following key bindings to @file{~/.emacs} useful:
4022
4023 @smalllisp
4024 (global-set-key "\C-xm" 'mh-smail)
4025 (global-set-key "\C-x4m" 'mh-smail-other-window)
4026 @end smalllisp
4027
4028 @cindex draft folder
4029 @cindex MH-Letter mode
4030 @cindex modes, MH-Letter
4031 @findex mh-send
4032 @kindex m
4033
4034 From within a MH-Folder buffer, you can simply use the command @kbd{m}
4035 (@code{mh-send}). However you invoke @code{mh-send}, your letter
4036 appears in an Emacs buffer whose mode is MH-Letter (to see what the
4037 buffer looks like, @pxref{Sending Mail Tour}). MH-Letter mode allows
4038 you to edit your message, to check the validity of the recipients, to
4039 insert attachments and other messages into your message, and to send
4040 the message. We'll go more into depth about editing a
4041 @dfn{draft}@footnote{I highly recommend that you use a @dfn{draft
4042 folder} so that you can edit several drafts in parallel. To do so,
4043 create a folder named @samp{+drafts} for example, and add the profile
4044 component @samp{Draft-Folder: drafts} (see @code{mh-profile}(5)).} (a
4045 message you're composing) in just a moment (@pxref{Editing Drafts}).
4046
4047 @vindex mh-compose-prompt-flag
4048
4049 If you prefer to be prompted for the recipient and subject fields
4050 before the MH-Letter buffer appears, turn on the option
4051 @code{mh-compose-prompt-flag}.
4052
4053 @cindex header field, @samp{X-Mailer:}
4054 @cindex @samp{X-Mailer:} header field
4055 @vindex mh-insert-x-mailer-flag
4056
4057 MH-E adds an @samp{X-Mailer:} header field to the header that includes
4058 the version of MH-E and Emacs that you are using. If you don't want to
4059 participate in our marketing, you can turn off the option
4060 @code{mh-insert-x-mailer-flag}.
4061
4062 @cindex @command{repl}
4063 @cindex @file{components}
4064 @cindex MH commands, @command{repl}
4065 @cindex MH-Letter mode
4066 @cindex Mail mode
4067 @cindex files, @file{components}
4068 @cindex modes, MH-Letter
4069 @cindex modes, Mail
4070 @vindex mail-mode-hook
4071 @vindex mh-letter-mode-hook
4072 @vindex text-mode-hook
4073
4074 Two hooks are provided to run commands on your freshly created draft.
4075 The first hook, @code{mh-letter-mode-hook}, allows you to do some
4076 processing before editing a letter@footnote{Actually, because
4077 MH-Letter mode inherits from Mail mode, the hooks
4078 @code{text-mode-hook} and @code{mail-mode-hook} are run (in that
4079 order) before @code{mh-letter-mode-hook}.}. For example, you may wish
4080 to modify the header after @command{repl} has done its work, or you
4081 may have a complicated @file{components} file and need to tell MH-E
4082 where the cursor should go. Here's an example of how you would use
4083 this hook.
4084
4085 @findex mh-insert-signature, example
4086
4087 @smalllisp
4088 @group
4089 (defvar letter-mode-init-done-flag nil
4090 "Non-nil means one-time MH-E settings have been made.")
4091
4092 (defun my-mh-letter-mode-hook ()
4093 "Prepare letter for editing."
4094 (when (not letter-mode-init-done) ; @r{only need to bind the keys once}
4095 (local-set-key "\C-ctb" 'add-enriched-text)
4096 (local-set-key "\C-cti" 'add-enriched-text)
4097 (local-set-key "\C-ctf" 'add-enriched-text)
4098 (local-set-key "\C-cts" 'add-enriched-text)
4099 (local-set-key "\C-ctB" 'add-enriched-text)
4100 (local-set-key "\C-ctu" 'add-enriched-text)
4101 (local-set-key "\C-ctc" 'add-enriched-text)
4102 (setq letter-mode-init-done t))
4103 (save-excursion
4104 (goto-char (point-max)) ; @r{go to end of message to}
4105 (mh-insert-signature))) ; @r{insert signature}
4106
4107 @i{Prepare draft for editing via mh-letter-mode-hook}
4108
4109 @end group
4110 @end smalllisp
4111
4112 The function, @code{add-enriched-text} is defined in the example in
4113 @ref{Adding Attachments}.
4114
4115 @vindex mh-compose-letter-function
4116 @vindex mh-letter-mode-hook
4117
4118 The second hook, a function really, is
4119 @code{mh-compose-letter-function}. Like @code{mh-letter-mode-hook}, it
4120 is called just before editing a new message; however, it is the last
4121 function called before you edit your message. The consequence of this
4122 is that you can write a function to write and send the message for
4123 you. This function is passed three arguments: the contents of the
4124 @samp{To:}, @samp{Subject:}, and @samp{Cc:} header fields.
4125
4126 @node Replying, Forwarding, Composing, Sending Mail
4127 @section Replying to Mail
4128
4129 @cindex @command{mhl}
4130 @cindex @file{mhl.reply}
4131 @cindex MH commands, @command{mhl}
4132 @cindex files, @file{mhl.reply}
4133 @cindex replying
4134 @findex mh-reply
4135 @kindex r
4136
4137 To compose a reply to a message, use the @kbd{r} (@code{mh-reply})
4138 command.
4139
4140 When you reply to a message, you are first prompted with @samp{Reply
4141 to whom?}. You have several choices here.
4142
4143 @quotation
4144 @multitable @columnfractions .20 .80
4145 @c @headitem Response @tab Reply Goes To
4146 @c XXX @headitem not yet supported by SourceForge's texi2pdf.
4147 @item @b{Response} @tab @b{Reply Goes To}
4148 @c -------------------------
4149 @item @kbd{from}
4150 @tab
4151 The person who sent the message. This is the default, so @key{RET} is
4152 sufficient.
4153 @c -------------------------
4154 @item @kbd{to}
4155 @tab
4156 Replies to the sender, plus all recipients in the @samp{To:} header field.
4157 @c -------------------------
4158 @item @kbd{cc}@*@kbd{all}
4159 @tab
4160 Forms a reply to the addresses in the @samp{Mail-Followup-To:} header
4161 field if one exists; otherwise forms a reply to the sender, plus all
4162 recipients.
4163 @end multitable
4164 @end quotation
4165
4166 @cindex @command{repl}
4167 @cindex MH commands, @command{repl}
4168 @vindex mh-reply-default-reply-to
4169
4170 Depending on your answer, @command{repl}@footnote{See the section
4171 @uref{@value{MH-BOOK-HOME}/reprep.html, Replying to Messages: repl} in
4172 the MH book.} is given a different argument to form your reply.
4173 Specifically, a choice of @kbd{from} or none at all runs @samp{repl
4174 -nocc all}, and a choice of @kbd{to} runs @samp{repl -cc to}. Finally,
4175 either @kbd{cc} or @kbd{all} runs @samp{repl -cc all -nocc me}. If you
4176 find that most of the time you specify one of these choices when you
4177 reply to a message, you can change the option
4178 @code{mh-reply-default-reply-to} from its default value of
4179 @samp{Prompt} to one of the choices listed above. You can always edit
4180 the recipients in the draft.
4181
4182 @cindex @samp{repl:} MH profile component
4183 @cindex MH profile component, @samp{repl:}
4184 @cindex MH-Letter mode
4185 @cindex MH-Show mode
4186 @cindex draft
4187 @cindex modes, MH-Letter
4188 @cindex modes, MH-Show
4189
4190 Two windows are then created. One window contains the message to which
4191 you are replying in an MH-Show buffer. Your draft, in MH-Letter mode
4192 (@pxref{Editing Drafts}), is in the other window. If the reply draft
4193 was not one that you expected, check the things that affect the
4194 behavior of @command{repl} which include the @samp{repl:} profile
4195 component and the @file{replcomps} and @file{replgroupcomps} files.
4196
4197 If you supply a prefix argument (as in @kbd{C-u r}), the message you
4198 are replying to is inserted in your reply after having first been run
4199 through @command{mhl} with the format file @file{mhl.reply}. See
4200 @command{mhl}(1) or the section
4201 @uref{@value{MH-BOOK-HOME}/shomes.html#Usisho, Using mhl} in the MH
4202 book to see how you can modify the default @file{mhl.reply} file.
4203
4204 @vindex mh-yank-behavior
4205
4206 Alternatively, you can customize the option @code{mh-yank-behavior}
4207 and choose one of its @samp{Automatically} variants to do the same
4208 thing. @xref{Inserting Letter}. If you do so, the prefix argument has
4209 no effect.
4210
4211 Another way to include the message automatically in your draft is to
4212 use @samp{repl: -filter repl.filter} in your MH profile.
4213
4214 @vindex mh-reply-show-message-flag
4215
4216 If you include the message automatically, you can hide the MH-Show
4217 buffer by turning off the option @code{mh-reply-show-message-flag}.
4218
4219 If you wish to customize the header or other parts of the reply draft,
4220 please see @command{repl}(1) and @code{mh-format}(5).
4221
4222 @node Forwarding, Redistributing, Replying, Sending Mail
4223 @section Forwarding Mail
4224
4225 @cindex @command{forw}
4226 @cindex draft
4227 @cindex forwarding
4228 @cindex MH commands, @command{forw}
4229 @findex mh-forward
4230 @kindex f
4231 @vindex mh-forward-hook
4232
4233 To forward a message, use the @kbd{f} (@code{mh-forward}) command. You
4234 are prompted for the @samp{To:} and @samp{cc:} recipients. You are
4235 given a draft to edit that looks like it would if you had run the MH
4236 command @command{forw}@footnote{See the section
4237 @uref{@value{MH-BOOK-HOME}/forfor.html, Forwarding Messages: forw} in
4238 the MH book.}. You can then add some text (@pxref{Editing Drafts}).
4239 You can forward several messages by using a range (@pxref{Ranges}).
4240 All of the messages in the range are inserted into your draft. The
4241 hook @code{mh-forward-hook} is called on the draft.
4242
4243 @cindex @file{.mh_profile}
4244 @cindex files, @file{.mh_profile}
4245 @cindex MH profile component, @samp{forw:}
4246 @cindex @samp{forw:} MH profile component
4247 @vindex mh-compose-forward-as-mime-flag
4248
4249 By default, the option @code{mh-compose-forward-as-mime-flag} is on
4250 which means that the forwarded messages are included as attachments.
4251 These are inline attachments so the forwarded message should appear in
4252 the body of your recipient's mail program. If you would prefer to
4253 forward your messages verbatim (as text, inline), then turn off this
4254 option. Forwarding messages verbatim works well for short, textual
4255 messages, but your recipient won't be able to view any non-textual
4256 attachments that were in the forwarded message. Be aware that if you
4257 have @samp{forw: -mime} in your MH profile, then forwarded messages
4258 will always be included as attachments regardless of the settings of
4259 @code{mh-compose-forward-as-mime-flag}.
4260
4261 @vindex mh-forward-subject-format
4262
4263 The format of the @samp{Subject:} header field for forwarded messages
4264 is controlled by the option @code{mh-forward-subject-format}. This
4265 option is a string which includes two escapes (@samp{%s}). The first
4266 @samp{%s} is replaced with the sender of the original message, and the
4267 second one is replaced with the original @samp{Subject:}. The default
4268 value of @code{"%s: %s"} takes a message with the header:
4269
4270 @smallexample
4271 @group
4272 To: Bill Wohler <wohler@@stop.mail-abuse.org>
4273 Subject: Re: 49er football
4274 From: Greg DesBrisay <gd@@stop.mail-abuse.org>
4275 @end group
4276 @end smallexample
4277
4278 and creates a subject header field of:
4279
4280 @smallexample
4281 Subject: Greg DesBrisay: Re: 49er football
4282 @end smallexample
4283
4284 @node Redistributing, Editing Again, Forwarding, Sending Mail
4285 @section Redistributing Your Mail
4286
4287 @cindex @command{dist}
4288 @cindex MH commands, @command{dist}
4289 @cindex redistributing
4290 @findex mh-redistribute
4291 @kindex M-d
4292
4293 The command @kbd{M-d} (@code{mh-redistribute}) is similar in function
4294 to forwarding mail, but it does not allow you to edit the message, nor
4295 does it add your name to the @samp{From:} header field. It appears to
4296 the recipient as if the message had come from the original sender.
4297 When you run this command, you are prompted for the recipients.
4298
4299 @findex mh-edit-again
4300 @kindex e
4301
4302 For more information on redistributing messages, see
4303 @command{dist}(1). Also investigate the command @kbd{e}
4304 (@code{mh-edit-again}) for another way to redistribute messages
4305 (@pxref{Editing Again}).
4306
4307 @cindex @command{send}
4308 @cindex MH commands, @command{send}
4309 @vindex mh-redist-full-contents-flag
4310
4311 The option @code{mh-redist-full-contents-flag} must be turned on if
4312 @command{dist}@footnote{See the section
4313 @uref{@value{MH-BOOK-HOME}/disdis.html, Distributing Messages with
4314 dist} in the MH book.} requires the whole letter for redistribution,
4315 which is the case if @command{send}@footnote{See the section
4316 @uref{@value{MH-BOOK-HOME}/sensen.html, Sending Some Mail: comp send}
4317 in the MH book.} is compiled with the @sc{berk} option (which many
4318 people abhor). If you find that MH will not allow you to redistribute
4319 a message that has been redistributed before, turn off this option.
4320
4321 The hook @code{mh-annotate-msg-hook} is run after annotating the
4322 message and scan line (@pxref{Sending Mail}).
4323
4324 @node Editing Again, , Redistributing, Sending Mail
4325 @section Editing Old Drafts and Bounced Messages
4326
4327 @cindex @file{draft}
4328 @cindex files, @file{draft}
4329 @cindex re-editing drafts
4330 @findex mh-edit-again
4331 @kindex F v drafts
4332 @kindex e
4333 @kindex n
4334
4335 If you don't complete a draft for one reason or another, and if the
4336 draft buffer is no longer available, you can pick your draft up again
4337 with @kbd{e} (@code{mh-edit-again}). If you don't use a draft
4338 folder, your last @file{draft} file will be used. If you use draft
4339 folders, you'll need to visit the draft folder with @kbd{F v drafts
4340 @key{RET}}, use @kbd{n} to move to the appropriate message, and then
4341 use @kbd{e} to prepare the message for editing.
4342
4343 @kindex e
4344
4345 The @kbd{e} command can also be used to take messages that were sent
4346 to you and to send them to more people.
4347
4348 @cindex Mailer-Daemon
4349 @findex mh-extract-rejected-mail
4350 @kindex C-c C-c
4351 @kindex E
4352
4353 Don't use @kbd{e} to re-edit a message from a @i{Mailer-Daemon} who
4354 complained that your mail wasn't posted for some reason or another. In
4355 this case, use @kbd{E} (@code{mh-extract-rejected-mail}) to prepare
4356 the message for editing by removing the @i{Mailer-Daemon} envelope and
4357 unneeded header fields. Fix whatever addressing problem you had, and
4358 send the message again with @kbd{C-c C-c}.
4359
4360 @node Editing Drafts, Aliases, Sending Mail, Top
4361 @chapter Editing a Draft
4362
4363 @cindex @samp{Letter} menu
4364 @cindex MH-Letter mode
4365 @cindex draft
4366 @cindex editing draft
4367 @cindex menu, @samp{Letter}
4368 @cindex modes, MH-Letter
4369
4370 When you edit a message that you want to send (called a @dfn{draft} in
4371 this case), the mode used is MH-Letter. This mode provides several
4372 commands in addition to the normal Emacs editing commands to help you
4373 edit your draft. These can also be found in the @samp{Letter} menu.
4374
4375 @table @kbd
4376 @kindex @key{SPC}
4377 @findex mh-letter-complete-or-space
4378 @item @key{SPC}
4379 Perform completion or insert space (@code{mh-letter-complete-or-space}).
4380 @c -------------------------
4381 @kindex M-@key{TAB}
4382 @findex mh-letter-complete
4383 @item M-@key{TAB}
4384 Perform completion on header field or word preceding point
4385 (@code{mh-letter-complete}).
4386 @c -------------------------
4387 @kindex , (comma)
4388 @findex mh-letter-confirm-address
4389 @item , (comma)
4390 Flash alias expansion (@code{mh-letter-confirm-address}).
4391 @c -------------------------
4392 @kindex @key{TAB}
4393 @findex mh-letter-next-header-field-or-indent
4394 @item @key{TAB}
4395 Cycle to next field (@code{mh-letter-next-header-field-or-indent}).
4396 @c -------------------------
4397 @kindex S-@key{TAB}
4398 @findex mh-letter-previous-header-field
4399 @item S-@key{TAB}
4400 Cycle to the previous header field
4401 (@code{mh-letter-previous-header-field}).
4402 @c -------------------------
4403 @kindex C-c ?
4404 @findex mh-help
4405 @item C-c ?
4406 Display cheat sheet for the MH-E commands (@code{mh-help}).
4407 @c -------------------------
4408 @cindex @samp{Letter > Send This Draft} menu item
4409 @cindex menu item, @samp{Letter > Send This Draft}
4410 @kindex C-c C-c
4411 @findex mh-send-letter
4412 @item C-c C-c
4413 Save draft and send message (@code{mh-send-letter}).
4414 @c -------------------------
4415 @kindex C-c C-d
4416 @findex mh-insert-identity
4417 @item C-c C-d
4418 Insert fields specified by the given identity
4419 (@code{mh-insert-identity}). @xref{Identities}.
4420 @c -------------------------
4421 @cindex @samp{Letter > Pull in All Compositions (MH)} menu item
4422 @cindex menu item, @samp{Letter > Pull in All Compositions (MH)}
4423 @kindex C-c C-e
4424 @findex mh-mh-to-mime
4425 @item C-c C-e
4426 Compose @sc{mime} message from MH-style directives
4427 (@code{mh-mh-to-mime}).
4428 @c -------------------------
4429 @kindex C-c C-f C-a
4430 @kindex C-c C-f a
4431 @findex mh-to-field
4432 @item C-c C-f C-a
4433 @itemx C-c C-f a
4434 Move to @samp{Mail-Reply-To:} header field (@code{mh-to-field}).
4435 @c -------------------------
4436 @kindex C-c C-f C-b
4437 @kindex C-c C-f b
4438 @item C-c C-f C-b
4439 @itemx C-c C-f b
4440 Move to @samp{Bcc:} header field (@code{mh-to-field}).
4441 @c -------------------------
4442 @kindex C-c C-f C-c
4443 @kindex C-c C-f c
4444 @item C-c C-f C-c
4445 @itemx C-c C-f c
4446 Move to @samp{Cc:} header field (@code{mh-to-field}).
4447 @c -------------------------
4448 @kindex C-c C-f C-d
4449 @kindex C-c C-f d
4450 @item C-c C-f C-d
4451 @itemx C-c C-f d
4452 Move to @samp{Dcc:} header field (@code{mh-to-field}).
4453 @c -------------------------
4454 @kindex C-c C-f C-f
4455 @kindex C-c C-f f
4456 @findex mh-to-fcc
4457 @item C-c C-f C-f
4458 @itemx C-c C-f f
4459 Move to @samp{Fcc:} header field (@code{mh-to-fcc}).
4460 @c -------------------------
4461 @kindex C-c C-f C-l
4462 @kindex C-c C-f l
4463 @item C-c C-f C-l
4464 @itemx C-c C-f l
4465 Move to @samp{Mail-Followup-To:} header field (@code{mh-to-field}).
4466 @c -------------------------
4467 @kindex C-c C-f C-m
4468 @kindex C-c C-f m
4469 @item C-c C-f C-m
4470 @itemx C-c C-f m
4471 Move to @samp{From:} header field (@code{mh-to-field}).
4472 @c -------------------------
4473 @kindex C-c C-f C-r
4474 @kindex C-c C-f r
4475 @item C-c C-f C-r
4476 @itemx C-c C-f r
4477 Move to @samp{Reply-To:} header field (@code{mh-to-field}).
4478 @c -------------------------
4479 @kindex C-c C-f C-s
4480 @kindex C-c C-f s
4481 @item C-c C-f C-s
4482 @itemx C-c C-f s
4483 Move to @samp{Subject:} header field (@code{mh-to-field}).
4484 @c -------------------------
4485 @kindex C-c C-f C-t
4486 @kindex C-c C-f t
4487 @item C-c C-f C-t
4488 @itemx C-c C-f t
4489 Move to @samp{To:} header field (@code{mh-to-field}).
4490 @c -------------------------
4491 @cindex @samp{Letter > Insert a Message...} menu item
4492 @cindex menu item, @samp{Letter > Insert a Message...}
4493 @kindex C-c C-i
4494 @findex mh-insert-letter
4495 @item C-c C-i
4496 Insert a message (@code{mh-insert-letter}).
4497 @c -------------------------
4498 @kindex C-c C-m C-e
4499 @findex mh-mml-secure-message-encrypt
4500 @item C-c C-m C-e
4501 Add tag to encrypt the message (@code{mh-mml-secure-message-encrypt}).
4502 @c -------------------------
4503 @cindex @samp{Letter > Compose Forward...} menu item
4504 @cindex menu item, @samp{Letter > Compose Forward...}
4505 @kindex C-c C-m C-f
4506 @kindex C-c C-m f
4507 @findex mh-compose-forward
4508 @item C-c C-m C-f
4509 @itemx C-c C-m f
4510 Add tag to forward a message (@code{mh-compose-forward}).
4511 @c -------------------------
4512 @cindex @samp{Letter > Compose Get File (MH)...} menu item
4513 @cindex menu item, @samp{Letter > Compose Get File (MH)...}
4514 @kindex C-c C-m C-g
4515 @kindex C-c C-m g
4516 @findex mh-mh-compose-anon-ftp
4517 @item C-c C-m C-g
4518 @itemx C-c C-m g
4519 Add tag to include anonymous ftp reference to a file
4520 (@code{mh-mh-compose-anon-ftp}).
4521 @c -------------------------
4522 @cindex @samp{Letter > Compose Insertion...} menu item
4523 @cindex menu item, @samp{Letter > Compose Insertion...}
4524 @kindex C-c C-m C-i
4525 @kindex C-c C-m i
4526 @findex mh-compose-insertion
4527 @item C-c C-m C-i
4528 @itemx C-c C-m i
4529 Add tag to include a file such as an image or sound
4530 (@code{mh-compose-insertion}).
4531 @c -------------------------
4532 @cindex @samp{Letter > Pull in All Compositions (MML)} menu item
4533 @cindex menu item, @samp{Letter > Pull in All Compositions (MML)}
4534 @kindex C-c C-m C-m
4535 @kindex C-c C-m m
4536 @findex mh-mml-to-mime
4537 @item C-c C-m C-m
4538 @itemx C-c C-m m
4539 Compose @sc{mime} message from MML tags (@code{mh-mml-to-mime}).
4540 @c -------------------------
4541 @kindex C-c C-m C-n
4542 @kindex C-c C-m n
4543 @findex mh-mml-unsecure-message
4544 @item C-c C-m C-n
4545 @itemx C-c C-m n
4546 Remove any secure message tags (@code{mh-mml-unsecure-message}).
4547 @c -------------------------
4548 @kindex C-c C-m C-s
4549 @findex mh-mml-secure-message-sign
4550 @item C-c C-m C-s
4551 Add tag to sign the message (@code{mh-mml-secure-message-sign}).
4552 @c -------------------------
4553 @cindex @samp{Letter > Compose Compressed tar (MH)...} menu item
4554 @cindex menu item, @samp{Letter > Compose Compressed tar (MH)...}
4555 @kindex C-c C-m C-t
4556 @kindex C-c C-m t
4557 @findex mh-mh-compose-external-compressed-tar
4558 @item C-c C-m C-t
4559 @itemx C-c C-m t
4560 Add tag to include anonymous ftp reference to a compressed tar file
4561 (@code{mh-mh-compose-external-compressed-tar}).
4562 @c -------------------------
4563 @cindex @samp{Letter > Revert to Non-MIME Edit (MH)} menu item
4564 @cindex menu item, @samp{Letter > Revert to Non-MIME Edit (MH)}
4565 @kindex C-c C-m C-u
4566 @kindex C-c C-m u
4567 @findex mh-mh-to-mime-undo
4568 @item C-c C-m C-u
4569 @itemx C-c C-m u
4570 Undo effects of @kbd{C-c C-e} (@code{mh-mh-to-mime-undo}).
4571 @c -------------------------
4572 @kindex C-c C-m C-x
4573 @kindex C-c C-m x
4574 @findex mh-mh-compose-external-type
4575 @item C-c C-m C-x
4576 @itemx C-c C-m x
4577 Add tag to refer to a remote file
4578 (@code{mh-mh-compose-external-type}).
4579 @c -------------------------
4580 @kindex C-c C-m e e
4581 @findex mh-mml-secure-message-encrypt
4582 @item C-c C-m e e
4583 Add tag to encrypt the message (@code{mh-mml-secure-message-encrypt}).
4584 @c -------------------------
4585 @kindex C-c C-m e s
4586 @findex mh-mml-secure-message-signencrypt
4587 @item C-c C-m e s
4588 Add tag to encrypt and sign the message@*
4589 (@code{mh-mml-secure-message-signencrypt}).
4590 @c -------------------------
4591 @kindex C-c C-m s e
4592 @findex mh-mml-secure-message-signencrypt
4593 @item C-c C-m s e
4594 Add tag to encrypt and sign the message@*
4595 (@code{mh-mml-secure-message-signencrypt}).
4596 @c -------------------------
4597 @kindex C-c C-m s s
4598 @findex mh-mml-secure-message-sign
4599 @item C-c C-m s s
4600 Add tag to sign the message (@code{mh-mml-secure-message-sign}).
4601 @c -------------------------
4602 @cindex @samp{Letter > Split Current Line} menu item
4603 @cindex menu item, @samp{Letter > Split Current Line}
4604 @kindex C-c C-o
4605 @findex mh-open-line
4606 @item C-c C-o
4607 Insert a newline and leave point before it (@code{mh-open-line}).
4608 @c -------------------------
4609 @cindex @samp{Letter > Kill This Draft} menu item
4610 @cindex menu item, @samp{Letter > Kill This Draft}
4611 @kindex C-c C-q
4612 @findex mh-fully-kill-draft
4613 @item C-c C-q
4614 Quit editing and delete draft message (@code{mh-fully-kill-draft}).
4615 @c -------------------------
4616 @cindex @samp{Letter > Insert Signature} menu item
4617 @cindex menu item, @samp{Letter > Insert Signature}
4618 @kindex C-c C-s
4619 @findex mh-insert-signature
4620 @item C-c C-s
4621 Insert signature in message (@code{mh-insert-signature}).
4622 @c -------------------------
4623 @kindex C-c C-t
4624 @findex mh-letter-toggle-header-field-display
4625 @item C-c C-t
4626 Toggle display of header field at point
4627 (@code{mh-letter-toggle-header-field-display}).
4628 @c -------------------------
4629 @cindex @samp{Letter > Check Recipient} menu item
4630 @cindex menu item, @samp{Letter > Check Recipient}
4631 @kindex C-c C-w
4632 @findex mh-check-whom
4633 @item C-c C-w
4634 Verify recipients, showing expansion of any aliases
4635 (@code{mh-check-whom}).
4636 @c -------------------------
4637 @cindex @samp{Letter > Yank Current Message} menu item
4638 @cindex menu item, @samp{Letter > Yank Current Message}
4639 @kindex C-c C-y
4640 @findex mh-yank-cur-msg
4641 @item C-c C-y
4642 Insert the current message into the draft buffer
4643 (@code{mh-yank-cur-msg}).
4644 @c -------------------------
4645 @kindex C-c M-d
4646 @findex mh-insert-auto-fields
4647 @item C-c M-d
4648 Insert custom fields if recipient is found in
4649 @code{mh-auto-fields-list} (@code{mh-insert-auto-fields}).
4650 @xref{Identities}.
4651 @end table
4652
4653 @cindex @samp{mh-letter} customization group
4654 @cindex customization group, @samp{mh-letter}
4655
4656 Several options from the @samp{mh-letter} customization group are used
4657 while editing a draft.
4658
4659 @vtable @code
4660 @item mh-compose-insertion
4661 Type of @sc{mime} message tags in messages (default: @samp{MML} if
4662 available; otherwise @samp{MH}).
4663 @c -------------------------
4664 @item mh-compose-skipped-header-fields
4665 List of header fields to skip over when navigating in draft (default:
4666 @code{'("From"} @code{"Organization"} @code{"References"}
4667 @code{"In-Reply-To"} @code{"X-Face"} @code{"Face"}
4668 @code{"X-Image-URL"} @code{"X-Mailer")}.
4669 @c -------------------------
4670 @item mh-compose-space-does-completion-flag
4671 On means @key{SPC} does completion in message header (default:
4672 @samp{off}).
4673 @c -------------------------
4674 @item mh-delete-yanked-msg-window-flag
4675 On means delete any window displaying the message (default: @samp{off}).
4676 @c -------------------------
4677 @item mh-extract-from-attribution-verb
4678 Verb to use for attribution when a message is yanked by @kbd{C-c C-y}
4679 (default: @code{"wrote:"}).
4680 @c -------------------------
4681 @item mh-ins-buf-prefix
4682 String to put before each line of a yanked or inserted message
4683 (default: @code{"> "}).
4684 @c -------------------------
4685 @item mh-letter-complete-function
4686 Function to call when completing outside of address or folder fields
4687 (default: @code{ispell-complete-word}).
4688 @c -------------------------
4689 @item mh-letter-fill-column
4690 Fill column to use in MH-Letter mode (default: 72).
4691 @c -------------------------
4692 @item mh-mml-method-default
4693 Default method to use in security tags (default: @samp{PGP (MIME)} if
4694 support for it is available; otherwise @samp{None}).
4695 @c -------------------------
4696 @item mh-signature-file-name
4697 Source of user's signature (default: @code{"~/.signature"}).
4698 @c -------------------------
4699 @item mh-signature-separator-flag
4700 On means a signature separator should be inserted (default:
4701 @samp{on}).
4702 @c -------------------------
4703 @item mh-x-face-file
4704 File containing X-Face or Face header field to insert in outgoing mail.
4705 (default: @code{"~/.face"}).
4706 @c -------------------------
4707 @item mh-yank-behavior
4708 Controls which part of a message is yanked by @kbd{C-c C-y} (default:
4709 @samp{Body With Attribution}).
4710 @end vtable
4711
4712 The following hooks are available.
4713
4714 @vtable @code
4715 @item mail-citation-hook
4716 Hook for modifying a citation just inserted in the mail buffer
4717 (default: @code{nil}).
4718 @c -------------------------
4719 @item mh-before-send-letter-hook
4720 Hook run at the beginning of the @kbd{C-c C-c} command (default:
4721 @samp{nil}).
4722 @c -------------------------
4723 @item mh-mh-to-mime-hook
4724 Hook run on the formatted letter by @kbd{C-c C-e} (default:
4725 @samp{nil}).
4726 @c -------------------------
4727 @item mh-insert-signature-hook
4728 Hook run by @kbd{C-c C-s} after signature has been inserted (default:
4729 @code{nil}).
4730 @end vtable
4731
4732 The following face is available.
4733
4734 @vtable @code
4735 @item mh-letter-header-field
4736 Editable header field value face in draft buffers.
4737 @end vtable
4738
4739 The commands and options introduced here are explained in more
4740 detail in the following sections.
4741
4742 @menu
4743 * Editing Message::
4744 * Inserting Letter::
4745 * Inserting Messages::
4746 * Signature::
4747 * Picture::
4748 * Adding Attachments::
4749 * Sending PGP::
4750 * Checking Recipients::
4751 * Sending Message::
4752 * Killing Draft::
4753 @end menu
4754
4755 @node Editing Message, Inserting Letter, Editing Drafts, Editing Drafts
4756 @section Editing the Message
4757
4758 @cindex @samp{Bcc:} header field
4759 @cindex @samp{Cc:} header field
4760 @cindex @samp{Dcc:} header field
4761 @cindex @samp{From:} header field
4762 @cindex @samp{Mail-Followup-To:} header field
4763 @cindex @samp{Mail-Reply-To:} header field
4764 @cindex @samp{Reply-To:} header field
4765 @cindex @samp{Subject:} header field
4766 @cindex @samp{To:} header field
4767 @cindex editing header
4768 @cindex header field, @samp{Bcc:}
4769 @cindex header field, @samp{Cc:}
4770 @cindex header field, @samp{Dcc:}
4771 @cindex header field, @samp{From:}
4772 @cindex header field, @samp{Mail-Followup-To:}
4773 @cindex header field, @samp{Mail-Reply-To:}
4774 @cindex header field, @samp{Reply-To:}
4775 @cindex header field, @samp{Subject:}
4776 @cindex header field, @samp{To:}
4777 @findex mh-to-field
4778 @kindex C-c C-f C-t
4779 @kindex C-c C-f t
4780
4781 Because the header is part of the message, you can edit the header
4782 fields as you wish. However, several convenience commands exist to
4783 help you create and edit them. For example, the command @kbd{C-c C-f
4784 C-t} (@code{mh-to-field}; alternatively, @kbd{C-c C-f t}) moves the
4785 cursor to the @samp{To:} header field, creating it if necessary. The
4786 commands for moving to the @samp{Cc:}, @samp{Subject:}, @samp{From:},
4787 @samp{Reply-To:}, @samp{Mail-Reply-To:}, @samp{Mail-Followup-To},
4788 @samp{Bcc:}, and @samp{Dcc:} header fields are similar.
4789
4790 @findex mh-to-fcc
4791 @kindex C-c C-f C-f
4792 @kindex C-c C-f f
4793
4794 One command behaves differently from the others, namely, @kbd{C-c C-f
4795 C-f} (@code{mh-to-fcc}; alternatively, @kbd{C-c C-f f}). This command
4796 will prompt you for the folder name in which to file a copy of the
4797 draft. @xref{Folder Selection}.
4798
4799 @findex indent-relative
4800 @findex mh-letter-next-header-field-or-indent
4801 @findex mh-letter-previous-header-field
4802 @kindex @key{TAB}
4803 @kindex S-@key{TAB}
4804 @vindex mh-compose-skipped-header-fields
4805 @vindex mh-letter-header-field
4806
4807 Within the header of the message, the command@* @key{TAB}
4808 (@code{mh-letter-next-header-field-or-indent}) moves between fields
4809 that are highlighted with the face @code{mh-letter-header-field},
4810 skipping those fields listed in
4811 @code{mh-compose-skipped-header-fields}. After the last field, this
4812 command then moves point to the message body before cycling back to
4813 the first field. If point is already past the first line of the
4814 message body, then this command indents by calling
4815 @code{indent-relative} with the given prefix argument. The command
4816 @kbd{S-@key{TAB}} (@code{mh-letter-previous-header-field}) moves
4817 backwards between the fields and cycles to the body of the message
4818 after the first field. Unlike the command @key{TAB}, it will always
4819 take point to the last field from anywhere in the body.
4820
4821 @cindex alias completion
4822 @cindex completion
4823 @cindex spell check
4824 @findex ispell-complete-word
4825 @findex mh-letter-complete
4826 @findex mh-letter-complete-or-space
4827 @findex mh-letter-confirm-address
4828 @kindex , (comma)
4829 @kindex @key{SPC}
4830 @kindex M-@key{TAB}
4831 @vindex mh-alias-flash-on-comma
4832 @vindex mh-compose-space-does-completion-flag
4833 @vindex mh-letter-complete-function
4834
4835 If the field contains addresses (for example, @samp{To:} or
4836 @samp{Cc:}) or folders (for example, @samp{Fcc:}) then the command
4837 @kbd{M-@key{TAB}} (@code{mh-letter-complete}) will provide alias
4838 completion (@pxref{Aliases}). In the body of the message,
4839 @kbd{M-@key{TAB}} runs @code{mh-letter-complete-function} instead,
4840 which is set to @samp{'ispell-complete-word} by default. The command
4841 @kbd{M-@key{TAB}} (@code{mh-letter-complete}) takes a prefix argument
4842 that is passed to the @code{mh-letter-complete-function}. In addition,
4843 turn on the option @code{mh-compose-space-does-completion-flag} to use
4844 the command @key{SPC} (@code{mh-letter-complete-or-space}) to perform
4845 completion in the header as well; use a prefix argument to specify
4846 more than one space. Addresses are separated by a comma; when you
4847 press the comma, the command @code{mh-letter-confirm-address} flashes
4848 the alias expansion in the minibuffer if
4849 @code{mh-alias-flash-on-comma} is turned on.
4850
4851 @c XXX Document the replacement for the inaccessible 'long argument.
4852
4853 @findex mh-letter-toggle-header-field-display
4854 @kindex C-c C-t
4855
4856 Use the command @kbd{C-c C-t}
4857 @code{mh-letter-toggle-header-field-display} to display truncated
4858 header fields. This command is a toggle so entering it again will hide
4859 the field. This command takes a prefix argument: if negative then the
4860 field is hidden, if positive then the field is displayed (for example,
4861 @kbd{C-u C-c C-t}).
4862
4863 Be sure to leave a row of dashes or a blank line between the header
4864 and the body of the message.
4865
4866 @vindex mh-letter-fill-column
4867
4868 The body of the message is edited as you would edit any Emacs buffer
4869 although there are a few commands and options to assist you. You can
4870 change the fill column in MH-Letter mode with the option
4871 @code{mh-letter-fill-column}. By default, this option is 72 to allow
4872 others to quote your message without line wrapping.
4873
4874 @cindex filling paragraphs
4875 @cindex paragraphs, filling
4876 @findex fill-paragraph
4877 @kindex M-q
4878 @vindex mh-ins-buf-prefix
4879
4880 You'll often include messages that were sent from user agents that
4881 haven't yet realized that paragraphs consist of more than a single
4882 line. This makes for long lines that wrap in an ugly fashion. You'll
4883 find that @kbd{M-q} (@code{fill-paragraph}) works well even on these
4884 quoted messages, even if they are nested, just as long as all of the
4885 quotes match the value of @code{mh-ins-buf-prefix} (@pxref{Inserting
4886 Letter}). For example, let's assume you have the following in your
4887 draft:
4888
4889 @smallexample
4890 @group
4891 > Hopefully this gives you an idea of what I'm currently doing. I'm \
4892 not sure yet whether I'm completely satisfied with my setup, but \
4893 it's worked okay for me so far.
4894 @end group
4895 @end smallexample
4896
4897 Running @kbd{M-q} on this paragraph produces:
4898
4899 @smallexample
4900 @group
4901 > Hopefully this gives you an idea of what I'm currently doing. I'm not
4902 > sure yet whether I'm completely satisfied with my setup, but it's
4903 > worked okay for me so far.
4904 @end group
4905 @end smallexample
4906
4907 @findex mh-open-line
4908 @findex open-line
4909 @kindex C-c C-o
4910 @kindex C-o
4911
4912 The command @kbd{C-c C-o} (@code{mh-open-line}) is similar to the
4913 command @kbd{C-o} (@code{open-line}) in that it inserts a newline
4914 after point. It differs in that it also inserts the right number of
4915 quoting characters and spaces so that the next line begins in the same
4916 column as it was. This is useful when breaking up paragraphs in
4917 replies. For example, if this command was used when point was after
4918 the first period in the paragraph above, the result would be this:
4919
4920 @smallexample
4921 @group
4922 > Hopefully this gives you an idea of what I'm currently doing.
4923
4924 > I'm not
4925 > sure yet whether I'm completely satisfied with my setup, but it's
4926 > worked okay for me so far.
4927 @end group
4928 @end smallexample
4929
4930 @node Inserting Letter, Inserting Messages, Editing Message, Editing Drafts
4931 @section Inserting Letter to Which You're Replying
4932
4933 @cindex inserting messages
4934 @cindex replying to messages
4935 @cindex yanking messages
4936 @findex mh-yank-cur-msg
4937 @kindex C-c C-y
4938 @vindex mh-ins-buf-prefix
4939
4940 It is often useful to insert a snippet of text from a letter that
4941 someone mailed to provide some context for your reply. The command
4942 @kbd{C-c C-y} (@code{mh-yank-cur-msg}) does this by adding an
4943 attribution, yanking a portion of text from the message to which
4944 you're replying, and inserting @code{mh-ins-buf-prefix} (@samp{> })
4945 before each line.
4946
4947 @smallexample
4948 @group
4949 Michael W Thelen <thelenm@@stop.mail-abuse.org> wrote:
4950
4951 > Hopefully this gives you an idea of what I'm currently doing. I'm not
4952 > sure yet whether I'm completely satisfied with my setup, but it's
4953 > worked okay for me so far.
4954 @end group
4955 @end smallexample
4956
4957 @vindex mh-extract-from-attribution-verb
4958
4959 The attribution consists of the sender's name and email address
4960 followed by the content of the option
4961 @code{mh-extract-from-attribution-verb}. This option can be set to
4962 @samp{wrote:}, @samp{a écrit:}, and @samp{schrieb:}. You can also use
4963 the @samp{Custom String} menu item to enter your own verb.
4964
4965 @vindex mail-citation-hook
4966 @vindex mh-ins-buf-prefix
4967 @vindex mh-yank-behavior
4968
4969 The prefix @code{"> "} is the default setting for the option
4970 @code{mh-ins-buf-prefix}. I suggest that you not modify this option
4971 since it is used by many mailers and news readers: messages are far
4972 easier to read if several included messages have all been indented by
4973 the same string. This prefix is not inserted if you use one of the
4974 supercite flavors of @code{mh-yank-behavior} or you have added a
4975 @code{mail-citation-hook} as described below.
4976
4977 @vindex mh-delete-yanked-msg-window-flag
4978
4979 You can also turn on the @code{mh-delete-yanked-msg-window-flag}
4980 option to delete the window containing the original message after
4981 yanking it to make more room on your screen for your reply.
4982
4983 @cindex Emacs, packages, supercite
4984 @cindex supercite package
4985 @kindex r
4986 @vindex mail-citation-hook
4987 @vindex mh-yank-behavior
4988
4989 You can control how the message to which you are replying is yanked
4990 into your reply using @code{mh-yank-behavior}. To include the entire
4991 message, including the entire header, use @samp{Body and
4992 Header}@footnote{If you'd rather have the header cleaned up, use
4993 @kbd{C-u r} instead of @kbd{r} when replying
4994 (@pxref{Replying}).}@footnote{In the past you would use this setting
4995 and set @code{mail-citation-hook} to @samp{supercite}, but this usage
4996 is now deprecated in favor of the @samp{Invoke supercite} setting.}.
4997 Use @samp{Body} to yank just the body without the header. To yank only
4998 the portion of the message following the point, set this option to
4999 @samp{Below Point}.
5000
5001 Choose @samp{Invoke supercite}@footnote{@emph{Supercite} is a
5002 full-bodied, full-featured, citation package that comes standard with
5003 Emacs.} to pass the entire message and header through supercite.
5004
5005 @vindex mh-extract-from-attribution-verb
5006
5007 If the @samp{Body With Attribution} setting is used, then the message
5008 minus the header is yanked and a simple attribution line is added at
5009 the top using the value of the option
5010 @code{mh-extract-from-attribution-verb}. This is the default.
5011
5012 @kindex C-c C-y
5013 @vindex mh-delete-yanked-msg-window-flag
5014
5015 If the @samp{Invoke supercite} or @samp{Body With Attribution}
5016 settings are used, the @samp{-noformat} argument is passed to the
5017 @command{repl} program to override a @samp{-filter} or @samp{-format}
5018 argument. These settings also have @samp{Automatically} variants that
5019 perform the action automatically when you reply so that you don't need
5020 to use @kbd{C-c C-y} at all. Note that this automatic action is only
5021 performed if the show buffer matches the message being replied to.
5022 People who use the automatic variants tend to turn on the option
5023 @code{mh-delete-yanked-msg-window-flag} as well so that the show
5024 window is never displayed.
5025
5026 @vindex mh-yank-behavior
5027
5028 If the show buffer has a region, the option @code{mh-yank-behavior} is
5029 ignored unless its value is one of @samp{Attribution} variants in
5030 which case the attribution is added to the yanked region.
5031
5032 @findex trivial-cite
5033 @vindex mail-citation-hook
5034 @vindex mh-ins-buf-prefix
5035 @vindex mh-yank-behavior
5036
5037 If this isn't enough, you can gain full control over the appearance of
5038 the included text by setting @code{mail-citation-hook} to a function
5039 that modifies it. This hook is ignored if the option
5040 @code{mh-yank-behavior} is set to one of the supercite flavors.
5041 Otherwise, this option controls how much of the message is passed to
5042 the hook. The function can find the citation between point and mark
5043 and it should leave point and mark around the modified citation text
5044 for the next hook function. The standard prefix
5045 @code{mh-ins-buf-prefix} is not added if this hook is set.
5046
5047 @cindex Emacs, packages, trivial-cite
5048 @cindex trivial-cite package
5049 @vindex mh-yank-behavior
5050
5051 For example, if you use the hook function
5052 @uref{http://shasta.cs.uiuc.edu/~lrclause/tc.html,
5053 @code{trivial-cite}} (which is NOT part of Emacs), set
5054 @code{mh-yank-behavior} to @samp{Body and Header}.
5055
5056 @node Inserting Messages, Signature, Inserting Letter, Editing Drafts
5057 @section Inserting Messages
5058
5059 @cindex inserting messages
5060 @findex mh-insert-letter
5061 @findex mh-yank-behavior
5062 @kindex C-c C-i
5063 @vindex mh-ins-buf-prefix
5064 @vindex mh-invisible-header-fields-compiled
5065 @vindex mh-yank-behavior
5066
5067 Messages can be inserted with @kbd{C-c C-i} (@code{mh-insert-letter}).
5068 This command prompts you for the folder and message number, which
5069 defaults to the current message in that folder. It then inserts the
5070 messages, indented by @code{mh-ins-buf-prefix} (@samp{> }) unless
5071 @code{mh-yank-behavior} is set to one of the supercite flavors in
5072 which case supercite is used to format the message. Certain
5073 undesirable header fields (see
5074 @code{mh-invisible-header-fields-compiled}) are removed before
5075 insertion.
5076
5077 If given a prefix argument (like @kbd{C-u C-c C-i}), the header is
5078 left intact, the message is not indented, and @samp{> } is not
5079 inserted before each line. This command leaves the mark before the
5080 letter and point after it.
5081
5082 @node Signature, Picture, Inserting Messages, Editing Drafts
5083 @section Inserting Your Signature
5084
5085 @cindex signature
5086 @findex mh-insert-signature
5087 @kindex C-c C-s
5088
5089 You can insert your signature at the current cursor location with the
5090 command @kbd{C-c C-s} (@code{mh-insert-signature}).
5091
5092 @cindex files, @file{.signature}
5093 @cindex @file{.signature}
5094 @cindex vCard
5095 @vindex mh-signature-file-name
5096
5097 By default, the text of your signature is taken from the file
5098 @file{~/.signature}. You can read from other sources by changing the
5099 option @code{mh-signature-file-name}. This file may contain a
5100 @dfn{vCard} in which case an attachment is added with the vCard.
5101
5102 @findex mh-signature-separator-p
5103 @vindex mh-signature-file-name
5104 @vindex mh-signature-separator
5105 @vindex mh-signature-separator-regexp
5106
5107 The option @code{mh-signature-file-name} may also be a symbol, in
5108 which case that function is called. You may not want a signature
5109 separator to be added for you; instead you may want to insert one
5110 yourself. Options that you may find useful to do this include
5111 @code{mh-signature-separator} (when inserting a signature separator)
5112 and @code{mh-signature-separator-regexp} (for finding said separator).
5113 The function @code{mh-signature-separator-p}, which reports @code{t}
5114 if the buffer contains a separator, may be useful as well.
5115
5116 @cindex signature separator
5117 @vindex mh-signature-separator-flag
5118
5119 A signature separator (@code{"-- "}) will be added if the signature
5120 block does not contain one and @code{mh-signature-separator-flag} is
5121 on. It is not recommended that you change this option since various
5122 mail user agents, including MH-E, use the separator to present the
5123 signature differently, and to suppress the signature when replying or
5124 yanking a letter into a draft.
5125
5126 @vindex mh-insert-signature-hook
5127 @vindex mh-signature-file-name
5128
5129 The hook @code{mh-insert-signature-hook} is run after the signature is
5130 inserted. Hook functions may access the actual name of the file or the
5131 function used to insert the signature with
5132 @code{mh-signature-file-name}.
5133
5134 The signature can also be inserted using Identities.
5135 @xref{Identities}.
5136
5137 @node Picture, Adding Attachments, Signature, Editing Drafts
5138 @section Inserting Your Picture
5139
5140 @cindex @file{.face}
5141 @cindex files, @file{.face}
5142 @vindex mh-x-face-file
5143
5144 You can insert your picture in the header of your mail message so that
5145 recipients see your face in the @samp{From:} header field if their
5146 mail user agent is sophisticated enough. In MH-E, this is done by
5147 placing your image in the file named by the option
5148 @code{mh-x-face-file} which is @file{~/.face} by default.
5149
5150 @cindex @samp{Face:} header field
5151 @cindex @samp{X-Face:} header field
5152 @cindex @samp{X-Image-URL:} header field
5153 @cindex header field, @samp{Face:}
5154 @cindex header field, @samp{X-Face:}
5155 @cindex header field, @samp{X-Image-URL:}
5156
5157 If the file starts with either of the strings @samp{X-Face:},
5158 @samp{Face:} or @samp{X-Image-URL:} then the contents are added to the
5159 message header verbatim. Otherwise it is assumed that the file
5160 contains the value of the @samp{X-Face:} header field.
5161
5162 @cindex @command{compface}
5163 @cindex Unix commands, @command{compface}
5164
5165 The @samp{X-Face:} header field, which is a low-resolution, black and
5166 white image, can be generated using the
5167 @uref{ftp://ftp.cs.indiana.edu/pub/faces/compface/compface.tar.Z,
5168 @command{compface}} command. The @uref{http://www.dairiki.org/xface/,
5169 @cite{Online X-Face Converter}} is a useful resource for quick
5170 conversion of images into @samp{X-Face:} header fields.
5171
5172 Use the @uref{http://quimby.gnus.org/circus/face/make-face,
5173 @command{make-face}} script to convert a JPEG image to the higher
5174 resolution, color, @samp{Face:} header field.
5175
5176 The URL of any image can be used for the @samp{X-Image-URL:} field and
5177 no processing of the image is required.
5178
5179 @vindex mh-x-face-file
5180
5181 To prevent the setting of any of these header fields, either set
5182 @code{mh-x-face-file} to @code{nil}, or simply ensure that the file
5183 defined by this option doesn't exist.
5184
5185 @xref{Viewing}, to see how these header fields are displayed in MH-E.
5186
5187 @node Adding Attachments, Sending PGP, Picture, Editing Drafts
5188 @section Adding Attachments
5189
5190 @cindex @command{mhbuild}
5191 @cindex @command{mhn}
5192 @cindex MH commands, @command{mhbuild}
5193 @cindex MH commands, @command{mhn}
5194 @cindex MIME
5195 @cindex multimedia mail
5196
5197 MH-E has the capability to create multimedia messages. It uses the
5198 @sc{mime} (Multipurpose Internet Mail Extensions)
5199 protocol@footnote{@sc{mime} is defined in
5200 @uref{http://www.rfc-editor.org/rfc/rfc2045.txt, RFC 2045}.} The
5201 @sc{mime} protocol allows you to incorporate images, sound, video,
5202 binary files, and even commands that fetch a file with @samp{ftp} when
5203 your recipient reads the message!
5204
5205 @kindex C-c C-m
5206
5207 If you were to create a multimedia message with plain MH commands, you
5208 would insert @command{mhbuild} or @command{mhn} directives (henceforth
5209 called @dfn{MH-style directives} into your draft and use the
5210 @command{mhbuild} command in nmh or @command{mhn} command in MH and
5211 GNU mailutils to expand them. MH-E works in much the same way,
5212 although it provides a handful of commands prefixed with @kbd{C-c C-m}
5213 to insert the directives so you don't need to remember the syntax of
5214 them. Remember: you can always add MH-style directives by
5215 hand@footnote{See the section
5216 @uref{@value{MH-BOOK-HOME}/usimim.html#SeMIMa, Sending MIME Mail} in
5217 the MH book.}.
5218
5219 @cindex MIME Meta Language (MML)
5220 @cindex MML
5221 @vindex mh-compose-insertion
5222
5223 In addition to MH-style directives, MH-E also supports MML (@sc{mime}
5224 Meta Language) tags@footnote{
5225 @ifinfo
5226 @c Although the third argument should default to the
5227 @c first, makeinfo goes to the wrong Info file without it being
5228 @c different--it seems to be getting our own Composing node.
5229 @xref{Composing,,Composing with MML,emacs-mime}.
5230 @end ifinfo
5231 @ifnotinfo
5232 See the section Composing in
5233 @uref{http://www.gnus.org/manual/emacs-mime.html, @cite{The Emacs MIME
5234 Manual}}.
5235 @end ifnotinfo
5236 }. The option @code{mh-compose-insertion} can be used to choose
5237 between them. By default, this option is set to @samp{MML} if it is
5238 supported since it provides a lot more functionality. This option can
5239 also be set to @samp{MH} if MH-style directives are preferred.
5240
5241 @cindex media types
5242 @cindex MIME, media types
5243
5244 The MH-E @sc{mime} commands require a @dfn{media type} for each body
5245 part or attachment. For example, a PDF document is of type
5246 @samp{application/pdf} and an HTML document is of type
5247 @samp{text/html}. Some commands fill in the media type for you,
5248 whereas others require you to enter one.
5249
5250 @cindex @command{file}
5251 @cindex @file{/etc/mime.types}
5252 @cindex files, @file{/etc/mime.types}
5253 @cindex Unix commands, @command{file}
5254 @findex mailcap-mime-types
5255
5256 In the cases where MH-E can do so, it will determine the media type
5257 automatically. It uses the @command{file} command to do this. Failing
5258 that, the Emacs function @code{mailcap-mime-types} is used to provide
5259 a list from which to choose. This function usually reads the file
5260 @file{/etc/mime.types}.
5261
5262 Whether the media type is chosen automatically, or you choose it from
5263 a list, use the type that seems to match best the file that you are
5264 including. In the case of binaries, the media type
5265 @samp{application/x-executable} can be useful. If you can't find an
5266 appropriate media type, use @samp{text/plain} for text messages and
5267 @samp{application/octet-stream} for everything else.
5268
5269 @cindex content description
5270 @cindex MIME, content description
5271
5272 You are also sometimes asked for a @dfn{content description}. This is
5273 simply an optional brief phrase, in your own words, that describes the
5274 object. If you don't care to enter a content description, just press
5275 return and none will be included; however, a reader may skip over
5276 multimedia fields unless the content description is compelling.
5277
5278 You can also create your own @sc{mime} body parts. In the following
5279 example, I describe how you can create and edit a @samp{text/enriched}
5280 body part to liven up your plain text messages with boldface,
5281 underlining, and italics. I include an Emacs function which inserts
5282 enriched text tags.
5283
5284 @smalllisp
5285 @group
5286 (defvar enriched-text-types '(("b" . "bold") ("i" . "italic")
5287 ("u" . "underline")
5288 ("s" . "smaller") ("B" . "bigger")
5289 ("f" . "fixed")
5290 ("c" . "center"))
5291 "Alist of (final-character . tag) choices for add-enriched-text.
5292 Additional types can be found in RFC 1563.")
5293
5294 (defun add-enriched-text (begin end)
5295 "Add enriched text tags around region.
5296 The tag used comes from the list enriched-text-types and is
5297 specified by the last keystroke of the command. When called from Lisp,
5298 arguments are BEGIN and END@."
5299 (interactive "r")
5300 ;; @r{Set type to the tag indicated by the last keystroke.}
5301 (let ((type (cdr (assoc (char-to-string (logior last-input-char ?@w{`}))
5302 enriched-text-types))))
5303 (save-restriction ; @r{restores state from narrow-to-region}
5304 (narrow-to-region begin end) ; @r{narrow view to region}
5305 (goto-char (point-min)) ; @r{move to beginning of text}
5306 (insert "<" type ">") ; @r{insert beginning tag}
5307 (goto-char (point-max)) ; @r{move to end of text}
5308 (insert "</" type ">")))) ; @r{insert terminating tag}
5309 @i{Emacs function for entering enriched text}
5310
5311 @end group
5312 @end smalllisp
5313
5314 To use the function @code{add-enriched-text}, first add it to
5315 @file{~/.emacs} and create key bindings for it (@pxref{Composing}).
5316
5317 Then, in your plain text message, set the mark with @kbd{C-@@} or
5318 @kbd{C-@key{SPC}}, type in the text to be highlighted, and type @kbd{C-c t
5319 b}. This adds @samp{<bold>} where you set the mark and adds
5320 @samp{</bold>} at the location of your cursor, giving you something
5321 like: @samp{You should be <bold>very</bold>}.
5322
5323 Before sending this message, use @kbd{C-c C-m C-m}
5324 (@code{mh-mml-to-mime})@footnote{Use @kbd{C-c C-e}
5325 (@code{mh-mh-to-mime}) if you're using MH-style directives.} to add
5326 MIME header fields. Then replace @samp{text/plain} with
5327 @samp{text/enriched} in the @samp{Content-Type:} header field.
5328
5329 You may also be interested in investigating @code{sgml-mode}.
5330
5331 @subheading Including Files
5332
5333 @cindex attachments, inserting
5334 @cindex images
5335 @cindex MIME, images
5336 @cindex MIME, sound
5337 @cindex MIME, video
5338 @cindex sound
5339 @cindex video
5340 @findex mh-compose-insertion
5341 @kindex C-c C-m C-i
5342 @kindex C-c C-m i
5343 @vindex mh-compose-insertion
5344
5345 Binaries, images, sound, and video can be inserted in your message
5346 with the command @kbd{C-c C-m C-i} (@code{mh-compose-insertion}). You
5347 are prompted for the filename containing the object, the media type if
5348 it cannot be determined automatically, and a content description. If
5349 you're using MH-style directives, you will also be prompted for
5350 additional attributes.
5351
5352 @subheading Forwarding Multimedia Messages
5353
5354 @findex mh-compose-forward
5355 @kindex C-c C-m C-f
5356 @kindex C-c C-m f
5357
5358 Mail may be forwarded with @sc{mime} using the command @kbd{C-c C-m
5359 C-f} (@code{mh-compose-forward}). You are prompted for a content
5360 description, the name of the folder in which the messages to forward
5361 are located, and a range of messages, which defaults to the current
5362 message in that folder. @xref{Ranges}.
5363
5364 @subheading Including an FTP Reference
5365
5366 @cindex @command{ftp}
5367 @cindex MIME, @command{ftp}
5368 @cindex Unix commands, @command{ftp}
5369 @findex mh-mh-compose-anon-ftp
5370 @kindex C-c C-m C-g
5371 @kindex C-c C-m g
5372
5373 You can have your message initiate an @command{ftp} transfer when the
5374 recipient reads the message. To do this, use the command @kbd{C-c C-m
5375 C-g} (@code{mh-mh-compose-anon-ftp}). You are prompted for the remote
5376 host and filename, the media type, and the content description.
5377
5378 @subheading Including tar Files
5379
5380 @cindex @command{ftp}
5381 @cindex @command{tar}
5382 @cindex MIME, @command{ftp}
5383 @cindex MIME, @command{tar}
5384 @cindex Unix commands, @command{ftp}
5385 @cindex Unix commands, @command{tar}
5386 @findex mh-mh-compose-anon-ftp
5387 @findex mh-mh-compose-external-compressed-tar
5388 @kindex C-c C-m C-g
5389 @kindex C-c C-m C-t
5390 @kindex C-c C-m t
5391
5392 If the remote file is a compressed tar file, you can use @kbd{C-c C-m
5393 C-t} (@code{mh-mh-compose-external-compressed-tar}). Then, in addition
5394 to retrieving the file via anonymous @emph{ftp} as per the command
5395 @kbd{C-c C-m C-g} (@code{mh-mh-compose-anon-ftp}), the file will also
5396 be uncompressed and untarred. You are prompted for the remote host and
5397 filename and the content description.
5398
5399 @subheading Including Other External Files
5400
5401 @findex mh-mh-compose-external-type
5402 @kindex C-c C-m C-x
5403 @kindex C-c C-m x
5404
5405 The command @kbd{C-c C-m C-x} (@code{mh-mh-compose-external-type}) is
5406 a general utility for referencing external files. In fact, all of the
5407 other commands that insert tags to access external files call this
5408 command. You are prompted for the access type, remote host and
5409 filename, and content type. If you provide a prefix argument, you are
5410 also prompted for a content description, attributes, parameters, and a
5411 comment.
5412
5413 @subheading Previewing Multimedia Messages
5414
5415 When you are finished editing a @sc{mime} message, it might look like this:
5416
5417 @cartouche
5418 @smallexample
5419 3 t08/24 root received fax files on Wed Aug 24 11:00:
5420 4+t08/24 To:wohler Test<<This is a test message to get the
5421
5422
5423
5424
5425
5426 --:%% @{+inbox@} 4 msgs (1-4) Bot L4 (MH-Folder Show)---------------
5427 To: wohler
5428 cc:
5429 Subject: Test of MIME
5430 --------
5431 Here is the SETI@@Home logo:
5432
5433 <#part type="image/x-xpm" filename="~/lib/images/setiathome.xpm"
5434 disposition=inline description="SETI@@home logo">
5435 <#/part>
5436 --:** @{draft@} All L8 (MH-Letter)----------------------------------
5437
5438 @end smallexample
5439 @end cartouche
5440 @i{MH-E @sc{mime} draft}
5441
5442 @findex mh-mml-to-mime
5443 @kindex C-c C-m C-m
5444 @kindex C-c C-m m
5445
5446 Typically, you send a message with attachments just like any other
5447 message (@pxref{Sending Message}).
5448
5449 @findex mh-mml-to-mime
5450 @kindex C-c C-m C-m
5451
5452 However, you may take a sneak preview of the @sc{mime} encoding if you
5453 wish by running the command @kbd{C-c C-m C-m} (@code{mh-mml-to-mime}).
5454 The following screen shows the @sc{mime} encoding specified by the
5455 tags. You can see why mail user agents are usually built to hide these
5456 details from the user.
5457
5458 @cartouche
5459 @smallexample
5460 To: wohler
5461 cc:
5462 Subject: Test of MIME
5463 X-Mailer: MH-E 8.1; nmh 1.1; GNU Emacs 23.1
5464 MIME-Version: 1.0
5465 Content-Type: multipart/mixed; boundary="=-=-="
5466 --------
5467 --=-=-=
5468
5469 Here is the SETI@@Home logo:
5470
5471
5472 --=-=-=
5473 Content-Type: image/x-xpm
5474 Content-Disposition: inline; filename=setiathome.xpm
5475 Content-Transfer-Encoding: base64
5476 Content-Description: SETI@@home logo
5477
5478 LyogWFBNICovCnN0YXRpYyBjaGFyICogc2V0aWF0aG9tZV94cG1bXSA9IHsKIjQ1IDQ1IDc2N
5479 --:-- @{draft@} Top L1 (MH-Letter)----------------------------------
5480
5481 @end smallexample
5482 @end cartouche
5483 @i{MH-E @sc{mime} draft ready to send}
5484
5485 @cindex undo effects of mh-mml-to-mime
5486
5487 This action can be undone by running @kbd{C-_} (@code{undo}).
5488
5489 @cindex @command{mhbuild}
5490 @cindex @command{mhn}
5491 @cindex MH commands, @command{mhbuild}
5492 @cindex MH commands, @command{mhn}
5493 @cindex undo effects of mh-mh-to-mime
5494 @findex mh-mh-to-mime
5495 @findex mh-mh-to-mime-undo
5496 @kindex C-c C-e
5497 @kindex C-c C-m C-m
5498 @kindex C-c C-m C-u
5499 @kindex C-c C-m u
5500
5501 If you're using MH-style directives, use @kbd{C-c C-e}
5502 (@code{mh-mh-to-mime}) instead of @kbd{C-c C-m C-m}. This runs the
5503 command @command{mhbuild} (@command{mhn}) on the message which expands
5504 the tags@footnote{See the section
5505 @uref{@value{MH-BOOK-HOME}/usimim.html#SeMIMa, Sending MIME Mail} in
5506 the MH book.}. This action can be undone by running @kbd{C-c C-m C-u}
5507 (@code{mh-mh-to-mime-undo}), which works by reverting to a backup
5508 file. You are prompted to confirm this action, but you can avoid the
5509 confirmation by adding an argument (for example, @kbd{C-u C-c C-m
5510 C-u}).
5511
5512 @kindex C-c C-e
5513 @vindex mh-mh-to-mime-args
5514
5515 If you wish to pass additional arguments to @command{mhbuild}
5516 (@command{mhn}) to affect how it builds your message, use the option
5517 @code{mh-mh-to-mime-args}. For example, you can build a consistency
5518 check into the message by setting @code{mh-mh-to-mime-args} to
5519 @samp{-check}. The recipient of your message can then run
5520 @samp{mhbuild -check} on the message---@command{mhbuild}
5521 (@command{mhn}) will complain if the message has been corrupted on the
5522 way. The command @kbd{C-c C-e} only consults this option when given a
5523 prefix argument (as in @kbd{C-u C-c C-e}).
5524
5525 @kindex C-c C-e
5526 @vindex mh-mh-to-mime-hook
5527
5528 The hook @code{mh-mh-to-mime-hook} is called after the message has
5529 been formatted by @kbd{C-c C-e}.
5530
5531 @node Sending PGP, Checking Recipients, Adding Attachments, Editing Drafts
5532 @section Signing and Encrypting Messages
5533
5534 @cindex signing messages
5535 @cindex encrypting messages
5536 @cindex RFC 3156
5537
5538 MH-E can sign and encrypt messages as defined in
5539 @uref{http://www.rfc-editor.org/rfc/rfc3156.txt, RFC 3156}. If you
5540 should choose to sign or encrypt your message, use one of the
5541 following commands to do so any time before sending your message.
5542
5543 @findex mh-mml-secure-message-encrypt
5544 @findex mh-mml-secure-message-sign
5545 @findex mh-mml-secure-message-signencrypt
5546 @kindex C-c C-m C-e
5547 @kindex C-c C-m C-s
5548 @kindex C-c C-m e e
5549 @kindex C-c C-m e s
5550 @kindex C-c C-m s e
5551 @kindex C-c C-m s s
5552
5553 The command @kbd{C-c C-m C-s} (@code{mh-mml-secure-message-sign})
5554 inserts the following tag:
5555
5556 @smallexample
5557 <#secure method=pgpmime mode=sign>
5558 @end smallexample
5559
5560 This is used to sign your message digitally. Likewise, the command
5561 @kbd{C-c C-m C-e} (@code{mh-mml-secure-message-encrypt}) inserts the
5562 following tag:
5563
5564 @smallexample
5565 <#secure method=pgpmime mode=encrypt>
5566 @end smallexample
5567
5568 This is used to encrypt your message. Finally, the command @kbd{C-c
5569 C-m s e} (@code{mh-mml-secure-message-signencrypt}) inserts the
5570 following tag:
5571
5572 @smallexample
5573 <#secure method=pgpmime mode=signencrypt>
5574 @end smallexample
5575
5576 @findex mh-mml-unsecure-message
5577 @kindex C-c C-m C-n
5578 @kindex C-c C-m n
5579 @vindex mh-mml-method-default
5580
5581 This is used to sign and encrypt your message. In each of these cases,
5582 a proper multipart message is created for you when you send the
5583 message. Use the command @kbd{C-c C-m C-n}
5584 (@code{mh-mml-unsecure-message}) to remove these tags. Use a prefix
5585 argument (as in @kbd{C-u C-c C-m s e}) to be prompted for one of the
5586 possible security methods (see @code{mh-mml-method-default}).
5587
5588 @vindex mh-mml-method-default
5589
5590 The option @code{mh-mml-method-default} is used to select between a
5591 variety of mail security mechanisms. The default is @samp{PGP (MIME)}
5592 if it is supported; otherwise, the default is @samp{None}. Other
5593 mechanisms include vanilla @samp{PGP} and @samp{S/MIME}.
5594
5595 @cindex @samp{pgg} customization group
5596 @cindex PGG
5597 @cindex customization group, @samp{pgg}
5598
5599 The @samp{pgg} customization group may have some settings which may
5600 interest you.
5601 @iftex
5602 See @cite{The PGG Manual}.
5603 @end iftex
5604 @ifinfo
5605 @xref{Top, , The PGG Manual, pgg, The PGG Manual}.
5606 @end ifinfo
5607 @ifhtml
5608 See
5609 @uref{http://www.dk.xemacs.org/Documentation/packages/html/pgg.html,
5610 @cite{The PGG Manual}}.
5611 @end ifhtml
5612
5613 @cindex header field, @samp{Fcc:}
5614 @cindex @samp{Fcc:} header field
5615 @vindex pgg-encrypt-for-me
5616
5617 In particular, I turn on the option @code{pgg-encrypt-for-me} so that
5618 all messages I encrypt are encrypted with my public key as well. If
5619 you keep a copy of all of your outgoing mail with a @samp{Fcc:} header
5620 field, this setting is vital so that you can read the mail you write!
5621
5622 @node Checking Recipients, Sending Message, Sending PGP, Editing Drafts
5623 @section Checking Recipients
5624
5625 @cindex @samp{*MH-E Recipients*}
5626 @cindex @command{whom}
5627 @cindex MH commands, @command{whom}
5628 @cindex buffers, @samp{*MH-E Recipients*}
5629 @cindex checking recipients
5630 @cindex recipients, checking
5631 @findex mh-check-whom
5632 @kindex C-c C-w
5633
5634 The command @kbd{C-c C-w} (@code{mh-check-whom}) expands aliases so
5635 you can check the actual address(es) in the alias. A new buffer named
5636 @samp{*MH-E Recipients*} is created with the output of @command{whom}
5637 (@pxref{Miscellaneous})@footnote{See the section
5638 @uref{@value{MH-BOOK-HOME}/senove.html#WhaPro, What now? -- and the
5639 whatnow Program} in the MH book.}.
5640
5641 @node Sending Message, Killing Draft, Checking Recipients, Editing Drafts
5642 @section Sending a Message
5643
5644 @cindex buffers, @samp{*MH-E Mail Delivery*}
5645 @cindex @samp{*MH-E Mail Delivery*}
5646 @cindex sending mail
5647 @findex mh-send-letter
5648 @kindex C-c C-c
5649
5650 When you are all through editing a message, you send it with the
5651 command @kbd{C-c C-c} (@code{mh-send-letter}). You can give a prefix
5652 argument (as in @kbd{C-u C-c C-c}) to monitor the first stage of the
5653 delivery; this output can be found in a buffer called @samp{*MH-E Mail
5654 Delivery*} (@pxref{Miscellaneous}).
5655
5656 @cindex sending mail
5657 @cindex spell check
5658 @findex ispell-message
5659 @kindex C-c C-c
5660 @vindex mh-before-send-letter-hook
5661
5662 The hook @code{mh-before-send-letter-hook} is run at the beginning of
5663 the command @kbd{C-c C-c}. For example, if you want to check your
5664 spelling in your message before sending, add the function
5665 @code{ispell-message}.
5666
5667 @cindex @command{send}
5668 @cindex MH commands, @command{send}
5669 @vindex mh-send-prog
5670
5671 In case the MH @command{send} program@footnote{See the section
5672 @uref{@value{MH-BOOK-HOME}/sensen.html, Sending Some Mail: comp send}
5673 in the MH book.} is installed under a different name, use
5674 @code{mh-send-prog} to tell MH-E the name.
5675
5676 The hook @code{mh-annotate-msg-hook} is run after annotating the
5677 message and scan line (@pxref{Sending Mail}).
5678
5679 @node Killing Draft, , Sending Message, Editing Drafts
5680 @section Killing the Draft
5681
5682 @cindex killing draft
5683 @findex kill-buffer
5684 @findex mh-fully-kill-draft
5685 @kindex C-c C-q
5686 @kindex C-x k
5687
5688 If for some reason you are not happy with the draft, you can use the
5689 command @kbd{C-c C-q} (@code{mh-fully-kill-draft}) to kill the draft
5690 buffer and delete the draft message. Use the command @kbd{C-x k}
5691 (@code{kill-buffer}) if you don't want to delete the draft message.
5692
5693 @node Aliases, Identities, Editing Drafts, Top
5694 @chapter Aliases
5695
5696 @cindex aliases
5697
5698 MH aliases are used in the same way in MH-E as they are in MH. Any
5699 alias listed as a recipient will be expanded when the message is sent.
5700 This chapter discusses other things you can do with aliases in MH-E.
5701
5702 @cindex MH-Letter mode
5703 @cindex modes, MH-Letter
5704
5705 The following commands are available in MH-Letter mode with the
5706 exception of @code{mh-alias-reload} which can be called from anywhere.
5707
5708 @table @kbd
5709 @kindex @key{SPC}
5710 @findex mh-letter-complete-or-space
5711 @item @key{SPC}
5712 Perform completion or insert space (@code{mh-letter-complete-or-space}).
5713 @c -------------------------
5714 @kindex M-@key{TAB}
5715 @findex mh-letter-complete
5716 @item M-@key{TAB}
5717 Perform completion on header field or word preceding point
5718 (@code{mh-letter-complete}).
5719 @c -------------------------
5720 @findex mh-alias-apropos
5721 @item mh-alias-apropos
5722 Show all aliases or addresses that match a regular expression.
5723 @c -------------------------
5724 @findex mh-alias-grab-from-field
5725 @item mh-alias-grab-from-field
5726 Add alias for the sender of the current message
5727 @c -------------------------
5728 @findex mh-alias-reload
5729 @item mh-alias-reload
5730 Reload MH aliases.
5731 @end table
5732
5733 @cindex @samp{mh-alias} customization group
5734 @cindex customization group, @samp{mh-alias}
5735
5736 The @samp{mh-alias} customization group contains options associated
5737 with aliases.
5738
5739 @vtable @code
5740 @item mh-alias-completion-ignore-case-flag
5741 On means don't consider case significant in MH alias completion
5742 (default: @samp{on}).
5743 @c -------------------------
5744 @item mh-alias-expand-aliases-flag
5745 On means to expand aliases entered in the minibuffer (default:
5746 @samp{off}).
5747 @c -------------------------
5748 @item mh-alias-flash-on-comma
5749 Specify whether to flash address or warn on translation (default: @samp{Flash
5750 but Don't Warn If No Alias}).
5751 @c -------------------------
5752 @item mh-alias-insert-file
5753 Filename used to store a new MH-E alias (default: @samp{Use Aliasfile
5754 Profile Component}).
5755 @c -------------------------
5756 @item mh-alias-insertion-location
5757 Specifies where new aliases are entered in alias files (default:
5758 @samp{Alphabetical}).
5759 @c -------------------------
5760 @item mh-alias-local-users
5761 If @samp{on}, local users are added to alias completion (default:
5762 @samp{on}).
5763 @c -------------------------
5764 @item mh-alias-local-users-prefix
5765 String prefixed to the real names of users from the password file
5766 (default: @code{"local."}.
5767 @c -------------------------
5768 @item mh-alias-passwd-gecos-comma-separator-flag
5769 On means the GECOS field in the password file uses a comma separator
5770 (default: @samp{on}).
5771 @end vtable
5772
5773 The following hook is available.
5774
5775 @vtable @code
5776 @item mh-alias-reloaded-hook
5777 Hook run by @code{mh-alias-reload} after loading aliases (default:
5778 @code{nil}).
5779 @end vtable
5780
5781 @subheading Adding Addresses to Draft
5782
5783 You can use aliases when you are adding recipients to a message.
5784
5785 @findex minibuffer-complete
5786 @kindex @key{TAB}
5787 @vindex mh-alias-expand-aliases-flag
5788 @vindex mh-compose-prompt-flag
5789
5790 In order to use minibuffer prompting for recipients and the subject
5791 line in the minibuffer, turn on the option
5792 @code{mh-compose-prompt-flag} (@pxref{Composing}), and use the
5793 @key{TAB} (@code{minibuffer-complete}) command to complete aliases
5794 (and optionally local logins) when prompted for the recipients. Turn
5795 on the option @code{mh-alias-expand-aliases-flag} if you want these
5796 aliases to be expanded to their respective addresses in the draft.
5797
5798 @findex mh-letter-complete
5799 @findex mh-letter-complete-or-space
5800 @kindex @key{SPC}
5801 @kindex M-@key{TAB}
5802
5803 Otherwise, you can complete aliases in the header of the draft with
5804 @kbd{M-@key{TAB}} (@code{mh-letter-complete}) or @key{SPC}
5805 (@code{mh-letter-complete-or-space}).
5806
5807 @vindex mh-alias-completion-ignore-case-flag
5808
5809 As MH ignores case in the aliases, so too does MH-E. However, you may
5810 turn off the option @code{mh-alias-completion-ignore-case-flag} to
5811 make case significant which can be used to segregate completion of
5812 your aliases. You might use uppercase for mailing lists and lowercase
5813 for people. For example, you might have:
5814
5815 @smallexample
5816 mark.baushke: Mark Baushke <mdb@@stop.mail-abuse.org>
5817 MH-E: MH-E Mailing List <mh-e-devel@@stop.mail-abuse.org>
5818 @end smallexample
5819
5820 When this option is turned off, if you were to type @kbd{M} in the
5821 @samp{To:} field and then @kbd{M-@key{TAB}}, then you'd get the list;
5822 if you started with @kbd{m} and then entered @kbd{M-@key{TAB}}, then
5823 you'd get Mark's address. Note that this option affects completion
5824 only. If you were to enter @kbd{Mark.Baushke}, it would still be
5825 identified with your @samp{mark.baushke} alias.
5826
5827 @findex mh-alias-minibuffer-confirm-address
5828 @findex mh-letter-confirm-address
5829 @vindex mh-alias-flash-on-comma
5830 @vindex mh-compose-prompt-flag
5831
5832 To verify that the alias you've entered is valid, the alias will be
5833 displayed in the minibuffer when you type a comma
5834 (@code{mh-letter-confirm-address} or
5835 @code{mh-alias-minibuffer-confirm-address} if the option
5836 @code{mh-compose-prompt-flag} is turned on). @xref{Composing}. This
5837 behavior can be controlled with the option
5838 @code{mh-alias-flash-on-comma} which provides three choices:
5839 @samp{Flash but Don't Warn If No Alias}, @samp{Flash and Warn If No
5840 Alias}, and @samp{Don't Flash Nor Warn If No Alias}.
5841
5842 For another way to verify the alias expansion, see @ref{Checking
5843 Recipients}.
5844
5845 @subheading Loading Aliases
5846
5847 @cindex @command{ali}
5848 @cindex @file{/etc/nmh/MailAliases}
5849 @cindex @samp{Aliasfile:} MH profile component
5850 @cindex MH commands, @command{ali}
5851 @cindex MH profile component, @samp{Aliasfile:}
5852 @cindex files, @file{/etc/nmh/MailAliases}
5853
5854 MH-E loads aliases for completion and folder name hints from various
5855 places. It uses the MH command @command{ali}@footnote{See the section
5856 @uref{@value{MH-BOOK-HOME}/mh.html, MH Aliases} in the MH book.} to
5857 read aliases from the files listed in the profile component
5858 @samp{Aliasfile:} as well as system-wide aliases (for example,
5859 @file{/etc/nmh/MailAliases}).
5860
5861 @cindex @file{/etc/passwd}
5862 @cindex files, @file{/etc/passwd}
5863
5864 In addition, aliases are created from @file{/etc/passwd} entries with
5865 a user ID larger than a magical number, typically 200. This can be a
5866 handy tool on a machine where you and co-workers exchange messages.
5867 These aliases have the form @samp{local.@var{first.last}} if a real
5868 name is present in the password file. Otherwise, the alias will have
5869 the form @samp{local.@var{login}}.
5870
5871 @vindex mh-alias-local-users-prefix
5872
5873 The prefix @samp{local.} can be modified via the option
5874 @code{mh-alias-local-users-prefix}. This option can also be set to
5875 @samp{Use Login}.
5876
5877 For example, consider the following password file entry:
5878
5879 @smallexample
5880 psg:x:1000:1000:Peter S Galbraith,,,:/home/psg:/bin/tcsh
5881 @end smallexample
5882
5883 @vindex mh-alias-local-users-prefix
5884
5885 The following settings of option @code{mh-alias-local-users-prefix}
5886 will produce the associated aliases:
5887
5888 @table @code
5889 @item "local."
5890 local.peter.galbraith
5891 @c -------------------------
5892 @item ""
5893 peter.galbraith
5894 @c -------------------------
5895 @item Use Login
5896 psg
5897 @end table
5898
5899 @vindex mh-alias-passwd-gecos-comma-separator-flag
5900
5901 In the example above, commas are used to separate different values
5902 within the so-called GECOS field. This is a fairly common usage.
5903 However, in the rare case that the GECOS field in your password file
5904 is not separated by commas and whose contents may contain commas, you
5905 can turn the option @code{mh-alias-passwd-gecos-comma-separator-flag}
5906 off.
5907
5908 @cindex NIS, obtaining local aliases from
5909 @cindex @samp{ypcat passwd}
5910 @vindex mh-alias-local-users
5911
5912 If you're on a system with thousands of users you don't know, and the
5913 loading of local aliases slows MH-E down noticeably, then the local
5914 alias feature can be disabled by turning off the option
5915 @code{mh-alias-local-users}. This option also takes a string which is
5916 executed to generate the password file. For example, use @samp{ypcat
5917 passwd} to obtain the NIS password file.
5918
5919 @findex mh-alias-reload
5920 @kindex M-x mh-alias-reload
5921 @vindex mh-alias-reloaded-hook
5922
5923 Since aliases are updated frequently, MH-E reloads aliases
5924 automatically whenever an alias lookup occurs if an alias source has
5925 changed. However, you can reload your aliases manually by calling the
5926 command @kbd{M-x mh-alias-reload} directly. This command runs
5927 @code{mh-alias-reloaded-hook} after the aliases have been loaded.
5928
5929 @subheading Adding Aliases
5930
5931 In the past, you have manually added aliases to your alias file(s)
5932 listed in your @samp{Aliasfile:} profile component. MH-E provides
5933 other methods for maintaining your alias file(s).
5934
5935 @findex mh-alias-add-alias
5936 @kindex M-x mh-alias-add-alias
5937
5938 You can use the @kbd{M-x mh-alias-add-alias} command which will prompt
5939 you for the alias and address that you would like to add. If the alias
5940 exists already, you will have the choice of inserting the new alias
5941 before or after the old alias. In the former case, this alias will be
5942 used when sending mail to this alias. In the latter case, the alias
5943 serves as an additional folder name hint when filing messages
5944 (@pxref{Folder Selection}).
5945
5946 Earlier, the alias prefix @samp{local} was presented. You can use
5947 other prefixes to organize your aliases or disambiguate entries. You
5948 might use prefixes for locales, jobs, or activities. For example, I
5949 have:
5950
5951 @smallexample
5952 @group
5953 ; Work
5954 attensity.don.mitchell: Don Mitchell <dmitchell@@stop.mail-abuse.com>
5955 isharp.don.mitchell: Don Mitchell <donaldsmitchell@@stop.mail-abuse.com>
5956 ...
5957 ; Sport
5958 diving.ken.mayer: Ken Mayer <kmayer@@stop.mail-abuse.com>
5959 sailing.mike.maloney: Mike Maloney <mmaloney@@stop.mail-abuse.com>
5960 ...
5961 ; Personal
5962 ariane.kolkmann: Ariane Kolkmann <ArianeKolkmann@@stop.mail-abuse.com>
5963 ...
5964 @end group
5965 @end smallexample
5966
5967 Using prefixes instead of postfixes helps you explore aliases during
5968 completion. If you forget the name of an old dive buddy, you can enter
5969 @samp{div} and then @key{SPC} to get a listing of all your dive buddies.
5970
5971 @kindex M-x mh-alias-add-address-under-point
5972 @kindex M-x mh-alias-grab-from-field
5973
5974 An alias for the sender of the current message is added automatically
5975 by clicking on the @samp{Grab From alias} tool bar button or by running
5976 the @kbd{M-x mh-alias-grab-from-field} command. Aliases for other
5977 recipients of the current message are added by placing your cursor
5978 over the desired recipient and giving the @kbd{M-x
5979 mh-alias-add-address-under-point} command.
5980
5981 @vindex mh-alias-insert-file
5982 @vindex mh-alias-insertion-location
5983
5984 The options @code{mh-alias-insert-file} and
5985 @code{mh-alias-insertion-location} controls how and where these aliases
5986 are inserted.
5987
5988 @vindex mh-alias-insert-file
5989
5990 The default setting of option @code{mh-alias-insert-file} is @samp{Use
5991 Aliasfile Profile Component}. This option can also hold the name of a
5992 file or a list a file names. If this option is set to a list of file
5993 names, or the @samp{Aliasfile:} profile component contains more than
5994 one file name, MH-E will prompt for one of them.
5995
5996 @vindex mh-alias-insertion-location
5997
5998 The option @code{mh-alias-insertion-location} is set to
5999 @samp{Alphabetical} by default. If you organize your alias file in
6000 other ways, then the settings @samp{Top} and @samp{Bottom} might be
6001 more appropriate.
6002
6003 @subheading Querying Aliases
6004
6005 @cindex regular expressions, @code{mh-alias-apropos}
6006 @findex mh-alias-apropos
6007 @kindex M-x mh-alias-apropos
6008
6009 If you can't quite remember an alias, you can use @kbd{M-x
6010 mh-alias-apropos} to show all aliases or addresses that match a
6011 regular expression
6012 @ifnothtml
6013 (@pxref{Regexps, , Syntax of Regular Expressions, emacs, The
6014 GNU Emacs Manual}).
6015 @end ifnothtml
6016 @ifhtml
6017 (see the section
6018 @uref{http://www.gnu.org/software/emacs/manual/html_node/Regexps.html,
6019 Syntax of Regular Expressions} in
6020 @cite{The GNU Emacs Manual}).
6021 @end ifhtml
6022
6023 @node Identities, Speedbar, Aliases, Top
6024 @chapter Identities
6025
6026 @cindex identities
6027 @cindex multiple personalities
6028
6029 MH-E supports the concept of multiple personalities or identities.
6030 This means that you can easily have a different header and signature
6031 at home and at work.
6032
6033 @cindex @samp{Identity} menu
6034 @cindex menu, @samp{Identity}
6035
6036 A couple of commands are used to insert identities in MH-Letter mode
6037 which are also found in the @samp{Identity} menu.
6038
6039 @table @kbd
6040 @kindex C-c C-d
6041 @findex mh-insert-identity
6042 @item C-c C-d
6043 Insert fields specified by given identity (@code{mh-insert-identity}).
6044 @c -------------------------
6045 @cindex @samp{Identity > Insert Auto Fields} menu item
6046 @cindex menu item, @samp{Identity > Insert Auto Fields}
6047 @kindex C-c M-d
6048 @findex mh-insert-auto-fields
6049 @item C-c M-d
6050 Insert custom fields if recipient found in @code{mh-auto-fields-list}
6051 (@code{mh-insert-auto-fields}).
6052 @end table
6053
6054 @cindex @samp{mh-identity} customization group
6055 @cindex customization group, @samp{mh-identity}
6056
6057 The @samp{mh-identity} customization group contains the following
6058 options.
6059
6060 @vtable @code
6061 @item mh-auto-fields-list
6062 List of recipients for which header lines are automatically inserted
6063 (default: @code{nil}).
6064 @c -------------------------
6065 @item mh-auto-fields-prompt-flag
6066 On means to prompt before sending if fields inserted (default:
6067 @samp{on})
6068 @c -------------------------
6069 @item mh-identity-default
6070 Default identity to use when @code{mh-letter-mode} is called (default:
6071 @samp{None}).
6072 @c -------------------------
6073 @item mh-identity-handlers
6074 Handler functions for fields in @code{mh-identity-list}.
6075 @c -------------------------
6076 @item mh-identity-list
6077 List of identities (default: @code{nil}).
6078 @end vtable
6079
6080 Some of the common header fields that people change depending on the
6081 context are the @samp{From:} and @samp{Organization:} fields, as well
6082 as the signature.
6083
6084 @vindex mh-identity-list
6085
6086 This is done by customizing the option @code{mh-identity-list}. In the
6087 customization buffer for this option, click on the @samp{INS} button
6088 and enter a label such as @samp{Home} or @samp{Work}. Then click on
6089 the @samp{INS} button with the label @samp{Add at least one item
6090 below}. The @samp{Value Menu} has the following menu items:
6091
6092 @table @samp
6093 @cindex header field, @samp{From:}
6094 @cindex @samp{From:} header field
6095 @item From Field
6096 Specify an alternate @samp{From:} header field. You must include a
6097 valid email address. A standard format is @samp{First Last
6098 <login@@host.domain>}. If you use an initial with a period, then you
6099 must quote your name as in @samp{"First I. Last"
6100 <login@@host.domain>}.
6101 @c -------------------------
6102 @cindex header field, @samp{Organization:}
6103 @cindex @samp{Organization:} header field
6104 @item Organization Field
6105 People usually list the name of the company where they work here.
6106 @c -------------------------
6107 @item Other Field
6108 Set any arbitrary header field and value here. Unless the header field
6109 is a standard one, precede the name of your field's label with
6110 @samp{X-}, as in @samp{X-Fruit-of-the-Day:}.
6111 @c -------------------------
6112 @item Attribution Verb
6113 This value overrides the setting of
6114 @code{mh-extract-from-attribution-verb}. @xref{Inserting Letter}.
6115 @c -------------------------
6116 @cindex signature
6117 @vindex mh-signature-file-name
6118 @item Signature
6119 Set your signature with this item. You can specify the contents of
6120 @code{mh-signature-file-name}, a file, or a function.
6121 @xref{Signature}.
6122 @c -------------------------
6123 @item GPG Key ID
6124 Specify a different key to sign or encrypt messages.
6125 @end table
6126
6127 @cindex Identity menu
6128 @cindex menu, Identity
6129 @findex mh-insert-identity
6130 @kindex C-c C-d
6131
6132 You can select the identities you have added via the menu called
6133 @samp{Identity} in the MH-Letter buffer. You can also use @kbd{C-c
6134 C-d} (@code{mh-insert-identity}). To clear the fields and signature
6135 added by the identity, select the @samp{None} identity.
6136
6137 @cindex menu item, @samp{Identity > Customize Identities}
6138 @cindex menu item, @samp{Identity > Save as Default}
6139 @cindex menu item, @samp{Identity > Set Default for Session}
6140 @cindex @samp{Identity > Customize Identities} menu item
6141 @cindex @samp{Identity > Save as Default} menu item
6142 @cindex @samp{Identity > Set Default for Session} menu item
6143 @vindex mh-identity-default
6144
6145 The @samp{Identity} menu contains two other items to save you from
6146 having to set the identity on every message. The menu item @samp{Set
6147 Default for Session} can be used to set the default identity to the
6148 current identity until you exit Emacs. The menu item @samp{Save as
6149 Default} sets the option @code{mh-identity-default} to the current
6150 identity setting. You can also customize the option
6151 @code{mh-identity-default} in the usual fashion. If you find that you
6152 need to add another identity, the menu item @samp{Customize
6153 Identities} is available for your convenience.
6154
6155 @cindex regular expressions, @code{mh-auto-fields-list}
6156 @vindex mh-auto-fields-list
6157
6158 The option @code{mh-auto-fields-list} can also be used to set the
6159 identity depending on the recipient to provide even more control. To
6160 customize @code{mh-auto-fields-list}, click on the @samp{INS} button
6161 and enter a regular expression for the recipient's address
6162 @ifnothtml
6163 (@pxref{Regexps, , Syntax of Regular Expressions, emacs, The
6164 GNU Emacs Manual}).
6165 @end ifnothtml
6166 @ifhtml
6167 (see the section
6168 @uref{http://www.gnu.org/software/emacs/manual/html_node/Regexps.html,
6169 Syntax of Regular Expressions} in
6170 @cite{The GNU Emacs Manual}).
6171 @end ifhtml
6172 Click on the @samp{INS} button with the @samp{Add at least one item
6173 below} label. The @samp{Value Menu} contains the following menu items:
6174
6175 @table @samp
6176 @item Identity
6177 Select an identity from those configured in @code{mh-identity-list}.
6178 All of the information for that identity will be added if the
6179 recipient matches.
6180 @c -------------------------
6181 @cindex @samp{Fcc:} header field
6182 @cindex header field, @samp{Fcc:}
6183 @item Fcc Field
6184 Insert an @samp{Fcc:} header field with the folder you provide. When
6185 you send the message, MH will put a copy of your message in this
6186 folder.
6187 @c -------------------------
6188 @cindex @samp{Mail-Followup-To:} header field
6189 @cindex header field, @samp{Mail-Followup-To:}
6190 @item Mail-Followup-To Field
6191 Insert an @samp{Mail-Followup-To:} header field with the recipients
6192 you provide. If the recipient's mail user agent supports this header
6193 field@footnote{@samp{Mail-Followup-To:} is supported by nmh.}, then
6194 their replies will go to the addresses listed. This is useful if their
6195 replies go both to the list and to you and you don't have a mechanism
6196 to suppress duplicates. If you reply to someone not on the list, you
6197 must either remove the @samp{Mail-Followup-To:} field, or ensure the
6198 recipient is also listed there so that he receives replies to your
6199 reply.
6200 @c -------------------------
6201 @item Other Field
6202 Other header fields may be added using this menu item.
6203 @end table
6204
6205 @findex mh-insert-auto-fields
6206 @kindex C-c M-d
6207 @vindex mh-auto-fields-prompt-flag
6208
6209 These fields can only be added after the recipient is known. Because
6210 you can continue to add recipients as you edit the draft, MH-E waits
6211 until the message is sent to perform the auto-insertions. This seems
6212 strange at first, but you'll get used to it. There are two ways to
6213 help you feel that the desired fields are added. The first is the
6214 action when the message is sent: if any fields are added
6215 automatically, you are given a chance to see and to confirm these
6216 fields before the message is actually sent. You can do away with this
6217 confirmation by turning off the option
6218 @code{mh-auto-fields-prompt-flag}. The second method is manual: once
6219 the header contains one or more recipients, you may run the command
6220 @kbd{C-c M-d} (@code{mh-insert-auto-fields}) or choose the
6221 @samp{Identity -> Insert Auto Fields} menu item to insert these fields
6222 manually. However, if you use this command, the automatic insertion
6223 when the message is sent is disabled.
6224
6225 @vindex mh-auto-fields-list
6226 @vindex mh-identity-list
6227
6228 You should avoid using the same header field in
6229 @code{mh-auto-fields-list} and @code{mh-identity-list} definitions
6230 that may apply to the same message as the result is undefined.
6231
6232 @vindex mh-identity-handlers
6233 @vindex mh-identity-list
6234
6235 The option @code{mh-identity-handlers} is used to change the way that
6236 fields, signatures, and attributions in @code{mh-identity-list} are
6237 added. To customize @code{mh-identity-handlers}, replace the name of
6238 an existing handler function associated with the field you want to
6239 change with the name of a function you have written. You can also
6240 click on an @samp{INS} button and insert a field of your choice and
6241 the name of the function you have written to handle it.
6242
6243 @vindex mh-identity-list
6244
6245 The @samp{Field} field can be any field that you've used in your
6246 @code{mh-identity-list}. The special fields @samp{:attribution-verb},
6247 @samp{:signature}, or @samp{:pgg-default-user-id} are used for the
6248 @code{mh-identity-list} choices @samp{Attribution Verb},
6249 @samp{Signature}, and @samp{GPG Key ID} respectively.
6250
6251 The handler associated with the @samp{:default} field is used when no
6252 other field matches.
6253
6254 The handler functions are passed two or three arguments: the field
6255 itself (for example, @samp{From}), or one of the special fields (for
6256 example, @samp{:signature}), and the action @samp{'remove} or
6257 @samp{'add}. If the action is @samp{'add}, an additional argument
6258 containing the value for the field is given.
6259
6260 @node Speedbar, Menu Bar, Identities, Top
6261 @chapter The Speedbar
6262
6263 @cindex folder navigation
6264 @cindex speedbar
6265 @findex mh-visit-folder
6266 @kindex F v
6267 @kindex M-x speedbar
6268 @kindex Mouse-2
6269
6270 You can also use the speedbar
6271 @ifnothtml
6272 (@pxref{Speedbar, , Speedbar Frames, emacs, The GNU Emacs Manual},)
6273 @end ifnothtml
6274 @ifhtml
6275 (see the section
6276 @uref{http://www.gnu.org/software/emacs/manual/html_node/Speedbar.html,
6277 Speedbar Frames} in @cite{The GNU Emacs Manual})
6278 @end ifhtml
6279 to view your folders. To bring up the speedbar, run @kbd{M-x speedbar
6280 @key{RET}}. You will see a new frame appear with all of your MH
6281 folders. Folders with unseen messages appear in boldface. Click on a
6282 folder name with @kbd{Mouse-2} to visit that folder in a similar
6283 fashion to the command @kbd{F v} (@code{mh-visit-folder})
6284 (@pxref{Folders}). Click on the @samp{+} icon to expand and view the
6285 sub-folders of that folder.
6286
6287 The speedbar can be manipulated with the keyboard as well. Use the
6288 Emacs navigational keys (like the arrow keys, or @kbd{C-n}) to move
6289 the cursor over the desired folder and then use the shortcuts for the
6290 menu items listed in the table below.
6291
6292 @table @samp
6293 @findex mh-speed-view
6294 @item Visit Folder (@key{RET})
6295 Visits the selected folder just as if you had used @kbd{F v}
6296 (@code{mh-speed-view}).
6297 @c -------------------------
6298 @findex mh-speed-expand-folder
6299 @item Expand Nested Folders (@kbd{+})
6300 Expands the selected folder in the speedbar, exposing the children
6301 folders inside it (@code{mh-speed-expand-folder}).
6302 @c -------------------------
6303 @findex mh-speed-contract-folder
6304 @item Contract Nested Folders (@kbd{-})
6305 Contracts or collapses the selected folder in the speedbar, hiding the
6306 children folders inside it (@code{mh-speed-contract-folder}).
6307 @c -------------------------
6308 @findex mh-speed-refresh
6309 @item Refresh Speedbar (@kbd{r})
6310 Regenerates the list of folders in the speedbar. Run this command if
6311 you've added or deleted a folder, or want to update the unseen message
6312 count before the next automatic update (@code{mh-speed-refresh}).
6313 @end table
6314
6315 @findex delete-frame
6316 @kindex C-x 5 0
6317 @kindex Mouse-3
6318
6319 You can click on @kbd{Mouse-3} to bring up a context menu that
6320 contains these items. Dismiss the speedbar with @kbd{C-x 5 0}
6321 (@code{delete-frame}).
6322
6323 @cindex @command{flists}
6324 @cindex MH commands, @command{flists}
6325 @cindex @samp{mh-speedbar} customization group
6326 @cindex customization group, @samp{mh-speedbar}
6327
6328 The MH-E speedbar uses the MH command @command{flists}@footnote{See
6329 the section @uref{@value{MH-BOOK-HOME}/morseq.html#flist, Searching for
6330 Sequences with flist} in the MH book.} to generate the list of
6331 folders. The @samp{mh-speedbar} customization group contains the
6332 following option which controls how often the speedbar calls
6333 @command{flists}.
6334
6335 @vtable @code
6336 @item mh-speed-update-interval
6337 Time between speedbar updates in seconds (default: 60). Set to 0 to
6338 disable automatic update.
6339 @end vtable
6340
6341 You can modify the appearance of the folders in the speedbar by
6342 customizing the following faces.
6343
6344 @vtable @code
6345 @item mh-speedbar-folder
6346 Basic folder face.
6347 @c -------------------------
6348 @item mh-speedbar-folder-with-unseen-messages
6349 Folder face when folder contains unread messages.
6350 @c -------------------------
6351 @item mh-speedbar-selected-folder
6352 Selected folder face.
6353 @c -------------------------
6354 @item mh-speedbar-selected-folder-with-unseen-messages
6355 Selected folder face when folder contains unread messages.
6356 @end vtable
6357
6358 @node Menu Bar, Tool Bar, Speedbar, Top
6359 @chapter The Menu Bar
6360
6361 @cindex @samp{Folder} menu
6362 @cindex @samp{Identity} menu
6363 @cindex @samp{Letter} menu
6364 @cindex @samp{Message} menu
6365 @cindex @samp{Search} menu
6366 @cindex @samp{Sequence} menu
6367 @cindex Folder menu
6368 @cindex Identity menu
6369 @cindex Letter menu
6370 @cindex MH-Folder mode
6371 @cindex MH-Letter mode
6372 @cindex MH-Search mode
6373 @cindex Message menu
6374 @cindex Search menu
6375 @cindex Sequence menu
6376 @cindex menu bar
6377 @cindex menu, Folder
6378 @cindex menu, Identity
6379 @cindex menu, Letter
6380 @cindex menu, Message
6381 @cindex menu, Search
6382 @cindex menu, Sequence
6383 @cindex menu, @samp{Folder}
6384 @cindex menu, @samp{Identity}
6385 @cindex menu, @samp{Letter}
6386 @cindex menu, @samp{Message}
6387 @cindex menu, @samp{Search}
6388 @cindex menu, @samp{Sequence}
6389 @cindex modes, MH-Folder
6390 @cindex modes, MH-Letter
6391 @cindex modes, MH-Search
6392
6393 For those of you who prefer to mouse and menu instead of using the
6394 meta-coke-bottle-bucky keys, MH-E provides menu items for most of its
6395 functions. The MH-Folder buffer adds the @samp{Folder},
6396 @samp{Message}, and @samp{Sequence} menus. The MH-Letter buffer adds
6397 the @samp{Identity} and @samp{Letter} menus. The MH-Search buffer adds
6398 the @samp{Search} menu. There's no need to list the actual items here,
6399 as you can more easily see them for yourself, and the functions are
6400 already described elsewhere in this manual.
6401
6402 For a description of the menu bar, please
6403 @ifnothtml
6404 @xref{Menu Bar, , The Menu Bar, emacs, The GNU Emacs Manual}.
6405 @end ifnothtml
6406 @ifhtml
6407 see the section
6408 @uref{http://www.gnu.org/software/emacs/manual/html_node/Menu-Bar.html,
6409 The Menu Bar} in @cite{The GNU Emacs Manual}.
6410 @end ifhtml
6411
6412 The Emacs manual describes how to get online help for a particular
6413 menu item. You can also look up a menu item in the index of this
6414 manual in two ways: all of the menu items are listed alphabetically,
6415 and you can also browse all of the items under the index entry
6416 @samp{menu item}.
6417
6418 @node Tool Bar, Searching, Menu Bar, Top
6419 @chapter The Tool Bar
6420
6421 @cindex tool bar
6422
6423 Emacs also provides a graphical tool bar. For a description of the
6424 tool bar, please
6425 @ifnothtml
6426 @xref{Tool Bars, , Tool Bars, emacs, The GNU Emacs Manual}.
6427 @end ifnothtml
6428 @ifhtml
6429 see the section
6430 @uref{http://www.gnu.org/software/emacs/manual/html_node/Tool-Bars.html,
6431 Tool Bars} in @cite{The GNU Emacs Manual}.
6432 @end ifhtml
6433
6434 @cindex @samp{mh-tool-bar} customization group
6435 @cindex customization group, @samp{mh-tool-bar}
6436
6437 MH-E adds several icons to this tool bar; you can modify the MH-E
6438 aspects of the tool bar via the @samp{mh-tool-bar} customization group.
6439
6440 @vtable @code
6441 @item mh-tool-bar-folder-buttons
6442 List of buttons to include in MH-Folder tool bar (default: a checklist
6443 too long to list here).
6444 @c -------------------------
6445 @item mh-tool-bar-letter-buttons
6446 List of buttons to include in MH-Letter tool bar (default: a checklist
6447 too long to list here).
6448 @c -------------------------
6449 @item mh-tool-bar-search-function
6450 Function called by the tool bar search button (default:
6451 @code{mh-search}).
6452 @c -------------------------
6453 @item mh-xemacs-tool-bar-position
6454 Tool bar location (default: @samp{Same As Default Tool Bar}).
6455 @c -------------------------
6456 @item mh-xemacs-use-tool-bar-flag
6457 If @samp{on}, use tool bar (default: @samp{on}, if supported).
6458 @end vtable
6459
6460 In GNU Emacs, icons for some of MH-E's functions are added to the tool
6461 bar. In XEmacs, you have the opportunity to create a separate tool bar for
6462 the MH-E icons.
6463
6464 @vindex mh-tool-bar-folder-buttons
6465 @vindex mh-tool-bar-letter-buttons
6466
6467 In either case, you can select which of these functions you'd like to
6468 see by customizing the options @code{mh-tool-bar-folder-buttons} and
6469 @code{mh-tool-bar-letter-buttons}. As you probably guessed, the former
6470 customizes the tool bar in MH-Folder mode and the latter in MH-Letter
6471 mode. Both of these options present you with a list of functions;
6472 check the functions whose icons you want to see and clear the check
6473 boxes for those you don't.
6474
6475 @findex mh-search
6476 @vindex mh-tool-bar-search-function
6477
6478 The function associated with the searching icon can be set via the
6479 option @code{mh-tool-bar-search-function}. By default, this is set to
6480 @code{mh-search}. @xref{Searching}. You can also choose @samp{Other
6481 Function} from the @samp{Value Menu} and enter a function of your own
6482 choosing.
6483
6484 @vindex mh-xemacs-use-tool-bar-flag
6485
6486 XEmacs provides a couple of extra options. The first,
6487 @code{mh-xemacs-use-tool-bar-flag}, controls whether to show the MH-E
6488 icons at all. By default, this option is turned on if the window
6489 system supports tool bars. If your system doesn't support tool bars,
6490 then you won't be able to turn on this option.
6491
6492 @vindex mh-xemacs-tool-bar-position
6493
6494 The second extra option is @code{mh-xemacs-tool-bar-position} which
6495 controls the placement of the tool bar along the four edges of the
6496 frame. You can choose from one of @samp{Same As Default Tool Bar},
6497 @samp{Top}, @samp{Bottom}, @samp{Left}, or @samp{Right}. If this
6498 variable is set to anything other than @samp{Same As Default Tool Bar}
6499 and the default tool bar is in a different location, then two tool
6500 bars will be displayed: the MH-E tool bar and the default tool bar.
6501
6502 @node Searching, Threading, Tool Bar, Top
6503 @chapter Searching Through Messages
6504
6505 @cindex @samp{Search} menu
6506 @cindex menu, @samp{Search}
6507 @cindex searching
6508 @findex mh-search
6509 @kindex F s
6510
6511 Earlier, the command @kbd{F s} (@code{mh-search}) was introduced which
6512 helps you find messages that lie buried in your folders
6513 (@pxref{Folders}). This chapter covers this command in more detail.
6514 Several commands are used to compose the search criteria and to start
6515 searching. A couple of them can be found in the @samp{Search} menu.
6516
6517 @table @kbd
6518 @kindex C-c ?
6519 @findex mh-help
6520 @item C-c ?
6521 Display cheat sheet for the MH-E commands (@code{mh-help}).
6522 @c -------------------------
6523 @cindex @samp{Search > Perform Search} menu item
6524 @cindex menu item, @samp{Search > Perform Search}
6525 @kindex C-c C-c
6526 @findex mh-index-do-search
6527 @item C-c C-c
6528 Find messages using @code{mh-search-program}
6529 (@code{mh-index-do-search}).
6530 @c -------------------------
6531 @cindex @samp{Search > Search with pick} menu item
6532 @cindex menu item, @samp{Search > Search with pick}
6533 @kindex C-c C-p
6534 @findex mh-pick-do-search
6535 @item C-c C-p
6536 Find messages using @command{pick} (@code{mh-pick-do-search}).
6537 @c -------------------------
6538 @kindex C-c ?
6539 @findex mh-help
6540 @item C-c ?
6541 Display cheat sheet for the MH-E commands (@code{mh-help}).
6542 @c -------------------------
6543 @kindex C-c C-f C-a
6544 @kindex C-c C-f a
6545 @findex mh-to-field
6546 @item C-c C-f a
6547 @itemx C-c C-f C-a
6548 Move to @samp{Mail-Reply-To:} header field (@code{mh-to-field}).
6549 @c -------------------------
6550 @kindex C-c C-f C-b
6551 @kindex C-c C-f b
6552 @item C-c C-f b
6553 @itemx C-c C-f C-b
6554 Move to @samp{Bcc:} header field (@code{mh-to-field}).
6555 @c -------------------------
6556 @kindex C-c C-f C-c
6557 @kindex C-c C-f c
6558 @item C-c C-f c
6559 @itemx C-c C-f C-c
6560 Move to @samp{Cc:} header field (@code{mh-to-field}).
6561 @c -------------------------
6562 @kindex C-c C-f C-d
6563 @kindex C-c C-f d
6564 @item C-c C-f d
6565 @itemx C-c C-f C-d
6566 Move to @samp{Dcc:} header field (@code{mh-to-field}).
6567 @c -------------------------
6568 @kindex C-c C-f C-f
6569 @kindex C-c C-f f
6570 @item C-c C-f f
6571 @itemx C-c C-f C-f
6572 Move to @samp{Fcc:} header field (@code{mh-to-field}).
6573 @c -------------------------
6574 @kindex C-c C-f C-l
6575 @kindex C-c C-f l
6576 @item C-c C-f l
6577 @itemx C-c C-f C-l
6578 Move to @samp{Mail-Followup-To:} header field (@code{mh-to-field}).
6579 @c -------------------------
6580 @kindex C-c C-f C-m
6581 @kindex C-c C-f m
6582 @item C-c C-f m
6583 @itemx C-c C-f C-m
6584 Move to @samp{From:} header field (@code{mh-to-field}).
6585 @c -------------------------
6586 @kindex C-c C-f C-r
6587 @kindex C-c C-f r
6588 @item C-c C-f r
6589 @itemx C-c C-f C-r
6590 Move to @samp{Reply-To:} header field (@code{mh-to-field}).
6591 @c -------------------------
6592 @kindex C-c C-f C-s
6593 @kindex C-c C-f s
6594 @item C-c C-f s
6595 @itemx C-c C-f C-s
6596 Move to @samp{Subject:} header field (@code{mh-to-field}).
6597 @c -------------------------
6598 @kindex C-c C-f C-t
6599 @kindex C-c C-f t
6600 @item C-c C-f t
6601 @itemx C-c C-f C-t
6602 Move to @samp{To:} header field (@code{mh-to-field}).
6603 @end table
6604
6605 Another few commands are available in the MH-Folder buffer resulting
6606 from a search.
6607
6608 @table @kbd
6609 @kindex @key{TAB}
6610 @findex mh-index-next-folder
6611 @item @key{TAB}
6612 Jump to the next folder marker (@code{mh-index-next-folder}).
6613 @c -------------------------
6614 @kindex S-@key{TAB}
6615 @findex mh-index-previous-folder
6616 @item S-@key{TAB}
6617 Jump to the previous folder marker (@code{mh-index-previous-folder}).
6618 @c -------------------------
6619 @kindex v
6620 @findex mh-index-visit-folder
6621 @item v
6622 Visit original folder from where the message at point was found
6623 (@code{mh-index-visit-folder}).
6624 @end table
6625
6626 @cindex @samp{mh-search} customization group
6627 @cindex customization group, @samp{mh-search}
6628
6629 There is one option from the @samp{mh-search} customization group used
6630 in searching.
6631
6632 @vtable @code
6633 @item mh-search-program
6634 Search program that MH-E shall use (default: @samp{Auto-detect}).
6635 @end vtable
6636
6637 The following hook is available.
6638
6639 @vtable @code
6640 @item mh-search-mode-hook
6641 Hook run upon entry to @code{mh-search-mode} (default: @code{nil}).
6642 @end vtable
6643
6644 The following face is available.
6645
6646 @vtable @code
6647 @item mh-search-folder
6648 Folder heading face in MH-Folder buffers created by searches.
6649 @end vtable
6650
6651 @findex mh-search-folder
6652 @kindex F s
6653
6654 The command @kbd{F s} (@code{mh-search-folder}) helps you find
6655 messages in your entire corpus of mail. You can search for messages to
6656 or from a particular person or about a particular subject. In fact,
6657 you can also search for messages containing selected strings in any
6658 arbitrary header field or any string found within the messages.
6659
6660 @cindex @command{pick}
6661 @cindex MH commands, @command{pick}
6662
6663 Out of the box, MH-E uses @command{pick} to find messages. With a
6664 little extra effort, you can set an indexing program which rewards you
6665 with extremely quick results. The drawback is that sometimes the index
6666 does not contain the words you're looking for. You can still use
6667 @command{pick} in these situations.
6668
6669 You are prompted for the folder to search. This can be @samp{all} to
6670 search all folders. Note that the search works recursively on the
6671 listed folder.
6672
6673 @cindex MH-Search mode
6674 @cindex modes, MH-Search
6675
6676 Next, an MH-Search buffer appears where you can enter search criteria.
6677
6678 @cartouche
6679 @smallexample
6680 From:
6681 To:
6682 Cc:
6683 Date:
6684 Subject:
6685 --------
6686 #
6687
6688
6689
6690
6691
6692
6693
6694
6695 --:** search-pattern All L7 (MH-Search)---------------------------
6696 Type C-c C-c to search messages, C-c C-p to use pick, C-c ? for help
6697 @end smallexample
6698 @end cartouche
6699 @i{Search window}
6700
6701 @cindex @command{pick}
6702 @cindex MH commands, @command{pick}
6703
6704 Edit this template by entering your search criteria in an appropriate
6705 header field that is already there, or create a new field yourself. If
6706 the string you're looking for could be anywhere in a message, then
6707 place the string underneath the row of dashes.
6708
6709 As an example, let's say that we want to find messages from Ginnean
6710 about horseback riding in the Kosciusko National Park (Australia)
6711 during January, 1994. Normally we would start with a broad search and
6712 narrow it down if necessary to produce a manageable amount of data,
6713 but we'll cut to the chase and create a fairly restrictive set of
6714 criteria as follows:
6715
6716 @smallexample
6717 @group
6718 From: ginnean
6719 To:
6720 Cc:
6721 Date: Jan 1994
6722 Subject:
6723 --------
6724 horse
6725 kosciusko
6726 @end group
6727 @end smallexample
6728
6729 @findex mh-to-field
6730 @kindex C-c C-f C-t
6731
6732 As with MH-Letter mode, MH-Search provides commands like @kbd{C-c C-f
6733 C-t} (@code{mh-to-field}) to help you fill in the blanks.
6734 @xref{Editing Message}.
6735
6736 @kindex F s
6737 @vindex mh-search-mode-hook
6738
6739 If you find that you do the same thing over and over when editing the
6740 search template, you may wish to bind some shortcuts to keys. This can
6741 be done with the variable @code{mh-search-mode-hook}, which is called
6742 when @kbd{F s} is run on a new pattern.
6743
6744 @findex mh-index-do-search
6745 @findex mh-pick-do-search
6746 @kindex C-c C-c
6747 @kindex C-c C-p
6748
6749 To perform the search, type @kbd{C-c C-c} (@code{mh-index-do-search}).
6750 Sometimes you're searching for text that is either not indexed, or
6751 hasn't been indexed yet. In this case you can override the default
6752 method with the pick method by running the command @kbd{C-c C-p}
6753 (@code{mh-pick-do-search}).
6754
6755 @cindex folders, @samp{+mhe-index}
6756 @cindex @samp{+mhe-index}
6757 @findex mh-index-next-folder
6758 @findex mh-index-previous-folder
6759 @kindex @key{TAB}
6760 @kindex S-@key{TAB}
6761 @vindex mh-search-folder
6762
6763 The messages that are found are put in a temporary sub-folder of
6764 @samp{+mhe-index} and are displayed in an MH-Folder buffer. This
6765 buffer is special because it displays messages from multiple folders;
6766 each set of messages from a given folder has a heading with the folder
6767 name. The appearance of the heading can be modified by customizing the
6768 face @code{mh-search-folder}. You can jump back and forth between the
6769 headings using the commands @kbd{@key{TAB}}
6770 (@code{mh-index-next-folder}) and @kbd{S-@key{TAB}}
6771 (@code{mh-index-previous-folder}).
6772
6773 @findex mh-index-visit-folder
6774 @findex mh-rescan-folder
6775 @kindex F r
6776 @kindex v
6777
6778 In addition, the command @kbd{v} (@code{mh-index-visit-folder}) can be
6779 used to visit the folder of the message at point. Initially, only the
6780 messages that matched the search criteria are displayed in the folder.
6781 While the temporary buffer has its own set of message numbers, the
6782 actual messages numbers are shown in the visited folder. Thus, the
6783 command @kbd{v} is useful to find the actual message number of an
6784 interesting message, or to view surrounding messages with the command
6785 @kbd{F r} @code{mh-rescan-folder}. @xref{Folders}.
6786
6787 @findex mh-kill-folder
6788 @kindex F k
6789
6790 Because this folder is temporary, you'll probably get in the habit of
6791 killing it when you're done with @kbd{F k} (@code{mh-kill-folder}).
6792 @xref{Folders}.
6793
6794 @kindex F s
6795
6796 You can regenerate the results by running @kbd{F s} with a prefix
6797 argument.
6798
6799 @cindex @command{procmail}
6800 @cindex Unix commands, @command{procmail}
6801 @cindex @samp{X-MHE-Checksum:} header field
6802 @cindex header field, @samp{X-MHE-Checksum:}
6803
6804 Note: This command uses an @samp{X-MHE-Checksum:} header field to
6805 cache the MD5 checksum of a message. This means that if an incoming
6806 message already contains an @samp{X-MHE-Checksum:} field, that message
6807 might not be found by this command. The following @command{procmail}
6808 recipe avoids this problem by renaming the existing header field:
6809
6810 @smallexample
6811 @group
6812 :0 wf
6813 | formail -R "X-MHE-Checksum" "X-Old-MHE-Checksum"
6814 @end group
6815 @end smallexample
6816
6817 @xref{Limits}, for an alternative interface to searching.
6818
6819 @section Configuring Indexed Searches
6820
6821 @cindex @command{grep}
6822 @cindex @command{mairix}
6823 @cindex @command{namazu}
6824 @cindex @command{pick}
6825 @cindex @command{swish++}
6826 @cindex @command{swish-e}
6827 @cindex Unix commands, @command{grep}
6828 @cindex Unix commands, @command{mairix}
6829 @cindex Unix commands, @command{namazu}
6830 @cindex Unix commands, @command{pick}
6831 @cindex Unix commands, @command{swish++}
6832 @cindex Unix commands, @command{swish-e}
6833 @findex mh-search
6834 @kindex F s
6835 @vindex mh-search-program
6836
6837 The command @kbd{F s} (@code{mh-search}) runs the command defined by
6838 the option @code{mh-search-program}. The default value is
6839 @samp{Auto-detect} which means that MH-E will automatically choose one
6840 of @command{swish++}, @command{swish-e}, @command{mairix},
6841 @command{namazu}, @command{pick} and @command{grep} in that order. If,
6842 for example, you have both @command{swish++} and @command{mairix}
6843 installed and you want to use @command{mairix}, then you can set this
6844 option to @samp{mairix}.
6845
6846 The following sub-sections describe how to set up the various indexing
6847 programs to use with MH-E.
6848
6849 @subsection swish++
6850
6851 @cindex @command{swish++}
6852 @cindex Unix commands, @command{swish++}
6853
6854 In the examples below, replace @file{/home/user/Mail} with the path to
6855 your MH directory.
6856
6857 First create the directory @file{/home/user/Mail/.swish++}. Then
6858 create the file @file{/home/user/Mail/.swish++/swish++.conf} with the
6859 following contents:
6860
6861 @smallexample
6862 @group
6863 IncludeMeta Bcc Cc Comments Content-Description From Keywords
6864 IncludeMeta Newsgroups Resent-To Subject To
6865 IncludeMeta Message-Id References In-Reply-To
6866 IncludeFile Mail *
6867 IndexFile /home/user/Mail/.swish++/swish++.index
6868 @end group
6869 @end smallexample
6870
6871 Use the following command line to generate the swish index. Run this
6872 daily from cron:
6873
6874 @smallexample
6875 @group
6876 find /home/user/Mail -path /home/user/Mail/mhe-index -prune \
6877 -o -path /home/user/Mail/.swish++ -prune \
6878 -o -name "[0-9]*" -print \
6879 | index -c /home/user/Mail/.swish++/swish++.conf -
6880 @end group
6881 @end smallexample
6882
6883 This command does not index the folders that hold the results of your
6884 searches in @samp{+mhe-index} since they tend to be ephemeral and the
6885 original messages are indexed anyway.
6886
6887 @cindex @command{index}
6888 @cindex Unix commands, @command{index}
6889 @cindex @command{index++}
6890 @cindex Unix commands, @command{index++}
6891
6892 On some systems (Debian GNU/Linux, for example), use @command{index++}
6893 instead of @command{index}.
6894
6895 @subsection swish
6896
6897 @cindex @command{swish-e}
6898 @cindex Unix commands, @command{swish-e}
6899
6900 In the examples below, replace @file{/home/user/Mail} with the path to
6901 your MH directory.
6902
6903 First create the directory @file{/home/user/Mail/.swish}. Then create
6904 the file @file{/home/user/Mail/.swish/config} with the following
6905 contents:
6906
6907 @smallexample
6908 @group
6909 DefaultContents TXT*
6910 IndexDir /home/user/Mail
6911 IndexFile /home/user/Mail/.swish/index
6912 IndexName "Mail Index"
6913 IndexDescription "Mail Index"
6914 IndexPointer "http://nowhere"
6915 IndexAdmin "nobody"
6916 #MetaNames automatic
6917 IndexReport 3
6918 FollowSymLinks no
6919 UseStemming no
6920 IgnoreTotalWordCountWhenRanking yes
6921 WordCharacters abcdefghijklmnopqrstuvwxyz0123456789-
6922 BeginCharacters abcdefghijklmnopqrstuvwxyz
6923 EndCharacters abcdefghijklmnopqrstuvwxyz0123456789
6924 IgnoreLimit 50 1000
6925 IndexComments 0
6926 FileRules filename contains \D
6927 FileRules pathname contains /home/user/Mail/.swish
6928 FileRules pathname contains /home/user/Mail/mhe-index
6929 FileRules filename is index
6930 @end group
6931 @end smallexample
6932
6933 This configuration does not index the folders that hold the results of
6934 your searches in @samp{+mhe-index} since they tend to be ephemeral and
6935 the original messages are indexed anyway.
6936
6937 If there are any directories you would like to ignore, append lines
6938 like the following to @file{config}:
6939
6940 @smallexample
6941 FileRules pathname contains /home/user/Mail/scripts
6942 @end smallexample
6943
6944 @cindex @command{swish-e}
6945 @cindex Unix commands, @command{swish-e}
6946
6947 Use the following command line to generate the swish index. Run this
6948 daily from cron:
6949
6950 @smallexample
6951 swish-e -c /home/user/Mail/.swish/config
6952 @end smallexample
6953
6954 @subsection mairix
6955
6956 @cindex @command{mairix}
6957 @cindex Unix commands, @command{mairix}
6958
6959 In the examples below, replace @file{/home/user/Mail} with the path to
6960 your MH directory.
6961
6962 First create the directory @file{/home/user/Mail/.mairix}. Then create
6963 the file @file{/home/user/Mail/.mairix/config} with the following
6964 contents:
6965
6966 @smallexample
6967 @group
6968 base=/home/user/Mail
6969
6970 # List of folders that should be indexed. 3 dots at the end means there
6971 # are subfolders within the folder
6972 mh=archive...:inbox:drafts:news:sent:trash
6973
6974 vfolder_format=raw
6975 database=/home/user/Mail/mairix/database
6976 @end group
6977 @end smallexample
6978
6979 Use the following command line to generate the mairix index. Run this daily
6980 from cron:
6981
6982 @smallexample
6983 mairix -f /home/user/Mail/.mairix/config
6984 @end smallexample
6985
6986 @subsection namazu
6987
6988 @cindex @command{namazu}
6989 @cindex Unix commands, @command{namazu}
6990
6991 In the examples below, replace @file{/home/user/Mail} with the path to
6992 your MH directory.
6993
6994 First create the directory @file{/home/user/Mail/.namazu}. Then create
6995 the file @file{/home/user/Mail/.namazu/mknmzrc} with the following
6996 contents:
6997
6998 @smallexample
6999 @group
7000 package conf; # Don't remove this line!
7001 $ADDRESS = 'user@@localhost';
7002 $ALLOW_FILE = "[0-9]*";
7003 $EXCLUDE_PATH = "^/home/user/Mail/(mhe-index|spam)";
7004 @end group
7005 @end smallexample
7006
7007 This configuration does not index the folders that hold the results of
7008 your searches in @samp{+mhe-index} since they tend to be ephemeral and
7009 the original messages are indexed anyway.
7010
7011 Use the following command line to generate the namazu index. Run this
7012 daily from cron:
7013
7014 @smallexample
7015 mknmz -f /home/user/Mail/.namazu/mknmzrc -O /home/user/Mail/.namazu \
7016 /home/user/Mail
7017 @end smallexample
7018
7019 @subsection pick
7020
7021 @cindex @command{pick}
7022 @cindex MH commands, @command{pick}
7023
7024 This search method does not require any setup.
7025
7026 Read @command{pick}(1) or the section
7027 @uref{@value{MH-BOOK-HOME}/finpic.html, Finding Messages with pick} in
7028 the MH book to find out more about how to enter the criteria.
7029
7030 @subsection grep
7031
7032 @cindex @command{grep}
7033 @cindex Unix commands, @command{grep}
7034
7035 This search method does not require any setup.
7036
7037 Unlike the other search methods, this method does not use the
7038 MH-Search buffer. Instead, you simply enter a regular expression in
7039 the minibuffer. For help in constructing regular expressions, see your
7040 man page for @command{grep}.
7041
7042 @node Threading, Limits, Searching, Top
7043 @chapter Viewing Message Threads
7044
7045 @cindex threading
7046
7047 MH-E groups messages by @dfn{threads} which are messages that are part
7048 of the same discussion and usually all have the same @samp{Subject:}
7049 header field. Other ways to organize messages in a folder include
7050 limiting (@pxref{Limits}) or using full-text indexed searches
7051 (@pxref{Searching}).
7052
7053 @cindex root, in threads
7054 @cindex siblings, in threads
7055 @cindex ancestor, in threads
7056
7057 A thread begins with a single message called a @dfn{root}. All replies
7058 to the same message are @dfn{siblings} of each other. Any message that
7059 has replies to it is an @dfn{ancestor} of those replies.
7060
7061 There are several commands that you can use to navigate and operate on
7062 threads.
7063
7064 @table @kbd
7065 @kindex T ?
7066 @findex mh-prefix-help
7067 @item T ?
7068 Display cheat sheet for the commands of the current prefix in
7069 minibuffer (@code{mh-prefix-help}).
7070 @c -------------------------
7071 @kindex T o
7072 @findex mh-thread-refile
7073 @item T o
7074 Refile (output) thread into folder (@code{mh-thread-refile}).
7075 @c -------------------------
7076 @kindex T d
7077 @findex mh-thread-delete
7078 @item T d
7079 Delete thread (@code{mh-thread-delete}).
7080 @c -------------------------
7081 @kindex T t
7082 @findex mh-toggle-threads
7083 @item T t
7084 Toggle threaded view of folder (@code{mh-toggle-threads}).
7085 @c -------------------------
7086 @kindex T n
7087 @findex mh-thread-next-sibling
7088 @item T n
7089 Display next sibling (@code{mh-thread-next-sibling}).
7090 @c -------------------------
7091 @kindex T p
7092 @findex mh-thread-previous-sibling
7093 @item T p
7094 Display previous sibling (@code{mh-thread-previous-sibling}).
7095 @c -------------------------
7096 @kindex T u
7097 @findex mh-thread-ancestor
7098 @item T u
7099 Display ancestor of current message (@code{mh-thread-ancestor}).
7100 @end table
7101
7102 @cindex @samp{mh-thread} customization group
7103 @cindex customization group, @samp{mh-thread}
7104
7105 The @samp{mh-thread} customization group contains one option.
7106
7107 @vtable @code
7108 @item mh-show-threads-flag
7109 On means new folders start in threaded mode (default: @samp{off}).
7110 @end vtable
7111
7112 @findex mh-toggle-threads
7113 @kindex T t
7114 @vindex mh-large-folder
7115 @vindex mh-show-threads-flag
7116
7117 Threading large number of messages can be time consuming so the option
7118 @code{mh-show-threads-flag} is turned off by default. If you turn on
7119 this option, then threading will be done only if the number of
7120 messages being threaded is less than @code{mh-large-folder}. In any
7121 event, threading can be turned on (and off) with the command @kbd{T t}
7122 (@code{mh-toggle-threads}).
7123
7124 @findex mh-thread-ancestor
7125 @findex mh-thread-next-sibling
7126 @findex mh-thread-previous-sibling
7127 @kindex T n
7128 @kindex T p
7129 @kindex T u
7130
7131 There are a few commands to help you navigate threads. If you do not
7132 care for the way a particular thread has turned, you can move up the
7133 chain of messages with the command @kbd{T u}
7134 (@code{mh-thread-ancestor}. At any point you can use @kbd{T n}
7135 (@code{mh-thread-next-sibling} or @kbd{T p}
7136 (@code{mh-thread-previous-sibling}) to jump to the next or previous
7137 sibling, skipping the sub-threads. The command @kbd{T u} can also take
7138 a prefix argument to jump to the message that started everything.
7139
7140 @findex mh-delete-subject-or-thread
7141 @findex mh-thread-delete
7142 @findex mh-thread-refile
7143 @kindex k
7144 @kindex T d
7145 @kindex T o
7146
7147 There are threaded equivalents for the commands that delete and refile
7148 messages. For example, @kbd{T o} (@code{mh-thread-refile}) refiles the
7149 current message and all its children. Similarly, the command @kbd{T d}
7150 (@code{mh-thread-delete}) deletes the current message and all its
7151 children. These commands do not refile or delete sibling messages.
7152 @xref{Navigating}, for a description of the similar command @kbd{k}
7153 (@code{mh-delete-subject-or-thread}).
7154
7155 @vindex mh-large-folder
7156
7157 If you find that threading is too slow, it may be that you have
7158 @code{mh-large-folder} set too high. Also, threading is one of the few
7159 features of MH-E that really benefits from compiling. If you haven't
7160 compiled MH-E, I encourage you to do so@footnote{If you're not sure if
7161 MH-E has been byte-compiled, you could try running @samp{locate
7162 mh-thread.elc} or otherwise find MH-E on your system and ensure that
7163 @file{mh-thread.elc} exists. If you have multiple versions and you
7164 find that one is compiled but the other is not, then go into your
7165 @samp{*scratch*} buffer in Emacs, enter @kbd{load-path C-j}, and
7166 ensure that the byte-compiled version appears first in the
7167 @code{load-path}. If you find that MH-E is not compiled and you
7168 installed MH-E yourself, please refer to the installation directions
7169 in the file @file{README} in the distribution.}.
7170
7171 @node Limits, Sequences, Threading, Top
7172 @chapter Limiting Display
7173
7174 @cindex limits
7175 @cindex filters
7176
7177 Another way to organize messages in a folder besides threading
7178 (@pxref{Threading}) or using full-text indexed searches
7179 (@pxref{Searching}) is by limiting the folder display to messages that
7180 are similar to the current message.
7181
7182 @table @kbd
7183 @kindex / ?
7184 @findex mh-prefix-help
7185 @item / ?
7186 Display cheat sheet for the commands of the current prefix in
7187 minibuffer (@code{mh-prefix-help}).
7188 @c -------------------------
7189 @cindex @samp{Sequence > Narrow to Tick Sequence} menu item
7190 @cindex menu item, @samp{Sequence > Narrow to Tick Sequence}
7191 @kindex / '
7192 @findex mh-narrow-to-tick
7193 @item / '
7194 Limit to messages in the @samp{tick} sequence
7195 (@code{mh-narrow-to-tick}).
7196 @c -------------------------
7197 @kindex / c
7198 @findex mh-narrow-to-cc
7199 @item / c
7200 Limit to messages with the same @samp{Cc:} field
7201 (@code{mh-narrow-to-cc}).
7202 @c -------------------------
7203 @kindex / m
7204 @findex mh-narrow-to-from
7205 @item / m
7206 Limit to messages with the same @samp{From:} field
7207 (@code{mh-narrow-to-from}).
7208 @c -------------------------
7209 @kindex / g
7210 @findex mh-narrow-to-range
7211 @item / g
7212 Limit to range (@code{mh-narrow-to-range}).
7213 @c -------------------------
7214 @cindex @samp{Sequence > Narrow to Subject Sequence} menu item
7215 @cindex menu item, @samp{Sequence > Narrow to Subject Sequence}
7216 @kindex / s
7217 @findex mh-narrow-to-subject
7218 @item / s
7219 Limit to messages with the same @samp{Subject:} field
7220 (@code{mh-narrow-to-subject}).
7221 @c -------------------------
7222 @kindex / t
7223 @findex mh-narrow-to-to
7224 @item / t
7225 Limit to messages with the same @samp{To:} field
7226 (@code{mh-narrow-to-to}).
7227 @c -------------------------
7228 @cindex @samp{Sequence > Widen from Sequence} menu item
7229 @cindex menu item, @samp{Sequence > Widen from Sequence}
7230 @kindex / w
7231 @findex mh-widen
7232 @item / w
7233 Remove last restriction (@code{mh-widen}).
7234 @end table
7235
7236 All of the limiting commands above refine the display in some way.
7237
7238 @cindex @command{pick}
7239 @cindex MH commands, @command{pick}
7240 @findex mh-narrow-to-cc
7241 @findex mh-narrow-to-from
7242 @findex mh-narrow-to-subject
7243 @findex mh-narrow-to-to
7244 @kindex / c
7245 @kindex / m
7246 @kindex / s
7247 @kindex / t
7248
7249 The commands @kbd{/ c} (@code{mh-narrow-to-cc}), @kbd{/ m}
7250 (@code{mh-narrow-to-from}), @kbd{/ s} (@code{mh-narrow-to-subject}),
7251 and @kbd{/ t} (@code{mh-narrow-to-to}) restrict the display to
7252 messages matching the content of the respective field in the current
7253 message. However, you can give any of these a prefix argument to edit
7254 the @command{pick} expression used to narrow the view@footnote{See
7255 @command{pick}(1) or the section
7256 @uref{@value{MH-BOOK-HOME}/finpic.html, Finding Messages with pick} in
7257 the MH book.}.
7258
7259 @cindex @samp{tick} sequence
7260 @cindex sequence, @samp{tick}
7261 @cindex ticked messages, viewing
7262 @findex mh-narrow-to-range
7263 @findex mh-narrow-to-tick
7264 @kindex / '
7265 @kindex / g
7266
7267 You can also limit the display to messages in the @samp{tick} sequence
7268 with the command @kbd{/ '} (@code{mh-narrow-to-tick}).
7269 @xref{Sequences}, for information on putting message into the
7270 @samp{tick} sequence. Use the @kbd{/ g} (@code{mh-narrow-to-range})
7271 command to limit the display to messages in a range (@pxref{Ranges}).
7272
7273 @findex mh-widen
7274 @kindex / w
7275
7276 Each limit can be undone in turn with the @kbd{/ w} (@code{mh-widen})
7277 command. Give this command a prefix argument to remove all limits.
7278
7279 @node Sequences, Junk, Limits, Top
7280 @chapter Using Sequences
7281
7282 @cindex @samp{Sequence} menu
7283 @cindex menu, @samp{Sequence}
7284 @cindex sequences
7285
7286 For the whole scoop on MH sequences, refer to
7287 @samp{mh-sequence}(5)@footnote{See the section
7288 @uref{@value{MH-BOOK-HOME}/morseq.html, More About Sequences} in the MH
7289 book.}. As you've read, several of the MH-E commands can operate on a
7290 sequence, which is a shorthand for a range or group of messages. For
7291 example, you might want to forward several messages to a friend or
7292 colleague. Here's how to manipulate sequences. These commands are also
7293 available in the @samp{Sequence} menu.
7294
7295 @table @kbd
7296 @cindex @samp{Sequence > Toggle Tick Mark} menu item
7297 @cindex menu item, @samp{Sequence > Toggle Tick Mark}
7298 @kindex '
7299 @findex mh-toggle-tick
7300 @item '
7301 Toggle tick mark of range (@code{mh-toggle-tick}).
7302 @c -------------------------
7303 @kindex S ?
7304 @findex mh-prefix-help
7305 @item S ?
7306 Display cheat sheet for the commands of the current prefix in
7307 minibuffer (@code{mh-prefix-help}).
7308 @c -------------------------
7309 @cindex @samp{Sequence > Narrow to Tick Sequence} menu item
7310 @cindex menu item, @samp{Sequence > Narrow to Tick Sequence}
7311 @kindex S '
7312 @findex mh-narrow-to-tick
7313 @item S '
7314 Limit to ticked messages (@code{mh-narrow-to-tick}).
7315 @c -------------------------
7316 @cindex @samp{Sequence > Delete Message from Sequence...} menu item
7317 @cindex menu item, @samp{Sequence > Delete Message from Sequence...}
7318 @kindex S d
7319 @findex mh-delete-msg-from-seq
7320 @item S d
7321 Delete range from sequence (@code{mh-delete-msg-from-seq}).
7322 @c -------------------------
7323 @cindex @samp{Sequence > Delete Sequence...} menu item
7324 @cindex menu item, @samp{Sequence > Delete Sequence...}
7325 @kindex S k
7326 @findex mh-delete-seq
7327 @item S k
7328 Delete sequence (@code{mh-delete-seq}).
7329 @c -------------------------
7330 @cindex @samp{Sequence > List Sequences in Folder...} menu item
7331 @cindex menu item, @samp{Sequence > List Sequences in Folder...}
7332 @kindex S l
7333 @findex mh-list-sequences
7334 @item S l
7335 List all sequences in folder (@code{mh-list-sequences}).
7336 @c -------------------------
7337 @cindex @samp{Sequence > Narrow to Sequence...} menu item
7338 @cindex menu item, @samp{Sequence > Narrow to Sequence...}
7339 @kindex S n
7340 @findex mh-narrow-to-seq
7341 @item S n
7342 Restrict display to messages in sequence (@code{mh-narrow-to-seq}).
7343 @c -------------------------
7344 @cindex @samp{Sequence > Add Message to Sequence...} menu item
7345 @cindex menu item, @samp{Sequence > Add Message to Sequence...}
7346 @kindex S p
7347 @findex mh-put-msg-in-seq
7348 @item S p
7349 Add range to sequence (@code{mh-put-msg-in-seq}).
7350 @c -------------------------
7351 @cindex @samp{Sequence > List Sequences for Message} menu item
7352 @cindex menu item, @samp{Sequence > List Sequences for Message}
7353 @kindex S s
7354 @findex mh-msg-is-in-seq
7355 @item S s
7356 Display the sequences in which the current message appears
7357 (@code{mh-msg-is-in-seq}).
7358 @c -------------------------
7359 @cindex @samp{Sequence > Widen from Sequence} menu item
7360 @cindex menu item, @samp{Sequence > Widen from Sequence}
7361 @kindex S w
7362 @findex mh-widen
7363 @item S w
7364 Remove last restriction (@code{mh-widen}).
7365 @c -------------------------
7366 @findex mh-update-sequences
7367 @item M-x mh-update-sequences
7368 Flush MH-E's state out to MH@.
7369 @end table
7370
7371 @cindex @samp{mh-sequences} customization group
7372 @cindex customization group, @samp{mh-sequences}
7373
7374 The @samp{mh-sequences} customization group contains the options
7375 associated with sequences.
7376
7377 @vtable @code
7378 @item mh-refile-preserves-sequences-flag
7379 On means that sequences are preserved when messages are refiled
7380 (default: @samp{on}).
7381 @c -------------------------
7382 @item mh-tick-seq
7383 The name of the MH sequence for ticked messages (default: @samp{'tick}).
7384 @c -------------------------
7385 @item mh-update-sequences-after-mh-show-flag
7386 On means flush MH sequences to disk after message is shown (default:
7387 @samp{on}).
7388 @end vtable
7389
7390 The following hook is available.
7391
7392 @vtable @code
7393 @item mh-unseen-updated-hook
7394 Hook run after the unseen sequence has been updated (default: @code{nil}).
7395 @end vtable
7396
7397 @cindex @command{pick}
7398 @cindex MH commands, @command{pick}
7399 @findex mh-put-msg-in-seq
7400 @kindex S p
7401
7402 To place a message in a sequence, use @kbd{S p}
7403 (@code{mh-put-msg-in-seq}). Give @kbd{S p} a range and you can add all
7404 the messages in a sequence to another sequence (for example, @kbd{C-u
7405 S p SourceSequence @key{RET} DestSequence @key{RET}}, @pxref{Ranges}).
7406
7407 @cindex @samp{tick} sequence
7408 @cindex sequence, @samp{tick}
7409 @cindex ticking messages
7410 @findex mh-index-ticked-messages
7411 @findex mh-toggle-tick
7412 @kindex '
7413 @kindex F '
7414 @kindex S p
7415
7416 One specific use of the @kbd{S p} command is @kbd{'}
7417 (@code{mh-toggle-tick}) which adds messages to the @samp{tick}
7418 sequence. This sequence can be viewed later with the @kbd{F '}
7419 (@code{mh-index-ticked-messages}) command (@pxref{Folders}).
7420
7421 @vindex mh-tick-seq
7422
7423 You can customize the option @code{mh-tick-seq} if you already use the
7424 @samp{tick} sequence for your own use. You can also disable all of the
7425 ticking functions by choosing the @samp{Disable Ticking} item but
7426 there isn't much advantage to that.
7427
7428 @cindex MH-Folder mode
7429 @cindex modes, MH-Folder
7430 @findex mh-narrow-to-seq
7431 @findex mh-narrow-to-tick
7432 @findex mh-widen
7433 @kindex S '
7434 @kindex S n
7435 @kindex S w
7436
7437 Once you've placed some messages in a sequence, you may wish to narrow
7438 the field of view to just those messages in the sequence you've
7439 created. To do this, use @kbd{S n} (@code{mh-narrow-to-seq}). You are
7440 prompted for the name of the sequence. What this does is show only
7441 those messages that are in the selected sequence in the MH-Folder
7442 buffer. In addition, it limits further MH-E searches to just those
7443 messages. To narrow the view to the messages in the @samp{tick}
7444 sequence, use @kbd{S '} (@code{mh-narrow-to-tick}). When you want to
7445 widen the view to all your messages again, use @kbd{S w}
7446 (@code{mh-widen}).
7447
7448 @cindex buffers, @samp{*MH-E Sequences*}
7449 @cindex @samp{*MH-E Sequences*}
7450 @findex mh-list-sequences
7451 @findex mh-msg-is-in-seq
7452 @kindex S l
7453 @kindex S s
7454
7455 You can see which sequences in which a message appears with the
7456 command @kbd{S s} (@code{mh-msg-is-in-seq}). Use a prefix argument to
7457 display the sequences in which another message appears (as in @kbd{C-u
7458 42 S s @key{RET}}). Or, you can list all sequences in a selected
7459 folder (default is current folder) with @kbd{S l}
7460 (@code{mh-list-sequences}). The list appears in a buffer named
7461 @samp{*MH-E Sequences*} (@pxref{Miscellaneous}).
7462
7463 @cindex MH profile component, @samp{Previous-Sequence:}
7464 @cindex @samp{cur} sequence
7465 @cindex @samp{Previous-Sequence:} MH profile component
7466 @cindex sequence, @samp{cur}
7467 @cindex sequence, @samp{Previous-Sequence}
7468 @vindex mh-refile-preserves-sequences-flag
7469
7470 If a message is in any sequence (except
7471 @samp{Previous-Sequence:}@footnote{See @samp{mh-profile}(5)).} and
7472 @samp{cur}) when it is refiled, then it will still be in those
7473 sequences in the destination folder. If this behavior is not desired,
7474 then turn off the option @code{mh-refile-preserves-sequences-flag}.
7475
7476 @findex mh-delete-msg-from-seq
7477 @findex mh-delete-seq
7478 @kindex d
7479 @kindex S d
7480 @kindex S k
7481
7482 If you want to remove a message (or range, @pxref{Ranges}) from a
7483 sequence, use @kbd{S d} (@code{mh-delete-msg-from-seq}). If you want
7484 to delete an entire sequence, use @kbd{S k} (@code{mh-delete-seq}). In
7485 the latter case you are prompted for the sequence to delete. Note that
7486 this deletes only the sequence, not the messages in the sequence. If
7487 you want to delete the messages, use @kbd{C-u d} (@pxref{Reading
7488 Mail}).
7489
7490 @cindex @samp{Unseen-Sequence:} MH profile component
7491 @cindex @samp{cur} sequence
7492 @cindex @samp{tick} sequence
7493 @cindex MH profile component, @samp{Unseen-Sequence:}
7494 @cindex sequence, @samp{Unseen-Sequence}
7495 @cindex sequence, @samp{cur}
7496 @cindex sequence, @samp{tick}
7497 @findex mh-update-sequences
7498 @kindex M-x mh-update-sequences
7499 @kindex q
7500 @kindex x
7501 @vindex mh-tick-seq
7502 @vindex mh-update-sequences-after-mh-show-flag
7503
7504 Three sequences are maintained internally by MH-E and pushed out to MH
7505 when a message is shown. They include the sequence specified by your
7506 @samp{Unseen-Sequence:} profile component, @samp{cur}, and the
7507 sequence listed by the option @code{mh-tick-seq} which is @samp{tick}
7508 by default. If you do not like this behavior, turn off the option
7509 @code{mh-update-sequences-after-mh-show-flag}. You can then update the
7510 state manually with the @kbd{x}, @kbd{q}, or @kbd{M-x
7511 mh-update-sequences} commands.
7512
7513 @vindex mh-seen-list
7514 @vindex mh-unseen-updated-hook
7515
7516 The hook @code{mh-unseen-updated-hook} is run after the unseen
7517 sequence has been updated. The variable @code{mh-seen-list} can be
7518 used by this hook to obtain the list of messages which were removed
7519 from the unseen sequence.
7520
7521 @cindex @command{mark}
7522 @cindex MH commands, @command{mark}
7523 @kindex S n
7524 @kindex S w
7525
7526 With the exceptions of @kbd{S n} and @kbd{S w}, the underlying MH
7527 command dealing with sequences is @command{mark}@footnote{See the
7528 section @uref{@value{MH-BOOK-HOME}/mmbwm.html, Make Message Bookmarks
7529 with mark} in the MH book.}.
7530
7531 @node Junk, Miscellaneous, Sequences, Top
7532 @chapter Dealing With Junk Mail
7533
7534 @cindex Marshall Rose
7535 @cindex junk mail
7536 @cindex spam
7537
7538 Marshall Rose once wrote a paper on MH entitled, @cite{How to process
7539 200 messages a day and still get some real work done}. This chapter
7540 could be entitled, @cite{How to process 1000 spams a day and still get
7541 some real work done}.
7542
7543 @cindex blacklisting
7544 @cindex ham
7545 @cindex viruses
7546 @cindex whitelisting
7547 @cindex worms
7548
7549 We use the terms @dfn{junk mail} and @dfn{spam} interchangeably for
7550 any unwanted message which includes spam, @dfn{viruses}, and
7551 @dfn{worms}. The opposite of spam is @dfn{ham}. The act of classifying
7552 a sender as one who sends junk mail is called @dfn{blacklisting}; the
7553 opposite is called @dfn{whitelisting}.
7554
7555 @table @kbd
7556 @kindex J ?
7557 @findex mh-prefix-help
7558 @item J ?
7559 Display cheat sheet for the commands of the current prefix in
7560 minibuffer (@code{mh-prefix-help}).
7561 @c -------------------------
7562 @kindex J b
7563 @findex mh-junk-blacklist
7564 @item J b
7565 Blacklist range as spam (@code{mh-junk-blacklist}).
7566 @c -------------------------
7567 @kindex J w
7568 @findex mh-junk-whitelist
7569 @item J w
7570 Whitelist range as ham (@code{mh-junk-whitelist}).
7571 @c -------------------------
7572 @item @code{mh-spamassassin-identify-spammers}
7573 Identify spammers who are repeat offenders.
7574 @end table
7575
7576 @cindex @samp{mh-junk} customization group
7577 @cindex customization group, @samp{mh-junk}
7578
7579 The following table lists the options from the @samp{mh-junk}
7580 customization group.
7581
7582 @vtable @code
7583 @item mh-junk-background
7584 If on, spam programs are run in background (default: @samp{off}).
7585 @c -------------------------
7586 @item mh-junk-disposition
7587 Disposition of junk mail (default: @samp{Delete Spam}).
7588 @c -------------------------
7589 @item mh-junk-program
7590 Spam program that MH-E should use (default: @samp{Auto-detect}).
7591 @end vtable
7592
7593 @cindex SpamProbe
7594 @cindex Spamassassin
7595 @cindex bogofilter
7596 @cindex spam filters, SpamProbe
7597 @cindex spam filters, Spamassassin
7598 @cindex spam filters, bogofilter
7599
7600 MH-E depends on @uref{http://spamassassin.apache.org/, SpamAssassin},
7601 @uref{http://bogofilter.sourceforge.net/, bogofilter}, or
7602 @uref{http://spamprobe.sourceforge.net/, SpamProbe} to throw the dreck
7603 away. This chapter describes briefly how to configure these programs
7604 to work well with MH-E and how to use MH-E's interface that provides
7605 continuing education for these programs.
7606
7607 @vindex mh-junk-program
7608
7609 The default setting of the option @code{mh-junk-program} is
7610 @samp{Auto-detect} which means that MH-E will automatically choose one
7611 of SpamAssassin, bogofilter, or SpamProbe in that order. If, for
7612 example, you have both SpamAssassin and bogofilter installed and you
7613 want to use bogofilter, then you can set this option to
7614 @samp{Bogofilter}.
7615
7616 @findex mh-junk-blacklist
7617 @kindex J b
7618 @vindex mh-junk-disposition
7619
7620 The command @kbd{J b} (@code{mh-junk-blacklist}) trains the spam
7621 program in use with the content of the range (@pxref{Ranges}) and then
7622 handles the message(s) as specified by the option
7623 @code{mh-junk-disposition}. By default, this option is set to
7624 @samp{Delete Spam} but you can also specify the name of the folder
7625 which is useful for building a corpus of spam for training purposes.
7626
7627 @findex mh-junk-whitelist
7628 @kindex J w
7629
7630 In contrast, the command @kbd{J w} (@code{mh-junk-whitelist})
7631 reclassifies a range of messages (@pxref{Ranges}) as ham if it were
7632 incorrectly classified as spam. It then refiles the message into the
7633 @file{+inbox} folder.
7634
7635 @cindex @samp{*MH-E Log*}
7636 @cindex buffers, @samp{*MH-E Log*}
7637 @findex call-process
7638 @vindex mh-junk-background
7639
7640 By default, the programs are run in the foreground, but this can be
7641 slow when junking large numbers of messages. If you have enough memory
7642 or don't junk that many messages at the same time, you might try
7643 turning on the option @code{mh-junk-background}. @footnote{Note that
7644 the option @code{mh-junk-background} is used as the @code{display}
7645 argument in the call to @code{call-process}. Therefore, turning on
7646 this option means setting its value to @samp{0}. You can also set its
7647 value to @samp{t} to direct the programs' output to the @samp{*MH-E
7648 Log*} buffer; this may be useful for debugging.}
7649
7650 The following sections discuss the various counter-spam measures that
7651 MH-E can work with.
7652
7653 @cindex @file{.procmailrc}
7654 @cindex files, @file{.procmailrc}
7655
7656 @subheading SpamAssassin
7657
7658 @cindex Spamassassin
7659 @cindex spam filters, Spamassassin
7660
7661 SpamAssassin is one of the more popular spam filtering programs. Get
7662 it from your local distribution or from the
7663 @uref{http://spamassassin.apache.org/, SpamAssassin web site}.
7664
7665 To use SpamAssassin, add the following recipes to @file{~/.procmailrc}:
7666
7667 @cindex @command{spamc}
7668 @cindex @samp{X-Spam-Level:} header field
7669 @cindex @samp{X-Spam-Status:} header field
7670 @cindex header field, @samp{X-Spam-Level:}
7671 @cindex header field, @samp{X-Spam-Status:}
7672
7673 @smallexample
7674 PATH=$PATH:/usr/bin/mh
7675 MAILDIR=$HOME/`mhparam Path`
7676
7677 # Fight spam with SpamAssassin.
7678 :0fw
7679 | spamc
7680
7681 # Anything with a spam level of 10 or more is junked immediately.
7682 :0:
7683 * ^X-Spam-Level: ..........
7684 /dev/null
7685
7686 :0:
7687 * ^X-Spam-Status: Yes
7688 spam/.
7689 @end smallexample
7690
7691 If you don't use @command{spamc}, use @samp{spamassassin -P -a}.
7692
7693 Note that one of the recipes above throws away messages with a score
7694 greater than or equal to 10. Here's how you can determine a value that
7695 works best for you.
7696
7697 First, run @samp{spamassassin -t} on every mail message in your
7698 archive and use @command{gnumeric} to verify that the average plus the
7699 standard deviation of good mail is under 5, the SpamAssassin default
7700 for ``spam''.
7701
7702 Using @command{gnumeric}, sort the messages by score and view the
7703 messages with the highest score. Determine the score which encompasses
7704 all of your interesting messages and add a couple of points to be
7705 conservative. Add that many dots to the @samp{X-Spam-Level:} header
7706 field above to send messages with that score down the drain.
7707
7708 In the example above, messages with a score of 5-9 are set aside in
7709 the @samp{+spam} folder for later review. The major weakness of
7710 rules-based filters is a plethora of false positives so it is
7711 worthwhile to check.
7712
7713 @findex mh-junk-blacklist
7714 @findex mh-junk-whitelist
7715 @kindex J b
7716 @kindex J w
7717
7718 If SpamAssassin classifies a message incorrectly, or is unsure, you can
7719 use the MH-E commands @kbd{J b} (@code{mh-junk-blacklist}) and
7720 @kbd{J w} (@code{mh-junk-whitelist}).
7721
7722 @cindex @command{sa-learn}
7723 @cindex @file{.spamassassin/user_prefs}
7724 @cindex files, @file{.spamassassin/user_prefs}
7725
7726 The command @kbd{J b} (@code{mh-junk-blacklist}) adds a
7727 @samp{blacklist_from} entry to @file{~/spamassassin/user_prefs},
7728 deletes the message, and sends the message to the Razor, so that
7729 others might not see this spam. If the @command{sa-learn} command is
7730 available, the message is also recategorized as spam.
7731
7732 The command@kbd{J w} (@code{mh-junk-whitelist}) adds a
7733 @samp{whitelist_from} rule to @samp{~/.spamassassin/user_prefs}. If
7734 the @command{sa-learn} command is available, the message is also
7735 recategorized as ham.
7736
7737 Over time, you'll observe that the same host or domain occurs
7738 repeatedly in the @samp{blacklist_from} entries, so you might think
7739 that you could avoid future spam by blacklisting all mail from a
7740 particular domain. The utility function
7741 @code{mh-spamassassin-identify-spammers} helps you do precisely that.
7742 This function displays a frequency count of the hosts and domains in
7743 the @samp{blacklist_from} entries from the last blank line in
7744 @file{~/.spamassassin/user_prefs} to the end of the file. This
7745 information can be used so that you can replace multiple
7746 @samp{blacklist_from} entries with a single wildcard entry such as:
7747
7748 @smallexample
7749 blacklist_from *@@*amazingoffersdirect2u.com
7750 @end smallexample
7751
7752 In versions of SpamAssassin (2.50 and on) that support a Bayesian
7753 classifier, @kbd{J b} @code{(mh-junk-blacklist}) uses the program
7754 @command{sa-learn} to recategorize the message as spam. Neither MH-E,
7755 nor SpamAssassin, rebuilds the database after adding words, so you
7756 will need to run @samp{sa-learn --rebuild} periodically. This can be
7757 done by adding the following to your @file{crontab}:
7758
7759 @smallexample
7760 0 * * * * sa-learn --rebuild > /dev/null 2>&1
7761 @end smallexample
7762
7763 @subheading Bogofilter
7764
7765 @cindex bogofilter
7766 @cindex spam filters, bogofilter
7767
7768 Bogofilter is a Bayesian spam filtering program. Get it from your
7769 local distribution or from the
7770 @uref{http://bogofilter.sourceforge.net/, bogofilter web site}.
7771
7772 Bogofilter is taught by running:
7773
7774 @smallexample
7775 bogofilter -n < good-message
7776 @end smallexample
7777
7778 on every good message, and
7779
7780 @smallexample
7781 bogofilter -s < spam-message
7782 @end smallexample
7783
7784 @cindex full training
7785
7786 on every spam message. This is called a @dfn{full training}; three
7787 other training methods are described in the FAQ that is distributed
7788 with bogofilter. Note that most Bayesian filters need 1000 to 5000 of
7789 each type of message to start doing a good job.
7790
7791 To use bogofilter, add the following recipes to @file{~/.procmailrc}:
7792
7793 @cindex @samp{X-Bogosity:} header field
7794 @cindex header field, @samp{X-Bogosity:}
7795
7796 @smallexample
7797 PATH=$PATH:/usr/bin/mh
7798 MAILDIR=$HOME/`mhparam Path`
7799
7800 # Fight spam with Bogofilter.
7801 :0fw
7802 | bogofilter -3 -e -p
7803
7804 :0:
7805 * ^X-Bogosity: Yes, tests=bogofilter
7806 spam/.
7807
7808 :0:
7809 * ^X-Bogosity: Unsure, tests=bogofilter
7810 spam/unsure/.
7811 @end smallexample
7812
7813 @findex mh-junk-blacklist
7814 @findex mh-junk-whitelist
7815 @kindex J b
7816 @kindex J w
7817
7818 If bogofilter classifies a message incorrectly, or is unsure, you can
7819 use the MH-E commands @kbd{J b} (@code{mh-junk-blacklist}) and @kbd{J
7820 w} (@code{mh-junk-whitelist}) to update bogofilter's training.
7821
7822 The @cite{Bogofilter FAQ} suggests that you run the following
7823 occasionally to shrink the database:
7824
7825 @smallexample
7826 bogoutil -d wordlist.db | bogoutil -l wordlist.db.new
7827 mv wordlist.db wordlist.db.prv
7828 mv wordlist.db.new wordlist.db
7829 @end smallexample
7830
7831 The @cite{Bogofilter tuning HOWTO} describes how you can fine-tune
7832 bogofilter.
7833
7834 @subheading SpamProbe
7835
7836 @cindex SpamProbe
7837 @cindex spam filters, SpamProbe
7838
7839 SpamProbe is a Bayesian spam filtering program. Get it from your local
7840 distribution or from the @uref{http://spamprobe.sourceforge.net,
7841 SpamProbe web site}.
7842
7843 To use SpamProbe, add the following recipes to @file{~/.procmailrc}:
7844
7845 @cindex @command{formail}
7846 @cindex @samp{X-SpamProbe:} header field
7847 @cindex header field, @samp{X-SpamProbe:}
7848
7849 @smallexample
7850 PATH=$PATH:/usr/bin/mh
7851 MAILDIR=$HOME/`mhparam Path`
7852
7853 # Fight spam with SpamProbe.
7854 :0
7855 SCORE=| spamprobe receive
7856
7857 :0 wf
7858 | formail -I "X-SpamProbe: $SCORE"
7859
7860 :0:
7861 *^X-SpamProbe: SPAM
7862 spam/.
7863 @end smallexample
7864
7865 @findex mh-junk-blacklist
7866 @findex mh-junk-whitelist
7867 @kindex J b
7868 @kindex J w
7869
7870 If SpamProbe classifies a message incorrectly, you can use the MH-E
7871 commands @kbd{J b} (@code{mh-junk-blacklist}) and @kbd{J w}
7872 (@code{mh-junk-whitelist}) to update SpamProbe's training.
7873
7874 @subheading Other Things You Can Do
7875
7876 There are a couple of things that you can add to @file{~/.procmailrc}
7877 in order to filter out a lot of spam and viruses. The first is to
7878 eliminate any message with a Windows executable (which is most likely
7879 a virus). The second is to eliminate mail in character sets that you
7880 can't read.
7881
7882 @cindex @samp{Content-Transfer-Encoding:} header field
7883 @cindex @samp{Content-Type:} header field
7884 @cindex @samp{Subject:} header field
7885 @cindex header field, @samp{Content-Transfer-Encoding:}
7886 @cindex header field, @samp{Content-Type:}
7887 @cindex header field, @samp{Subject:}
7888
7889 @smallexample
7890 PATH=$PATH:/usr/bin/mh
7891 MAILDIR=$HOME/`mhparam Path`
7892
7893 #
7894 # Filter messages with win32 executables/virii.
7895 #
7896 # These attachments are base64 and have a TVqQAAMAAAAEAAAA//8AALg
7897 # pattern. The string "this program cannot be run in MS-DOS mode"
7898 # encoded in base64 is 4fug4AtAnNIbg and helps to avoid false
7899 # positives (Roland Smith via Pete from the bogofilter mailing list).
7900 #
7901 :0 B:
7902 * ^Content-Transfer-Encoding:.*base64
7903 * ^TVqQAAMAAAAEAAAA//8AALg
7904 * 4fug4AtAnNIbg
7905 spam/exe/.
7906
7907 #
7908 # Filter mail in unreadable character sets (from the Bogofilter FAQ).
7909 #
7910 UNREADABLE='[^?"]*big5|iso-2022-jp|ISO-2022-KR|euc-kr|gb2312|ks_c_5601-1987'
7911
7912 :0:
7913 * 1^0 $ ^Subject:.*=\?($UNREADABLE)
7914 * 1^0 $ ^Content-Type:.*charset="?($UNREADABLE)
7915 spam/unreadable/.
7916
7917 :0:
7918 * ^Content-Type:.*multipart
7919 * B ?? $ ^Content-Type:.*^?.*charset="?($UNREADABLE)
7920 spam/unreadable/.
7921 @end smallexample
7922
7923 @node Miscellaneous, Scan Line Formats, Junk, Top
7924 @chapter Miscellaneous Commands, Variables, and Buffers
7925
7926 This chapter covers the following command and the various MH-E
7927 buffers,
7928
7929 @ftable @code
7930 @item mh-version
7931 Display version information about MH-E and the MH mail handling
7932 system.
7933 @end ftable
7934
7935 @cindex buffers, @samp{*MH-E Info*}
7936 @cindex MH-E version
7937 @cindex @samp{*MH-E Info*}
7938 @cindex version
7939 @kindex M-x mh-version
7940
7941 One command worth noting is @kbd{M-x mh-version}. You can compare the
7942 version this command prints to the latest release (@pxref{Getting
7943 MH-E}). The output of @kbd{M-x mh-version}, found in a buffer named
7944 @samp{*MH-E Info*}, should usually be included with any bug report you
7945 submit (@pxref{Bug Reports}).
7946
7947 @subheading MH-E Buffers
7948
7949 Besides the MH-Folder, MH-Show, and MH-Letter buffers, MH-E creates
7950 several other buffers. They are:
7951
7952 @table @samp
7953 @cindex @samp{*MH-E Folders*}
7954 @cindex buffers, @samp{*MH-E Folders*}
7955 @findex mh-list-folders
7956 @item *MH-E Folders*
7957 @kindex F l
7958 This buffer contains the output of @kbd{F l} (@code{mh-list-folders}).
7959 @xref{Folders}.
7960 @c -------------------------
7961 @cindex @samp{*MH-E Help*}
7962 @cindex buffers, @samp{*MH-E Help*}
7963 @findex mh-help
7964 @item *MH-E Help*
7965 @kindex ?
7966 @kindex C-c ?
7967 This buffer contains the output of @kbd{?} (@code{mh-help}) and
7968 @kbd{C-c ?} in MH-Letter mode. @xref{Using This Manual}.
7969 @c -------------------------
7970 @cindex @samp{*MH-E Info*}
7971 @cindex buffers, @samp{*MH-E Info*}
7972 @item *MH-E Info*
7973 This buffer contains the output of @kbd{M-x mh-version @key{RET}}.
7974 @c -------------------------
7975 @cindex @samp{*MH-E Log*}
7976 @cindex buffers, @samp{*MH-E Log*}
7977 @item *MH-E Log*
7978 This buffer contains the last 100 lines of the output of the various
7979 MH commands.
7980 @c -------------------------
7981 @cindex @samp{*MH-E Mail Delivery*}
7982 @cindex buffers, @samp{*MH-E Mail Delivery*}
7983 @item *MH-E Mail Delivery*
7984 This buffer contains the transcript of a mail delivery. @xref{Sending
7985 Message}.
7986 @c -------------------------
7987 @cindex @samp{*MH-E Recipients*}
7988 @cindex buffers, @samp{*MH-E Recipients*}
7989 @findex mh-check-whom
7990 @item *MH-E Recipients*
7991 @kindex C-c C-w
7992 This buffer contains the output of @kbd{C-c C-w}
7993 (@code{mh-check-whom}) and is killed when draft is sent.
7994 @xref{Checking Recipients}.
7995 @c -------------------------
7996 @cindex @samp{*MH-E Sequences*}
7997 @cindex buffers, @samp{*MH-E Sequences*}
7998 @item *MH-E Sequences*
7999 This buffer contains the output of @kbd{S l}
8000 (@code{mh-list-sequences}). @xref{Sequences}.
8001 @c -------------------------
8002 @cindex @samp{*mh-temp*}
8003 @cindex buffers, @samp{*mh-temp*}
8004 @item *mh-temp*
8005 This is a scratch, ephemeral, buffer used by MH-E functions. Note that
8006 it is hidden because the first character in the name is a space.
8007 You'll generally not have any need for this buffer.
8008 @end table
8009
8010 @node Scan Line Formats, Procmail, Miscellaneous, Top
8011 @appendix Scan Line Formats
8012
8013 @cindex scan line formats
8014
8015 This appendix discusses how MH-E creates, parses, and manipulates scan
8016 lines. If you have your own MH scan or inc format files, you
8017 @strong{can} teach MH-E how to handle them, but it isn't easy as
8018 you'll see.
8019
8020 @cindex @samp{mh-scan-line-formats} customization group
8021 @cindex customization group, @samp{mh-scan-line-formats}
8022
8023 This table lists the options in the @samp{mh-scan-line-formats}
8024 customization group.
8025
8026 @vtable @code
8027 @item mh-adaptive-cmd-note-flag
8028 On means that the message number width is determined dynamically
8029 (default: @samp{on}).
8030 @c -------------------------
8031 @item mh-scan-format-file
8032 Specifies the format file to pass to the scan program (default:
8033 @samp{Use MH-E scan Format}).
8034 @c -------------------------
8035 @item mh-scan-prog
8036 Program used to scan messages (default: @code{"scan"}).
8037 @end vtable
8038
8039 @vindex mh-adaptive-cmd-note-flag
8040
8041 There are a couple of caveats when creating your own scan format file.
8042 First, MH-E will not work if your scan lines do not include message
8043 numbers. It will work poorly if you don't dedicate a column for
8044 showing the current message and notations. It is also best to keep the
8045 first column empty to make room for the cursor and so that text isn't
8046 obscured by the current message's overlay arrow when running in a
8047 terminal. You won't be able to use the option
8048 @code{mh-adaptive-cmd-note-flag} or the threading features
8049 (@pxref{Threading}).
8050
8051 @cindex message numbers
8052 @findex mh-set-cmd-note
8053 @vindex mh-adaptive-cmd-note-flag
8054 @vindex mh-scan-format-file
8055
8056 If you've created your own format to handle long message numbers,
8057 you'll be pleased to know you no longer need it since MH-E adapts its
8058 internal format based upon the largest message number if
8059 @code{mh-adaptive-cmd-note-flag} is on (the default). If you prefer
8060 fixed-width message numbers, turn off @code{mh-adaptive-cmd-note-flag}
8061 and call @code{mh-set-cmd-note} with the width specified by your
8062 format file (see @code{mh-scan-format-file}). For example, the default
8063 width is 4, so you would use @samp{(mh-set-cmd-note 4)}.
8064
8065 @vindex mh-adaptive-cmd-note-flag
8066 @vindex mh-scan-format-file
8067 @vindex mh-scan-format-mh
8068 @vindex mh-scan-format-nmh
8069
8070 The default setting for @code{mh-scan-format-file} is @samp{Use MH-E
8071 scan Format}. This means that the format string will be taken from the
8072 either @code{mh-scan-format-mh} or @code{mh-scan-format-nmh} depending
8073 on whether MH or nmh (or GNU mailutils MH) is in use. This setting
8074 also enables you to turn on the option
8075 @code{mh-adaptive-cmd-note-flag}. You can also set this option to
8076 @samp{Use Default scan Format} to get the same output as you would get
8077 if you ran @command{scan} from the shell. If you have a format file
8078 that you want MH-E to use but not MH, you can set this option to
8079 @samp{Specify a scan Format File} and enter the name of your format
8080 file.
8081
8082 @vindex mh-scan-format-file
8083 @vindex mh-scan-format-mh
8084 @vindex mh-scan-format-nmh
8085
8086 The scan format that MH-E uses when @code{mh-scan-format-file} is set
8087 to its default of @samp{Use MH-E scan Format} is held in the variables
8088 @code{mh-scan-format-nmh} and @code{mh-scan-format-mh} depending on
8089 whether you are using nmh (or GNU mailutils MH) or not. Typically, you
8090 create your own format files rather than modifying these variables.
8091 The value of @code{mh-scan-format-nmh} is:
8092
8093 @smallexample
8094 (concat
8095 "%4(msg)"
8096 "%<(cur)+%| %>"
8097 "%<@{replied@}-"
8098 "%?(nonnull(comp@{to@}))%<(mymbox@{to@})t%>"
8099 "%?(nonnull(comp@{cc@}))%<(mymbox@{cc@})c%>"
8100 "%?(nonnull(comp@{bcc@}))%<(mymbox@{bcc@})b%>"
8101 "%?(nonnull(comp@{newsgroups@}))n%>"
8102 "%<(zero) %>"
8103 "%02(mon@{date@})/%02(mday@{date@})%<@{date@} %|*%>"
8104 "%<(mymbox@{from@})%<@{to@}To:%14(decode(friendly@{to@}))%>%>"
8105 "%<(zero)%17(decode(friendly@{from@}))%> "
8106 "%(decode@{subject@})%<@{body@}<<%@{body@}%>")
8107 @end smallexample
8108
8109 @cindex decoding RFC 2047
8110 @cindex RFC 2047, decoding
8111 @vindex mh-scan-format-mh
8112
8113 The setting for @code{mh-scan-format-mh} is similar, except that MH
8114 doesn't have the function @code{decode} (which is used to decode RFC
8115 2047 encodings).
8116
8117 @cindex notations, scan line
8118 @cindex scan line notations
8119
8120 These strings are passed to the @command{scan} program via the
8121 @option{-format} argument. The formats are identical to the defaults
8122 except that additional hints for fontification have been added to the
8123 existing notations in the fifth column (remember that in Emacs, the
8124 columns start at 0). The values of the fifth column, in priority
8125 order, are: @samp{-} if the message has been replied to, @samp{t} if
8126 an address in the @samp{To:} field matches one of the mailboxes of the
8127 current user, @samp{c} if the @samp{Cc:} field matches, @samp{b} if
8128 the @samp{Bcc:} field matches, and @samp{n} if a non-empty
8129 @samp{Newsgroups:} field is present.
8130
8131 @cindex @command{scan}
8132 @cindex MH commands, @command{scan}
8133 @vindex mh-progs
8134 @vindex mh-scan-prog
8135
8136 The name of the program that generates a listing of one line per
8137 message is held in @code{mh-scan-prog} (default: @code{"scan"}).
8138 Unless this variable contains an absolute pathname, it is assumed to
8139 be in the @code{mh-progs} directory (@pxref{Getting Started}). You may
8140 link another program to @command{scan} (see @samp{mh-profile}(5)) to
8141 produce a different type of listing@footnote{See the section
8142 @uref{@value{MH-BOOK-HOME}/faswsprs.html, Find and Specify with scan
8143 pick Ranges Sequences} in the MH book.}.
8144
8145 @cindex regular expressions, scan line formats
8146 @findex mh-set-cmd-note
8147 @findex setq
8148
8149 If you change the format of the scan lines you'll need to tell MH-E
8150 how to parse the new format. As you will see, quite a lot of variables
8151 are involved to do that. Use @kbd{M-x apropos @key{RET}
8152 mh-scan.*regexp @key{RET}} to obtain a list of these variables. You
8153 will also have to call @code{mh-set-cmd-note} if your notations are
8154 not in column 4 (columns in Emacs start with 0). Note that unlike most
8155 of the user options described in this manual, these are variables and
8156 must be set with @code{setq} instead of in a customization buffer. For
8157 help with regular expressions, see
8158 @ifnothtml
8159 @ref{Regexps, , Syntax of Regular Expressions, emacs, The
8160 GNU Emacs Manual}.
8161 @end ifnothtml
8162 @ifhtml
8163 section
8164 @uref{http://www.gnu.org/software/emacs/manual/html_node/Regexps.html,
8165 Syntax of Regular Expressions} in @cite{The GNU Emacs Manual}.
8166 @end ifhtml
8167
8168 The first variable has to do with pruning out garbage.
8169
8170 @vtable @code
8171 @cindex @command{inc}
8172 @cindex MH commands, @command{inc}
8173 @cindex @command{scan}
8174 @cindex MH commands, @command{scan}
8175 @item mh-scan-valid-regexp
8176 This regular expression describes a valid scan line. This is used to
8177 eliminate error messages that are occasionally produced by
8178 @command{inc}@footnote{See the section
8179 @uref{@value{MH-BOOK-HOME}/reapre.html, Reading Mail: inc show next
8180 prev} in the MH book.} or @command{scan} (default: @code{"^ *[0-9]"}).
8181 @end vtable
8182
8183 Next, many variables control how the scan lines are parsed.
8184
8185 @vtable @code
8186 @vindex mh-folder-body
8187 @vindex mh-folder-font-lock-keywords
8188 @item mh-scan-body-regexp
8189 This regular expression matches the message body fragment. Note that
8190 the default setting of @code{mh-folder-font-lock-keywords} expects
8191 this expression to contain at least one parenthesized expression which
8192 matches the body text as in the default of
8193 @code{"\\(<<\\([^\n]+\\)?\\)"}. If this regular expression is not
8194 correct, the body fragment will not be highlighted with the face
8195 @code{mh-folder-body}.
8196 @c -------------------------
8197 @vindex mh-folder-cur-msg-number
8198 @vindex mh-folder-font-lock-keywords
8199 @vindex mh-note-cur
8200 @item mh-scan-cur-msg-number-regexp
8201 This regular expression matches the current message. It must match
8202 from the beginning of the line. Note that the default setting of
8203 @code{mh-folder-font-lock-keywords} expects this expression to contain
8204 at least one parenthesized expression which matches the message number
8205 as in the default of @w{@code{"^\\( *[0-9]+\\+\\).*"}}. This
8206 expression includes the leading space and current message marker
8207 @samp{+} within the parenthesis since it looks better to highlight
8208 these items as well. The highlighting is done with the face
8209 @code{mh-folder-cur-msg-number}. This regular expression should be
8210 correct as it is needed by non-fontification functions. See also
8211 @code{mh-note-cur}.
8212 @c -------------------------
8213 @vindex mh-folder-date
8214 @vindex mh-folder-font-lock-keywords
8215 @vindex mh-scan-sent-to-me-sender-regexp
8216 @item mh-scan-date-regexp
8217 This regular expression matches a valid date. It must @strong{not} be
8218 anchored to the beginning or the end of the line. Note that the
8219 default setting of @code{mh-folder-font-lock-keywords} expects this
8220 expression to contain only one parenthesized expression which matches
8221 the date field as in the default of
8222 @code{"\\([0-9][0-9]/[0-9][0-9]\\)"}. If this regular expression is
8223 not correct, the date will not be highlighted with the face
8224 @code{mh-folder-date}.
8225 @c -------------------------
8226 @vindex mh-folder-deleted
8227 @vindex mh-folder-font-lock-keywords
8228 @vindex mh-note-deleted
8229 @item mh-scan-deleted-msg-regexp
8230 This regular expression matches deleted messages. It must match from
8231 the beginning of the line. Note that the default setting of
8232 @code{mh-folder-font-lock-keywords} expects this expression to contain
8233 at least one parenthesized expression which matches the message number
8234 as in the default of @code{"^\\( *[0-9]+\\)D"}. This expression
8235 includes the leading space within the parenthesis since it looks
8236 better to highlight it as well. The highlighting is done with the face
8237 @code{mh-folder-deleted}. This regular expression should be correct as
8238 it is needed by non-fontification functions. See also
8239 @code{mh-note-deleted}.
8240 @c -------------------------
8241 @vindex mh-folder-font-lock-keywords
8242 @vindex mh-folder-msg-number
8243 @item mh-scan-good-msg-regexp
8244 This regular expression matches ``good'' messages. It must match from
8245 the beginning of the line. Note that the default setting of
8246 @code{mh-folder-font-lock-keywords} expects this expression to contain
8247 at least one parenthesized expression which matches the message number
8248 as in the default of @w{@code{"^\\( *[0-9]+\\)[^D^0-9]"}}. This
8249 expression includes the leading space within the parenthesis since it
8250 looks better to highlight it as well. The highlighting is done with
8251 the face @code{mh-folder-msg-number}. This regular expression should
8252 be correct as it is needed by non-fontification functions.
8253 @c -------------------------
8254 @vindex mh-scan-format-file
8255 @item mh-scan-msg-format-regexp
8256 This regular expression finds the message number width in a scan
8257 format. Note that the message number must be placed in a parenthesized
8258 expression as in the default of @code{"%\\([0-9]*\\)(msg)"}. This
8259 variable is only consulted if @code{mh-scan-format-file} is set to
8260 @samp{Use MH-E scan Format}.
8261 @c -------------------------
8262 @vindex mh-scan-format-file
8263 @item mh-scan-msg-format-string
8264 This is a format string for the width of the message number in a scan
8265 format. Use @samp{0%d} for zero-filled message numbers. This variable
8266 is only consulted if @code{mh-scan-format-file} is set to @samp{Use
8267 MH-E scan Format} (default: @code{"%d"}).
8268 @c -------------------------
8269 @item mh-scan-msg-number-regexp
8270 This regular expression extracts the message number. It must match
8271 from the beginning of the line. Note that the message number must be
8272 placed in a parenthesized expression as in the default of @w{@code{"^
8273 *\\([0-9]+\\)"}}.
8274 @c -------------------------
8275 @item mh-scan-msg-overflow-regexp
8276 This regular expression matches overflowed message numbers (default:
8277 @code{"^[?0-9][0-9]"}).
8278 @c -------------------------
8279 @item mh-scan-msg-search-regexp
8280 This regular expression matches a particular message. It is a format
8281 string; use @samp{%d} to represent the location of the message number
8282 within the expression as in the default of @code{"^[^0-9]*%d[^0-9]"}.
8283 @c -------------------------
8284 @vindex mh-folder-address
8285 @vindex mh-folder-font-lock-keywords
8286 @vindex mh-folder-to
8287 @item mh-scan-rcpt-regexp
8288 This regular expression specifies the recipient in messages you sent.
8289 Note that the default setting of @code{mh-folder-font-lock-keywords}
8290 expects this expression to contain two parenthesized expressions. The
8291 first is expected to match the @samp{To:} that the default scan format
8292 file generates. The second is expected to match the recipient's name
8293 as in the default of @code{"\\(To:\\)\\(..............\\)"}. If this
8294 regular expression is not correct, the @samp{To:} string will not be
8295 highlighted with the face @code{mh-folder-to} and the recipient will not be
8296 highlighted with the face @code{mh-folder-address}.
8297 @c -------------------------
8298 @vindex mh-folder-font-lock-keywords
8299 @vindex mh-folder-refiled
8300 @vindex mh-note-refiled
8301 @item mh-scan-refiled-msg-regexp
8302 This regular expression matches refiled messages. It must match from
8303 the beginning of the line. Note that the default setting of
8304 @code{mh-folder-font-lock-keywords} expects this expression to contain
8305 at least one parenthesized expression which matches the message number
8306 as in the default of @w{@code{"^\\( *[0-9]+\\)\\^"}}. This expression
8307 includes the leading space within the parenthesis since it looks
8308 better to highlight it as well. The highlighting is done with the face
8309 @code{mh-folder-refiled}. This regular expression should be correct as
8310 it is needed by non-fontification functions. See also
8311 @code{mh-note-refiled}.
8312 @c -------------------------
8313 @vindex mh-folder-font-lock-keywords
8314 @vindex mh-folder-sent-to-me-sender
8315 @vindex mh-mh-folder-sent-to-me-hint
8316 @vindex mh-scan-format-nmh
8317 @item mh-scan-sent-to-me-sender-regexp
8318 This regular expression matches messages sent to us. Note that the
8319 default setting of @code{mh-folder-font-lock-keywords} expects this
8320 expression to contain at least two parenthesized expressions. The
8321 first should match the fontification hint (see
8322 @code{mh-scan-format-nmh}) and the second should match the user name
8323 as in the default of
8324 @w{@code{"^ *[0-9]+.\\([bct]\\).....[ ]*\\(..................\\)"}}.
8325 If this regular expression is not correct, the notation hints will not
8326 be highlighted with the face @code{mh-mh-folder-sent-to-me-hint} and
8327 the sender will not be highlighted with the face
8328 @code{mh-folder-sent-to-me-sender}.
8329 @c -------------------------
8330 @vindex mh-folder-followup
8331 @vindex mh-folder-font-lock-keywords
8332 @vindex mh-folder-subject
8333 @item mh-scan-subject-regexp
8334 This regular expression matches the subject. It must match from the
8335 beginning of the line. Note that the default setting of
8336 @samp{mh-folder-font-lock-keywords} expects this expression to contain
8337 at least three parenthesized expressions. The first is expected to
8338 match the @samp{Re:} string, if any, and is highlighted with the face
8339 @code{mh-folder-followup}. The second matches an optional bracketed
8340 number after @samp{Re:}, such as in @samp{Re[2]:} (and is thus a
8341 sub-expression of the first expression). The third is expected to
8342 match the subject line itself which is highlighted with the face
8343 @code{mh-folder-subject}. For example, the default is
8344 @w{@code{"^ *[0-9]+........[ ]*...................}}@*
8345 @w{@code{\\([Rr][Ee]\\(\\[[0-9]+\\]\\)?:\\s-*\\)*\\([^<\n]*\\)"}}.
8346 This regular expression should be correct as it is needed by
8347 non-fontification functions. Note that this example is broken up on
8348 two lines for readability, but is actually a single string.
8349 @end vtable
8350
8351 Finally, there are a slew of variables that control how MH-E annotates
8352 the scan lines.
8353
8354 @vtable @code
8355 @findex mh-set-cmd-note
8356 @vindex mh-adaptive-cmd-note-flag
8357 @item mh-cmd-note
8358 Column for notations (default: 4). This variable should be set with
8359 the function @code{mh-set-cmd-note}. This variable may be updated
8360 dynamically if @code{mh-adaptive-cmd-note-flag} is on. The following
8361 variables contain the notational characters. Note that columns in
8362 Emacs start with 0.
8363 @c -------------------------
8364 @item mh-note-copied
8365 Messages that have been copied are marked by this character (default:
8366 @code{?C}).
8367 @c -------------------------
8368 @vindex mh-scan-cur-msg-number-regexp
8369 @item mh-note-cur
8370 The current message (in MH, not in MH-E) is marked by this character
8371 (default: @code{?+}). See also @code{mh-scan-cur-msg-number-regexp}.
8372 @c -------------------------
8373 @vindex mh-scan-deleted-msg-regexp
8374 @item mh-note-deleted
8375 Messages that have been deleted are marked by this character (default:
8376 @code{?D}). See also @code{mh-scan-deleted-msg-regexp}.
8377 @c -------------------------
8378 @item mh-note-dist
8379 Messages that have been redistributed are marked by this character
8380 (default: @code{?R}).
8381 @c -------------------------
8382 @item mh-note-forw
8383 Messages that have been forwarded are marked by this character
8384 (default: @code{?F}).
8385 @c -------------------------
8386 @item mh-note-printed
8387 Messages that have been printed are marked by this character (default:
8388 @code{?P}).
8389 @c -------------------------
8390 @vindex mh-scan-refiled-msg-regexp
8391 @item mh-note-refiled
8392 Messages that have been refiled are marked by this character (default:
8393 @code{?^}). See also @code{mh-scan-refiled-msg-regexp}.
8394 @c -------------------------
8395 @item mh-note-repl
8396 Messages that have been replied to are marked by this character
8397 (default: @code{?-}).
8398 @c -------------------------
8399 @item mh-note-seq
8400 Messages in a user-defined sequence are marked by this character
8401 (default: @code{?%}). Messages in the @samp{search} sequence are
8402 marked by this character as well.
8403 @end vtable
8404
8405 For example, let's say I have the following in @file{scan.format}
8406 which displays the sender, the subject, and the message number. This
8407 format places a @samp{+} after the message number for the current
8408 message according to MH; it also uses that column for notations.
8409
8410 @smallexample
8411 %20(decode(friendly@{from@})) %50(decode@{subject@}) %4(msg)%<(cur)+%| %>
8412 @end smallexample
8413
8414 @vindex mh-adaptive-cmd-note-flag
8415 @vindex mh-scan-format-file
8416 @vindex mh-scan-format-file, example
8417
8418 The first thing you have to do is tell MH-E to use this file.
8419 Customize @code{mh-scan-format-file} and set its value to @samp{Use
8420 Default scan Format}. If you didn't get already turn off
8421 @code{mh-adaptive-cmd-note-flag}, you'll need to do that first.
8422
8423 Next, tell MH-E what a valid scan line looks like so that you can at
8424 least display the output of scan in your MH-Folder buffer.
8425
8426 @vindex mh-scan-valid-regexp, example
8427
8428 @smalllisp
8429 (setq mh-scan-valid-regexp "[0-9]+[+D^ ]$")
8430 @end smalllisp
8431
8432 Now, in order to get rid of the @samp{Cursor not pointing to message}
8433 message, you need to tell MH-E how to access the message number. You
8434 should also see why MH-E requires that you include a message number in
8435 the first place.
8436
8437 @vindex mh-scan-msg-number-regexp, example
8438 @vindex mh-scan-msg-search-regexp, example
8439
8440 @smalllisp
8441 (setq mh-scan-msg-number-regexp "^.* \\([0-9]+\\)[+D^ ]$")
8442 (setq mh-scan-msg-search-regexp " %d[+D^ ]$")
8443 @end smalllisp
8444
8445 In order to get the next and previous commands working, add this.
8446
8447 @vindex mh-scan-good-msg-regexp, example
8448
8449 @smalllisp
8450 (setq mh-scan-good-msg-regexp "^.* \\([0-9]+\\)[+D^ ]$")
8451 @end smalllisp
8452
8453 Note that the current message isn't marked with a @samp{+} when moving
8454 between the next and previous messages. Here is the code required to
8455 get this working.
8456
8457 @vindex set-mh-cmd-note, example
8458 @vindex mh-scan-cur-msg-number-regexp, example
8459
8460 @smalllisp
8461 (set-mh-cmd-note 76)
8462 (setq mh-scan-cur-msg-number-regexp "^.* \\([0-9]+\\)\\+$")
8463 @end smalllisp
8464
8465 Finally, add the following to delete and refile messages.
8466
8467 @vindex mh-scan-deleted-msg-regexp, example
8468 @vindex mh-scan-refiled-msg-regexp, example
8469
8470 @smalllisp
8471 (setq mh-scan-deleted-msg-regexp "^.* \\([0-9]+\\)D$")
8472 (setq mh-scan-refiled-msg-regexp "^.* \\([0-9]+\\)\\^$")
8473 @end smalllisp
8474
8475 This is just a bare minimum; it's best to adjust all of the regular
8476 expressions to ensure that MH-E and highlighting perform well.
8477
8478 @node Procmail, Odds and Ends, Scan Line Formats, Top
8479 @appendix Reading Mailing Lists Effectively
8480
8481 @cindex @command{procmail}
8482 @cindex @command{slocal}
8483 @cindex Gnus
8484 @cindex MH commands, @command{slocal}
8485 @cindex Unix commands, @command{procmail}
8486 @cindex mailing lists, reading
8487
8488 This appendix explains how to use @uref{http://www.procmail.org/,
8489 procmail} to file mail from mailing lists into folders which can then
8490 be read easily with MH-E@footnote{The MH equivalent, @command{slocal},
8491 can be used as well, but procmail is more flexible and more packages
8492 exist for procmail than for slocal.}. Some mailing lists have such
8493 high traffic that Gnus must be used and I discuss how to use Gnus
8494 side-by-side with MH-E.
8495
8496 @cindex @file{.procmailrc}
8497 @cindex files, @file{.procmailrc}
8498
8499 First, I'll describe how to put mail from your mailing lists directly
8500 into an MH folder using @command{procmail}. First, add the following
8501 to @file{~/.procmailrc}. While the logging variables aren't strictly
8502 necessary, they are extremely useful.
8503
8504 @smallexample
8505 [1] # Update PATH so procmail can find myrcvstore, rcvstore and mhparam.
8506 [2] PATH=$PATH:/usr/lib/mh:/usr/bin/mh:$HOME/bin
8507 [3]
8508 [4] # Point LOGFILE at the actual log file.
8509 [5] LOGFILE=$HOME/.procmail.log
8510 [6]
8511 [7] # This setting provides just the right amount of information.
8512 [8] LOGABSTRACT=all
8513 [9]
8514 [10] # Uncomment the following line to see how your patterns match.
8515 [11] #VERBOSE=yes
8516 [12]
8517 [13] # Place mail sent to any MH-E mailing list in +mh-e.
8518 [14] :0 w: mh-e$LOCKEXT
8519 [15] * ^TO.*mh-e-.*@.*sourceforge.net
8520 [16] | myrcvstore -create +mh-e
8521 @end smallexample
8522
8523 @cindex @command{rcvstore}
8524 @cindex MH commands, @command{rcvstore}
8525
8526 Line 14 creates a lock file in your mail directory based upon the name
8527 of the folder. This is done because @command{rcvstore} does not
8528 perform locking. While this lock file will prevent @command{procmail}
8529 from writing to a folder concurrently, there is a slight chance that
8530 you might lose a message if you're performing operations on a folder
8531 at the same time @command{rcvstore} is placing a message there. You
8532 have been warned. Now that that disclaimer is out of the way, note
8533 that I've been using this set-up for over a decade and haven't lost
8534 anything to my knowledge@footnote{See
8535 @uref{https://savannah.nongnu.org/bugs/?func=detailbug&bug_id=4361&group_id=2166,
8536 Savannah issue #4361} to see if @command{rcvstore} locking is still an
8537 issue.}.
8538
8539 @cindex @samp{Unseen-Sequence:} MH profile component
8540 @cindex MH profile component, @samp{Unseen-Sequence:}
8541
8542 Line 16 uses the following script, @code{myrcvstore}, to massage the
8543 message as described in the comment and file the message in the given
8544 folder@footnote{The @samp{-create} argument wasn't always the default
8545 to @command{rcvstore}.}.
8546
8547 @smallexample
8548 #! /bin/sh
8549
8550 # Accepts a message on standard input and passes it through rcvstore
8551 # after first passing it through any filters. All arguments are passed
8552 # on to rcvstore.
8553
8554 # Force the "From user date" to become part of header. One reason this
8555 # is done is because the presence of the From field confuses dist so
8556 # that dist adds a new header, rather than using the existing header.
8557 # Note that this should not be done for any message that goes into a
8558 # Gnus incoming file (Gnus will thrown an error) nor should it be
8559 # applied to any message that goes to the system mailbox because the
8560 # entire mailbox will be incorporated as a single message.
8561 formail -c -z -R 'From ' X-Envelope-From: |
8562 rcvstore $@@
8563 @end smallexample
8564
8565 If your version of @command{rcvstore} doesn't add messages to the
8566 @samp{unseen} sequence by default, add the following line to your MH
8567 profile:
8568
8569 @smallexample
8570 Unseen-Sequence: unseen
8571 @end smallexample
8572
8573 Now view your new messages with the speedbar (@pxref{Speedbar}) or with
8574 @kbd{F n} (@code{mh-index-new-messages}). @xref{Folders}.
8575
8576 If you're on a mailing list that is so voluminous that it is
8577 impossible to read every message, it usually better to read the
8578 mailing list like a newsgroup in a news reader. Emacs has a built-in
8579 newsreader called Gnus. The remainder of this appendix talks about how
8580 to use Gnus with an MH message store. The version of Gnus that was
8581 used to prepare this manual was 5.10. Versions 5.8 through 5.10 should
8582 work but versions prior to 5.8 use different options.
8583
8584 This table contains a list of Gnus options that you will have to
8585 modify. Note that for them to become accessible, you'll have to load
8586 @file{nnml.el} first. This can be done with @kbd{M-x load-library
8587 @key{RET} nnml @key{RET}}.
8588
8589 @vtable @code
8590 @item gnus-secondary-select-methods
8591 Select the @samp{nnml} value. This select method uses directories for
8592 folders and individual files for messages, just like MH. You do not
8593 have to set an address.
8594 @c -------------------------
8595 @item mail-sources
8596 Select the @samp{Several files in a directory} value, check the
8597 @samp{Path} box and enter @file{~/Mail} to tell Gnus where to find
8598 your mail.
8599 @c -------------------------
8600 @vindex mail-user-agent
8601 @item message-mail-user-agent
8602 In order to send mail within Gnus using MH-E, set this option to
8603 @samp{mail-user-agent} and set the @code{mail-user-agent} option to
8604 @samp{Emacs interface to MH}.
8605 @c -------------------------
8606 @item nnmail-keep-last-article
8607 Since Gnus keeps track of which messages you have read, it would be
8608 bad if Gnus expired the last message, for example, message 100, and
8609 @command{rcvstore} gave the next new message number 1. Gnus would then
8610 ignore it since it thinks that you've read messages 1-100. Turning on
8611 this option ensures that the last message is never removed thereby
8612 eliminating this problem.
8613 @end vtable
8614
8615 Next add the following to @file{~/.procmailrc}. If you don't subscribe
8616 to the GnuCash mailing list, substitute one to which you are
8617 subscribed.
8618
8619 @smallexample
8620 PATH=$PATH:/usr/bin/mh
8621 MAILDIR=$HOME/`mhparam Path`
8622 # Place mail sent to the GnuCash mailing list in gnucash.spool, where
8623 # Gnus will pick it up.
8624 :0:
8625 * ^TO.*gnucash.*@.*gnucash.org
8626 gnucash.spool
8627 @end smallexample
8628
8629 Wait for some messages to appear in @file{gnucash.spool} and run Gnus
8630 with @kbd{M-x gnus @key{RET}}. To view the folder created in the
8631 example above, you would tell Gnus about it the first time only with
8632 @kbd{G m gnucash @key{RET} nnml @key{RET}}. In MH-E, this folder is
8633 known as @samp{+gnucash}.
8634
8635 @node Odds and Ends, History, Procmail, Top
8636 @appendix Odds and Ends
8637
8638 This appendix covers a few topics that don't fit elsewhere. Here I
8639 tell you how to report bugs and how to get on the MH-E mailing lists.
8640 I also point out some additional sources of information.
8641
8642 @menu
8643 * Bug Reports::
8644 * Mailing Lists::
8645 * MH FAQ and Support::
8646 * Getting MH-E::
8647 @end menu
8648
8649 @node Bug Reports, Mailing Lists, Odds and Ends, Odds and Ends
8650 @appendixsec Bug Reports
8651
8652 @cindex bugs
8653 @cindex SourceForge
8654 @kindex M-x mh-version
8655
8656 Bug reports should be filed at
8657 @uref{https://sourceforge.net/tracker/?group_id=13357&atid=113357,
8658 SourceForge}. You need to be a SourceForge user to submit bug reports,
8659 but this is easy enough to do that it shouldn't be a restriction for
8660 you. Please include the output of @kbd{M-x mh-version}
8661 (@pxref{Miscellaneous}) in any bug report you send unless you're 110%
8662 positive we won't ask for it.
8663
8664 @node Mailing Lists, MH FAQ and Support, Bug Reports, Odds and Ends
8665 @appendixsec MH-E Mailing Lists
8666
8667 @cindex SourceForge
8668 @cindex mailing lists
8669
8670 There are several mailing lists for MH-E. They are @i{mh-e-users at
8671 lists.sourceforge.net}, @i{mh-e-announce at lists.sourceforge.net},
8672 and @i{mh-e-devel at lists.sourceforge.net}. You can subscribe or view
8673 the archives at @uref{https://sourceforge.net/mail/?group_id=13357,
8674 SourceForge}. Do not report bugs on these lists; please submit them
8675 via SourceForge (@pxref{Bug Reports}).
8676
8677 @node MH FAQ and Support, Getting MH-E, Mailing Lists, Odds and Ends
8678 @appendixsec MH FAQ and Support
8679
8680 @cindex FAQ
8681 @cindex MH FAQ
8682
8683 The article @uref{http://www.newt.com/faq/mh.html, @cite{MH Frequently
8684 Asked Questions (FAQ) with Answers}} appears monthly in the newsgroup
8685 @samp{comp.mail.mh}. While very little is there that deals with MH-E
8686 specifically, there is an incredible wealth of material about MH
8687 itself which you will find useful.
8688
8689 @cindex support
8690
8691 You can find FAQs on MH-E at the
8692 @uref{https://sourceforge.net/tracker/?group_id=13357&atid=213357,
8693 Support Requests} page on SourceForge. If you don't find the answer to
8694 your question, file a support request and your question will become a
8695 new FAQ!
8696
8697 @node Getting MH-E, , MH FAQ and Support, Odds and Ends
8698 @appendixsec Getting MH-E
8699
8700 @cindex MH-E, obtaining
8701 @cindex getting MH-E
8702 @cindex obtaining MH-E
8703
8704 Because MH-E is undergoing a phase of sustained growth, the version of
8705 MH-E in your Emacs is likely to be out of date although it is most
8706 likely to be more up to date than the copy that comes with the MH
8707 distribution in @file{miscellany/mh-e}.
8708
8709 @cindex change log
8710 @cindex release notes
8711
8712 New MH-E releases are always available for downloading at
8713 @uref{https://sourceforge.net/project/showfiles.php?group_id=13357,
8714 SourceForge} before they appear in an Emacs release. You can read the
8715 release notes on that page to determine if the given release of MH-E
8716 is already installed in your version of Emacs. You can also read the
8717 change log to see if you are interested in what the given release of
8718 MH-E has to offer (although we have no doubt that you will be
8719 extremely interested in all new releases).
8720
8721 @cindex Debian
8722
8723 If you use Debian, you can install the Debian
8724 @uref{http://packages.debian.org/unstable/mail/mh-e, mh-e package}
8725 instead.
8726
8727 @cindex files, @samp{MH-E-NEWS}
8728 @cindex files, @samp{README}
8729 @cindex news
8730 @cindex @samp{MH-E-NEWS}
8731 @cindex @samp{README}
8732 @kindex M-x mh-version
8733
8734 After you download and extract the MH-E tarball, read the
8735 @file{README} file and @file{MH-E-NEWS}. These correspond to the
8736 release notes and change log mentioned above. The file @file{README}
8737 contains instructions on installing MH-E. If you're already running
8738 Emacs, please quit that session and start again to load in the new
8739 MH-E. Check that you're running the new version with the command
8740 @kbd{M-x mh-version}.
8741
8742 @cindex contributed software
8743 @cindex manual
8744 @cindex documentation
8745
8746 In addition to the mh-e package, the
8747 @uref{https://sourceforge.net/project/showfiles.php?group_id=13357,
8748 SourceForge} site also contains doc and contrib packages. The former
8749 is the latest release of this manual, and the latter contains a few
8750 contributed packages you might find useful.
8751
8752 @node History, GFDL, Odds and Ends, Top
8753 @appendix History of MH-E
8754
8755 @cindex Bill Wohler
8756 @cindex Brian Reid
8757 @cindex Gildea, Stephen
8758 @cindex Jim Larus
8759 @cindex Larus, Jim
8760 @cindex MH-E, versions
8761 @cindex Reid, Brian
8762 @cindex SourceForge
8763 @cindex Stephen Gildea
8764 @cindex Wohler, Bill
8765 @cindex history of MH-E
8766 @cindex versions of MH-E
8767
8768 MH-E was originally written by Brian Reid in 1983 and has changed
8769 hands several times since then. Jim Larus wanted to do something
8770 similar for GNU Emacs, and ended up completely rewriting it that same
8771 year. In 1989, Stephen Gildea picked it up and added many
8772 improvements. Bill Wohler then took over in 2000 and moved its
8773 development to @uref{http://sourceforge.net/, SourceForge} where it
8774 lives today.
8775
8776 @menu
8777 * From Brian Reid::
8778 * From Jim Larus::
8779 * From Stephen Gildea::
8780 * From Bill Wohler::
8781 @end menu
8782
8783 @node From Brian Reid, From Jim Larus, History, History
8784 @appendixsec From Brian Reid
8785
8786 @cindex Brian Reid
8787 @cindex Reid, Brian
8788
8789 One day in 1983 I got the flu and had to stay home from work for three
8790 days with nothing to do. I used that time to write MHE@. The
8791 fundamental idea behind MHE was that it was a ``puppeteer'' driving
8792 the MH programs underneath it. MH had a model that the editor was
8793 supposed to run as a sub-process of the mailer, which seemed to me at
8794 the time to be the tail wagging the dog. So I turned it around and
8795 made the editor drive the MH programs. I made sure that the UCI people
8796 (who were maintaining MH at the time) took in my changes and made them
8797 stick.
8798
8799 Today, I still use my own version of MHE because I don't at all like
8800 the way that GNU MH-E works and I've never gotten to be good enough at
8801 hacking Emacs Lisp to make GNU MH-E do what I want. The Gosling-emacs
8802 version of MHE and the GNU Emacs version of MH-E have almost nothing
8803 in common except similar names. They work differently, have different
8804 conceptual models, and have different key bindings@footnote{After
8805 reading this article, I questioned Brian about his version of MHE, and
8806 received some great ideas for improving MH-E such as a dired-like
8807 method of selecting folders; and removing the prompting when sending
8808 mail, filling in the blanks in the draft buffer instead. I passed them
8809 on to Stephen Gildea, the current maintainer, and he was excited about
8810 the ideas as well. Perhaps one day, MH-E will again resemble MHE
8811 (draft form editing was introduced in version 7.4).}.
8812
8813 Brian Reid, June 1994
8814
8815 @node From Jim Larus, From Stephen Gildea, From Brian Reid, History
8816 @appendixsec From Jim Larus
8817
8818 @cindex Jim Larus
8819 @cindex Larus, Jim
8820
8821 Brian Reid, while at CMU or shortly after going to Stanford wrote a
8822 mail reading program called MHE for Gosling Emacs. It had much the
8823 same structure as MH-E (i.e., invoked MH programs), though it was
8824 simpler and the commands were slightly different. Unfortunately, I no
8825 longer have a copy so the differences are lost in the mists of time.
8826
8827 In '82-83, I was working at BBN and wrote a lot of mlisp code in
8828 Gosling Emacs to make it look more like Tennex Emacs. One of the
8829 packages that I picked up and improved was Reid's mail system. In '83,
8830 I went back to Berkeley. About that time, Stallman's first version of
8831 GNU Emacs came out and people started to move to it from Gosling Emacs
8832 (as I recall, the transition took a year or two). I decided to port
8833 Reid's MHE and used the mlisp to Emacs Lisp translator that came with
8834 GNU Emacs. It did a lousy job and the resulting code didn't work, so I
8835 bit the bullet and rewrote the code by hand (it was a lot smaller and
8836 simpler then, so it took only a day or two).
8837
8838 Soon after that, MH-E became part of the standard Emacs distribution
8839 and suggestions kept dribbling in for improvements. MH-E soon reached
8840 sufficient functionality to keep me happy, but I kept on improving it
8841 because I was a graduate student with plenty of time on my hands and
8842 it was more fun than my dissertation. In retrospect, the one thing
8843 that I regret is not writing any documentation, which seriously
8844 limited the use and appeal of the package.
8845
8846 @cindex @command{xmh}, in MH-E history
8847
8848 In '89, I came to Wisconsin as a professor and decided not to work on
8849 MH-E. It was stable, except for minor bugs, and had enough
8850 functionality, so I let it be for a few years. Stephen Gildea of BBN
8851 began to pester me about the bugs, but I ignored them. In 1990, he
8852 went off to the X Consortium, said good bye, and said that he would
8853 now be using @command{xmh}. A few months later, he came back and said
8854 that he couldn't stand @command{xmh} and could I put a few more bug fixes
8855 into MH-E. At that point, I had no interest in fixing MH-E, so I gave
8856 the responsibility of maintenance to him and he has done a fine job
8857 since then.
8858
8859 Jim Larus, June 1994
8860
8861 @node From Stephen Gildea, From Bill Wohler, From Jim Larus, History
8862 @appendixsec From Stephen Gildea
8863
8864 @cindex Gildea, Stephen
8865 @cindex Stephen Gildea
8866
8867 In 1987 I went to work for Bolt Beranek and Newman, as Jim had before
8868 me. In my previous job, I had been using RMAIL, but as my folders tend
8869 to run large, I was frustrated with the speed of RMAIL@. However, I
8870 stuck with it because I wanted the GNU Emacs interface. I am very
8871 familiar and comfortable with the Emacs interface (with just a few
8872 modifications of my own) and dislike having to use applications with
8873 embedded editors; they never live up to Emacs.
8874
8875 MH is the mail reader of choice at BBN, so I converted to it. Since I
8876 didn't want to give up using an Emacs interface, I started using MH-E.
8877 As is my wont, I started hacking on it almost immediately. I first
8878 used version 3.4m. One of the first features I added was to treat the
8879 folder buffer as a file-visiting buffer: you could lock it, save it,
8880 and be warned of unsaved changes when killing it. I also worked to
8881 bring its functionality a little closer to RMAIL@. Jim Larus was very
8882 cooperative about merging in my changes, and my efforts first appeared
8883 in version 3.6, distributed with Emacs 18.52 in 1988. Next I decided
8884 MH-E was too slow and optimized it a lot. Version, 3.7, distributed
8885 with Emacs 18.56 in 1990, was noticeably faster.
8886
8887 When I moved to the X Consortium I became the first person there to
8888 not use xmh. (There is now one other engineer there using MH-E.) About
8889 this point I took over maintenance of MH-E from Jim and was finally
8890 able to add some features Jim hadn't accepted, such as the backward
8891 searching undo. My first release was 3.8 (Emacs 18.58) in 1992.
8892
8893 Now, in 1994, we see a flurry of releases, with both 4.0 and 5.0.
8894 Version 4.0 added many new features, including background folder
8895 collection and support for composing @sc{mime} messages. (Reading
8896 @sc{mime} messages remains to be done, alas.) While writing this book,
8897 Bill Wohler gave MH-E its closest examination ever, uncovering bugs
8898 and inconsistencies that required a new major version to fix, and so
8899 version 5 was released.
8900
8901 Stephen Gildea, June 1994
8902
8903 @node From Bill Wohler, , From Stephen Gildea, History
8904 @appendixsec From Bill Wohler
8905
8906 @cindex Wohler, Bill
8907 @cindex Bill Wohler
8908
8909 The preface originally included the following text which I use to
8910 begin my story:
8911
8912 @quotation
8913 But it's important to note a brief history of MH-E.
8914
8915 @w{Version 3} was prevalent through the @w{Emacs 18} and early
8916 @w{Emacs 19} years. Then @w{Version 4} came out (@w{Emacs 19.23}),
8917 which introduced several new and changed commands. Next, @w{Version
8918 5.0} was released, which fixed some bugs and incompatibilities, and
8919 was incorporated into @w{Emacs 19.29}.
8920 @end quotation
8921
8922 After a long break, Stephen handed the reins over to me in 2000. I
8923 moved the project to a new site called SourceForge and organized a
8924 great team of developers. Our first release in late 2001 was version
8925 6. It appeared around the time of Emacs 21.2 and had menus and tool
8926 bar buttons.
8927
8928 Then, indexed searches, improved MIME handling, a speedbar, multiple
8929 identities, alias completion, an index view of unseen messages, spam
8930 software support, Face and X-Image-URL header field support, Fcc
8931 completion, arbitrary range handling, and draft form editing were
8932 introduced in the version 7 series around the time of Emacs 21.4
8933 (2004). Still, Emacs itself contained version 5 of MH-E released back
8934 in 1994.
8935
8936 Version 8 development was mostly driven by the rewrite of the manual.
8937 It also brought GNU mailutils MH support, S/MIME support, picon
8938 support, and an improved interface for hiding header fields. The CVS
8939 repository was migrated from SourceForge to Savannah (only for those
8940 files that were already part of Emacs) and the software was completely
8941 reorganized to push back two decades of entropy. Version 8 appeared in
8942 Emacs 22.1 in 2006.
8943
8944 Development was then quiet for a couple of years. Emacs 23.1, which is
8945 due out in 2009, will contain version 8.1. This version includes a few
8946 new features and several bug fixes.
8947
8948 Bill Wohler, August 2008
8949
8950 @node GFDL, GPL, History, Top
8951 @appendix GNU Free Documentation License
8952 @include doclicense.texi
8953
8954 @node GPL, Key Index, GFDL, Top
8955 @appendix GNU General Public License
8956 @include gpl.texi
8957
8958 @node Key Index, Command Index, GPL, Top
8959 @unnumbered Key (Character) Index
8960 @printindex ky
8961
8962 @node Command Index, Option Index, Key Index, Top
8963 @unnumbered Command Index
8964 @printindex fn
8965
8966 @node Option Index, Concept Index, Command Index, Top
8967 @unnumbered Option (Variable) Index
8968 @printindex vr
8969
8970 @node Concept Index, , Option Index, Top
8971 @unnumbered Concept Index
8972 @printindex cp
8973
8974 @bye
8975
8976 @c Ispell Helpers
8977 @c
8978 @c The following are words that ispell should ignore that would not
8979 @c normally be in a dictionary (global or personal). Be careful not to
8980 @c include words here that could potentially be typos of other words
8981 @c (such as url, elisp, or MHE).
8982 @c
8983 @c LocalWords: CTRL ESC SPC f's
8984 @c LocalWords: addr Aliasfile alist
8985 @c LocalWords: Baushke Bcc BBN Beranek bogofilter bogofilter's
8986 @c LocalWords: cmd CMU contrib cron
8987 @c LocalWords: DesBrisay Dcc devel dir dired docstring filll forw
8988 @c LocalWords: GECOS Gildea Gildea's Ginnean GnuCash goto gnuserv htm
8989 @c LocalWords: ImageMagick inbox ispell keychain
8990 @c LocalWords: Larus licensor LocalWords lookup lpr
8991 @c LocalWords: makeinfo mairix mbox mh mhbuild mhl mhpath mlisp
8992 @c LocalWords: MML msg multipart
8993 @c LocalWords: Namazu NIS nenscript nnml num
8994 @c LocalWords: packmbox passphrase pathname prev procmail prog repl
8995 @c LocalWords: slocal sortm SpamAssassin spammers SpamProbe SpamProbe's
8996 @c LocalWords: sublicense supercite speedbar
8997 @c LocalWords: Tennex texi texinfo Thelen thelenm
8998 @c LocalWords: UCI undeleted whatnow wohler xmh ypcat
8999 @c
9000 @c See http://www.oreilly.com/oreilly/author/stylesheet.html.
9001 @c See http://en.wikipedia.org/.
9002 @c
9003 @c Note the lowercase mh which is needed to avoid hits in the
9004 @c functions and variables. Occasionally, check for accidental
9005 @c inclusion of mh in text by uncommenting the following and executing
9006 @c it with C-x C-e. You want to see "Search failed"
9007 @c (let ((case-fold-search nil))
9008 @c (goto-char (point-min))
9009 @c (search-forward-regexp "^mh\\( \\|$\\)"))
9010 @c
9011 @c An extremely useful setting for texinfo-mode-hook is:
9012 @c (add-to-list
9013 @c 'ispell-skip-region-alist
9014 @c (list
9015 @c (concat "\\(@\\(small\\)?\\(example\\|lisp\\)"
9016 @c "\\(@\\([irw]\\|code\\|var\\){[^}]+}\\|"
9017 @c "@[@{}.]\\|"
9018 @c "[^@]\\|"
9019 @c "@\\(end \\)?group\\|"
9020 @c "@\\(end \\)?cartouche\\)+"
9021 @c "@end \\(small\\)?\\(example\\|lisp\\)\\|"
9022 @c "@\\(code\\|command\\|file\\|kbd\\|sc\\){[^}]+}\\|"
9023 @c "^@end [a-z]+$\\|"
9024 @c "^@\\([fv]\\|print\\)index .*$\\|"
9025 @c "@uref{[^,]+,\\|"
9026 @c "@[a-z]+\\|"
9027 @c "/[a-z.]+[/}]\\)")))))
9028 @c
9029 @c Cross References
9030 @c
9031 @c See existing cross-references to the Emacs manual and the Emacs
9032 @c Lisp manual (search for ``GNU Emacs Manual'' and ``GNU
9033 @c Emacs Lisp Reference Manual'' respectively).
9034
9035 @c @ftable Sorting
9036 @c
9037 @c As per index (sort of): Punctuation, keyboard characters (such as
9038 @c RET and BS) upper and lowercase mixed (lower comes before
9039 @c uppercase), control characters go with uppercase C, meta characters
9040 @c go with uppercase M.
9041 @c In some cases, the sort isn't strictly ASCII.
9042 @c For example, SPC (mh-page-msg) reads better before BS
9043 @c (mh-previous-page) and . (mh-show) is better before ,
9044 @c (mh-header-display).
9045
9046 @c @vtable Sorting
9047 @c
9048 @c Alphabetical, pull hooks into their own table.
9049
9050 @c Local Variables:
9051 @c sentence-end-double-space: nil
9052 @c End:
9053
9054 @ignore
9055 arch-tag: b778477d-1a10-4a99-84de-f877a2ea6bef
9056 @end ignore