* mh-e.texi (Using This Manual): Printed elisp manuals no longer available.
[emacs.git] / doc / misc / mh-e.texi
blob804a31d2cb5412c41ec0858269682c331cf22dfb
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
10 @c Version of the software and manual.
11 @set VERSION 8.3
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 2011-09-20
16 @set UPDATE-MONTH September, 2011
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/
22 @c Copyright
23 @copying
24 This is version @value{VERSION}@value{EDITION} of @cite{The MH-E
25 Manual}, last updated @value{UPDATED}.
27 Copyright @copyright{} 1995, 2001--2003, 2005--2013 Free Software
28 Foundation, Inc.
30 @c This dual license has been agreed upon by the FSF.
32 @quotation
33 Permission is granted to copy, distribute and/or modify this document
34 under the terms of either:
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.''
44 (a) The FSF's Back-Cover Text is: ``You have the freedom to copy and
45 modify this GNU manual.''
47 @item
48 the GNU General Public License as published by the Free Software
49 Foundation; either version 3, or (at your option) any later version. A
50 copy of the license is included in the section entitled ``GNU General
51 Public License.''
52 @end enumerate
54 @end quotation
55 @end copying
57 @c Info Directory Entry
58 @dircategory Emacs network features
59 @direntry
60 * MH-E: (mh-e).                 Emacs interface to the MH mail system.
61 @end direntry
63 @c Title Page
64 @titlepage
65 @title The MH-E Manual
66 @subtitle Version @value{VERSION}@value{EDITION}
67 @subtitle @value{UPDATE-MONTH}
68 @author Bill Wohler
70 @c Copyright Page
71 @page
72 @vskip 0pt plus 1filll
73 @insertcopying
74 @end titlepage
76 @ifnottex
77 @html
78 <!--
79 @end html
80 @node Top, Preface, (dir), (dir)
81 @top The MH-E Manual
82 @html
83 -->
84 @end html
85 @insertcopying
86 @end ifnottex
88 @c Table of Contents
89 @contents
91 @html
92 <!--
93 @end html
95 @menu
96 * Preface::                     Preface
97 * Conventions::                 GNU Emacs Terms and Conventions
98 * Getting Started::             Getting Started
99 * Tour Through MH-E::           Tour Through MH-E
100 * Using This Manual::           Using This Manual
101 * Incorporating Mail::          Incorporating Mail
102 * Reading Mail::                Reading Mail
103 * Folders::                     Organizing Your Mail with Folders
104 * Sending Mail::                Sending Mail
105 * Editing Drafts::              Editing a Draft
106 * Aliases::                     Aliases
107 * Identities::                  Identities
108 * Speedbar::                    The Speedbar
109 * Menu Bar::                    The Menu Bar
110 * Tool Bar::                    The Tool Bar
111 * Searching::                   Searching Through Messages
112 * Threading::                   Viewing Message Threads
113 * Limits::                      Limiting Display
114 * Sequences::                   Using Sequences
115 * Junk::                        Dealing With Junk Mail
116 * Miscellaneous::               Miscellaneous Commands, Variables, and Buffers
117 * Scan Line Formats::           Scan Line Formats
118 * Procmail::                    Reading Mailing Lists Effectively
119 * Odds and Ends::               Odds and Ends
120 * History::                     History of MH-E
121 * GFDL::                        GNU Free Documentation License
122 * GPL::                         GNU General Public License
123 * Key Index::                   Key (Character) Index
124 * Command Index::               Command Index
125 * Option Index::                Option (Variable) Index
126 * Concept Index::               Concept Index
128 @detailmenu
129  --- The Detailed Node Listing ---
131 Tour Through MH-E
133 * Sending Mail Tour::
134 * Reading Mail Tour::
135 * Processing Mail Tour::
136 * Leaving MH-E::
137 * More About MH-E::
139 Using This Manual
141 * Options::
142 * Ranges::
143 * Folder Selection::
145 Reading Your Mail
147 * Viewing::
148 * Viewing Attachments::
149 * HTML::
150 * Digests::
151 * Reading PGP::
152 * Printing::
153 * Files and Pipes::
154 * Navigating::
155 * Miscellaneous Commands and Options::
157 Sending Mail
159 * Composing::
160 * Replying::
161 * Forwarding::
162 * Redistributing::
163 * Editing Again::
165 Editing a Draft
167 * Editing Message::
168 * Inserting Letter::
169 * Inserting Messages::
170 * Signature::
171 * Picture::
172 * Adding Attachments::
173 * Sending PGP::
174 * Checking Recipients::
175 * Sending Message::
176 * Killing Draft::
178 Odds and Ends
180 * Bug Reports::
181 * Mailing Lists::
182 * MH FAQ and Support::
183 * Getting MH-E::
185 History of MH-E
187 * From Brian Reid::
188 * From Jim Larus::
189 * From Stephen Gildea::
190 * From Bill Wohler::
192 @end detailmenu
193 @end menu
195 @html
197 @end html
199 @node Preface, Conventions, Top, Top
200 @unnumbered Preface
202 @cindex Emacs
203 @cindex Unix commands, Emacs
204 @cindex preface
206 This manual introduces another interface to the MH mail system that is
207 accessible through the GNU Emacs editor, namely, @emph{MH-E}. MH-E is
208 easy to use. I don't assume that you know GNU Emacs or even MH at this
209 point, since I didn't know either of them when I discovered MH-E@.
210 However, MH-E was the tip of the iceberg, and I discovered more and
211 more niceties about GNU Emacs and MH@. Now I'm fully hooked on both of
212 them.
214 The MH-E package is distributed with Emacs@footnote{Version
215 @value{VERSION} of MH-E appeared in Emacs 24.1. It is supported in GNU
216 Emacs 23 and higher, as well as XEmacs 21.4.22 and 21.5.31. MH-E is
217 known not to work with GNU Emacs versions 20 and below, and XEmacs
218 version 21.5.9--21.5.16. It is compatible with MH versions 6.8.4 and
219 higher, all versions of nmh, and GNU mailutils 1.0 and higher}, so you
220 shouldn't have to do anything special to use it. Gnus is also
221 required; version 5.10 or higher is recommended. This manual covers
222 MH-E version @value{VERSION}. To help you decide which version you
223 have, see @ref{Getting Started}.
225 @findex help-with-tutorial
226 @kindex C-h t
228 If you don't already use GNU Emacs but want to learn more, you can
229 read an online tutorial by starting GNU Emacs and typing @kbd{C-h t}
230 (@code{help-with-tutorial}). (To learn about this notation, see
231 @ref{Conventions}.) If you want to take the plunge, consult the
232 @iftex
233 @cite{GNU Emacs Manual},
234 @end iftex
235 @ifinfo
236 @ref{Top, , GNU Emacs Manual, emacs, GNU Emacs Manual},
237 @end ifinfo
238 @ifhtml
239 @uref{http://www.gnu.org/software/emacs/manual/html_node/emacs/,
240 @cite{GNU Emacs Manual}},
241 @end ifhtml
242 from the Free Software Foundation.
244 If more information is needed, you can go to the Unix manual pages of
245 the individual MH commands. When the name is not obvious, I'll guide
246 you to a relevant MH manual page that describes the action more fully.
248 @cindex @cite{MH & nmh: Email for Users & Programmers}
249 @cindex MH book
250 @cindex info
251 @kindex C-h i
253 This manual is available in both Info and online formats. The Info
254 version is distributed with Emacs and can be accessed with the
255 @command{info} command (@samp{info mh-e}) or within Emacs (@kbd{C-h i
256 m mh-e @key{RET}}). The online version is available at
257 @uref{http://mh-e.sourceforge.net/manual/, SourceForge}. Another great
258 online resource is the book @uref{http://rand-mh.sourceforge.net/book/,
259 @cite{MH & nmh: Email for Users & Programmers}} (also known as
260 @dfn{the MH book}).
262 I hope you enjoy this manual! If you have any comments, or suggestions
263 for this document, please let me know.
265 @cindex Bill Wohler
266 @cindex Wohler, Bill
268 @noindent
269 Bill Wohler <@i{wohler at newt.com}>@*
270 8 February 1995@*
271 24 February 2006
273 @node Conventions, Getting Started, Preface, Top
274 @chapter GNU Emacs Terms and Conventions
276 @cindex Emacs
277 @cindex Emacs, conventions
278 @cindex Emacs, terms
279 @cindex Unix commands, Emacs
280 @cindex conventions, Emacs
281 @cindex terms, Emacs
283 If you're an experienced Emacs user, you can skip the following
284 conventions and definition of terms and go directly to the next
285 section (@pxref{Getting Started}).
287 @cindex Emacs commands
288 @cindex MH commands
289 @cindex Unix commands
290 @cindex commands
291 @cindex commands, MH
292 @cindex commands, Unix
293 @cindex commands, shell
294 @cindex functions
295 @cindex shell commands
297 In general, @dfn{functions} in this text refer to Emacs Lisp functions
298 that one would call from within Emacs Lisp programs (for example,
299 @code{(mh-inc-folder)}). On the other hand, @dfn{commands} are those
300 things that are run by the user, such as @kbd{i} or @kbd{M-x
301 mh-inc-folder}. Programs outside of Emacs are specifically called MH
302 commands, shell commands, or Unix commands.
304 @cindex conventions, key names
305 @cindex key names
307 The conventions for key names are as follows:
309 @table @kbd
310 @item C-x
311 Hold down the @key{CTRL} (Control) key and press the @kbd{x} key.
312 @c -------------------------
313 @item M-x
314 Hold down the @key{META} or @key{ALT} key and press the @kbd{x} key.
316 Since some keyboards don't have a @key{META} key, you can generate
317 @kbd{M-x}, for example, by pressing @key{ESC} (Escape),
318 @emph{releasing it}, and then pressing the @kbd{x} key.
319 @c -------------------------
320 @item @key{RET}
321 Press the @key{RETURN} or @key{ENTER} key. This is normally used to
322 complete a command.
323 @c -------------------------
324 @item @key{SPC}
325 Press the space bar.
326 @c -------------------------
327 @item @key{TAB}
328 Press the @key{TAB} key.
329 @c -------------------------
330 @item @key{DEL}
331 Press the @key{DELETE} key.
332 @c -------------------------
333 @item @key{BS}
334 Press the @key{BACKSPACE} key@footnote{If you are using Version 20 or
335 earlier of Emacs, you will need to use the @key{DEL} key.}.
336 @end table
338 @cindex Emacs, prefix argument
339 @cindex prefix argument
340 @kindex C-u
342 A @dfn{prefix argument} allows you to pass an argument to any Emacs
343 function. To pass an argument, type @kbd{C-u} before the Emacs command
344 or keystroke. Numeric arguments can be passed as well. For example, to
345 insert five f's, use @kbd{C-u 5 f}. There is a default of four when
346 using @kbd{C-u}, and you can use multiple prefix arguments to provide
347 arguments of powers of four. To continue our example, you could insert
348 four f's with @kbd{C-u f}, 16 f's with @kbd{C-u C-u f}, 64 f's with
349 @kbd{C-u C-u C-u f}, and so on. Numeric and valueless negative
350 arguments can also be inserted with the @key{META} key. Examples
351 include @kbd{M-5} to specify an argument of 5, or @kbd{M--} which
352 specifies a negative argument with no particular value.
354 @sp 1
355 @center @strong{NOTE}
357 @quotation
358 The prefix @kbd{C-u} or @kbd{M-} is not necessary in MH-E's MH-Folder
359 mode (@pxref{Reading Mail Tour}). In this mode, simply enter the
360 numerical argument before entering the command.
361 @end quotation
362 @sp 1
364 @cindex @file{.emacs}
365 @cindex Emacs, variables
366 @cindex files, @file{.emacs}
367 @cindex variables
368 @findex setq
370 Emacs uses @dfn{variables} to hold values. These can be changed via
371 calls to the function @code{setq} in @file{~/.emacs}.
373 @cindex Emacs, options
374 @cindex options
375 @findex customize-group
376 @findex customize-option
378 Variables in MH-E that are normally modified by the user are called
379 @dfn{options} and are modified through the customize functions (such
380 as @kbd{M-x customize-option} or @kbd{M-x customize-group}).
381 @ifnothtml
382 @xref{Easy Customization,,,emacs,The GNU Emacs Manual}, in @cite{The
383 GNU Emacs Manual}.
384 @end ifnothtml
385 @ifhtml
386 See section
387 @uref{http://www.gnu.org/software/emacs/manual/html_node/emacs/Easy-Customization.html,
388 Easy Customization} in @cite{The GNU Emacs Manual}.
389 @end ifhtml
390 @xref{Options}.
392 @cindex Emacs, faces
393 @cindex faces
394 @cindex highlighting
395 @findex customize-face
397 You can specify various styles for displaying text using @dfn{faces}.
398 MH-E provides a set of faces that you can use to personalize the look
399 of your MH-E buffers. Use the command @kbd{M-x customize-face} to do
400 this.
401 @ifnothtml
402 @xref{Face Customization,,,emacs,The GNU Emacs Manual}, in @cite{The
403 GNU Emacs Manual}.
404 @end ifnothtml
405 @ifhtml
406 See section
407 @uref{http://www.gnu.org/software/emacs/manual/html_node/emacs/Face-Customization.html,
408 Face Customization} in @cite{The GNU Emacs Manual}.
409 @end ifhtml
411 @cindex abnormal hooks
412 @cindex hooks
413 @cindex normal hooks
414 @findex add-hook
415 @findex customize-option
417 Commands often offer @dfn{hooks} which enable you to extend or modify
418 the way a command works.
419 @ifnothtml
420 @ref{Hooks, , Hooks, emacs, The GNU Emacs Manual}, in @cite{The GNU
421 Emacs Manual}
422 @end ifnothtml
423 @ifhtml
424 See section
425 @uref{http://www.gnu.org/software/emacs/manual/html_node/emacs/Hooks.html,
426 Hooks} in @cite{The GNU Emacs Manual}
427 @end ifhtml
428 for a description about @dfn{normal hooks} and @dfn{abnormal hooks}.
429 MH-E uses normal hooks in nearly all cases, so you can assume that we
430 are talking about normal hooks unless we explicitly mention that a
431 hook is abnormal. We also follow the conventions described in that
432 section: the name of the abnormal hooks end in @code{-functions} and all
433 the rest of the MH-E hooks end in @code{-hook}. You can add hooks with
434 either @code{customize-option} or @code{add-hook}.
436 @cindex Emacs, mark
437 @cindex Emacs, point
438 @cindex Emacs, region
439 @cindex mark
440 @cindex point
441 @cindex region
442 @kindex C-@@
443 @kindex C-@key{SPC}
445 There are several other terms that are used in Emacs that you should
446 know. The @dfn{point} is where the cursor currently is. You can save
447 your current place in the file by setting a @dfn{mark}. This operation
448 is useful in several ways. The mark can be later used when defining a
449 @dfn{region}, which is the text between the point and mark. Many
450 commands operate on regions, such as those for deleting text or
451 filling paragraphs. A mark can be set with @kbd{C-@@} (or
452 @kbd{C-@key{SPC}}).
454 @cindex completion
455 @cindex Emacs, completion
456 @cindex Emacs, file completion
457 @cindex Emacs, folder completion
458 @cindex Emacs, minibuffer
459 @cindex file completion
460 @cindex folder completion
461 @cindex minibuffer
462 @kindex SPC
463 @kindex TAB
465 The @dfn{minibuffer} is the bottom line of the Emacs window, where all
466 prompting and multiple-character input is directed. You can use
467 @dfn{completion} to enter values such as folders. Completion means
468 that Emacs fills in text for you when you type @key{SPC} or @key{TAB}.
469 A second @key{SPC} or @key{TAB} will list all possibilities at that
470 point.
471 @ifnothtml
472 @xref{Completion, , Completion, emacs, The GNU Emacs Manual}.
473 @end ifnothtml
474 @ifhtml
475 See the section
476 @uref{http://www.gnu.org/software/emacs/manual/html_node/emacs/Completion.html,
477 Completion} in @cite{The GNU Emacs Manual}.
478 @end ifhtml
479 Note that @key{SPC} cannot be used for completing filenames and
480 folders.
482 @findex help-with-tutorial
483 @kindex C-h t
484 @kindex M-x
486 The minibuffer is also where you enter Emacs function names after
487 typing @kbd{M-x}. For example, in the preface, I mentioned that you
488 could obtain help with @kbd{C-h t} (@code{help-with-tutorial}). What
489 this means is that you can get a tutorial by typing either @kbd{C-h t}
490 or @kbd{M-x help-with-tutorial}. In the latter case, you are prompted
491 for @samp{help-with-tutorial} in the minibuffer after typing
492 @kbd{M-x}.
494 @cindex ~
496 The @samp{~} notation in filenames represents your home directory.
497 This notation is used by many shells including @command{bash},
498 @code{tcsh}, and @command{csh}. It is analogous to the environment
499 variable @samp{$HOME}. For example, @file{~/.emacs} can be written
500 @file{$HOME/.emacs} or using the absolute path as in
501 @file{/home/wohler/.emacs} instead.
503 @cindex Emacs, interrupting
504 @cindex Emacs, quitting
505 @cindex interrupting
506 @cindex quitting
508 @i{In case of trouble:} Emacs can be interrupted at any time with
509 @kbd{C-g}. For example, if you've started a command that requests that
510 you enter something in the minibuffer, but then you change your mind,
511 type @kbd{C-g} and you'll be back where you started. If you want to
512 exit Emacs entirely, use @kbd{C-x C-c}.
514 @node Getting Started, Tour Through MH-E, Conventions, Top
515 @chapter Getting Started
517 @cindex MH-E, versions
518 @cindex history
519 @cindex versions of MH-E
521 Because there are many old versions of MH-E out there, it is important
522 to know which version you have. I'll be talking about @w{Version 8}
523 which is pretty close to @w{Version 6} and @w{Version 7}. It differs
524 from @w{Version 4} and @w{Version 5} and is vastly different from
525 @w{Version 3}. @xref{History}.
527 @findex mh-version
529 To determine which version of MH-E that you have, enter @kbd{M-x
530 mh-version @key{RET}}. Hopefully it says that you're running
531 @w{Version @value{VERSION}} which is the latest version as of this
532 printing.
534 If your version is much older than this, please consider upgrading.
535 You can have your system administrator upgrade the system-wide
536 version, or you can install your own personal version. It's really
537 quite easy. @xref{Getting MH-E}, for instructions for getting and
538 installing MH-E.
540 If the @code{mh-version} command displays @samp{No MH variant
541 detected}@footnote{In very old versions of MH-E, you may get the error
542 message, @samp{Cannot find the commands `inc' and `mhl' and the file
543 `components'} if MH-E can't find MH@. In this case, you need to update
544 MH-E, and you may need to install MH too. However, newer versions of
545 MH-E are better at finding MH if it is on your system.}, then you need
546 to install MH or tell MH-E where to find MH.
548 @cindex Debian
549 @cindex nmh
550 @cindex GNU mailutils MH
552 If you don't have MH on your system already, you must install a
553 variant of MH@. The Debian mh-e package does this for you automatically
554 (@pxref{Getting MH-E}). Most people use
555 @uref{http://www.nongnu.org/nmh/, nmh}, but you may be interested in
556 trying out @uref{http://www.gnu.org/software/mailutils/, GNU mailutils
557 MH}, which supports IMAP@. Your GNU/Linux distribution probably has
558 packages for both of these.
560 @cindex @command{install-mh}
561 @cindex MH commands, @command{install-mh}
562 @cindex MH book
564 If you've never run MH before, you need to run @command{install-mh}
565 from the shell before you continue. This sets up your personal MH
566 environment@footnote{See the section
567 @uref{@value{MH-BOOK-HOME}/../overall/setup.html, Setting Up MH} in the
568 MH book.}. If you don't, you'll be greeted with the error message:
569 @samp{Install MH and run install-mh before running MH-E}. This is all
570 you need to know about MH to use MH-E, but the more you know about MH,
571 the more you can leverage its power. See the
572 @uref{@value{MH-BOOK-HOME}/../, MH book} to learn more about MH.
574 @cindex @samp{Path:} MH profile component
575 @cindex MH profile
576 @cindex MH profile component
577 @cindex MH profile component, @samp{Path:}
579 Your MH environment includes your @dfn{MH profile} which is found in
580 the file @file{~/.mh_profile}, or the file named in the environment
581 variable @samp{$MH}. This file contains a number of @dfn{MH
582 profile components}. For example, the @samp{Path:} MH profile
583 component contains the path to your mail directory, which is
584 @file{~/Mail} by default.
586 @cindex @command{mhparam}
587 @cindex MH commands, @command{mhparam}
588 @vindex exec-path
589 @vindex mh-path
590 @vindex mh-sys-path
591 @vindex mh-variant
592 @vindex mh-variant-in-use
594 There are several options MH-E uses to interact with your MH
595 installation. The option @code{mh-variant} specifies the variant used
596 by MH-E (@pxref{Options}). The default setting of this option is
597 @samp{Auto-detect} which means that MH-E will automatically choose the
598 first of nmh, MH, or GNU mailutils MH that it finds in the directories
599 listed in @code{mh-path} (which you can customize),
600 @code{mh-sys-path}, and @code{exec-path}. If MH-E can't find MH at
601 all, you may have to customize @code{mh-path} and add the directory in
602 which the command @command{mhparam} is located. If, on the other hand,
603 you have both nmh and GNU mailutils MH installed (for example) and
604 @code{mh-variant-in-use} was initialized to nmh but you want to use
605 GNU mailutils MH, then you can set @code{mh-variant} to
606 @samp{gnu-mh}.
608 @vindex mh-flists-present-flag
609 @vindex mh-lib
610 @vindex mh-lib-progs
611 @vindex mh-progs
613 When @code{mh-variant} is changed, MH-E resets @code{mh-progs},
614 @code{mh-lib}, @code{mh-lib-progs}, @code{mh-flists-present-flag}, and
615 @code{mh-variant-in-use} accordingly.
617 @cindex @file{.emacs}
618 @cindex files, @file{.emacs}
620 @sp 1
621 @center @strong{NOTE}
623 @quotation
624 Prior to version 8, it was often necessary to set some of these
625 variables in @file{~/.emacs}; now it is no longer necessary and can
626 actually cause problems.
627 @end quotation
628 @sp 1
630 @cindex MH profile component, @samp{Draft-Folder:}
631 @cindex MH profile component, @samp{Path:}
632 @cindex MH profile component, @samp{Previous-Sequence:}
633 @cindex MH profile component, @samp{Unseen-Sequence:}
634 @cindex @samp{Draft-Folder:} MH profile component
635 @cindex @samp{Path:} MH profile component
636 @cindex @samp{Previous-Sequence:} MH profile component
637 @cindex @samp{Unseen-Sequence:} MH profile component
638 @findex mh-find-path
639 @vindex mh-draft-folder
640 @vindex mh-find-path-hook
641 @vindex mh-inbox
642 @vindex mh-previous-seq
643 @vindex mh-unseen-seq
644 @vindex mh-user-path
646 In addition to setting variables that point to MH itself, MH-E also
647 sets a handful of variables that point to where you keep your mail.
648 During initialization, the function @code{mh-find-path} sets
649 @code{mh-user-path} from your @samp{Path:} MH profile component (but
650 defaults to @samp{Mail} if one isn't present), @code{mh-draft-folder}
651 from @samp{Draft-Folder:}, @code{mh-unseen-seq} from
652 @samp{Unseen-Sequence:}, @code{mh-previous-seq} from
653 @samp{Previous-Sequence:}, and @code{mh-inbox} from @samp{Inbox:}
654 (defaults to @samp{+inbox}). The hook @code{mh-find-path-hook} is run
655 after these variables have been set. This hook can be used the change
656 the value of these variables if you need to run with different values
657 between MH and MH-E.
659 @node Tour Through MH-E, Using This Manual, Getting Started, Top
660 @chapter Tour Through MH-E
662 @cindex introduction
663 @cindex tour
664 @cindex tutorial
666 This chapter introduces some of the terms you'll need to know and then
667 takes you on a tour of MH-E@footnote{The keys mentioned in these
668 chapters refer to the default key bindings. If you've changed the
669 bindings, refer to the command summaries at the beginning of each
670 chapter for a mapping between default key bindings and function
671 names.}. When you're done, you'll be able to send, read, and file
672 mail, which is all that a lot of people ever do. But if you're the
673 curious or adventurous type, read the rest of the manual to be able to
674 use all the features of MH-E@. I suggest you read this chapter first to
675 get the big picture, and then you can read the manual as you wish.
677 @menu
678 * Sending Mail Tour::
679 * Reading Mail Tour::
680 * Processing Mail Tour::
681 * Leaving MH-E::
682 * More About MH-E::
683 @end menu
685 @node Sending Mail Tour, Reading Mail Tour, Tour Through MH-E, Tour Through MH-E
686 @section Sending Mail
688 @cindex MH-Letter mode
689 @cindex mode
690 @cindex modes, MH-Letter
691 @cindex sending mail
692 @findex mh-smail
693 @kindex M-x mh-smail
695 Let's start our tour by sending ourselves a message which we can later
696 read and process. Enter @kbd{M-x mh-smail} to invoke the MH-E program
697 to send messages. Your message appears in an Emacs buffer whose
698 mode@footnote{A @dfn{mode} changes Emacs to make it easier to edit a
699 particular type of text.} is MH-Letter.
701 Enter your login name in the @samp{To:} header field. Press the
702 @key{TAB} twice to move the cursor past the @samp{Cc:} field, since no
703 carbon copies are to be sent, and on to the @samp{Subject:} field.
704 Enter @kbd{Test} or anything else that comes to mind.
706 Press @key{TAB} again to move the cursor to the body of the message.
707 Enter some text, using normal Emacs commands. You should now have
708 something like this@footnote{If you're running Emacs under the X
709 Window System, then you would also see a menu bar and a tool bar. I've
710 left out the menu bar and tool bar in all of the example screens.}:
712 @cartouche
713 @smallexample
720 --:--  *scratch*   All L1     (Lisp Interaction)-------------------------
721 To: wohler
723 Subject: Test
724 X-Mailer: MH-E 8.1; nmh 1.1; GNU Emacs 23.1
725 --------
726 This is a test message to get the wheels churning...#
729 --:**  @{draft@}   All L5     (MH-Letter)----------------------------------
730 Type C-c C-c to send message, C-C ? for help
731 @end smallexample
732 @end cartouche
733 @i{MH-E message composition window}
735 Note the line of dashes that separates the header and the body of the
736 message. It is essential that these dashes (or a blank line) are
737 present or the body of your message will be considered to be part of
738 the header.
740 @cindex help
741 @findex describe-mode
742 @kindex C-c ?
743 @kindex C-c C-c
744 @kindex C-h m
746 There are several commands specific to MH-Letter mode@footnote{You can
747 get quick help for the commands used most often with @kbd{C-c ?} or
748 more complete help with the @kbd{C-h m} (@code{describe-mode})
749 command.}, but at this time we'll only use @kbd{C-c C-c} to send your
750 message. Type @kbd{C-c C-c} now. That's all there is to it!
752 @node Reading Mail Tour, Processing Mail Tour, Sending Mail Tour, Tour Through MH-E
753 @section Receiving Mail
755 @cindex @command{inc}
756 @cindex @command{scan}
757 @cindex MH commands, @command{inc}
758 @cindex MH commands, @command{scan}
759 @cindex MH-Folder mode
760 @cindex modes, MH-Folder
761 @cindex reading mail
762 @findex mh-rmail
763 @kindex M-x mh-rmail
765 To read the mail you've just sent yourself, enter @kbd{M-x mh-rmail}.
766 This incorporates the new mail and puts the output from
767 @command{inc}@footnote{See the section
768 @uref{@value{MH-BOOK-HOME}/reapre.html, Reading Mail: inc show next
769 prev} in the MH book.} (called @dfn{scan lines} after the MH program
770 @command{scan}@footnote{See the section
771 @uref{@value{MH-BOOK-HOME}/faswsprs.html, Find and Specify with scan
772 pick Ranges Sequences} in the MH book.} which prints a one-line
773 summary of each message) into a buffer called @samp{+inbox} whose
774 major mode is MH-Folder.
776 @findex mh-rmail
777 @kindex F r
778 @kindex M-x mh-rmail
780 @sp 1
781 @center @strong{NOTE}
783 @quotation
785 The @kbd{M-x mh-rmail} command will show you only new mail, not mail
786 you have already read. If you were to run this tour again, you would
787 use @kbd{F r} to pull all your messages into MH-E.
788 @end quotation
789 @sp 1
791 @kindex @key{RET}
792 @kindex n
793 @kindex p
795 You should see the scan line for your message, and perhaps others. Use
796 @kbd{n} or @kbd{p} to move the cursor to your test message and type
797 @key{RET} to read your message. You should see something like:
799 @cartouche
800 @smallexample
801   3 t08/24 root       received fax files on Wed Aug 24 11:00:13 PDT 1
802 # 4+t08/24 To:wohler  Test<<This is a test message to get the wheels
804 -:%%  @{+inbox/select@} 4 msgs (1-4)   Bot L4     (MH-Folder Show)---------
805 To: wohler
806 Subject: Test
807 X-Mailer: MH-E 8.1; nmh 1.1; GNU Emacs 23.1
808 Date: Fri, 17 Mar 2006 10:49:11 -0800
809 From: Bill Wohler <wohler@@stop.mail-abuse.org>
811 This is a test message to get the wheels churning...
815 --:--  @{show-+inbox@} 4   All L1     (MH-Show)----------------------------
817 @end smallexample
818 @end cartouche
819 @i{After incorporating new messages}
821 @kindex @key{DEL}
822 @kindex @key{SPC}
824 If you typed a long message, you can view subsequent pages with
825 @key{SPC} and previous pages with @key{DEL}.
827 @node Processing Mail Tour, Leaving MH-E, Reading Mail Tour, Tour Through MH-E
828 @section Processing Mail
830 @cindex processing mail
831 @kindex @key{RET}
832 @kindex r
834 The first thing we want to do is reply to the message that we sent
835 ourselves. Ensure that the cursor is still on the same line as your
836 test message and type @kbd{r}. You are prompted in the minibuffer with
837 @samp{Reply to whom:}. Here MH-E is asking whether you'd like to reply
838 to the original sender only, to the sender and primary recipients, or
839 to the sender and all recipients. You can press @key{TAB} to see these
840 choices. If you simply press @key{RET}, you'll reply only to the
841 sender. Press @key{RET} now.
843 You'll find yourself in an Emacs buffer similar to that when you were
844 sending the original message, like this:
846 @cartouche
847 @smallexample
850 Subject: Re: Test
851 In-reply-to: <31054.1142621351@@stop.mail-abuse.org>
852 References: <31054.1142621351@@stop.mail-abuse.org>
853 Comments: In-reply-to Bill Wohler <wohler@@stop.mail-abuse.org>
854    message dated "Fri, 17 Mar 2006 10:49:11 -0800."
855 X-Mailer: MH-E 8.1; nmh 1.1; GNU Emacs 23.1
856 --------
859 --:--  @{draft@}  All L10     (MH-Letter)----------------------------------
860 To: wohler
861 Subject: Test
862 X-Mailer: MH-E 8.1; nmh 1.1; GNU Emacs 23.1
863 Date: Fri, 17 Mar 2006 10:49:11 -0800
864 From: Bill Wohler <wohler@@stop.mail-abuse.org>
866 This is a test message to get the wheels churning...
868 --:--  @{show-+inbox@} 4   All L1     (MH-Show)----------------------------
869 Type C-c C-c to send message, C-c ? for help
870 @end smallexample
871 @end cartouche
872 @i{Composition window during reply}
874 @findex backward-char
875 @findex forward-char
876 @findex next-line
877 @findex previous-line
878 @kindex C-b
879 @kindex C-c C-c
880 @kindex C-c C-f C-t
881 @kindex C-f
882 @kindex C-n
883 @kindex C-p
884 @kindex @key{BS}
886 By default, MH will not add you to the address list of your replies,
887 so if you find that the @samp{To:} header field is missing, don't
888 worry. In this case, type @kbd{C-c C-f C-t} to create and go to the
889 @samp{To:} field, where you can type your login name again. You can
890 move around with the arrow keys or with @kbd{C-p}
891 (@code{previous-line}), @kbd{C-n} (@code{next-line}), @kbd{C-b}
892 (@code{backward-char}), and @kbd{C-f} (@code{forward-char}) and can
893 delete the previous character with @key{BS}. When you're finished
894 editing your message, send it with @kbd{C-c C-c} as before.
896 @cindex @command{refile}
897 @cindex MH commands, @command{refile}
898 @cindex folders
899 @kindex @key{SPC}
900 @kindex o
902 You'll often want to save messages that were sent to you in an
903 organized fashion. This is done with @dfn{folders}. You can use
904 folders to keep messages from your friends, or messages related to a
905 particular topic. With your cursor in the MH-Folder buffer and
906 positioned on the message you sent to yourself, type @kbd{o} to output
907 (@command{refile} in MH parlance) that message to a folder. Enter
908 @kbd{test} at the @samp{Destination folder:} prompt and type @kbd{y}
909 (or @key{SPC}) when MH-E asks to create the folder @samp{+test}. Note
910 that a @samp{^} (caret) appears next to the message number, which
911 means that the message has been marked for refiling but has not yet
912 been refiled. We'll talk about how the refile is actually carried out
913 in a moment.
915 @cindex MH-Folder mode
916 @cindex modes, MH-Folder
917 @kindex d
918 @kindex i
919 @kindex @key{RET}
920 @kindex n
921 @kindex p
922 @kindex x
924 Your previous reply is now waiting in the system mailbox. You
925 incorporate this mail into your MH-Folder buffer named @samp{+inbox}
926 with the @kbd{i} command. Do this now. After the mail is incorporated,
927 use @kbd{n} or @kbd{p} to move the cursor to the new message, and read
928 it with @key{RET}. Let's delete this message by typing @kbd{d}. Note
929 that a @samp{D} appears next to the message number. This means that
930 the message is marked for deletion but is not yet deleted. To perform
931 the deletion (and the refile we did previously), use the @kbd{x}
932 command.
934 @findex mh-smail
935 @kindex m
936 @kindex M-x mh-smail
938 If you want to send another message you can use @kbd{m} instead of
939 @kbd{M-x mh-smail}. So go ahead, send some mail to your friends!
941 @cindex help
942 @cindex prefix characters
943 @findex describe-mode
944 @kindex ?
945 @kindex C-h m
946 @kindex F ?
948 You can get a quick reminder about these commands by typing @kbd{?}.
949 This lists several @dfn{prefix characters}. To list the commands
950 available via the prefix characters, type the prefix character
951 followed by a @kbd{?}, for example, @kbd{F ?}. More complete help is
952 available with the @kbd{C-h m} (@code{describe-mode}) command.
954 @node Leaving MH-E, More About MH-E, Processing Mail Tour, Tour Through MH-E
955 @section Leaving MH-E
957 @cindex Emacs, quitting
958 @cindex quitting
959 @kindex C-x C-c
960 @kindex x
962 You may now wish to exit @command{emacs} entirely. Use @kbd{C-x C-c}
963 to exit @command{emacs}. If you exited without running @kbd{x} in the
964 @samp{+inbox} buffer, Emacs will offer to save it for you. Type
965 @kbd{y} or @key{SPC} to save @samp{+inbox} changes, which means to
966 perform any refiles and deletes that you did there.
968 @findex mh-rmail
969 @kindex C-x b
970 @kindex C-x k
971 @kindex M-x mh-rmail
972 @kindex q
974 If you don't want to leave Emacs, you can type @kbd{q} to bury (hide)
975 the MH-E folder or delete it entirely with @kbd{C-x k}. You can then
976 later recall it with @kbd{C-x b} or @kbd{M-x mh-rmail}.
978 @cindex @command{packf}
979 @cindex MH commands, @command{packf}
980 @cindex exporting folders
981 @cindex folders, exporting
982 @cindex mbox-style folder
984 On the other hand, if you no longer want to use MH and MH-E, you can
985 take your mail with you. You can copy all of your mail into a single
986 file, mbox-style, by using the MH command @command{packf}. For
987 example, to create a file called @file{msgbox} with the messages in
988 your @samp{+inbox} folder, use @samp{packf +inbox}. The
989 @command{packf} command will append the messages to the file if it
990 already exists, so you can use @samp{folders -recurse -fast} in a
991 script to copy all of your messages into a single file, or using the
992 @samp{-file} argument, a file for each folder.
994 @node More About MH-E,  , Leaving MH-E, Tour Through MH-E
995 @section More About MH-E
997 These are the basic commands to get you going, but there are plenty
998 more. If you think that MH-E is for you, read the rest of the manual
999 to find out how you can:
1001 @itemize @bullet
1002 @item
1003 Print your messages (@pxref{Printing}).
1004 @c -------------------------
1005 @item
1006 Edit messages and include your signature (@pxref{Editing Drafts}).
1007 @c -------------------------
1008 @item
1009 Forward messages (@pxref{Forwarding}).
1010 @c -------------------------
1011 @item
1012 Read digests (@pxref{Digests}).
1013 @c -------------------------
1014 @item
1015 Edit bounced messages (@pxref{Editing Again}).
1016 @c -------------------------
1017 @item
1018 Send multimedia messages (@pxref{Adding Attachments}).
1019 @c -------------------------
1020 @item
1021 Read HTML messages (@pxref{HTML}).
1022 @c -------------------------
1023 @item
1024 Use aliases and identities (see @ref{Aliases}, @pxref{Identities}).
1025 @c -------------------------
1026 @item
1027 Create different views of your mail (see @ref{Threading}, @pxref{Limits}).
1028 @c -------------------------
1029 @item
1030 Deal with junk mail (@pxref{Junk}).
1031 @c -------------------------
1032 @item
1033 Handle signed and encrypted messages (see @ref{Reading PGP},
1034 @pxref{Sending PGP}).
1035 @c -------------------------
1036 @item
1037 Process mail that was sent with @command{shar} or @command{uuencode}
1038 (@pxref{Files and Pipes}).
1039 @c -------------------------
1040 @item
1041 Use sequences conveniently (@pxref{Sequences}).
1042 @c -------------------------
1043 @item
1044 Use the speedbar, tool bar, and menu bar (see @ref{Speedbar}, see @ref{Tool
1045 Bar}, @pxref{Menu Bar}).
1046 @c -------------------------
1047 @item
1048 Show header fields in different fonts (@pxref{Reading Mail}).
1049 @c -------------------------
1050 @item
1051 Find previously refiled messages (@pxref{Searching}).
1052 @c -------------------------
1053 @item
1054 Place messages in a file (@pxref{Files and Pipes}).
1055 @end itemize
1057 Remember that you can also use MH commands when you're not running
1058 MH-E (and when you are!).
1060 @node Using This Manual, Incorporating Mail, Tour Through MH-E, Top
1061 @chapter Using This Manual
1063 This chapter begins the meat of the manual which goes into more detail
1064 about every MH-E command and option.
1066 @cindex Emacs, info
1067 @cindex Emacs, online help
1068 @cindex info
1069 @cindex online help
1070 @findex describe-mode
1071 @findex mh-help
1072 @kindex ?
1073 @kindex C-c ?
1074 @kindex C-h C-h
1075 @kindex C-h C-k i
1076 @kindex C-h i
1077 @kindex C-h m
1079 There are many commands, but don't get intimidated. There are command
1080 summaries at the beginning of each chapter. In case you have or would
1081 like to rebind the keys, the command summaries also list the
1082 associated Emacs Lisp function. Furthermore, even if you're stranded
1083 on a desert island with a laptop and are without your manuals, you can
1084 get a summary of all these commands with GNU Emacs online help: use
1085 @kbd{C-h m} (@code{describe-mode}) for a brief summary of commands,
1086 @kbd{?} (@code{mh-help}) for an even briefer summary@footnote{This
1087 help appears in a buffer called @samp{*MH-E Help*}
1088 (@pxref{Miscellaneous}).} (@kbd{C-c ?} in MH-Letter mode), or @kbd{C-h
1089 i} to read this manual via Info. The online help is quite good; try
1090 running @kbd{C-h C-h}. This brings up a list of available help topics,
1091 one of which displays the documentation for a given key (like @kbd{C-h
1092 k C-n}). Another useful help feature is to view the manual section
1093 that describes a given key (such as @kbd{C-h K i}). In addition,
1094 review @ref{Conventions}, if any of the GNU Emacs conventions are
1095 strange to you.
1097 In addition to all of the commands, it is also possible to reconfigure
1098 MH-E to fit the needs of even the most demanding user. The following
1099 chapters also describe all of the options, show the defaults, and make
1100 recommendations for customization.
1102 However, when customizing your mail environment, first try to change
1103 what you want in MH, and only change MH-E if changing MH is not
1104 possible. That way you will get the same behavior inside and outside
1105 GNU Emacs. Note that MH-E does not provide hooks for customizations
1106 that can be done in MH; this omission is intentional.
1108 @cindex Emacs Lisp Manual
1109 @cindex Emacs, Emacs Lisp Manual
1110 @cindex Emacs, info
1111 @cindex Emacs, online help
1112 @cindex info
1113 @cindex online help
1115 I hope I've included enough examples here to get you well on your way.
1116 If you want to explore Emacs Lisp further, a programming manual does
1117 exist,
1118 @c Yes, some of the stuff in the following sections is redundant, but
1119 @c TeX barfs if the @ifs are inside the @footnote.
1120 @iftex
1121 @footnote{The @cite{GNU Emacs Lisp Reference Manual} may be available
1122 online in the Info system by typing @kbd{C-h i m Emacs Lisp
1123 @key{RET}}. It is also available online at @*
1124 @uref{http://www.gnu.org/software/emacs/manual/elisp.html}.}
1125 @end iftex
1126 @ifinfo
1127 @footnote{@xref{Top, The GNU Emacs Lisp Reference Manual, , elisp, GNU
1128 Emacs Lisp Reference Manual}, which may be available online in the
1129 Info system. It is also available online at
1130 @uref{http://www.gnu.org/software/emacs/manual/elisp.html}.}
1131 @end ifinfo
1132 @ifhtml
1133 @footnote{The
1134 @uref{http://www.gnu.org/software/emacs/manual/elisp.html,
1135 The GNU Emacs Lisp Reference Manual} may also be available online in
1136 the Info system by typing @kbd{C-h i m Emacs Lisp @key{RET}}.}
1137 @end ifhtml
1138 and you can look at the code itself for examples. Look in the Emacs
1139 Lisp directory on your system (such as
1140 @file{/usr/local/share/emacs/lisp/mh-e}) and find all the @file{mh-*.el}
1141 files there. When calling MH-E and other Emacs Lisp functions directly
1142 from Emacs Lisp code, you'll need to know the correct arguments. Use
1143 the online help for this. For example, try @kbd{C-h f
1144 mh-execute-commands @key{RET}}. If you write your own functions,
1145 please do not prefix your symbols (variables and functions) with
1146 @samp{mh-}. This prefix is reserved for the MH-E package. To avoid
1147 conflicts with existing MH-E symbols, use a prefix like @samp{my-} or
1148 your initials. (Unless, of course, your initials happen to be @emph{mh}!)
1150 @menu
1151 * Options::
1152 * Ranges::
1153 * Folder Selection::
1154 @end menu
1156 @node Options, Ranges, Using This Manual, Using This Manual
1157 @section Options
1159 @cindex Emacs, customizing
1160 @cindex Emacs, setting options
1161 @cindex customizing MH-E
1162 @cindex setting options
1163 @findex customize-option
1164 @vindex mh-lpr-command-format, example
1166 Many string or integer options are easy to modify using @kbd{M-x
1167 customize-option}. For example, to modify the option that controls
1168 printing, you would run @kbd{M-x customize-option @key{RET}
1169 mh-lpr-command-format @key{RET}}. In the buffer that appears, modify
1170 the string to the right of the variable. For example, you may change
1171 the @command{lpr} command with @samp{nenscript -G -r -2 -i'%s'}. Then
1172 use the @samp{State} combo box and select @samp{Save for Future
1173 Sessions}. To read more about @code{mh-lpr-command-format}, see
1174 @ref{Printing}.
1176 @cindex nil
1177 @cindex off, option
1178 @cindex on, option
1179 @cindex option, turning on and off
1180 @cindex t
1181 @findex customize-option
1182 @vindex mh-bury-show-buffer-flag, example
1184 Options can also hold boolean values. In Emacs Lisp, the boolean
1185 values are @code{nil}, which means false, and @code{t}, which means
1186 true. The @code{customize-option} function makes it easy to change
1187 boolean values; simply click on the toggle button in the customize
1188 buffer to switch between @samp{on} (@code{t}) and @samp{off}
1189 (@code{nil}). For example, try setting @code{mh-bury-show-buffer-flag}
1190 to @samp{off} to keep the MH-Show buffer at the top of the buffer
1191 stack. Use the @samp{State} combo box and choose @samp{Set for Current
1192 Session} to see how the option affects the show buffer. Then choose
1193 the @samp{Erase Customization} menu item to reset the option to the
1194 default, which places the MH-Show buffer at the bottom of the buffer
1195 stack.
1197 @vindex mh-mhl-format-file, example
1199 The text usually says to turn on an option by setting it to a
1200 @emph{non-@code{nil}} value, because sometimes values other than
1201 @samp{on} are meaningful. An example of this is the variable
1202 @code{mh-mhl-format-file} (@pxref{Viewing}). Other options, such as
1203 hooks, involve a little more Emacs Lisp programming expertise.
1205 @cindex customization group, @samp{mh}
1206 @cindex @samp{mh} customization group
1207 @findex customize-group
1208 @findex mh-customize
1210 You can browse all of the MH-E options with the @code{customize-group}
1211 function. Try entering @kbd{M-x customize-group @key{RET} mh
1212 @key{RET}} to view the top-level options as well as buttons for all of
1213 the MH-E customization groups. Another way to view the MH-E
1214 customization group is to use @kbd{M-x mh-customize @key{RET}}.
1216 @node Ranges, Folder Selection, Options, Using This Manual
1217 @section Ranges
1219 @c Sync with mh-folder-mode docstring.
1221 @cindex message abbreviations
1222 @cindex message ranges
1223 @cindex ranges
1225 Many commands that operate on individual messages, such as
1226 @code{mh-forward} or @code{mh-refile-msg} take a @code{RANGE}
1227 argument. This argument can be used in several ways.
1229 @kindex C-u, with ranges
1231 If you provide the prefix argument @kbd{C-u} to these commands, then
1232 you will be prompted for the message range. This can be any valid MH
1233 range which can include messages, sequences (@pxref{Sequences}), and
1234 the abbreviations (described in the @command{mh}(1) man page):
1236 @table @samp
1237 @item <num1>-<num2>
1238 Indicates all messages in the range <num1> to <num2>, inclusive. The
1239 range must be nonempty.
1240 @c -------------------------
1241 @item <num>:N
1242 @itemx <num>:+N
1243 @itemx <num>:-N
1244 Up to N messages beginning with (or ending with) message num. Num may
1245 be any of the predefined symbols: first, prev, cur, next or last.
1246 @c -------------------------
1247 @item first:N
1248 @itemx prev:N
1249 @itemx next:N
1250 @itemx last:N
1251 The first, previous, next or last messages, if they exist.
1252 @c -------------------------
1253 @item all
1254 All of the messages.
1255 @end table
1257 For example, a range that shows all of these things is @samp{1 2 3
1258 5-10 last:5 unseen}.
1260 @vindex transient-mark-mode
1262 If the option @code{transient-mark-mode} is turned on and you set a
1263 region in the MH-Folder buffer, then the MH-E command will perform the
1264 operation on all messages in that region.
1266 @cindex @samp{mh-range} customization group
1267 @cindex customization group, @samp{mh-range}
1269 The @samp{mh-range} customization group contains a single option which
1270 affects how ranges are interpreted.
1272 @vtable @code
1273 @item mh-interpret-number-as-range-flag
1274 On means interpret a number as a range (default: @samp{on}).
1275 @end vtable
1277 @vindex mh-interpret-number-as-range-flag
1279 Since one of the most frequent ranges used is @samp{last:N}, MH-E will
1280 interpret input such as @samp{200} as @samp{last:200} if the
1281 @code{mh-interpret-number-as-range-flag} option is on (which is the
1282 default). If you need to scan just the message 200, then use the range
1283 @samp{200:1} or @samp{200-200}.
1285 @node Folder Selection,  , Ranges, Using This Manual
1286 @section Folder Selection
1288 @cindex completion, folders
1289 @cindex folders, completion
1290 @cindex folders, selecting
1292 When you choose a folder in MH-E via a command such as @kbd{o}
1293 (@code{mh-refile-msg}), completion is used to enter the folder
1294 @ifnothtml
1295 (@pxref{Completion, , , emacs, The GNU Emacs Manual}).
1296 @end ifnothtml
1297 @ifhtml
1298 (see the section
1299 @uref{http://www.gnu.org/software/emacs/manual/html_node/emacs/Completion.html,
1300 Completion} in @cite{The GNU Emacs Manual}).
1301 @end ifhtml
1302 In addition, MH-E has several ways of choosing a suitable default so
1303 that the folder can often be selected with a single @key{RET} key.
1305 @cindex customization group, @samp{mh-folder-selection}
1306 @cindex @samp{mh-folder-selection} customization group
1308 The @samp{mh-folder-selection} customization group contains some
1309 options which are used to help with this.
1311 @vtable @code
1312 @item mh-default-folder-for-message-function
1313 Function to select a default folder for refiling or @samp{Fcc:}
1314 (default: @code{nil}).
1315 @c -------------------------
1316 @item mh-default-folder-list
1317 List of addresses and folders (default: @code{nil}).
1318 @c -------------------------
1319 @item mh-default-folder-must-exist-flag
1320 On means guessed folder name must exist to be used (default:
1321 @samp{on}).
1322 @c -------------------------
1323 @item mh-default-folder-prefix
1324 Prefix used for folder names generated from aliases (default: @code{""}).
1325 @end vtable
1327 @vindex mh-default-folder-for-message-function
1329 You can set the option @code{mh-default-folder-for-message-function}
1330 to a function that provides a default folder for the message to be
1331 refiled. When this function is called, the current buffer contains the
1332 message being refiled and point is at the start of the message. This
1333 function should return the default folder as a string with a leading
1334 @samp{+} sign. It can also return @code{nil} so that the last folder
1335 name is used as the default, or an empty string to suppress the
1336 default entirely.
1338 Otherwise, the name of the destination folder is derived from the
1339 sender as follows:
1341 @enumerate
1342 @vindex mh-default-folder-list
1343 @item
1344 The folder name associated with the first address found in the list
1345 @code{mh-default-folder-list} is used. Each element in this list
1346 contains a @samp{Check Recipient} item. If this item is turned on,
1347 then the address is checked against the recipient instead of the
1348 sender. This is useful for mailing lists.
1349 @c -------------------------
1350 @vindex mh-default-folder-prefix
1351 @item
1352 An alias prefixed by @code{mh-default-folder-prefix} corresponding to
1353 the address is used. The prefix is used to prevent clutter in your
1354 mail directory. @xref{Aliases}.
1355 @end enumerate
1357 @vindex mh-default-folder-must-exist-flag
1359 If the derived folder does not exist, and
1360 @code{mh-default-folder-must-exist-flag} is @code{t}, then the last
1361 folder name used is suggested. This is useful if you get mail from
1362 various people for whom you have an alias, but file them all in the
1363 same project folder.
1365 @node Incorporating Mail, Reading Mail, Using This Manual, Top
1366 @chapter Incorporating Your Mail
1368 @cindex @samp{Folder} menu
1369 @cindex incorporating
1370 @cindex menu, @samp{Folder}
1372 This chapter talks about getting mail from your system mailbox into
1373 your MH @samp{+inbox} folder. The following command accomplishes that
1374 and is found in the @samp{Folder} menu.
1376 @table @kbd
1377 @cindex @samp{Folder > Incorporate New Mail} menu item
1378 @cindex menu item, @samp{Folder > Incorporate New Mail}
1379 @findex mh-inc-folder
1380 @kindex i
1381 @item i
1382 Incorporate new mail into a folder (@code{mh-inc-folder}).
1383 @end table
1385 @cindex @samp{mh-inc} customization group
1386 @cindex customization group, @samp{mh-inc}
1388 The following options in the @samp{mh-inc} customization group are
1389 used.
1391 @vtable @code
1392 @item mh-inc-prog
1393 Program to incorporate mail (default: @code{"inc"}).
1394 @c -------------------------
1395 @item mh-inc-spool-list
1396 Alternate spool files (default: @code{nil}).
1397 @end vtable
1399 The following hook is available.
1401 @vtable @code
1402 @findex mh-inc-folder
1403 @item mh-inc-folder-hook
1404 Hook run by @code{mh-inc-folder} after incorporating mail into a
1405 folder (default: @code{nil}).
1406 @end vtable
1408 @cindex @samp{+inbox}
1409 @findex mh-inc-folder
1410 @kindex i
1412 If at any time you receive new mail, incorporate the new mail into
1413 your @samp{+inbox} buffer with @kbd{i} (@code{mh-inc-folder}). Note
1414 that @kbd{i} will display the @samp{+inbox} buffer, even if there
1415 isn't any new mail. You can incorporate mail from any file into the
1416 current folder by specifying a prefix argument; you'll be prompted for
1417 the name of the file to use as well as the destination folder (for
1418 example, @kbd{C-u i ~/mbox @key{RET} +tmp @key{RET}}).
1420 @cindex @file{.emacs}
1421 @cindex Emacs, notification of new mail
1422 @cindex files, @file{.emacs}
1423 @cindex new mail
1424 @cindex notification of new mail
1426 Emacs can notify you when you have new mail by displaying @samp{Mail}
1427 in the mode line. To enable this behavior, and to have a clock in the
1428 mode line as well, add the following to @file{~/.emacs}:
1430 @findex display-time
1432 @smalllisp
1433 (display-time)
1434 @end smalllisp
1436 @cindex @command{inc}
1437 @cindex incorporating
1438 @cindex MH commands, @command{inc}
1439 @vindex mh-inc-prog
1440 @vindex mh-progs
1442 The name of the program that incorporates new mail is stored in
1443 @code{mh-inc-prog}; it is @code{"inc"} by default. This program
1444 generates a one-line summary for each of the new messages. Unless it
1445 is an absolute pathname, the file is assumed to be in the
1446 @code{mh-progs} directory (@pxref{Getting Started}). You may also link
1447 a file to @command{inc} that uses a different format (see
1448 @samp{mh-profile}(5), and sections
1449 @uref{@value{MH-BOOK-HOME}/reapre.html, Reading Mail: inc show next
1450 prev} and @uref{@value{MH-BOOK-HOME}/mhstr.html, MH Format Strings} in
1451 the MH book). You'll then need to modify several variables
1452 appropriately (@pxref{Scan Line Formats}).
1454 @vindex mh-inc-spool-list
1456 You can use the @code{mh-inc-spool-list} variable to direct MH-E to
1457 retrieve mail from arbitrary spool files other than your system
1458 mailbox, file it in folders other than your @samp{+inbox}, and assign
1459 key bindings to incorporate this mail.
1461 @cindex @command{procmail}
1462 @cindex @file{.procmailrc}
1463 @cindex Unix commands, @command{procmail}
1464 @cindex files, @file{.procmailrc}
1466 Suppose you are subscribed to the @i{mh-e-devel} mailing list and you
1467 use @command{procmail} to filter this mail into @file{~/mail/mh-e}
1468 with the following recipe in @file{.procmailrc}:
1470 @smallexample
1471 PATH=$PATH:/usr/bin/mh
1472 MAILDIR=$HOME/`mhparam Path`
1474 * ^From mh-e-devel-admin@@stop.mail-abuse.org
1475 mh-e
1476 @end smallexample
1478 @findex mh-inc-spool-*
1479 @kindex I *
1481 In order to incorporate @file{~/mail/mh-e} into @samp{+mh-e} with an
1482 @kbd{I m} (@code{mh-inc-spool-mh-e}) command, customize this option,
1483 and click on the @samp{INS} button. Enter a @samp{Spool File} of
1484 @samp{~/mail/mh-e}, a @samp{Folder} of @samp{mh-e}, and a @samp{Key
1485 Binding} of @samp{m}.
1487 @cindex @command{emacsclient}
1488 @cindex @command{gnuclient}
1489 @cindex @command{xbuffy}
1490 @cindex @samp{gnuserv}
1491 @cindex Unix commands, @command{emacsclient}
1492 @cindex Unix commands, @command{gnuclient}
1493 @cindex Unix commands, @command{xbuffy}
1495 You can use @command{xbuffy} to automate the incorporation of this
1496 mail using the Emacs 23 command @command{emacsclient} as follows:
1498 @smallexample
1499 box ~/mail/mh-e
1500     title mh-e
1501     origMode
1502     polltime 10
1503     headertime 0
1504     command emacsclient --eval '(mh-inc-spool-mh-e)'
1505 @end smallexample
1507 In XEmacs, the command @command{gnuclient} is used in a similar
1508 fashion.
1510 @findex mh-inc-folder
1511 @kindex i
1512 @vindex mh-inc-folder-hook
1514 You can set the hook @code{mh-inc-folder-hook}, which is called after
1515 new mail is incorporated by the @kbd{i} (@code{mh-inc-folder})
1516 command. A good use of this hook is to rescan the whole folder either
1517 after running @kbd{M-x mh-rmail} the first time or when you've changed
1518 the message numbers from outside of MH-E.
1520 @findex mh-execute-commands
1521 @findex mh-rescan-folder, example
1522 @findex mh-show, example
1523 @vindex mh-inc-folder-hook, example
1525 @smalllisp
1526 @group
1527 (defun my-mh-inc-folder-hook ()
1528   "Hook to rescan folder after incorporating mail."
1529   (if (buffer-modified-p)            ; @r{if outstanding refiles and deletes,}
1530       (mh-execute-commands))         ;   @r{carry them out}
1531   (mh-rescan-folder)                 ; @r{synchronize with +inbox}
1532   (mh-show))                         ; @r{show the current message}
1534 (add-hook 'mh-inc-folder-hook 'my-mh-inc-folder-hook)
1536 @i{Rescan folder after incorporating new mail via mh-inc-folder-hook}
1538 @end group
1539 @end smalllisp
1541 @node Reading Mail, Folders, Incorporating Mail, Top
1542 @chapter Reading Your Mail
1544 @cindex @samp{+inbox}
1545 @cindex MH-Folder mode
1546 @cindex MH-Show mode
1547 @cindex modes, MH-Folder
1548 @cindex modes, MH-Show
1549 @cindex reading mail
1550 @findex mh-rmail
1551 @kindex F r
1552 @kindex F v
1553 @kindex M-x mh-rmail
1555 The MH-E entry point for reading mail is @kbd{M-x mh-rmail}. This
1556 command incorporates your mail and creates a buffer called
1557 @samp{+inbox} in MH-Folder mode. The command @kbd{M-x mh-rmail} shows
1558 you only new mail, not mail you have already read@footnote{If you want
1559 to see your old mail as well, use @kbd{F r} to pull all your messages
1560 into MH-E@. Or, give a prefix argument to @code{mh-rmail} so it will
1561 prompt you for folder to visit like @kbd{F v} (for example, @kbd{C-u
1562 M-x mh-rmail @key{RET} bob @key{RET}}). @xref{Folders}.}.
1564 @findex display-time
1565 @vindex read-mail-command
1567 There are some commands that need to read mail, such as @kbd{Mouse-2}
1568 over the @samp{Mail} button that @code{display-time} adds to the mode
1569 line. You can configure Emacs to have these commands use MH-E by
1570 setting the option @code{read-mail-command} to @samp{mh-rmail}.
1572 @cindex @command{scan}
1573 @cindex @samp{Message} menu
1574 @cindex MH commands, @command{scan}
1575 @cindex menu, @samp{Message}
1576 @cindex scan lines
1578 The @samp{+inbox} buffer contains @dfn{scan lines}, which are one-line
1579 summaries of each incorporated message. You can perform most MH
1580 commands on these messages via one- or two-letter commands in either
1581 the MH-Folder or MH-Show buffers or by using the @samp{Message} menu.
1582 See @command{scan}(1) for a description of the contents of the scan
1583 lines, and see the Figure in @ref{Reading Mail Tour}, for an example.
1585 @table @kbd
1586 @kindex ?
1587 @findex mh-help
1588 @item ?
1589 Display cheat sheet for the MH-E commands (@code{mh-help}).
1590 @c -------------------------
1591 @cindex @samp{Message > Show Message} menu item
1592 @cindex menu item, @samp{Message > Show Message}
1593 @kindex @key{RET}
1594 @findex mh-show
1595 @item @key{RET}
1596 Display message (@code{mh-show}).
1597 @c -------------------------
1598 @cindex @samp{Message > Show Message with Header} menu item
1599 @cindex menu item, @samp{Message > Show Message with Header}
1600 @kindex , (comma)
1601 @findex mh-header-display
1602 @item , (comma)
1603 Display message with all header fields (@code{mh-header-display}).
1604 @c -------------------------
1605 @cindex @samp{Message > Show Message with Preferred Alternative} menu item
1606 @cindex menu item, @samp{Message > Show Message with Preferred Alternative}
1607 @kindex : (colon)
1608 @findex mh-show-preferred-alternative
1609 @item : (colon)
1610 Display message with the default preferred alternative
1611 (@code{mh-show-preferred-alternative}).
1612 @c -------------------------
1613 @kindex ; (semicolon)
1614 @findex mh-toggle-mh-decode-mime-flag
1615 @item ; (semicolon)
1616 Toggle the value of @code{mh-decode-mime-flag}
1617 (@code{mh-toggle-mh-decode-mime-flag}).
1618 @c -------------------------
1619 @kindex @key{SPC}
1620 @findex mh-page-msg
1621 @item @key{SPC}
1622 Display next page in message (@code{mh-page-msg}).
1623 @c -------------------------
1624 @kindex @key{BS}
1625 @findex mh-previous-page
1626 @item @key{BS}
1627 Display previous page in message (@code{mh-previous-page}).
1628 @c -------------------------
1629 @cindex @samp{Message > Write Message to File...} menu item
1630 @cindex menu item, @samp{Message > Write Message to File...}
1631 @kindex >
1632 @findex mh-write-msg-to-file
1633 @item >
1634 Append message to end of file (@code{mh-write-msg-to-file}).
1635 @c -------------------------
1636 @cindex @samp{Message > Pipe Message to Command...} menu item
1637 @cindex menu item, @samp{Message > Pipe Message to Command...}
1638 @kindex |
1639 @findex mh-pipe-msg
1640 @item |
1641 Pipe message through shell command (@code{mh-pipe-msg}).
1642 @c -------------------------
1643 @kindex C-d
1644 @findex mh-delete-msg-no-motion
1645 @item C-d
1646 Delete range, don't move to next message
1647 (@code{mh-delete-msg-no-motion}).
1648 @c -------------------------
1649 @cindex @samp{Message > Delete Message} menu item
1650 @cindex menu item, @samp{Message > Delete Message}
1651 @kindex d
1652 @findex mh-delete-msg
1653 @item d
1654 Delete range (@code{mh-delete-msg}).
1655 @c -------------------------
1656 @kindex D ?
1657 @findex mh-prefix-help
1658 @item D ?
1659 Display cheat sheet for the commands of the current prefix in
1660 minibuffer (@code{mh-prefix-help}).
1661 @c -------------------------
1662 @kindex D @key{SPC}
1663 @findex mh-page-digest
1664 @item D @key{SPC}
1665 Display next message in digest (@code{mh-page-digest}).
1666 @c -------------------------
1667 @kindex D @key{BS}
1668 @findex mh-page-digest-backwards
1669 @item D @key{BS}
1670 Display previous message in digest (@code{mh-page-digest-backwards}).
1671 @c -------------------------
1672 @cindex @samp{Message > Burst Digest Message} menu item
1673 @cindex menu item, @samp{Message > Burst Digest Message}
1674 @kindex D b
1675 @findex mh-burst-digest
1676 @item D b
1677 Break up digest into separate messages (@code{mh-burst-digest}).
1678 @c -------------------------
1679 @cindex @samp{Message > Go to Message by Number...} menu item
1680 @cindex menu item, @samp{Message > Go to Message by Number...}
1681 @kindex g
1682 @findex mh-goto-msg
1683 @item g
1684 Go to a message (@code{mh-goto-msg}).
1685 @c -------------------------
1686 @kindex k
1687 @findex mh-delete-subject-or-thread
1688 @item k
1689 Delete messages with same subject or thread
1690 (@code{mh-delete-subject-or-thread}).
1691 @c -------------------------
1692 @kindex K ?
1693 @findex mh-prefix-help
1694 @item K ?
1695 Display cheat sheet for the commands of the current prefix in
1696 minibuffer (@code{mh-prefix-help}).
1697 @c -------------------------
1698 @kindex K @key{TAB}
1699 @findex mh-next-button
1700 @item K @key{TAB}
1701 Go to the next button (@code{mh-next-button}).
1702 @c -------------------------
1703 @kindex K S-@key{TAB}
1704 @findex mh-prev-button
1705 @item K S-@key{TAB}
1706 Go to the previous button (@code{mh-prev-button}).
1707 @c -------------------------
1708 @kindex K a
1709 @findex mh-mime-save-parts
1710 @item K a
1711 Save attachments (@code{mh-mime-save-parts}).
1712 @c -------------------------
1713 @kindex K e
1714 @findex mh-display-with-external-viewer
1715 @item K e
1716 View attachment externally (@code{mh-display-with-external-viewer}).
1717 @c -------------------------
1718 @kindex K i
1719 @findex mh-folder-inline-mime-part
1720 @item K i
1721 Show attachment verbatim (@code{mh-folder-inline-mime-part}).
1722 @c -------------------------
1723 @kindex K o
1724 @findex mh-folder-save-mime-part
1725 @item K o
1726 Save (output) attachment (@code{mh-folder-save-mime-part}).
1727 @c -------------------------
1728 @kindex K t
1729 @findex mh-toggle-mime-buttons
1730 @item K t
1731 Toggle option @code{mh-display-buttons-for-inline-parts-flag}
1732 (@code{mh-toggle-mime-buttons}).
1733 @c -------------------------
1734 @kindex K v
1735 @findex mh-folder-toggle-mime-part
1736 @item K v
1737 View attachment (@code{mh-folder-toggle-mime-part}).
1738 @c -------------------------
1739 @cindex @samp{Message > Modify Message} menu item
1740 @cindex menu item, @samp{Message > Modify Message}
1741 @kindex M
1742 @findex mh-modify
1743 @item M
1744 Edit message (@code{mh-modify}).
1745 @c -------------------------
1746 @cindex @samp{Message > Go to First Message} menu item
1747 @cindex menu item, @samp{Message > Go to First Message}
1748 @kindex M-<
1749 @findex mh-first-msg
1750 @item M-<
1751 Display first message (@code{mh-first-msg}).
1752 @c -------------------------
1753 @cindex @samp{Message > Go to Last Message} menu item
1754 @cindex menu item, @samp{Message > Go to Last Message}
1755 @kindex M->
1756 @findex mh-last-msg
1757 @item M->
1758 Display last message (@code{mh-last-msg}).
1759 @c -------------------------
1760 @kindex M-n
1761 @findex mh-next-unread-msg
1762 @item M-n
1763 Display next unread message (@code{mh-next-unread-msg}).
1764 @c -------------------------
1765 @kindex M-p
1766 @findex mh-previous-unread-msg
1767 @item M-p
1768 Display previous unread message (@code{mh-previous-unread-msg}).
1769 @c -------------------------
1770 @cindex @samp{Message > Next Message} menu item
1771 @cindex menu item, @samp{Message > Next Message}
1772 @kindex n
1773 @findex mh-next-undeleted-msg
1774 @item n
1775 Display next message (@code{mh-next-undeleted-msg}).
1776 @c -------------------------
1777 @cindex @samp{Message > Previous Message} menu item
1778 @cindex menu item, @samp{Message > Previous Message}
1779 @kindex p
1780 @findex mh-previous-undeleted-msg
1781 @item p
1782 Display previous message (@code{mh-previous-undeleted-msg}).
1783 @c -------------------------
1784 @kindex P ?
1785 @findex mh-prefix-help
1786 @item P ?
1787 Display cheat sheet for the commands of the current prefix in
1788 minibuffer (@code{mh-prefix-help}).
1789 @c -------------------------
1790 @kindex P C
1791 @findex mh-ps-print-toggle-color
1792 @item P C
1793 Toggle whether color is used in printing messages
1794 (@code{mh-ps-print-toggle-color}).
1795 @c -------------------------
1796 @kindex P F
1797 @findex mh-ps-print-toggle-faces
1798 @item P F
1799 Toggle whether printing is done with faces or not
1800 (@code{mh-ps-print-toggle-faces}).
1801 @c -------------------------
1802 @kindex P f
1803 @findex mh-ps-print-msg-file
1804 @item P f
1805 Print range to file (@code{mh-ps-print-msg-file}).
1806 @c -------------------------
1807 @cindex @samp{Message > Print Message} menu item
1808 @cindex menu item, @samp{Message > Print Message}
1809 @kindex P l
1810 @findex mh-print-msg
1811 @item P l
1812 Print range the old fashioned way
1813 (@code{mh-print-msg}).
1814 @c -------------------------
1815 @kindex P p
1816 @findex mh-ps-print-msg
1817 @item P p
1818 Print range (@code{mh-ps-print-msg}).
1819 @c -------------------------
1820 @kindex X ?
1821 @findex mh-prefix-help
1822 @item X ?
1823 Display cheat sheet for the commands of the current prefix in
1824 minibuffer (@code{mh-prefix-help}).
1825 @c -------------------------
1826 @cindex @samp{Message > Unpack Uuencoded Message...} menu item
1827 @cindex menu item, @samp{Message > Unpack Uuencoded Message...}
1828 @kindex X s
1829 @kindex X u
1830 @findex mh-store-msg
1831 @item X s
1832 @itemx X u
1833 Unpack message created with @command{uudecode} or @command{shar}
1834 (@code{mh-store-msg}).
1835 @c -------------------------
1836 @kindex Mouse-2
1837 @findex mh-show-mouse
1838 @item Mouse-2
1839 Move point to mouse event and show message (@code{mh-show-mouse}).
1840 @end table
1842 Within the MH-Show buffer, the following command is defined.
1844 @table @kbd
1845 @kindex @key{RET}
1846 @kindex Mouse-1
1847 @kindex Mouse-2
1848 @findex mh-press-button
1849 @item @key{RET}
1850 @itemx Mouse-1
1851 @itemx Mouse-2
1852 View contents of button (@code{mh-press-button}).
1853 @end table
1855 @cindex @samp{mh-show} customization group
1856 @cindex customization group, @samp{mh-show}
1858 The following table lists options in the @samp{mh-show} customization
1859 group that are used while reading mail.
1861 @vtable @code
1862 @item mh-bury-show-buffer-flag
1863 On means show buffer is buried (default: @samp{on}).
1864 @c -------------------------
1865 @item mh-clean-message-header-flag
1866 On means remove extraneous header fields (default: @samp{on}).
1867 @c -------------------------
1868 @item mh-decode-mime-flag
1869 On means attachments are handled (default: @samp{on} if the Gnus
1870 @samp{mm-decode} package is present).
1871 @c -------------------------
1872 @item mh-display-buttons-for-alternatives-flag
1873 On means display buttons for all alternative attachments (default:
1874 @samp{off}).
1875 @c -------------------------
1876 @item mh-display-buttons-for-inline-parts-flag
1877 On means display buttons for all inline attachments (default:
1878 @samp{off}).
1879 @c -------------------------
1880 @item mh-do-not-confirm-flag
1881 On means non-reversible commands do not prompt for confirmation
1882 (default: @samp{off}).
1883 @c -------------------------
1884 @item mh-fetch-x-image-url
1885 Control fetching of @samp{X-Image-URL:} header field image (default:
1886 @samp{Never Fetch}).
1887 @c -------------------------
1888 @item mh-graphical-smileys-flag
1889 On means graphical smileys are displayed (default: @samp{on}).
1890 @c -------------------------
1891 @item mh-graphical-emphasis-flag
1892 On means graphical emphasis is displayed (default: @samp{on}).
1893 @c -------------------------
1894 @item mh-highlight-citation-style
1895 Style for highlighting citations (default: @samp{Multicolor}).
1896 @c -------------------------
1897 @item mh-invisible-header-fields-default
1898 List of hidden header fields (default: a checklist too long to list
1899 here).
1900 @c -------------------------
1901 @item mh-invisible-header-fields
1902 Additional header fields to hide (default: @code{nil}).
1903 @c -------------------------
1904 @item mh-lpr-command-format
1905 Command used to print (default: @code{"lpr -J '%s'"}).
1906 @c -------------------------
1907 @item mh-max-inline-image-height
1908 Maximum inline image height if @samp{Content-Disposition:} is not
1909 present (default: 0).
1910 @c -------------------------
1911 @item mh-max-inline-image-width
1912 Maximum inline image width if @samp{Content-Disposition:} is not
1913 present(default: 0).
1914 @c -------------------------
1915 @item mh-mhl-format-file
1916 Specifies the format file to pass to the @command{mhl} program
1917 (default: @samp{Use Default mhl Format (Printing Only)}).
1918 @c -------------------------
1919 @item mh-mime-save-parts-default-directory
1920 Default directory to use for @kbd{K a}.
1921 @c -------------------------
1922 @item mh-print-background-flag
1923 On means messages should be printed in the background (default:
1924 @samp{off}).
1925 @c -------------------------
1926 @item mh-show-buffer-mode-line-buffer-id
1927 Format string to produce @code{mode-line-buffer-identification} for
1928 show buffers (default: @code{"    @{show-%s@} %d"}).
1929 @c -------------------------
1930 @item mh-show-maximum-size
1931 Maximum size of message (in bytes) to display automatically (default:
1933 @c -------------------------
1934 @item mh-show-use-xface-flag
1935 On means display face images in MH-Show buffers (default: @samp{on}).
1936 @c -------------------------
1937 @item mh-store-default-directory
1938 Default directory for @kbd{X s} (default: @samp{Current}).
1939 @c -------------------------
1940 @item mh-summary-height
1941 Number of lines in MH-Folder buffer (including the mode line)
1942 (default: depends on size of frame).
1943 @end vtable
1945 The following hooks are available.
1947 @vtable @code
1948 @item mh-delete-msg-hook
1949 Hook run after marking each message for deletion (default: @code{nil}).
1950 @c -------------------------
1951 @item mh-show-hook
1952 Hook run after @key{RET} shows a message (default: @code{nil}).
1953 @c -------------------------
1954 @item mh-show-mode-hook
1955 Hook run upon entry to @code{mh-show-mode} (default: @code{nil}).
1956 @end vtable
1958 The following faces are available.
1960 @vtable @code
1961 @item mh-show-cc
1962 Face used to highlight @samp{cc:} header fields.
1963 @c -------------------------
1964 @item mh-show-date
1965 Face used to highlight @samp{Date:} header fields.
1966 @c -------------------------
1967 @item mh-show-from
1968 Face used to highlight @samp{From:} header fields.
1969 @c -------------------------
1970 @item mh-show-header
1971 Face used to deemphasize less interesting header fields.
1972 @c -------------------------
1973 @item mh-show-pgg-bad
1974 Bad PGG signature face.
1975 @c -------------------------
1976 @item mh-show-pgg-good
1977 Good PGG signature face.
1978 @c -------------------------
1979 @item mh-show-pgg-unknown
1980 Unknown or untrusted PGG signature face.
1981 @c -------------------------
1982 @item mh-show-signature
1983 Signature face.
1984 @c -------------------------
1985 @item mh-show-subject
1986 Face used to highlight @samp{Subject:} header fields.
1987 @c -------------------------
1988 @item mh-show-to
1989 Face used to highlight @samp{To:} header fields.
1990 @c -------------------------
1991 @item mh-show-xface
1992 X-Face image face.
1993 @end vtable
1995 The functions and variables introduced here are explained in more
1996 detail in the following sections.
1998 @menu
1999 * Viewing::
2000 * Viewing Attachments::
2001 * HTML::
2002 * Digests::
2003 * Reading PGP::
2004 * Printing::
2005 * Files and Pipes::
2006 * Navigating::
2007 * Miscellaneous Commands and Options::
2008 @end menu
2010 @node Viewing, Viewing Attachments, Reading Mail, Reading Mail
2011 @section Viewing Your Mail
2013 @findex mh-header-display
2014 @findex mh-page-msg
2015 @findex mh-previous-page
2016 @findex mh-show
2017 @findex mh-show-mouse
2018 @kindex , (comma)
2019 @kindex . (period)
2020 @kindex @key{BS}
2021 @kindex @key{RET}
2022 @kindex @key{SPC}
2023 @kindex Mouse-2
2025 The command @key{RET} (@code{mh-show}) displays the message that the
2026 cursor is on while @kbd{Mouse-2} (@code{mh-show-mouse}) displays the
2027 message that the mouse cursor is on. If the message is already
2028 displayed, it scrolls to the beginning of the message. Use @key{SPC}
2029 (@code{mh-page-msg}) and @key{BS} (@code{mh-previous-page}) to move
2030 forwards and backwards one page at a time through the message. You can
2031 give either of these commands a prefix argument that specifies the
2032 number of lines to scroll (such as @kbd{10 @key{SPC}}). The @key{SPC}
2033 command will also show the next undeleted message if it is used at the
2034 bottom of a message. MH-E normally hides a lot of the superfluous
2035 header fields that mailers add to a message, but if you wish to see
2036 all of them, use the command @kbd{,} (comma;
2037 @code{mh-header-display}).
2039 @vindex mh-show-maximum-size
2041 The option @code{mh-show-maximum-size} provides an opportunity to skip
2042 over large messages which may be slow to load. The default value of 0
2043 means that all message are shown regardless of size.
2045 A litany of options control what displayed messages look like.
2047 @vindex mh-show-cc
2048 @vindex mh-show-date
2049 @vindex mh-show-from
2050 @vindex mh-show-header
2051 @vindex mh-show-subject
2052 @vindex mh-show-to
2054 First, the appearance of the header fields can be modified by
2055 customizing the associated face: @code{mh-show-to}, @code{mh-show-cc},
2056 @code{mh-show-from}, @code{mh-show-date}, and @code{mh-show-subject}.
2057 The face @code{mh-show-header} is used to deemphasize the other, less
2058 interesting, header fields.
2060 @cindex regular expressions, @code{mh-invisible-header-fields}
2061 @vindex mh-clean-message-header-flag
2062 @vindex mh-invisible-header-fields
2063 @vindex mh-invisible-header-fields-default
2065 Normally messages are delivered with a handful of uninteresting header
2066 fields. These are hidden by turning on the option
2067 @code{mh-clean-message-header-flag} (which it is by default). The
2068 header fields listed in the option
2069 @code{mh-invisible-header-fields-default} are hidden, although you can
2070 check off any field that you would like to see. Header fields that you
2071 would like to hide that aren't listed can be added to the option
2072 @code{mh-invisible-header-fields} with a couple of caveats. Regular
2073 expressions are not allowed. Unique fields should have a @samp{:}
2074 suffix; otherwise, the element can be used to render invisible an
2075 entire class of fields that start with the same prefix. If you think a
2076 header field should be generally ignored, please update
2077 @uref{https://sourceforge.net/tracker/index.php?func=detail&aid=1916032&group_id=13357&atid=113357,
2078 SF #1916032}.
2080 @cindex header field, @samp{Face:}
2081 @cindex header field, @samp{X-Face:}
2082 @cindex header field, @samp{X-Image-URL:}
2083 @cindex @samp{Face:} header field
2084 @cindex @samp{X-Face:} header field
2085 @cindex @samp{X-Image-URL:} header field
2086 @vindex mh-show-use-xface-flag
2088 MH-E can display the content of @samp{Face:}, @samp{X-Face:}, and
2089 @samp{X-Image-URL:} header fields. If any of these fields occur in the
2090 header of your message, the sender's face will appear in the
2091 @samp{From:} header field. If more than one of these fields appear,
2092 then the first field found in the order @samp{Face:}, @samp{X-Face:},
2093 and @samp{X-Image-URL:} will be used. The option
2094 @code{mh-show-use-xface-flag} is used to turn this feature on and off.
2095 This feature will be turned on by default if your system supports it.
2097 The first header field used, if present, is the Gnus-specific
2098 @samp{Face:} field@footnote{The @samp{Face:} field appeared in GNU
2099 Emacs 21 and XEmacs. For more information, see
2100 @uref{http://quimby.gnus.org/circus/face/}.}.
2102 @cindex @command{uncompface}
2103 @cindex Emacs, packages, x-face
2104 @cindex Unix commands, @command{uncompface}
2105 @cindex x-face package
2106 @vindex mh-show-xface
2108 Next is the traditional @samp{X-Face:} header field@footnote{The
2109 display of this field requires the
2110 @uref{ftp://ftp.cs.indiana.edu/pub/faces/compface/compface.tar.Z,
2111 @command{uncompface} program}. Recent versions of XEmacs have internal
2112 support for @samp{X-Face:} images. If your version of XEmacs does not,
2113 then you'll need both @command{uncompface} and the
2114 @uref{ftp://ftp.jpl.org/pub/elisp/, @samp{x-face} package}.}. MH-E
2115 renders the foreground and background of the image using the
2116 associated attributes of the face @code{mh-show-xface}.
2118 @cindex @command{convert}
2119 @cindex @command{wget}
2120 @cindex ImageMagick
2121 @cindex Unix commands, @command{convert}
2122 @cindex Unix commands, @command{wget}
2123 @vindex mh-fetch-x-image-url
2125 Finally, MH-E will display images referenced by the
2126 @samp{X-Image-URL:} header field if neither the @samp{Face:} nor the
2127 @samp{X-Face:} fields are present@footnote{The display of the images
2128 requires the @uref{http://www.gnu.org/software/wget/wget.html,
2129 @command{wget} program} to fetch the image and the @command{convert}
2130 program from the @uref{http://www.imagemagick.org/, ImageMagick
2131 suite}.}. Of the three header fields this is the most efficient in
2132 terms of network usage since the image doesn't need to be transmitted
2133 with every single mail. The option @code{mh-fetch-x-image-url}
2134 controls the fetching of the @samp{X-Image-URL:} header field image
2135 with the following values:
2137 @table @samp
2138 @item Ask Before Fetching
2139 You are prompted before the image is fetched. MH-E will remember your
2140 reply and will either use the already fetched image the next time the
2141 same URL is encountered or silently skip it if you didn't fetch it the
2142 first time. This is a good setting.
2143 @c -------------------------
2144 @item Never Fetch
2145 Images are never fetched and only displayed if they are already
2146 present in the cache. This is the default.
2147 @end table
2149 There isn't a value of @samp{Always Fetch} for privacy and DOS (denial
2150 of service) reasons. For example, fetching a URL can tip off a spammer
2151 that you've read his email (which is why you shouldn't blindly answer
2152 yes if you've set this option to @samp{Ask Before Fetching}). Someone
2153 may also flood your network and fill your disk drive by sending a
2154 torrent of messages, each specifying a unique URL to a very large
2155 file.
2157 @cindex @file{.mhe-x-image-cache}
2158 @cindex files, @file{.mhe-x-image-cache}
2160 The cache of images is found in the directory
2161 @file{.mhe-x-image-cache} within your MH directory. You can add your
2162 own face to the @samp{From:} field too. @xref{Picture}.
2164 @cindex @command{mhl}
2165 @cindex MH commands, @command{mhl}
2166 @vindex mh-mhl-format-file
2168 Normally MH-E takes care of displaying messages itself (rather than
2169 calling an MH program to do the work). If you'd rather have
2170 @command{mhl} display the message (within MH-E), change the option
2171 @code{mh-mhl-format-file} from its default value of @samp{Use Default
2172 mhl Format (Printing Only)}. You can set this option to @samp{Use
2173 Default mhl Format} to get the same output as you would get if you ran
2174 @command{mhl} from the shell. If you have a format file that you want
2175 MH-E to use, you can set this option to @samp{Specify an mhl Format
2176 File} and enter the name of your format file (@command{mhl}(1) or
2177 section @uref{@value{MH-BOOK-HOME}/shomes.html#Usisho, Using mhl} in
2178 the MH book tells you how to write one). Your format file should
2179 specify a non-zero value for @samp{overflowoffset} to allow MH-E to
2180 parse the header. Note that @command{mhl} is always used for printing
2181 and forwarding; in this case, the value of @code{mh-mhl-format-file}
2182 is consulted if you have specified a format file.
2184 @cindex citations, highlighting
2185 @cindex highlighting citations
2186 @vindex mh-highlight-citation-style
2188 If the sender of the message has cited other messages in his message,
2189 then MH-E will highlight these citations to emphasize the sender's
2190 actual response. The option @code{mh-highlight-citation-style} can be
2191 customized to change the highlighting style. The @samp{Multicolor}
2192 method uses a different color for each indentation while the
2193 @samp{Monotone} method highlights all citations in red. To disable
2194 highlighting of citations entirely, choose @samp{None}.
2196 @cindex URLs, highlighting
2197 @cindex email addresses, highlighting
2198 @cindex highlighting URLs
2199 @cindex highlighting email addresses
2200 @cindex links, following
2201 @findex goto-address-at-point
2202 @kindex C-c @key{RET}
2203 @kindex Mouse-2
2204 @vindex goto-address-highlight-p
2206 Email addresses and URLs in the message are highlighted if the option
2207 @code{goto-address-highlight-p} is on, which it is by default. To view
2208 the web page for a highlighted URL or to send a message using a
2209 highlighted email address, use @kbd{Mouse-2} or @kbd{C-c @key{RET}}
2210 (@code{goto-address-at-point}). @xref{Sending Mail}, to see how to
2211 configure Emacs to send the message using MH-E.
2213 @cindex boldface, showing
2214 @cindex emphasis
2215 @cindex italics, showing
2216 @cindex smileys
2217 @cindex typesetting
2218 @cindex underline, showing
2219 @vindex gnus-emphasis-alist
2220 @vindex mh-decode-mime-flag
2221 @vindex mh-graphical-emphasis-flag
2222 @vindex mh-graphical-smileys-flag
2224 It is a long standing custom to inject body language using a
2225 cornucopia of punctuation, also known as the @dfn{smileys}. MH-E can
2226 render these as graphical widgets if the option
2227 @code{mh-graphical-smileys-flag} is turned on, which it is by default.
2228 Smileys include patterns such as :-) and ;-). Similarly, a few
2229 typesetting features are indicated in ASCII text with certain
2230 characters. If your terminal supports it, MH-E can render these
2231 typesetting directives naturally if the option
2232 @code{mh-graphical-emphasis-flag} is turned on, which it is by
2233 default. For example, _underline_ will be
2234 @ifhtml
2235 @html
2236 <u>underlined</u>,
2237 @end html
2238 @end ifhtml
2239 @ifnothtml
2240 underlined,
2241 @end ifnothtml
2242 *bold* will appear in @b{bold}, /italics/ will appear in @i{italics},
2243 and so on. See the option @code{gnus-emphasis-alist} for the whole
2244 list. Both of these options are disabled if the option
2245 @code{mh-decode-mime-flag} is turned off. @xref{Viewing Attachments}.
2247 @cindex signature separator
2248 @cindex vCard
2249 @vindex mh-show-signature
2251 MH-E normally renders signatures and vCards in italics so that the
2252 body of the message stands out more. MH-E depends on the presence of
2253 the @dfn{signature separator} (@code{"-- "}) to do this. You can also
2254 customize the face @code{mh-show-signature} so the appearance of the
2255 signature block is more to your liking.
2257 @vindex mh-show-hook
2258 @vindex mh-show-mode-hook
2260 Two hooks can be used to control how messages are displayed. The first
2261 hook, @code{mh-show-mode-hook}, is called early on in the process of
2262 the message display. It is usually used to perform some action on the
2263 message's content. The second hook, @code{mh-show-hook}, is the last
2264 thing called after messages are displayed. It's used to affect the
2265 behavior of MH-E in general or when @code{mh-show-mode-hook} is too
2266 early.
2268 @cindex MH-Show mode
2269 @cindex modes, MH-Show
2270 @vindex mh-show-buffer-mode-line-buffer-id
2272 For those who like to modify their mode lines, use
2273 @code{mh-show-buffer-mode-line-buffer-id} to modify the mode line in
2274 the MH-Show buffers. Place the two escape strings @samp{%s} and
2275 @samp{%d}, which will display the folder name and the message number,
2276 respectively, somewhere in the string in that order. The default value
2277 of @code{"@{show-%s@} %d"} yields a mode line of
2279 @smallexample
2280 -----@{show-+inbox@} 4      (MH-Show)--Bot--------------------------------
2281 @end smallexample
2283 @node Viewing Attachments, HTML, Viewing, Reading Mail
2284 @section Viewing Attachments
2286 @cindex attachments
2287 @cindex body parts
2288 @cindex @command{mhshow}
2289 @cindex @command{show}
2290 @cindex MH commands, @command{mhshow}
2291 @cindex MH commands, @command{show}
2292 @cindex MIME
2293 @cindex multimedia mail
2295 MH has the ability to display @dfn{@sc{mime}} (Multipurpose Internet
2296 Mail Extensions) messages which are simply messages with additional
2297 @dfn{body parts} or @dfn{attachments}. You can use the MH commands
2298 @command{show}@footnote{See the section
2299 @uref{@value{MH-BOOK-HOME}/reapre.html, Reading Mail: inc show next
2300 prev} in the MH book.} or @command{mhshow}@footnote{See the section
2301 @uref{@value{MH-BOOK-HOME}/usimim.html#ReMIMa, Reading MIME Mail} in
2302 the MH book.} from the shell to read @sc{mime} messages@footnote{You
2303 can call them directly from Emacs if you're running the X Window
2304 System: type @kbd{M-! xterm -e mhshow @var{message-number}}. You can
2305 leave out the @samp{xterm -e} if you use @command{mhlist} or
2306 @command{mhstore}.}.
2308 @cindex Emacs, packages, mm-decode
2309 @cindex mm-decode package
2310 @findex mh-toggle-mh-decode-mime-flag
2311 @kindex ; (semicolon)
2312 @vindex mh-decode-mime-flag
2314 MH-E can handle attachments as well if the Gnus @samp{mm-decode}
2315 package is present. If so, the option @code{mh-decode-mime-flag} will
2316 be on. Otherwise, you'll see the @sc{mime} body parts rather than text
2317 or attachments. There isn't much point in turning off the option
2318 @code{mh-decode-mime-flag}; however, you can inspect it if it appears
2319 that the body parts are not being interpreted correctly or toggle it
2320 with the command @kbd{;} (semicolon;
2321 @code{mh-toggle-mh-decode-mime-flag}) to view the raw message. This
2322 option also controls the display of quoted-printable messages and
2323 other graphical widgets. @xref{Viewing}.
2325 @cindex buttons
2327 Attachments in MH-E are indicated by @dfn{buttons} like this:
2329 @smallexample
2330 [1. image/jpeg; foo.jpg]...
2331 @end smallexample
2333 @findex mh-next-button
2334 @findex mh-press-button
2335 @findex mh-prev-button
2336 @kindex @key{RET}
2337 @kindex K @key{TAB}
2338 @kindex K S-@key{TAB}
2339 @kindex Mouse-1
2340 @kindex Mouse-2
2342 To view the contents of the button, use either @kbd{Mouse-1} or
2343 @kbd{Mouse-2} on the button or @key{RET} (@code{mh-press-button}) when
2344 the cursor is over the button. This command is a toggle so if you use
2345 it again on the same attachment, it is hidden. If Emacs does not know
2346 how to display the attachment, then Emacs offers to save the
2347 attachment in a file. To move the cursor to the next button, use the
2348 command @kbd{K @key{TAB}} (@code{mh-next-button}). If the end of the
2349 buffer is reached then the search wraps over to the start of the
2350 buffer. To move the cursor to the previous button, use the command
2351 @kbd{K S-@key{TAB}} (@code{mh-prev-button}). If the beginning of the
2352 buffer is reached then the search wraps over to the end of the buffer.
2354 @cindex attachments, viewing
2355 @cindex viewing attachments
2356 @findex mh-folder-toggle-mime-part
2357 @kindex K v
2359 Another way to view the contents of a button is to use the command
2360 @kbd{K v} (@code{mh-folder-toggle-mime-part}). This command displays
2361 (or hides) the attachment associated with the button under the cursor.
2362 If the cursor is not located over a button, then the cursor first
2363 moves to the next button, wrapping to the beginning of the message if
2364 necessary. This command has the advantage over the previous commands
2365 of working from the MH-Folder buffer. You can also provide a numeric
2366 prefix argument (as in @kbd{4 K v}) to view the attachment labeled
2367 with that number. If Emacs does not know how to display the
2368 attachment, then Emacs offers to save the attachment in a file.
2370 @cindex @file{/etc/mailcap}
2371 @cindex files, @file{/etc/mailcap}
2372 @findex mailcap-mime-info
2373 @findex mh-display-with-external-viewer
2374 @kindex K e
2376 If Emacs does not know how to view an attachment, you could save it
2377 into a file and then run some program to open it. It is easier,
2378 however, to launch the program directly from MH-E with the command
2379 @kbd{K e} (@code{mh-display-with-external-viewer}). While you'll most
2380 likely use this to view spreadsheets and documents, it is also useful
2381 to use your browser to view HTML attachments with higher fidelity than
2382 what Emacs can provide. This command displays the attachment
2383 associated with the button under the cursor. If the cursor is not
2384 located over a button, then the cursor first moves to the next button,
2385 wrapping to the beginning of the message if necessary. You can provide
2386 a numeric prefix argument (as in @kbd{4 K e}) to view the attachment
2387 labeled with that number. This command tries to provide a reasonable
2388 default for the viewer by calling the Emacs function
2389 @code{mailcap-mime-info}. This function usually reads the file
2390 @file{/etc/mailcap}.
2392 @cindex attachments, saving
2393 @cindex saving attachments
2394 @findex mh-folder-save-mime-part
2395 @kindex K o
2397 Use the command @kbd{K o} (@code{mh-folder-save-mime-part}) to save
2398 attachments (the mnemonic is ``output''). This command saves the
2399 attachment associated with the button under the cursor. If the cursor
2400 is not located over a button, then the cursor first moves to the next
2401 button, wrapping to the beginning of the message if necessary. You can
2402 also provide a numeric prefix argument (as in @kbd{3 K o}) to save the
2403 attachment labeled with that number. This command prompts you for a
2404 filename and suggests a specific name if it is available.
2406 @cindex @command{mhn}
2407 @cindex @command{mhstore}
2408 @cindex MH commands, @command{mhn}
2409 @cindex MH commands, @command{mhstore}
2410 @findex mh-mime-save-parts
2411 @kindex K a
2412 @vindex mh-mime-save-parts-default-directory
2414 You can save all of the attachments at once with the command @kbd{K a}
2415 (@code{mh-mime-save-parts}). The attachments are saved in the
2416 directory specified by the option
2417 @code{mh-mime-save-parts-default-directory} unless you use a prefix
2418 argument (as in @kbd{C-u K a}) in which case you are prompted for the
2419 directory. These directories may be superseded by MH profile
2420 components, since this function calls on @command{mhstore}
2421 (@command{mhn}) to do the work.
2423 @vindex mh-mime-save-parts-default-directory
2425 The default value for the option
2426 @code{mh-mime-save-parts-default-directory} is @samp{Prompt Always} so
2427 that you are always prompted for the directory in which to save the
2428 attachments. However, if you usually use the same directory within a
2429 session, then you can set this option to @samp{Prompt the First Time}
2430 to avoid the prompt each time. you can make this directory permanent
2431 by choosing @samp{Directory} and entering the directory's name.
2433 @cindex attachments, inline
2434 @cindex inline attachments
2435 @findex mh-toggle-mime-buttons
2436 @kindex K t
2437 @vindex mh-display-buttons-for-inline-parts-flag
2439 The sender can request that attachments should be viewed inline so
2440 that they do not really appear like an attachment at all to the
2441 reader. Most of the time, this is desirable, so by default MH-E
2442 suppresses the buttons for inline attachments. On the other hand, you
2443 may receive code or HTML which the sender has added to his message as
2444 inline attachments so that you can read them in MH-E@. In this case, it
2445 is useful to see the buttons so that you know you don't have to cut
2446 and paste the code into a file; you can simply save the attachment. If
2447 you want to make the buttons visible for inline attachments, you can
2448 use the command @kbd{K t} (@code{mh-toggle-mime-buttons}) to toggle
2449 the visibility of these buttons. You can turn on these buttons
2450 permanently by turning on the option
2451 @code{mh-display-buttons-for-inline-parts-flag}.
2453 MH-E cannot display all attachments inline however. It can display
2454 text (including @sc{html}) and images.
2456 @cindex header field, @samp{Content-Disposition:}
2457 @cindex inline images
2458 @cindex @samp{Content-Disposition:} header field
2459 @vindex mh-max-inline-image-height
2460 @vindex mh-max-inline-image-width
2462 Some older mail programs do not insert the needed
2463 plumbing@footnote{This plumbing is the @samp{Content-Disposition:}
2464 header field.} to tell MH-E whether to display the attachments inline
2465 or not. If this is the case, MH-E will display these images inline if
2466 they are smaller than the window. However, you might want to allow
2467 larger images to be displayed inline. To do this, you can change the
2468 options @code{mh-max-inline-image-width} and
2469 @code{mh-max-inline-image-height} from their default value of zero to
2470 a large number. The size of your screen is a good choice for these
2471 numbers.
2473 @cindex alternatives
2474 @cindex attachments, alternatives
2475 @vindex mh-display-buttons-for-alternatives-flag
2477 Sometimes, a mail program will produce multiple alternatives of an
2478 attachment in increasing degree of faithfulness to the original
2479 content. By default, only the preferred alternative is displayed. If
2480 the option @code{mh-display-buttons-for-alternatives-flag} is on, then
2481 the preferred part is shown inline and buttons are shown for each of
2482 the other alternatives.
2484 @vindex mm-discouraged-alternatives
2486 Many people prefer to see the @samp{text/plain} alternative rather
2487 than the @samp{text/html} alternative. To do this in MH-E, customize
2488 the option @code{mm-discouraged-alternatives}, and add
2489 @samp{text/html}. The next best alternative, if any, will be shown.
2491 @findex mh-show-preferred-alternative
2492 @kindex : (colon)
2494 Occasionally, though, you might want to see the preferred alternative.
2495 The command @kbd{:} (@code{mh-show-preferred-alternative}) displays
2496 the message with the default preferred alternative. This is as if
2497 @code{mm-discouraged-alternatives} is set to @samp{nil}. Use the
2498 command @key{RET} (@code{mh-show}) to show the message normally again.
2500 @kindex K i
2501 @findex mh-folder-inline-mime-part
2503 You can view the raw contents of an attachment with the command @kbd{K
2504 i} (@code{mh-folder-inline-mime-part}). This command displays (or
2505 hides) the contents of the attachment associated with the button under
2506 the cursor verbatim. If the cursor is not located over a button, then
2507 the cursor first moves to the next button, wrapping to the beginning
2508 of the message if necessary. You can also provide a numeric prefix
2509 argument (as in @kbd{4 K i}) to view the attachment labeled with that
2510 number.
2512 For additional information on buttons, see
2513 @ifinfo
2514 @ref{Article Buttons,,,gnus}, and @ref{MIME Commands,,,gnus}.
2515 @end ifinfo
2516 @ifnotinfo
2517 the chapters @uref{http://www.gnus.org/manual/gnus_101.html#SEC101,
2518 Article Buttons} and
2519 @uref{http://www.gnus.org/manual/gnus_108.html#SEC108, MIME Commands}
2520 in the @cite{The Gnus Manual}.
2521 @end ifnotinfo
2523 @node HTML, Digests, Viewing Attachments, Reading Mail
2524 @section HTML
2526 @cindex HTML
2527 @cindex Gnus
2529 MH-E can display messages that have been sent in HTML@footnote{This
2530 feature depends on a version of Gnus that is at least 5.10.}. The
2531 content of the message will appear in the MH-Show buffer as you would
2532 expect if the entire message is HTML, or there is an inline HTML body
2533 part. However, if there is an HTML body part that is an attachment,
2534 then you'll see a button like this:
2536 @smallexample
2537 [1. text/html; foo.html]...
2538 @end smallexample
2540 To see how to read the contents of this body part, see @ref{Viewing
2541 Attachments}.
2543 @vindex mm-text-html-renderer
2545 The browser that MH-E uses is determined by the option
2546 @code{mm-text-html-renderer}. The default setting is set automatically
2547 based upon the presence of a known browser on your system. If you wish
2548 to use a different browser, then set this option accordingly. See the
2549 documentation for the browser you use for additional information on
2550 how to use it. In particular, find and disable the option to render
2551 images as this can tip off spammers that the email address they have
2552 used is valid.
2554 @vindex mm-text-html-renderer
2556 If you're confused about which @code{mm-text-html-renderer} to use,
2557 here's a brief description of each, sorted by popularity, that
2558 includes the results of a quick poll of MH-E users from 2005-12-23.
2560 @table @asis
2561 @cindex browser, @samp{w3m}
2562 @cindex @samp{w3m}
2563 @kindex Mouse-2
2564 @item @samp{w3m} 7
2565 The @samp{w3m} browser requires an external program. It's quick,
2566 produces pretty nice output, and best of all, it's the only browser
2567 that highlights links. These can be clicked with @kbd{Mouse-2} to view
2568 the content of the link in @samp{w3m}. The @samp{w3m} browser handles
2569 tables well and actually respects the table's width parameter (which
2570 can cause text to wrap if the author didn't anticipate that the page
2571 would be viewed in Emacs).
2572 @c -------------------------
2573 @cindex browser, @samp{w3m-standalone}
2574 @cindex @samp{w3m-standalone}
2575 @item @samp{w3m-standalone} 3
2576 This browser, along with @samp{nil} for the external browser, are the
2577 only choices that work without having to download a separate lisp
2578 package or external program. This browser is quick, but does not show
2579 links. It handles simple tables but some tables get rendered much
2580 wider than the Emacs frame. This browser was the only one not to
2581 handle the escape @samp{&ndash;} (it printed a @samp{?}), but it did
2582 render @samp{&reg;}.
2583 @c -------------------------
2584 @cindex browser, @samp{links}
2585 @cindex @samp{links}
2586 @item @samp{links} 1
2587 The @samp{links} browser requires an external program. It's quick, and
2588 produces nicer output than @samp{lynx} on single column mails in
2589 tables. However, it doesn't show links and it doesn't do as nice a job
2590 on multi-column tables as some lines wrap. At least it fits in 80
2591 columns and thus seems better than @samp{w3} and
2592 @samp{w3m-standalone}. Converts escapes such as @samp{&reg;} to (R).
2593 @c -------------------------
2594 @cindex browser, @samp{lynx}
2595 @cindex @samp{lynx}
2596 @item @samp{lynx} 1
2597 The @samp{lynx} browser requires an external program. It's quick and
2598 produces pretty decent output but it doesn't show links. It doesn't
2599 seem to do multi-column tables which makes output much cleaner. It
2600 centers the output and wraps long lines more than most. Handles
2601 @samp{&reg;}.
2602 @c -------------------------
2603 @item @samp{nil} 1
2604 This choice obviously requires an external browser. Like
2605 @samp{w3m-standalone}, it works out of the box. With this setting,
2606 HTML messages have a button for the body part which you can view with
2607 @kbd{K v} (@code{mh-folder-toggle-mime-part}).
2608 @c -------------------------
2609 @cindex browser, @samp{w3}
2610 @cindex @samp{w3}
2611 @item @samp{w3} 0
2612 This choice does not require an external program as all of the
2613 rendering is done in lisp. You do need to get the package separately.
2614 This browser is @strong{slow}, and doesn't appear to have been updated
2615 since 2001 and the author hasn't responded to my emails. It displays
2616 unknown tags instead of hiding them, so you get to see all the
2617 Microsoft crap in certain messages. Tends to make multi-column tables
2618 wider than even a full-screen Emacs can handle. Like @samp{w3m}, you
2619 can follow links, but you have to find them first as they are not
2620 highlighted. Performs well on single-column tables and handles escapes
2621 such as @samp{&reg;}.
2622 @c -------------------------
2623 @cindex browser, @samp{html2text}
2624 @cindex @samp{html2text}
2625 @item @samp{html2text} 0
2626 The @samp{html2text} browser requires an external program. I noticed
2627 that it can do some nasty things with simple HTML mails (like filling
2628 the entire message as if it were one paragraph, including signature).
2629 On another message, it displayed half of the HTML tags for some
2630 reason.
2631 @end table
2633 @vindex mm-text-html-renderer
2635 For a couple more sources of information about
2636 @code{mm-text-html-renderer},
2637 @ifinfo
2638 @xref{Display Customization,,,emacs-mime}, and the documentation for
2639 the Gnus command @kbd{W h} (@pxref{Article Washing,,,gnus},).
2640 @end ifinfo
2641 @ifnotinfo
2642 see section @uref{http://www.gnus.org/manual/emacs-mime_6.html,
2643 Display Customization} in the @cite{The Emacs MIME Manual} and the
2644 documentation for the Gnus command @kbd{W h} (see section
2645 @uref{http://www.gnus.org/manual/gnus_99.html, Article Washing} in the
2646 @cite{The Gnus Manual}).
2647 @end ifnotinfo
2649 @cindex @file{.emacs}
2650 @cindex files, @file{.emacs}
2651 @findex browse-url-at-mouse
2652 @kindex S-Mouse-2
2654 A useful key binding that you can add to @file{~/.emacs} is the
2655 following which displays an HTML link or textual URL in an external
2656 browser when clicked with @kbd{S-mouse-2}. This binding works in any
2657 buffer, including HTML buffers.
2659 @smalllisp
2660 (global-set-key [S-mouse-2] 'browse-url-at-mouse)
2661 @end smalllisp
2663 @node Digests, Reading PGP, HTML, Reading Mail
2664 @section Digests
2666 @cindex digests
2667 @findex mh-page-digest
2668 @findex mh-page-digest-backwards
2669 @kindex D @key{BS}
2670 @kindex D @key{SPC}
2671 @kindex @key{BS}
2672 @kindex @key{SPC}
2674 A digest is a message that contains other messages. Special MH-E
2675 commands let you read digests conveniently. You can use @key{SPC} and
2676 @key{BS} to page through the digest as if it were a normal message,
2677 but if you wish to skip to the next message in the digest, use
2678 @kbd{D @key{SPC}} (@code{mh-page-digest}). To return to a previous message,
2679 use @kbd{D @key{BS}} (@code{mh-page-digest-backwards}).
2681 @cindex @command{burst}
2682 @cindex MH commands, @command{burst}
2683 @cindex MH-Folder Show mode
2684 @cindex modes, MH-Folder Show
2685 @findex mh-burst-digest
2686 @kindex d
2687 @kindex D b
2688 @kindex t
2690 Another handy command is @kbd{D b} (@code{mh-burst-digest}). This
2691 command uses the MH command @command{burst}@footnote{See the section
2692 @uref{@value{MH-BOOK-HOME}/burdig.html, Bursting Messages} in the MH
2693 book.} to break out each message in the digest into its own message.
2694 Using this command, you can quickly delete unwanted messages, like
2695 this: Once the digest is split up, toggle out of MH-Folder Show mode
2696 with @kbd{t} (@pxref{Folders}) so that the scan lines fill the screen
2697 and messages aren't displayed. Then use @kbd{d} (@pxref{Reading Mail})
2698 to quickly delete messages that you don't want to read (based on the
2699 @samp{Subject:} header field). You can also burst the digest to reply
2700 directly to the people who posted the messages in the digest. One
2701 problem you may encounter is that the @samp{From:} header fields are
2702 preceded with a @samp{>} so that your reply can't create the
2703 @samp{To:} field correctly. In this case, you must correct the
2704 @samp{To:} field yourself. This is described later (@pxref{Editing
2705 Drafts}).
2707 @node Reading PGP, Printing, Digests, Reading Mail
2708 @section Signed and Encrypted Messages
2710 @cindex GPG
2711 @cindex GnuPG
2712 @cindex Gnus
2713 @cindex OpenPGP
2714 @cindex PGP
2715 @cindex RFC 3156
2716 @cindex encrypted messages
2717 @cindex security
2718 @cindex signed messages
2720 You can read encrypted or signed PGP or GPG messages with
2721 MH-E@footnote{This feature depends on post-5.10 versions of Gnus.
2722 @cite{MIME Security with OpenPGP} is documented in
2723 @uref{http://www.rfc-editor.org/rfc/rfc3156.txt, RFC 3156}. However,
2724 MH-E can also decrypt old-style PGP messages that are not in MIME
2725 format.}. This section assumes that you already have a good
2726 understanding of GPG and have set up your keys appropriately.
2728 If someone sends you a signed message, here is what you'll see:
2730 @smallexample
2731 @group
2732 [[PGP Signed Part:Bill Wohler <wohler@@stop.mail-abuse.org>]]
2733 This is a signed message.
2735 [[End of PGP Signed Part]]
2736 @end group
2737 @end smallexample
2739 @cindex keychain
2740 @cindex key server
2741 @cindex signed messages
2743 If the key for the given signature is not in your keychain, you'll be
2744 given the opportunity to fetch the key from a key server and verify
2745 the key. If the message is really large, the verification process can
2746 take a long time. You can press @kbd{C-g} at any time to
2747 cancel@footnote{Unfortunately in the current version, the validation
2748 process doesn't display a message so it appears that MH-E has hung. We
2749 hope that this will be fixed in the future.}.
2751 If the signature doesn't check out, you might see something like this:
2753 @smallexample
2754 @group
2755 [[PGP Signed Part:Failed]]
2756 This is a signed message.
2757 This is garbage added after the signature was made.
2759 [[End of PGP Signed Part]]
2760 @end group
2761 @end smallexample
2763 @cindex decrypting messages
2765 If someone sends you an encrypted message, MH-E will ask for your
2766 passphrase to decrypt the message. You should see something like this:
2768 @smallexample
2769 @group
2770 [[PGP Encrypted Part:OK]]
2772 [[PGP Signed Part:Bill Wohler <wohler@@stop.mail-abuse.org>]]
2773 This is the secret message.
2775 [[End of PGP Signed Part]]
2777 [[End of PGP Encrypted Part]]
2778 @end group
2779 @end smallexample
2781 If there is a problem decrypting the message, the button will say:
2783 @smallexample
2784 [[PGP Encrypted Part:Failed]]
2785 @end smallexample
2787 You can read the contents of this button using the methods described in
2788 @ref{Viewing Attachments}. If the message were corrupted, you'd see
2789 this:
2791 @smallexample
2792 [[PGP Encrypted Part:Failed]
2793 Invalid base64 data]
2794 @end smallexample
2796 If your passphrase were incorrect, you'd see something like this:
2798 @smallexample
2799 [GNUPG:] ENC_TO CD9C88BB610BD9AD 1 0
2800 [GNUPG:] USERID_HINT CD9C88BB610BD9AD Bill Wohler <wohler@@stop.mail-abuse.org>
2801 [GNUPG:] NEED_PASSPHRASE CD9C88BB610BD9AD CD9C88BB610BD9AD 1 0
2802 [GNUPG:] BAD_PASSPHRASE CD9C88BB610BD9AD
2803 gpg: encrypted with 1024-bit RSA key, ID 610BD9AD, created 1997-09-09
2804       "Bill Wohler <wohler@@stop.mail-abuse.org>"
2805 gpg: public key decryption failed: bad passphrase
2806 [GNUPG:] BEGIN_DECRYPTION
2807 [GNUPG:] DECRYPTION_FAILED
2808 gpg: decryption failed: secret key not available
2809 [GNUPG:] END_DECRYPTION
2811 gpg exited abnormally: '2'
2812 @end smallexample
2814 @vindex mh-show-pgg-bad
2815 @vindex mh-show-pgg-good
2816 @vindex mh-show-pgg-unknown
2818 The appearance of the buttons is controlled by the faces
2819 @code{mh-show-pgg-good}, @code{mh-show-pgg-bad}, and
2820 @code{mh-show-pgg-unknown} depending on the validity of the signature.
2821 The latter is used whether the signature is unknown or untrusted.
2823 @cindex @samp{pgg} customization group
2824 @cindex PGG
2825 @cindex customization group, @samp{pgg}
2827 The @samp{pgg} customization group may have some settings which may
2828 interest you.
2829 @iftex
2830 See @cite{The PGG Manual}.
2831 @end iftex
2832 @ifinfo
2833 @xref{Top, , The PGG Manual, pgg, The PGG Manual}.
2834 @end ifinfo
2835 @ifhtml
2837 @uref{http://www.gnu.org/software/emacs/manual/pgg.html,
2838 @cite{The PGG Manual}}.
2839 @end ifhtml
2841 @node Printing, Files and Pipes, Reading PGP, Reading Mail
2842 @section Printing Your Mail
2844 @cindex printing
2845 @findex mh-ps-print-msg
2846 @findex mh-ps-print-msg-file
2847 @kindex P f
2848 @kindex P p
2849 @vindex mh-lpr-command-format
2850 @vindex mh-print-background-flag
2852 To print messages in MH-E, use the command @kbd{P p}
2853 (@code{mh-ps-print-msg}). You can print all the messages in a range
2854 (as in @kbd{C-u P p 1 3 5-7 last:5 frombob @key{RET}},
2855 @pxref{Ranges}). You can also send the output to a file with @kbd{P f}
2856 (@code{mh-ps-print-msg-file}). This command will print inline text
2857 attachments but will not decrypt messages. However, when a message is
2858 displayed in an MH-Show buffer, then that buffer is used verbatim for
2859 printing with the caveat that only text attachments, if opened inline,
2860 are printed. Therefore, encrypted messages can be printed by showing
2861 and decrypting them first. The commands @kbd{P p} and @kbd{P f} do not
2862 use the options @code{mh-lpr-command-format} or
2863 @code{mh-print-background-flag}, described below.
2865 @findex mh-ps-print-toggle-color
2866 @kindex P C
2867 @vindex ps-print-color-p
2869 Colors are emulated on black-and-white printers with shades of gray.
2870 This might produce illegible output, even if your screen colors only
2871 use shades of gray. If this is the case, try using the command @kbd{P
2872 C} (@code{mh-ps-print-toggle-color}) to toggle between color, no
2873 color, and a black and white representation of the colors and see
2874 which works best. You change this setting permanently by customizing
2875 the option @code{ps-print-color-p}.
2877 @findex mh-ps-print-toggle-faces
2878 @kindex P F
2880 Another related function is the command @kbd{P F}
2881 (@code{mh-ps-print-toggle-faces}). This command toggles between using
2882 faces and not. When faces are enabled, the printed message will look
2883 very similar to the message in the MH-Show buffer.
2885 @cindex ps-print package
2886 @cindex Emacs, packages, ps-print
2888 MH-E uses the @samp{ps-print} package to do the printing, so you can
2889 customize the printing further by going to the @samp{ps-print}
2890 customization group.
2892 @cindex @command{lpr}
2893 @cindex @command{mhl}
2894 @cindex MH commands, @command{mhl}
2895 @cindex Unix commands, @command{lpr}
2896 @findex mh-print-msg
2897 @kindex P l
2899 An alternative to using the @samp{ps-print} package is the command
2900 @kbd{P l} (@code{mh-print-msg}) (the @i{l} is for @i{l}ine printer or
2901 @i{l}pr). You can print all the messages in a range. The message is
2902 formatted with @command{mhl}@footnote{See the section
2903 @uref{@value{MH-BOOK-HOME}/shomes.html#Usisho, Using mhl} in the MH
2904 book.} and printed with the @command{lpr} command.
2906 @kindex P f
2907 @kindex P l
2908 @kindex P p
2909 @vindex mh-lpr-command-format
2910 @vindex mh-print-background-flag
2912 The command @kbd{P l} uses two options. The option
2913 @code{mh-lpr-command-format} contains the Unix command line which
2914 performs the actual printing. The string can contain one escape,
2915 @samp{%s}, which is replaced by the name of the folder and the message
2916 number and is useful for print job names. The default setting is
2917 @code{"lpr -J '%s'"}. I use @code{"mpage -h'%s' -b Letter -H1of -mlrtb
2918 -P"} which produces a nice header and adds a bit of margin so the text
2919 fits within my printer's margins. Normally messages are printed in the
2920 foreground. If this is slow on your system, you may elect to turn on
2921 the option @code{mh-print-background-flag} to print in the background.
2922 If you do this, do not delete the message until it is printed or else
2923 the output may be truncated. These options are not used by the
2924 commands @kbd{P p} or @kbd{P f}.
2926 @node Files and Pipes, Navigating, Printing, Reading Mail
2927 @section Files and Pipes
2929 @cindex files
2930 @cindex pipes
2931 @findex mh-refile-or-write-again
2932 @findex mh-write-msg-to-file
2933 @kindex >
2934 @kindex !
2936 MH-E does offer a couple of commands that are not a part of MH@. The
2937 first one, @kbd{>} (@code{mh-write-msg-to-file}), writes a message to
2938 a file. You are prompted for the filename. If the file already exists,
2939 the message is appended to it. You can also write the message to the
2940 file without the header by specifying a prefix argument (such as
2941 @kbd{C-u > /tmp/foobar @key{RET}}). Subsequent writes to the same file
2942 can be made with the command @kbd{!}
2943 (@code{mh-refile-or-write-again}).
2945 @findex mh-pipe-msg
2946 @kindex |
2947 @kindex l
2949 You can also pipe the message through a Unix shell command with the
2950 command @kbd{|} (@code{mh-pipe-msg}). You are prompted for the Unix
2951 command through which you wish to run your message. If you give a
2952 prefix argument to this command, the message header is included in the
2953 text passed to the command (the contrived example @kbd{C-u | lpr}
2954 would be done with the @kbd{l} command instead).
2956 @cindex @command{shar}
2957 @cindex @command{uuencode}
2958 @cindex Unix commands, @command{shar}
2959 @cindex Unix commands, @command{uuencode}
2960 @findex mh-store-msg
2961 @kindex X s
2962 @vindex mh-store-default-directory
2964 If the message is a shell archive @command{shar} or has been run
2965 through @command{uuencode} use @kbd{X s} (@code{mh-store-msg}) to
2966 extract the body of the message. The default directory for extraction
2967 is the current directory; however, you have a chance to specify a
2968 different extraction directory. The next time you use this command,
2969 the default directory is the last directory you used. If you would
2970 like to change the initial default directory, customize the option
2971 @code{mh-store-default-directory}, change the value from
2972 @samp{Current} to @samp{Directory}, and then enter the name of the
2973 directory for storing the content of these messages.
2975 @findex mh-store-buffer
2976 @kindex @key{RET}
2977 @kindex X s
2979 By the way, @kbd{X s} calls the Emacs Lisp function
2980 @code{mh-store-buffer}. I mention this because you can use it directly
2981 if you're editing a buffer that contains a file that has been run
2982 through @command{uuencode} or @command{shar}. For example, you can
2983 extract the contents of the current buffer in your home directory by
2984 typing @kbd{M-x mh-store-buffer @key{RET} ~ @key{RET}}.
2986 @node Navigating, Miscellaneous Commands and Options, Files and Pipes, Reading Mail
2987 @section Navigating
2989 @cindex moving between messages
2990 @cindex navigation
2991 @findex mh-first-msg
2992 @findex mh-goto-msg
2993 @findex mh-last-msg
2994 @findex mh-next-undeleted-msg
2995 @findex mh-next-unread-msg
2996 @findex mh-previous-undeleted-msg
2997 @findex mh-previous-unread-msg
2998 @kindex g
2999 @kindex M-<
3000 @kindex M->
3001 @kindex M-n
3002 @kindex M-p
3003 @kindex n
3004 @kindex p
3006 To move on to the next message, use the command @kbd{n}
3007 (@code{mh-next-undeleted-msg}); use @kbd{p}
3008 (@code{mh-previous-undeleted-msg}) to read the previous message. To
3009 move to the next unread message, use @kbd{M-n}
3010 (@code{mh-next-unread-msg}); use @kbd{M-p}
3011 (@code{mh-previous-unread-msg}) to move to the previous unread
3012 message. These commands can be given a prefix argument to specify how
3013 many messages to skip (for example, @kbd{5 n}). You can also move to a
3014 specific message with @kbd{g} (@code{mh-goto-msg}). You can enter the
3015 message number either before or after typing @kbd{g}. In the latter
3016 case, Emacs prompts you. Finally, you can go to the first or last
3017 message with @kbd{M-<} (@code{mh-first-msg}) and @kbd{M->}
3018 (@code{mh-last-msg}) respectively.
3020 @cindex MH-Folder mode
3021 @cindex modes, MH-Folder
3022 @findex next-line
3023 @findex previous-line
3024 @kindex C-n
3025 @kindex C-p
3026 @kindex @key{RET}
3028 You can also use the Emacs commands @kbd{C-p} (@code{previous-line})
3029 and @kbd{C-n} (@code{next-line}) to move up and down the scan lines in
3030 the MH-Folder window. These commands can be used in conjunction with
3031 @key{RET} to look at deleted or refiled messages.
3033 @cindex deleting messages
3034 @findex mh-delete-msg
3035 @kindex d
3036 @kindex n
3037 @kindex p
3039 To mark a message for deletion, use the command @kbd{d}
3040 (@code{mh-delete-msg}). A @samp{D} is placed by the message in the
3041 scan window, and the next undeleted message is displayed. If the
3042 previous command had been @kbd{p}, then the next message displayed is
3043 the first undeleted message previous to the message just deleted. Use
3044 @kbd{n} to force subsequent @kbd{d} commands to move forward to the
3045 next undeleted message after deleting the message under the cursor.
3046 You may also specify a range (for example, @kbd{C-u d 1 3 5-7 last:5
3047 frombob @key{RET}}, @pxref{Ranges}).
3049 @findex mh-delete-msg-no-motion
3050 @kindex C-d
3052 The command @kbd{C-d} (@code{mh-delete-msg-no-motion}) marks the
3053 message (or messages in range) for deletion but leaves the cursor at
3054 the current message in case you wish to perform other operations on
3055 the message.
3057 @findex mh-delete-subject
3058 @findex mh-delete-subject-or-thread
3059 @findex mh-thread-delete
3060 @findex mh-undo
3061 @kindex k
3062 @kindex T d
3063 @kindex u
3065 And to delete more messages faster, you can use @kbd{k}
3066 (@code{mh-delete-subject-or-thread}) to delete all the messages with
3067 the same subject as the current message. This command puts these
3068 messages in a sequence named @samp{subject}. You can undo this action
3069 by using @kbd{u} (@code{mh-undo}) with a prefix argument and then
3070 specifying the @samp{subject} sequence. However, if the buffer is
3071 displaying a threaded view of the folder then @kbd{k} behaves like
3072 @kbd{T d} (@code{mh-thread-delete}). @xref{Threading}.
3074 @findex mh-execute-commands
3075 @kindex x
3077 However you mark a message for deletion, the command @kbd{x}
3078 (@code{mh-execute-commands}) actually carries out the deletion
3079 (@pxref{Folders}).
3081 @vindex mh-delete-msg-hook
3083 The hook @code{mh-delete-msg-hook} is called after you mark a message
3084 for deletion. For example, a past maintainer of MH-E used this once
3085 when he kept statistics on his mail usage.
3087 @node Miscellaneous Commands and Options,  , Navigating, Reading Mail
3088 @section Miscellaneous Commands and Options
3090 This section contains a few more miscellaneous commands and options.
3092 @cindex editing message
3093 @findex mh-modify
3094 @kindex M
3096 There are times when you need to edit a message. For example, you may
3097 need to fix a broken Content-Type header field. You can do this with
3098 the command @kbd{M} (@code{mh-modify}). It displays the raw message in
3099 an editable buffer. When you are done editing, save and kill the
3100 buffer as you would any other.
3102 @findex mh-kill-folder
3103 @findex mh-pack-folder
3104 @vindex mh-do-not-confirm-flag
3106 Commands such as @code{mh-pack-folder} prompt to confirm whether to
3107 process outstanding moves and deletes or not before continuing.
3108 Turning on the option @code{mh-do-not-confirm-flag} means that these
3109 actions will be performed---which is usually desired but cannot be
3110 retracted---without question@footnote{In previous versions of MH-E,
3111 this option suppressed the confirmation in @code{mh-kill-folder}.
3112 Since this kept most users from setting this option,
3113 @code{mh-kill-folder} was modified in version 6.0 to always ask for
3114 confirmation subject to @code{mh-kill-folder-suppress-prompt-hook}.
3115 @xref{Folders}.}.
3117 @cindex MH-Folder mode
3118 @cindex modes, MH-Folder
3119 @vindex mh-summary-height
3121 The option @code{mh-summary-height} controls the number of scan lines
3122 displayed in the MH-Folder window, including the mode line. The
3123 default value of this option is @samp{Automatic} which means that the
3124 MH-Folder buffer will maintain the same proportional size if the frame
3125 is resized. If you'd prefer a fixed height, then choose the
3126 @samp{Fixed Size} option and enter the number of lines you'd like to
3127 see.
3129 @vindex mh-bury-show-buffer-flag
3131 Normally the buffer for displaying messages is buried at the bottom at
3132 the buffer stack. You may wish to disable this feature by turning off
3133 the option @code{mh-bury-show-buffer-flag}. One advantage of not
3134 burying the show buffer is that one can delete the show buffer more
3135 easily in an electric buffer list because of its proximity to its
3136 associated MH-Folder buffer. Try running @kbd{M-x
3137 electric-buffer-list} to see what I mean.
3139 @cindex @file{.emacs}
3140 @cindex files, @file{.emacs}
3141 @cindex reading mail
3143 Before we leave this section, I'll include a function that I use as a
3144 front end to MH-E@footnote{Stephen Gildea's favorite binding is
3145 @kbd{(global-set-key "\C-cr" 'mh-rmail)}.}. It toggles between your
3146 working window configuration, which may be quite involved---windows
3147 filled with source, compilation output, man pages, and other
3148 documentation---and your MH-E window configuration. Like the rest of
3149 the customization described in this section, simply add the following
3150 code to @file{~/.emacs}.
3152 @iftex
3153 @filbreak
3154 @end iftex
3156 @findex mh-rmail, example
3158 @smalllisp
3159 @group
3160 (defvar my-mh-screen-saved nil
3161   "Set to non-@code{nil} when MH-E window configuration shown.")
3162 (defvar my-normal-screen nil "Normal window configuration.")
3163 (defvar my-mh-screen nil "MH-E window configuration.")
3165 (defun my-mh-rmail (&optional arg)
3166   "Toggle between MH-E and normal screen configurations.
3167 With non-@code{nil} or prefix argument, @i{inc} mailbox as well
3168 when going into mail."
3169   (interactive "P")                 ; @r{user callable function, P=prefix arg}
3170   (setq my-mh-screen-saved          ; @r{save state}
3171         (cond
3172          ;; @r{Bring up MH-E screen if arg or normal window configuration.}
3173          ;; @r{If arg or +inbox buffer doesn't exist, run mh-rmail.}
3174          ((or arg (null my-mh-screen-saved))
3175           (setq my-normal-screen (current-window-configuration))
3176           (if (or arg (null (get-buffer "+inbox")))
3177               (mh-rmail)
3178             (set-window-configuration my-mh-screen))
3179           t)                        ; @r{set my-mh-screen-saved to @code{t}}
3180          ;; @r{Otherwise, save MH-E screen and restore normal screen.}
3181          (t
3182           (setq my-mh-screen (current-window-configuration))
3183           (set-window-configuration my-normal-screen)
3184           nil))))                   ; @r{set my-mh-screen-saved to nil}
3186 (global-set-key "\C-x\r" 'my-mh-rmail)  ;@r{ call with C-x @key{RET}}
3188 @i{Starting MH-E}
3190 @end group
3191 @end smalllisp
3193 If you type an argument (@kbd{C-u}) or if @code{my-mh-screen-saved} is
3194 @code{nil} (meaning a non-MH-E window configuration), the current
3195 window configuration is saved, either the @samp{+inbox} buffer is
3196 displayed or @code{mh-rmail} is run, and the MH-E window configuration
3197 is shown. Otherwise, the MH-E window configuration is saved and the
3198 original configuration is displayed.
3200 @node Folders, Sending Mail, Reading Mail, Top
3201 @chapter Organizing Your Mail with Folders
3203 @cindex @samp{Folder} menu
3204 @cindex @samp{Message} menu
3205 @cindex folders
3206 @cindex menu, @samp{Folder}
3207 @cindex menu, @samp{Message}
3208 @cindex using folders
3210 This chapter discusses the things you can do with folders within MH-E@.
3211 The commands in this chapter are also found in the @samp{Folder} and
3212 @samp{Message} menus.
3214 @table @kbd
3215 @kindex ?
3216 @findex mh-help
3217 @item ?
3218 Display cheat sheet for the MH-E commands (@code{mh-help}).
3219 @c -------------------------
3220 @kindex !
3221 @findex mh-refile-or-write-again
3222 @item !
3223 Repeat last output command (@code{mh-refile-or-write-again}).
3224 @c -------------------------
3225 @cindex @samp{Message > Copy Message to Folder...} menu item
3226 @cindex menu item, @samp{Message > Copy Message to Folder...}
3227 @kindex c
3228 @findex mh-copy-msg
3229 @item c
3230 Copy range to folder (@code{mh-copy-msg}).
3231 @c -------------------------
3232 @kindex F ?
3233 @findex mh-prefix-help
3234 @item F ?
3235 Display cheat sheet for the commands of the current prefix in
3236 minibuffer (@code{mh-prefix-help}).
3237 @c -------------------------
3238 @kindex F '
3239 @findex mh-index-ticked-messages
3240 @item F '
3241 Display ticked messages (@code{mh-index-ticked-messages}).
3242 @c -------------------------
3243 @kindex F c
3244 @findex mh-catchup
3245 @item F c
3246 Delete range from the @samp{unseen} sequence (@code{mh-catchup}).
3247 @c -------------------------
3248 @kindex F k
3249 @findex mh-kill-folder
3250 @item F k
3251 Remove folder (@code{mh-kill-folder}).
3252 @c -------------------------
3253 @cindex @samp{Folder > List Folders} menu item
3254 @cindex menu item, @samp{Folder > List Folders}
3255 @kindex F l
3256 @findex mh-list-folders
3257 @item F l
3258 List all folders (@code{mh-list-folders}).
3259 @c -------------------------
3260 @cindex @samp{Folder > View New Messages} menu item
3261 @cindex menu item, @samp{Folder > View New Messages}
3262 @kindex F n
3263 @findex mh-index-new-messages
3264 @item F n
3265 Display unseen messages (@code{mh-index-new-messages}).
3266 @c -------------------------
3267 @cindex @samp{Folder > Pack Folder} menu item
3268 @cindex menu item, @samp{Folder > Pack Folder}
3269 @kindex F p
3270 @findex mh-pack-folder
3271 @item F p
3272 Pack folder (@code{mh-pack-folder}).
3273 @c -------------------------
3274 @kindex F q
3275 @findex mh-index-sequenced-messages
3276 @item F q
3277 Display messages in any sequence (@code{mh-index-sequenced-messages}).
3278 @c -------------------------
3279 @cindex @samp{Folder > Rescan Folder} menu item
3280 @cindex menu item, @samp{Folder > Rescan Folder}
3281 @kindex F r
3282 @findex mh-rescan-folder
3283 @item F r
3284 Rescan folder (@code{mh-rescan-folder}).
3285 @c -------------------------
3286 @cindex @samp{Folder > Search...} menu item
3287 @cindex menu item, @samp{Folder > Search...}
3288 @kindex F s
3289 @findex mh-search
3290 @item F s
3291 Search your MH mail (@code{mh-search}).
3292 @c -------------------------
3293 @cindex @samp{Folder > Sort Folder} menu item
3294 @cindex menu item, @samp{Folder > Sort Folder}
3295 @kindex F S
3296 @findex mh-sort-folder
3297 @item F S
3298 Sort folder (@code{mh-sort-folder}).
3299 @c -------------------------
3300 @kindex F u
3301 @findex mh-undo-folder
3302 @item F u
3303 Undo all refiles and deletes in the current folder (@code{mh-undo-folder}).
3304 @c -------------------------
3305 @cindex @samp{Folder > Visit a Folder...} menu item
3306 @cindex menu item, @samp{Folder > Visit a Folder...}
3307 @kindex F v
3308 @findex mh-visit-folder
3309 @item F v
3310 Visit folder (@code{mh-visit-folder}).
3311 @c -------------------------
3312 @cindex @samp{Message > Refile Message} menu item
3313 @cindex menu item, @samp{Message > Refile Message}
3314 @kindex o
3315 @findex mh-refile-msg
3316 @item o
3317 Refile (output) range into folder (@code{mh-refile-msg}).
3318 @c -------------------------
3319 @cindex @samp{Folder > Quit MH-E} menu item
3320 @cindex menu item, @samp{Folder > Quit MH-E}
3321 @kindex q
3322 @findex mh-quit
3323 @item q
3324 Quit the current MH-E folder (@code{mh-quit}).
3325 @c -------------------------
3326 @cindex @samp{Folder > Toggle Show/Folder} menu item
3327 @cindex menu item, @samp{Folder > Toggle Show/Folder}
3328 @kindex t
3329 @findex mh-toggle-showing
3330 @item t
3331 Toggle between MH-Folder and MH-Folder Show modes
3332 (@code{mh-toggle-showing}).
3333 @c -------------------------
3334 @cindex @samp{Message > Undo Delete/Refile} menu item
3335 @cindex menu item, @samp{Message > Undo Delete/Refile}
3336 @kindex u
3337 @findex mh-undo
3338 @item u
3339 Undo pending deletes or refiles in range (@code{mh-undo}).
3340 @c -------------------------
3341 @cindex @samp{Message > Execute Delete/Refile} menu item
3342 @cindex menu item, @samp{Message > Execute Delete/Refile}
3343 @kindex x
3344 @findex mh-execute-commands
3345 @item x
3346 Process outstanding delete and refile requests
3347 (@code{mh-execute-commands}).
3348 @end table
3350 @cindex @samp{mh-folder} customization group
3351 @cindex customization group, @samp{mh-folder}
3353 The @samp{mh-folder} customization group is used to tune these
3354 commands.
3356 @vtable @code
3357 @item mh-new-messages-folders
3358 Folders searched for the @samp{unseen} sequence (default:
3359 @code{Inbox}).
3360 @c -------------------------
3361 @item mh-ticked-messages-folders
3362 Folders searched for @code{mh-tick-seq} (default: @code{t}).
3363 @c -------------------------
3364 @item mh-large-folder
3365 The number of messages that indicates a large folder (default: 200).
3366 @c -------------------------
3367 @item mh-recenter-summary-flag
3368 On means to recenter the summary window (default: @samp{off}).
3369 @c -------------------------
3370 @item mh-recursive-folders-flag
3371 On means that commands which operate on folders do so recursively
3372 (default: @samp{off}).
3373 @c -------------------------
3374 @item mh-sortm-args
3375 Additional arguments for @command{sortm} (default: @code{nil}).
3376 @end vtable
3378 The following hooks are available.
3380 @vtable @code
3381 @item mh-after-commands-processed-hook
3382 Hook run by @kbd{x} after performing outstanding refile and delete
3383 requests (default: @code{nil}).
3384 @c -------------------------
3385 @item mh-before-commands-processed-hook
3386 Hook run by @kbd{x} before performing outstanding refile and delete
3387 requests (default: @code{nil}).
3388 @c -------------------------
3389 @item mh-before-quit-hook
3390 Hook run by q before quitting MH-E (default: @code{nil}).
3391 @c -------------------------
3392 @item mh-folder-mode-hook
3393 Hook run by @code{mh-folder-mode} when visiting a new folder (default:
3394 @code{nil}).
3395 @c -------------------------
3396 @item mh-kill-folder-suppress-prompt-hook
3397 Abnormal hook run at the beginning of @code{mh-kill-folder} (default:
3398 @code{'mh-search-p}).
3399 @c -------------------------
3400 @item mh-pack-folder-hook
3401 Hook run by @code{mh-pack-folder} after renumbering the messages
3402 (default: @code{nil}).
3403 @c -------------------------
3404 @item mh-quit-hook
3405 Hook run by q after quitting MH-E (default: @code{nil}).
3406 @c -------------------------
3407 @item mh-refile-msg-hook
3408 Hook run by o after marking each message for refiling (default:
3409 @code{nil}).
3410 @end vtable
3412 The following faces are available for customizing the appearance of
3413 the MH-Folder buffer. @xref{Scan Line Formats}.
3415 @vtable @code
3416 @item mh-folder-address
3417 Recipient face.
3418 @c -------------------------
3419 @item mh-folder-body
3420 Body text face.
3421 @c -------------------------
3422 @item mh-folder-cur-msg-number
3423 Current message number face.
3424 @c -------------------------
3425 @item mh-folder-date
3426 Date face.
3427 @c -------------------------
3428 @item mh-folder-deleted
3429 Deleted message face.
3430 @c -------------------------
3431 @item mh-folder-followup
3432 @samp{Re:} face.
3433 @c -------------------------
3434 @item mh-folder-msg-number
3435 Message number face.
3436 @c -------------------------
3437 @item mh-folder-refiled
3438 Refiled message face.
3439 @c -------------------------
3440 @vindex mh-scan-format-nmh
3441 @vindex mh-scan-sent-to-me-sender-regexp
3442 @item mh-folder-sent-to-me-hint
3443 Fontification hint face in messages sent directly to us. The detection
3444 of messages sent to us is governed by the scan format
3445 @code{mh-scan-format-nmh} and regular expression
3446 @code{mh-scan-sent-to-me-sender-regexp}.
3447 @c -------------------------
3448 @vindex mh-scan-format-nmh
3449 @vindex mh-scan-sent-to-me-sender-regexp
3450 @item mh-folder-scan-format
3451 Sender face in messages sent directly to us. The detection of messages
3452 sent to us is governed by the scan format @code{mh-scan-format-nmh}
3453 and regular expression @code{mh-scan-sent-to-me-sender-regexp}.
3454 @c -------------------------
3455 @item mh-folder-subject
3456 Subject face.
3457 @c -------------------------
3458 @item mh-folder-tick
3459 Ticked message face.
3460 @c -------------------------
3461 @item mh-folder-to
3462 @samp{To:} face.
3463 @end vtable
3465 @vindex mh-folder-mode-hook
3467 The hook @code{mh-folder-mode-hook} is called when visiting a new
3468 folder in MH-Folder mode. This could be used to set your own key
3469 bindings, for example:
3471 @vindex mh-folder-mode-hook, example
3473 @smalllisp
3474 @group
3475 (defvar my-mh-init-done nil
3476   "Non-@code{nil} when one-time MH-E settings made.")
3478 (defun my-mh-folder-mode-hook ()
3479   "Hook to set key bindings in MH-Folder mode."
3480   (if (not my-mh-init-done)             ; @r{only need to bind the keys once }
3481       (progn
3482         (local-set-key "//" 'my-search-msg)
3483         (local-set-key "b" 'mh-burst-digest)    ; @r{better use of @kbd{b}}
3484         (setq my-mh-init-done t))))
3486 (add-hook 'mh-folder-mode-hook 'my-mh-folder-mode-hook)
3488 (defun my-search-msg ()
3489   "Search for a regexp in the current message."
3490   (interactive)                         ; @r{user function}
3491   (save-window-excursion
3492     (other-window 1)                    ; @r{go to next window}
3493     (isearch-forward-regexp)))          ; @r{string search; hit return}
3494                                         ; @r{  when done}
3496 @i{Create additional key bindings via mh-folder-mode-hook}
3498 @end group
3499 @end smalllisp
3501 @cindex @command{folder}
3502 @cindex @command{refile}
3503 @cindex MH commands, @command{folder}
3504 @cindex MH commands, @command{refile}
3505 @findex mh-refile-msg
3506 @kindex o
3507 @vindex mh-refile-msg-hook
3509 MH-E has analogies for each of the MH @command{folder} and
3510 @command{refile} commands@footnote{See the sections
3511 @uref{@value{MH-BOOK-HOME}/fol.html#Youfol, Your Current Folder:
3512 folder} and @uref{@value{MH-BOOK-HOME}/fol.html#Movref, Moving and
3513 Linking Messages: refile} in the MH book.}. To refile a message in
3514 another folder, use the command @kbd{o} (@code{mh-refile-msg})
3515 (mnemonic: ``output''). You are prompted for the folder name
3516 (@pxref{Folder Selection}). Note that this command can also be used to
3517 create folders. If you specify a folder that does not exist, you will
3518 be prompted to create it. The hook @code{mh-refile-msg-hook} is called
3519 after a message is marked to be refiled.
3521 @findex mh-write-msg-to-file
3522 @kindex !
3524 If you are refiling several messages into the same folder, you can use
3525 the command @kbd{!} (@code{mh-refile-or-write-again}) to repeat the
3526 last refile or write (for the description of @kbd{>}
3527 (@code{mh-write-msg-to-file}), @pxref{Files and Pipes}). You can use a
3528 range in either case (for example, @kbd{C-u o 1 3 5-7 last:5 frombob
3529 @key{RET}}, @pxref{Ranges}).
3531 @cindex expunging refiles and deletes
3532 @cindex undoing refiles and deletes
3533 @findex mh-undo
3534 @kindex u
3536 If you've deleted a message or refiled it, but changed your mind, you
3537 can cancel the action before you've executed it. Use @kbd{u}
3538 (@code{mh-undo}) to undo a refile on or deletion of a single message.
3539 You can also undo refiles and deletes for messages that are found in a
3540 given range (@pxref{Ranges}).
3542 @findex mh-undo-folder
3543 @kindex F u
3545 Alternatively, you can use @kbd{F u} (@code{mh-undo-folder}) to undo
3546 all refiles and deletes in the current folder.
3548 @findex mh-execute-commands
3549 @kindex x
3551 If you've marked messages to be deleted or refiled and you want to go
3552 ahead and delete or refile the messages, use @kbd{x}
3553 (@code{mh-execute-commands}). Many MH-E commands that may affect the
3554 numbering of the messages (such as @kbd{F r} or @kbd{F p}) will ask if
3555 you want to process refiles or deletes first and then either run
3556 @kbd{x} for you or undo the pending refiles and deletes.
3558 @kindex x
3559 @vindex mh-after-commands-processed-hook
3560 @vindex mh-before-commands-processed-hook
3561 @vindex mh-current-folder
3563 The command @kbd{x} runs @code{mh-before-commands-processed-hook}
3564 before the commands are processed and
3565 @code{mh-after-commands-processed-hook} after the commands are
3566 processed. Variables that are useful with the former hook include
3567 @code{mh-delete-list} and @code{mh-refile-list} which can be used to
3568 see which changes will be made to the current folder,
3569 @code{mh-current-folder}. Variables that are useful with the latter
3570 hook include @code{mh-folders-changed}, which lists which folders were
3571 affected by deletes and refiles. This list will always include the
3572 current folder @code{mh-current-folder}.
3574 @findex mh-copy-msg
3575 @kindex c
3576 @kindex o
3578 If you wish to copy a message to another folder, you can use the
3579 command @kbd{c} (@code{mh-copy-msg}) (see the @option{-link} argument
3580 to @command{refile}(1)). Like the command @kbd{o}, this command
3581 prompts you for the name of the target folder and you can specify a
3582 range (@pxref{Ranges}). Note that unlike the command @kbd{o}, the copy
3583 takes place immediately. The original copy remains in the current
3584 folder.
3586 @cindex junk mail
3587 @cindex MH-Folder mode
3588 @cindex MH-Folder Show mode
3589 @cindex modes, MH-Folder
3590 @cindex modes, MH-Folder Show
3591 @cindex spam
3592 @findex mh-toggle-showing
3593 @kindex t
3595 The command @kbd{t} (@code{mh-toggle-showing}) switches between
3596 MH-Folder mode and MH-Folder Show mode@footnote{For you Emacs wizards,
3597 this is implemented as an Emacs minor mode.}. MH-Folder mode turns off
3598 the associated show buffer so that you can perform operations on the
3599 messages quickly without reading them. This is an excellent way to
3600 prune out your junk mail or to refile a group of messages to another
3601 folder for later examination.
3603 @cindex MH-Folder mode
3604 @cindex MH-Show mode
3605 @cindex modes, MH-Folder
3606 @cindex modes, MH-Show
3607 @cindex moving between messages
3608 @kindex t
3609 @vindex mh-recenter-summary-flag
3611 When you use @kbd{t} to toggle from MH-Folder Show mode to MH-Folder
3612 mode, the MH-Show buffer is hidden and the MH-Folder buffer is left
3613 alone. Setting @code{mh-recenter-summary-flag} to a non-@code{nil}
3614 value causes the toggle to display as many scan lines as possible,
3615 with the cursor at the middle. The effect of
3616 @code{mh-recenter-summary-flag} is rather useful, but it can be
3617 annoying on a slow network connection.
3619 @findex mh-visit-folder
3620 @kindex F v
3621 @vindex mh-large-folder
3623 When you want to read the messages that you have refiled into folders,
3624 use the command @kbd{F v} (@code{mh-visit-folder}) to visit the
3625 folder. You are prompted for the folder name. The folder buffer will
3626 show just unseen messages if there are any; otherwise, it will show
3627 all the messages in the buffer as long there are fewer than
3628 @code{mh-large-folder} messages. If there are more, then you are
3629 prompted for a range of messages to scan. You can provide a prefix
3630 argument in order to specify a range of messages to show when you
3631 visit the folder (@pxref{Ranges}). In this case, regions are not used
3632 to specify the range and @code{mh-large-folder} is ignored. Note that
3633 this command can also be used to create folders. If you specify a
3634 folder that does not exist, you will be prompted to create it.
3636 @findex mh-search
3637 @kindex F s
3639 If you forget where you've refiled your messages, you can find them
3640 using @kbd{F s} (@code{mh-search}). @xref{Searching}.
3642 @cindex @command{procmail}
3643 @cindex @samp{unseen} sequence
3644 @cindex sequence, @samp{unseen}
3645 @cindex Unix commands, @command{procmail}
3646 @cindex unseen messages, viewing
3647 @findex mh-index-new-messages
3648 @kindex F n
3649 @vindex mh-new-messages-folders
3651 If you use a program such as @command{procmail} to file your incoming
3652 mail automatically, you can display new, unseen, messages using the
3653 command @kbd{F n} (@code{mh-index-new-messages}). All messages in the
3654 @samp{unseen} sequence from the folders in
3655 @code{mh-new-messages-folders} are listed. However, this list of
3656 folders can be overridden with a prefix argument: with a prefix
3657 argument, enter a space-separated list of folders, or nothing to
3658 search all folders.
3660 @cindex @samp{tick} sequence
3661 @cindex sequence, @samp{tick}
3662 @cindex ticked messages, viewing
3663 @findex mh-index-ticked-messages
3664 @kindex F '
3665 @vindex mh-ticked-messages-folders
3667 If you have ticked messages (@pxref{Sequences}), you can display them
3668 using the command @kbd{F '} (@code{mh-index-ticked-messages}). All
3669 messages in the @samp{tick} sequence from the folders in
3670 @code{mh-ticked-messages-folders} are listed. With a prefix argument,
3671 enter a space-separated list of folders, or nothing to search all
3672 folders.
3674 @findex mh-index-sequenced-messages
3675 @kindex F q
3676 @vindex mh-new-messages-folders
3678 You can display messages in any sequence with the command @kbd{F q}
3679 (@code{mh-index-sequenced-messages}). All messages from the folders in
3680 @code{mh-new-messages-folders} in the sequence you provide are listed.
3681 With a prefix argument, enter a space-separated list of folders at the
3682 prompt, or nothing to search all folders.
3684 @vindex mh-new-messages-folders
3685 @vindex mh-recursive-folders-flag
3686 @vindex mh-ticked-messages-folders
3688 Set the options @code{mh-new-messages-folders} and
3689 @code{mh-ticked-messages-folders} to @samp{Inbox} to search the
3690 @samp{+inbox} folder or @samp{All} to search all of the top level
3691 folders. Otherwise, list the folders that should be searched with the
3692 @samp{Choose Folders} menu item. See @code{mh-recursive-folders-flag}.
3694 @cindex buffers, @samp{*MH-E Folders*}
3695 @cindex @samp{*MH-E Folders*}
3696 @findex mh-kill-folder
3697 @findex mh-list-folders
3698 @findex mh-pack-folder
3699 @findex mh-rescan-folder
3700 @findex mh-sort-folder
3701 @kindex F k
3702 @kindex F l
3703 @kindex F p
3704 @kindex F r
3705 @kindex F S
3707 Other commands you can perform on folders include: @kbd{F l}
3708 (@code{mh-list-folders}), to place a listing of all the folders in
3709 your mail directory in a buffer called @samp{*MH-E Folders*}
3710 (@pxref{Miscellaneous}); @kbd{F k} (@code{mh-kill-folder}), to remove
3711 a folder; @kbd{F S} (@code{mh-sort-folder}), to sort the messages by
3712 date (see @command{sortm}(1) to see how to sort by other criteria);
3713 @kbd{F p} (@code{mh-pack-folder}), to pack a folder, removing gaps
3714 from the numbering sequence; and @kbd{F r} (@code{mh-rescan-folder}),
3715 to rescan the folder, which is useful to grab all messages in your
3716 @samp{+inbox} after processing your new mail for the first time. If
3717 you don't want to rescan the entire folder, the commands @kbd{F r} or
3718 @kbd{F p} will accept a range (@pxref{Ranges}).
3720 @kindex F p
3721 @vindex mh-pack-folder-hook
3723 The command @kbd{F p} runs @code{mh-pack-folder-hook} after
3724 renumbering the messages. A variable that is useful with this hook
3725 is @code{mh-current-folder}.
3727 @kindex @key{TAB}
3728 @vindex mh-recursive-folders-flag
3730 By default, operations on folders work only one level at a time. Set
3731 @code{mh-recursive-folders-flag} to non-@code{nil} to operate on all
3732 folders. This mostly means that you'll be able to see all your folders
3733 when you press @key{TAB} when prompted for a folder name.
3735 @findex mh-search-p
3736 @kindex k
3737 @vindex mh-kill-folder-suppress-prompt-functions
3739 The hook @code{mh-kill-folder-suppress-prompt-functions} is an abnormal
3740 hook run at the beginning of the command @kbd{k}. The hook functions
3741 are called with no arguments and should return a non-nil value to
3742 suppress the normal prompt when you remove a folder. This is useful
3743 for folders that are easily regenerated. The default value of
3744 @code{mh-search-p} suppresses the prompt on folders generated by
3745 searching.
3747 @sp 1
3748 @center @strong{NOTE}
3750 @quotation
3751 Use this hook with care. If there is a bug in your hook which returns
3752 @code{t} on @samp{+inbox} and you press @kbd{k} by accident in the
3753 @code{+inbox} folder, you will not be happy.
3754 @end quotation
3755 @sp 1
3757 @cindex @command{sortm}
3758 @cindex @file{.mh_profile}
3759 @cindex files, @file{.mh_profile}
3760 @cindex MH commands, @command{sortm}
3761 @cindex MH profile component, @samp{sortm:}
3762 @cindex @samp{sortm:} MH profile component
3763 @kindex F S
3764 @vindex mh-sortm-args
3766 The option @code{mh-sortm-args} holds extra arguments to pass on to
3767 the command @command{sortm}@footnote{See the section
3768 @uref{@value{MH-BOOK-HOME}/sorsor.html, Sorting Messages: sortm} in the
3769 MH book.} when a prefix argument is used with @kbd{F S}. Normally
3770 default arguments to @command{sortm} are specified in the MH profile.
3771 This option may be used to provide an alternate view. For example,
3772 @samp{'(\"-nolimit\" \"-textfield\" \"subject\")} is a useful setting.
3774 @cindex exiting
3775 @cindex quitting
3776 @findex mh-quit
3777 @kindex q
3779 When you want to quit using MH-E and go back to editing, you can use
3780 the @kbd{q} (@code{mh-quit}) command. This buries the buffers of the
3781 current MH-E folder and restores the buffers that were present when
3782 you first ran @kbd{M-x mh-rmail}. It also removes any MH-E working
3783 buffers whose name begins with @samp{ *mh-} or @samp{*MH-E }
3784 (@pxref{Miscellaneous}). You can later restore your MH-E session by
3785 selecting the @samp{+inbox} buffer or by running @kbd{M-x mh-rmail}
3786 again.
3788 @findex mh-execute-commands
3789 @kindex q
3790 @vindex mh-before-quit-hook
3791 @vindex mh-before-quit-hook, example
3792 @vindex mh-quit-hook
3793 @vindex mh-quit-hook, example
3795 The two hooks @code{mh-before-quit-hook} and @code{mh-quit-hook} are
3796 called by @kbd{q}. The former one is called before the quit occurs, so
3797 you might use it to perform any MH-E operations; you could perform
3798 some query and abort the quit or call @code{mh-execute-commands}, for
3799 example. The latter is not run in an MH-E context, so you might use it
3800 to modify the window setup. If you find that @kbd{q} buries a lot of
3801 buffers that you would rather remove, you can use both
3802 @code{mh-before-quit-hook} and @code{mh-quit-hook} to accomplish that.
3804 @smalllisp
3805 @group
3806 (defvar my-mh-folder-buffer-to-delete nil
3807   "Folder buffer that is being quit.")
3809 (defun my-mh-before-quit-hook ()
3810   "Save folder buffer that is to be deleted."
3811   (setq my-mh-folder-buffer-to-delete (current-buffer)))
3813 (defun my-mh-quit-hook ()
3814   "Kill folder buffer rather than just bury it."
3815   (set-buffer my-mh-folder-buffer-to-delete)
3816   (if (get-buffer mh-show-buffer)
3817       (kill-buffer mh-show-buffer))
3818   (kill-buffer (current-buffer)))
3820 @i{Kill MH-Folder buffer instead of burying it}
3821 @end group
3822 @end smalllisp
3824 @cindex folders, renaming
3825 @cindex renaming folders
3826 @findex dired
3827 @findex dired-do-rename
3829 You can use dired to manipulate the folders themselves. For example, I
3830 renamed my @samp{+out} folder to the more common @samp{+outbox} by
3831 running dired on my mail directory (@kbd{M-x dired RET ~/Mail RET}),
3832 moving my cursor to @samp{out} and using the command @kbd{R}
3833 (@code{dired-do-rename}).
3835 @node Sending Mail, Editing Drafts, Folders, Top
3836 @chapter Sending Mail
3838 @cindex sending mail
3839 @findex mh-smail
3840 @kindex M-x mh-smail
3842 You can send a mail message in several ways. You can call @kbd{M-x
3843 mh-smail} directly, or from the command line like this:
3845 @cindex starting from command line
3847 @smallexample
3848 $ @kbd{emacs -f mh-smail}
3849 @end smallexample
3851 @findex goto-address-at-point
3852 @vindex mail-user-agent
3854 There are some commands that need to send a mail message, such as
3855 @code{goto-address-at-point}. You can configure Emacs to have these
3856 commands use MH-E by setting the option @code{mail-user-agent} to
3857 @samp{Emacs interface to MH}.
3859 @cindex @samp{Message} menu
3860 @cindex menu, @samp{Message}
3862 From within MH-E's MH-Folder mode, other methods of sending mail are
3863 available as well. These can also be found in the @samp{Message} menu.
3865 @table @kbd
3866 @cindex @samp{Message > Edit Message Again} menu item
3867 @cindex menu item, @samp{Message > Edit Message Again}
3868 @kindex e
3869 @findex mh-edit-again
3870 @item e
3871 Edit a message to send it again (@code{mh-edit-again}).
3872 @c -------------------------
3873 @cindex @samp{Message > Re-edit a Bounced Message} menu item
3874 @cindex menu item, @samp{Message > Re-edit a Bounced Message}
3875 @kindex E
3876 @findex mh-extract-rejected-mail
3877 @item E
3878 Edit a message that was returned by the mail system
3879 (@code{mh-extract-rejected-mail}).
3880 @c -------------------------
3881 @cindex @samp{Message > Forward Message...} menu item
3882 @cindex menu item, @samp{Message > Forward Message...}
3883 @kindex f
3884 @findex mh-forward
3885 @item f
3886 Forward message (@code{mh-forward}).
3887 @c -------------------------
3888 @cindex @samp{Message > Reply to Message...} menu item
3889 @cindex menu item, @samp{Message > Reply to Message...}
3890 @kindex r
3891 @findex mh-reply
3892 @item r
3893 Reply to a message (@code{mh-reply}).
3894 @c -------------------------
3895 @cindex @samp{Message > Compose a New Message} menu item
3896 @cindex menu item, @samp{Message > Compose a New Message}
3897 @kindex s
3898 @findex mh-send
3899 @item s
3900 Compose a message (@code{mh-send}).
3901 @c -------------------------
3902 @cindex @samp{Message > Redistribute Message...} menu item
3903 @cindex menu item, @samp{Message > Redistribute Message...}
3904 @kindex M-d
3905 @findex mh-redistribute
3906 @item M-d
3907 Redistribute a message (@code{mh-redistribute}).
3908 @c -------------------------
3909 @findex mh-smail
3910 @item M-x mh-smail
3911 Compose a message with the MH mail system.
3912 @c -------------------------
3913 @findex mh-smail-other-window
3914 @item M-x mh-smail-other-window
3915 Compose a message with the MH mail system in other window.
3916 @end table
3918 @cindex @samp{mh-sending-mail} customization group
3919 @cindex customization group, @samp{mh-sending-mail}
3921 In addition, several options from the @samp{mh-sending-mail}
3922 customization group are useful when sending mail or replying to mail.
3923 They are summarized in the following table.
3925 @vtable @code
3926 @item mh-compose-forward-as-mime-flag
3927 On means that messages are forwarded as attachments (default:
3928 @samp{on}).
3929 @c -------------------------
3930 @item mh-compose-letter-function
3931 Hook run when starting a new draft (default: @code{nil}).
3932 @c -------------------------
3933 @item mh-compose-prompt-flag
3934 On means prompt for header fields when composing a new draft (default:
3935 @samp{off}).
3936 @c -------------------------
3937 @item mh-forward-subject-format
3938 Format string for forwarded message subject (default: @code{"%s:
3939 %s"}).
3940 @c -------------------------
3941 @item mh-insert-x-mailer-flag
3942 On means append an @samp{X-Mailer:} header field to the header
3943 (default: @samp{on}).
3944 @c -------------------------
3945 @item mh-redist-full-contents-flag
3946 On means the @command{dist} command needs entire letter for
3947 redistribution (default: @samp{off}).
3948 @c -------------------------
3949 @item mh-reply-default-reply-to
3950 Sets the person or persons to whom a reply will be sent (default:
3951 @samp{Prompt}).
3952 @c -------------------------
3953 @item mh-reply-show-message-flag
3954 On means the MH-Show buffer is displayed using @kbd{r}
3955 (@code{mh-reply}) (default: @samp{on}).
3956 @end vtable
3958 The following hooks are available.
3960 @vtable @code
3961 @item mh-annotate-msg-hook
3962 Hook run by @code{mh-annotate-msg} after annotation (default:
3963 @code{nil}).
3964 @c -------------------------
3965 @item mh-forward-hook
3966 Hook run by @code{mh-forward} on a forwarded letter (default:
3967 @code{nil}).
3968 @c -------------------------
3969 @item mh-letter-mode-hook
3970 Hook run by @code{mh-letter-mode} on a new letter (default:
3971 @code{nil}).
3972 @end vtable
3974 @findex mh-annotate-msg
3975 @vindex mh-annotate-list
3976 @vindex mh-annotate-msg-hook
3977 @vindex mh-current-folder
3979 A hook that is called whenever a message is sent and after the scan
3980 lines and message are annotated is @code{mh-annotate-msg-hook}. Hook
3981 functions can access the current folder name with
3982 @code{mh-current-folder} and obtain the message numbers of the
3983 annotated messages with @code{mh-annotate-list}.
3985 The rest of the functions and options introduced here are explained in
3986 more detail in the following sections.
3988 @menu
3989 * Composing::
3990 * Replying::
3991 * Forwarding::
3992 * Redistributing::
3993 * Editing Again::
3994 @end menu
3996 @node Composing, Replying, Sending Mail, Sending Mail
3997 @section Composing
3999 @cindex @file{.emacs}
4000 @cindex MH-Folder mode
4001 @cindex composing mail
4002 @cindex draft
4003 @cindex files, @file{.emacs}
4004 @cindex modes, MH-Folder
4005 @cindex sending mail
4006 @findex mh-smail
4007 @findex mh-smail-other-window
4008 @kindex M-x mh-smail
4009 @kindex M-x mh-smail-other-window
4011 Outside of an MH-Folder buffer, you must call either @kbd{M-x
4012 mh-smail} or @kbd{M-x mh-smail-other-window} to compose a new message.
4013 The former command always creates a two-window layout with the current
4014 buffer on top and the draft on the bottom. Use the latter command if
4015 you would rather preserve the window layout. You may find adding the
4016 following key bindings to @file{~/.emacs} useful:
4018 @smalllisp
4019 (global-set-key "\C-xm" 'mh-smail)
4020 (global-set-key "\C-x4m" 'mh-smail-other-window)
4021 @end smalllisp
4023 @cindex draft folder
4024 @cindex MH-Letter mode
4025 @cindex modes, MH-Letter
4026 @findex mh-send
4027 @kindex m
4029 From within a MH-Folder buffer, you can simply use the command @kbd{m}
4030 (@code{mh-send}). However you invoke @code{mh-send}, your letter
4031 appears in an Emacs buffer whose mode is MH-Letter (to see what the
4032 buffer looks like, @pxref{Sending Mail Tour}). MH-Letter mode allows
4033 you to edit your message, to check the validity of the recipients, to
4034 insert attachments and other messages into your message, and to send
4035 the message. We'll go more into depth about editing a
4036 @dfn{draft}@footnote{I highly recommend that you use a @dfn{draft
4037 folder} so that you can edit several drafts in parallel. To do so,
4038 create a folder named @samp{+drafts} for example, and add the profile
4039 component @samp{Draft-Folder: drafts} (see @code{mh-profile}(5)).} (a
4040 message you're composing) in just a moment (@pxref{Editing Drafts}).
4042 @vindex mh-compose-prompt-flag
4044 If you prefer to be prompted for the recipient and subject fields
4045 before the MH-Letter buffer appears, turn on the option
4046 @code{mh-compose-prompt-flag}.
4048 @cindex header field, @samp{X-Mailer:}
4049 @cindex @samp{X-Mailer:} header field
4050 @vindex mh-insert-x-mailer-flag
4052 MH-E adds an @samp{X-Mailer:} header field to the header that includes
4053 the version of MH-E and Emacs that you are using. If you don't want to
4054 participate in our marketing, you can turn off the option
4055 @code{mh-insert-x-mailer-flag}.
4057 @cindex @command{repl}
4058 @cindex @file{components}
4059 @cindex MH commands, @command{repl}
4060 @cindex MH-Letter mode
4061 @cindex Mail mode
4062 @cindex files, @file{components}
4063 @cindex modes, MH-Letter
4064 @cindex modes, Mail
4065 @vindex mail-mode-hook
4066 @vindex mh-letter-mode-hook
4067 @vindex text-mode-hook
4069 Two hooks are provided to run commands on your freshly created draft.
4070 The first hook, @code{mh-letter-mode-hook}, allows you to do some
4071 processing before editing a letter@footnote{Actually, because
4072 MH-Letter mode inherits from Mail mode, the hooks
4073 @code{text-mode-hook} and @code{mail-mode-hook} are run (in that
4074 order) before @code{mh-letter-mode-hook}.}. For example, you may wish
4075 to modify the header after @command{repl} has done its work, or you
4076 may have a complicated @file{components} file and need to tell MH-E
4077 where the cursor should go. Here's an example of how you would use
4078 this hook.
4080 @findex mh-insert-signature, example
4082 @smalllisp
4083 @group
4084 (defvar letter-mode-init-done-flag nil
4085   "Non-nil means one-time MH-E settings have been made.")
4087 (defun my-mh-letter-mode-hook ()
4088   "Prepare letter for editing."
4089   (when (not letter-mode-init-done)     ; @r{only need to bind the keys once}
4090     (local-set-key "\C-ctb" 'add-enriched-text)
4091     (local-set-key "\C-cti" 'add-enriched-text)
4092     (local-set-key "\C-ctf" 'add-enriched-text)
4093     (local-set-key "\C-cts" 'add-enriched-text)
4094     (local-set-key "\C-ctB" 'add-enriched-text)
4095     (local-set-key "\C-ctu" 'add-enriched-text)
4096     (local-set-key "\C-ctc" 'add-enriched-text)
4097     (setq letter-mode-init-done t))
4098   (save-excursion
4099     (goto-char (point-max))             ; @r{go to end of message to}
4100     (mh-insert-signature)))             ;   @r{insert signature}
4102 @i{Prepare draft for editing via mh-letter-mode-hook}
4104 @end group
4105 @end smalllisp
4107 The function, @code{add-enriched-text} is defined in the example in
4108 @ref{Adding Attachments}.
4110 @vindex mh-compose-letter-function
4111 @vindex mh-letter-mode-hook
4113 The second hook, a function really, is
4114 @code{mh-compose-letter-function}. Like @code{mh-letter-mode-hook}, it
4115 is called just before editing a new message; however, it is the last
4116 function called before you edit your message. The consequence of this
4117 is that you can write a function to write and send the message for
4118 you. This function is passed three arguments: the contents of the
4119 @samp{To:}, @samp{Subject:}, and @samp{Cc:} header fields.
4121 @node Replying, Forwarding, Composing, Sending Mail
4122 @section Replying to Mail
4124 @cindex @command{mhl}
4125 @cindex @file{mhl.reply}
4126 @cindex MH commands, @command{mhl}
4127 @cindex files, @file{mhl.reply}
4128 @cindex replying
4129 @findex mh-reply
4130 @kindex r
4132 To compose a reply to a message, use the @kbd{r} (@code{mh-reply})
4133 command.
4135 When you reply to a message, you are first prompted with @samp{Reply
4136 to whom?}. You have several choices here.
4138 @quotation
4139 @multitable @columnfractions .20 .80
4140 @c @headitem Response @tab Reply Goes To
4141 @c XXX @headitem not yet supported by SourceForge's texi2pdf.
4142 @item @b{Response} @tab @b{Reply Goes To}
4143 @c -------------------------
4144 @item @kbd{from}
4145 @tab
4146 The person who sent the message. This is the default, so @key{RET} is
4147 sufficient.
4148 @c -------------------------
4149 @item @kbd{to}
4150 @tab
4151 Replies to the sender, plus all recipients in the @samp{To:} header field.
4152 @c -------------------------
4153 @item @kbd{cc}@*@kbd{all}
4154 @tab
4155 Forms a reply to the addresses in the @samp{Mail-Followup-To:} header
4156 field if one exists; otherwise forms a reply to the sender, plus all
4157 recipients.
4158 @end multitable
4159 @end quotation
4161 @cindex @command{repl}
4162 @cindex MH commands, @command{repl}
4163 @vindex mh-reply-default-reply-to
4165 Depending on your answer, @command{repl}@footnote{See the section
4166 @uref{@value{MH-BOOK-HOME}/reprep.html, Replying to Messages: repl} in
4167 the MH book.} is given a different argument to form your reply.
4168 Specifically, a choice of @kbd{from} or none at all runs @samp{repl
4169 -nocc all}, and a choice of @kbd{to} runs @samp{repl -cc to}. Finally,
4170 either @kbd{cc} or @kbd{all} runs @samp{repl -cc all -nocc me}. If you
4171 find that most of the time you specify one of these choices when you
4172 reply to a message, you can change the option
4173 @code{mh-reply-default-reply-to} from its default value of
4174 @samp{Prompt} to one of the choices listed above. You can always edit
4175 the recipients in the draft.
4177 @cindex @samp{repl:} MH profile component
4178 @cindex MH profile component, @samp{repl:}
4179 @cindex MH-Letter mode
4180 @cindex MH-Show mode
4181 @cindex draft
4182 @cindex modes, MH-Letter
4183 @cindex modes, MH-Show
4185 Two windows are then created. One window contains the message to which
4186 you are replying in an MH-Show buffer. Your draft, in MH-Letter mode
4187 (@pxref{Editing Drafts}), is in the other window. If the reply draft
4188 was not one that you expected, check the things that affect the
4189 behavior of @command{repl} which include the @samp{repl:} profile
4190 component and the @file{replcomps} and @file{replgroupcomps} files.
4192 If you supply a prefix argument (as in @kbd{C-u r}), the message you
4193 are replying to is inserted in your reply after having first been run
4194 through @command{mhl} with the format file @file{mhl.reply}. See
4195 @command{mhl}(1) or the section
4196 @uref{@value{MH-BOOK-HOME}/shomes.html#Usisho, Using mhl} in the MH
4197 book to see how you can modify the default @file{mhl.reply} file.
4199 @vindex mh-yank-behavior
4201 Alternatively, you can customize the option @code{mh-yank-behavior}
4202 and choose one of its @samp{Automatically} variants to do the same
4203 thing. @xref{Inserting Letter}. If you do so, the prefix argument has
4204 no effect.
4206 Another way to include the message automatically in your draft is to
4207 use @samp{repl: -filter repl.filter} in your MH profile.
4209 @vindex mh-reply-show-message-flag
4211 If you include the message automatically, you can hide the MH-Show
4212 buffer by turning off the option @code{mh-reply-show-message-flag}.
4214 If you wish to customize the header or other parts of the reply draft,
4215 please see @command{repl}(1) and @code{mh-format}(5).
4217 @node Forwarding, Redistributing, Replying, Sending Mail
4218 @section Forwarding Mail
4220 @cindex @command{forw}
4221 @cindex draft
4222 @cindex forwarding
4223 @cindex MH commands, @command{forw}
4224 @findex mh-forward
4225 @kindex f
4226 @vindex mh-forward-hook
4228 To forward a message, use the @kbd{f} (@code{mh-forward}) command. You
4229 are prompted for the @samp{To:} and @samp{cc:} recipients. You are
4230 given a draft to edit that looks like it would if you had run the MH
4231 command @command{forw}@footnote{See the section
4232 @uref{@value{MH-BOOK-HOME}/forfor.html, Forwarding Messages: forw} in
4233 the MH book.}. You can then add some text (@pxref{Editing Drafts}).
4234 You can forward several messages by using a range (@pxref{Ranges}).
4235 All of the messages in the range are inserted into your draft. The
4236 hook @code{mh-forward-hook} is called on the draft.
4238 @cindex @file{.mh_profile}
4239 @cindex files, @file{.mh_profile}
4240 @cindex MH profile component, @samp{forw:}
4241 @cindex @samp{forw:} MH profile component
4242 @vindex mh-compose-forward-as-mime-flag
4244 By default, the option @code{mh-compose-forward-as-mime-flag} is on
4245 which means that the forwarded messages are included as attachments.
4246 These are inline attachments so the forwarded message should appear in
4247 the body of your recipient's mail program. If you would prefer to
4248 forward your messages verbatim (as text, inline), then turn off this
4249 option. Forwarding messages verbatim works well for short, textual
4250 messages, but your recipient won't be able to view any non-textual
4251 attachments that were in the forwarded message. Be aware that if you
4252 have @samp{forw: -mime} in your MH profile, then forwarded messages
4253 will always be included as attachments regardless of the settings of
4254 @code{mh-compose-forward-as-mime-flag}.
4256 @vindex mh-forward-subject-format
4258 The format of the @samp{Subject:} header field for forwarded messages
4259 is controlled by the option @code{mh-forward-subject-format}. This
4260 option is a string which includes two escapes (@samp{%s}). The first
4261 @samp{%s} is replaced with the sender of the original message, and the
4262 second one is replaced with the original @samp{Subject:}. The default
4263 value of @code{"%s: %s"} takes a message with the header:
4265 @smallexample
4266 @group
4267 To: Bill Wohler <wohler@@stop.mail-abuse.org>
4268 Subject: Re: 49er football
4269 From: Greg DesBrisay <gd@@stop.mail-abuse.org>
4270 @end group
4271 @end smallexample
4273 and creates a subject header field of:
4275 @smallexample
4276 Subject: Greg DesBrisay: Re: 49er football
4277 @end smallexample
4279 @node Redistributing, Editing Again, Forwarding, Sending Mail
4280 @section Redistributing Your Mail
4282 @cindex @command{dist}
4283 @cindex MH commands, @command{dist}
4284 @cindex redistributing
4285 @findex mh-redistribute
4286 @kindex M-d
4288 The command @kbd{M-d} (@code{mh-redistribute}) is similar in function
4289 to forwarding mail, but it does not allow you to edit the message, nor
4290 does it add your name to the @samp{From:} header field. It appears to
4291 the recipient as if the message had come from the original sender.
4292 When you run this command, you are prompted for the recipients.
4294 @findex mh-edit-again
4295 @kindex e
4297 For more information on redistributing messages, see
4298 @command{dist}(1). Also investigate the command @kbd{e}
4299 (@code{mh-edit-again}) for another way to redistribute messages
4300 (@pxref{Editing Again}).
4302 @cindex @command{send}
4303 @cindex MH commands, @command{send}
4304 @vindex mh-redist-full-contents-flag
4306 The option @code{mh-redist-full-contents-flag} must be turned on if
4307 @command{dist}@footnote{See the section
4308 @uref{@value{MH-BOOK-HOME}/disdis.html, Distributing Messages with
4309 dist} in the MH book.} requires the whole letter for redistribution,
4310 which is the case if @command{send}@footnote{See the section
4311 @uref{@value{MH-BOOK-HOME}/sensen.html, Sending Some Mail: comp send}
4312 in the MH book.} is compiled with the @sc{berk} option (which many
4313 people abhor). If you find that MH will not allow you to redistribute
4314 a message that has been redistributed before, turn off this option.
4316 The hook @code{mh-annotate-msg-hook} is run after annotating the
4317 message and scan line (@pxref{Sending Mail}).
4319 @node Editing Again,  , Redistributing, Sending Mail
4320 @section Editing Old Drafts and Bounced Messages
4322 @cindex @file{draft}
4323 @cindex files, @file{draft}
4324 @cindex re-editing drafts
4325 @findex mh-edit-again
4326 @kindex F v drafts
4327 @kindex e
4328 @kindex n
4330 If you don't complete a draft for one reason or another, and if the
4331 draft buffer is no longer available, you can pick your draft up again
4332 with @kbd{e} (@code{mh-edit-again}). If you don't use a draft
4333 folder, your last @file{draft} file will be used. If you use draft
4334 folders, you'll need to visit the draft folder with @kbd{F v drafts
4335 @key{RET}}, use @kbd{n} to move to the appropriate message, and then
4336 use @kbd{e} to prepare the message for editing.
4338 @kindex e
4340 The @kbd{e} command can also be used to take messages that were sent
4341 to you and to send them to more people.
4343 @cindex Mailer-Daemon
4344 @findex mh-extract-rejected-mail
4345 @kindex C-c C-c
4346 @kindex E
4348 Don't use @kbd{e} to re-edit a message from a @i{Mailer-Daemon} who
4349 complained that your mail wasn't posted for some reason or another. In
4350 this case, use @kbd{E} (@code{mh-extract-rejected-mail}) to prepare
4351 the message for editing by removing the @i{Mailer-Daemon} envelope and
4352 unneeded header fields. Fix whatever addressing problem you had, and
4353 send the message again with @kbd{C-c C-c}.
4355 @node Editing Drafts, Aliases, Sending Mail, Top
4356 @chapter Editing a Draft
4358 @cindex @samp{Letter} menu
4359 @cindex MH-Letter mode
4360 @cindex draft
4361 @cindex editing draft
4362 @cindex menu, @samp{Letter}
4363 @cindex modes, MH-Letter
4365 When you edit a message that you want to send (called a @dfn{draft} in
4366 this case), the mode used is MH-Letter. This mode provides several
4367 commands in addition to the normal Emacs editing commands to help you
4368 edit your draft. These can also be found in the @samp{Letter} menu.
4370 @table @kbd
4371 @kindex @key{SPC}
4372 @findex mh-letter-complete-or-space
4373 @item @key{SPC}
4374 Perform completion or insert space (@code{mh-letter-complete-or-space}).
4375 @c -------------------------
4376 @kindex M-@key{TAB}
4377 @findex mh-letter-complete
4378 @item M-@key{TAB}
4379 Perform completion on header field or word preceding point
4380 (@code{mh-letter-complete}).
4381 @c -------------------------
4382 @kindex , (comma)
4383 @findex mh-letter-confirm-address
4384 @item , (comma)
4385 Flash alias expansion (@code{mh-letter-confirm-address}).
4386 @c -------------------------
4387 @kindex @key{TAB}
4388 @findex mh-letter-next-header-field-or-indent
4389 @item @key{TAB}
4390 Cycle to next field (@code{mh-letter-next-header-field-or-indent}).
4391 @c -------------------------
4392 @kindex S-@key{TAB}
4393 @findex mh-letter-previous-header-field
4394 @item S-@key{TAB}
4395 Cycle to the previous header field
4396 (@code{mh-letter-previous-header-field}).
4397 @c -------------------------
4398 @kindex C-c ?
4399 @findex mh-help
4400 @item C-c ?
4401 Display cheat sheet for the MH-E commands (@code{mh-help}).
4402 @c -------------------------
4403 @cindex @samp{Letter > Send This Draft} menu item
4404 @cindex menu item, @samp{Letter > Send This Draft}
4405 @kindex C-c C-c
4406 @findex mh-send-letter
4407 @item C-c C-c
4408 Save draft and send message (@code{mh-send-letter}).
4409 @c -------------------------
4410 @kindex C-c C-d
4411 @findex mh-insert-identity
4412 @item C-c C-d
4413 Insert fields specified by the given identity
4414 (@code{mh-insert-identity}). @xref{Identities}.
4415 @c -------------------------
4416 @cindex @samp{Letter > Pull in All Compositions (MH)} menu item
4417 @cindex menu item, @samp{Letter > Pull in All Compositions (MH)}
4418 @kindex C-c C-e
4419 @findex mh-mh-to-mime
4420 @item C-c C-e
4421 Compose @sc{mime} message from MH-style directives
4422 (@code{mh-mh-to-mime}).
4423 @c -------------------------
4424 @kindex C-c C-f C-a
4425 @kindex C-c C-f a
4426 @findex mh-to-field
4427 @item C-c C-f C-a
4428 @itemx C-c C-f a
4429 Move to @samp{Mail-Reply-To:} header field (@code{mh-to-field}).
4430 @c -------------------------
4431 @kindex C-c C-f C-b
4432 @kindex C-c C-f b
4433 @item C-c C-f C-b
4434 @itemx C-c C-f b
4435 Move to @samp{Bcc:} header field (@code{mh-to-field}).
4436 @c -------------------------
4437 @kindex C-c C-f C-c
4438 @kindex C-c C-f c
4439 @item C-c C-f C-c
4440 @itemx C-c C-f c
4441 Move to @samp{Cc:} header field (@code{mh-to-field}).
4442 @c -------------------------
4443 @kindex C-c C-f C-d
4444 @kindex C-c C-f d
4445 @item C-c C-f C-d
4446 @itemx C-c C-f d
4447 Move to @samp{Dcc:} header field (@code{mh-to-field}).
4448 @c -------------------------
4449 @kindex C-c C-f C-f
4450 @kindex C-c C-f f
4451 @findex mh-to-fcc
4452 @item C-c C-f C-f
4453 @itemx C-c C-f f
4454 Move to @samp{Fcc:} header field (@code{mh-to-fcc}).
4455 @c -------------------------
4456 @kindex C-c C-f C-l
4457 @kindex C-c C-f l
4458 @item C-c C-f C-l
4459 @itemx C-c C-f l
4460 Move to @samp{Mail-Followup-To:} header field (@code{mh-to-field}).
4461 @c -------------------------
4462 @kindex C-c C-f C-m
4463 @kindex C-c C-f m
4464 @item C-c C-f C-m
4465 @itemx C-c C-f m
4466 Move to @samp{From:} header field (@code{mh-to-field}).
4467 @c -------------------------
4468 @kindex C-c C-f C-r
4469 @kindex C-c C-f r
4470 @item C-c C-f C-r
4471 @itemx C-c C-f r
4472 Move to @samp{Reply-To:} header field (@code{mh-to-field}).
4473 @c -------------------------
4474 @kindex C-c C-f C-s
4475 @kindex C-c C-f s
4476 @item C-c C-f C-s
4477 @itemx C-c C-f s
4478 Move to @samp{Subject:} header field (@code{mh-to-field}).
4479 @c -------------------------
4480 @kindex C-c C-f C-t
4481 @kindex C-c C-f t
4482 @item C-c C-f C-t
4483 @itemx C-c C-f t
4484 Move to @samp{To:} header field (@code{mh-to-field}).
4485 @c -------------------------
4486 @cindex @samp{Letter > Insert a Message...} menu item
4487 @cindex menu item, @samp{Letter > Insert a Message...}
4488 @kindex C-c C-i
4489 @findex mh-insert-letter
4490 @item C-c C-i
4491 Insert a message (@code{mh-insert-letter}).
4492 @c -------------------------
4493 @kindex C-c C-m C-e
4494 @findex mh-mml-secure-message-encrypt
4495 @item C-c C-m C-e
4496 Add tag to encrypt the message (@code{mh-mml-secure-message-encrypt}).
4497 @c -------------------------
4498 @cindex @samp{Letter > Compose Forward...} menu item
4499 @cindex menu item, @samp{Letter > Compose Forward...}
4500 @kindex C-c C-m C-f
4501 @kindex C-c C-m f
4502 @findex mh-compose-forward
4503 @item C-c C-m C-f
4504 @itemx C-c C-m f
4505 Add tag to forward a message (@code{mh-compose-forward}).
4506 @c -------------------------
4507 @cindex @samp{Letter > Compose Get File (MH)...} menu item
4508 @cindex menu item, @samp{Letter > Compose Get File (MH)...}
4509 @kindex C-c C-m C-g
4510 @kindex C-c C-m g
4511 @findex mh-mh-compose-anon-ftp
4512 @item C-c C-m C-g
4513 @itemx C-c C-m g
4514 Add tag to include anonymous ftp reference to a file
4515 (@code{mh-mh-compose-anon-ftp}).
4516 @c -------------------------
4517 @cindex @samp{Letter > Compose Insertion...} menu item
4518 @cindex menu item, @samp{Letter > Compose Insertion...}
4519 @kindex C-c C-m C-i
4520 @kindex C-c C-m i
4521 @findex mh-compose-insertion
4522 @item C-c C-m C-i
4523 @itemx C-c C-m i
4524 Add tag to include a file such as an image or sound
4525 (@code{mh-compose-insertion}).
4526 @c -------------------------
4527 @cindex @samp{Letter > Pull in All Compositions (MML)} menu item
4528 @cindex menu item, @samp{Letter > Pull in All Compositions (MML)}
4529 @kindex C-c C-m C-m
4530 @kindex C-c C-m m
4531 @findex mh-mml-to-mime
4532 @item C-c C-m C-m
4533 @itemx C-c C-m m
4534 Compose @sc{mime} message from MML tags (@code{mh-mml-to-mime}).
4535 @c -------------------------
4536 @kindex C-c C-m C-n
4537 @kindex C-c C-m n
4538 @findex mh-mml-unsecure-message
4539 @item C-c C-m C-n
4540 @itemx C-c C-m n
4541 Remove any secure message tags (@code{mh-mml-unsecure-message}).
4542 @c -------------------------
4543 @kindex C-c C-m C-s
4544 @findex mh-mml-secure-message-sign
4545 @item C-c C-m C-s
4546 Add tag to sign the message (@code{mh-mml-secure-message-sign}).
4547 @c -------------------------
4548 @cindex @samp{Letter > Compose Compressed tar (MH)...} menu item
4549 @cindex menu item, @samp{Letter > Compose Compressed tar (MH)...}
4550 @kindex C-c C-m C-t
4551 @kindex C-c C-m t
4552 @findex mh-mh-compose-external-compressed-tar
4553 @item C-c C-m C-t
4554 @itemx C-c C-m t
4555 Add tag to include anonymous ftp reference to a compressed tar file
4556 (@code{mh-mh-compose-external-compressed-tar}).
4557 @c -------------------------
4558 @cindex @samp{Letter > Revert to Non-MIME Edit (MH)} menu item
4559 @cindex menu item, @samp{Letter > Revert to Non-MIME Edit (MH)}
4560 @kindex C-c C-m C-u
4561 @kindex C-c C-m u
4562 @findex mh-mh-to-mime-undo
4563 @item C-c C-m C-u
4564 @itemx C-c C-m u
4565 Undo effects of @kbd{C-c C-e} (@code{mh-mh-to-mime-undo}).
4566 @c -------------------------
4567 @kindex C-c C-m C-x
4568 @kindex C-c C-m x
4569 @findex mh-mh-compose-external-type
4570 @item C-c C-m C-x
4571 @itemx C-c C-m x
4572 Add tag to refer to a remote file
4573 (@code{mh-mh-compose-external-type}).
4574 @c -------------------------
4575 @kindex C-c C-m e e
4576 @findex mh-mml-secure-message-encrypt
4577 @item C-c C-m e e
4578 Add tag to encrypt the message (@code{mh-mml-secure-message-encrypt}).
4579 @c -------------------------
4580 @kindex C-c C-m e s
4581 @findex mh-mml-secure-message-signencrypt
4582 @item C-c C-m e s
4583 Add tag to encrypt and sign the message@*
4584 (@code{mh-mml-secure-message-signencrypt}).
4585 @c -------------------------
4586 @kindex C-c C-m s e
4587 @findex mh-mml-secure-message-signencrypt
4588 @item C-c C-m s e
4589 Add tag to encrypt and sign the message@*
4590 (@code{mh-mml-secure-message-signencrypt}).
4591 @c -------------------------
4592 @kindex C-c C-m s s
4593 @findex mh-mml-secure-message-sign
4594 @item C-c C-m s s
4595 Add tag to sign the message (@code{mh-mml-secure-message-sign}).
4596 @c -------------------------
4597 @cindex @samp{Letter > Split Current Line} menu item
4598 @cindex menu item, @samp{Letter > Split Current Line}
4599 @kindex C-c C-o
4600 @findex mh-open-line
4601 @item C-c C-o
4602 Insert a newline and leave point before it (@code{mh-open-line}).
4603 @c -------------------------
4604 @cindex @samp{Letter > Kill This Draft} menu item
4605 @cindex menu item, @samp{Letter > Kill This Draft}
4606 @kindex C-c C-q
4607 @findex mh-fully-kill-draft
4608 @item C-c C-q
4609 Quit editing and delete draft message (@code{mh-fully-kill-draft}).
4610 @c -------------------------
4611 @cindex @samp{Letter > Insert Signature} menu item
4612 @cindex menu item, @samp{Letter > Insert Signature}
4613 @kindex C-c C-s
4614 @findex mh-insert-signature
4615 @item C-c C-s
4616 Insert signature in message (@code{mh-insert-signature}).
4617 @c -------------------------
4618 @kindex C-c C-t
4619 @findex mh-letter-toggle-header-field-display
4620 @item C-c C-t
4621 Toggle display of header field at point
4622 (@code{mh-letter-toggle-header-field-display}).
4623 @c -------------------------
4624 @cindex @samp{Letter > Check Recipient} menu item
4625 @cindex menu item, @samp{Letter > Check Recipient}
4626 @kindex C-c C-w
4627 @findex mh-check-whom
4628 @item C-c C-w
4629 Verify recipients, showing expansion of any aliases
4630 (@code{mh-check-whom}).
4631 @c -------------------------
4632 @cindex @samp{Letter > Yank Current Message} menu item
4633 @cindex menu item, @samp{Letter > Yank Current Message}
4634 @kindex C-c C-y
4635 @findex mh-yank-cur-msg
4636 @item C-c C-y
4637 Insert the current message into the draft buffer
4638 (@code{mh-yank-cur-msg}).
4639 @c -------------------------
4640 @kindex C-c M-d
4641 @findex mh-insert-auto-fields
4642 @item C-c M-d
4643 Insert custom fields if recipient is found in
4644 @code{mh-auto-fields-list} (@code{mh-insert-auto-fields}).
4645 @xref{Identities}.
4646 @end table
4648 @cindex @samp{mh-letter} customization group
4649 @cindex customization group, @samp{mh-letter}
4651 Several options from the @samp{mh-letter} customization group are used
4652 while editing a draft.
4654 @vtable @code
4655 @item mh-compose-insertion
4656 Type of @sc{mime} message tags in messages (default: @samp{MML} if
4657 available; otherwise @samp{MH}).
4658 @c -------------------------
4659 @item mh-compose-skipped-header-fields
4660 List of header fields to skip over when navigating in draft (default:
4661 @code{'("From"} @code{"Organization"} @code{"References"}
4662 @code{"In-Reply-To"} @code{"X-Face"} @code{"Face"}
4663 @code{"X-Image-URL"} @code{"X-Mailer")}.
4664 @c -------------------------
4665 @item mh-compose-space-does-completion-flag
4666 On means @key{SPC} does completion in message header (default:
4667 @samp{off}).
4668 @c -------------------------
4669 @item mh-delete-yanked-msg-window-flag
4670 On means delete any window displaying the message (default: @samp{off}).
4671 @c -------------------------
4672 @item mh-extract-from-attribution-verb
4673 Verb to use for attribution when a message is yanked by @kbd{C-c C-y}
4674 (default: @code{"wrote:"}).
4675 @c -------------------------
4676 @item mh-ins-buf-prefix
4677 String to put before each line of a yanked or inserted message
4678 (default: @code{"> "}).
4679 @c -------------------------
4680 @item mh-letter-complete-function
4681 Function to call when completing outside of address or folder fields
4682 (default: @code{ispell-complete-word}).
4683 @c -------------------------
4684 @item mh-letter-fill-column
4685 Fill column to use in MH-Letter mode (default: 72).
4686 @c -------------------------
4687 @item mh-mml-method-default
4688 Default method to use in security tags (default: @samp{PGP (MIME)} if
4689 support for it is available; otherwise @samp{None}).
4690 @c -------------------------
4691 @item mh-signature-file-name
4692 Source of user's signature (default: @code{"~/.signature"}).
4693 @c -------------------------
4694 @item mh-signature-separator-flag
4695 On means a signature separator should be inserted (default:
4696 @samp{on}).
4697 @c -------------------------
4698 @item mh-x-face-file
4699 File containing X-Face or Face header field to insert in outgoing mail.
4700 (default: @code{"~/.face"}).
4701 @c -------------------------
4702 @item mh-yank-behavior
4703 Controls which part of a message is yanked by @kbd{C-c C-y} (default:
4704 @samp{Body With Attribution}).
4705 @end vtable
4707 The following hooks are available.
4709 @vtable @code
4710 @item mail-citation-hook
4711 Hook for modifying a citation just inserted in the mail buffer
4712 (default: @code{nil}).
4713 @c -------------------------
4714 @item mh-before-send-letter-hook
4715 Hook run at the beginning of the @kbd{C-c C-c} command (default:
4716 @samp{nil}).
4717 @c -------------------------
4718 @item mh-mh-to-mime-hook
4719 Hook run on the formatted letter by @kbd{C-c C-e} (default:
4720 @samp{nil}).
4721 @c -------------------------
4722 @item mh-insert-signature-hook
4723 Hook run by @kbd{C-c C-s} after signature has been inserted (default:
4724 @code{nil}).
4725 @end vtable
4727 The following face is available.
4729 @vtable @code
4730 @item mh-letter-header-field
4731 Editable header field value face in draft buffers.
4732 @end vtable
4734 The commands and options introduced here are explained in more
4735 detail in the following sections.
4737 @menu
4738 * Editing Message::
4739 * Inserting Letter::
4740 * Inserting Messages::
4741 * Signature::
4742 * Picture::
4743 * Adding Attachments::
4744 * Sending PGP::
4745 * Checking Recipients::
4746 * Sending Message::
4747 * Killing Draft::
4748 @end menu
4750 @node Editing Message, Inserting Letter, Editing Drafts, Editing Drafts
4751 @section Editing the Message
4753 @cindex @samp{Bcc:} header field
4754 @cindex @samp{Cc:} header field
4755 @cindex @samp{Dcc:} header field
4756 @cindex @samp{From:} header field
4757 @cindex @samp{Mail-Followup-To:} header field
4758 @cindex @samp{Mail-Reply-To:} header field
4759 @cindex @samp{Reply-To:} header field
4760 @cindex @samp{Subject:} header field
4761 @cindex @samp{To:} header field
4762 @cindex editing header
4763 @cindex header field, @samp{Bcc:}
4764 @cindex header field, @samp{Cc:}
4765 @cindex header field, @samp{Dcc:}
4766 @cindex header field, @samp{From:}
4767 @cindex header field, @samp{Mail-Followup-To:}
4768 @cindex header field, @samp{Mail-Reply-To:}
4769 @cindex header field, @samp{Reply-To:}
4770 @cindex header field, @samp{Subject:}
4771 @cindex header field, @samp{To:}
4772 @findex mh-to-field
4773 @kindex C-c C-f C-t
4774 @kindex C-c C-f t
4776 Because the header is part of the message, you can edit the header
4777 fields as you wish. However, several convenience commands exist to
4778 help you create and edit them. For example, the command @kbd{C-c C-f
4779 C-t} (@code{mh-to-field}; alternatively, @kbd{C-c C-f t}) moves the
4780 cursor to the @samp{To:} header field, creating it if necessary. The
4781 commands for moving to the @samp{Cc:}, @samp{Subject:}, @samp{From:},
4782 @samp{Reply-To:}, @samp{Mail-Reply-To:}, @samp{Mail-Followup-To},
4783 @samp{Bcc:}, and @samp{Dcc:} header fields are similar.
4785 @findex mh-to-fcc
4786 @kindex C-c C-f C-f
4787 @kindex C-c C-f f
4789 One command behaves differently from the others, namely, @kbd{C-c C-f
4790 C-f} (@code{mh-to-fcc}; alternatively, @kbd{C-c C-f f}). This command
4791 will prompt you for the folder name in which to file a copy of the
4792 draft. @xref{Folder Selection}.
4794 @findex indent-relative
4795 @findex mh-letter-next-header-field-or-indent
4796 @findex mh-letter-previous-header-field
4797 @kindex @key{TAB}
4798 @kindex S-@key{TAB}
4799 @vindex mh-compose-skipped-header-fields
4800 @vindex mh-letter-header-field
4802 Within the header of the message, the command@* @key{TAB}
4803 (@code{mh-letter-next-header-field-or-indent}) moves between fields
4804 that are highlighted with the face @code{mh-letter-header-field},
4805 skipping those fields listed in
4806 @code{mh-compose-skipped-header-fields}. After the last field, this
4807 command then moves point to the message body before cycling back to
4808 the first field. If point is already past the first line of the
4809 message body, then this command indents by calling
4810 @code{indent-relative} with the given prefix argument. The command
4811 @kbd{S-@key{TAB}} (@code{mh-letter-previous-header-field}) moves
4812 backwards between the fields and cycles to the body of the message
4813 after the first field. Unlike the command @key{TAB}, it will always
4814 take point to the last field from anywhere in the body.
4816 @cindex alias completion
4817 @cindex completion
4818 @cindex spell check
4819 @findex ispell-complete-word
4820 @findex mh-letter-complete
4821 @findex mh-letter-complete-or-space
4822 @findex mh-letter-confirm-address
4823 @kindex , (comma)
4824 @kindex @key{SPC}
4825 @kindex M-@key{TAB}
4826 @vindex mh-alias-flash-on-comma
4827 @vindex mh-compose-space-does-completion-flag
4828 @vindex mh-letter-complete-function
4830 If the field contains addresses (for example, @samp{To:} or
4831 @samp{Cc:}) or folders (for example, @samp{Fcc:}) then the command
4832 @kbd{M-@key{TAB}} (@code{mh-letter-complete}) will provide alias
4833 completion (@pxref{Aliases}). In the body of the message,
4834 @kbd{M-@key{TAB}} runs @code{mh-letter-complete-function} instead,
4835 which is set to @samp{'ispell-complete-word} by default. The command
4836 @kbd{M-@key{TAB}} (@code{mh-letter-complete}) takes a prefix argument
4837 that is passed to the @code{mh-letter-complete-function}. In addition,
4838 turn on the option @code{mh-compose-space-does-completion-flag} to use
4839 the command @key{SPC} (@code{mh-letter-complete-or-space}) to perform
4840 completion in the header as well; use a prefix argument to specify
4841 more than one space. Addresses are separated by a comma; when you
4842 press the comma, the command @code{mh-letter-confirm-address} flashes
4843 the alias expansion in the minibuffer if
4844 @code{mh-alias-flash-on-comma} is turned on.
4846 @c XXX Document the replacement for the inaccessible 'long argument.
4848 @findex mh-letter-toggle-header-field-display
4849 @kindex C-c C-t
4851 Use the command @kbd{C-c C-t}
4852 @code{mh-letter-toggle-header-field-display} to display truncated
4853 header fields. This command is a toggle so entering it again will hide
4854 the field. This command takes a prefix argument: if negative then the
4855 field is hidden, if positive then the field is displayed (for example,
4856 @kbd{C-u C-c C-t}).
4858 Be sure to leave a row of dashes or a blank line between the header
4859 and the body of the message.
4861 @vindex mh-letter-fill-column
4863 The body of the message is edited as you would edit any Emacs buffer
4864 although there are a few commands and options to assist you. You can
4865 change the fill column in MH-Letter mode with the option
4866 @code{mh-letter-fill-column}. By default, this option is 72 to allow
4867 others to quote your message without line wrapping.
4869 @cindex filling paragraphs
4870 @cindex paragraphs, filling
4871 @findex fill-paragraph
4872 @kindex M-q
4873 @vindex mh-ins-buf-prefix
4875 You'll often include messages that were sent from user agents that
4876 haven't yet realized that paragraphs consist of more than a single
4877 line. This makes for long lines that wrap in an ugly fashion. You'll
4878 find that @kbd{M-q} (@code{fill-paragraph}) works well even on these
4879 quoted messages, even if they are nested, just as long as all of the
4880 quotes match the value of @code{mh-ins-buf-prefix} (@pxref{Inserting
4881 Letter}). For example, let's assume you have the following in your
4882 draft:
4884 @smallexample
4885 @group
4886 > Hopefully this gives you an idea of what I'm currently doing. I'm \
4887 not sure yet whether I'm completely satisfied with my setup, but    \
4888 it's worked okay for me so far.
4889 @end group
4890 @end smallexample
4892 Running @kbd{M-q} on this paragraph produces:
4894 @smallexample
4895 @group
4896 > Hopefully this gives you an idea of what I'm currently doing. I'm not
4897 > sure yet whether I'm completely satisfied with my setup, but it's
4898 > worked okay for me so far.
4899 @end group
4900 @end smallexample
4902 @findex mh-open-line
4903 @findex open-line
4904 @kindex C-c C-o
4905 @kindex C-o
4907 The command @kbd{C-c C-o} (@code{mh-open-line}) is similar to the
4908 command @kbd{C-o} (@code{open-line}) in that it inserts a newline
4909 after point. It differs in that it also inserts the right number of
4910 quoting characters and spaces so that the next line begins in the same
4911 column as it was. This is useful when breaking up paragraphs in
4912 replies. For example, if this command was used when point was after
4913 the first period in the paragraph above, the result would be this:
4915 @smallexample
4916 @group
4917 > Hopefully this gives you an idea of what I'm currently doing.
4919 >                                                               I'm not
4920 > sure yet whether I'm completely satisfied with my setup, but it's
4921 > worked okay for me so far.
4922 @end group
4923 @end smallexample
4925 @node Inserting Letter, Inserting Messages, Editing Message, Editing Drafts
4926 @section Inserting Letter to Which You're Replying
4928 @cindex inserting messages
4929 @cindex replying to messages
4930 @cindex yanking messages
4931 @findex mh-yank-cur-msg
4932 @kindex C-c C-y
4933 @vindex mh-ins-buf-prefix
4935 It is often useful to insert a snippet of text from a letter that
4936 someone mailed to provide some context for your reply. The command
4937 @kbd{C-c C-y} (@code{mh-yank-cur-msg}) does this by adding an
4938 attribution, yanking a portion of text from the message to which
4939 you're replying, and inserting @code{mh-ins-buf-prefix} (@samp{> })
4940 before each line.
4942 @smallexample
4943 @group
4944 Michael W Thelen <thelenm@@stop.mail-abuse.org> wrote:
4946 > Hopefully this gives you an idea of what I'm currently doing. I'm not
4947 > sure yet whether I'm completely satisfied with my setup, but it's
4948 > worked okay for me so far.
4949 @end group
4950 @end smallexample
4952 @vindex mh-extract-from-attribution-verb
4954 The attribution consists of the sender's name and email address
4955 followed by the content of the option
4956 @code{mh-extract-from-attribution-verb}. This option can be set to
4957 @samp{wrote:}, @samp{a Ã©crit:}, and @samp{schrieb:}. You can also use
4958 the @samp{Custom String} menu item to enter your own verb.
4960 @vindex mail-citation-hook
4961 @vindex mh-ins-buf-prefix
4962 @vindex mh-yank-behavior
4964 The prefix @code{"> "} is the default setting for the option
4965 @code{mh-ins-buf-prefix}. I suggest that you not modify this option
4966 since it is used by many mailers and news readers: messages are far
4967 easier to read if several included messages have all been indented by
4968 the same string. This prefix is not inserted if you use one of the
4969 supercite flavors of @code{mh-yank-behavior} or you have added a
4970 @code{mail-citation-hook} as described below.
4972 @vindex mh-delete-yanked-msg-window-flag
4974 You can also turn on the @code{mh-delete-yanked-msg-window-flag}
4975 option to delete the window containing the original message after
4976 yanking it to make more room on your screen for your reply.
4978 @cindex Emacs, packages, supercite
4979 @cindex supercite package
4980 @kindex r
4981 @vindex mail-citation-hook
4982 @vindex mh-yank-behavior
4984 You can control how the message to which you are replying is yanked
4985 into your reply using @code{mh-yank-behavior}. To include the entire
4986 message, including the entire header, use @samp{Body and
4987 Header}@footnote{If you'd rather have the header cleaned up, use
4988 @kbd{C-u r} instead of @kbd{r} when replying
4989 (@pxref{Replying}).}@footnote{In the past you would use this setting
4990 and set @code{mail-citation-hook} to @samp{supercite}, but this usage
4991 is now deprecated in favor of the @samp{Invoke supercite} setting.}.
4992 Use @samp{Body} to yank just the body without the header. To yank only
4993 the portion of the message following the point, set this option to
4994 @samp{Below Point}.
4996 Choose @samp{Invoke supercite}@footnote{@emph{Supercite} is a
4997 full-bodied, full-featured, citation package that comes standard with
4998 Emacs.} to pass the entire message and header through supercite.
5000 @vindex mh-extract-from-attribution-verb
5002 If the @samp{Body With Attribution} setting is used, then the message
5003 minus the header is yanked and a simple attribution line is added at
5004 the top using the value of the option
5005 @code{mh-extract-from-attribution-verb}. This is the default.
5007 @kindex C-c C-y
5008 @vindex mh-delete-yanked-msg-window-flag
5010 If the @samp{Invoke supercite} or @samp{Body With Attribution}
5011 settings are used, the @samp{-noformat} argument is passed to the
5012 @command{repl} program to override a @samp{-filter} or @samp{-format}
5013 argument. These settings also have @samp{Automatically} variants that
5014 perform the action automatically when you reply so that you don't need
5015 to use @kbd{C-c C-y} at all. Note that this automatic action is only
5016 performed if the show buffer matches the message being replied to.
5017 People who use the automatic variants tend to turn on the option
5018 @code{mh-delete-yanked-msg-window-flag} as well so that the show
5019 window is never displayed.
5021 @vindex mh-yank-behavior
5023 If the show buffer has a region, the option @code{mh-yank-behavior} is
5024 ignored unless its value is one of @samp{Attribution} variants in
5025 which case the attribution is added to the yanked region.
5027 @findex trivial-cite
5028 @vindex mail-citation-hook
5029 @vindex mh-ins-buf-prefix
5030 @vindex mh-yank-behavior
5032 If this isn't enough, you can gain full control over the appearance of
5033 the included text by setting @code{mail-citation-hook} to a function
5034 that modifies it. This hook is ignored if the option
5035 @code{mh-yank-behavior} is set to one of the supercite flavors.
5036 Otherwise, this option controls how much of the message is passed to
5037 the hook. The function can find the citation between point and mark
5038 and it should leave point and mark around the modified citation text
5039 for the next hook function. The standard prefix
5040 @code{mh-ins-buf-prefix} is not added if this hook is set.
5042 @cindex Emacs, packages, trivial-cite
5043 @cindex trivial-cite package
5044 @vindex mh-yank-behavior
5046 For example, if you use the hook function
5047 @uref{http://www.emacswiki.org/emacs/TrivialCite,
5048 @code{trivial-cite}} (which is NOT part of Emacs), set
5049 @code{mh-yank-behavior} to @samp{Body and Header}.
5051 @node Inserting Messages, Signature, Inserting Letter, Editing Drafts
5052 @section Inserting Messages
5054 @cindex inserting messages
5055 @findex mh-insert-letter
5056 @findex mh-yank-behavior
5057 @kindex C-c C-i
5058 @vindex mh-ins-buf-prefix
5059 @vindex mh-invisible-header-fields-compiled
5060 @vindex mh-yank-behavior
5062 Messages can be inserted with @kbd{C-c C-i} (@code{mh-insert-letter}).
5063 This command prompts you for the folder and message number, which
5064 defaults to the current message in that folder. It then inserts the
5065 messages, indented by @code{mh-ins-buf-prefix} (@samp{> }) unless
5066 @code{mh-yank-behavior} is set to one of the supercite flavors in
5067 which case supercite is used to format the message. Certain
5068 undesirable header fields (see
5069 @code{mh-invisible-header-fields-compiled}) are removed before
5070 insertion.
5072 If given a prefix argument (like @kbd{C-u C-c C-i}), the header is
5073 left intact, the message is not indented, and @samp{> } is not
5074 inserted before each line. This command leaves the mark before the
5075 letter and point after it.
5077 @node Signature, Picture, Inserting Messages, Editing Drafts
5078 @section Inserting Your Signature
5080 @cindex signature
5081 @findex mh-insert-signature
5082 @kindex C-c C-s
5084 You can insert your signature at the current cursor location with the
5085 command @kbd{C-c C-s} (@code{mh-insert-signature}).
5087 @cindex files, @file{.signature}
5088 @cindex @file{.signature}
5089 @cindex vCard
5090 @vindex mh-signature-file-name
5092 By default, the text of your signature is taken from the file
5093 @file{~/.signature}. You can read from other sources by changing the
5094 option @code{mh-signature-file-name}. This file may contain a
5095 @dfn{vCard} in which case an attachment is added with the vCard.
5097 @findex mh-signature-separator-p
5098 @vindex mh-signature-file-name
5099 @vindex mh-signature-separator
5100 @vindex mh-signature-separator-regexp
5102 The option @code{mh-signature-file-name} may also be a symbol, in
5103 which case that function is called. You may not want a signature
5104 separator to be added for you; instead you may want to insert one
5105 yourself. Options that you may find useful to do this include
5106 @code{mh-signature-separator} (when inserting a signature separator)
5107 and @code{mh-signature-separator-regexp} (for finding said separator).
5108 The function @code{mh-signature-separator-p}, which reports @code{t}
5109 if the buffer contains a separator, may be useful as well.
5111 @cindex signature separator
5112 @vindex mh-signature-separator-flag
5114 A signature separator (@code{"-- "}) will be added if the signature
5115 block does not contain one and @code{mh-signature-separator-flag} is
5116 on. It is not recommended that you change this option since various
5117 mail user agents, including MH-E, use the separator to present the
5118 signature differently, and to suppress the signature when replying or
5119 yanking a letter into a draft.
5121 @vindex mh-insert-signature-hook
5122 @vindex mh-signature-file-name
5124 The hook @code{mh-insert-signature-hook} is run after the signature is
5125 inserted. Hook functions may access the actual name of the file or the
5126 function used to insert the signature with
5127 @code{mh-signature-file-name}.
5129 The signature can also be inserted using Identities.
5130 @xref{Identities}.
5132 @node Picture, Adding Attachments, Signature, Editing Drafts
5133 @section Inserting Your Picture
5135 @cindex @file{.face}
5136 @cindex files, @file{.face}
5137 @vindex mh-x-face-file
5139 You can insert your picture in the header of your mail message so that
5140 recipients see your face in the @samp{From:} header field if their
5141 mail user agent is sophisticated enough. In MH-E, this is done by
5142 placing your image in the file named by the option
5143 @code{mh-x-face-file} which is @file{~/.face} by default.
5145 @cindex @samp{Face:} header field
5146 @cindex @samp{X-Face:} header field
5147 @cindex @samp{X-Image-URL:} header field
5148 @cindex header field, @samp{Face:}
5149 @cindex header field, @samp{X-Face:}
5150 @cindex header field, @samp{X-Image-URL:}
5152 If the file starts with either of the strings @samp{X-Face:},
5153 @samp{Face:} or @samp{X-Image-URL:} then the contents are added to the
5154 message header verbatim. Otherwise it is assumed that the file
5155 contains the value of the @samp{X-Face:} header field.
5157 @cindex @command{compface}
5158 @cindex Unix commands, @command{compface}
5160 The @samp{X-Face:} header field, which is a low-resolution, black and
5161 white image, can be generated using the
5162 @uref{ftp://ftp.cs.indiana.edu/pub/faces/compface/compface.tar.Z,
5163 @command{compface}} command. The @uref{http://www.dairiki.org/xface/,
5164 @cite{Online X-Face Converter}} is a useful resource for quick
5165 conversion of images into @samp{X-Face:} header fields.
5167 Use the @uref{http://quimby.gnus.org/circus/face/make-face,
5168 @command{make-face}} script to convert a JPEG image to the higher
5169 resolution, color, @samp{Face:} header field.
5171 The URL of any image can be used for the @samp{X-Image-URL:} field and
5172 no processing of the image is required.
5174 @vindex mh-x-face-file
5176 To prevent the setting of any of these header fields, either set
5177 @code{mh-x-face-file} to @code{nil}, or simply ensure that the file
5178 defined by this option doesn't exist.
5180 @xref{Viewing}, to see how these header fields are displayed in MH-E.
5182 @node Adding Attachments, Sending PGP, Picture, Editing Drafts
5183 @section Adding Attachments
5185 @cindex @command{mhbuild}
5186 @cindex @command{mhn}
5187 @cindex MH commands, @command{mhbuild}
5188 @cindex MH commands, @command{mhn}
5189 @cindex MIME
5190 @cindex multimedia mail
5192 MH-E has the capability to create multimedia messages. It uses the
5193 @sc{mime} (Multipurpose Internet Mail Extensions)
5194 protocol@footnote{@sc{mime} is defined in
5195 @uref{http://www.rfc-editor.org/rfc/rfc2045.txt, RFC 2045}.} The
5196 @sc{mime} protocol allows you to incorporate images, sound, video,
5197 binary files, and even commands that fetch a file with @samp{ftp} when
5198 your recipient reads the message!
5200 @kindex C-c C-m
5202 If you were to create a multimedia message with plain MH commands, you
5203 would insert @command{mhbuild} or @command{mhn} directives (henceforth
5204 called @dfn{MH-style directives} into your draft and use the
5205 @command{mhbuild} command in nmh or @command{mhn} command in MH and
5206 GNU mailutils to expand them. MH-E works in much the same way,
5207 although it provides a handful of commands prefixed with @kbd{C-c C-m}
5208 to insert the directives so you don't need to remember the syntax of
5209 them. Remember: you can always add MH-style directives by
5210 hand@footnote{See the section
5211 @uref{@value{MH-BOOK-HOME}/usimim.html#SeMIMa, Sending MIME Mail} in
5212 the MH book.}.
5214 @cindex MIME Meta Language (MML)
5215 @cindex MML
5216 @vindex mh-compose-insertion
5218 In addition to MH-style directives, MH-E also supports MML (@sc{mime}
5219 Meta Language) tags@footnote{
5220 @ifinfo
5221 @c Although the third argument should default to the
5222 @c first, makeinfo goes to the wrong Info file without it being
5223 @c different--it seems to be getting our own Composing node.
5224 @xref{Composing,,Composing with MML,emacs-mime}.
5225 @end ifinfo
5226 @ifnotinfo
5227 See the section Composing in
5228 @uref{http://www.gnus.org/manual/emacs-mime.html, @cite{The Emacs MIME
5229 Manual}}.
5230 @end ifnotinfo
5231 }. The option @code{mh-compose-insertion} can be used to choose
5232 between them. By default, this option is set to @samp{MML} if it is
5233 supported since it provides a lot more functionality. This option can
5234 also be set to @samp{MH} if MH-style directives are preferred.
5236 @cindex media types
5237 @cindex MIME, media types
5239 The MH-E @sc{mime} commands require a @dfn{media type} for each body
5240 part or attachment. For example, a PDF document is of type
5241 @samp{application/pdf} and an HTML document is of type
5242 @samp{text/html}. Some commands fill in the media type for you,
5243 whereas others require you to enter one.
5245 @cindex @command{file}
5246 @cindex @file{/etc/mime.types}
5247 @cindex files, @file{/etc/mime.types}
5248 @cindex Unix commands, @command{file}
5249 @findex mailcap-mime-types
5251 In the cases where MH-E can do so, it will determine the media type
5252 automatically. It uses the @command{file} command to do this. Failing
5253 that, the Emacs function @code{mailcap-mime-types} is used to provide
5254 a list from which to choose. This function usually reads the file
5255 @file{/etc/mime.types}.
5257 Whether the media type is chosen automatically, or you choose it from
5258 a list, use the type that seems to match best the file that you are
5259 including. In the case of binaries, the media type
5260 @samp{application/x-executable} can be useful. If you can't find an
5261 appropriate media type, use @samp{text/plain} for text messages and
5262 @samp{application/octet-stream} for everything else.
5264 @cindex content description
5265 @cindex MIME, content description
5267 You are also sometimes asked for a @dfn{content description}. This is
5268 simply an optional brief phrase, in your own words, that describes the
5269 object. If you don't care to enter a content description, just press
5270 return and none will be included; however, a reader may skip over
5271 multimedia fields unless the content description is compelling.
5273 You can also create your own @sc{mime} body parts. In the following
5274 example, I describe how you can create and edit a @samp{text/enriched}
5275 body part to liven up your plain text messages with boldface,
5276 underlining, and italics. I include an Emacs function which inserts
5277 enriched text tags.
5279 @smalllisp
5280 @group
5281 (defvar enriched-text-types '(("b" . "bold") ("i" . "italic")
5282                               ("u" . "underline")
5283                               ("s" . "smaller") ("B" . "bigger")
5284                               ("f" . "fixed")
5285                               ("c" . "center"))
5286   "Alist of (final-character . tag) choices for add-enriched-text.
5287 Additional types can be found in RFC 1563.")
5289 (defun add-enriched-text (begin end)
5290   "Add enriched text tags around region.
5291 The tag used comes from the list enriched-text-types and is
5292 specified by the last keystroke of the command.  When called from Lisp,
5293 arguments are BEGIN and END@."
5294   (interactive "r")
5295   ;; @r{Set type to the tag indicated by the last keystroke.}
5296   (let ((type (cdr (assoc (char-to-string (logior last-input-char ?@w{`}))
5297                           enriched-text-types))))
5298     (save-restriction               ; @r{restores state from narrow-to-region}
5299       (narrow-to-region begin end)      ; @r{narrow view to region}
5300       (goto-char (point-min))           ; @r{move to beginning of text}
5301       (insert "<" type ">")             ; @r{insert beginning tag}
5302       (goto-char (point-max))           ; @r{move to end of text}
5303       (insert "</" type ">"))))         ; @r{insert terminating tag}
5304 @i{Emacs function for entering enriched text}
5306 @end group
5307 @end smalllisp
5309 To use the function @code{add-enriched-text}, first add it to
5310 @file{~/.emacs} and create key bindings for it (@pxref{Composing}).
5312 Then, in your plain text message, set the mark with @kbd{C-@@} or
5313 @kbd{C-@key{SPC}}, type in the text to be highlighted, and type @kbd{C-c t
5314 b}. This adds @samp{<bold>} where you set the mark and adds
5315 @samp{</bold>} at the location of your cursor, giving you something
5316 like: @samp{You should be <bold>very</bold>}.
5318 Before sending this message, use @kbd{C-c C-m C-m}
5319 (@code{mh-mml-to-mime})@footnote{Use @kbd{C-c C-e}
5320 (@code{mh-mh-to-mime}) if you're using MH-style directives.} to add
5321 MIME header fields. Then replace @samp{text/plain} with
5322 @samp{text/enriched} in the @samp{Content-Type:} header field.
5324 You may also be interested in investigating @code{sgml-mode}.
5326 @subheading Including Files
5328 @cindex attachments, inserting
5329 @cindex images
5330 @cindex MIME, images
5331 @cindex MIME, sound
5332 @cindex MIME, video
5333 @cindex sound
5334 @cindex video
5335 @findex mh-compose-insertion
5336 @kindex C-c C-m C-i
5337 @kindex C-c C-m i
5338 @vindex mh-compose-insertion
5340 Binaries, images, sound, and video can be inserted in your message
5341 with the command @kbd{C-c C-m C-i} (@code{mh-compose-insertion}). You
5342 are prompted for the filename containing the object, the media type if
5343 it cannot be determined automatically, and a content description. If
5344 you're using MH-style directives, you will also be prompted for
5345 additional attributes.
5347 @subheading Forwarding Multimedia Messages
5349 @findex mh-compose-forward
5350 @kindex C-c C-m C-f
5351 @kindex C-c C-m f
5353 Mail may be forwarded with @sc{mime} using the command @kbd{C-c C-m
5354 C-f} (@code{mh-compose-forward}). You are prompted for a content
5355 description, the name of the folder in which the messages to forward
5356 are located, and a range of messages, which defaults to the current
5357 message in that folder. @xref{Ranges}.
5359 @subheading Including an FTP Reference
5361 @cindex @command{ftp}
5362 @cindex MIME, @command{ftp}
5363 @cindex Unix commands, @command{ftp}
5364 @findex mh-mh-compose-anon-ftp
5365 @kindex C-c C-m C-g
5366 @kindex C-c C-m g
5368 You can have your message initiate an @command{ftp} transfer when the
5369 recipient reads the message. To do this, use the command @kbd{C-c C-m
5370 C-g} (@code{mh-mh-compose-anon-ftp}). You are prompted for the remote
5371 host and filename, the media type, and the content description.
5373 @subheading Including tar Files
5375 @cindex @command{ftp}
5376 @cindex @command{tar}
5377 @cindex MIME, @command{ftp}
5378 @cindex MIME, @command{tar}
5379 @cindex Unix commands, @command{ftp}
5380 @cindex Unix commands, @command{tar}
5381 @findex mh-mh-compose-anon-ftp
5382 @findex mh-mh-compose-external-compressed-tar
5383 @kindex C-c C-m C-g
5384 @kindex C-c C-m C-t
5385 @kindex C-c C-m t
5387 If the remote file is a compressed tar file, you can use @kbd{C-c C-m
5388 C-t} (@code{mh-mh-compose-external-compressed-tar}). Then, in addition
5389 to retrieving the file via anonymous @emph{ftp} as per the command
5390 @kbd{C-c C-m C-g} (@code{mh-mh-compose-anon-ftp}), the file will also
5391 be uncompressed and untarred. You are prompted for the remote host and
5392 filename and the content description.
5394 @subheading Including Other External Files
5396 @findex mh-mh-compose-external-type
5397 @kindex C-c C-m C-x
5398 @kindex C-c C-m x
5400 The command @kbd{C-c C-m C-x} (@code{mh-mh-compose-external-type}) is
5401 a general utility for referencing external files. In fact, all of the
5402 other commands that insert tags to access external files call this
5403 command. You are prompted for the access type, remote host and
5404 filename, and content type. If you provide a prefix argument, you are
5405 also prompted for a content description, attributes, parameters, and a
5406 comment.
5408 @subheading Previewing Multimedia Messages
5410 When you are finished editing a @sc{mime} message, it might look like this:
5412 @cartouche
5413 @smallexample
5414 3 t08/24  root               received fax files on Wed Aug 24 11:00:
5415 4+t08/24  To:wohler          Test<<This is a test message to get the
5421 --:%%  @{+inbox@} 4 msgs (1-4)   Bot L4     (MH-Folder Show)---------------
5422 To: wohler
5424 Subject: Test of MIME
5425 --------
5426 Here is the SETI@@Home logo:
5428 <#part type="image/x-xpm" filename="~/lib/images/setiathome.xpm"
5429 disposition=inline description="SETI@@home logo">
5430 <#/part>
5431 --:**  @{draft@}   All L8     (MH-Letter)----------------------------------
5433 @end smallexample
5434 @end cartouche
5435 @i{MH-E @sc{mime} draft}
5437 @findex mh-mml-to-mime
5438 @kindex C-c C-m C-m
5439 @kindex C-c C-m m
5441 Typically, you send a message with attachments just like any other
5442 message (@pxref{Sending Message}).
5444 @findex mh-mml-to-mime
5445 @kindex C-c C-m C-m
5447 However, you may take a sneak preview of the @sc{mime} encoding if you
5448 wish by running the command @kbd{C-c C-m C-m} (@code{mh-mml-to-mime}).
5449 The following screen shows the @sc{mime} encoding specified by the
5450 tags. You can see why mail user agents are usually built to hide these
5451 details from the user.
5453 @cartouche
5454 @smallexample
5455 To: wohler
5457 Subject: Test of MIME
5458 X-Mailer: MH-E 8.1; nmh 1.1; GNU Emacs 23.1
5459 MIME-Version: 1.0
5460 Content-Type: multipart/mixed; boundary="=-=-="
5461 --------
5462 --=-=-=
5464 Here is the SETI@@Home logo:
5467 --=-=-=
5468 Content-Type: image/x-xpm
5469 Content-Disposition: inline; filename=setiathome.xpm
5470 Content-Transfer-Encoding: base64
5471 Content-Description: SETI@@home logo
5473 LyogWFBNICovCnN0YXRpYyBjaGFyICogc2V0aWF0aG9tZV94cG1bXSA9IHsKIjQ1IDQ1IDc2N
5474 --:--  @{draft@}   Top L1     (MH-Letter)----------------------------------
5476 @end smallexample
5477 @end cartouche
5478 @i{MH-E @sc{mime} draft ready to send}
5480 @cindex undo effects of mh-mml-to-mime
5482 This action can be undone by running @kbd{C-_} (@code{undo}).
5484 @cindex @command{mhbuild}
5485 @cindex @command{mhn}
5486 @cindex MH commands, @command{mhbuild}
5487 @cindex MH commands, @command{mhn}
5488 @cindex undo effects of mh-mh-to-mime
5489 @findex mh-mh-to-mime
5490 @findex mh-mh-to-mime-undo
5491 @kindex C-c C-e
5492 @kindex C-c C-m C-m
5493 @kindex C-c C-m C-u
5494 @kindex C-c C-m u
5496 If you're using MH-style directives, use @kbd{C-c C-e}
5497 (@code{mh-mh-to-mime}) instead of @kbd{C-c C-m C-m}. This runs the
5498 command @command{mhbuild} (@command{mhn}) on the message which expands
5499 the tags@footnote{See the section
5500 @uref{@value{MH-BOOK-HOME}/usimim.html#SeMIMa, Sending MIME Mail} in
5501 the MH book.}. This action can be undone by running @kbd{C-c C-m C-u}
5502 (@code{mh-mh-to-mime-undo}), which works by reverting to a backup
5503 file. You are prompted to confirm this action, but you can avoid the
5504 confirmation by adding an argument (for example, @kbd{C-u C-c C-m
5505 C-u}).
5507 @kindex C-c C-e
5508 @vindex mh-mh-to-mime-args
5510 If you wish to pass additional arguments to @command{mhbuild}
5511 (@command{mhn}) to affect how it builds your message, use the option
5512 @code{mh-mh-to-mime-args}. For example, you can build a consistency
5513 check into the message by setting @code{mh-mh-to-mime-args} to
5514 @samp{-check}. The recipient of your message can then run
5515 @samp{mhbuild -check} on the message---@command{mhbuild}
5516 (@command{mhn}) will complain if the message has been corrupted on the
5517 way. The command @kbd{C-c C-e} only consults this option when given a
5518 prefix argument (as in @kbd{C-u C-c C-e}).
5520 @kindex C-c C-e
5521 @vindex mh-mh-to-mime-hook
5523 The hook @code{mh-mh-to-mime-hook} is called after the message has
5524 been formatted by @kbd{C-c C-e}.
5526 @node Sending PGP, Checking Recipients, Adding Attachments, Editing Drafts
5527 @section Signing and Encrypting Messages
5529 @cindex signing messages
5530 @cindex encrypting messages
5531 @cindex RFC 3156
5533 MH-E can sign and encrypt messages as defined in
5534 @uref{http://www.rfc-editor.org/rfc/rfc3156.txt, RFC 3156}. If you
5535 should choose to sign or encrypt your message, use one of the
5536 following commands to do so any time before sending your message.
5538 @findex mh-mml-secure-message-encrypt
5539 @findex mh-mml-secure-message-sign
5540 @findex mh-mml-secure-message-signencrypt
5541 @kindex C-c C-m C-e
5542 @kindex C-c C-m C-s
5543 @kindex C-c C-m e e
5544 @kindex C-c C-m e s
5545 @kindex C-c C-m s e
5546 @kindex C-c C-m s s
5548 The command @kbd{C-c C-m C-s} (@code{mh-mml-secure-message-sign})
5549 inserts the following tag:
5551 @smallexample
5552 <#secure method=pgpmime mode=sign>
5553 @end smallexample
5555 This is used to sign your message digitally. Likewise, the command
5556 @kbd{C-c C-m C-e} (@code{mh-mml-secure-message-encrypt}) inserts the
5557 following tag:
5559 @smallexample
5560 <#secure method=pgpmime mode=encrypt>
5561 @end smallexample
5563 This is used to encrypt your message. Finally, the command @kbd{C-c
5564 C-m s e} (@code{mh-mml-secure-message-signencrypt}) inserts the
5565 following tag:
5567 @smallexample
5568 <#secure method=pgpmime mode=signencrypt>
5569 @end smallexample
5571 @findex mh-mml-unsecure-message
5572 @kindex C-c C-m C-n
5573 @kindex C-c C-m n
5574 @vindex mh-mml-method-default
5576 This is used to sign and encrypt your message. In each of these cases,
5577 a proper multipart message is created for you when you send the
5578 message. Use the command @kbd{C-c C-m C-n}
5579 (@code{mh-mml-unsecure-message}) to remove these tags. Use a prefix
5580 argument (as in @kbd{C-u C-c C-m s e}) to be prompted for one of the
5581 possible security methods (see @code{mh-mml-method-default}).
5583 @vindex mh-mml-method-default
5585 The option @code{mh-mml-method-default} is used to select between a
5586 variety of mail security mechanisms. The default is @samp{PGP (MIME)}
5587 if it is supported; otherwise, the default is @samp{None}. Other
5588 mechanisms include vanilla @samp{PGP} and @samp{S/MIME}.
5590 @cindex @samp{pgg} customization group
5591 @cindex PGG
5592 @cindex customization group, @samp{pgg}
5594 The @samp{pgg} customization group may have some settings which may
5595 interest you.
5596 @iftex
5597 See @cite{The PGG Manual}.
5598 @end iftex
5599 @ifinfo
5600 @xref{Top, , The PGG Manual, pgg, The PGG Manual}.
5601 @end ifinfo
5602 @ifhtml
5604 @uref{http://www.gnu.org/software/emacs/manual/pgg.html,
5605 @cite{The PGG Manual}}.
5606 @end ifhtml
5608 @cindex header field, @samp{Fcc:}
5609 @cindex @samp{Fcc:} header field
5610 @vindex pgg-encrypt-for-me
5612 In particular, I turn on the option @code{pgg-encrypt-for-me} so that
5613 all messages I encrypt are encrypted with my public key as well. If
5614 you keep a copy of all of your outgoing mail with a @samp{Fcc:} header
5615 field, this setting is vital so that you can read the mail you write!
5617 @node Checking Recipients, Sending Message, Sending PGP, Editing Drafts
5618 @section Checking Recipients
5620 @cindex @samp{*MH-E Recipients*}
5621 @cindex @command{whom}
5622 @cindex MH commands, @command{whom}
5623 @cindex buffers, @samp{*MH-E Recipients*}
5624 @cindex checking recipients
5625 @cindex recipients, checking
5626 @findex mh-check-whom
5627 @kindex C-c C-w
5629 The command @kbd{C-c C-w} (@code{mh-check-whom}) expands aliases so
5630 you can check the actual address(es) in the alias. A new buffer named
5631 @samp{*MH-E Recipients*} is created with the output of @command{whom}
5632 (@pxref{Miscellaneous})@footnote{See the section
5633 @uref{@value{MH-BOOK-HOME}/senove.html#WhaPro, What now?---and the
5634 whatnow Program} in the MH book.}.
5636 @node Sending Message, Killing Draft, Checking Recipients, Editing Drafts
5637 @section Sending a Message
5639 @cindex buffers, @samp{*MH-E Mail Delivery*}
5640 @cindex @samp{*MH-E Mail Delivery*}
5641 @cindex sending mail
5642 @findex mh-send-letter
5643 @kindex C-c C-c
5645 When you are all through editing a message, you send it with the
5646 command @kbd{C-c C-c} (@code{mh-send-letter}). You can give a prefix
5647 argument (as in @kbd{C-u C-c C-c}) to monitor the first stage of the
5648 delivery; this output can be found in a buffer called @samp{*MH-E Mail
5649 Delivery*} (@pxref{Miscellaneous}).
5651 @cindex sending mail
5652 @cindex spell check
5653 @findex ispell-message
5654 @kindex C-c C-c
5655 @vindex mh-before-send-letter-hook
5657 The hook @code{mh-before-send-letter-hook} is run at the beginning of
5658 the command @kbd{C-c C-c}. For example, if you want to check your
5659 spelling in your message before sending, add the function
5660 @code{ispell-message}.
5662 @cindex @command{send}
5663 @cindex MH commands, @command{send}
5664 @vindex mh-send-prog
5666 In case the MH @command{send} program@footnote{See the section
5667 @uref{@value{MH-BOOK-HOME}/sensen.html, Sending Some Mail: comp send}
5668 in the MH book.} is installed under a different name, use
5669 @code{mh-send-prog} to tell MH-E the name.
5671 The hook @code{mh-annotate-msg-hook} is run after annotating the
5672 message and scan line (@pxref{Sending Mail}).
5674 @node Killing Draft,  , Sending Message, Editing Drafts
5675 @section Killing the Draft
5677 @cindex killing draft
5678 @findex kill-buffer
5679 @findex mh-fully-kill-draft
5680 @kindex C-c C-q
5681 @kindex C-x k
5683 If for some reason you are not happy with the draft, you can use the
5684 command @kbd{C-c C-q} (@code{mh-fully-kill-draft}) to kill the draft
5685 buffer and delete the draft message. Use the command @kbd{C-x k}
5686 (@code{kill-buffer}) if you don't want to delete the draft message.
5688 @node Aliases, Identities, Editing Drafts, Top
5689 @chapter Aliases
5691 @cindex aliases
5693 MH aliases are used in the same way in MH-E as they are in MH@. Any
5694 alias listed as a recipient will be expanded when the message is sent.
5695 This chapter discusses other things you can do with aliases in MH-E.
5697 @cindex MH-Letter mode
5698 @cindex modes, MH-Letter
5700 The following commands are available in MH-Letter mode with the
5701 exception of @code{mh-alias-reload} which can be called from anywhere.
5703 @table @kbd
5704 @kindex @key{SPC}
5705 @findex mh-letter-complete-or-space
5706 @item @key{SPC}
5707 Perform completion or insert space (@code{mh-letter-complete-or-space}).
5708 @c -------------------------
5709 @kindex M-@key{TAB}
5710 @findex mh-letter-complete
5711 @item M-@key{TAB}
5712 Perform completion on header field or word preceding point
5713 (@code{mh-letter-complete}).
5714 @c -------------------------
5715 @findex mh-alias-apropos
5716 @item mh-alias-apropos
5717 Show all aliases or addresses that match a regular expression.
5718 @c -------------------------
5719 @findex mh-alias-grab-from-field
5720 @item mh-alias-grab-from-field
5721 Add alias for the sender of the current message
5722 @c -------------------------
5723 @findex mh-alias-reload
5724 @item mh-alias-reload
5725 Reload MH aliases.
5726 @end table
5728 @cindex @samp{mh-alias} customization group
5729 @cindex customization group, @samp{mh-alias}
5731 The @samp{mh-alias} customization group contains options associated
5732 with aliases.
5734 @vtable @code
5735 @item mh-alias-completion-ignore-case-flag
5736 On means don't consider case significant in MH alias completion
5737 (default: @samp{on}).
5738 @c -------------------------
5739 @item mh-alias-expand-aliases-flag
5740 On means to expand aliases entered in the minibuffer (default:
5741 @samp{off}).
5742 @c -------------------------
5743 @item mh-alias-flash-on-comma
5744 Specify whether to flash address or warn on translation (default: @samp{Flash
5745 but Don't Warn If No Alias}).
5746 @c -------------------------
5747 @item mh-alias-insert-file
5748 Filename used to store a new MH-E alias (default: @samp{Use Aliasfile
5749 Profile Component}).
5750 @c -------------------------
5751 @item mh-alias-insertion-location
5752 Specifies where new aliases are entered in alias files (default:
5753 @samp{Alphabetical}).
5754 @c -------------------------
5755 @item mh-alias-local-users
5756 If @samp{on}, local users are added to alias completion (default:
5757 @samp{on}).
5758 @c -------------------------
5759 @item mh-alias-local-users-prefix
5760 String prefixed to the real names of users from the password file
5761 (default: @code{"local."}.
5762 @c -------------------------
5763 @item mh-alias-passwd-gecos-comma-separator-flag
5764 On means the GECOS field in the password file uses a comma separator
5765 (default: @samp{on}).
5766 @end vtable
5768 The following hook is available.
5770 @vtable @code
5771 @item mh-alias-reloaded-hook
5772 Hook run by @code{mh-alias-reload} after loading aliases (default:
5773 @code{nil}).
5774 @end vtable
5776 @subheading Adding Addresses to Draft
5778 You can use aliases when you are adding recipients to a message.
5780 @findex minibuffer-complete
5781 @kindex @key{TAB}
5782 @vindex mh-alias-expand-aliases-flag
5783 @vindex mh-compose-prompt-flag
5785 In order to use minibuffer prompting for recipients and the subject
5786 line in the minibuffer, turn on the option
5787 @code{mh-compose-prompt-flag} (@pxref{Composing}), and use the
5788 @key{TAB} (@code{minibuffer-complete}) command to complete aliases
5789 (and optionally local logins) when prompted for the recipients. Turn
5790 on the option @code{mh-alias-expand-aliases-flag} if you want these
5791 aliases to be expanded to their respective addresses in the draft.
5793 @findex mh-letter-complete
5794 @findex mh-letter-complete-or-space
5795 @kindex @key{SPC}
5796 @kindex M-@key{TAB}
5798 Otherwise, you can complete aliases in the header of the draft with
5799 @kbd{M-@key{TAB}} (@code{mh-letter-complete}) or @key{SPC}
5800 (@code{mh-letter-complete-or-space}).
5802 @vindex mh-alias-completion-ignore-case-flag
5804 As MH ignores case in the aliases, so too does MH-E@. However, you may
5805 turn off the option @code{mh-alias-completion-ignore-case-flag} to
5806 make case significant which can be used to segregate completion of
5807 your aliases. You might use uppercase for mailing lists and lowercase
5808 for people. For example, you might have:
5810 @smallexample
5811 mark.baushke: Mark Baushke <mdb@@stop.mail-abuse.org>
5812 MH-E: MH-E Mailing List <mh-e-devel@@stop.mail-abuse.org>
5813 @end smallexample
5815 When this option is turned off, if you were to type @kbd{M} in the
5816 @samp{To:} field and then @kbd{M-@key{TAB}}, then you'd get the list;
5817 if you started with @kbd{m} and then entered @kbd{M-@key{TAB}}, then
5818 you'd get Mark's address. Note that this option affects completion
5819 only. If you were to enter @kbd{Mark.Baushke}, it would still be
5820 identified with your @samp{mark.baushke} alias.
5822 @findex mh-alias-minibuffer-confirm-address
5823 @findex mh-letter-confirm-address
5824 @vindex mh-alias-flash-on-comma
5825 @vindex mh-compose-prompt-flag
5827 To verify that the alias you've entered is valid, the alias will be
5828 displayed in the minibuffer when you type a comma
5829 (@code{mh-letter-confirm-address} or
5830 @code{mh-alias-minibuffer-confirm-address} if the option
5831 @code{mh-compose-prompt-flag} is turned on). @xref{Composing}. This
5832 behavior can be controlled with the option
5833 @code{mh-alias-flash-on-comma} which provides three choices:
5834 @samp{Flash but Don't Warn If No Alias}, @samp{Flash and Warn If No
5835 Alias}, and @samp{Don't Flash Nor Warn If No Alias}.
5837 For another way to verify the alias expansion, see @ref{Checking
5838 Recipients}.
5840 @subheading Loading Aliases
5842 @cindex @command{ali}
5843 @cindex @file{/etc/nmh/MailAliases}
5844 @cindex @samp{Aliasfile:} MH profile component
5845 @cindex MH commands, @command{ali}
5846 @cindex MH profile component, @samp{Aliasfile:}
5847 @cindex files, @file{/etc/nmh/MailAliases}
5849 MH-E loads aliases for completion and folder name hints from various
5850 places. It uses the MH command @command{ali}@footnote{See the section
5851 @uref{@value{MH-BOOK-HOME}/mh.html, MH Aliases} in the MH book.} to
5852 read aliases from the files listed in the profile component
5853 @samp{Aliasfile:} as well as system-wide aliases (for example,
5854 @file{/etc/nmh/MailAliases}).
5856 @cindex @file{/etc/passwd}
5857 @cindex files, @file{/etc/passwd}
5859 In addition, aliases are created from @file{/etc/passwd} entries with
5860 a user ID larger than a magical number, typically 200. This can be a
5861 handy tool on a machine where you and co-workers exchange messages.
5862 These aliases have the form @samp{local.@var{first.last}} if a real
5863 name is present in the password file. Otherwise, the alias will have
5864 the form @samp{local.@var{login}}.
5866 @vindex mh-alias-local-users-prefix
5868 The prefix @samp{local.} can be modified via the option
5869 @code{mh-alias-local-users-prefix}. This option can also be set to
5870 @samp{Use Login}.
5872 For example, consider the following password file entry:
5874 @smallexample
5875 psg:x:1000:1000:Peter S Galbraith,,,:/home/psg:/bin/tcsh
5876 @end smallexample
5878 @vindex mh-alias-local-users-prefix
5880 The following settings of option @code{mh-alias-local-users-prefix}
5881 will produce the associated aliases:
5883 @table @code
5884 @item "local."
5885 local.peter.galbraith
5886 @c -------------------------
5887 @item ""
5888 peter.galbraith
5889 @c -------------------------
5890 @item Use Login
5892 @end table
5894 @vindex mh-alias-passwd-gecos-comma-separator-flag
5896 In the example above, commas are used to separate different values
5897 within the so-called GECOS field. This is a fairly common usage.
5898 However, in the rare case that the GECOS field in your password file
5899 is not separated by commas and whose contents may contain commas, you
5900 can turn the option @code{mh-alias-passwd-gecos-comma-separator-flag}
5901 off.
5903 @cindex NIS, obtaining local aliases from
5904 @cindex @samp{ypcat passwd}
5905 @vindex mh-alias-local-users
5907 If you're on a system with thousands of users you don't know, and the
5908 loading of local aliases slows MH-E down noticeably, then the local
5909 alias feature can be disabled by turning off the option
5910 @code{mh-alias-local-users}. This option also takes a string which is
5911 executed to generate the password file. For example, use @samp{ypcat
5912 passwd} to obtain the NIS password file.
5914 @findex mh-alias-reload
5915 @kindex M-x mh-alias-reload
5916 @vindex mh-alias-reloaded-hook
5918 Since aliases are updated frequently, MH-E reloads aliases
5919 automatically whenever an alias lookup occurs if an alias source has
5920 changed. However, you can reload your aliases manually by calling the
5921 command @kbd{M-x mh-alias-reload} directly. This command runs
5922 @code{mh-alias-reloaded-hook} after the aliases have been loaded.
5924 @subheading Adding Aliases
5926 In the past, you have manually added aliases to your alias file(s)
5927 listed in your @samp{Aliasfile:} profile component. MH-E provides
5928 other methods for maintaining your alias file(s).
5930 @findex mh-alias-add-alias
5931 @kindex M-x mh-alias-add-alias
5933 You can use the @kbd{M-x mh-alias-add-alias} command which will prompt
5934 you for the alias and address that you would like to add. If the alias
5935 exists already, you will have the choice of inserting the new alias
5936 before or after the old alias. In the former case, this alias will be
5937 used when sending mail to this alias. In the latter case, the alias
5938 serves as an additional folder name hint when filing messages
5939 (@pxref{Folder Selection}).
5941 Earlier, the alias prefix @samp{local} was presented. You can use
5942 other prefixes to organize your aliases or disambiguate entries. You
5943 might use prefixes for locales, jobs, or activities. For example, I
5944 have:
5946 @smallexample
5947 @group
5948 ; Work
5949 attensity.don.mitchell: Don Mitchell <dmitchell@@stop.mail-abuse.com>
5950 isharp.don.mitchell: Don Mitchell <donaldsmitchell@@stop.mail-abuse.com>
5952 ; Sport
5953 diving.ken.mayer: Ken Mayer <kmayer@@stop.mail-abuse.com>
5954 sailing.mike.maloney: Mike Maloney <mmaloney@@stop.mail-abuse.com>
5956 ; Personal
5957 ariane.kolkmann: Ariane Kolkmann <ArianeKolkmann@@stop.mail-abuse.com>
5959 @end group
5960 @end smallexample
5962 Using prefixes instead of postfixes helps you explore aliases during
5963 completion. If you forget the name of an old dive buddy, you can enter
5964 @samp{div} and then @key{SPC} to get a listing of all your dive buddies.
5966 @kindex M-x mh-alias-add-address-under-point
5967 @kindex M-x mh-alias-grab-from-field
5969 An alias for the sender of the current message is added automatically
5970 by clicking on the @samp{Grab From alias} tool bar button or by running
5971 the @kbd{M-x mh-alias-grab-from-field} command. Aliases for other
5972 recipients of the current message are added by placing your cursor
5973 over the desired recipient and giving the @kbd{M-x
5974 mh-alias-add-address-under-point} command.
5976 @vindex mh-alias-insert-file
5977 @vindex mh-alias-insertion-location
5979 The options @code{mh-alias-insert-file} and
5980 @code{mh-alias-insertion-location} controls how and where these aliases
5981 are inserted.
5983 @vindex mh-alias-insert-file
5985 The default setting of option @code{mh-alias-insert-file} is @samp{Use
5986 Aliasfile Profile Component}. This option can also hold the name of a
5987 file or a list a file names. If this option is set to a list of file
5988 names, or the @samp{Aliasfile:} profile component contains more than
5989 one file name, MH-E will prompt for one of them.
5991 @vindex mh-alias-insertion-location
5993 The option @code{mh-alias-insertion-location} is set to
5994 @samp{Alphabetical} by default. If you organize your alias file in
5995 other ways, then the settings @samp{Top} and @samp{Bottom} might be
5996 more appropriate.
5998 @subheading Querying Aliases
6000 @cindex regular expressions, @code{mh-alias-apropos}
6001 @findex mh-alias-apropos
6002 @kindex M-x mh-alias-apropos
6004 If you can't quite remember an alias, you can use @kbd{M-x
6005 mh-alias-apropos} to show all aliases or addresses that match a
6006 regular expression
6007 @ifnothtml
6008 (@pxref{Regexps, , Syntax of Regular Expressions, emacs, The
6009 GNU Emacs Manual}).
6010 @end ifnothtml
6011 @ifhtml
6012 (see the section
6013 @uref{http://www.gnu.org/software/emacs/manual/html_node/emacs/Regexps.html,
6014 Syntax of Regular Expressions} in
6015 @cite{The GNU Emacs Manual}).
6016 @end ifhtml
6018 @node Identities, Speedbar, Aliases, Top
6019 @chapter Identities
6021 @cindex identities
6022 @cindex multiple personalities
6024 MH-E supports the concept of multiple personalities or identities.
6025 This means that you can easily have a different header and signature
6026 at home and at work.
6028 @cindex @samp{Identity} menu
6029 @cindex menu, @samp{Identity}
6031 A couple of commands are used to insert identities in MH-Letter mode
6032 which are also found in the @samp{Identity} menu.
6034 @table @kbd
6035 @kindex C-c C-d
6036 @findex mh-insert-identity
6037 @item C-c C-d
6038 Insert fields specified by given identity (@code{mh-insert-identity}).
6039 @c -------------------------
6040 @cindex @samp{Identity > Insert Auto Fields} menu item
6041 @cindex menu item, @samp{Identity > Insert Auto Fields}
6042 @kindex C-c M-d
6043 @findex mh-insert-auto-fields
6044 @item C-c M-d
6045 Insert custom fields if recipient found in @code{mh-auto-fields-list}
6046 (@code{mh-insert-auto-fields}).
6047 @end table
6049 @cindex @samp{mh-identity} customization group
6050 @cindex customization group, @samp{mh-identity}
6052 The @samp{mh-identity} customization group contains the following
6053 options.
6055 @vtable @code
6056 @item mh-auto-fields-list
6057 List of recipients for which header lines are automatically inserted
6058 (default: @code{nil}).
6059 @c -------------------------
6060 @item mh-auto-fields-prompt-flag
6061 On means to prompt before sending if fields inserted (default:
6062 @samp{on})
6063 @c -------------------------
6064 @item mh-identity-default
6065 Default identity to use when @code{mh-letter-mode} is called (default:
6066 @samp{None}).
6067 @c -------------------------
6068 @item mh-identity-handlers
6069 Handler functions for fields in @code{mh-identity-list}.
6070 @c -------------------------
6071 @item mh-identity-list
6072 List of identities (default: @code{nil}).
6073 @end vtable
6075 Some of the common header fields that people change depending on the
6076 context are the @samp{From:} and @samp{Organization:} fields, as well
6077 as the signature.
6079 @vindex mh-identity-list
6081 This is done by customizing the option @code{mh-identity-list}. In the
6082 customization buffer for this option, click on the @samp{INS} button
6083 and enter a label such as @samp{Home} or @samp{Work}. Then click on
6084 the @samp{INS} button with the label @samp{Add at least one item
6085 below}. The @samp{Value Menu} has the following menu items:
6087 @table @samp
6088 @cindex header field, @samp{From:}
6089 @cindex @samp{From:} header field
6090 @item From Field
6091 Specify an alternate @samp{From:} header field. You must include a
6092 valid email address. A standard format is @samp{First Last
6093 <login@@host.domain>}. If you use an initial with a period, then you
6094 must quote your name as in @samp{"First I. Last"
6095 <login@@host.domain>}.
6096 @c -------------------------
6097 @cindex header field, @samp{Organization:}
6098 @cindex @samp{Organization:} header field
6099 @item Organization Field
6100 People usually list the name of the company where they work here.
6101 @c -------------------------
6102 @item Other Field
6103 Set any arbitrary header field and value here. Unless the header field
6104 is a standard one, precede the name of your field's label with
6105 @samp{X-}, as in @samp{X-Fruit-of-the-Day:}.
6106 @c -------------------------
6107 @item Attribution Verb
6108 This value overrides the setting of
6109 @code{mh-extract-from-attribution-verb}. @xref{Inserting Letter}.
6110 @c -------------------------
6111 @cindex signature
6112 @vindex mh-signature-file-name
6113 @item Signature
6114 Set your signature with this item. You can specify the contents of
6115 @code{mh-signature-file-name}, a file, or a function.
6116 @xref{Signature}.
6117 @c -------------------------
6118 @item GPG Key ID
6119 Specify a different key to sign or encrypt messages.
6120 @end table
6122 @cindex Identity menu
6123 @cindex menu, Identity
6124 @findex mh-insert-identity
6125 @kindex C-c C-d
6127 You can select the identities you have added via the menu called
6128 @samp{Identity} in the MH-Letter buffer. You can also use @kbd{C-c
6129 C-d} (@code{mh-insert-identity}). To clear the fields and signature
6130 added by the identity, select the @samp{None} identity.
6132 @cindex menu item, @samp{Identity > Customize Identities}
6133 @cindex menu item, @samp{Identity > Save as Default}
6134 @cindex menu item, @samp{Identity > Set Default for Session}
6135 @cindex @samp{Identity > Customize Identities} menu item
6136 @cindex @samp{Identity > Save as Default} menu item
6137 @cindex @samp{Identity > Set Default for Session} menu item
6138 @vindex mh-identity-default
6140 The @samp{Identity} menu contains two other items to save you from
6141 having to set the identity on every message. The menu item @samp{Set
6142 Default for Session} can be used to set the default identity to the
6143 current identity until you exit Emacs. The menu item @samp{Save as
6144 Default} sets the option @code{mh-identity-default} to the current
6145 identity setting. You can also customize the option
6146 @code{mh-identity-default} in the usual fashion. If you find that you
6147 need to add another identity, the menu item @samp{Customize
6148 Identities} is available for your convenience.
6150 @cindex regular expressions, @code{mh-auto-fields-list}
6151 @vindex mh-auto-fields-list
6153 The option @code{mh-auto-fields-list} can also be used to set the
6154 identity depending on the recipient to provide even more control. To
6155 customize @code{mh-auto-fields-list}, click on the @samp{INS} button
6156 and enter a regular expression for the recipient's address
6157 @ifnothtml
6158 (@pxref{Regexps, , Syntax of Regular Expressions, emacs, The
6159 GNU Emacs Manual}).
6160 @end ifnothtml
6161 @ifhtml
6162 (see the section
6163 @uref{http://www.gnu.org/software/emacs/manual/html_node/emacs/Regexps.html,
6164 Syntax of Regular Expressions} in
6165 @cite{The GNU Emacs Manual}).
6166 @end ifhtml
6167 Click on the @samp{INS} button with the @samp{Add at least one item
6168 below} label. The @samp{Value Menu} contains the following menu items:
6170 @table @samp
6171 @item Identity
6172 Select an identity from those configured in @code{mh-identity-list}.
6173 All of the information for that identity will be added if the
6174 recipient matches.
6175 @c -------------------------
6176 @cindex @samp{Fcc:} header field
6177 @cindex header field, @samp{Fcc:}
6178 @item Fcc Field
6179 Insert an @samp{Fcc:} header field with the folder you provide. When
6180 you send the message, MH will put a copy of your message in this
6181 folder.
6182 @c -------------------------
6183 @cindex @samp{Mail-Followup-To:} header field
6184 @cindex header field, @samp{Mail-Followup-To:}
6185 @item Mail-Followup-To Field
6186 Insert an @samp{Mail-Followup-To:} header field with the recipients
6187 you provide. If the recipient's mail user agent supports this header
6188 field@footnote{@samp{Mail-Followup-To:} is supported by nmh.}, then
6189 their replies will go to the addresses listed. This is useful if their
6190 replies go both to the list and to you and you don't have a mechanism
6191 to suppress duplicates. If you reply to someone not on the list, you
6192 must either remove the @samp{Mail-Followup-To:} field, or ensure the
6193 recipient is also listed there so that he receives replies to your
6194 reply.
6195 @c -------------------------
6196 @item Other Field
6197 Other header fields may be added using this menu item.
6198 @end table
6200 @findex mh-insert-auto-fields
6201 @kindex C-c M-d
6202 @vindex mh-auto-fields-prompt-flag
6204 These fields can only be added after the recipient is known. Because
6205 you can continue to add recipients as you edit the draft, MH-E waits
6206 until the message is sent to perform the auto-insertions. This seems
6207 strange at first, but you'll get used to it. There are two ways to
6208 help you feel that the desired fields are added. The first is the
6209 action when the message is sent: if any fields are added
6210 automatically, you are given a chance to see and to confirm these
6211 fields before the message is actually sent. You can do away with this
6212 confirmation by turning off the option
6213 @code{mh-auto-fields-prompt-flag}. The second method is manual: once
6214 the header contains one or more recipients, you may run the command
6215 @kbd{C-c M-d} (@code{mh-insert-auto-fields}) or choose the
6216 @samp{Identity -> Insert Auto Fields} menu item to insert these fields
6217 manually. However, if you use this command, the automatic insertion
6218 when the message is sent is disabled.
6220 @vindex mh-auto-fields-list
6221 @vindex mh-identity-list
6223 You should avoid using the same header field in
6224 @code{mh-auto-fields-list} and @code{mh-identity-list} definitions
6225 that may apply to the same message as the result is undefined.
6227 @vindex mh-identity-handlers
6228 @vindex mh-identity-list
6230 The option @code{mh-identity-handlers} is used to change the way that
6231 fields, signatures, and attributions in @code{mh-identity-list} are
6232 added. To customize @code{mh-identity-handlers}, replace the name of
6233 an existing handler function associated with the field you want to
6234 change with the name of a function you have written. You can also
6235 click on an @samp{INS} button and insert a field of your choice and
6236 the name of the function you have written to handle it.
6238 @vindex mh-identity-list
6240 The @samp{Field} field can be any field that you've used in your
6241 @code{mh-identity-list}. The special fields @samp{:attribution-verb},
6242 @samp{:signature}, or @samp{:pgg-default-user-id} are used for the
6243 @code{mh-identity-list} choices @samp{Attribution Verb},
6244 @samp{Signature}, and @samp{GPG Key ID} respectively.
6246 The handler associated with the @samp{:default} field is used when no
6247 other field matches.
6249 The handler functions are passed two or three arguments: the field
6250 itself (for example, @samp{From}), or one of the special fields (for
6251 example, @samp{:signature}), and the action @samp{'remove} or
6252 @samp{'add}. If the action is @samp{'add}, an additional argument
6253 containing the value for the field is given.
6255 @node Speedbar, Menu Bar, Identities, Top
6256 @chapter The Speedbar
6258 @cindex folder navigation
6259 @cindex speedbar
6260 @findex mh-visit-folder
6261 @kindex F v
6262 @kindex M-x speedbar
6263 @kindex Mouse-2
6265 You can also use the speedbar
6266 @ifnothtml
6267 (@pxref{Speedbar, , Speedbar Frames, emacs, The GNU Emacs Manual},)
6268 @end ifnothtml
6269 @ifhtml
6270 (see the section
6271 @uref{http://www.gnu.org/software/emacs/manual/html_node/emacs/Speedbar.html,
6272 Speedbar Frames} in @cite{The GNU Emacs Manual})
6273 @end ifhtml
6274 to view your folders. To bring up the speedbar, run @kbd{M-x speedbar
6275 @key{RET}}. You will see a new frame appear with all of your MH
6276 folders. Folders with unseen messages appear in boldface. Click on a
6277 folder name with @kbd{Mouse-2} to visit that folder in a similar
6278 fashion to the command @kbd{F v} (@code{mh-visit-folder})
6279 (@pxref{Folders}). Click on the @samp{+} icon to expand and view the
6280 sub-folders of that folder.
6282 The speedbar can be manipulated with the keyboard as well. Use the
6283 Emacs navigational keys (like the arrow keys, or @kbd{C-n}) to move
6284 the cursor over the desired folder and then use the shortcuts for the
6285 menu items listed in the table below.
6287 @table @samp
6288 @findex mh-speed-view
6289 @item Visit Folder (@key{RET})
6290 Visits the selected folder just as if you had used @kbd{F v}
6291 (@code{mh-speed-view}).
6292 @c -------------------------
6293 @findex mh-speed-expand-folder
6294 @item Expand Nested Folders (@kbd{+})
6295 Expands the selected folder in the speedbar, exposing the children
6296 folders inside it (@code{mh-speed-expand-folder}).
6297 @c -------------------------
6298 @findex mh-speed-contract-folder
6299 @item Contract Nested Folders (@kbd{-})
6300 Contracts or collapses the selected folder in the speedbar, hiding the
6301 children folders inside it (@code{mh-speed-contract-folder}).
6302 @c -------------------------
6303 @findex mh-speed-refresh
6304 @item Refresh Speedbar (@kbd{r})
6305 Regenerates the list of folders in the speedbar. Run this command if
6306 you've added or deleted a folder, or want to update the unseen message
6307 count before the next automatic update (@code{mh-speed-refresh}).
6308 @end table
6310 @findex delete-frame
6311 @kindex C-x 5 0
6312 @kindex Mouse-3
6314 You can click on @kbd{Mouse-3} to bring up a context menu that
6315 contains these items. Dismiss the speedbar with @kbd{C-x 5 0}
6316 (@code{delete-frame}).
6318 @cindex @command{flists}
6319 @cindex MH commands, @command{flists}
6320 @cindex @samp{mh-speedbar} customization group
6321 @cindex customization group, @samp{mh-speedbar}
6323 The MH-E speedbar uses the MH command @command{flists}@footnote{See
6324 the section @uref{@value{MH-BOOK-HOME}/morseq.html#flist, Searching for
6325 Sequences with flist} in the MH book.} to generate the list of
6326 folders. The @samp{mh-speedbar} customization group contains the
6327 following option which controls how often the speedbar calls
6328 @command{flists}.
6330 @vtable @code
6331 @item mh-speed-update-interval
6332 Time between speedbar updates in seconds (default: 60). Set to 0 to
6333 disable automatic update.
6334 @end vtable
6336 You can modify the appearance of the folders in the speedbar by
6337 customizing the following faces.
6339 @vtable @code
6340 @item mh-speedbar-folder
6341 Basic folder face.
6342 @c -------------------------
6343 @item mh-speedbar-folder-with-unseen-messages
6344 Folder face when folder contains unread messages.
6345 @c -------------------------
6346 @item mh-speedbar-selected-folder
6347 Selected folder face.
6348 @c -------------------------
6349 @item mh-speedbar-selected-folder-with-unseen-messages
6350 Selected folder face when folder contains unread messages.
6351 @end vtable
6353 @node Menu Bar, Tool Bar, Speedbar, Top
6354 @chapter The Menu Bar
6356 @cindex @samp{Folder} menu
6357 @cindex @samp{Identity} menu
6358 @cindex @samp{Letter} menu
6359 @cindex @samp{Message} menu
6360 @cindex @samp{Search} menu
6361 @cindex @samp{Sequence} menu
6362 @cindex Folder menu
6363 @cindex Identity menu
6364 @cindex Letter menu
6365 @cindex MH-Folder mode
6366 @cindex MH-Letter mode
6367 @cindex MH-Search mode
6368 @cindex Message menu
6369 @cindex Search menu
6370 @cindex Sequence menu
6371 @cindex menu bar
6372 @cindex menu, Folder
6373 @cindex menu, Identity
6374 @cindex menu, Letter
6375 @cindex menu, Message
6376 @cindex menu, Search
6377 @cindex menu, Sequence
6378 @cindex menu, @samp{Folder}
6379 @cindex menu, @samp{Identity}
6380 @cindex menu, @samp{Letter}
6381 @cindex menu, @samp{Message}
6382 @cindex menu, @samp{Search}
6383 @cindex menu, @samp{Sequence}
6384 @cindex modes, MH-Folder
6385 @cindex modes, MH-Letter
6386 @cindex modes, MH-Search
6388 For those of you who prefer to mouse and menu instead of using the
6389 meta-coke-bottle-bucky keys, MH-E provides menu items for most of its
6390 functions. The MH-Folder buffer adds the @samp{Folder},
6391 @samp{Message}, and @samp{Sequence} menus. The MH-Letter buffer adds
6392 the @samp{Identity} and @samp{Letter} menus. The MH-Search buffer adds
6393 the @samp{Search} menu. There's no need to list the actual items here,
6394 as you can more easily see them for yourself, and the functions are
6395 already described elsewhere in this manual.
6397 For a description of the menu bar, please
6398 @ifnothtml
6399 @xref{Menu Bar, , The Menu Bar, emacs, The GNU Emacs Manual}.
6400 @end ifnothtml
6401 @ifhtml
6402 see the section
6403 @uref{http://www.gnu.org/software/emacs/manual/html_node/emacs/Menu-Bar.html,
6404 The Menu Bar} in @cite{The GNU Emacs Manual}.
6405 @end ifhtml
6407 The Emacs manual describes how to get online help for a particular
6408 menu item. You can also look up a menu item in the index of this
6409 manual in two ways: all of the menu items are listed alphabetically,
6410 and you can also browse all of the items under the index entry
6411 @samp{menu item}.
6413 @node Tool Bar, Searching, Menu Bar, Top
6414 @chapter The Tool Bar
6416 @cindex tool bar
6418 Emacs also provides a graphical tool bar. For a description of the
6419 tool bar, please
6420 @ifnothtml
6421 @xref{Tool Bars, , Tool Bars, emacs, The GNU Emacs Manual}.
6422 @end ifnothtml
6423 @ifhtml
6424 see the section
6425 @uref{http://www.gnu.org/software/emacs/manual/html_node/emacs/Tool-Bars.html,
6426 Tool Bars} in @cite{The GNU Emacs Manual}.
6427 @end ifhtml
6429 @cindex @samp{mh-tool-bar} customization group
6430 @cindex customization group, @samp{mh-tool-bar}
6432 MH-E adds several icons to this tool bar; you can modify the MH-E
6433 aspects of the tool bar via the @samp{mh-tool-bar} customization group.
6435 @vtable @code
6436 @item mh-tool-bar-folder-buttons
6437 List of buttons to include in MH-Folder tool bar (default: a checklist
6438 too long to list here).
6439 @c -------------------------
6440 @item mh-tool-bar-letter-buttons
6441 List of buttons to include in MH-Letter tool bar (default: a checklist
6442 too long to list here).
6443 @c -------------------------
6444 @item mh-tool-bar-search-function
6445 Function called by the tool bar search button (default:
6446 @code{mh-search}).
6447 @c -------------------------
6448 @item mh-xemacs-tool-bar-position
6449 Tool bar location (default: @samp{Same As Default Tool Bar}).
6450 @c -------------------------
6451 @item mh-xemacs-use-tool-bar-flag
6452 If @samp{on}, use tool bar (default: @samp{on}, if supported).
6453 @end vtable
6455 In GNU Emacs, icons for some of MH-E's functions are added to the tool
6456 bar. In XEmacs, you have the opportunity to create a separate tool bar for
6457 the MH-E icons.
6459 @vindex mh-tool-bar-folder-buttons
6460 @vindex mh-tool-bar-letter-buttons
6462 In either case, you can select which of these functions you'd like to
6463 see by customizing the options @code{mh-tool-bar-folder-buttons} and
6464 @code{mh-tool-bar-letter-buttons}. As you probably guessed, the former
6465 customizes the tool bar in MH-Folder mode and the latter in MH-Letter
6466 mode. Both of these options present you with a list of functions;
6467 check the functions whose icons you want to see and clear the check
6468 boxes for those you don't.
6470 @findex mh-search
6471 @vindex mh-tool-bar-search-function
6473 The function associated with the searching icon can be set via the
6474 option @code{mh-tool-bar-search-function}. By default, this is set to
6475 @code{mh-search}. @xref{Searching}. You can also choose @samp{Other
6476 Function} from the @samp{Value Menu} and enter a function of your own
6477 choosing.
6479 @vindex mh-xemacs-use-tool-bar-flag
6481 XEmacs provides a couple of extra options. The first,
6482 @code{mh-xemacs-use-tool-bar-flag}, controls whether to show the MH-E
6483 icons at all. By default, this option is turned on if the window
6484 system supports tool bars. If your system doesn't support tool bars,
6485 then you won't be able to turn on this option.
6487 @vindex mh-xemacs-tool-bar-position
6489 The second extra option is @code{mh-xemacs-tool-bar-position} which
6490 controls the placement of the tool bar along the four edges of the
6491 frame. You can choose from one of @samp{Same As Default Tool Bar},
6492 @samp{Top}, @samp{Bottom}, @samp{Left}, or @samp{Right}. If this
6493 variable is set to anything other than @samp{Same As Default Tool Bar}
6494 and the default tool bar is in a different location, then two tool
6495 bars will be displayed: the MH-E tool bar and the default tool bar.
6497 @node Searching, Threading, Tool Bar, Top
6498 @chapter Searching Through Messages
6500 @cindex @samp{Search} menu
6501 @cindex menu, @samp{Search}
6502 @cindex searching
6503 @findex mh-search
6504 @kindex F s
6506 Earlier, the command @kbd{F s} (@code{mh-search}) was introduced which
6507 helps you find messages that lie buried in your folders
6508 (@pxref{Folders}). This chapter covers this command in more detail.
6509 Several commands are used to compose the search criteria and to start
6510 searching. A couple of them can be found in the @samp{Search} menu.
6512 @table @kbd
6513 @kindex C-c ?
6514 @findex mh-help
6515 @item C-c ?
6516 Display cheat sheet for the MH-E commands (@code{mh-help}).
6517 @c -------------------------
6518 @cindex @samp{Search > Perform Search} menu item
6519 @cindex menu item, @samp{Search > Perform Search}
6520 @kindex C-c C-c
6521 @findex mh-index-do-search
6522 @item C-c C-c
6523 Find messages using @code{mh-search-program}
6524 (@code{mh-index-do-search}).
6525 @c -------------------------
6526 @cindex @samp{Search > Search with pick} menu item
6527 @cindex menu item, @samp{Search > Search with pick}
6528 @kindex C-c C-p
6529 @findex mh-pick-do-search
6530 @item C-c C-p
6531 Find messages using @command{pick} (@code{mh-pick-do-search}).
6532 @c -------------------------
6533 @kindex C-c ?
6534 @findex mh-help
6535 @item C-c ?
6536 Display cheat sheet for the MH-E commands (@code{mh-help}).
6537 @c -------------------------
6538 @kindex C-c C-f C-a
6539 @kindex C-c C-f a
6540 @findex mh-to-field
6541 @item C-c C-f a
6542 @itemx C-c C-f C-a
6543 Move to @samp{Mail-Reply-To:} header field (@code{mh-to-field}).
6544 @c -------------------------
6545 @kindex C-c C-f C-b
6546 @kindex C-c C-f b
6547 @item C-c C-f b
6548 @itemx C-c C-f C-b
6549 Move to @samp{Bcc:} header field (@code{mh-to-field}).
6550 @c -------------------------
6551 @kindex C-c C-f C-c
6552 @kindex C-c C-f c
6553 @item C-c C-f c
6554 @itemx C-c C-f C-c
6555 Move to @samp{Cc:} header field (@code{mh-to-field}).
6556 @c -------------------------
6557 @kindex C-c C-f C-d
6558 @kindex C-c C-f d
6559 @item C-c C-f d
6560 @itemx C-c C-f C-d
6561 Move to @samp{Dcc:} header field (@code{mh-to-field}).
6562 @c -------------------------
6563 @kindex C-c C-f C-f
6564 @kindex C-c C-f f
6565 @item C-c C-f f
6566 @itemx C-c C-f C-f
6567 Move to @samp{Fcc:} header field (@code{mh-to-field}).
6568 @c -------------------------
6569 @kindex C-c C-f C-l
6570 @kindex C-c C-f l
6571 @item C-c C-f l
6572 @itemx C-c C-f C-l
6573 Move to @samp{Mail-Followup-To:} header field (@code{mh-to-field}).
6574 @c -------------------------
6575 @kindex C-c C-f C-m
6576 @kindex C-c C-f m
6577 @item C-c C-f m
6578 @itemx C-c C-f C-m
6579 Move to @samp{From:} header field (@code{mh-to-field}).
6580 @c -------------------------
6581 @kindex C-c C-f C-r
6582 @kindex C-c C-f r
6583 @item C-c C-f r
6584 @itemx C-c C-f C-r
6585 Move to @samp{Reply-To:} header field (@code{mh-to-field}).
6586 @c -------------------------
6587 @kindex C-c C-f C-s
6588 @kindex C-c C-f s
6589 @item C-c C-f s
6590 @itemx C-c C-f C-s
6591 Move to @samp{Subject:} header field (@code{mh-to-field}).
6592 @c -------------------------
6593 @kindex C-c C-f C-t
6594 @kindex C-c C-f t
6595 @item C-c C-f t
6596 @itemx C-c C-f C-t
6597 Move to @samp{To:} header field (@code{mh-to-field}).
6598 @end table
6600 Another few commands are available in the MH-Folder buffer resulting
6601 from a search.
6603 @table @kbd
6604 @kindex @key{TAB}
6605 @findex mh-index-next-folder
6606 @item @key{TAB}
6607 Jump to the next folder marker (@code{mh-index-next-folder}).
6608 @c -------------------------
6609 @kindex S-@key{TAB}
6610 @findex mh-index-previous-folder
6611 @item S-@key{TAB}
6612 Jump to the previous folder marker (@code{mh-index-previous-folder}).
6613 @c -------------------------
6614 @kindex v
6615 @findex mh-index-visit-folder
6616 @item v
6617 Visit original folder from where the message at point was found
6618 (@code{mh-index-visit-folder}).
6619 @end table
6621 @cindex @samp{mh-search} customization group
6622 @cindex customization group, @samp{mh-search}
6624 There is one option from the @samp{mh-search} customization group used
6625 in searching.
6627 @vtable @code
6628 @item mh-search-program
6629 Search program that MH-E shall use (default: @samp{Auto-detect}).
6630 @end vtable
6632 The following hook is available.
6634 @vtable @code
6635 @item mh-search-mode-hook
6636 Hook run upon entry to @code{mh-search-mode} (default: @code{nil}).
6637 @end vtable
6639 The following face is available.
6641 @vtable @code
6642 @item mh-search-folder
6643 Folder heading face in MH-Folder buffers created by searches.
6644 @end vtable
6646 @findex mh-search-folder
6647 @kindex F s
6649 The command @kbd{F s} (@code{mh-search-folder}) helps you find
6650 messages in your entire corpus of mail. You can search for messages to
6651 or from a particular person or about a particular subject. In fact,
6652 you can also search for messages containing selected strings in any
6653 arbitrary header field or any string found within the messages.
6655 @cindex @command{pick}
6656 @cindex MH commands, @command{pick}
6658 Out of the box, MH-E uses @command{pick} to find messages. With a
6659 little extra effort, you can set an indexing program which rewards you
6660 with extremely quick results. The drawback is that sometimes the index
6661 does not contain the words you're looking for. You can still use
6662 @command{pick} in these situations.
6664 You are prompted for the folder to search. This can be @samp{all} to
6665 search all folders. Note that the search works recursively on the
6666 listed folder.
6668 @cindex MH-Search mode
6669 @cindex modes, MH-Search
6671 Next, an MH-Search buffer appears where you can enter search criteria.
6673 @cartouche
6674 @smallexample
6675 From:
6678 Date:
6679 Subject:
6680 --------
6690 --:**  search-pattern   All L7     (MH-Search)---------------------------
6691 Type C-c C-c to search messages, C-c C-p to use pick, C-c ? for help
6692 @end smallexample
6693 @end cartouche
6694 @i{Search window}
6696 @cindex @command{pick}
6697 @cindex MH commands, @command{pick}
6699 Edit this template by entering your search criteria in an appropriate
6700 header field that is already there, or create a new field yourself. If
6701 the string you're looking for could be anywhere in a message, then
6702 place the string underneath the row of dashes.
6704 As an example, let's say that we want to find messages from Ginnean
6705 about horseback riding in the Kosciusko National Park (Australia)
6706 during January, 1994. Normally we would start with a broad search and
6707 narrow it down if necessary to produce a manageable amount of data,
6708 but we'll cut to the chase and create a fairly restrictive set of
6709 criteria as follows:
6711 @smallexample
6712 @group
6713 From: ginnean
6716 Date: Jan 1994
6717 Subject:
6718 --------
6719 horse
6720 kosciusko
6721 @end group
6722 @end smallexample
6724 @findex mh-to-field
6725 @kindex C-c C-f C-t
6727 As with MH-Letter mode, MH-Search provides commands like @kbd{C-c C-f
6728 C-t} (@code{mh-to-field}) to help you fill in the blanks.
6729 @xref{Editing Message}.
6731 @kindex F s
6732 @vindex mh-search-mode-hook
6734 If you find that you do the same thing over and over when editing the
6735 search template, you may wish to bind some shortcuts to keys. This can
6736 be done with the variable @code{mh-search-mode-hook}, which is called
6737 when @kbd{F s} is run on a new pattern.
6739 @findex mh-index-do-search
6740 @findex mh-pick-do-search
6741 @kindex C-c C-c
6742 @kindex C-c C-p
6744 To perform the search, type @kbd{C-c C-c} (@code{mh-index-do-search}).
6745 Sometimes you're searching for text that is either not indexed, or
6746 hasn't been indexed yet. In this case you can override the default
6747 method with the pick method by running the command @kbd{C-c C-p}
6748 (@code{mh-pick-do-search}).
6750 @cindex folders, @samp{+mhe-index}
6751 @cindex @samp{+mhe-index}
6752 @findex mh-index-next-folder
6753 @findex mh-index-previous-folder
6754 @kindex @key{TAB}
6755 @kindex S-@key{TAB}
6756 @vindex mh-search-folder
6758 The messages that are found are put in a temporary sub-folder of
6759 @samp{+mhe-index} and are displayed in an MH-Folder buffer. This
6760 buffer is special because it displays messages from multiple folders;
6761 each set of messages from a given folder has a heading with the folder
6762 name. The appearance of the heading can be modified by customizing the
6763 face @code{mh-search-folder}. You can jump back and forth between the
6764 headings using the commands @kbd{@key{TAB}}
6765 (@code{mh-index-next-folder}) and @kbd{S-@key{TAB}}
6766 (@code{mh-index-previous-folder}).
6768 @findex mh-index-visit-folder
6769 @findex mh-rescan-folder
6770 @kindex F r
6771 @kindex v
6773 In addition, the command @kbd{v} (@code{mh-index-visit-folder}) can be
6774 used to visit the folder of the message at point. Initially, only the
6775 messages that matched the search criteria are displayed in the folder.
6776 While the temporary buffer has its own set of message numbers, the
6777 actual messages numbers are shown in the visited folder. Thus, the
6778 command @kbd{v} is useful to find the actual message number of an
6779 interesting message, or to view surrounding messages with the command
6780 @kbd{F r} @code{mh-rescan-folder}. @xref{Folders}.
6782 @findex mh-kill-folder
6783 @kindex F k
6785 Because this folder is temporary, you'll probably get in the habit of
6786 killing it when you're done with @kbd{F k} (@code{mh-kill-folder}).
6787 @xref{Folders}.
6789 @kindex F s
6791 You can regenerate the results by running @kbd{F s} with a prefix
6792 argument.
6794 @cindex @command{procmail}
6795 @cindex Unix commands, @command{procmail}
6796 @cindex @samp{X-MHE-Checksum:} header field
6797 @cindex header field, @samp{X-MHE-Checksum:}
6799 Note: This command uses an @samp{X-MHE-Checksum:} header field to
6800 cache the MD5 checksum of a message. This means that if an incoming
6801 message already contains an @samp{X-MHE-Checksum:} field, that message
6802 might not be found by this command. The following @command{procmail}
6803 recipe avoids this problem by renaming the existing header field:
6805 @smallexample
6806 @group
6807 :0 wf
6808 | formail -R "X-MHE-Checksum" "X-Old-MHE-Checksum"
6809 @end group
6810 @end smallexample
6812 @xref{Limits}, for an alternative interface to searching.
6814 @section Configuring Indexed Searches
6816 @cindex @command{grep}
6817 @cindex @command{mairix}
6818 @cindex @command{namazu}
6819 @cindex @command{pick}
6820 @cindex @command{swish++}
6821 @cindex @command{swish-e}
6822 @cindex Unix commands, @command{grep}
6823 @cindex Unix commands, @command{mairix}
6824 @cindex Unix commands, @command{namazu}
6825 @cindex Unix commands, @command{pick}
6826 @cindex Unix commands, @command{swish++}
6827 @cindex Unix commands, @command{swish-e}
6828 @findex mh-search
6829 @kindex F s
6830 @vindex mh-search-program
6832 The command @kbd{F s} (@code{mh-search}) runs the command defined by
6833 the option @code{mh-search-program}. The default value is
6834 @samp{Auto-detect} which means that MH-E will automatically choose one
6835 of @command{swish++}, @command{swish-e}, @command{mairix},
6836 @command{namazu}, @command{pick} and @command{grep} in that order. If,
6837 for example, you have both @command{swish++} and @command{mairix}
6838 installed and you want to use @command{mairix}, then you can set this
6839 option to @samp{mairix}.
6841 The following sub-sections describe how to set up the various indexing
6842 programs to use with MH-E.
6844 @subsection swish++
6846 @cindex @command{swish++}
6847 @cindex Unix commands, @command{swish++}
6849 In the examples below, replace @file{/home/user/Mail} with the path to
6850 your MH directory.
6852 First create the directory @file{/home/user/Mail/.swish++}. Then
6853 create the file @file{/home/user/Mail/.swish++/swish++.conf} with the
6854 following contents:
6856 @smallexample
6857 @group
6858 IncludeMeta         Bcc Cc Comments Content-Description From Keywords
6859 IncludeMeta         Newsgroups Resent-To Subject To
6860 IncludeMeta         Message-Id References In-Reply-To
6861 IncludeFile         Mail    *
6862 IndexFile           /home/user/Mail/.swish++/swish++.index
6863 @end group
6864 @end smallexample
6866 Use the following command line to generate the swish index. Run this
6867 daily from cron:
6869 @smallexample
6870 @group
6871 find /home/user/Mail -path /home/user/Mail/mhe-index -prune \
6872                      -o -path /home/user/Mail/.swish++ -prune \
6873                      -o -name "[0-9]*" -print \
6874     | index -c /home/user/Mail/.swish++/swish++.conf -
6875 @end group
6876 @end smallexample
6878 This command does not index the folders that hold the results of your
6879 searches in @samp{+mhe-index} since they tend to be ephemeral and the
6880 original messages are indexed anyway.
6882 @cindex @command{index}
6883 @cindex Unix commands, @command{index}
6884 @cindex @command{index++}
6885 @cindex Unix commands, @command{index++}
6887 On some systems (Debian GNU/Linux, for example), use @command{index++}
6888 instead of @command{index}.
6890 @subsection swish
6892 @cindex @command{swish-e}
6893 @cindex Unix commands, @command{swish-e}
6895 In the examples below, replace @file{/home/user/Mail} with the path to
6896 your MH directory.
6898 First create the directory @file{/home/user/Mail/.swish}. Then create
6899 the file @file{/home/user/Mail/.swish/config} with the following
6900 contents:
6902 @smallexample
6903 @group
6904 DefaultContents TXT*
6905 IndexDir /home/user/Mail
6906 IndexFile /home/user/Mail/.swish/index
6907 IndexName "Mail Index"
6908 IndexDescription "Mail Index"
6909 IndexPointer "http://nowhere"
6910 IndexAdmin "nobody"
6911 #MetaNames automatic
6912 IndexReport 3
6913 FollowSymLinks no
6914 UseStemming no
6915 IgnoreTotalWordCountWhenRanking yes
6916 WordCharacters abcdefghijklmnopqrstuvwxyz0123456789-
6917 BeginCharacters abcdefghijklmnopqrstuvwxyz
6918 EndCharacters abcdefghijklmnopqrstuvwxyz0123456789
6919 IgnoreLimit 50 1000
6920 IndexComments 0
6921 FileRules filename contains \D
6922 FileRules pathname contains /home/user/Mail/.swish
6923 FileRules pathname contains /home/user/Mail/mhe-index
6924 FileRules filename is index
6925 @end group
6926 @end smallexample
6928 This configuration does not index the folders that hold the results of
6929 your searches in @samp{+mhe-index} since they tend to be ephemeral and
6930 the original messages are indexed anyway.
6932 If there are any directories you would like to ignore, append lines
6933 like the following to @file{config}:
6935 @smallexample
6936 FileRules pathname contains /home/user/Mail/scripts
6937 @end smallexample
6939 @cindex @command{swish-e}
6940 @cindex Unix commands, @command{swish-e}
6942 Use the following command line to generate the swish index. Run this
6943 daily from cron:
6945 @smallexample
6946 swish-e -c /home/user/Mail/.swish/config
6947 @end smallexample
6949 @subsection mairix
6951 @cindex @command{mairix}
6952 @cindex Unix commands, @command{mairix}
6954 In the examples below, replace @file{/home/user/Mail} with the path to
6955 your MH directory.
6957 First create the directory @file{/home/user/Mail/.mairix}. Then create
6958 the file @file{/home/user/Mail/.mairix/config} with the following
6959 contents:
6961 @smallexample
6962 @group
6963 base=/home/user/Mail
6965 # List of folders that should be indexed. 3 dots at the end means there
6966 # are subfolders within the folder
6967 mh=archive...:inbox:drafts:news:sent:trash
6969 vfolder_format=mh
6970 database=/home/user/Mail/.mairix/database
6971 @end group
6972 @end smallexample
6974 Use the following command line to generate the mairix index. Run this daily
6975 from cron:
6977 @smallexample
6978 mairix -f /home/user/Mail/.mairix/config
6979 @end smallexample
6981 @subsection namazu
6983 @cindex @command{namazu}
6984 @cindex Unix commands, @command{namazu}
6986 In the examples below, replace @file{/home/user/Mail} with the path to
6987 your MH directory.
6989 First create the directory @file{/home/user/Mail/.namazu}. Then create
6990 the file @file{/home/user/Mail/.namazu/mknmzrc} with the following
6991 contents:
6993 @smallexample
6994 @group
6995 package conf;  # Don't remove this line!
6996 $ADDRESS = 'user@@localhost';
6997 $ALLOW_FILE = "[0-9]*";
6998 $EXCLUDE_PATH = "^/home/user/Mail/(mhe-index|spam)";
6999 @end group
7000 @end smallexample
7002 This configuration does not index the folders that hold the results of
7003 your searches in @samp{+mhe-index} since they tend to be ephemeral and
7004 the original messages are indexed anyway.
7006 Use the following command line to generate the namazu index. Run this
7007 daily from cron:
7009 @smallexample
7010 mknmz -f /home/user/Mail/.namazu/mknmzrc -O /home/user/Mail/.namazu \
7011       -q /home/user/Mail
7012 @end smallexample
7014 @subsection pick
7016 @cindex @command{pick}
7017 @cindex MH commands, @command{pick}
7019 This search method does not require any setup.
7021 Read @command{pick}(1) or the section
7022 @uref{@value{MH-BOOK-HOME}/finpic.html, Finding Messages with pick} in
7023 the MH book to find out more about how to enter the criteria.
7025 @subsection grep
7027 @cindex @command{grep}
7028 @cindex Unix commands, @command{grep}
7030 This search method does not require any setup.
7032 Unlike the other search methods, this method does not use the
7033 MH-Search buffer. Instead, you simply enter a regular expression in
7034 the minibuffer. For help in constructing regular expressions, see your
7035 man page for @command{grep}.
7037 @node Threading, Limits, Searching, Top
7038 @chapter Viewing Message Threads
7040 @cindex threading
7042 MH-E groups messages by @dfn{threads} which are messages that are part
7043 of the same discussion and usually all have the same @samp{Subject:}
7044 header field. Other ways to organize messages in a folder include
7045 limiting (@pxref{Limits}) or using full-text indexed searches
7046 (@pxref{Searching}).
7048 @cindex root, in threads
7049 @cindex siblings, in threads
7050 @cindex ancestor, in threads
7052 A thread begins with a single message called a @dfn{root}. All replies
7053 to the same message are @dfn{siblings} of each other. Any message that
7054 has replies to it is an @dfn{ancestor} of those replies.
7056 There are several commands that you can use to navigate and operate on
7057 threads.
7059 @table @kbd
7060 @kindex T ?
7061 @findex mh-prefix-help
7062 @item T ?
7063 Display cheat sheet for the commands of the current prefix in
7064 minibuffer (@code{mh-prefix-help}).
7065 @c -------------------------
7066 @kindex T o
7067 @findex mh-thread-refile
7068 @item T o
7069 Refile (output) thread into folder (@code{mh-thread-refile}).
7070 @c -------------------------
7071 @kindex T d
7072 @findex mh-thread-delete
7073 @item T d
7074 Delete thread (@code{mh-thread-delete}).
7075 @c -------------------------
7076 @kindex T t
7077 @findex mh-toggle-threads
7078 @item T t
7079 Toggle threaded view of folder (@code{mh-toggle-threads}).
7080 @c -------------------------
7081 @kindex T n
7082 @findex mh-thread-next-sibling
7083 @item T n
7084 Display next sibling (@code{mh-thread-next-sibling}).
7085 @c -------------------------
7086 @kindex T p
7087 @findex mh-thread-previous-sibling
7088 @item T p
7089 Display previous sibling (@code{mh-thread-previous-sibling}).
7090 @c -------------------------
7091 @kindex T u
7092 @findex mh-thread-ancestor
7093 @item T u
7094 Display ancestor of current message (@code{mh-thread-ancestor}).
7095 @end table
7097 @cindex @samp{mh-thread} customization group
7098 @cindex customization group, @samp{mh-thread}
7100 The @samp{mh-thread} customization group contains one option.
7102 @vtable @code
7103 @item mh-show-threads-flag
7104 On means new folders start in threaded mode (default: @samp{off}).
7105 @end vtable
7107 @findex mh-toggle-threads
7108 @kindex T t
7109 @vindex mh-large-folder
7110 @vindex mh-show-threads-flag
7112 Threading large number of messages can be time consuming so the option
7113 @code{mh-show-threads-flag} is turned off by default. If you turn on
7114 this option, then threading will be done only if the number of
7115 messages being threaded is less than @code{mh-large-folder}. In any
7116 event, threading can be turned on (and off) with the command @kbd{T t}
7117 (@code{mh-toggle-threads}).
7119 @findex mh-thread-ancestor
7120 @findex mh-thread-next-sibling
7121 @findex mh-thread-previous-sibling
7122 @kindex T n
7123 @kindex T p
7124 @kindex T u
7126 There are a few commands to help you navigate threads. If you do not
7127 care for the way a particular thread has turned, you can move up the
7128 chain of messages with the command @kbd{T u}
7129 (@code{mh-thread-ancestor}. At any point you can use @kbd{T n}
7130 (@code{mh-thread-next-sibling} or @kbd{T p}
7131 (@code{mh-thread-previous-sibling}) to jump to the next or previous
7132 sibling, skipping the sub-threads. The command @kbd{T u} can also take
7133 a prefix argument to jump to the message that started everything.
7135 @findex mh-delete-subject-or-thread
7136 @findex mh-thread-delete
7137 @findex mh-thread-refile
7138 @kindex k
7139 @kindex T d
7140 @kindex T o
7142 There are threaded equivalents for the commands that delete and refile
7143 messages. For example, @kbd{T o} (@code{mh-thread-refile}) refiles the
7144 current message and all its children. Similarly, the command @kbd{T d}
7145 (@code{mh-thread-delete}) deletes the current message and all its
7146 children. These commands do not refile or delete sibling messages.
7147 @xref{Navigating}, for a description of the similar command @kbd{k}
7148 (@code{mh-delete-subject-or-thread}).
7150 @vindex mh-large-folder
7152 If you find that threading is too slow, it may be that you have
7153 @code{mh-large-folder} set too high. Also, threading is one of the few
7154 features of MH-E that really benefits from compiling. If you haven't
7155 compiled MH-E, I encourage you to do so@footnote{If you're not sure if
7156 MH-E has been byte-compiled, you could try running @samp{locate
7157 mh-thread.elc} or otherwise find MH-E on your system and ensure that
7158 @file{mh-thread.elc} exists. If you have multiple versions and you
7159 find that one is compiled but the other is not, then go into your
7160 @samp{*scratch*} buffer in Emacs, enter @kbd{load-path C-j}, and
7161 ensure that the byte-compiled version appears first in the
7162 @code{load-path}. If you find that MH-E is not compiled and you
7163 installed MH-E yourself, please refer to the installation directions
7164 in the file @file{README} in the distribution.}.
7166 @node Limits, Sequences, Threading, Top
7167 @chapter Limiting Display
7169 @cindex limits
7170 @cindex filters
7172 Another way to organize messages in a folder besides threading
7173 (@pxref{Threading}) or using full-text indexed searches
7174 (@pxref{Searching}) is by limiting the folder display to messages that
7175 are similar to the current message.
7177 @table @kbd
7178 @kindex / ?
7179 @findex mh-prefix-help
7180 @item / ?
7181 Display cheat sheet for the commands of the current prefix in
7182 minibuffer (@code{mh-prefix-help}).
7183 @c -------------------------
7184 @cindex @samp{Sequence > Narrow to Tick Sequence} menu item
7185 @cindex menu item, @samp{Sequence > Narrow to Tick Sequence}
7186 @kindex / '
7187 @findex mh-narrow-to-tick
7188 @item / '
7189 Limit to messages in the @samp{tick} sequence
7190 (@code{mh-narrow-to-tick}).
7191 @c -------------------------
7192 @kindex / c
7193 @findex mh-narrow-to-cc
7194 @item / c
7195 Limit to messages with the same @samp{Cc:} field
7196 (@code{mh-narrow-to-cc}).
7197 @c -------------------------
7198 @kindex / m
7199 @findex mh-narrow-to-from
7200 @item / m
7201 Limit to messages with the same @samp{From:} field
7202 (@code{mh-narrow-to-from}).
7203 @c -------------------------
7204 @kindex / g
7205 @findex mh-narrow-to-range
7206 @item / g
7207 Limit to range (@code{mh-narrow-to-range}).
7208 @c -------------------------
7209 @cindex @samp{Sequence > Narrow to Subject Sequence} menu item
7210 @cindex menu item, @samp{Sequence > Narrow to Subject Sequence}
7211 @kindex / s
7212 @findex mh-narrow-to-subject
7213 @item / s
7214 Limit to messages with the same @samp{Subject:} field
7215 (@code{mh-narrow-to-subject}).
7216 @c -------------------------
7217 @kindex / t
7218 @findex mh-narrow-to-to
7219 @item / t
7220 Limit to messages with the same @samp{To:} field
7221 (@code{mh-narrow-to-to}).
7222 @c -------------------------
7223 @cindex @samp{Sequence > Widen from Sequence} menu item
7224 @cindex menu item, @samp{Sequence > Widen from Sequence}
7225 @kindex / w
7226 @findex mh-widen
7227 @item / w
7228 Remove last restriction (@code{mh-widen}).
7229 @end table
7231 All of the limiting commands above refine the display in some way.
7233 @cindex @command{pick}
7234 @cindex MH commands, @command{pick}
7235 @findex mh-narrow-to-cc
7236 @findex mh-narrow-to-from
7237 @findex mh-narrow-to-subject
7238 @findex mh-narrow-to-to
7239 @kindex / c
7240 @kindex / m
7241 @kindex / s
7242 @kindex / t
7244 The commands @kbd{/ c} (@code{mh-narrow-to-cc}), @kbd{/ m}
7245 (@code{mh-narrow-to-from}), @kbd{/ s} (@code{mh-narrow-to-subject}),
7246 and @kbd{/ t} (@code{mh-narrow-to-to}) restrict the display to
7247 messages matching the content of the respective field in the current
7248 message. However, you can give any of these a prefix argument to edit
7249 the @command{pick} expression used to narrow the view@footnote{See
7250 @command{pick}(1) or the section
7251 @uref{@value{MH-BOOK-HOME}/finpic.html, Finding Messages with pick} in
7252 the MH book.}.
7254 @cindex @samp{tick} sequence
7255 @cindex sequence, @samp{tick}
7256 @cindex ticked messages, viewing
7257 @findex mh-narrow-to-range
7258 @findex mh-narrow-to-tick
7259 @kindex / '
7260 @kindex / g
7262 You can also limit the display to messages in the @samp{tick} sequence
7263 with the command @kbd{/ '} (@code{mh-narrow-to-tick}).
7264 @xref{Sequences}, for information on putting message into the
7265 @samp{tick} sequence. Use the @kbd{/ g} (@code{mh-narrow-to-range})
7266 command to limit the display to messages in a range (@pxref{Ranges}).
7268 @findex mh-widen
7269 @kindex / w
7271 Each limit can be undone in turn with the @kbd{/ w} (@code{mh-widen})
7272 command. Give this command a prefix argument to remove all limits.
7274 @node Sequences, Junk, Limits, Top
7275 @chapter Using Sequences
7277 @cindex @samp{Sequence} menu
7278 @cindex menu, @samp{Sequence}
7279 @cindex sequences
7281 For the whole scoop on MH sequences, refer to
7282 @samp{mh-sequence}(5)@footnote{See the section
7283 @uref{@value{MH-BOOK-HOME}/morseq.html, More About Sequences} in the MH
7284 book.}. As you've read, several of the MH-E commands can operate on a
7285 sequence, which is a shorthand for a range or group of messages. For
7286 example, you might want to forward several messages to a friend or
7287 colleague. Here's how to manipulate sequences. These commands are also
7288 available in the @samp{Sequence} menu.
7290 @table @kbd
7291 @cindex @samp{Sequence > Toggle Tick Mark} menu item
7292 @cindex menu item, @samp{Sequence > Toggle Tick Mark}
7293 @kindex '
7294 @findex mh-toggle-tick
7295 @item '
7296 Toggle tick mark of range (@code{mh-toggle-tick}).
7297 @c -------------------------
7298 @kindex S ?
7299 @findex mh-prefix-help
7300 @item S ?
7301 Display cheat sheet for the commands of the current prefix in
7302 minibuffer (@code{mh-prefix-help}).
7303 @c -------------------------
7304 @cindex @samp{Sequence > Narrow to Tick Sequence} menu item
7305 @cindex menu item, @samp{Sequence > Narrow to Tick Sequence}
7306 @kindex S '
7307 @findex mh-narrow-to-tick
7308 @item S '
7309 Limit to ticked messages (@code{mh-narrow-to-tick}).
7310 @c -------------------------
7311 @cindex @samp{Sequence > Delete Message from Sequence...} menu item
7312 @cindex menu item, @samp{Sequence > Delete Message from Sequence...}
7313 @kindex S d
7314 @findex mh-delete-msg-from-seq
7315 @item S d
7316 Delete range from sequence (@code{mh-delete-msg-from-seq}).
7317 @c -------------------------
7318 @cindex @samp{Sequence > Delete Sequence...} menu item
7319 @cindex menu item, @samp{Sequence > Delete Sequence...}
7320 @kindex S k
7321 @findex mh-delete-seq
7322 @item S k
7323 Delete sequence (@code{mh-delete-seq}).
7324 @c -------------------------
7325 @cindex @samp{Sequence > List Sequences in Folder...} menu item
7326 @cindex menu item, @samp{Sequence > List Sequences in Folder...}
7327 @kindex S l
7328 @findex mh-list-sequences
7329 @item S l
7330 List all sequences in folder (@code{mh-list-sequences}).
7331 @c -------------------------
7332 @cindex @samp{Sequence > Narrow to Sequence...} menu item
7333 @cindex menu item, @samp{Sequence > Narrow to Sequence...}
7334 @kindex S n
7335 @findex mh-narrow-to-seq
7336 @item S n
7337 Restrict display to messages in sequence (@code{mh-narrow-to-seq}).
7338 @c -------------------------
7339 @cindex @samp{Sequence > Add Message to Sequence...} menu item
7340 @cindex menu item, @samp{Sequence > Add Message to Sequence...}
7341 @kindex S p
7342 @findex mh-put-msg-in-seq
7343 @item S p
7344 Add range to sequence (@code{mh-put-msg-in-seq}).
7345 @c -------------------------
7346 @cindex @samp{Sequence > List Sequences for Message} menu item
7347 @cindex menu item, @samp{Sequence > List Sequences for Message}
7348 @kindex S s
7349 @findex mh-msg-is-in-seq
7350 @item S s
7351 Display the sequences in which the current message appears
7352 (@code{mh-msg-is-in-seq}).
7353 @c -------------------------
7354 @cindex @samp{Sequence > Widen from Sequence} menu item
7355 @cindex menu item, @samp{Sequence > Widen from Sequence}
7356 @kindex S w
7357 @findex mh-widen
7358 @item S w
7359 Remove last restriction (@code{mh-widen}).
7360 @c -------------------------
7361 @findex mh-update-sequences
7362 @item M-x mh-update-sequences
7363 Flush MH-E's state out to MH@.
7364 @end table
7366 @cindex @samp{mh-sequences} customization group
7367 @cindex customization group, @samp{mh-sequences}
7369 The @samp{mh-sequences} customization group contains the options
7370 associated with sequences.
7372 @vtable @code
7373 @item mh-refile-preserves-sequences-flag
7374 On means that sequences are preserved when messages are refiled
7375 (default: @samp{on}).
7376 @c -------------------------
7377 @item mh-tick-seq
7378 The name of the MH sequence for ticked messages (default: @samp{'tick}).
7379 @c -------------------------
7380 @item mh-update-sequences-after-mh-show-flag
7381 On means flush MH sequences to disk after message is shown (default:
7382 @samp{on}).
7383 @end vtable
7385 The following hook is available.
7387 @vtable @code
7388 @item mh-unseen-updated-hook
7389 Hook run after the unseen sequence has been updated (default: @code{nil}).
7390 @end vtable
7392 @cindex @command{pick}
7393 @cindex MH commands, @command{pick}
7394 @findex mh-put-msg-in-seq
7395 @kindex S p
7397 To place a message in a sequence, use @kbd{S p}
7398 (@code{mh-put-msg-in-seq}). Give @kbd{S p} a range and you can add all
7399 the messages in a sequence to another sequence (for example, @kbd{C-u
7400 S p SourceSequence @key{RET} DestSequence @key{RET}}, @pxref{Ranges}).
7402 @cindex @samp{tick} sequence
7403 @cindex sequence, @samp{tick}
7404 @cindex ticking messages
7405 @findex mh-index-ticked-messages
7406 @findex mh-toggle-tick
7407 @kindex '
7408 @kindex F '
7409 @kindex S p
7411 One specific use of the @kbd{S p} command is @kbd{'}
7412 (@code{mh-toggle-tick}) which adds messages to the @samp{tick}
7413 sequence. This sequence can be viewed later with the @kbd{F '}
7414 (@code{mh-index-ticked-messages}) command (@pxref{Folders}).
7416 @vindex mh-tick-seq
7418 You can customize the option @code{mh-tick-seq} if you already use the
7419 @samp{tick} sequence for your own use. You can also disable all of the
7420 ticking functions by choosing the @samp{Disable Ticking} item but
7421 there isn't much advantage to that.
7423 @cindex MH-Folder mode
7424 @cindex modes, MH-Folder
7425 @findex mh-narrow-to-seq
7426 @findex mh-narrow-to-tick
7427 @findex mh-widen
7428 @kindex S '
7429 @kindex S n
7430 @kindex S w
7432 Once you've placed some messages in a sequence, you may wish to narrow
7433 the field of view to just those messages in the sequence you've
7434 created. To do this, use @kbd{S n} (@code{mh-narrow-to-seq}). You are
7435 prompted for the name of the sequence. What this does is show only
7436 those messages that are in the selected sequence in the MH-Folder
7437 buffer. In addition, it limits further MH-E searches to just those
7438 messages. To narrow the view to the messages in the @samp{tick}
7439 sequence, use @kbd{S '} (@code{mh-narrow-to-tick}). When you want to
7440 widen the view to all your messages again, use @kbd{S w}
7441 (@code{mh-widen}).
7443 @cindex buffers, @samp{*MH-E Sequences*}
7444 @cindex @samp{*MH-E Sequences*}
7445 @findex mh-list-sequences
7446 @findex mh-msg-is-in-seq
7447 @kindex S l
7448 @kindex S s
7450 You can see which sequences in which a message appears with the
7451 command @kbd{S s} (@code{mh-msg-is-in-seq}). Use a prefix argument to
7452 display the sequences in which another message appears (as in @kbd{C-u
7453 42 S s @key{RET}}). Or, you can list all sequences in a selected
7454 folder (default is current folder) with @kbd{S l}
7455 (@code{mh-list-sequences}). The list appears in a buffer named
7456 @samp{*MH-E Sequences*} (@pxref{Miscellaneous}).
7458 @cindex MH profile component, @samp{Previous-Sequence:}
7459 @cindex @samp{cur} sequence
7460 @cindex @samp{Previous-Sequence:} MH profile component
7461 @cindex sequence, @samp{cur}
7462 @cindex sequence, @samp{Previous-Sequence}
7463 @vindex mh-refile-preserves-sequences-flag
7465 If a message is in any sequence (except
7466 @samp{Previous-Sequence:}@footnote{See @samp{mh-profile}(5)).} and
7467 @samp{cur}) when it is refiled, then it will still be in those
7468 sequences in the destination folder. If this behavior is not desired,
7469 then turn off the option @code{mh-refile-preserves-sequences-flag}.
7471 @findex mh-delete-msg-from-seq
7472 @findex mh-delete-seq
7473 @kindex d
7474 @kindex S d
7475 @kindex S k
7477 If you want to remove a message (or range, @pxref{Ranges}) from a
7478 sequence, use @kbd{S d} (@code{mh-delete-msg-from-seq}). If you want
7479 to delete an entire sequence, use @kbd{S k} (@code{mh-delete-seq}). In
7480 the latter case you are prompted for the sequence to delete. Note that
7481 this deletes only the sequence, not the messages in the sequence. If
7482 you want to delete the messages, use @kbd{C-u d} (@pxref{Reading
7483 Mail}).
7485 @cindex @samp{Unseen-Sequence:} MH profile component
7486 @cindex @samp{cur} sequence
7487 @cindex @samp{tick} sequence
7488 @cindex MH profile component, @samp{Unseen-Sequence:}
7489 @cindex sequence, @samp{Unseen-Sequence}
7490 @cindex sequence, @samp{cur}
7491 @cindex sequence, @samp{tick}
7492 @findex mh-update-sequences
7493 @kindex M-x mh-update-sequences
7494 @kindex q
7495 @kindex x
7496 @vindex mh-tick-seq
7497 @vindex mh-update-sequences-after-mh-show-flag
7499 Three sequences are maintained internally by MH-E and pushed out to MH
7500 when a message is shown. They include the sequence specified by your
7501 @samp{Unseen-Sequence:} profile component, @samp{cur}, and the
7502 sequence listed by the option @code{mh-tick-seq} which is @samp{tick}
7503 by default. If you do not like this behavior, turn off the option
7504 @code{mh-update-sequences-after-mh-show-flag}. You can then update the
7505 state manually with the @kbd{x}, @kbd{q}, or @kbd{M-x
7506 mh-update-sequences} commands.
7508 @vindex mh-seen-list
7509 @vindex mh-unseen-updated-hook
7511 The hook @code{mh-unseen-updated-hook} is run after the unseen
7512 sequence has been updated. The variable @code{mh-seen-list} can be
7513 used by this hook to obtain the list of messages which were removed
7514 from the unseen sequence.
7516 @cindex @command{mark}
7517 @cindex MH commands, @command{mark}
7518 @kindex S n
7519 @kindex S w
7521 With the exceptions of @kbd{S n} and @kbd{S w}, the underlying MH
7522 command dealing with sequences is @command{mark}@footnote{See the
7523 section @uref{@value{MH-BOOK-HOME}/mmbwm.html, Make Message Bookmarks
7524 with mark} in the MH book.}.
7526 @node Junk, Miscellaneous, Sequences, Top
7527 @chapter Dealing With Junk Mail
7529 @cindex Marshall Rose
7530 @cindex junk mail
7531 @cindex spam
7533 Marshall Rose once wrote a paper on MH entitled, @cite{How to process
7534 200 messages a day and still get some real work done}. This chapter
7535 could be entitled, @cite{How to process 1000 spams a day and still get
7536 some real work done}.
7538 @cindex blacklisting
7539 @cindex ham
7540 @cindex viruses
7541 @cindex whitelisting
7542 @cindex worms
7544 We use the terms @dfn{junk mail} and @dfn{spam} interchangeably for
7545 any unwanted message which includes spam, @dfn{viruses}, and
7546 @dfn{worms}. The opposite of spam is @dfn{ham}. The act of classifying
7547 a sender as one who sends junk mail is called @dfn{blacklisting}; the
7548 opposite is called @dfn{whitelisting}.
7550 @table @kbd
7551 @kindex J ?
7552 @findex mh-prefix-help
7553 @item J ?
7554 Display cheat sheet for the commands of the current prefix in
7555 minibuffer (@code{mh-prefix-help}).
7556 @c -------------------------
7557 @kindex J b
7558 @findex mh-junk-blacklist
7559 @item J b
7560 Blacklist range as spam (@code{mh-junk-blacklist}).
7561 @c -------------------------
7562 @kindex J w
7563 @findex mh-junk-whitelist
7564 @item J w
7565 Whitelist range as ham (@code{mh-junk-whitelist}).
7566 @c -------------------------
7567 @item @code{mh-spamassassin-identify-spammers}
7568 Identify spammers who are repeat offenders.
7569 @end table
7571 @cindex @samp{mh-junk} customization group
7572 @cindex customization group, @samp{mh-junk}
7574 The following table lists the options from the @samp{mh-junk}
7575 customization group.
7577 @vtable @code
7578 @item mh-junk-background
7579 If on, spam programs are run in background (default: @samp{off}).
7580 @c -------------------------
7581 @item mh-junk-disposition
7582 Disposition of junk mail (default: @samp{Delete Spam}).
7583 @c -------------------------
7584 @item mh-junk-program
7585 Spam program that MH-E should use (default: @samp{Auto-detect}).
7586 @end vtable
7588 @cindex SpamProbe
7589 @cindex Spamassassin
7590 @cindex bogofilter
7591 @cindex spam filters, SpamProbe
7592 @cindex spam filters, Spamassassin
7593 @cindex spam filters, bogofilter
7595 MH-E depends on @uref{http://spamassassin.apache.org/, SpamAssassin},
7596 @uref{http://bogofilter.sourceforge.net/, bogofilter}, or
7597 @uref{http://spamprobe.sourceforge.net/, SpamProbe} to throw the dreck
7598 away. This chapter describes briefly how to configure these programs
7599 to work well with MH-E and how to use MH-E's interface that provides
7600 continuing education for these programs.
7602 @vindex mh-junk-program
7604 The default setting of the option @code{mh-junk-program} is
7605 @samp{Auto-detect} which means that MH-E will automatically choose one
7606 of SpamAssassin, bogofilter, or SpamProbe in that order. If, for
7607 example, you have both SpamAssassin and bogofilter installed and you
7608 want to use bogofilter, then you can set this option to
7609 @samp{Bogofilter}.
7611 @findex mh-junk-blacklist
7612 @kindex J b
7613 @vindex mh-junk-disposition
7615 The command @kbd{J b} (@code{mh-junk-blacklist}) trains the spam
7616 program in use with the content of the range (@pxref{Ranges}) and then
7617 handles the message(s) as specified by the option
7618 @code{mh-junk-disposition}. By default, this option is set to
7619 @samp{Delete Spam} but you can also specify the name of the folder
7620 which is useful for building a corpus of spam for training purposes.
7622 @findex mh-junk-whitelist
7623 @kindex J w
7625 In contrast, the command @kbd{J w} (@code{mh-junk-whitelist})
7626 reclassifies a range of messages (@pxref{Ranges}) as ham if it were
7627 incorrectly classified as spam. It then refiles the message into the
7628 @file{+inbox} folder.
7630 @cindex @samp{*MH-E Log*}
7631 @cindex buffers, @samp{*MH-E Log*}
7632 @findex call-process
7633 @vindex mh-junk-background
7635 By default, the programs are run in the foreground, but this can be
7636 slow when junking large numbers of messages. If you have enough memory
7637 or don't junk that many messages at the same time, you might try
7638 turning on the option @code{mh-junk-background}. @footnote{Note that
7639 the option @code{mh-junk-background} is used as the @code{display}
7640 argument in the call to @code{call-process}. Therefore, turning on
7641 this option means setting its value to @samp{0}. You can also set its
7642 value to @samp{t} to direct the programs' output to the @samp{*MH-E
7643 Log*} buffer; this may be useful for debugging.}
7645 The following sections discuss the various counter-spam measures that
7646 MH-E can work with.
7648 @cindex @file{.procmailrc}
7649 @cindex files, @file{.procmailrc}
7651 @subheading SpamAssassin
7653 @cindex Spamassassin
7654 @cindex spam filters, Spamassassin
7656 SpamAssassin is one of the more popular spam filtering programs. Get
7657 it from your local distribution or from the
7658 @uref{http://spamassassin.apache.org/, SpamAssassin web site}.
7660 To use SpamAssassin, add the following recipes to @file{~/.procmailrc}:
7662 @cindex @command{spamc}
7663 @cindex @samp{X-Spam-Level:} header field
7664 @cindex @samp{X-Spam-Status:} header field
7665 @cindex header field, @samp{X-Spam-Level:}
7666 @cindex header field, @samp{X-Spam-Status:}
7668 @smallexample
7669 PATH=$PATH:/usr/bin/mh
7670 MAILDIR=$HOME/`mhparam Path`
7672 # Fight spam with SpamAssassin.
7673 :0fw
7674 | spamc
7676 # Anything with a spam level of 10 or more is junked immediately.
7678 * ^X-Spam-Level: ..........
7679 /dev/null
7682 * ^X-Spam-Status: Yes
7683 spam/.
7684 @end smallexample
7686 If you don't use @command{spamc}, use @samp{spamassassin -P -a}.
7688 Note that one of the recipes above throws away messages with a score
7689 greater than or equal to 10. Here's how you can determine a value that
7690 works best for you.
7692 First, run @samp{spamassassin -t} on every mail message in your
7693 archive and use @command{gnumeric} to verify that the average plus the
7694 standard deviation of good mail is under 5, the SpamAssassin default
7695 for ``spam''.
7697 Using @command{gnumeric}, sort the messages by score and view the
7698 messages with the highest score. Determine the score which encompasses
7699 all of your interesting messages and add a couple of points to be
7700 conservative. Add that many dots to the @samp{X-Spam-Level:} header
7701 field above to send messages with that score down the drain.
7703 In the example above, messages with a score of 5--9 are set aside in
7704 the @samp{+spam} folder for later review. The major weakness of
7705 rules-based filters is a plethora of false positives so it is
7706 worthwhile to check.
7708 @findex mh-junk-blacklist
7709 @findex mh-junk-whitelist
7710 @kindex J b
7711 @kindex J w
7713 If SpamAssassin classifies a message incorrectly, or is unsure, you can
7714 use the MH-E commands @kbd{J b} (@code{mh-junk-blacklist}) and
7715 @kbd{J w} (@code{mh-junk-whitelist}).
7717 @cindex @command{sa-learn}
7718 @cindex @file{.spamassassin/user_prefs}
7719 @cindex files, @file{.spamassassin/user_prefs}
7721 The command @kbd{J b} (@code{mh-junk-blacklist}) adds a
7722 @samp{blacklist_from} entry to @file{~/spamassassin/user_prefs},
7723 deletes the message, and sends the message to the Razor, so that
7724 others might not see this spam. If the @command{sa-learn} command is
7725 available, the message is also recategorized as spam.
7727 The command@kbd{J w} (@code{mh-junk-whitelist}) adds a
7728 @samp{whitelist_from} rule to @samp{~/.spamassassin/user_prefs}. If
7729 the @command{sa-learn} command is available, the message is also
7730 recategorized as ham.
7732 Over time, you'll observe that the same host or domain occurs
7733 repeatedly in the @samp{blacklist_from} entries, so you might think
7734 that you could avoid future spam by blacklisting all mail from a
7735 particular domain. The utility function
7736 @code{mh-spamassassin-identify-spammers} helps you do precisely that.
7737 This function displays a frequency count of the hosts and domains in
7738 the @samp{blacklist_from} entries from the last blank line in
7739 @file{~/.spamassassin/user_prefs} to the end of the file. This
7740 information can be used so that you can replace multiple
7741 @samp{blacklist_from} entries with a single wildcard entry such as:
7743 @smallexample
7744 blacklist_from *@@*amazingoffersdirect2u.com
7745 @end smallexample
7747 In versions of SpamAssassin (2.50 and on) that support a Bayesian
7748 classifier, @kbd{J b} @code{(mh-junk-blacklist}) uses the program
7749 @command{sa-learn} to recategorize the message as spam. Neither MH-E,
7750 nor SpamAssassin, rebuilds the database after adding words, so you
7751 will need to run @samp{sa-learn --rebuild} periodically. This can be
7752 done by adding the following to your @file{crontab}:
7754 @smallexample
7755 0 * * * *       sa-learn --rebuild > /dev/null 2>&1
7756 @end smallexample
7758 @subheading Bogofilter
7760 @cindex bogofilter
7761 @cindex spam filters, bogofilter
7763 Bogofilter is a Bayesian spam filtering program. Get it from your
7764 local distribution or from the
7765 @uref{http://bogofilter.sourceforge.net/, bogofilter web site}.
7767 Bogofilter is taught by running:
7769 @smallexample
7770 bogofilter -n < good-message
7771 @end smallexample
7773 on every good message, and
7775 @smallexample
7776 bogofilter -s < spam-message
7777 @end smallexample
7779 @cindex full training
7781 on every spam message. This is called a @dfn{full training}; three
7782 other training methods are described in the FAQ that is distributed
7783 with bogofilter. Note that most Bayesian filters need 1000 to 5000 of
7784 each type of message to start doing a good job.
7786 To use bogofilter, add the following recipes to @file{~/.procmailrc}:
7788 @cindex @samp{X-Bogosity:} header field
7789 @cindex header field, @samp{X-Bogosity:}
7791 @smallexample
7792 PATH=$PATH:/usr/bin/mh
7793 MAILDIR=$HOME/`mhparam Path`
7795 # Fight spam with Bogofilter.
7796 :0fw
7797 | bogofilter -3 -e -p
7800 * ^X-Bogosity: Yes, tests=bogofilter
7801 spam/.
7804 * ^X-Bogosity: Unsure, tests=bogofilter
7805 spam/unsure/.
7806 @end smallexample
7808 @findex mh-junk-blacklist
7809 @findex mh-junk-whitelist
7810 @kindex J b
7811 @kindex J w
7813 If bogofilter classifies a message incorrectly, or is unsure, you can
7814 use the MH-E commands @kbd{J b} (@code{mh-junk-blacklist}) and @kbd{J
7815 w} (@code{mh-junk-whitelist}) to update bogofilter's training.
7817 The @cite{Bogofilter FAQ} suggests that you run the following
7818 occasionally to shrink the database:
7820 @smallexample
7821 bogoutil -d wordlist.db | bogoutil -l wordlist.db.new
7822 mv wordlist.db wordlist.db.prv
7823 mv wordlist.db.new wordlist.db
7824 @end smallexample
7826 The @cite{Bogofilter tuning HOWTO} describes how you can fine-tune
7827 bogofilter.
7829 @subheading SpamProbe
7831 @cindex SpamProbe
7832 @cindex spam filters, SpamProbe
7834 SpamProbe is a Bayesian spam filtering program. Get it from your local
7835 distribution or from the @uref{http://spamprobe.sourceforge.net,
7836 SpamProbe web site}.
7838 To use SpamProbe, add the following recipes to @file{~/.procmailrc}:
7840 @cindex @command{formail}
7841 @cindex @samp{X-SpamProbe:} header field
7842 @cindex header field, @samp{X-SpamProbe:}
7844 @smallexample
7845 PATH=$PATH:/usr/bin/mh
7846 MAILDIR=$HOME/`mhparam Path`
7848 # Fight spam with SpamProbe.
7850 SCORE=| spamprobe receive
7852 :0 wf
7853 | formail -I "X-SpamProbe: $SCORE"
7856 *^X-SpamProbe: SPAM
7857 spam/.
7858 @end smallexample
7860 @findex mh-junk-blacklist
7861 @findex mh-junk-whitelist
7862 @kindex J b
7863 @kindex J w
7865 If SpamProbe classifies a message incorrectly, you can use the MH-E
7866 commands @kbd{J b} (@code{mh-junk-blacklist}) and @kbd{J w}
7867 (@code{mh-junk-whitelist}) to update SpamProbe's training.
7869 @subheading Other Things You Can Do
7871 There are a couple of things that you can add to @file{~/.procmailrc}
7872 in order to filter out a lot of spam and viruses. The first is to
7873 eliminate any message with a Windows executable (which is most likely
7874 a virus). The second is to eliminate mail in character sets that you
7875 can't read.
7877 @cindex @samp{Content-Transfer-Encoding:} header field
7878 @cindex @samp{Content-Type:} header field
7879 @cindex @samp{Subject:} header field
7880 @cindex header field, @samp{Content-Transfer-Encoding:}
7881 @cindex header field, @samp{Content-Type:}
7882 @cindex header field, @samp{Subject:}
7884 @smallexample
7885 PATH=$PATH:/usr/bin/mh
7886 MAILDIR=$HOME/`mhparam Path`
7889 # Filter messages with w32 executables/virii.
7891 # These attachments are base64 and have a TVqQAAMAAAAEAAAA//8AALg
7892 # pattern. The string "this program cannot be run in MS-DOS mode"
7893 # encoded in base64 is 4fug4AtAnNIbg and helps to avoid false
7894 # positives (Roland Smith via Pete from the bogofilter mailing list).
7896 :0 B:
7897 * ^Content-Transfer-Encoding:.*base64
7898 * ^TVqQAAMAAAAEAAAA//8AALg
7899 * 4fug4AtAnNIbg
7900 spam/exe/.
7903 # Filter mail in unreadable character sets (from the Bogofilter FAQ).
7905 UNREADABLE='[^?"]*big5|iso-2022-jp|ISO-2022-KR|euc-kr|gb2312|ks_c_5601-1987'
7908 * 1^0 $ ^Subject:.*=\?($UNREADABLE)
7909 * 1^0 $ ^Content-Type:.*charset="?($UNREADABLE)
7910 spam/unreadable/.
7913 * ^Content-Type:.*multipart
7914 * B ?? $ ^Content-Type:.*^?.*charset="?($UNREADABLE)
7915 spam/unreadable/.
7916 @end smallexample
7918 @node Miscellaneous, Scan Line Formats, Junk, Top
7919 @chapter Miscellaneous Commands, Variables, and Buffers
7921 This chapter covers the following command and the various MH-E
7922 buffers,
7924 @ftable @code
7925 @item mh-version
7926 Display version information about MH-E and the MH mail handling
7927 system.
7928 @end ftable
7930 @cindex buffers, @samp{*MH-E Info*}
7931 @cindex MH-E version
7932 @cindex @samp{*MH-E Info*}
7933 @cindex version
7934 @kindex M-x mh-version
7936 One command worth noting is @kbd{M-x mh-version}. You can compare the
7937 version this command prints to the latest release (@pxref{Getting
7938 MH-E}). The output of @kbd{M-x mh-version}, found in a buffer named
7939 @samp{*MH-E Info*}, should usually be included with any bug report you
7940 submit (@pxref{Bug Reports}).
7942 @subheading MH-E Buffers
7944 Besides the MH-Folder, MH-Show, and MH-Letter buffers, MH-E creates
7945 several other buffers. They are:
7947 @table @samp
7948 @cindex @samp{*MH-E Folders*}
7949 @cindex buffers, @samp{*MH-E Folders*}
7950 @findex mh-list-folders
7951 @item *MH-E Folders*
7952 @kindex F l
7953 This buffer contains the output of @kbd{F l} (@code{mh-list-folders}).
7954 @xref{Folders}.
7955 @c -------------------------
7956 @cindex @samp{*MH-E Help*}
7957 @cindex buffers, @samp{*MH-E Help*}
7958 @findex mh-help
7959 @item *MH-E Help*
7960 @kindex ?
7961 @kindex C-c ?
7962 This buffer contains the output of @kbd{?} (@code{mh-help}) and
7963 @kbd{C-c ?} in MH-Letter mode. @xref{Using This Manual}.
7964 @c -------------------------
7965 @cindex @samp{*MH-E Info*}
7966 @cindex buffers, @samp{*MH-E Info*}
7967 @item *MH-E Info*
7968 This buffer contains the output of @kbd{M-x mh-version @key{RET}}.
7969 @c -------------------------
7970 @cindex @samp{*MH-E Log*}
7971 @cindex buffers, @samp{*MH-E Log*}
7972 @item *MH-E Log*
7973 This buffer contains the last 100 lines of the output of the various
7974 MH commands.
7975 @c -------------------------
7976 @cindex @samp{*MH-E Mail Delivery*}
7977 @cindex buffers, @samp{*MH-E Mail Delivery*}
7978 @item *MH-E Mail Delivery*
7979 This buffer contains the transcript of a mail delivery. @xref{Sending
7980 Message}.
7981 @c -------------------------
7982 @cindex @samp{*MH-E Recipients*}
7983 @cindex buffers, @samp{*MH-E Recipients*}
7984 @findex mh-check-whom
7985 @item *MH-E Recipients*
7986 @kindex C-c C-w
7987 This buffer contains the output of @kbd{C-c C-w}
7988 (@code{mh-check-whom}) and is killed when draft is sent.
7989 @xref{Checking Recipients}.
7990 @c -------------------------
7991 @cindex @samp{*MH-E Sequences*}
7992 @cindex buffers, @samp{*MH-E Sequences*}
7993 @item *MH-E Sequences*
7994 This buffer contains the output of @kbd{S l}
7995 (@code{mh-list-sequences}). @xref{Sequences}.
7996 @c -------------------------
7997 @cindex @samp{*mh-temp*}
7998 @cindex buffers, @samp{*mh-temp*}
7999 @item *mh-temp*
8000 This is a scratch, ephemeral, buffer used by MH-E functions. Note that
8001 it is hidden because the first character in the name is a space.
8002 You'll generally not have any need for this buffer.
8003 @end table
8005 @node Scan Line Formats, Procmail, Miscellaneous, Top
8006 @appendix Scan Line Formats
8008 @cindex scan line formats
8010 This appendix discusses how MH-E creates, parses, and manipulates scan
8011 lines. If you have your own MH scan or inc format files, you
8012 @strong{can} teach MH-E how to handle them, but it isn't easy as
8013 you'll see.
8015 @cindex @samp{mh-scan-line-formats} customization group
8016 @cindex customization group, @samp{mh-scan-line-formats}
8018 This table lists the options in the @samp{mh-scan-line-formats}
8019 customization group.
8021 @vtable @code
8022 @item mh-adaptive-cmd-note-flag
8023 On means that the message number width is determined dynamically
8024 (default: @samp{on}).
8025 @c -------------------------
8026 @item mh-scan-format-file
8027 Specifies the format file to pass to the scan program (default:
8028 @samp{Use MH-E scan Format}).
8029 @c -------------------------
8030 @item mh-scan-prog
8031 Program used to scan messages (default: @code{"scan"}).
8032 @end vtable
8034 @vindex mh-adaptive-cmd-note-flag
8036 There are a couple of caveats when creating your own scan format file.
8037 First, MH-E will not work if your scan lines do not include message
8038 numbers. It will work poorly if you don't dedicate a column for
8039 showing the current message and notations. It is also best to keep the
8040 first column empty to make room for the cursor and so that text isn't
8041 obscured by the current message's overlay arrow when running in a
8042 terminal. You won't be able to use the option
8043 @code{mh-adaptive-cmd-note-flag} or the threading features
8044 (@pxref{Threading}).
8046 @cindex message numbers
8047 @findex mh-set-cmd-note
8048 @vindex mh-adaptive-cmd-note-flag
8049 @vindex mh-scan-format-file
8051 If you've created your own format to handle long message numbers,
8052 you'll be pleased to know you no longer need it since MH-E adapts its
8053 internal format based upon the largest message number if
8054 @code{mh-adaptive-cmd-note-flag} is on (the default). If you prefer
8055 fixed-width message numbers, turn off @code{mh-adaptive-cmd-note-flag}
8056 and call @code{mh-set-cmd-note} with the width specified by your
8057 format file (see @code{mh-scan-format-file}). For example, the default
8058 width is 4, so you would use @samp{(mh-set-cmd-note 4)}.
8060 @vindex mh-adaptive-cmd-note-flag
8061 @vindex mh-scan-format-file
8062 @vindex mh-scan-format-mh
8063 @vindex mh-scan-format-nmh
8065 The default setting for @code{mh-scan-format-file} is @samp{Use MH-E
8066 scan Format}. This means that the format string will be taken from the
8067 either @code{mh-scan-format-mh} or @code{mh-scan-format-nmh} depending
8068 on whether MH or nmh (or GNU mailutils MH) is in use. This setting
8069 also enables you to turn on the option
8070 @code{mh-adaptive-cmd-note-flag}. You can also set this option to
8071 @samp{Use Default scan Format} to get the same output as you would get
8072 if you ran @command{scan} from the shell. If you have a format file
8073 that you want MH-E to use but not MH, you can set this option to
8074 @samp{Specify a scan Format File} and enter the name of your format
8075 file.
8077 @vindex mh-scan-format-file
8078 @vindex mh-scan-format-mh
8079 @vindex mh-scan-format-nmh
8081 The scan format that MH-E uses when @code{mh-scan-format-file} is set
8082 to its default of @samp{Use MH-E scan Format} is held in the variables
8083 @code{mh-scan-format-nmh} and @code{mh-scan-format-mh} depending on
8084 whether you are using nmh (or GNU mailutils MH) or not. Typically, you
8085 create your own format files rather than modifying these variables.
8086 The value of @code{mh-scan-format-nmh} is:
8088 @smallexample
8089 (concat
8090  "%4(msg)"
8091  "%<(cur)+%| %>"
8092  "%<@{replied@}-"
8093  "%?(nonnull(comp@{to@}))%<(mymbox@{to@})t%>"
8094  "%?(nonnull(comp@{cc@}))%<(mymbox@{cc@})c%>"
8095  "%?(nonnull(comp@{bcc@}))%<(mymbox@{bcc@})b%>"
8096  "%?(nonnull(comp@{newsgroups@}))n%>"
8097  "%<(zero) %>"
8098  "%02(mon@{date@})/%02(mday@{date@})%<@{date@} %|*%>"
8099  "%<(mymbox@{from@})%<@{to@}To:%14(decode(friendly@{to@}))%>%>"
8100  "%<(zero)%17(decode(friendly@{from@}))%>  "
8101  "%(decode@{subject@})%<@{body@}<<%@{body@}%>")
8102 @end smallexample
8104 @cindex decoding RFC 2047
8105 @cindex RFC 2047, decoding
8106 @vindex mh-scan-format-mh
8108 The setting for @code{mh-scan-format-mh} is similar, except that MH
8109 doesn't have the function @code{decode} (which is used to decode RFC
8110 2047 encodings).
8112 @cindex notations, scan line
8113 @cindex scan line notations
8115 These strings are passed to the @command{scan} program via the
8116 @option{-format} argument. The formats are identical to the defaults
8117 except that additional hints for fontification have been added to the
8118 existing notations in the fifth column (remember that in Emacs, the
8119 columns start at 0). The values of the fifth column, in priority
8120 order, are: @samp{-} if the message has been replied to, @samp{t} if
8121 an address in the @samp{To:} field matches one of the mailboxes of the
8122 current user, @samp{c} if the @samp{Cc:} field matches, @samp{b} if
8123 the @samp{Bcc:} field matches, and @samp{n} if a non-empty
8124 @samp{Newsgroups:} field is present.
8126 @cindex @command{scan}
8127 @cindex MH commands, @command{scan}
8128 @vindex mh-progs
8129 @vindex mh-scan-prog
8131 The name of the program that generates a listing of one line per
8132 message is held in @code{mh-scan-prog} (default: @code{"scan"}).
8133 Unless this variable contains an absolute pathname, it is assumed to
8134 be in the @code{mh-progs} directory (@pxref{Getting Started}). You may
8135 link another program to @command{scan} (see @samp{mh-profile}(5)) to
8136 produce a different type of listing@footnote{See the section
8137 @uref{@value{MH-BOOK-HOME}/faswsprs.html, Find and Specify with scan
8138 pick Ranges Sequences} in the MH book.}.
8140 @cindex regular expressions, scan line formats
8141 @findex mh-set-cmd-note
8142 @findex setq
8144 If you change the format of the scan lines you'll need to tell MH-E
8145 how to parse the new format. As you will see, quite a lot of variables
8146 are involved to do that. Use @kbd{M-x apropos @key{RET}
8147 mh-scan.*regexp @key{RET}} to obtain a list of these variables. You
8148 will also have to call @code{mh-set-cmd-note} if your notations are
8149 not in column 4 (columns in Emacs start with 0). Note that unlike most
8150 of the user options described in this manual, these are variables and
8151 must be set with @code{setq} instead of in a customization buffer. For
8152 help with regular expressions, see
8153 @ifnothtml
8154 @ref{Regexps, , Syntax of Regular Expressions, emacs, The
8155 GNU Emacs Manual}.
8156 @end ifnothtml
8157 @ifhtml
8158 section
8159 @uref{http://www.gnu.org/software/emacs/manual/html_node/emacs/Regexps.html,
8160 Syntax of Regular Expressions} in @cite{The GNU Emacs Manual}.
8161 @end ifhtml
8163 The first variable has to do with pruning out garbage.
8165 @vtable @code
8166 @cindex @command{inc}
8167 @cindex MH commands, @command{inc}
8168 @cindex @command{scan}
8169 @cindex MH commands, @command{scan}
8170 @item mh-scan-valid-regexp
8171 This regular expression describes a valid scan line. This is used to
8172 eliminate error messages that are occasionally produced by
8173 @command{inc}@footnote{See the section
8174 @uref{@value{MH-BOOK-HOME}/reapre.html, Reading Mail: inc show next
8175 prev} in the MH book.} or @command{scan} (default: @code{"^ *[0-9]"}).
8176 @end vtable
8178 Next, many variables control how the scan lines are parsed.
8180 @vtable @code
8181 @vindex mh-folder-body
8182 @vindex mh-folder-font-lock-keywords
8183 @item mh-scan-body-regexp
8184 This regular expression matches the message body fragment. Note that
8185 the default setting of @code{mh-folder-font-lock-keywords} expects
8186 this expression to contain at least one parenthesized expression which
8187 matches the body text as in the default of
8188 @code{"\\(<<\\([^\n]+\\)?\\)"}. If this regular expression is not
8189 correct, the body fragment will not be highlighted with the face
8190 @code{mh-folder-body}.
8191 @c -------------------------
8192 @vindex mh-folder-cur-msg-number
8193 @vindex mh-folder-font-lock-keywords
8194 @vindex mh-note-cur
8195 @item mh-scan-cur-msg-number-regexp
8196 This regular expression matches the current message. It must match
8197 from the beginning of the line. Note that the default setting of
8198 @code{mh-folder-font-lock-keywords} expects this expression to contain
8199 at least one parenthesized expression which matches the message number
8200 as in the default of @w{@code{"^\\( *[0-9]+\\+\\).*"}}. This
8201 expression includes the leading space and current message marker
8202 @samp{+} within the parenthesis since it looks better to highlight
8203 these items as well. The highlighting is done with the face
8204 @code{mh-folder-cur-msg-number}. This regular expression should be
8205 correct as it is needed by non-fontification functions. See also
8206 @code{mh-note-cur}.
8207 @c -------------------------
8208 @vindex mh-folder-date
8209 @vindex mh-folder-font-lock-keywords
8210 @vindex mh-scan-sent-to-me-sender-regexp
8211 @item mh-scan-date-regexp
8212 This regular expression matches a valid date. It must @strong{not} be
8213 anchored to the beginning or the end of the line. Note that the
8214 default setting of @code{mh-folder-font-lock-keywords} expects this
8215 expression to contain only one parenthesized expression which matches
8216 the date field as in the default of
8217 @code{"\\([0-9][0-9]/[0-9][0-9]\\)"}. If this regular expression is
8218 not correct, the date will not be highlighted with the face
8219 @code{mh-folder-date}.
8220 @c -------------------------
8221 @vindex mh-folder-deleted
8222 @vindex mh-folder-font-lock-keywords
8223 @vindex mh-note-deleted
8224 @item mh-scan-deleted-msg-regexp
8225 This regular expression matches deleted messages. It must match from
8226 the beginning of the line. Note that the default setting of
8227 @code{mh-folder-font-lock-keywords} expects this expression to contain
8228 at least one parenthesized expression which matches the message number
8229 as in the default of @code{"^\\( *[0-9]+\\)D"}. This expression
8230 includes the leading space within the parenthesis since it looks
8231 better to highlight it as well. The highlighting is done with the face
8232 @code{mh-folder-deleted}. This regular expression should be correct as
8233 it is needed by non-fontification functions. See also
8234 @code{mh-note-deleted}.
8235 @c -------------------------
8236 @vindex mh-folder-font-lock-keywords
8237 @vindex mh-folder-msg-number
8238 @item mh-scan-good-msg-regexp
8239 This regular expression matches ``good'' messages. It must match from
8240 the beginning of the line. Note that the default setting of
8241 @code{mh-folder-font-lock-keywords} expects this expression to contain
8242 at least one parenthesized expression which matches the message number
8243 as in the default of @w{@code{"^\\( *[0-9]+\\)[^D^0-9]"}}. This
8244 expression includes the leading space within the parenthesis since it
8245 looks better to highlight it as well. The highlighting is done with
8246 the face @code{mh-folder-msg-number}. This regular expression should
8247 be correct as it is needed by non-fontification functions.
8248 @c -------------------------
8249 @vindex mh-scan-format-file
8250 @item mh-scan-msg-format-regexp
8251 This regular expression finds the message number width in a scan
8252 format. Note that the message number must be placed in a parenthesized
8253 expression as in the default of @code{"%\\([0-9]*\\)(msg)"}. This
8254 variable is only consulted if @code{mh-scan-format-file} is set to
8255 @samp{Use MH-E scan Format}.
8256 @c -------------------------
8257 @vindex mh-scan-format-file
8258 @item mh-scan-msg-format-string
8259 This is a format string for the width of the message number in a scan
8260 format. Use @samp{0%d} for zero-filled message numbers. This variable
8261 is only consulted if @code{mh-scan-format-file} is set to @samp{Use
8262 MH-E scan Format} (default: @code{"%d"}).
8263 @c -------------------------
8264 @item mh-scan-msg-number-regexp
8265 This regular expression extracts the message number. It must match
8266 from the beginning of the line. Note that the message number must be
8267 placed in a parenthesized expression as in the default of @w{@code{"^
8268 *\\([0-9]+\\)"}}.
8269 @c -------------------------
8270 @item mh-scan-msg-overflow-regexp
8271 This regular expression matches overflowed message numbers (default:
8272 @code{"^[?0-9][0-9]"}).
8273 @c -------------------------
8274 @item mh-scan-msg-search-regexp
8275 This regular expression matches a particular message. It is a format
8276 string; use @samp{%d} to represent the location of the message number
8277 within the expression as in the default of @code{"^[^0-9]*%d[^0-9]"}.
8278 @c -------------------------
8279 @vindex mh-folder-address
8280 @vindex mh-folder-font-lock-keywords
8281 @vindex mh-folder-to
8282 @item mh-scan-rcpt-regexp
8283 This regular expression specifies the recipient in messages you sent.
8284 Note that the default setting of @code{mh-folder-font-lock-keywords}
8285 expects this expression to contain two parenthesized expressions. The
8286 first is expected to match the @samp{To:} that the default scan format
8287 file generates. The second is expected to match the recipient's name
8288 as in the default of @code{"\\(To:\\)\\(..............\\)"}. If this
8289 regular expression is not correct, the @samp{To:} string will not be
8290 highlighted with the face @code{mh-folder-to} and the recipient will not be
8291 highlighted with the face @code{mh-folder-address}.
8292 @c -------------------------
8293 @vindex mh-folder-font-lock-keywords
8294 @vindex mh-folder-refiled
8295 @vindex mh-note-refiled
8296 @item mh-scan-refiled-msg-regexp
8297 This regular expression matches refiled messages. It must match from
8298 the beginning of the line. Note that the default setting of
8299 @code{mh-folder-font-lock-keywords} expects this expression to contain
8300 at least one parenthesized expression which matches the message number
8301 as in the default of @w{@code{"^\\( *[0-9]+\\)\\^"}}. This expression
8302 includes the leading space within the parenthesis since it looks
8303 better to highlight it as well. The highlighting is done with the face
8304 @code{mh-folder-refiled}. This regular expression should be correct as
8305 it is needed by non-fontification functions. See also
8306 @code{mh-note-refiled}.
8307 @c -------------------------
8308 @vindex mh-folder-font-lock-keywords
8309 @vindex mh-folder-sent-to-me-sender
8310 @vindex mh-mh-folder-sent-to-me-hint
8311 @vindex mh-scan-format-nmh
8312 @item mh-scan-sent-to-me-sender-regexp
8313 This regular expression matches messages sent to us. Note that the
8314 default setting of @code{mh-folder-font-lock-keywords} expects this
8315 expression to contain at least two parenthesized expressions. The
8316 first should match the fontification hint (see
8317 @code{mh-scan-format-nmh}) and the second should match the user name
8318 as in the default of
8319 @w{@code{"^ *[0-9]+.\\([bct]\\).....[ ]*\\(..................\\)"}}.
8320 If this regular expression is not correct, the notation hints will not
8321 be highlighted with the face @code{mh-mh-folder-sent-to-me-hint} and
8322 the sender will not be highlighted with the face
8323 @code{mh-folder-sent-to-me-sender}.
8324 @c -------------------------
8325 @vindex mh-folder-followup
8326 @vindex mh-folder-font-lock-keywords
8327 @vindex mh-folder-subject
8328 @item mh-scan-subject-regexp
8329 This regular expression matches the subject. It must match from the
8330 beginning of the line. Note that the default setting of
8331 @samp{mh-folder-font-lock-keywords} expects this expression to contain
8332 at least three parenthesized expressions. The first is expected to
8333 match the @samp{Re:} string, if any, and is highlighted with the face
8334 @code{mh-folder-followup}. The second matches an optional bracketed
8335 number after @samp{Re:}, such as in @samp{Re[2]:} (and is thus a
8336 sub-expression of the first expression). The third is expected to
8337 match the subject line itself which is highlighted with the face
8338 @code{mh-folder-subject}. For example, the default is
8339 @w{@code{"^ *[0-9]+........[ ]*...................}}@*
8340 @w{@code{\\([Rr][Ee]\\(\\[[0-9]+\\]\\)?:\\s-*\\)*\\([^<\n]*\\)"}}.
8341 This regular expression should be correct as it is needed by
8342 non-fontification functions. Note that this example is broken up on
8343 two lines for readability, but is actually a single string.
8344 @end vtable
8346 Finally, there are a slew of variables that control how MH-E annotates
8347 the scan lines.
8349 @vtable @code
8350 @findex mh-set-cmd-note
8351 @vindex mh-adaptive-cmd-note-flag
8352 @item mh-cmd-note
8353 Column for notations (default: 4). This variable should be set with
8354 the function @code{mh-set-cmd-note}. This variable may be updated
8355 dynamically if @code{mh-adaptive-cmd-note-flag} is on. The following
8356 variables contain the notational characters. Note that columns in
8357 Emacs start with 0.
8358 @c -------------------------
8359 @item mh-note-copied
8360 Messages that have been copied are marked by this character (default:
8361 @code{?C}).
8362 @c -------------------------
8363 @vindex mh-scan-cur-msg-number-regexp
8364 @item mh-note-cur
8365 The current message (in MH, not in MH-E) is marked by this character
8366 (default: @code{?+}). See also @code{mh-scan-cur-msg-number-regexp}.
8367 @c -------------------------
8368 @vindex mh-scan-deleted-msg-regexp
8369 @item mh-note-deleted
8370 Messages that have been deleted are marked by this character (default:
8371 @code{?D}). See also @code{mh-scan-deleted-msg-regexp}.
8372 @c -------------------------
8373 @item mh-note-dist
8374 Messages that have been redistributed are marked by this character
8375 (default: @code{?R}).
8376 @c -------------------------
8377 @item mh-note-forw
8378 Messages that have been forwarded are marked by this character
8379 (default: @code{?F}).
8380 @c -------------------------
8381 @item mh-note-printed
8382 Messages that have been printed are marked by this character (default:
8383 @code{?P}).
8384 @c -------------------------
8385 @vindex mh-scan-refiled-msg-regexp
8386 @item mh-note-refiled
8387 Messages that have been refiled are marked by this character (default:
8388 @code{?^}). See also @code{mh-scan-refiled-msg-regexp}.
8389 @c -------------------------
8390 @item mh-note-repl
8391 Messages that have been replied to are marked by this character
8392 (default: @code{?-}).
8393 @c -------------------------
8394 @item mh-note-seq
8395 Messages in a user-defined sequence are marked by this character
8396 (default: @code{?%}). Messages in the @samp{search} sequence are
8397 marked by this character as well.
8398 @end vtable
8400 For example, let's say I have the following in @file{scan.format}
8401 which displays the sender, the subject, and the message number. This
8402 format places a @samp{+} after the message number for the current
8403 message according to MH; it also uses that column for notations.
8405 @smallexample
8406 %20(decode(friendly@{from@})) %50(decode@{subject@})  %4(msg)%<(cur)+%| %>
8407 @end smallexample
8409 @vindex mh-adaptive-cmd-note-flag
8410 @vindex mh-scan-format-file
8411 @vindex mh-scan-format-file, example
8413 The first thing you have to do is tell MH-E to use this file.
8414 Customize @code{mh-scan-format-file} and set its value to @samp{Use
8415 Default scan Format}. If you didn't get already turn off
8416 @code{mh-adaptive-cmd-note-flag}, you'll need to do that first.
8418 Next, tell MH-E what a valid scan line looks like so that you can at
8419 least display the output of scan in your MH-Folder buffer.
8421 @vindex mh-scan-valid-regexp, example
8423 @smalllisp
8424 (setq mh-scan-valid-regexp "[0-9]+[+D^ ]$")
8425 @end smalllisp
8427 Now, in order to get rid of the @samp{Cursor not pointing to message}
8428 message, you need to tell MH-E how to access the message number. You
8429 should also see why MH-E requires that you include a message number in
8430 the first place.
8432 @vindex mh-scan-msg-number-regexp, example
8433 @vindex mh-scan-msg-search-regexp, example
8435 @smalllisp
8436 (setq mh-scan-msg-number-regexp "^.* \\([0-9]+\\)[+D^ ]$")
8437 (setq mh-scan-msg-search-regexp " %d[+D^ ]$")
8438 @end smalllisp
8440 In order to get the next and previous commands working, add this.
8442 @vindex mh-scan-good-msg-regexp, example
8444 @smalllisp
8445 (setq mh-scan-good-msg-regexp "^.* \\([0-9]+\\)[+D^ ]$")
8446 @end smalllisp
8448 Note that the current message isn't marked with a @samp{+} when moving
8449 between the next and previous messages. Here is the code required to
8450 get this working.
8452 @vindex set-mh-cmd-note, example
8453 @vindex mh-scan-cur-msg-number-regexp, example
8455 @smalllisp
8456 (set-mh-cmd-note 76)
8457 (setq mh-scan-cur-msg-number-regexp "^.* \\([0-9]+\\)\\+$")
8458 @end smalllisp
8460 Finally, add the following to delete and refile messages.
8462 @vindex mh-scan-deleted-msg-regexp, example
8463 @vindex mh-scan-refiled-msg-regexp, example
8465 @smalllisp
8466 (setq mh-scan-deleted-msg-regexp "^.* \\([0-9]+\\)D$")
8467 (setq mh-scan-refiled-msg-regexp "^.* \\([0-9]+\\)\\^$")
8468 @end smalllisp
8470 This is just a bare minimum; it's best to adjust all of the regular
8471 expressions to ensure that MH-E and highlighting perform well.
8473 @node Procmail, Odds and Ends, Scan Line Formats, Top
8474 @appendix Reading Mailing Lists Effectively
8476 @cindex @command{procmail}
8477 @cindex @command{slocal}
8478 @cindex Gnus
8479 @cindex MH commands, @command{slocal}
8480 @cindex Unix commands, @command{procmail}
8481 @cindex mailing lists, reading
8483 This appendix explains how to use @uref{http://www.procmail.org/,
8484 procmail} to file mail from mailing lists into folders which can then
8485 be read easily with MH-E@footnote{The MH equivalent, @command{slocal},
8486 can be used as well, but procmail is more flexible and more packages
8487 exist for procmail than for slocal.}. Some mailing lists have such
8488 high traffic that Gnus must be used and I discuss how to use Gnus
8489 side-by-side with MH-E.
8491 @cindex @file{.procmailrc}
8492 @cindex files, @file{.procmailrc}
8494 First, I'll describe how to put mail from your mailing lists directly
8495 into an MH folder using @command{procmail}. First, add the following
8496 to @file{~/.procmailrc}. While the logging variables aren't strictly
8497 necessary, they are extremely useful.
8499 @smallexample
8500 [1]  # Update PATH so procmail can find myrcvstore, rcvstore and mhparam.
8501 [2]  PATH=$PATH:/usr/lib/mh:/usr/bin/mh:$HOME/bin
8503 [4]  # Point LOGFILE at the actual log file.
8504 [5]  LOGFILE=$HOME/.procmail.log
8506 [7]  # This setting provides just the right amount of information.
8507 [8]  LOGABSTRACT=all
8509 [10] # Uncomment the following line to see how your patterns match.
8510 [11] #VERBOSE=yes
8511 [12]
8512 [13] # Place mail sent to any MH-E mailing list in +mh-e.
8513 [14] :0 w: mh-e$LOCKEXT
8514 [15] * ^TO.*mh-e-.*@@.*sourceforge.net
8515 [16] | myrcvstore -create +mh-e
8516 @end smallexample
8518 @cindex @command{rcvstore}
8519 @cindex MH commands, @command{rcvstore}
8521 Line 14 creates a lock file in your mail directory based upon the name
8522 of the folder. This is done because @command{rcvstore} does not
8523 perform locking. While this lock file will prevent @command{procmail}
8524 from writing to a folder concurrently, there is a slight chance that
8525 you might lose a message if you're performing operations on a folder
8526 at the same time @command{rcvstore} is placing a message there. You
8527 have been warned. Now that that disclaimer is out of the way, note
8528 that I've been using this set-up for over a decade and haven't lost
8529 anything to my knowledge@footnote{See
8530 @uref{https://savannah.nongnu.org/bugs/?func=detailbug&bug_id=4361&group_id=2166,
8531 Savannah issue #4361} to see if @command{rcvstore} locking is still an
8532 issue.}.
8534 @cindex @samp{Unseen-Sequence:} MH profile component
8535 @cindex MH profile component, @samp{Unseen-Sequence:}
8537 Line 16 uses the following script, @code{myrcvstore}, to massage the
8538 message as described in the comment and file the message in the given
8539 folder@footnote{The @samp{-create} argument wasn't always the default
8540 to @command{rcvstore}.}.
8542 @smallexample
8543 #! /bin/sh
8545 # Accepts a message on standard input and passes it through rcvstore
8546 # after first passing it through any filters. All arguments are passed
8547 # on to rcvstore.
8549 # Force the "From user date" to become part of header. One reason this
8550 # is done is because the presence of the From field confuses dist so
8551 # that dist adds a new header, rather than using the existing header.
8552 # Note that this should not be done for any message that goes into a
8553 # Gnus incoming file (Gnus will thrown an error) nor should it be
8554 # applied to any message that goes to the system mailbox because the
8555 # entire mailbox will be incorporated as a single message.
8556 formail -c -z -R 'From ' X-Envelope-From: |
8557 rcvstore $@@
8558 @end smallexample
8560 If your version of @command{rcvstore} doesn't add messages to the
8561 @samp{unseen} sequence by default, add the following line to your MH
8562 profile:
8564 @smallexample
8565 Unseen-Sequence: unseen
8566 @end smallexample
8568 Now view your new messages with the speedbar (@pxref{Speedbar}) or with
8569 @kbd{F n} (@code{mh-index-new-messages}). @xref{Folders}.
8571 If you're on a mailing list that is so voluminous that it is
8572 impossible to read every message, it usually better to read the
8573 mailing list like a newsgroup in a news reader. Emacs has a built-in
8574 newsreader called Gnus. The remainder of this appendix talks about how
8575 to use Gnus with an MH message store. The version of Gnus that was
8576 used to prepare this manual was 5.10. Versions 5.8 through 5.10 should
8577 work but versions prior to 5.8 use different options.
8579 This table contains a list of Gnus options that you will have to
8580 modify. Note that for them to become accessible, you'll have to load
8581 @file{nnml.el} first. This can be done with @kbd{M-x load-library
8582 @key{RET} nnml @key{RET}}.
8584 @vtable @code
8585 @item gnus-secondary-select-methods
8586 Select the @samp{nnml} value. This select method uses directories for
8587 folders and individual files for messages, just like MH@. You do not
8588 have to set an address.
8589 @c -------------------------
8590 @item mail-sources
8591 Select the @samp{Several files in a directory} value, check the
8592 @samp{Path} box and enter @file{~/Mail} to tell Gnus where to find
8593 your mail.
8594 @c -------------------------
8595 @vindex mail-user-agent
8596 @item message-mail-user-agent
8597 In order to send mail within Gnus using MH-E, set this option to
8598 @samp{mail-user-agent} and set the @code{mail-user-agent} option to
8599 @samp{Emacs interface to MH}.
8600 @c -------------------------
8601 @item nnmail-keep-last-article
8602 Since Gnus keeps track of which messages you have read, it would be
8603 bad if Gnus expired the last message, for example, message 100, and
8604 @command{rcvstore} gave the next new message number 1. Gnus would then
8605 ignore it since it thinks that you've read messages 1--100. Turning on
8606 this option ensures that the last message is never removed thereby
8607 eliminating this problem.
8608 @end vtable
8610 Next add the following to @file{~/.procmailrc}. If you don't subscribe
8611 to the GnuCash mailing list, substitute one to which you are
8612 subscribed.
8614 @smallexample
8615 PATH=$PATH:/usr/bin/mh
8616 MAILDIR=$HOME/`mhparam Path`
8617 # Place mail sent to the GnuCash mailing list in gnucash.spool, where
8618 # Gnus will pick it up.
8620 * ^TO.*gnucash.*@@.*gnucash.org
8621 gnucash.spool
8622 @end smallexample
8624 Wait for some messages to appear in @file{gnucash.spool} and run Gnus
8625 with @kbd{M-x gnus @key{RET}}. To view the folder created in the
8626 example above, you would tell Gnus about it the first time only with
8627 @kbd{G m gnucash @key{RET} nnml @key{RET}}. In MH-E, this folder is
8628 known as @samp{+gnucash}.
8630 @node Odds and Ends, History, Procmail, Top
8631 @appendix Odds and Ends
8633 This appendix covers a few topics that don't fit elsewhere. Here I
8634 tell you how to report bugs and how to get on the MH-E mailing lists.
8635 I also point out some additional sources of information.
8637 @menu
8638 * Bug Reports::
8639 * Mailing Lists::
8640 * MH FAQ and Support::
8641 * Getting MH-E::
8642 @end menu
8644 @node Bug Reports, Mailing Lists, Odds and Ends, Odds and Ends
8645 @appendixsec Bug Reports
8647 @cindex bugs
8648 @cindex SourceForge
8649 @kindex M-x mh-version
8651 Bug reports should be filed at
8652 @uref{https://sourceforge.net/tracker/?group_id=13357&atid=113357,
8653 SourceForge}. You need to be a SourceForge user to submit bug reports,
8654 but this is easy enough to do that it shouldn't be a restriction for
8655 you. Please include the output of @kbd{M-x mh-version}
8656 (@pxref{Miscellaneous}) in any bug report you send unless you're 110%
8657 positive we won't ask for it.
8659 @node Mailing Lists, MH FAQ and Support, Bug Reports, Odds and Ends
8660 @appendixsec MH-E Mailing Lists
8662 @cindex SourceForge
8663 @cindex mailing lists
8665 There are several mailing lists for MH-E@. They are @i{mh-e-users at
8666 lists.sourceforge.net}, @i{mh-e-announce at lists.sourceforge.net},
8667 and @i{mh-e-devel at lists.sourceforge.net}. You can subscribe or view
8668 the archives at @uref{https://sourceforge.net/mail/?group_id=13357,
8669 SourceForge}. Do not report bugs on these lists; please submit them
8670 via SourceForge (@pxref{Bug Reports}).
8672 @node MH FAQ and Support, Getting MH-E, Mailing Lists, Odds and Ends
8673 @appendixsec MH FAQ and Support
8675 @cindex FAQ
8676 @cindex MH FAQ
8678 The article @uref{http://www.newt.com/faq/mh.html, @cite{MH Frequently
8679 Asked Questions (FAQ) with Answers}} appears monthly in the newsgroup
8680 @samp{comp.mail.mh}. While very little is there that deals with MH-E
8681 specifically, there is an incredible wealth of material about MH
8682 itself which you will find useful.
8684 @cindex support
8686 You can find FAQs on MH-E at the
8687 @uref{https://sourceforge.net/tracker/?group_id=13357&atid=213357,
8688 Support Requests} page on SourceForge. If you don't find the answer to
8689 your question, file a support request and your question will become a
8690 new FAQ!
8692 @node Getting MH-E,  , MH FAQ and Support, Odds and Ends
8693 @appendixsec Getting MH-E
8695 @cindex MH-E, obtaining
8696 @cindex getting MH-E
8697 @cindex obtaining MH-E
8699 Because MH-E is undergoing a phase of sustained growth, the version of
8700 MH-E in your Emacs is likely to be out of date although it is most
8701 likely to be more up to date than the copy that comes with the MH
8702 distribution in @file{miscellany/mh-e}.
8704 @cindex change log
8705 @cindex release notes
8707 New MH-E releases are always available for downloading at
8708 @uref{https://sourceforge.net/project/showfiles.php?group_id=13357,
8709 SourceForge} before they appear in an Emacs release. You can read the
8710 release notes on that page to determine if the given release of MH-E
8711 is already installed in your version of Emacs. You can also read the
8712 change log to see if you are interested in what the given release of
8713 MH-E has to offer (although we have no doubt that you will be
8714 extremely interested in all new releases).
8716 @cindex Debian
8718 If you use Debian, you can install the Debian
8719 @uref{http://packages.debian.org/unstable/mail/mh-e, mh-e package}
8720 instead.
8722 @cindex files, @samp{MH-E-NEWS}
8723 @cindex files, @samp{README}
8724 @cindex news
8725 @cindex @samp{MH-E-NEWS}
8726 @cindex @samp{README}
8727 @kindex M-x mh-version
8729 After you download and extract the MH-E tarball, read the
8730 @file{README} file and @file{MH-E-NEWS}. These correspond to the
8731 release notes and change log mentioned above. The file @file{README}
8732 contains instructions on installing MH-E@. If you're already running
8733 Emacs, please quit that session and start again to load in the new
8734 MH-E@. Check that you're running the new version with the command
8735 @kbd{M-x mh-version}.
8737 @cindex contributed software
8738 @cindex manual
8739 @cindex documentation
8741 In addition to the mh-e package, the
8742 @uref{https://sourceforge.net/project/showfiles.php?group_id=13357,
8743 SourceForge} site also contains doc and contrib packages. The former
8744 is the latest release of this manual, and the latter contains a few
8745 contributed packages you might find useful.
8747 @node History, GFDL, Odds and Ends, Top
8748 @appendix History of MH-E
8750 @cindex Bill Wohler
8751 @cindex Brian Reid
8752 @cindex Gildea, Stephen
8753 @cindex Jim Larus
8754 @cindex Larus, Jim
8755 @cindex MH-E, versions
8756 @cindex Reid, Brian
8757 @cindex SourceForge
8758 @cindex Stephen Gildea
8759 @cindex Wohler, Bill
8760 @cindex history of MH-E
8761 @cindex versions of MH-E
8763 MH-E was originally written by Brian Reid in 1983 and has changed
8764 hands several times since then. Jim Larus wanted to do something
8765 similar for GNU Emacs, and ended up completely rewriting it that same
8766 year. In 1989, Stephen Gildea picked it up and added many
8767 improvements. Bill Wohler then took over in 2000 and moved its
8768 development to @uref{http://sourceforge.net/, SourceForge} where it
8769 lives today.
8771 @menu
8772 * From Brian Reid::
8773 * From Jim Larus::
8774 * From Stephen Gildea::
8775 * From Bill Wohler::
8776 @end menu
8778 @node From Brian Reid, From Jim Larus, History, History
8779 @appendixsec From Brian Reid
8781 @cindex Brian Reid
8782 @cindex Reid, Brian
8784 One day in 1983 I got the flu and had to stay home from work for three
8785 days with nothing to do. I used that time to write MHE@. The
8786 fundamental idea behind MHE was that it was a ``puppeteer'' driving
8787 the MH programs underneath it. MH had a model that the editor was
8788 supposed to run as a sub-process of the mailer, which seemed to me at
8789 the time to be the tail wagging the dog. So I turned it around and
8790 made the editor drive the MH programs. I made sure that the UCI people
8791 (who were maintaining MH at the time) took in my changes and made them
8792 stick.
8794 Today, I still use my own version of MHE because I don't at all like
8795 the way that GNU MH-E works and I've never gotten to be good enough at
8796 hacking Emacs Lisp to make GNU MH-E do what I want. The Gosling-emacs
8797 version of MHE and the GNU Emacs version of MH-E have almost nothing
8798 in common except similar names. They work differently, have different
8799 conceptual models, and have different key bindings@footnote{After
8800 reading this article, I questioned Brian about his version of MHE, and
8801 received some great ideas for improving MH-E such as a dired-like
8802 method of selecting folders; and removing the prompting when sending
8803 mail, filling in the blanks in the draft buffer instead. I passed them
8804 on to Stephen Gildea, the current maintainer, and he was excited about
8805 the ideas as well. Perhaps one day, MH-E will again resemble MHE
8806 (draft form editing was introduced in version 7.4).}.
8808 Brian Reid, June 1994
8810 @node From Jim Larus, From Stephen Gildea, From Brian Reid, History
8811 @appendixsec From Jim Larus
8813 @cindex Jim Larus
8814 @cindex Larus, Jim
8816 Brian Reid, while at CMU or shortly after going to Stanford wrote a
8817 mail reading program called MHE for Gosling Emacs. It had much the
8818 same structure as MH-E (i.e., invoked MH programs), though it was
8819 simpler and the commands were slightly different. Unfortunately, I no
8820 longer have a copy so the differences are lost in the mists of time.
8822 In '82--83, I was working at BBN and wrote a lot of mlisp code in
8823 Gosling Emacs to make it look more like Tennex Emacs. One of the
8824 packages that I picked up and improved was Reid's mail system. In '83,
8825 I went back to Berkeley. About that time, Stallman's first version of
8826 GNU Emacs came out and people started to move to it from Gosling Emacs
8827 (as I recall, the transition took a year or two). I decided to port
8828 Reid's MHE and used the mlisp to Emacs Lisp translator that came with
8829 GNU Emacs. It did a lousy job and the resulting code didn't work, so I
8830 bit the bullet and rewrote the code by hand (it was a lot smaller and
8831 simpler then, so it took only a day or two).
8833 Soon after that, MH-E became part of the standard Emacs distribution
8834 and suggestions kept dribbling in for improvements. MH-E soon reached
8835 sufficient functionality to keep me happy, but I kept on improving it
8836 because I was a graduate student with plenty of time on my hands and
8837 it was more fun than my dissertation. In retrospect, the one thing
8838 that I regret is not writing any documentation, which seriously
8839 limited the use and appeal of the package.
8841 @cindex @command{xmh}, in MH-E history
8843 In '89, I came to Wisconsin as a professor and decided not to work on
8844 MH-E@. It was stable, except for minor bugs, and had enough
8845 functionality, so I let it be for a few years. Stephen Gildea of BBN
8846 began to pester me about the bugs, but I ignored them. In 1990, he
8847 went off to the X Consortium, said good bye, and said that he would
8848 now be using @command{xmh}. A few months later, he came back and said
8849 that he couldn't stand @command{xmh} and could I put a few more bug fixes
8850 into MH-E@. At that point, I had no interest in fixing MH-E, so I gave
8851 the responsibility of maintenance to him and he has done a fine job
8852 since then.
8854 Jim Larus, June 1994
8856 @node From Stephen Gildea, From Bill Wohler, From Jim Larus, History
8857 @appendixsec From Stephen Gildea
8859 @cindex Gildea, Stephen
8860 @cindex Stephen Gildea
8862 In 1987 I went to work for Bolt Beranek and Newman, as Jim had before
8863 me. In my previous job, I had been using RMAIL, but as my folders tend
8864 to run large, I was frustrated with the speed of RMAIL@. However, I
8865 stuck with it because I wanted the GNU Emacs interface. I am very
8866 familiar and comfortable with the Emacs interface (with just a few
8867 modifications of my own) and dislike having to use applications with
8868 embedded editors; they never live up to Emacs.
8870 MH is the mail reader of choice at BBN, so I converted to it. Since I
8871 didn't want to give up using an Emacs interface, I started using MH-E@.
8872 As is my wont, I started hacking on it almost immediately. I first
8873 used version 3.4m. One of the first features I added was to treat the
8874 folder buffer as a file-visiting buffer: you could lock it, save it,
8875 and be warned of unsaved changes when killing it. I also worked to
8876 bring its functionality a little closer to RMAIL@. Jim Larus was very
8877 cooperative about merging in my changes, and my efforts first appeared
8878 in version 3.6, distributed with Emacs 18.52 in 1988. Next I decided
8879 MH-E was too slow and optimized it a lot. Version, 3.7, distributed
8880 with Emacs 18.56 in 1990, was noticeably faster.
8882 When I moved to the X Consortium I became the first person there to
8883 not use xmh. (There is now one other engineer there using MH-E@.) About
8884 this point I took over maintenance of MH-E from Jim and was finally
8885 able to add some features Jim hadn't accepted, such as the backward
8886 searching undo. My first release was 3.8 (Emacs 18.58) in 1992.
8888 Now, in 1994, we see a flurry of releases, with both 4.0 and 5.0.
8889 Version 4.0 added many new features, including background folder
8890 collection and support for composing @sc{mime} messages. (Reading
8891 @sc{mime} messages remains to be done, alas.) While writing this book,
8892 Bill Wohler gave MH-E its closest examination ever, uncovering bugs
8893 and inconsistencies that required a new major version to fix, and so
8894 version 5 was released.
8896 Stephen Gildea, June 1994
8898 @node From Bill Wohler,  , From Stephen Gildea, History
8899 @appendixsec From Bill Wohler
8901 @cindex Wohler, Bill
8902 @cindex Bill Wohler
8904 The preface originally included the following text which I use to
8905 begin my story:
8907 @quotation
8908 But it's important to note a brief history of MH-E.
8910 @w{Version 3} was prevalent through the @w{Emacs 18} and early
8911 @w{Emacs 19} years. Then @w{Version 4} came out (@w{Emacs 19.23}),
8912 which introduced several new and changed commands. Next, @w{Version
8913 5.0} was released, which fixed some bugs and incompatibilities, and
8914 was incorporated into @w{Emacs 19.29}.
8915 @end quotation
8917 After a long break, Stephen handed the reins over to me in 2000. I
8918 moved the project to a new site called SourceForge and organized a
8919 great team of developers. Our first release in late 2001 was version
8920 6. It appeared around the time of Emacs 21.2 and had menus and tool
8921 bar buttons.
8923 Then, indexed searches, improved MIME handling, a speedbar, multiple
8924 identities, alias completion, an index view of unseen messages, spam
8925 software support, Face and X-Image-URL header field support, Fcc
8926 completion, arbitrary range handling, and draft form editing were
8927 introduced in the version 7 series around the time of Emacs 21.4
8928 (2004). Still, Emacs itself contained version 5 of MH-E released back
8929 in 1994.
8931 Version 8 development was mostly driven by the rewrite of the manual.
8932 It also brought GNU mailutils MH support, S/MIME support, picon
8933 support, and an improved interface for hiding header fields. The CVS
8934 repository was migrated from SourceForge to Savannah (only for those
8935 files that were already part of Emacs) and the software was completely
8936 reorganized to push back two decades of entropy. Version 8 appeared in
8937 Emacs 22.1 in 2006.
8939 Development was then quiet for a couple of years. Emacs 23.1, which is
8940 due out in 2009, will contain version 8.1. This version includes a few
8941 new features and several bug fixes.
8943 Bill Wohler, August 2008
8945 @node GFDL, GPL, History, Top
8946 @appendix GNU Free Documentation License
8947 @include doclicense.texi
8949 @node GPL, Key Index, GFDL, Top
8950 @appendix GNU General Public License
8951 @include gpl.texi
8953 @node Key Index, Command Index, GPL, Top
8954 @unnumbered Key (Character) Index
8955 @printindex ky
8957 @node Command Index, Option Index, Key Index, Top
8958 @unnumbered Command Index
8959 @printindex fn
8961 @node Option Index, Concept Index, Command Index, Top
8962 @unnumbered Option (Variable) Index
8963 @printindex vr
8965 @node Concept Index,  , Option Index, Top
8966 @unnumbered Concept Index
8967 @printindex cp
8969 @bye
8971 @c Ispell Helpers
8973 @c The following are words that ispell should ignore that would not
8974 @c normally be in a dictionary (global or personal). Be careful not to
8975 @c include words here that could potentially be typos of other words
8976 @c (such as url, elisp, or MHE).
8978 @c LocalWords: CTRL ESC SPC f's
8979 @c LocalWords: addr Aliasfile alist
8980 @c LocalWords: Baushke Bcc BBN Beranek bogofilter bogofilter's
8981 @c LocalWords: cmd CMU contrib cron
8982 @c LocalWords: DesBrisay Dcc devel dir dired docstring filll forw
8983 @c LocalWords: GECOS Gildea Gildea's Ginnean GnuCash goto gnuserv htm
8984 @c LocalWords: ImageMagick inbox ispell keychain
8985 @c LocalWords: Larus licensor LocalWords lookup lpr
8986 @c LocalWords: makeinfo mairix mbox mh mhbuild mhl mhpath mlisp
8987 @c LocalWords: MML msg multipart
8988 @c LocalWords: Namazu NIS nenscript nnml num
8989 @c LocalWords: packmbox passphrase pathname prev procmail prog repl
8990 @c LocalWords: slocal sortm SpamAssassin spammers SpamProbe SpamProbe's
8991 @c LocalWords: sublicense supercite speedbar
8992 @c LocalWords: Tennex texi texinfo Thelen thelenm
8993 @c LocalWords: UCI undeleted whatnow wohler xmh ypcat
8995 @c See http://www.oreilly.com/oreilly/author/stylesheet.html.
8996 @c See http://en.wikipedia.org/.
8998 @c Note the lowercase mh which is needed to avoid hits in the
8999 @c functions and variables. Occasionally, check for accidental
9000 @c inclusion of mh in text by uncommenting the following and executing
9001 @c it with C-x C-e. You want to see "Search failed"
9002 @c   (let ((case-fold-search nil))
9003 @c        (goto-char (point-min))
9004 @c        (search-forward-regexp "^mh\\( \\|$\\)"))
9006 @c An extremely useful setting for texinfo-mode-hook is:
9007 @c   (add-to-list
9008 @c    'ispell-skip-region-alist
9009 @c    (list
9010 @c     (concat "\\(@\\(small\\)?\\(example\\|lisp\\)"
9011 @c             "\\(@\\([irw]\\|code\\|var\\){[^}]+}\\|"
9012 @c             "@[@{}.]\\|"
9013 @c             "[^@]\\|"
9014 @c             "@\\(end \\)?group\\|"
9015 @c             "@\\(end \\)?cartouche\\)+"
9016 @c             "@end \\(small\\)?\\(example\\|lisp\\)\\|"
9017 @c             "@\\(code\\|command\\|file\\|kbd\\|sc\\){[^}]+}\\|"
9018 @c             "^@end [a-z]+$\\|"
9019 @c             "^@\\([fv]\\|print\\)index .*$\\|"
9020 @c             "@uref{[^,]+,\\|"
9021 @c             "@[a-z]+\\|"
9022 @c             "/[a-z.]+[/}]\\)")))))
9024 @c Cross References
9026 @c See existing cross-references to the Emacs manual and the Emacs
9027 @c Lisp manual (search for ``GNU Emacs Manual'' and ``GNU
9028 @c Emacs Lisp Reference Manual'' respectively).
9030 @c @ftable Sorting
9032 @c As per index (sort of): Punctuation, keyboard characters (such as
9033 @c RET and BS) upper and lowercase mixed (lower comes before
9034 @c uppercase), control characters go with uppercase C, meta characters
9035 @c go with uppercase M.
9036 @c In some cases, the sort isn't strictly ASCII.
9037 @c For example, SPC (mh-page-msg) reads better before BS
9038 @c (mh-previous-page) and . (mh-show) is better before ,
9039 @c (mh-header-display).
9041 @c @vtable Sorting
9043 @c Alphabetical, pull hooks into their own table.
9045 @c Local Variables:
9046 @c sentence-end-double-space: nil
9047 @c End: