In display-buffer-pop-up-frame make BUFFER current (Bug#15133).
[emacs.git] / doc / misc / mh-e.texi
bloba0ea0fe6de928225cf6527b8ba16dd30ecf2ae4c
1 \input texinfo   @c -*- mode: texinfo; coding: utf-8; -*-
2 @c
3 @c Note: This document requires makeinfo version 4.6 or greater to build.
4 @c
5 @c %**start of header
6 @setfilename ../../info/mh-e
7 @settitle The MH-E Manual
8 @c %**end of header
10 @c Version of the software and manual.
11 @set VERSION 8.5
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 2013-03-02
16 @set UPDATE-MONTH March, 2013
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.4. 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
259 @uref{http://rand-mh.sourceforge.net/book/, @cite{MH & nmh: Email for
260 Users & Programmers}} (also known as @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
554 automatically (@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://mailutils.org/, GNU mailutils MH}, which
557 supports IMAP@. Your GNU/Linux distribution probably has packages for
558 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/p/mh-e/bugs/245/, SF #245}.
2079 @cindex header field, @samp{Face:}
2080 @cindex header field, @samp{X-Face:}
2081 @cindex header field, @samp{X-Image-URL:}
2082 @cindex @samp{Face:} header field
2083 @cindex @samp{X-Face:} header field
2084 @cindex @samp{X-Image-URL:} header field
2085 @vindex mh-show-use-xface-flag
2087 MH-E can display the content of @samp{Face:}, @samp{X-Face:}, and
2088 @samp{X-Image-URL:} header fields. If any of these fields occur in the
2089 header of your message, the sender's face will appear in the
2090 @samp{From:} header field. If more than one of these fields appear,
2091 then the first field found in the order @samp{Face:}, @samp{X-Face:},
2092 and @samp{X-Image-URL:} will be used. The option
2093 @code{mh-show-use-xface-flag} is used to turn this feature on and off.
2094 This feature will be turned on by default if your system supports it.
2096 The first header field used, if present, is the Gnus-specific
2097 @samp{Face:} field@footnote{The @samp{Face:} field appeared in GNU
2098 Emacs 21 and XEmacs. For more information, see
2099 @uref{http://quimby.gnus.org/circus/face/}.}.
2101 @cindex @command{uncompface}
2102 @cindex Emacs, packages, x-face
2103 @cindex Unix commands, @command{uncompface}
2104 @cindex x-face package
2105 @vindex mh-show-xface
2107 Next is the traditional @samp{X-Face:} header field@footnote{The
2108 display of this field requires the
2109 @uref{ftp://ftp.cs.indiana.edu/pub/faces/compface/compface.tar.Z,
2110 @command{uncompface} program}. Recent versions of XEmacs have internal
2111 support for @samp{X-Face:} images. If your version of XEmacs does not,
2112 then you'll need both @command{uncompface} and the
2113 @uref{ftp://ftp.jpl.org/pub/elisp/, @samp{x-face} package}.}. MH-E
2114 renders the foreground and background of the image using the
2115 associated attributes of the face @code{mh-show-xface}.
2117 @cindex @command{convert}
2118 @cindex @command{wget}
2119 @cindex ImageMagick
2120 @cindex Unix commands, @command{convert}
2121 @cindex Unix commands, @command{wget}
2122 @vindex mh-fetch-x-image-url
2124 Finally, MH-E will display images referenced by the
2125 @samp{X-Image-URL:} header field if neither the @samp{Face:} nor the
2126 @samp{X-Face:} fields are present@footnote{The display of the images
2127 requires the @uref{http://www.gnu.org/software/wget/wget.html,
2128 @command{wget} program} to fetch the image and the @command{convert}
2129 program from the @uref{http://www.imagemagick.org/script/index.php,
2130 ImageMagick suite}.}. Of the three header fields this is the most
2131 efficient in terms of network usage since the image doesn't need to be
2132 transmitted with every single mail. The option
2133 @code{mh-fetch-x-image-url} controls the fetching of the
2134 @samp{X-Image-URL:} header field image with the following values:
2136 @table @samp
2137 @item Ask Before Fetching
2138 You are prompted before the image is fetched. MH-E will remember your
2139 reply and will either use the already fetched image the next time the
2140 same URL is encountered or silently skip it if you didn't fetch it the
2141 first time. This is a good setting.
2142 @c -------------------------
2143 @item Never Fetch
2144 Images are never fetched and only displayed if they are already
2145 present in the cache. This is the default.
2146 @end table
2148 There isn't a value of @samp{Always Fetch} for privacy and DOS (denial
2149 of service) reasons. For example, fetching a URL can tip off a spammer
2150 that you've read his email (which is why you shouldn't blindly answer
2151 yes if you've set this option to @samp{Ask Before Fetching}). Someone
2152 may also flood your network and fill your disk drive by sending a
2153 torrent of messages, each specifying a unique URL to a very large
2154 file.
2156 @cindex @file{.mhe-x-image-cache}
2157 @cindex files, @file{.mhe-x-image-cache}
2159 The cache of images is found in the directory
2160 @file{.mhe-x-image-cache} within your MH directory. You can add your
2161 own face to the @samp{From:} field too. @xref{Picture}.
2163 @cindex @command{mhl}
2164 @cindex MH commands, @command{mhl}
2165 @vindex mh-mhl-format-file
2167 Normally MH-E takes care of displaying messages itself (rather than
2168 calling an MH program to do the work). If you'd rather have
2169 @command{mhl} display the message (within MH-E), change the option
2170 @code{mh-mhl-format-file} from its default value of @samp{Use Default
2171 mhl Format (Printing Only)}. You can set this option to @samp{Use
2172 Default mhl Format} to get the same output as you would get if you ran
2173 @command{mhl} from the shell. If you have a format file that you want
2174 MH-E to use, you can set this option to @samp{Specify an mhl Format
2175 File} and enter the name of your format file (@command{mhl}(1) or
2176 section @uref{@value{MH-BOOK-HOME}/shomes.html#Usisho, Using mhl} in
2177 the MH book tells you how to write one). Your format file should
2178 specify a non-zero value for @samp{overflowoffset} to allow MH-E to
2179 parse the header. Note that @command{mhl} is always used for printing
2180 and forwarding; in this case, the value of @code{mh-mhl-format-file}
2181 is consulted if you have specified a format file.
2183 @cindex citations, highlighting
2184 @cindex highlighting citations
2185 @vindex mh-highlight-citation-style
2187 If the sender of the message has cited other messages in his message,
2188 then MH-E will highlight these citations to emphasize the sender's
2189 actual response. The option @code{mh-highlight-citation-style} can be
2190 customized to change the highlighting style. The @samp{Multicolor}
2191 method uses a different color for each indentation while the
2192 @samp{Monotone} method highlights all citations in red. To disable
2193 highlighting of citations entirely, choose @samp{None}.
2195 @cindex URLs, highlighting
2196 @cindex email addresses, highlighting
2197 @cindex highlighting URLs
2198 @cindex highlighting email addresses
2199 @cindex links, following
2200 @findex goto-address-at-point
2201 @kindex C-c @key{RET}
2202 @kindex Mouse-2
2203 @vindex goto-address-highlight-p
2205 Email addresses and URLs in the message are highlighted if the option
2206 @code{goto-address-highlight-p} is on, which it is by default. To view
2207 the web page for a highlighted URL or to send a message using a
2208 highlighted email address, use @kbd{Mouse-2} or @kbd{C-c @key{RET}}
2209 (@code{goto-address-at-point}). @xref{Sending Mail}, to see how to
2210 configure Emacs to send the message using MH-E.
2212 @cindex boldface, showing
2213 @cindex emphasis
2214 @cindex italics, showing
2215 @cindex smileys
2216 @cindex typesetting
2217 @cindex underline, showing
2218 @vindex gnus-emphasis-alist
2219 @vindex mh-decode-mime-flag
2220 @vindex mh-graphical-emphasis-flag
2221 @vindex mh-graphical-smileys-flag
2223 It is a long standing custom to inject body language using a
2224 cornucopia of punctuation, also known as the @dfn{smileys}. MH-E can
2225 render these as graphical widgets if the option
2226 @code{mh-graphical-smileys-flag} is turned on, which it is by default.
2227 Smileys include patterns such as :-) and ;-). Similarly, a few
2228 typesetting features are indicated in ASCII text with certain
2229 characters. If your terminal supports it, MH-E can render these
2230 typesetting directives naturally if the option
2231 @code{mh-graphical-emphasis-flag} is turned on, which it is by
2232 default. For example, _underline_ will be
2233 @ifhtml
2234 @html
2235 <u>underlined</u>,
2236 @end html
2237 @end ifhtml
2238 @ifnothtml
2239 underlined,
2240 @end ifnothtml
2241 *bold* will appear in @b{bold}, /italics/ will appear in @i{italics},
2242 and so on. See the option @code{gnus-emphasis-alist} for the whole
2243 list. Both of these options are disabled if the option
2244 @code{mh-decode-mime-flag} is turned off. @xref{Viewing Attachments}.
2246 @cindex signature separator
2247 @cindex vCard
2248 @vindex mh-show-signature
2250 MH-E normally renders signatures and vCards in italics so that the
2251 body of the message stands out more. MH-E depends on the presence of
2252 the @dfn{signature separator} (@code{"-- "}) to do this. You can also
2253 customize the face @code{mh-show-signature} so the appearance of the
2254 signature block is more to your liking.
2256 @vindex mh-show-hook
2257 @vindex mh-show-mode-hook
2259 Two hooks can be used to control how messages are displayed. The first
2260 hook, @code{mh-show-mode-hook}, is called early on in the process of
2261 the message display. It is usually used to perform some action on the
2262 message's content. The second hook, @code{mh-show-hook}, is the last
2263 thing called after messages are displayed. It's used to affect the
2264 behavior of MH-E in general or when @code{mh-show-mode-hook} is too
2265 early.
2267 @cindex MH-Show mode
2268 @cindex modes, MH-Show
2269 @vindex mh-show-buffer-mode-line-buffer-id
2271 For those who like to modify their mode lines, use
2272 @code{mh-show-buffer-mode-line-buffer-id} to modify the mode line in
2273 the MH-Show buffers. Place the two escape strings @samp{%s} and
2274 @samp{%d}, which will display the folder name and the message number,
2275 respectively, somewhere in the string in that order. The default value
2276 of @code{"@{show-%s@} %d"} yields a mode line of
2278 @smallexample
2279 -----@{show-+inbox@} 4      (MH-Show)--Bot--------------------------------
2280 @end smallexample
2282 @node Viewing Attachments, HTML, Viewing, Reading Mail
2283 @section Viewing Attachments
2285 @cindex attachments
2286 @cindex body parts
2287 @cindex @command{mhshow}
2288 @cindex @command{show}
2289 @cindex MH commands, @command{mhshow}
2290 @cindex MH commands, @command{show}
2291 @cindex MIME
2292 @cindex multimedia mail
2294 MH has the ability to display @dfn{@sc{mime}} (Multipurpose Internet
2295 Mail Extensions) messages which are simply messages with additional
2296 @dfn{body parts} or @dfn{attachments}. You can use the MH commands
2297 @command{show}@footnote{See the section
2298 @uref{@value{MH-BOOK-HOME}/reapre.html, Reading Mail: inc show next
2299 prev} in the MH book.} or @command{mhshow}@footnote{See the section
2300 @uref{@value{MH-BOOK-HOME}/usimim.html#ReMIMa, Reading MIME Mail} in
2301 the MH book.} from the shell to read @sc{mime} messages@footnote{You
2302 can call them directly from Emacs if you're running the X Window
2303 System: type @kbd{M-! xterm -e mhshow @var{message-number}}. You can
2304 leave out the @samp{xterm -e} if you use @command{mhlist} or
2305 @command{mhstore}.}.
2307 @cindex Emacs, packages, mm-decode
2308 @cindex mm-decode package
2309 @findex mh-toggle-mh-decode-mime-flag
2310 @kindex ; (semicolon)
2311 @vindex mh-decode-mime-flag
2313 MH-E can handle attachments as well if the Gnus @samp{mm-decode}
2314 package is present. If so, the option @code{mh-decode-mime-flag} will
2315 be on. Otherwise, you'll see the @sc{mime} body parts rather than text
2316 or attachments. There isn't much point in turning off the option
2317 @code{mh-decode-mime-flag}; however, you can inspect it if it appears
2318 that the body parts are not being interpreted correctly or toggle it
2319 with the command @kbd{;} (semicolon;
2320 @code{mh-toggle-mh-decode-mime-flag}) to view the raw message. This
2321 option also controls the display of quoted-printable messages and
2322 other graphical widgets. @xref{Viewing}.
2324 @cindex buttons
2326 Attachments in MH-E are indicated by @dfn{buttons} like this:
2328 @smallexample
2329 [1. image/jpeg; foo.jpg]...
2330 @end smallexample
2332 @findex mh-next-button
2333 @findex mh-press-button
2334 @findex mh-prev-button
2335 @kindex @key{RET}
2336 @kindex K @key{TAB}
2337 @kindex K S-@key{TAB}
2338 @kindex Mouse-1
2339 @kindex Mouse-2
2341 To view the contents of the button, use either @kbd{Mouse-1} or
2342 @kbd{Mouse-2} on the button or @key{RET} (@code{mh-press-button}) when
2343 the cursor is over the button. This command is a toggle so if you use
2344 it again on the same attachment, it is hidden. If Emacs does not know
2345 how to display the attachment, then Emacs offers to save the
2346 attachment in a file. To move the cursor to the next button, use the
2347 command @kbd{K @key{TAB}} (@code{mh-next-button}). If the end of the
2348 buffer is reached then the search wraps over to the start of the
2349 buffer. To move the cursor to the previous button, use the command
2350 @kbd{K S-@key{TAB}} (@code{mh-prev-button}). If the beginning of the
2351 buffer is reached then the search wraps over to the end of the buffer.
2353 @cindex attachments, viewing
2354 @cindex viewing attachments
2355 @findex mh-folder-toggle-mime-part
2356 @kindex K v
2358 Another way to view the contents of a button is to use the command
2359 @kbd{K v} (@code{mh-folder-toggle-mime-part}). This command displays
2360 (or hides) the attachment associated with the button under the cursor.
2361 If the cursor is not located over a button, then the cursor first
2362 moves to the next button, wrapping to the beginning of the message if
2363 necessary. This command has the advantage over the previous commands
2364 of working from the MH-Folder buffer. You can also provide a numeric
2365 prefix argument (as in @kbd{4 K v}) to view the attachment labeled
2366 with that number. If Emacs does not know how to display the
2367 attachment, then Emacs offers to save the attachment in a file.
2369 @cindex @file{/etc/mailcap}
2370 @cindex files, @file{/etc/mailcap}
2371 @findex mailcap-mime-info
2372 @findex mh-display-with-external-viewer
2373 @kindex K e
2375 If Emacs does not know how to view an attachment, you could save it
2376 into a file and then run some program to open it. It is easier,
2377 however, to launch the program directly from MH-E with the command
2378 @kbd{K e} (@code{mh-display-with-external-viewer}). While you'll most
2379 likely use this to view spreadsheets and documents, it is also useful
2380 to use your browser to view HTML attachments with higher fidelity than
2381 what Emacs can provide. This command displays the attachment
2382 associated with the button under the cursor. If the cursor is not
2383 located over a button, then the cursor first moves to the next button,
2384 wrapping to the beginning of the message if necessary. You can provide
2385 a numeric prefix argument (as in @kbd{4 K e}) to view the attachment
2386 labeled with that number. This command tries to provide a reasonable
2387 default for the viewer by calling the Emacs function
2388 @code{mailcap-mime-info}. This function usually reads the file
2389 @file{/etc/mailcap}.
2391 @cindex attachments, saving
2392 @cindex saving attachments
2393 @findex mh-folder-save-mime-part
2394 @kindex K o
2396 Use the command @kbd{K o} (@code{mh-folder-save-mime-part}) to save
2397 attachments (the mnemonic is ``output''). This command saves the
2398 attachment associated with the button under the cursor. If the cursor
2399 is not located over a button, then the cursor first moves to the next
2400 button, wrapping to the beginning of the message if necessary. You can
2401 also provide a numeric prefix argument (as in @kbd{3 K o}) to save the
2402 attachment labeled with that number. This command prompts you for a
2403 filename and suggests a specific name if it is available.
2405 @cindex @command{mhn}
2406 @cindex @command{mhstore}
2407 @cindex MH commands, @command{mhn}
2408 @cindex MH commands, @command{mhstore}
2409 @findex mh-mime-save-parts
2410 @kindex K a
2411 @vindex mh-mime-save-parts-default-directory
2413 You can save all of the attachments at once with the command @kbd{K a}
2414 (@code{mh-mime-save-parts}). The attachments are saved in the
2415 directory specified by the option
2416 @code{mh-mime-save-parts-default-directory} unless you use a prefix
2417 argument (as in @kbd{C-u K a}) in which case you are prompted for the
2418 directory. These directories may be superseded by MH profile
2419 components, since this function calls on @command{mhstore}
2420 (@command{mhn}) to do the work.
2422 @vindex mh-mime-save-parts-default-directory
2424 The default value for the option
2425 @code{mh-mime-save-parts-default-directory} is @samp{Prompt Always} so
2426 that you are always prompted for the directory in which to save the
2427 attachments. However, if you usually use the same directory within a
2428 session, then you can set this option to @samp{Prompt the First Time}
2429 to avoid the prompt each time. you can make this directory permanent
2430 by choosing @samp{Directory} and entering the directory's name.
2432 @cindex attachments, inline
2433 @cindex inline attachments
2434 @findex mh-toggle-mime-buttons
2435 @kindex K t
2436 @vindex mh-display-buttons-for-inline-parts-flag
2438 The sender can request that attachments should be viewed inline so
2439 that they do not really appear like an attachment at all to the
2440 reader. Most of the time, this is desirable, so by default MH-E
2441 suppresses the buttons for inline attachments. On the other hand, you
2442 may receive code or HTML which the sender has added to his message as
2443 inline attachments so that you can read them in MH-E@. In this case, it
2444 is useful to see the buttons so that you know you don't have to cut
2445 and paste the code into a file; you can simply save the attachment. If
2446 you want to make the buttons visible for inline attachments, you can
2447 use the command @kbd{K t} (@code{mh-toggle-mime-buttons}) to toggle
2448 the visibility of these buttons. You can turn on these buttons
2449 permanently by turning on the option
2450 @code{mh-display-buttons-for-inline-parts-flag}.
2452 MH-E cannot display all attachments inline however. It can display
2453 text (including @sc{html}) and images.
2455 @cindex header field, @samp{Content-Disposition:}
2456 @cindex inline images
2457 @cindex @samp{Content-Disposition:} header field
2458 @vindex mh-max-inline-image-height
2459 @vindex mh-max-inline-image-width
2461 Some older mail programs do not insert the needed
2462 plumbing@footnote{This plumbing is the @samp{Content-Disposition:}
2463 header field.} to tell MH-E whether to display the attachments inline
2464 or not. If this is the case, MH-E will display these images inline if
2465 they are smaller than the window. However, you might want to allow
2466 larger images to be displayed inline. To do this, you can change the
2467 options @code{mh-max-inline-image-width} and
2468 @code{mh-max-inline-image-height} from their default value of zero to
2469 a large number. The size of your screen is a good choice for these
2470 numbers.
2472 @cindex alternatives
2473 @cindex attachments, alternatives
2474 @vindex mh-display-buttons-for-alternatives-flag
2476 Sometimes, a mail program will produce multiple alternatives of an
2477 attachment in increasing degree of faithfulness to the original
2478 content. By default, only the preferred alternative is displayed. If
2479 the option @code{mh-display-buttons-for-alternatives-flag} is on, then
2480 the preferred part is shown inline and buttons are shown for each of
2481 the other alternatives.
2483 @vindex mm-discouraged-alternatives
2485 Many people prefer to see the @samp{text/plain} alternative rather
2486 than the @samp{text/html} alternative. To do this in MH-E, customize
2487 the option @code{mm-discouraged-alternatives}, and add
2488 @samp{text/html}. The next best alternative, if any, will be shown.
2490 @findex mh-show-preferred-alternative
2491 @kindex : (colon)
2493 Occasionally, though, you might want to see the preferred alternative.
2494 The command @kbd{:} (@code{mh-show-preferred-alternative}) displays
2495 the message with the default preferred alternative. This is as if
2496 @code{mm-discouraged-alternatives} is set to @samp{nil}. Use the
2497 command @key{RET} (@code{mh-show}) to show the message normally again.
2499 @kindex K i
2500 @findex mh-folder-inline-mime-part
2502 You can view the raw contents of an attachment with the command @kbd{K
2503 i} (@code{mh-folder-inline-mime-part}). This command displays (or
2504 hides) the contents of the attachment associated with the button under
2505 the cursor verbatim. If the cursor is not located over a button, then
2506 the cursor first moves to the next button, wrapping to the beginning
2507 of the message if necessary. You can also provide a numeric prefix
2508 argument (as in @kbd{4 K i}) to view the attachment labeled with that
2509 number.
2511 For additional information on buttons, see
2512 @ifinfo
2513 @ref{Article Buttons,,,gnus}, and @ref{MIME Commands,,,gnus}.
2514 @end ifinfo
2515 @ifnotinfo
2516 the chapters @uref{http://www.gnus.org/manual/gnus_101.html#SEC101,
2517 Article Buttons} and
2518 @uref{http://www.gnus.org/manual/gnus_108.html#SEC108, MIME Commands}
2519 in the @cite{The Gnus Manual}.
2520 @end ifnotinfo
2522 @node HTML, Digests, Viewing Attachments, Reading Mail
2523 @section HTML
2525 @cindex HTML
2526 @cindex Gnus
2528 MH-E can display messages that have been sent in HTML@footnote{This
2529 feature depends on a version of Gnus that is at least 5.10.}. The
2530 content of the message will appear in the MH-Show buffer as you would
2531 expect if the entire message is HTML, or there is an inline HTML body
2532 part. However, if there is an HTML body part that is an attachment,
2533 then you'll see a button like this:
2535 @smallexample
2536 [1. text/html; foo.html]...
2537 @end smallexample
2539 To see how to read the contents of this body part, see @ref{Viewing
2540 Attachments}.
2542 @vindex mm-text-html-renderer
2544 The browser that MH-E uses is determined by the option
2545 @code{mm-text-html-renderer}. The default setting is set automatically
2546 based upon the presence of a known browser on your system. If you wish
2547 to use a different browser, then set this option accordingly. See the
2548 documentation for the browser you use for additional information on
2549 how to use it. In particular, find and disable the option to render
2550 images as this can tip off spammers that the email address they have
2551 used is valid.
2553 @vindex mm-text-html-renderer
2555 If you're confused about which @code{mm-text-html-renderer} to use,
2556 here's a brief description of each, sorted by popularity, that
2557 includes the results of a quick poll of MH-E users from 2005-12-23.
2559 @table @asis
2560 @cindex browser, @samp{w3m}
2561 @cindex @samp{w3m}
2562 @kindex Mouse-2
2563 @item @samp{w3m} 7
2564 The @samp{w3m} browser requires an external program. It's quick,
2565 produces pretty nice output, and best of all, it's the only browser
2566 that highlights links. These can be clicked with @kbd{Mouse-2} to view
2567 the content of the link in @samp{w3m}. The @samp{w3m} browser handles
2568 tables well and actually respects the table's width parameter (which
2569 can cause text to wrap if the author didn't anticipate that the page
2570 would be viewed in Emacs).
2571 @c -------------------------
2572 @cindex browser, @samp{w3m-standalone}
2573 @cindex @samp{w3m-standalone}
2574 @item @samp{w3m-standalone} 3
2575 This browser, along with @samp{nil} for the external browser, are the
2576 only choices that work without having to download a separate lisp
2577 package or external program. This browser is quick, but does not show
2578 links. It handles simple tables but some tables get rendered much
2579 wider than the Emacs frame. This browser was the only one not to
2580 handle the escape @samp{&ndash;} (it printed a @samp{?}), but it did
2581 render @samp{&reg;}.
2582 @c -------------------------
2583 @cindex browser, @samp{links}
2584 @cindex @samp{links}
2585 @item @samp{links} 1
2586 The @samp{links} browser requires an external program. It's quick, and
2587 produces nicer output than @samp{lynx} on single column mails in
2588 tables. However, it doesn't show links and it doesn't do as nice a job
2589 on multi-column tables as some lines wrap. At least it fits in 80
2590 columns and thus seems better than @samp{w3} and
2591 @samp{w3m-standalone}. Converts escapes such as @samp{&reg;} to (R).
2592 @c -------------------------
2593 @cindex browser, @samp{lynx}
2594 @cindex @samp{lynx}
2595 @item @samp{lynx} 1
2596 The @samp{lynx} browser requires an external program. It's quick and
2597 produces pretty decent output but it doesn't show links. It doesn't
2598 seem to do multi-column tables which makes output much cleaner. It
2599 centers the output and wraps long lines more than most. Handles
2600 @samp{&reg;}.
2601 @c -------------------------
2602 @item @samp{nil} 1
2603 This choice obviously requires an external browser. Like
2604 @samp{w3m-standalone}, it works out of the box. With this setting,
2605 HTML messages have a button for the body part which you can view with
2606 @kbd{K v} (@code{mh-folder-toggle-mime-part}).
2607 @c -------------------------
2608 @cindex browser, @samp{w3}
2609 @cindex @samp{w3}
2610 @item @samp{w3} 0
2611 This choice does not require an external program as all of the
2612 rendering is done in lisp. You do need to get the package separately.
2613 This browser is @strong{slow}, and doesn't appear to have been updated
2614 since 2001 and the author hasn't responded to my emails. It displays
2615 unknown tags instead of hiding them, so you get to see all the
2616 Microsoft crap in certain messages. Tends to make multi-column tables
2617 wider than even a full-screen Emacs can handle. Like @samp{w3m}, you
2618 can follow links, but you have to find them first as they are not
2619 highlighted. Performs well on single-column tables and handles escapes
2620 such as @samp{&reg;}.
2621 @c -------------------------
2622 @cindex browser, @samp{html2text}
2623 @cindex @samp{html2text}
2624 @item @samp{html2text} 0
2625 The @samp{html2text} browser requires an external program. I noticed
2626 that it can do some nasty things with simple HTML mails (like filling
2627 the entire message as if it were one paragraph, including signature).
2628 On another message, it displayed half of the HTML tags for some
2629 reason.
2630 @end table
2632 @vindex mm-text-html-renderer
2634 For a couple more sources of information about
2635 @code{mm-text-html-renderer},
2636 @ifinfo
2637 @xref{Display Customization,,,emacs-mime}, and the documentation for
2638 the Gnus command @kbd{W h} (@pxref{Article Washing,,,gnus},).
2639 @end ifinfo
2640 @ifnotinfo
2641 see section @uref{http://www.gnus.org/manual/emacs-mime_6.html,
2642 Display Customization} in the @cite{The Emacs MIME Manual} and the
2643 documentation for the Gnus command @kbd{W h} (see section
2644 @uref{http://www.gnus.org/manual/gnus_99.html, Article Washing} in the
2645 @cite{The Gnus Manual}).
2646 @end ifnotinfo
2648 @cindex @file{.emacs}
2649 @cindex files, @file{.emacs}
2650 @findex browse-url-at-mouse
2651 @kindex S-Mouse-2
2653 A useful key binding that you can add to @file{~/.emacs} is the
2654 following which displays an HTML link or textual URL in an external
2655 browser when clicked with @kbd{S-mouse-2}. This binding works in any
2656 buffer, including HTML buffers.
2658 @smalllisp
2659 (global-set-key [S-mouse-2] 'browse-url-at-mouse)
2660 @end smalllisp
2662 @node Digests, Reading PGP, HTML, Reading Mail
2663 @section Digests
2665 @cindex digests
2666 @findex mh-page-digest
2667 @findex mh-page-digest-backwards
2668 @kindex D @key{BS}
2669 @kindex D @key{SPC}
2670 @kindex @key{BS}
2671 @kindex @key{SPC}
2673 A digest is a message that contains other messages. Special MH-E
2674 commands let you read digests conveniently. You can use @key{SPC} and
2675 @key{BS} to page through the digest as if it were a normal message,
2676 but if you wish to skip to the next message in the digest, use
2677 @kbd{D @key{SPC}} (@code{mh-page-digest}). To return to a previous message,
2678 use @kbd{D @key{BS}} (@code{mh-page-digest-backwards}).
2680 @cindex @command{burst}
2681 @cindex MH commands, @command{burst}
2682 @cindex MH-Folder Show mode
2683 @cindex modes, MH-Folder Show
2684 @findex mh-burst-digest
2685 @kindex d
2686 @kindex D b
2687 @kindex t
2689 Another handy command is @kbd{D b} (@code{mh-burst-digest}). This
2690 command uses the MH command @command{burst}@footnote{See the section
2691 @uref{@value{MH-BOOK-HOME}/burdig.html, Bursting Messages} in the MH
2692 book.} to break out each message in the digest into its own message.
2693 Using this command, you can quickly delete unwanted messages, like
2694 this: Once the digest is split up, toggle out of MH-Folder Show mode
2695 with @kbd{t} (@pxref{Folders}) so that the scan lines fill the screen
2696 and messages aren't displayed. Then use @kbd{d} (@pxref{Reading Mail})
2697 to quickly delete messages that you don't want to read (based on the
2698 @samp{Subject:} header field). You can also burst the digest to reply
2699 directly to the people who posted the messages in the digest. One
2700 problem you may encounter is that the @samp{From:} header fields are
2701 preceded with a @samp{>} so that your reply can't create the
2702 @samp{To:} field correctly. In this case, you must correct the
2703 @samp{To:} field yourself. This is described later (@pxref{Editing
2704 Drafts}).
2706 @node Reading PGP, Printing, Digests, Reading Mail
2707 @section Signed and Encrypted Messages
2709 @cindex GPG
2710 @cindex GnuPG
2711 @cindex Gnus
2712 @cindex OpenPGP
2713 @cindex PGP
2714 @cindex RFC 3156
2715 @cindex encrypted messages
2716 @cindex security
2717 @cindex signed messages
2719 You can read encrypted or signed PGP or GPG messages with
2720 MH-E@footnote{This feature depends on post-5.10 versions of Gnus.
2721 @cite{MIME Security with OpenPGP} is documented in
2722 @uref{http://www.rfc-editor.org/rfc/rfc3156.txt, RFC 3156}. However,
2723 MH-E can also decrypt old-style PGP messages that are not in MIME
2724 format.}. This section assumes that you already have a good
2725 understanding of GPG and have set up your keys appropriately.
2727 If someone sends you a signed message, here is what you'll see:
2729 @smallexample
2730 @group
2731 [[PGP Signed Part:Bill Wohler <wohler@@stop.mail-abuse.org>]]
2732 This is a signed message.
2734 [[End of PGP Signed Part]]
2735 @end group
2736 @end smallexample
2738 @cindex keychain
2739 @cindex key server
2740 @cindex signed messages
2742 If the key for the given signature is not in your keychain, you'll be
2743 given the opportunity to fetch the key from a key server and verify
2744 the key. If the message is really large, the verification process can
2745 take a long time. You can press @kbd{C-g} at any time to
2746 cancel@footnote{Unfortunately in the current version, the validation
2747 process doesn't display a message so it appears that MH-E has hung. We
2748 hope that this will be fixed in the future.}.
2750 If the signature doesn't check out, you might see something like this:
2752 @smallexample
2753 @group
2754 [[PGP Signed Part:Failed]]
2755 This is a signed message.
2756 This is garbage added after the signature was made.
2758 [[End of PGP Signed Part]]
2759 @end group
2760 @end smallexample
2762 @cindex decrypting messages
2764 If someone sends you an encrypted message, MH-E will ask for your
2765 passphrase to decrypt the message. You should see something like this:
2767 @smallexample
2768 @group
2769 [[PGP Encrypted Part:OK]]
2771 [[PGP Signed Part:Bill Wohler <wohler@@stop.mail-abuse.org>]]
2772 This is the secret message.
2774 [[End of PGP Signed Part]]
2776 [[End of PGP Encrypted Part]]
2777 @end group
2778 @end smallexample
2780 If there is a problem decrypting the message, the button will say:
2782 @smallexample
2783 [[PGP Encrypted Part:Failed]]
2784 @end smallexample
2786 You can read the contents of this button using the methods described in
2787 @ref{Viewing Attachments}. If the message were corrupted, you'd see
2788 this:
2790 @smallexample
2791 [[PGP Encrypted Part:Failed]
2792 Invalid base64 data]
2793 @end smallexample
2795 If your passphrase were incorrect, you'd see something like this:
2797 @smallexample
2798 [GNUPG:] ENC_TO CD9C88BB610BD9AD 1 0
2799 [GNUPG:] USERID_HINT CD9C88BB610BD9AD Bill Wohler <wohler@@stop.mail-abuse.org>
2800 [GNUPG:] NEED_PASSPHRASE CD9C88BB610BD9AD CD9C88BB610BD9AD 1 0
2801 [GNUPG:] BAD_PASSPHRASE CD9C88BB610BD9AD
2802 gpg: encrypted with 1024-bit RSA key, ID 610BD9AD, created 1997-09-09
2803       "Bill Wohler <wohler@@stop.mail-abuse.org>"
2804 gpg: public key decryption failed: bad passphrase
2805 [GNUPG:] BEGIN_DECRYPTION
2806 [GNUPG:] DECRYPTION_FAILED
2807 gpg: decryption failed: secret key not available
2808 [GNUPG:] END_DECRYPTION
2810 gpg exited abnormally: '2'
2811 @end smallexample
2813 @vindex mh-show-pgg-bad
2814 @vindex mh-show-pgg-good
2815 @vindex mh-show-pgg-unknown
2817 The appearance of the buttons is controlled by the faces
2818 @code{mh-show-pgg-good}, @code{mh-show-pgg-bad}, and
2819 @code{mh-show-pgg-unknown} depending on the validity of the signature.
2820 The latter is used whether the signature is unknown or untrusted.
2822 @cindex @samp{pgg} customization group
2823 @cindex PGG
2824 @cindex customization group, @samp{pgg}
2826 The @samp{pgg} customization group may have some settings which may
2827 interest you.
2828 @iftex
2829 See @cite{The PGG Manual}.
2830 @end iftex
2831 @ifinfo
2832 @xref{Top, , The PGG Manual, pgg, The PGG Manual}.
2833 @end ifinfo
2834 @ifhtml
2836 @uref{http://www.gnu.org/software/emacs/manual/pgg.html,
2837 @cite{The PGG Manual}}.
2838 @end ifhtml
2840 @node Printing, Files and Pipes, Reading PGP, Reading Mail
2841 @section Printing Your Mail
2843 @cindex printing
2844 @findex mh-ps-print-msg
2845 @findex mh-ps-print-msg-file
2846 @kindex P f
2847 @kindex P p
2848 @vindex mh-lpr-command-format
2849 @vindex mh-print-background-flag
2851 To print messages in MH-E, use the command @kbd{P p}
2852 (@code{mh-ps-print-msg}). You can print all the messages in a range
2853 (as in @kbd{C-u P p 1 3 5-7 last:5 frombob @key{RET}},
2854 @pxref{Ranges}). You can also send the output to a file with @kbd{P f}
2855 (@code{mh-ps-print-msg-file}). This command will print inline text
2856 attachments but will not decrypt messages. However, when a message is
2857 displayed in an MH-Show buffer, then that buffer is used verbatim for
2858 printing with the caveat that only text attachments, if opened inline,
2859 are printed. Therefore, encrypted messages can be printed by showing
2860 and decrypting them first. The commands @kbd{P p} and @kbd{P f} do not
2861 use the options @code{mh-lpr-command-format} or
2862 @code{mh-print-background-flag}, described below.
2864 @findex mh-ps-print-toggle-color
2865 @kindex P C
2866 @vindex ps-print-color-p
2868 Colors are emulated on black-and-white printers with shades of gray.
2869 This might produce illegible output, even if your screen colors only
2870 use shades of gray. If this is the case, try using the command @kbd{P
2871 C} (@code{mh-ps-print-toggle-color}) to toggle between color, no
2872 color, and a black and white representation of the colors and see
2873 which works best. You change this setting permanently by customizing
2874 the option @code{ps-print-color-p}.
2876 @findex mh-ps-print-toggle-faces
2877 @kindex P F
2879 Another related function is the command @kbd{P F}
2880 (@code{mh-ps-print-toggle-faces}). This command toggles between using
2881 faces and not. When faces are enabled, the printed message will look
2882 very similar to the message in the MH-Show buffer.
2884 @cindex ps-print package
2885 @cindex Emacs, packages, ps-print
2887 MH-E uses the @samp{ps-print} package to do the printing, so you can
2888 customize the printing further by going to the @samp{ps-print}
2889 customization group.
2891 @cindex @command{lpr}
2892 @cindex @command{mhl}
2893 @cindex MH commands, @command{mhl}
2894 @cindex Unix commands, @command{lpr}
2895 @findex mh-print-msg
2896 @kindex P l
2898 An alternative to using the @samp{ps-print} package is the command
2899 @kbd{P l} (@code{mh-print-msg}) (the @i{l} is for @i{l}ine printer or
2900 @i{l}pr). You can print all the messages in a range. The message is
2901 formatted with @command{mhl}@footnote{See the section
2902 @uref{@value{MH-BOOK-HOME}/shomes.html#Usisho, Using mhl} in the MH
2903 book.} and printed with the @command{lpr} command.
2905 @kindex P f
2906 @kindex P l
2907 @kindex P p
2908 @vindex mh-lpr-command-format
2909 @vindex mh-print-background-flag
2911 The command @kbd{P l} uses two options. The option
2912 @code{mh-lpr-command-format} contains the Unix command line which
2913 performs the actual printing. The string can contain one escape,
2914 @samp{%s}, which is replaced by the name of the folder and the message
2915 number and is useful for print job names. The default setting is
2916 @code{"lpr -J '%s'"}. I use @code{"mpage -h'%s' -b Letter -H1of -mlrtb
2917 -P"} which produces a nice header and adds a bit of margin so the text
2918 fits within my printer's margins. Normally messages are printed in the
2919 foreground. If this is slow on your system, you may elect to turn on
2920 the option @code{mh-print-background-flag} to print in the background.
2921 If you do this, do not delete the message until it is printed or else
2922 the output may be truncated. These options are not used by the
2923 commands @kbd{P p} or @kbd{P f}.
2925 @node Files and Pipes, Navigating, Printing, Reading Mail
2926 @section Files and Pipes
2928 @cindex files
2929 @cindex pipes
2930 @findex mh-refile-or-write-again
2931 @findex mh-write-msg-to-file
2932 @kindex >
2933 @kindex !
2935 MH-E does offer a couple of commands that are not a part of MH@. The
2936 first one, @kbd{>} (@code{mh-write-msg-to-file}), writes a message to
2937 a file. You are prompted for the filename. If the file already exists,
2938 the message is appended to it. You can also write the message to the
2939 file without the header by specifying a prefix argument (such as
2940 @kbd{C-u > /tmp/foobar @key{RET}}). Subsequent writes to the same file
2941 can be made with the command @kbd{!}
2942 (@code{mh-refile-or-write-again}).
2944 @findex mh-pipe-msg
2945 @kindex |
2946 @kindex l
2948 You can also pipe the message through a Unix shell command with the
2949 command @kbd{|} (@code{mh-pipe-msg}). You are prompted for the Unix
2950 command through which you wish to run your message. If you give a
2951 prefix argument to this command, the message header is included in the
2952 text passed to the command (the contrived example @kbd{C-u | lpr}
2953 would be done with the @kbd{l} command instead).
2955 @cindex @command{shar}
2956 @cindex @command{uuencode}
2957 @cindex Unix commands, @command{shar}
2958 @cindex Unix commands, @command{uuencode}
2959 @findex mh-store-msg
2960 @kindex X s
2961 @vindex mh-store-default-directory
2963 If the message is a shell archive @command{shar} or has been run
2964 through @command{uuencode} use @kbd{X s} (@code{mh-store-msg}) to
2965 extract the body of the message. The default directory for extraction
2966 is the current directory; however, you have a chance to specify a
2967 different extraction directory. The next time you use this command,
2968 the default directory is the last directory you used. If you would
2969 like to change the initial default directory, customize the option
2970 @code{mh-store-default-directory}, change the value from
2971 @samp{Current} to @samp{Directory}, and then enter the name of the
2972 directory for storing the content of these messages.
2974 @findex mh-store-buffer
2975 @kindex @key{RET}
2976 @kindex X s
2978 By the way, @kbd{X s} calls the Emacs Lisp function
2979 @code{mh-store-buffer}. I mention this because you can use it directly
2980 if you're editing a buffer that contains a file that has been run
2981 through @command{uuencode} or @command{shar}. For example, you can
2982 extract the contents of the current buffer in your home directory by
2983 typing @kbd{M-x mh-store-buffer @key{RET} ~ @key{RET}}.
2985 @node Navigating, Miscellaneous Commands and Options, Files and Pipes, Reading Mail
2986 @section Navigating
2988 @cindex moving between messages
2989 @cindex navigation
2990 @findex mh-first-msg
2991 @findex mh-goto-msg
2992 @findex mh-last-msg
2993 @findex mh-next-undeleted-msg
2994 @findex mh-next-unread-msg
2995 @findex mh-previous-undeleted-msg
2996 @findex mh-previous-unread-msg
2997 @kindex g
2998 @kindex M-<
2999 @kindex M->
3000 @kindex M-n
3001 @kindex M-p
3002 @kindex n
3003 @kindex p
3005 To move on to the next message, use the command @kbd{n}
3006 (@code{mh-next-undeleted-msg}); use @kbd{p}
3007 (@code{mh-previous-undeleted-msg}) to read the previous message. To
3008 move to the next unread message, use @kbd{M-n}
3009 (@code{mh-next-unread-msg}); use @kbd{M-p}
3010 (@code{mh-previous-unread-msg}) to move to the previous unread
3011 message. These commands can be given a prefix argument to specify how
3012 many messages to skip (for example, @kbd{5 n}). You can also move to a
3013 specific message with @kbd{g} (@code{mh-goto-msg}). You can enter the
3014 message number either before or after typing @kbd{g}. In the latter
3015 case, Emacs prompts you. Finally, you can go to the first or last
3016 message with @kbd{M-<} (@code{mh-first-msg}) and @kbd{M->}
3017 (@code{mh-last-msg}) respectively.
3019 @cindex MH-Folder mode
3020 @cindex modes, MH-Folder
3021 @findex next-line
3022 @findex previous-line
3023 @kindex C-n
3024 @kindex C-p
3025 @kindex @key{RET}
3027 You can also use the Emacs commands @kbd{C-p} (@code{previous-line})
3028 and @kbd{C-n} (@code{next-line}) to move up and down the scan lines in
3029 the MH-Folder window. These commands can be used in conjunction with
3030 @key{RET} to look at deleted or refiled messages.
3032 @cindex deleting messages
3033 @findex mh-delete-msg
3034 @kindex d
3035 @kindex n
3036 @kindex p
3038 To mark a message for deletion, use the command @kbd{d}
3039 (@code{mh-delete-msg}). A @samp{D} is placed by the message in the
3040 scan window, and the next undeleted message is displayed. If the
3041 previous command had been @kbd{p}, then the next message displayed is
3042 the first undeleted message previous to the message just deleted. Use
3043 @kbd{n} to force subsequent @kbd{d} commands to move forward to the
3044 next undeleted message after deleting the message under the cursor.
3045 You may also specify a range (for example, @kbd{C-u d 1 3 5-7 last:5
3046 frombob @key{RET}}, @pxref{Ranges}).
3048 @findex mh-delete-msg-no-motion
3049 @kindex C-d
3051 The command @kbd{C-d} (@code{mh-delete-msg-no-motion}) marks the
3052 message (or messages in range) for deletion but leaves the cursor at
3053 the current message in case you wish to perform other operations on
3054 the message.
3056 @findex mh-delete-subject
3057 @findex mh-delete-subject-or-thread
3058 @findex mh-thread-delete
3059 @findex mh-undo
3060 @kindex k
3061 @kindex T d
3062 @kindex u
3064 And to delete more messages faster, you can use @kbd{k}
3065 (@code{mh-delete-subject-or-thread}) to delete all the messages with
3066 the same subject as the current message. This command puts these
3067 messages in a sequence named @samp{subject}. You can undo this action
3068 by using @kbd{u} (@code{mh-undo}) with a prefix argument and then
3069 specifying the @samp{subject} sequence. However, if the buffer is
3070 displaying a threaded view of the folder then @kbd{k} behaves like
3071 @kbd{T d} (@code{mh-thread-delete}). @xref{Threading}.
3073 @findex mh-execute-commands
3074 @kindex x
3076 However you mark a message for deletion, the command @kbd{x}
3077 (@code{mh-execute-commands}) actually carries out the deletion
3078 (@pxref{Folders}).
3080 @vindex mh-delete-msg-hook
3082 The hook @code{mh-delete-msg-hook} is called after you mark a message
3083 for deletion. For example, a past maintainer of MH-E used this once
3084 when he kept statistics on his mail usage.
3086 @node Miscellaneous Commands and Options,  , Navigating, Reading Mail
3087 @section Miscellaneous Commands and Options
3089 This section contains a few more miscellaneous commands and options.
3091 @cindex editing message
3092 @findex mh-modify
3093 @kindex M
3095 There are times when you need to edit a message. For example, you may
3096 need to fix a broken Content-Type header field. You can do this with
3097 the command @kbd{M} (@code{mh-modify}). It displays the raw message in
3098 an editable buffer. When you are done editing, save and kill the
3099 buffer as you would any other.
3101 @findex mh-kill-folder
3102 @findex mh-pack-folder
3103 @vindex mh-do-not-confirm-flag
3105 Commands such as @code{mh-pack-folder} prompt to confirm whether to
3106 process outstanding moves and deletes or not before continuing.
3107 Turning on the option @code{mh-do-not-confirm-flag} means that these
3108 actions will be performed---which is usually desired but cannot be
3109 retracted---without question@footnote{In previous versions of MH-E,
3110 this option suppressed the confirmation in @code{mh-kill-folder}.
3111 Since this kept most users from setting this option,
3112 @code{mh-kill-folder} was modified in version 6.0 to always ask for
3113 confirmation subject to @code{mh-kill-folder-suppress-prompt-hook}.
3114 @xref{Folders}.}.
3116 @cindex MH-Folder mode
3117 @cindex modes, MH-Folder
3118 @vindex mh-summary-height
3120 The option @code{mh-summary-height} controls the number of scan lines
3121 displayed in the MH-Folder window, including the mode line. The
3122 default value of this option is @samp{Automatic} which means that the
3123 MH-Folder buffer will maintain the same proportional size if the frame
3124 is resized. If you'd prefer a fixed height, then choose the
3125 @samp{Fixed Size} option and enter the number of lines you'd like to
3126 see.
3128 @vindex mh-bury-show-buffer-flag
3130 Normally the buffer for displaying messages is buried at the bottom at
3131 the buffer stack. You may wish to disable this feature by turning off
3132 the option @code{mh-bury-show-buffer-flag}. One advantage of not
3133 burying the show buffer is that one can delete the show buffer more
3134 easily in an electric buffer list because of its proximity to its
3135 associated MH-Folder buffer. Try running @kbd{M-x
3136 electric-buffer-list} to see what I mean.
3138 @cindex @file{.emacs}
3139 @cindex files, @file{.emacs}
3140 @cindex reading mail
3142 Before we leave this section, I'll include a function that I use as a
3143 front end to MH-E@footnote{Stephen Gildea's favorite binding is
3144 @kbd{(global-set-key "\C-cr" 'mh-rmail)}.}. It toggles between your
3145 working window configuration, which may be quite involved---windows
3146 filled with source, compilation output, man pages, and other
3147 documentation---and your MH-E window configuration. Like the rest of
3148 the customization described in this section, simply add the following
3149 code to @file{~/.emacs}.
3151 @iftex
3152 @filbreak
3153 @end iftex
3155 @findex mh-rmail, example
3157 @smalllisp
3158 @group
3159 (defvar my-mh-screen-saved nil
3160   "Set to non-@code{nil} when MH-E window configuration shown.")
3161 (defvar my-normal-screen nil "Normal window configuration.")
3162 (defvar my-mh-screen nil "MH-E window configuration.")
3164 (defun my-mh-rmail (&optional arg)
3165   "Toggle between MH-E and normal screen configurations.
3166 With non-@code{nil} or prefix argument, @i{inc} mailbox as well
3167 when going into mail."
3168   (interactive "P")                 ; @r{user callable function, P=prefix arg}
3169   (setq my-mh-screen-saved          ; @r{save state}
3170         (cond
3171          ;; @r{Bring up MH-E screen if arg or normal window configuration.}
3172          ;; @r{If arg or +inbox buffer doesn't exist, run mh-rmail.}
3173          ((or arg (null my-mh-screen-saved))
3174           (setq my-normal-screen (current-window-configuration))
3175           (if (or arg (null (get-buffer "+inbox")))
3176               (mh-rmail)
3177             (set-window-configuration my-mh-screen))
3178           t)                        ; @r{set my-mh-screen-saved to @code{t}}
3179          ;; @r{Otherwise, save MH-E screen and restore normal screen.}
3180          (t
3181           (setq my-mh-screen (current-window-configuration))
3182           (set-window-configuration my-normal-screen)
3183           nil))))                   ; @r{set my-mh-screen-saved to nil}
3185 (global-set-key "\C-x\r" 'my-mh-rmail)  ;@r{ call with C-x @key{RET}}
3187 @i{Starting MH-E}
3189 @end group
3190 @end smalllisp
3192 If you type an argument (@kbd{C-u}) or if @code{my-mh-screen-saved} is
3193 @code{nil} (meaning a non-MH-E window configuration), the current
3194 window configuration is saved, either the @samp{+inbox} buffer is
3195 displayed or @code{mh-rmail} is run, and the MH-E window configuration
3196 is shown. Otherwise, the MH-E window configuration is saved and the
3197 original configuration is displayed.
3199 @node Folders, Sending Mail, Reading Mail, Top
3200 @chapter Organizing Your Mail with Folders
3202 @cindex @samp{Folder} menu
3203 @cindex @samp{Message} menu
3204 @cindex folders
3205 @cindex menu, @samp{Folder}
3206 @cindex menu, @samp{Message}
3207 @cindex using folders
3209 This chapter discusses the things you can do with folders within MH-E@.
3210 The commands in this chapter are also found in the @samp{Folder} and
3211 @samp{Message} menus.
3213 @table @kbd
3214 @kindex ?
3215 @findex mh-help
3216 @item ?
3217 Display cheat sheet for the MH-E commands (@code{mh-help}).
3218 @c -------------------------
3219 @kindex !
3220 @findex mh-refile-or-write-again
3221 @item !
3222 Repeat last output command (@code{mh-refile-or-write-again}).
3223 @c -------------------------
3224 @cindex @samp{Message > Copy Message to Folder...} menu item
3225 @cindex menu item, @samp{Message > Copy Message to Folder...}
3226 @kindex c
3227 @findex mh-copy-msg
3228 @item c
3229 Copy range to folder (@code{mh-copy-msg}).
3230 @c -------------------------
3231 @kindex F ?
3232 @findex mh-prefix-help
3233 @item F ?
3234 Display cheat sheet for the commands of the current prefix in
3235 minibuffer (@code{mh-prefix-help}).
3236 @c -------------------------
3237 @kindex F '
3238 @findex mh-index-ticked-messages
3239 @item F '
3240 Display ticked messages (@code{mh-index-ticked-messages}).
3241 @c -------------------------
3242 @kindex F c
3243 @findex mh-catchup
3244 @item F c
3245 Delete range from the @samp{unseen} sequence (@code{mh-catchup}).
3246 @c -------------------------
3247 @kindex F k
3248 @findex mh-kill-folder
3249 @item F k
3250 Remove folder (@code{mh-kill-folder}).
3251 @c -------------------------
3252 @cindex @samp{Folder > List Folders} menu item
3253 @cindex menu item, @samp{Folder > List Folders}
3254 @kindex F l
3255 @findex mh-list-folders
3256 @item F l
3257 List all folders (@code{mh-list-folders}).
3258 @c -------------------------
3259 @cindex @samp{Folder > View New Messages} menu item
3260 @cindex menu item, @samp{Folder > View New Messages}
3261 @kindex F n
3262 @findex mh-index-new-messages
3263 @item F n
3264 Display unseen messages (@code{mh-index-new-messages}).
3265 @c -------------------------
3266 @cindex @samp{Folder > Pack Folder} menu item
3267 @cindex menu item, @samp{Folder > Pack Folder}
3268 @kindex F p
3269 @findex mh-pack-folder
3270 @item F p
3271 Pack folder (@code{mh-pack-folder}).
3272 @c -------------------------
3273 @kindex F q
3274 @findex mh-index-sequenced-messages
3275 @item F q
3276 Display messages in any sequence (@code{mh-index-sequenced-messages}).
3277 @c -------------------------
3278 @cindex @samp{Folder > Rescan Folder} menu item
3279 @cindex menu item, @samp{Folder > Rescan Folder}
3280 @kindex F r
3281 @findex mh-rescan-folder
3282 @item F r
3283 Rescan folder (@code{mh-rescan-folder}).
3284 @c -------------------------
3285 @cindex @samp{Folder > Search...} menu item
3286 @cindex menu item, @samp{Folder > Search...}
3287 @kindex F s
3288 @findex mh-search
3289 @item F s
3290 Search your MH mail (@code{mh-search}).
3291 @c -------------------------
3292 @cindex @samp{Folder > Sort Folder} menu item
3293 @cindex menu item, @samp{Folder > Sort Folder}
3294 @kindex F S
3295 @findex mh-sort-folder
3296 @item F S
3297 Sort folder (@code{mh-sort-folder}).
3298 @c -------------------------
3299 @kindex F u
3300 @findex mh-undo-folder
3301 @item F u
3302 Undo all refiles and deletes in the current folder (@code{mh-undo-folder}).
3303 @c -------------------------
3304 @cindex @samp{Folder > Visit a Folder...} menu item
3305 @cindex menu item, @samp{Folder > Visit a Folder...}
3306 @kindex F v
3307 @findex mh-visit-folder
3308 @item F v
3309 Visit folder (@code{mh-visit-folder}).
3310 @c -------------------------
3311 @cindex @samp{Message > Refile Message} menu item
3312 @cindex menu item, @samp{Message > Refile Message}
3313 @kindex o
3314 @findex mh-refile-msg
3315 @item o
3316 Refile (output) range into folder (@code{mh-refile-msg}).
3317 @c -------------------------
3318 @cindex @samp{Folder > Quit MH-E} menu item
3319 @cindex menu item, @samp{Folder > Quit MH-E}
3320 @kindex q
3321 @findex mh-quit
3322 @item q
3323 Quit the current MH-E folder (@code{mh-quit}).
3324 @c -------------------------
3325 @cindex @samp{Folder > Toggle Show/Folder} menu item
3326 @cindex menu item, @samp{Folder > Toggle Show/Folder}
3327 @kindex t
3328 @findex mh-toggle-showing
3329 @item t
3330 Toggle between MH-Folder and MH-Folder Show modes
3331 (@code{mh-toggle-showing}).
3332 @c -------------------------
3333 @cindex @samp{Message > Undo Delete/Refile} menu item
3334 @cindex menu item, @samp{Message > Undo Delete/Refile}
3335 @kindex u
3336 @findex mh-undo
3337 @item u
3338 Undo pending deletes or refiles in range (@code{mh-undo}).
3339 @c -------------------------
3340 @cindex @samp{Message > Execute Delete/Refile} menu item
3341 @cindex menu item, @samp{Message > Execute Delete/Refile}
3342 @kindex x
3343 @findex mh-execute-commands
3344 @item x
3345 Process outstanding delete and refile requests
3346 (@code{mh-execute-commands}).
3347 @end table
3349 @cindex @samp{mh-folder} customization group
3350 @cindex customization group, @samp{mh-folder}
3352 The @samp{mh-folder} customization group is used to tune these
3353 commands.
3355 @vtable @code
3356 @item mh-new-messages-folders
3357 Folders searched for the @samp{unseen} sequence (default:
3358 @code{Inbox}).
3359 @c -------------------------
3360 @item mh-ticked-messages-folders
3361 Folders searched for @code{mh-tick-seq} (default: @code{t}).
3362 @c -------------------------
3363 @item mh-large-folder
3364 The number of messages that indicates a large folder (default: 200).
3365 @c -------------------------
3366 @item mh-recenter-summary-flag
3367 On means to recenter the summary window (default: @samp{off}).
3368 @c -------------------------
3369 @item mh-recursive-folders-flag
3370 On means that commands which operate on folders do so recursively
3371 (default: @samp{off}).
3372 @c -------------------------
3373 @item mh-sortm-args
3374 Additional arguments for @command{sortm} (default: @code{nil}).
3375 @end vtable
3377 The following hooks are available.
3379 @vtable @code
3380 @item mh-after-commands-processed-hook
3381 Hook run by @kbd{x} after performing outstanding refile and delete
3382 requests (default: @code{nil}).
3383 @c -------------------------
3384 @item mh-before-commands-processed-hook
3385 Hook run by @kbd{x} before performing outstanding refile and delete
3386 requests (default: @code{nil}).
3387 @c -------------------------
3388 @item mh-before-quit-hook
3389 Hook run by q before quitting MH-E (default: @code{nil}).
3390 @c -------------------------
3391 @item mh-folder-mode-hook
3392 Hook run by @code{mh-folder-mode} when visiting a new folder (default:
3393 @code{nil}).
3394 @c -------------------------
3395 @item mh-kill-folder-suppress-prompt-hook
3396 Abnormal hook run at the beginning of @code{mh-kill-folder} (default:
3397 @code{'mh-search-p}).
3398 @c -------------------------
3399 @item mh-pack-folder-hook
3400 Hook run by @code{mh-pack-folder} after renumbering the messages
3401 (default: @code{nil}).
3402 @c -------------------------
3403 @item mh-quit-hook
3404 Hook run by q after quitting MH-E (default: @code{nil}).
3405 @c -------------------------
3406 @item mh-refile-msg-hook
3407 Hook run by o after marking each message for refiling (default:
3408 @code{nil}).
3409 @end vtable
3411 The following faces are available for customizing the appearance of
3412 the MH-Folder buffer. @xref{Scan Line Formats}.
3414 @vtable @code
3415 @item mh-folder-address
3416 Recipient face.
3417 @c -------------------------
3418 @item mh-folder-body
3419 Body text face.
3420 @c -------------------------
3421 @item mh-folder-cur-msg-number
3422 Current message number face.
3423 @c -------------------------
3424 @item mh-folder-date
3425 Date face.
3426 @c -------------------------
3427 @item mh-folder-deleted
3428 Deleted message face.
3429 @c -------------------------
3430 @item mh-folder-followup
3431 @samp{Re:} face.
3432 @c -------------------------
3433 @item mh-folder-msg-number
3434 Message number face.
3435 @c -------------------------
3436 @item mh-folder-refiled
3437 Refiled message face.
3438 @c -------------------------
3439 @vindex mh-scan-format-nmh
3440 @vindex mh-scan-sent-to-me-sender-regexp
3441 @item mh-folder-sent-to-me-hint
3442 Fontification hint face in messages sent directly to us. The detection
3443 of messages sent to us is governed by the scan format
3444 @code{mh-scan-format-nmh} and regular expression
3445 @code{mh-scan-sent-to-me-sender-regexp}.
3446 @c -------------------------
3447 @vindex mh-scan-format-nmh
3448 @vindex mh-scan-sent-to-me-sender-regexp
3449 @item mh-folder-scan-format
3450 Sender face in messages sent directly to us. The detection of messages
3451 sent to us is governed by the scan format @code{mh-scan-format-nmh}
3452 and regular expression @code{mh-scan-sent-to-me-sender-regexp}.
3453 @c -------------------------
3454 @item mh-folder-subject
3455 Subject face.
3456 @c -------------------------
3457 @item mh-folder-tick
3458 Ticked message face.
3459 @c -------------------------
3460 @item mh-folder-to
3461 @samp{To:} face.
3462 @end vtable
3464 @vindex mh-folder-mode-hook
3466 The hook @code{mh-folder-mode-hook} is called when visiting a new
3467 folder in MH-Folder mode. This could be used to set your own key
3468 bindings, for example:
3470 @vindex mh-folder-mode-hook, example
3472 @smalllisp
3473 @group
3474 (defvar my-mh-init-done nil
3475   "Non-@code{nil} when one-time MH-E settings made.")
3477 (defun my-mh-folder-mode-hook ()
3478   "Hook to set key bindings in MH-Folder mode."
3479   (if (not my-mh-init-done)             ; @r{only need to bind the keys once }
3480       (progn
3481         (local-set-key "//" 'my-search-msg)
3482         (local-set-key "b" 'mh-burst-digest)    ; @r{better use of @kbd{b}}
3483         (setq my-mh-init-done t))))
3485 (add-hook 'mh-folder-mode-hook 'my-mh-folder-mode-hook)
3487 (defun my-search-msg ()
3488   "Search for a regexp in the current message."
3489   (interactive)                         ; @r{user function}
3490   (save-window-excursion
3491     (other-window 1)                    ; @r{go to next window}
3492     (isearch-forward-regexp)))          ; @r{string search; hit return}
3493                                         ; @r{  when done}
3495 @i{Create additional key bindings via mh-folder-mode-hook}
3497 @end group
3498 @end smalllisp
3500 @cindex @command{folder}
3501 @cindex @command{refile}
3502 @cindex MH commands, @command{folder}
3503 @cindex MH commands, @command{refile}
3504 @findex mh-refile-msg
3505 @kindex o
3506 @vindex mh-refile-msg-hook
3508 MH-E has analogies for each of the MH @command{folder} and
3509 @command{refile} commands@footnote{See the sections
3510 @uref{@value{MH-BOOK-HOME}/fol.html#Youfol, Your Current Folder:
3511 folder} and @uref{@value{MH-BOOK-HOME}/fol.html#Movref, Moving and
3512 Linking Messages: refile} in the MH book.}. To refile a message in
3513 another folder, use the command @kbd{o} (@code{mh-refile-msg})
3514 (mnemonic: ``output''). You are prompted for the folder name
3515 (@pxref{Folder Selection}). Note that this command can also be used to
3516 create folders. If you specify a folder that does not exist, you will
3517 be prompted to create it. The hook @code{mh-refile-msg-hook} is called
3518 after a message is marked to be refiled.
3520 @findex mh-write-msg-to-file
3521 @kindex !
3523 If you are refiling several messages into the same folder, you can use
3524 the command @kbd{!} (@code{mh-refile-or-write-again}) to repeat the
3525 last refile or write (for the description of @kbd{>}
3526 (@code{mh-write-msg-to-file}), @pxref{Files and Pipes}). You can use a
3527 range in either case (for example, @kbd{C-u o 1 3 5-7 last:5 frombob
3528 @key{RET}}, @pxref{Ranges}).
3530 @cindex expunging refiles and deletes
3531 @cindex undoing refiles and deletes
3532 @findex mh-undo
3533 @kindex u
3535 If you've deleted a message or refiled it, but changed your mind, you
3536 can cancel the action before you've executed it. Use @kbd{u}
3537 (@code{mh-undo}) to undo a refile on or deletion of a single message.
3538 You can also undo refiles and deletes for messages that are found in a
3539 given range (@pxref{Ranges}).
3541 @findex mh-undo-folder
3542 @kindex F u
3544 Alternatively, you can use @kbd{F u} (@code{mh-undo-folder}) to undo
3545 all refiles and deletes in the current folder.
3547 @findex mh-execute-commands
3548 @kindex x
3550 If you've marked messages to be deleted or refiled and you want to go
3551 ahead and delete or refile the messages, use @kbd{x}
3552 (@code{mh-execute-commands}). Many MH-E commands that may affect the
3553 numbering of the messages (such as @kbd{F r} or @kbd{F p}) will ask if
3554 you want to process refiles or deletes first and then either run
3555 @kbd{x} for you or undo the pending refiles and deletes.
3557 @kindex x
3558 @vindex mh-after-commands-processed-hook
3559 @vindex mh-before-commands-processed-hook
3560 @vindex mh-current-folder
3562 The command @kbd{x} runs @code{mh-before-commands-processed-hook}
3563 before the commands are processed and
3564 @code{mh-after-commands-processed-hook} after the commands are
3565 processed. Variables that are useful with the former hook include
3566 @code{mh-delete-list} and @code{mh-refile-list} which can be used to
3567 see which changes will be made to the current folder,
3568 @code{mh-current-folder}. Variables that are useful with the latter
3569 hook include @code{mh-folders-changed}, which lists which folders were
3570 affected by deletes and refiles. This list will always include the
3571 current folder @code{mh-current-folder}.
3573 @findex mh-copy-msg
3574 @kindex c
3575 @kindex o
3577 If you wish to copy a message to another folder, you can use the
3578 command @kbd{c} (@code{mh-copy-msg}) (see the @option{-link} argument
3579 to @command{refile}(1)). Like the command @kbd{o}, this command
3580 prompts you for the name of the target folder and you can specify a
3581 range (@pxref{Ranges}). Note that unlike the command @kbd{o}, the copy
3582 takes place immediately. The original copy remains in the current
3583 folder.
3585 @cindex junk mail
3586 @cindex MH-Folder mode
3587 @cindex MH-Folder Show mode
3588 @cindex modes, MH-Folder
3589 @cindex modes, MH-Folder Show
3590 @cindex spam
3591 @findex mh-toggle-showing
3592 @kindex t
3594 The command @kbd{t} (@code{mh-toggle-showing}) switches between
3595 MH-Folder mode and MH-Folder Show mode@footnote{For you Emacs wizards,
3596 this is implemented as an Emacs minor mode.}. MH-Folder mode turns off
3597 the associated show buffer so that you can perform operations on the
3598 messages quickly without reading them. This is an excellent way to
3599 prune out your junk mail or to refile a group of messages to another
3600 folder for later examination.
3602 @cindex MH-Folder mode
3603 @cindex MH-Show mode
3604 @cindex modes, MH-Folder
3605 @cindex modes, MH-Show
3606 @cindex moving between messages
3607 @kindex t
3608 @vindex mh-recenter-summary-flag
3610 When you use @kbd{t} to toggle from MH-Folder Show mode to MH-Folder
3611 mode, the MH-Show buffer is hidden and the MH-Folder buffer is left
3612 alone. Setting @code{mh-recenter-summary-flag} to a non-@code{nil}
3613 value causes the toggle to display as many scan lines as possible,
3614 with the cursor at the middle. The effect of
3615 @code{mh-recenter-summary-flag} is rather useful, but it can be
3616 annoying on a slow network connection.
3618 @findex mh-visit-folder
3619 @kindex F v
3620 @vindex mh-large-folder
3622 When you want to read the messages that you have refiled into folders,
3623 use the command @kbd{F v} (@code{mh-visit-folder}) to visit the
3624 folder. You are prompted for the folder name. The folder buffer will
3625 show just unseen messages if there are any; otherwise, it will show
3626 all the messages in the buffer as long there are fewer than
3627 @code{mh-large-folder} messages. If there are more, then you are
3628 prompted for a range of messages to scan. You can provide a prefix
3629 argument in order to specify a range of messages to show when you
3630 visit the folder (@pxref{Ranges}). In this case, regions are not used
3631 to specify the range and @code{mh-large-folder} is ignored. Note that
3632 this command can also be used to create folders. If you specify a
3633 folder that does not exist, you will be prompted to create it.
3635 @findex mh-search
3636 @kindex F s
3638 If you forget where you've refiled your messages, you can find them
3639 using @kbd{F s} (@code{mh-search}). @xref{Searching}.
3641 @cindex @command{procmail}
3642 @cindex @samp{unseen} sequence
3643 @cindex sequence, @samp{unseen}
3644 @cindex Unix commands, @command{procmail}
3645 @cindex unseen messages, viewing
3646 @findex mh-index-new-messages
3647 @kindex F n
3648 @vindex mh-new-messages-folders
3650 If you use a program such as @command{procmail} to file your incoming
3651 mail automatically, you can display new, unseen, messages using the
3652 command @kbd{F n} (@code{mh-index-new-messages}). All messages in the
3653 @samp{unseen} sequence from the folders in
3654 @code{mh-new-messages-folders} are listed. However, this list of
3655 folders can be overridden with a prefix argument: with a prefix
3656 argument, enter a space-separated list of folders, or nothing to
3657 search all folders.
3659 @cindex @samp{tick} sequence
3660 @cindex sequence, @samp{tick}
3661 @cindex ticked messages, viewing
3662 @findex mh-index-ticked-messages
3663 @kindex F '
3664 @vindex mh-ticked-messages-folders
3666 If you have ticked messages (@pxref{Sequences}), you can display them
3667 using the command @kbd{F '} (@code{mh-index-ticked-messages}). All
3668 messages in the @samp{tick} sequence from the folders in
3669 @code{mh-ticked-messages-folders} are listed. With a prefix argument,
3670 enter a space-separated list of folders, or nothing to search all
3671 folders.
3673 @findex mh-index-sequenced-messages
3674 @kindex F q
3675 @vindex mh-new-messages-folders
3677 You can display messages in any sequence with the command @kbd{F q}
3678 (@code{mh-index-sequenced-messages}). All messages from the folders in
3679 @code{mh-new-messages-folders} in the sequence you provide are listed.
3680 With a prefix argument, enter a space-separated list of folders at the
3681 prompt, or nothing to search all folders.
3683 @vindex mh-new-messages-folders
3684 @vindex mh-recursive-folders-flag
3685 @vindex mh-ticked-messages-folders
3687 Set the options @code{mh-new-messages-folders} and
3688 @code{mh-ticked-messages-folders} to @samp{Inbox} to search the
3689 @samp{+inbox} folder or @samp{All} to search all of the top level
3690 folders. Otherwise, list the folders that should be searched with the
3691 @samp{Choose Folders} menu item. See @code{mh-recursive-folders-flag}.
3693 @cindex buffers, @samp{*MH-E Folders*}
3694 @cindex @samp{*MH-E Folders*}
3695 @findex mh-kill-folder
3696 @findex mh-list-folders
3697 @findex mh-pack-folder
3698 @findex mh-rescan-folder
3699 @findex mh-sort-folder
3700 @kindex F k
3701 @kindex F l
3702 @kindex F p
3703 @kindex F r
3704 @kindex F S
3706 Other commands you can perform on folders include: @kbd{F l}
3707 (@code{mh-list-folders}), to place a listing of all the folders in
3708 your mail directory in a buffer called @samp{*MH-E Folders*}
3709 (@pxref{Miscellaneous}); @kbd{F k} (@code{mh-kill-folder}), to remove
3710 a folder; @kbd{F S} (@code{mh-sort-folder}), to sort the messages by
3711 date (see @command{sortm}(1) to see how to sort by other criteria);
3712 @kbd{F p} (@code{mh-pack-folder}), to pack a folder, removing gaps
3713 from the numbering sequence; and @kbd{F r} (@code{mh-rescan-folder}),
3714 to rescan the folder, which is useful to grab all messages in your
3715 @samp{+inbox} after processing your new mail for the first time. If
3716 you don't want to rescan the entire folder, the commands @kbd{F r} or
3717 @kbd{F p} will accept a range (@pxref{Ranges}).
3719 @kindex F p
3720 @vindex mh-pack-folder-hook
3722 The command @kbd{F p} runs @code{mh-pack-folder-hook} after
3723 renumbering the messages. A variable that is useful with this hook
3724 is @code{mh-current-folder}.
3726 @kindex @key{TAB}
3727 @vindex mh-recursive-folders-flag
3729 By default, operations on folders work only one level at a time. Set
3730 @code{mh-recursive-folders-flag} to non-@code{nil} to operate on all
3731 folders. This mostly means that you'll be able to see all your folders
3732 when you press @key{TAB} when prompted for a folder name.
3734 @findex mh-search-p
3735 @kindex k
3736 @vindex mh-kill-folder-suppress-prompt-functions
3738 The hook @code{mh-kill-folder-suppress-prompt-functions} is an abnormal
3739 hook run at the beginning of the command @kbd{k}. The hook functions
3740 are called with no arguments and should return a non-nil value to
3741 suppress the normal prompt when you remove a folder. This is useful
3742 for folders that are easily regenerated. The default value of
3743 @code{mh-search-p} suppresses the prompt on folders generated by
3744 searching.
3746 @sp 1
3747 @center @strong{NOTE}
3749 @quotation
3750 Use this hook with care. If there is a bug in your hook which returns
3751 @code{t} on @samp{+inbox} and you press @kbd{k} by accident in the
3752 @code{+inbox} folder, you will not be happy.
3753 @end quotation
3754 @sp 1
3756 @cindex @command{sortm}
3757 @cindex @file{.mh_profile}
3758 @cindex files, @file{.mh_profile}
3759 @cindex MH commands, @command{sortm}
3760 @cindex MH profile component, @samp{sortm:}
3761 @cindex @samp{sortm:} MH profile component
3762 @kindex F S
3763 @vindex mh-sortm-args
3765 The option @code{mh-sortm-args} holds extra arguments to pass on to
3766 the command @command{sortm}@footnote{See the section
3767 @uref{@value{MH-BOOK-HOME}/sorsor.html, Sorting Messages: sortm} in the
3768 MH book.} when a prefix argument is used with @kbd{F S}. Normally
3769 default arguments to @command{sortm} are specified in the MH profile.
3770 This option may be used to provide an alternate view. For example,
3771 @samp{'(\"-nolimit\" \"-textfield\" \"subject\")} is a useful setting.
3773 @cindex exiting
3774 @cindex quitting
3775 @findex mh-quit
3776 @kindex q
3778 When you want to quit using MH-E and go back to editing, you can use
3779 the @kbd{q} (@code{mh-quit}) command. This buries the buffers of the
3780 current MH-E folder and restores the buffers that were present when
3781 you first ran @kbd{M-x mh-rmail}. It also removes any MH-E working
3782 buffers whose name begins with @samp{ *mh-} or @samp{*MH-E }
3783 (@pxref{Miscellaneous}). You can later restore your MH-E session by
3784 selecting the @samp{+inbox} buffer or by running @kbd{M-x mh-rmail}
3785 again.
3787 @findex mh-execute-commands
3788 @kindex q
3789 @vindex mh-before-quit-hook
3790 @vindex mh-before-quit-hook, example
3791 @vindex mh-quit-hook
3792 @vindex mh-quit-hook, example
3794 The two hooks @code{mh-before-quit-hook} and @code{mh-quit-hook} are
3795 called by @kbd{q}. The former one is called before the quit occurs, so
3796 you might use it to perform any MH-E operations; you could perform
3797 some query and abort the quit or call @code{mh-execute-commands}, for
3798 example. The latter is not run in an MH-E context, so you might use it
3799 to modify the window setup. If you find that @kbd{q} buries a lot of
3800 buffers that you would rather remove, you can use both
3801 @code{mh-before-quit-hook} and @code{mh-quit-hook} to accomplish that.
3803 @smalllisp
3804 @group
3805 (defvar my-mh-folder-buffer-to-delete nil
3806   "Folder buffer that is being quit.")
3808 (defun my-mh-before-quit-hook ()
3809   "Save folder buffer that is to be deleted."
3810   (setq my-mh-folder-buffer-to-delete (current-buffer)))
3812 (defun my-mh-quit-hook ()
3813   "Kill folder buffer rather than just bury it."
3814   (set-buffer my-mh-folder-buffer-to-delete)
3815   (if (get-buffer mh-show-buffer)
3816       (kill-buffer mh-show-buffer))
3817   (kill-buffer (current-buffer)))
3819 @i{Kill MH-Folder buffer instead of burying it}
3820 @end group
3821 @end smalllisp
3823 @cindex folders, renaming
3824 @cindex renaming folders
3825 @findex dired
3826 @findex dired-do-rename
3828 You can use dired to manipulate the folders themselves. For example, I
3829 renamed my @samp{+out} folder to the more common @samp{+outbox} by
3830 running dired on my mail directory (@kbd{M-x dired RET ~/Mail RET}),
3831 moving my cursor to @samp{out} and using the command @kbd{R}
3832 (@code{dired-do-rename}).
3834 @node Sending Mail, Editing Drafts, Folders, Top
3835 @chapter Sending Mail
3837 @cindex sending mail
3838 @findex mh-smail
3839 @kindex M-x mh-smail
3841 You can send a mail message in several ways. You can call @kbd{M-x
3842 mh-smail} directly, or from the command line like this:
3844 @cindex starting from command line
3846 @smallexample
3847 $ @kbd{emacs -f mh-smail}
3848 @end smallexample
3850 @findex goto-address-at-point
3851 @vindex mail-user-agent
3853 There are some commands that need to send a mail message, such as
3854 @code{goto-address-at-point}. You can configure Emacs to have these
3855 commands use MH-E by setting the option @code{mail-user-agent} to
3856 @samp{Emacs interface to MH}.
3858 @cindex @samp{Message} menu
3859 @cindex menu, @samp{Message}
3861 From within MH-E's MH-Folder mode, other methods of sending mail are
3862 available as well. These can also be found in the @samp{Message} menu.
3864 @table @kbd
3865 @cindex @samp{Message > Edit Message Again} menu item
3866 @cindex menu item, @samp{Message > Edit Message Again}
3867 @kindex e
3868 @findex mh-edit-again
3869 @item e
3870 Edit a message to send it again (@code{mh-edit-again}).
3871 @c -------------------------
3872 @cindex @samp{Message > Re-edit a Bounced Message} menu item
3873 @cindex menu item, @samp{Message > Re-edit a Bounced Message}
3874 @kindex E
3875 @findex mh-extract-rejected-mail
3876 @item E
3877 Edit a message that was returned by the mail system
3878 (@code{mh-extract-rejected-mail}).
3879 @c -------------------------
3880 @cindex @samp{Message > Forward Message...} menu item
3881 @cindex menu item, @samp{Message > Forward Message...}
3882 @kindex f
3883 @findex mh-forward
3884 @item f
3885 Forward message (@code{mh-forward}).
3886 @c -------------------------
3887 @cindex @samp{Message > Reply to Message...} menu item
3888 @cindex menu item, @samp{Message > Reply to Message...}
3889 @kindex r
3890 @findex mh-reply
3891 @item r
3892 Reply to a message (@code{mh-reply}).
3893 @c -------------------------
3894 @cindex @samp{Message > Compose a New Message} menu item
3895 @cindex menu item, @samp{Message > Compose a New Message}
3896 @kindex s
3897 @findex mh-send
3898 @item s
3899 Compose a message (@code{mh-send}).
3900 @c -------------------------
3901 @cindex @samp{Message > Redistribute Message...} menu item
3902 @cindex menu item, @samp{Message > Redistribute Message...}
3903 @kindex M-d
3904 @findex mh-redistribute
3905 @item M-d
3906 Redistribute a message (@code{mh-redistribute}).
3907 @c -------------------------
3908 @findex mh-smail
3909 @item M-x mh-smail
3910 Compose a message with the MH mail system.
3911 @c -------------------------
3912 @findex mh-smail-other-window
3913 @item M-x mh-smail-other-window
3914 Compose a message with the MH mail system in other window.
3915 @end table
3917 @cindex @samp{mh-sending-mail} customization group
3918 @cindex customization group, @samp{mh-sending-mail}
3920 In addition, several options from the @samp{mh-sending-mail}
3921 customization group are useful when sending mail or replying to mail.
3922 They are summarized in the following table.
3924 @vtable @code
3925 @item mh-compose-forward-as-mime-flag
3926 On means that messages are forwarded as attachments (default:
3927 @samp{on}).
3928 @c -------------------------
3929 @item mh-compose-letter-function
3930 Hook run when starting a new draft (default: @code{nil}).
3931 @c -------------------------
3932 @item mh-compose-prompt-flag
3933 On means prompt for header fields when composing a new draft (default:
3934 @samp{off}).
3935 @c -------------------------
3936 @item mh-forward-subject-format
3937 Format string for forwarded message subject (default: @code{"%s:
3938 %s"}).
3939 @c -------------------------
3940 @item mh-insert-x-mailer-flag
3941 On means append an @samp{X-Mailer:} header field to the header
3942 (default: @samp{on}).
3943 @c -------------------------
3944 @item mh-redist-full-contents-flag
3945 On means the @command{dist} command needs entire letter for
3946 redistribution (default: @samp{off}).
3947 @c -------------------------
3948 @item mh-reply-default-reply-to
3949 Sets the person or persons to whom a reply will be sent (default:
3950 @samp{Prompt}).
3951 @c -------------------------
3952 @item mh-reply-show-message-flag
3953 On means the MH-Show buffer is displayed using @kbd{r}
3954 (@code{mh-reply}) (default: @samp{on}).
3955 @end vtable
3957 The following hooks are available.
3959 @vtable @code
3960 @item mh-annotate-msg-hook
3961 Hook run by @code{mh-annotate-msg} after annotation (default:
3962 @code{nil}).
3963 @c -------------------------
3964 @item mh-forward-hook
3965 Hook run by @code{mh-forward} on a forwarded letter (default:
3966 @code{nil}).
3967 @c -------------------------
3968 @item mh-letter-mode-hook
3969 Hook run by @code{mh-letter-mode} on a new letter (default:
3970 @code{nil}).
3971 @end vtable
3973 @findex mh-annotate-msg
3974 @vindex mh-annotate-list
3975 @vindex mh-annotate-msg-hook
3976 @vindex mh-current-folder
3978 A hook that is called whenever a message is sent and after the scan
3979 lines and message are annotated is @code{mh-annotate-msg-hook}. Hook
3980 functions can access the current folder name with
3981 @code{mh-current-folder} and obtain the message numbers of the
3982 annotated messages with @code{mh-annotate-list}.
3984 The rest of the functions and options introduced here are explained in
3985 more detail in the following sections.
3987 @menu
3988 * Composing::
3989 * Replying::
3990 * Forwarding::
3991 * Redistributing::
3992 * Editing Again::
3993 @end menu
3995 @node Composing, Replying, Sending Mail, Sending Mail
3996 @section Composing
3998 @cindex @file{.emacs}
3999 @cindex MH-Folder mode
4000 @cindex composing mail
4001 @cindex draft
4002 @cindex files, @file{.emacs}
4003 @cindex modes, MH-Folder
4004 @cindex sending mail
4005 @findex mh-smail
4006 @findex mh-smail-other-window
4007 @kindex M-x mh-smail
4008 @kindex M-x mh-smail-other-window
4010 Outside of an MH-Folder buffer, you must call either @kbd{M-x
4011 mh-smail} or @kbd{M-x mh-smail-other-window} to compose a new message.
4012 The former command always creates a two-window layout with the current
4013 buffer on top and the draft on the bottom. Use the latter command if
4014 you would rather preserve the window layout. You may find adding the
4015 following key bindings to @file{~/.emacs} useful:
4017 @smalllisp
4018 (global-set-key "\C-xm" 'mh-smail)
4019 (global-set-key "\C-x4m" 'mh-smail-other-window)
4020 @end smalllisp
4022 @cindex draft folder
4023 @cindex MH-Letter mode
4024 @cindex modes, MH-Letter
4025 @findex mh-send
4026 @kindex m
4028 From within a MH-Folder buffer, you can simply use the command @kbd{m}
4029 (@code{mh-send}). However you invoke @code{mh-send}, your letter
4030 appears in an Emacs buffer whose mode is MH-Letter (to see what the
4031 buffer looks like, @pxref{Sending Mail Tour}). MH-Letter mode allows
4032 you to edit your message, to check the validity of the recipients, to
4033 insert attachments and other messages into your message, and to send
4034 the message. We'll go more into depth about editing a
4035 @dfn{draft}@footnote{I highly recommend that you use a @dfn{draft
4036 folder} so that you can edit several drafts in parallel. To do so,
4037 create a folder named @samp{+drafts} for example, and add the profile
4038 component @samp{Draft-Folder: drafts} (see @code{mh-profile}(5)).} (a
4039 message you're composing) in just a moment (@pxref{Editing Drafts}).
4041 @vindex mh-compose-prompt-flag
4043 If you prefer to be prompted for the recipient and subject fields
4044 before the MH-Letter buffer appears, turn on the option
4045 @code{mh-compose-prompt-flag}.
4047 @cindex header field, @samp{X-Mailer:}
4048 @cindex @samp{X-Mailer:} header field
4049 @vindex mh-insert-x-mailer-flag
4051 MH-E adds an @samp{X-Mailer:} header field to the header that includes
4052 the version of MH-E and Emacs that you are using. If you don't want to
4053 participate in our marketing, you can turn off the option
4054 @code{mh-insert-x-mailer-flag}.
4056 @cindex @command{repl}
4057 @cindex @file{components}
4058 @cindex MH commands, @command{repl}
4059 @cindex MH-Letter mode
4060 @cindex Mail mode
4061 @cindex files, @file{components}
4062 @cindex modes, MH-Letter
4063 @cindex modes, Mail
4064 @vindex mail-mode-hook
4065 @vindex mh-letter-mode-hook
4066 @vindex text-mode-hook
4068 Two hooks are provided to run commands on your freshly created draft.
4069 The first hook, @code{mh-letter-mode-hook}, allows you to do some
4070 processing before editing a letter@footnote{Actually, because
4071 MH-Letter mode inherits from Mail mode, the hooks
4072 @code{text-mode-hook} and @code{mail-mode-hook} are run (in that
4073 order) before @code{mh-letter-mode-hook}.}. For example, you may wish
4074 to modify the header after @command{repl} has done its work, or you
4075 may have a complicated @file{components} file and need to tell MH-E
4076 where the cursor should go. Here's an example of how you would use
4077 this hook.
4079 @findex mh-insert-signature, example
4081 @smalllisp
4082 @group
4083 (defvar letter-mode-init-done-flag nil
4084   "Non-nil means one-time MH-E settings have been made.")
4086 (defun my-mh-letter-mode-hook ()
4087   "Prepare letter for editing."
4088   (when (not letter-mode-init-done)     ; @r{only need to bind the keys once}
4089     (local-set-key "\C-ctb" 'add-enriched-text)
4090     (local-set-key "\C-cti" 'add-enriched-text)
4091     (local-set-key "\C-ctf" 'add-enriched-text)
4092     (local-set-key "\C-cts" 'add-enriched-text)
4093     (local-set-key "\C-ctB" 'add-enriched-text)
4094     (local-set-key "\C-ctu" 'add-enriched-text)
4095     (local-set-key "\C-ctc" 'add-enriched-text)
4096     (setq letter-mode-init-done t))
4097   (save-excursion
4098     (goto-char (point-max))             ; @r{go to end of message to}
4099     (mh-insert-signature)))             ;   @r{insert signature}
4101 @i{Prepare draft for editing via mh-letter-mode-hook}
4103 @end group
4104 @end smalllisp
4106 The function, @code{add-enriched-text} is defined in the example in
4107 @ref{Adding Attachments}.
4109 @vindex mh-compose-letter-function
4110 @vindex mh-letter-mode-hook
4112 The second hook, a function really, is
4113 @code{mh-compose-letter-function}. Like @code{mh-letter-mode-hook}, it
4114 is called just before editing a new message; however, it is the last
4115 function called before you edit your message. The consequence of this
4116 is that you can write a function to write and send the message for
4117 you. This function is passed three arguments: the contents of the
4118 @samp{To:}, @samp{Subject:}, and @samp{Cc:} header fields.
4120 @node Replying, Forwarding, Composing, Sending Mail
4121 @section Replying to Mail
4123 @cindex @command{mhl}
4124 @cindex @file{mhl.reply}
4125 @cindex MH commands, @command{mhl}
4126 @cindex files, @file{mhl.reply}
4127 @cindex replying
4128 @findex mh-reply
4129 @kindex r
4131 To compose a reply to a message, use the @kbd{r} (@code{mh-reply})
4132 command.
4134 When you reply to a message, you are first prompted with @samp{Reply
4135 to whom?}. You have several choices here.
4137 @quotation
4138 @multitable @columnfractions .20 .80
4139 @c @headitem Response @tab Reply Goes To
4140 @c XXX @headitem not yet supported by SourceForge's texi2pdf.
4141 @item @b{Response} @tab @b{Reply Goes To}
4142 @c -------------------------
4143 @item @kbd{from}
4144 @tab
4145 The person who sent the message. This is the default, so @key{RET} is
4146 sufficient.
4147 @c -------------------------
4148 @item @kbd{to}
4149 @tab
4150 Replies to the sender, plus all recipients in the @samp{To:} header field.
4151 @c -------------------------
4152 @item @kbd{cc}@*@kbd{all}
4153 @tab
4154 Forms a reply to the addresses in the @samp{Mail-Followup-To:} header
4155 field if one exists; otherwise forms a reply to the sender, plus all
4156 recipients.
4157 @end multitable
4158 @end quotation
4160 @cindex @command{repl}
4161 @cindex MH commands, @command{repl}
4162 @vindex mh-reply-default-reply-to
4164 Depending on your answer, @command{repl}@footnote{See the section
4165 @uref{@value{MH-BOOK-HOME}/reprep.html, Replying to Messages: repl} in
4166 the MH book.} is given a different argument to form your reply.
4167 Specifically, a choice of @kbd{from} or none at all runs @samp{repl
4168 -nocc all}, and a choice of @kbd{to} runs @samp{repl -cc to}. Finally,
4169 either @kbd{cc} or @kbd{all} runs @samp{repl -cc all -nocc me}. If you
4170 find that most of the time you specify one of these choices when you
4171 reply to a message, you can change the option
4172 @code{mh-reply-default-reply-to} from its default value of
4173 @samp{Prompt} to one of the choices listed above. You can always edit
4174 the recipients in the draft.
4176 @cindex @samp{repl:} MH profile component
4177 @cindex MH profile component, @samp{repl:}
4178 @cindex MH-Letter mode
4179 @cindex MH-Show mode
4180 @cindex draft
4181 @cindex modes, MH-Letter
4182 @cindex modes, MH-Show
4184 Two windows are then created. One window contains the message to which
4185 you are replying in an MH-Show buffer. Your draft, in MH-Letter mode
4186 (@pxref{Editing Drafts}), is in the other window. If the reply draft
4187 was not one that you expected, check the things that affect the
4188 behavior of @command{repl} which include the @samp{repl:} profile
4189 component and the @file{replcomps} and @file{replgroupcomps} files.
4191 If you supply a prefix argument (as in @kbd{C-u r}), the message you
4192 are replying to is inserted in your reply after having first been run
4193 through @command{mhl} with the format file @file{mhl.reply}. See
4194 @command{mhl}(1) or the section
4195 @uref{@value{MH-BOOK-HOME}/shomes.html#Usisho, Using mhl} in the MH
4196 book to see how you can modify the default @file{mhl.reply} file.
4198 @vindex mh-yank-behavior
4200 Alternatively, you can customize the option @code{mh-yank-behavior}
4201 and choose one of its @samp{Automatically} variants to do the same
4202 thing. @xref{Inserting Letter}. If you do so, the prefix argument has
4203 no effect.
4205 Another way to include the message automatically in your draft is to
4206 use @samp{repl: -filter repl.filter} in your MH profile.
4208 @vindex mh-reply-show-message-flag
4210 If you include the message automatically, you can hide the MH-Show
4211 buffer by turning off the option @code{mh-reply-show-message-flag}.
4213 If you wish to customize the header or other parts of the reply draft,
4214 please see @command{repl}(1) and @code{mh-format}(5).
4216 @node Forwarding, Redistributing, Replying, Sending Mail
4217 @section Forwarding Mail
4219 @cindex @command{forw}
4220 @cindex draft
4221 @cindex forwarding
4222 @cindex MH commands, @command{forw}
4223 @findex mh-forward
4224 @kindex f
4225 @vindex mh-forward-hook
4227 To forward a message, use the @kbd{f} (@code{mh-forward}) command. You
4228 are prompted for the @samp{To:} and @samp{cc:} recipients. You are
4229 given a draft to edit that looks like it would if you had run the MH
4230 command @command{forw}@footnote{See the section
4231 @uref{@value{MH-BOOK-HOME}/forfor.html, Forwarding Messages: forw} in
4232 the MH book.}. You can then add some text (@pxref{Editing Drafts}).
4233 You can forward several messages by using a range (@pxref{Ranges}).
4234 All of the messages in the range are inserted into your draft. The
4235 hook @code{mh-forward-hook} is called on the draft.
4237 @cindex @file{.mh_profile}
4238 @cindex files, @file{.mh_profile}
4239 @cindex MH profile component, @samp{forw:}
4240 @cindex @samp{forw:} MH profile component
4241 @vindex mh-compose-forward-as-mime-flag
4243 By default, the option @code{mh-compose-forward-as-mime-flag} is on
4244 which means that the forwarded messages are included as attachments.
4245 These are inline attachments so the forwarded message should appear in
4246 the body of your recipient's mail program. If you would prefer to
4247 forward your messages verbatim (as text, inline), then turn off this
4248 option. Forwarding messages verbatim works well for short, textual
4249 messages, but your recipient won't be able to view any non-textual
4250 attachments that were in the forwarded message. Be aware that if you
4251 have @samp{forw: -mime} in your MH profile, then forwarded messages
4252 will always be included as attachments regardless of the settings of
4253 @code{mh-compose-forward-as-mime-flag}.
4255 @vindex mh-forward-subject-format
4257 The format of the @samp{Subject:} header field for forwarded messages
4258 is controlled by the option @code{mh-forward-subject-format}. This
4259 option is a string which includes two escapes (@samp{%s}). The first
4260 @samp{%s} is replaced with the sender of the original message, and the
4261 second one is replaced with the original @samp{Subject:}. The default
4262 value of @code{"%s: %s"} takes a message with the header:
4264 @smallexample
4265 @group
4266 To: Bill Wohler <wohler@@stop.mail-abuse.org>
4267 Subject: Re: 49er football
4268 From: Greg DesBrisay <gd@@stop.mail-abuse.org>
4269 @end group
4270 @end smallexample
4272 and creates a subject header field of:
4274 @smallexample
4275 Subject: Greg DesBrisay: Re: 49er football
4276 @end smallexample
4278 @node Redistributing, Editing Again, Forwarding, Sending Mail
4279 @section Redistributing Your Mail
4281 @cindex @command{dist}
4282 @cindex MH commands, @command{dist}
4283 @cindex redistributing
4284 @findex mh-redistribute
4285 @kindex M-d
4287 The command @kbd{M-d} (@code{mh-redistribute}) is similar in function
4288 to forwarding mail, but it does not allow you to edit the message, nor
4289 does it add your name to the @samp{From:} header field. It appears to
4290 the recipient as if the message had come from the original sender.
4291 When you run this command, you are prompted for the recipients.
4293 @findex mh-edit-again
4294 @kindex e
4296 For more information on redistributing messages, see
4297 @command{dist}(1). Also investigate the command @kbd{e}
4298 (@code{mh-edit-again}) for another way to redistribute messages
4299 (@pxref{Editing Again}).
4301 @cindex @command{send}
4302 @cindex MH commands, @command{send}
4303 @vindex mh-redist-full-contents-flag
4305 The option @code{mh-redist-full-contents-flag} must be turned on if
4306 @command{dist}@footnote{See the section
4307 @uref{@value{MH-BOOK-HOME}/disdis.html, Distributing Messages with
4308 dist} in the MH book.} requires the whole letter for redistribution,
4309 which is the case if @command{send}@footnote{See the section
4310 @uref{@value{MH-BOOK-HOME}/sensen.html, Sending Some Mail: comp send}
4311 in the MH book.} is compiled with the @sc{berk} option (which many
4312 people abhor). If you find that MH will not allow you to redistribute
4313 a message that has been redistributed before, turn off this option.
4315 The hook @code{mh-annotate-msg-hook} is run after annotating the
4316 message and scan line (@pxref{Sending Mail}).
4318 @node Editing Again,  , Redistributing, Sending Mail
4319 @section Editing Old Drafts and Bounced Messages
4321 @cindex @file{draft}
4322 @cindex files, @file{draft}
4323 @cindex re-editing drafts
4324 @findex mh-edit-again
4325 @kindex F v drafts
4326 @kindex e
4327 @kindex n
4329 If you don't complete a draft for one reason or another, and if the
4330 draft buffer is no longer available, you can pick your draft up again
4331 with @kbd{e} (@code{mh-edit-again}). If you don't use a draft
4332 folder, your last @file{draft} file will be used. If you use draft
4333 folders, you'll need to visit the draft folder with @kbd{F v drafts
4334 @key{RET}}, use @kbd{n} to move to the appropriate message, and then
4335 use @kbd{e} to prepare the message for editing.
4337 @kindex e
4339 The @kbd{e} command can also be used to take messages that were sent
4340 to you and to send them to more people.
4342 @cindex Mailer-Daemon
4343 @findex mh-extract-rejected-mail
4344 @kindex C-c C-c
4345 @kindex E
4347 Don't use @kbd{e} to re-edit a message from a @i{Mailer-Daemon} who
4348 complained that your mail wasn't posted for some reason or another. In
4349 this case, use @kbd{E} (@code{mh-extract-rejected-mail}) to prepare
4350 the message for editing by removing the @i{Mailer-Daemon} envelope and
4351 unneeded header fields. Fix whatever addressing problem you had, and
4352 send the message again with @kbd{C-c C-c}.
4354 @node Editing Drafts, Aliases, Sending Mail, Top
4355 @chapter Editing a Draft
4357 @cindex @samp{Letter} menu
4358 @cindex MH-Letter mode
4359 @cindex draft
4360 @cindex editing draft
4361 @cindex menu, @samp{Letter}
4362 @cindex modes, MH-Letter
4364 When you edit a message that you want to send (called a @dfn{draft} in
4365 this case), the mode used is MH-Letter. This mode provides several
4366 commands in addition to the normal Emacs editing commands to help you
4367 edit your draft. These can also be found in the @samp{Letter} menu.
4369 @table @kbd
4370 @kindex @key{SPC}
4371 @findex mh-letter-complete-or-space
4372 @item @key{SPC}
4373 Perform completion or insert space (@code{mh-letter-complete-or-space}).
4374 @c -------------------------
4375 @kindex M-@key{TAB}
4376 @findex mh-letter-complete
4377 @item M-@key{TAB}
4378 Perform completion on header field or word preceding point
4379 (@code{mh-letter-complete}).
4380 @c -------------------------
4381 @kindex , (comma)
4382 @findex mh-letter-confirm-address
4383 @item , (comma)
4384 Flash alias expansion (@code{mh-letter-confirm-address}).
4385 @c -------------------------
4386 @kindex @key{TAB}
4387 @findex mh-letter-next-header-field-or-indent
4388 @item @key{TAB}
4389 Cycle to next field (@code{mh-letter-next-header-field-or-indent}).
4390 @c -------------------------
4391 @kindex S-@key{TAB}
4392 @findex mh-letter-previous-header-field
4393 @item S-@key{TAB}
4394 Cycle to the previous header field
4395 (@code{mh-letter-previous-header-field}).
4396 @c -------------------------
4397 @kindex C-c ?
4398 @findex mh-help
4399 @item C-c ?
4400 Display cheat sheet for the MH-E commands (@code{mh-help}).
4401 @c -------------------------
4402 @cindex @samp{Letter > Send This Draft} menu item
4403 @cindex menu item, @samp{Letter > Send This Draft}
4404 @kindex C-c C-c
4405 @findex mh-send-letter
4406 @item C-c C-c
4407 Save draft and send message (@code{mh-send-letter}).
4408 @c -------------------------
4409 @kindex C-c C-d
4410 @findex mh-insert-identity
4411 @item C-c C-d
4412 Insert fields specified by the given identity
4413 (@code{mh-insert-identity}). @xref{Identities}.
4414 @c -------------------------
4415 @cindex @samp{Letter > Pull in All Compositions (MH)} menu item
4416 @cindex menu item, @samp{Letter > Pull in All Compositions (MH)}
4417 @kindex C-c C-e
4418 @findex mh-mh-to-mime
4419 @item C-c C-e
4420 Compose @sc{mime} message from MH-style directives
4421 (@code{mh-mh-to-mime}).
4422 @c -------------------------
4423 @kindex C-c C-f C-a
4424 @kindex C-c C-f a
4425 @findex mh-to-field
4426 @item C-c C-f C-a
4427 @itemx C-c C-f a
4428 Move to @samp{Mail-Reply-To:} header field (@code{mh-to-field}).
4429 @c -------------------------
4430 @kindex C-c C-f C-b
4431 @kindex C-c C-f b
4432 @item C-c C-f C-b
4433 @itemx C-c C-f b
4434 Move to @samp{Bcc:} header field (@code{mh-to-field}).
4435 @c -------------------------
4436 @kindex C-c C-f C-c
4437 @kindex C-c C-f c
4438 @item C-c C-f C-c
4439 @itemx C-c C-f c
4440 Move to @samp{Cc:} header field (@code{mh-to-field}).
4441 @c -------------------------
4442 @kindex C-c C-f C-d
4443 @kindex C-c C-f d
4444 @item C-c C-f C-d
4445 @itemx C-c C-f d
4446 Move to @samp{Dcc:} header field (@code{mh-to-field}).
4447 @c -------------------------
4448 @kindex C-c C-f C-f
4449 @kindex C-c C-f f
4450 @findex mh-to-fcc
4451 @item C-c C-f C-f
4452 @itemx C-c C-f f
4453 Move to @samp{Fcc:} header field (@code{mh-to-fcc}).
4454 @c -------------------------
4455 @kindex C-c C-f C-l
4456 @kindex C-c C-f l
4457 @item C-c C-f C-l
4458 @itemx C-c C-f l
4459 Move to @samp{Mail-Followup-To:} header field (@code{mh-to-field}).
4460 @c -------------------------
4461 @kindex C-c C-f C-m
4462 @kindex C-c C-f m
4463 @item C-c C-f C-m
4464 @itemx C-c C-f m
4465 Move to @samp{From:} header field (@code{mh-to-field}).
4466 @c -------------------------
4467 @kindex C-c C-f C-r
4468 @kindex C-c C-f r
4469 @item C-c C-f C-r
4470 @itemx C-c C-f r
4471 Move to @samp{Reply-To:} header field (@code{mh-to-field}).
4472 @c -------------------------
4473 @kindex C-c C-f C-s
4474 @kindex C-c C-f s
4475 @item C-c C-f C-s
4476 @itemx C-c C-f s
4477 Move to @samp{Subject:} header field (@code{mh-to-field}).
4478 @c -------------------------
4479 @kindex C-c C-f C-t
4480 @kindex C-c C-f t
4481 @item C-c C-f C-t
4482 @itemx C-c C-f t
4483 Move to @samp{To:} header field (@code{mh-to-field}).
4484 @c -------------------------
4485 @cindex @samp{Letter > Insert a Message...} menu item
4486 @cindex menu item, @samp{Letter > Insert a Message...}
4487 @kindex C-c C-i
4488 @findex mh-insert-letter
4489 @item C-c C-i
4490 Insert a message (@code{mh-insert-letter}).
4491 @c -------------------------
4492 @kindex C-c C-m C-e
4493 @findex mh-mml-secure-message-encrypt
4494 @item C-c C-m C-e
4495 Add tag to encrypt the message (@code{mh-mml-secure-message-encrypt}).
4496 @c -------------------------
4497 @cindex @samp{Letter > Compose Forward...} menu item
4498 @cindex menu item, @samp{Letter > Compose Forward...}
4499 @kindex C-c C-m C-f
4500 @kindex C-c C-m f
4501 @findex mh-compose-forward
4502 @item C-c C-m C-f
4503 @itemx C-c C-m f
4504 Add tag to forward a message (@code{mh-compose-forward}).
4505 @c -------------------------
4506 @cindex @samp{Letter > Compose Get File (MH)...} menu item
4507 @cindex menu item, @samp{Letter > Compose Get File (MH)...}
4508 @kindex C-c C-m C-g
4509 @kindex C-c C-m g
4510 @findex mh-mh-compose-anon-ftp
4511 @item C-c C-m C-g
4512 @itemx C-c C-m g
4513 Add tag to include anonymous ftp reference to a file
4514 (@code{mh-mh-compose-anon-ftp}).
4515 @c -------------------------
4516 @cindex @samp{Letter > Compose Insertion...} menu item
4517 @cindex menu item, @samp{Letter > Compose Insertion...}
4518 @kindex C-c C-m C-i
4519 @kindex C-c C-m i
4520 @findex mh-compose-insertion
4521 @item C-c C-m C-i
4522 @itemx C-c C-m i
4523 Add tag to include a file such as an image or sound
4524 (@code{mh-compose-insertion}).
4525 @c -------------------------
4526 @cindex @samp{Letter > Pull in All Compositions (MML)} menu item
4527 @cindex menu item, @samp{Letter > Pull in All Compositions (MML)}
4528 @kindex C-c C-m C-m
4529 @kindex C-c C-m m
4530 @findex mh-mml-to-mime
4531 @item C-c C-m C-m
4532 @itemx C-c C-m m
4533 Compose @sc{mime} message from MML tags (@code{mh-mml-to-mime}).
4534 @c -------------------------
4535 @kindex C-c C-m C-n
4536 @kindex C-c C-m n
4537 @findex mh-mml-unsecure-message
4538 @item C-c C-m C-n
4539 @itemx C-c C-m n
4540 Remove any secure message tags (@code{mh-mml-unsecure-message}).
4541 @c -------------------------
4542 @kindex C-c C-m C-s
4543 @findex mh-mml-secure-message-sign
4544 @item C-c C-m C-s
4545 Add tag to sign the message (@code{mh-mml-secure-message-sign}).
4546 @c -------------------------
4547 @cindex @samp{Letter > Compose Compressed tar (MH)...} menu item
4548 @cindex menu item, @samp{Letter > Compose Compressed tar (MH)...}
4549 @kindex C-c C-m C-t
4550 @kindex C-c C-m t
4551 @findex mh-mh-compose-external-compressed-tar
4552 @item C-c C-m C-t
4553 @itemx C-c C-m t
4554 Add tag to include anonymous ftp reference to a compressed tar file
4555 (@code{mh-mh-compose-external-compressed-tar}).
4556 @c -------------------------
4557 @cindex @samp{Letter > Revert to Non-MIME Edit (MH)} menu item
4558 @cindex menu item, @samp{Letter > Revert to Non-MIME Edit (MH)}
4559 @kindex C-c C-m C-u
4560 @kindex C-c C-m u
4561 @findex mh-mh-to-mime-undo
4562 @item C-c C-m C-u
4563 @itemx C-c C-m u
4564 Undo effects of @kbd{C-c C-e} (@code{mh-mh-to-mime-undo}).
4565 @c -------------------------
4566 @kindex C-c C-m C-x
4567 @kindex C-c C-m x
4568 @findex mh-mh-compose-external-type
4569 @item C-c C-m C-x
4570 @itemx C-c C-m x
4571 Add tag to refer to a remote file
4572 (@code{mh-mh-compose-external-type}).
4573 @c -------------------------
4574 @kindex C-c C-m e e
4575 @findex mh-mml-secure-message-encrypt
4576 @item C-c C-m e e
4577 Add tag to encrypt the message (@code{mh-mml-secure-message-encrypt}).
4578 @c -------------------------
4579 @kindex C-c C-m e s
4580 @findex mh-mml-secure-message-signencrypt
4581 @item C-c C-m e s
4582 Add tag to encrypt and sign the message@*
4583 (@code{mh-mml-secure-message-signencrypt}).
4584 @c -------------------------
4585 @kindex C-c C-m s e
4586 @findex mh-mml-secure-message-signencrypt
4587 @item C-c C-m s e
4588 Add tag to encrypt and sign the message@*
4589 (@code{mh-mml-secure-message-signencrypt}).
4590 @c -------------------------
4591 @kindex C-c C-m s s
4592 @findex mh-mml-secure-message-sign
4593 @item C-c C-m s s
4594 Add tag to sign the message (@code{mh-mml-secure-message-sign}).
4595 @c -------------------------
4596 @cindex @samp{Letter > Split Current Line} menu item
4597 @cindex menu item, @samp{Letter > Split Current Line}
4598 @kindex C-c C-o
4599 @findex mh-open-line
4600 @item C-c C-o
4601 Insert a newline and leave point before it (@code{mh-open-line}).
4602 @c -------------------------
4603 @cindex @samp{Letter > Kill This Draft} menu item
4604 @cindex menu item, @samp{Letter > Kill This Draft}
4605 @kindex C-c C-q
4606 @findex mh-fully-kill-draft
4607 @item C-c C-q
4608 Quit editing and delete draft message (@code{mh-fully-kill-draft}).
4609 @c -------------------------
4610 @cindex @samp{Letter > Insert Signature} menu item
4611 @cindex menu item, @samp{Letter > Insert Signature}
4612 @kindex C-c C-s
4613 @findex mh-insert-signature
4614 @item C-c C-s
4615 Insert signature in message (@code{mh-insert-signature}).
4616 @c -------------------------
4617 @kindex C-c C-t
4618 @findex mh-letter-toggle-header-field-display
4619 @item C-c C-t
4620 Toggle display of header field at point
4621 (@code{mh-letter-toggle-header-field-display}).
4622 @c -------------------------
4623 @cindex @samp{Letter > Check Recipient} menu item
4624 @cindex menu item, @samp{Letter > Check Recipient}
4625 @kindex C-c C-w
4626 @findex mh-check-whom
4627 @item C-c C-w
4628 Verify recipients, showing expansion of any aliases
4629 (@code{mh-check-whom}).
4630 @c -------------------------
4631 @cindex @samp{Letter > Yank Current Message} menu item
4632 @cindex menu item, @samp{Letter > Yank Current Message}
4633 @kindex C-c C-y
4634 @findex mh-yank-cur-msg
4635 @item C-c C-y
4636 Insert the current message into the draft buffer
4637 (@code{mh-yank-cur-msg}).
4638 @c -------------------------
4639 @kindex C-c M-d
4640 @findex mh-insert-auto-fields
4641 @item C-c M-d
4642 Insert custom fields if recipient is found in
4643 @code{mh-auto-fields-list} (@code{mh-insert-auto-fields}).
4644 @xref{Identities}.
4645 @end table
4647 @cindex @samp{mh-letter} customization group
4648 @cindex customization group, @samp{mh-letter}
4650 Several options from the @samp{mh-letter} customization group are used
4651 while editing a draft.
4653 @vtable @code
4654 @item mh-compose-insertion
4655 Type of @sc{mime} message tags in messages (default: @samp{MML} if
4656 available; otherwise @samp{MH}).
4657 @c -------------------------
4658 @item mh-compose-skipped-header-fields
4659 List of header fields to skip over when navigating in draft (default:
4660 @code{'("From"} @code{"Organization"} @code{"References"}
4661 @code{"In-Reply-To"} @code{"X-Face"} @code{"Face"}
4662 @code{"X-Image-URL"} @code{"X-Mailer")}.
4663 @c -------------------------
4664 @item mh-compose-space-does-completion-flag
4665 On means @key{SPC} does completion in message header (default:
4666 @samp{off}).
4667 @c -------------------------
4668 @item mh-delete-yanked-msg-window-flag
4669 On means delete any window displaying the message (default: @samp{off}).
4670 @c -------------------------
4671 @item mh-extract-from-attribution-verb
4672 Verb to use for attribution when a message is yanked by @kbd{C-c C-y}
4673 (default: @code{"wrote:"}).
4674 @c -------------------------
4675 @item mh-ins-buf-prefix
4676 String to put before each line of a yanked or inserted message
4677 (default: @code{"> "}).
4678 @c -------------------------
4679 @item mh-letter-complete-function
4680 Function to call when completing outside of address or folder fields
4681 (default: @code{ispell-complete-word}).
4682 @c -------------------------
4683 @item mh-letter-fill-column
4684 Fill column to use in MH-Letter mode (default: 72).
4685 @c -------------------------
4686 @item mh-mml-method-default
4687 Default method to use in security tags (default: @samp{PGP (MIME)} if
4688 support for it is available; otherwise @samp{None}).
4689 @c -------------------------
4690 @item mh-signature-file-name
4691 Source of user's signature (default: @code{"~/.signature"}).
4692 @c -------------------------
4693 @item mh-signature-separator-flag
4694 On means a signature separator should be inserted (default:
4695 @samp{on}).
4696 @c -------------------------
4697 @item mh-x-face-file
4698 File containing X-Face or Face header field to insert in outgoing mail.
4699 (default: @code{"~/.face"}).
4700 @c -------------------------
4701 @item mh-yank-behavior
4702 Controls which part of a message is yanked by @kbd{C-c C-y} (default:
4703 @samp{Body With Attribution}).
4704 @end vtable
4706 The following hooks are available.
4708 @vtable @code
4709 @item mail-citation-hook
4710 Hook for modifying a citation just inserted in the mail buffer
4711 (default: @code{nil}).
4712 @c -------------------------
4713 @item mh-before-send-letter-hook
4714 Hook run at the beginning of the @kbd{C-c C-c} command (default:
4715 @samp{nil}).
4716 @c -------------------------
4717 @item mh-mh-to-mime-hook
4718 Hook run on the formatted letter by @kbd{C-c C-e} (default:
4719 @samp{nil}).
4720 @c -------------------------
4721 @item mh-insert-signature-hook
4722 Hook run by @kbd{C-c C-s} after signature has been inserted (default:
4723 @code{nil}).
4724 @end vtable
4726 The following face is available.
4728 @vtable @code
4729 @item mh-letter-header-field
4730 Editable header field value face in draft buffers.
4731 @end vtable
4733 The commands and options introduced here are explained in more
4734 detail in the following sections.
4736 @menu
4737 * Editing Message::
4738 * Inserting Letter::
4739 * Inserting Messages::
4740 * Signature::
4741 * Picture::
4742 * Adding Attachments::
4743 * Sending PGP::
4744 * Checking Recipients::
4745 * Sending Message::
4746 * Killing Draft::
4747 @end menu
4749 @node Editing Message, Inserting Letter, Editing Drafts, Editing Drafts
4750 @section Editing the Message
4752 @cindex @samp{Bcc:} header field
4753 @cindex @samp{Cc:} header field
4754 @cindex @samp{Dcc:} header field
4755 @cindex @samp{From:} header field
4756 @cindex @samp{Mail-Followup-To:} header field
4757 @cindex @samp{Mail-Reply-To:} header field
4758 @cindex @samp{Reply-To:} header field
4759 @cindex @samp{Subject:} header field
4760 @cindex @samp{To:} header field
4761 @cindex editing header
4762 @cindex header field, @samp{Bcc:}
4763 @cindex header field, @samp{Cc:}
4764 @cindex header field, @samp{Dcc:}
4765 @cindex header field, @samp{From:}
4766 @cindex header field, @samp{Mail-Followup-To:}
4767 @cindex header field, @samp{Mail-Reply-To:}
4768 @cindex header field, @samp{Reply-To:}
4769 @cindex header field, @samp{Subject:}
4770 @cindex header field, @samp{To:}
4771 @findex mh-to-field
4772 @kindex C-c C-f C-t
4773 @kindex C-c C-f t
4775 Because the header is part of the message, you can edit the header
4776 fields as you wish. However, several convenience commands exist to
4777 help you create and edit them. For example, the command @kbd{C-c C-f
4778 C-t} (@code{mh-to-field}; alternatively, @kbd{C-c C-f t}) moves the
4779 cursor to the @samp{To:} header field, creating it if necessary. The
4780 commands for moving to the @samp{Cc:}, @samp{Subject:}, @samp{From:},
4781 @samp{Reply-To:}, @samp{Mail-Reply-To:}, @samp{Mail-Followup-To},
4782 @samp{Bcc:}, and @samp{Dcc:} header fields are similar.
4784 @findex mh-to-fcc
4785 @kindex C-c C-f C-f
4786 @kindex C-c C-f f
4788 One command behaves differently from the others, namely, @kbd{C-c C-f
4789 C-f} (@code{mh-to-fcc}; alternatively, @kbd{C-c C-f f}). This command
4790 will prompt you for the folder name in which to file a copy of the
4791 draft. @xref{Folder Selection}.
4793 @findex indent-relative
4794 @findex mh-letter-next-header-field-or-indent
4795 @findex mh-letter-previous-header-field
4796 @kindex @key{TAB}
4797 @kindex S-@key{TAB}
4798 @vindex mh-compose-skipped-header-fields
4799 @vindex mh-letter-header-field
4801 Within the header of the message, the command@* @key{TAB}
4802 (@code{mh-letter-next-header-field-or-indent}) moves between fields
4803 that are highlighted with the face @code{mh-letter-header-field},
4804 skipping those fields listed in
4805 @code{mh-compose-skipped-header-fields}. After the last field, this
4806 command then moves point to the message body before cycling back to
4807 the first field. If point is already past the first line of the
4808 message body, then this command indents by calling
4809 @code{indent-relative} with the given prefix argument. The command
4810 @kbd{S-@key{TAB}} (@code{mh-letter-previous-header-field}) moves
4811 backwards between the fields and cycles to the body of the message
4812 after the first field. Unlike the command @key{TAB}, it will always
4813 take point to the last field from anywhere in the body.
4815 @cindex alias completion
4816 @cindex completion
4817 @cindex spell check
4818 @findex ispell-complete-word
4819 @findex mh-letter-complete
4820 @findex mh-letter-complete-or-space
4821 @findex mh-letter-confirm-address
4822 @kindex , (comma)
4823 @kindex @key{SPC}
4824 @kindex M-@key{TAB}
4825 @vindex mh-alias-flash-on-comma
4826 @vindex mh-compose-space-does-completion-flag
4827 @vindex mh-letter-complete-function
4829 If the field contains addresses (for example, @samp{To:} or
4830 @samp{Cc:}) or folders (for example, @samp{Fcc:}) then the command
4831 @kbd{M-@key{TAB}} (@code{mh-letter-complete}) will provide alias
4832 completion (@pxref{Aliases}). In the body of the message,
4833 @kbd{M-@key{TAB}} runs @code{mh-letter-complete-function} instead,
4834 which is set to @samp{'ispell-complete-word} by default. The command
4835 @kbd{M-@key{TAB}} (@code{mh-letter-complete}) takes a prefix argument
4836 that is passed to the @code{mh-letter-complete-function}. In addition,
4837 turn on the option @code{mh-compose-space-does-completion-flag} to use
4838 the command @key{SPC} (@code{mh-letter-complete-or-space}) to perform
4839 completion in the header as well; use a prefix argument to specify
4840 more than one space. Addresses are separated by a comma; when you
4841 press the comma, the command @code{mh-letter-confirm-address} flashes
4842 the alias expansion in the minibuffer if
4843 @code{mh-alias-flash-on-comma} is turned on.
4845 @c XXX Document the replacement for the inaccessible 'long argument.
4847 @findex mh-letter-toggle-header-field-display
4848 @kindex C-c C-t
4850 Use the command @kbd{C-c C-t}
4851 @code{mh-letter-toggle-header-field-display} to display truncated
4852 header fields. This command is a toggle so entering it again will hide
4853 the field. This command takes a prefix argument: if negative then the
4854 field is hidden, if positive then the field is displayed (for example,
4855 @kbd{C-u C-c C-t}).
4857 Be sure to leave a row of dashes or a blank line between the header
4858 and the body of the message.
4860 @vindex mh-letter-fill-column
4862 The body of the message is edited as you would edit any Emacs buffer
4863 although there are a few commands and options to assist you. You can
4864 change the fill column in MH-Letter mode with the option
4865 @code{mh-letter-fill-column}. By default, this option is 72 to allow
4866 others to quote your message without line wrapping.
4868 @cindex filling paragraphs
4869 @cindex paragraphs, filling
4870 @findex fill-paragraph
4871 @kindex M-q
4872 @vindex mh-ins-buf-prefix
4874 You'll often include messages that were sent from user agents that
4875 haven't yet realized that paragraphs consist of more than a single
4876 line. This makes for long lines that wrap in an ugly fashion. You'll
4877 find that @kbd{M-q} (@code{fill-paragraph}) works well even on these
4878 quoted messages, even if they are nested, just as long as all of the
4879 quotes match the value of @code{mh-ins-buf-prefix} (@pxref{Inserting
4880 Letter}). For example, let's assume you have the following in your
4881 draft:
4883 @smallexample
4884 @group
4885 > Hopefully this gives you an idea of what I'm currently doing. I'm \
4886 not sure yet whether I'm completely satisfied with my setup, but    \
4887 it's worked okay for me so far.
4888 @end group
4889 @end smallexample
4891 Running @kbd{M-q} on this paragraph produces:
4893 @smallexample
4894 @group
4895 > Hopefully this gives you an idea of what I'm currently doing. I'm not
4896 > sure yet whether I'm completely satisfied with my setup, but it's
4897 > worked okay for me so far.
4898 @end group
4899 @end smallexample
4901 @findex mh-open-line
4902 @findex open-line
4903 @kindex C-c C-o
4904 @kindex C-o
4906 The command @kbd{C-c C-o} (@code{mh-open-line}) is similar to the
4907 command @kbd{C-o} (@code{open-line}) in that it inserts a newline
4908 after point. It differs in that it also inserts the right number of
4909 quoting characters and spaces so that the next line begins in the same
4910 column as it was. This is useful when breaking up paragraphs in
4911 replies. For example, if this command was used when point was after
4912 the first period in the paragraph above, the result would be this:
4914 @smallexample
4915 @group
4916 > Hopefully this gives you an idea of what I'm currently doing.
4918 >                                                               I'm not
4919 > sure yet whether I'm completely satisfied with my setup, but it's
4920 > worked okay for me so far.
4921 @end group
4922 @end smallexample
4924 @node Inserting Letter, Inserting Messages, Editing Message, Editing Drafts
4925 @section Inserting Letter to Which You're Replying
4927 @cindex inserting messages
4928 @cindex replying to messages
4929 @cindex yanking messages
4930 @findex mh-yank-cur-msg
4931 @kindex C-c C-y
4932 @vindex mh-ins-buf-prefix
4934 It is often useful to insert a snippet of text from a letter that
4935 someone mailed to provide some context for your reply. The command
4936 @kbd{C-c C-y} (@code{mh-yank-cur-msg}) does this by adding an
4937 attribution, yanking a portion of text from the message to which
4938 you're replying, and inserting @code{mh-ins-buf-prefix} (@samp{> })
4939 before each line.
4941 @smallexample
4942 @group
4943 Michael W Thelen <thelenm@@stop.mail-abuse.org> wrote:
4945 > Hopefully this gives you an idea of what I'm currently doing. I'm not
4946 > sure yet whether I'm completely satisfied with my setup, but it's
4947 > worked okay for me so far.
4948 @end group
4949 @end smallexample
4951 @vindex mh-extract-from-attribution-verb
4953 The attribution consists of the sender's name and email address
4954 followed by the content of the option
4955 @code{mh-extract-from-attribution-verb}. This option can be set to
4956 @samp{wrote:}, @samp{a Ã©crit:}, and @samp{schrieb:}. You can also use
4957 the @samp{Custom String} menu item to enter your own verb.
4959 @vindex mail-citation-hook
4960 @vindex mh-ins-buf-prefix
4961 @vindex mh-yank-behavior
4963 The prefix @code{"> "} is the default setting for the option
4964 @code{mh-ins-buf-prefix}. I suggest that you not modify this option
4965 since it is used by many mailers and news readers: messages are far
4966 easier to read if several included messages have all been indented by
4967 the same string. This prefix is not inserted if you use one of the
4968 supercite flavors of @code{mh-yank-behavior} or you have added a
4969 @code{mail-citation-hook} as described below.
4971 @vindex mh-delete-yanked-msg-window-flag
4973 You can also turn on the @code{mh-delete-yanked-msg-window-flag}
4974 option to delete the window containing the original message after
4975 yanking it to make more room on your screen for your reply.
4977 @cindex Emacs, packages, supercite
4978 @cindex supercite package
4979 @kindex r
4980 @vindex mail-citation-hook
4981 @vindex mh-yank-behavior
4983 You can control how the message to which you are replying is yanked
4984 into your reply using @code{mh-yank-behavior}. To include the entire
4985 message, including the entire header, use @samp{Body and
4986 Header}@footnote{If you'd rather have the header cleaned up, use
4987 @kbd{C-u r} instead of @kbd{r} when replying
4988 (@pxref{Replying}).}@footnote{In the past you would use this setting
4989 and set @code{mail-citation-hook} to @samp{supercite}, but this usage
4990 is now deprecated in favor of the @samp{Invoke supercite} setting.}.
4991 Use @samp{Body} to yank just the body without the header. To yank only
4992 the portion of the message following the point, set this option to
4993 @samp{Below Point}.
4995 Choose @samp{Invoke supercite}@footnote{@emph{Supercite} is a
4996 full-bodied, full-featured, citation package that comes standard with
4997 Emacs.} to pass the entire message and header through supercite.
4999 @vindex mh-extract-from-attribution-verb
5001 If the @samp{Body With Attribution} setting is used, then the message
5002 minus the header is yanked and a simple attribution line is added at
5003 the top using the value of the option
5004 @code{mh-extract-from-attribution-verb}. This is the default.
5006 @kindex C-c C-y
5007 @vindex mh-delete-yanked-msg-window-flag
5009 If the @samp{Invoke supercite} or @samp{Body With Attribution}
5010 settings are used, the @samp{-noformat} argument is passed to the
5011 @command{repl} program to override a @samp{-filter} or @samp{-format}
5012 argument. These settings also have @samp{Automatically} variants that
5013 perform the action automatically when you reply so that you don't need
5014 to use @kbd{C-c C-y} at all. Note that this automatic action is only
5015 performed if the show buffer matches the message being replied to.
5016 People who use the automatic variants tend to turn on the option
5017 @code{mh-delete-yanked-msg-window-flag} as well so that the show
5018 window is never displayed.
5020 @vindex mh-yank-behavior
5022 If the show buffer has a region, the option @code{mh-yank-behavior} is
5023 ignored unless its value is one of @samp{Attribution} variants in
5024 which case the attribution is added to the yanked region.
5026 @findex trivial-cite
5027 @vindex mail-citation-hook
5028 @vindex mh-ins-buf-prefix
5029 @vindex mh-yank-behavior
5031 If this isn't enough, you can gain full control over the appearance of
5032 the included text by setting @code{mail-citation-hook} to a function
5033 that modifies it. This hook is ignored if the option
5034 @code{mh-yank-behavior} is set to one of the supercite flavors.
5035 Otherwise, this option controls how much of the message is passed to
5036 the hook. The function can find the citation between point and mark
5037 and it should leave point and mark around the modified citation text
5038 for the next hook function. The standard prefix
5039 @code{mh-ins-buf-prefix} is not added if this hook is set.
5041 @cindex Emacs, packages, trivial-cite
5042 @cindex trivial-cite package
5043 @vindex mh-yank-behavior
5045 For example, if you use the hook function
5046 @uref{http://www.emacswiki.org/emacs/TrivialCite,
5047 @code{trivial-cite}} (which is NOT part of Emacs), set
5048 @code{mh-yank-behavior} to @samp{Body and Header}.
5050 @node Inserting Messages, Signature, Inserting Letter, Editing Drafts
5051 @section Inserting Messages
5053 @cindex inserting messages
5054 @findex mh-insert-letter
5055 @findex mh-yank-behavior
5056 @kindex C-c C-i
5057 @vindex mh-ins-buf-prefix
5058 @vindex mh-invisible-header-fields-compiled
5059 @vindex mh-yank-behavior
5061 Messages can be inserted with @kbd{C-c C-i} (@code{mh-insert-letter}).
5062 This command prompts you for the folder and message number, which
5063 defaults to the current message in that folder. It then inserts the
5064 messages, indented by @code{mh-ins-buf-prefix} (@samp{> }) unless
5065 @code{mh-yank-behavior} is set to one of the supercite flavors in
5066 which case supercite is used to format the message. Certain
5067 undesirable header fields (see
5068 @code{mh-invisible-header-fields-compiled}) are removed before
5069 insertion.
5071 If given a prefix argument (like @kbd{C-u C-c C-i}), the header is
5072 left intact, the message is not indented, and @samp{> } is not
5073 inserted before each line. This command leaves the mark before the
5074 letter and point after it.
5076 @node Signature, Picture, Inserting Messages, Editing Drafts
5077 @section Inserting Your Signature
5079 @cindex signature
5080 @findex mh-insert-signature
5081 @kindex C-c C-s
5083 You can insert your signature at the current cursor location with the
5084 command @kbd{C-c C-s} (@code{mh-insert-signature}).
5086 @cindex files, @file{.signature}
5087 @cindex @file{.signature}
5088 @cindex vCard
5089 @vindex mh-signature-file-name
5091 By default, the text of your signature is taken from the file
5092 @file{~/.signature}. You can read from other sources by changing the
5093 option @code{mh-signature-file-name}. This file may contain a
5094 @dfn{vCard} in which case an attachment is added with the vCard.
5096 @findex mh-signature-separator-p
5097 @vindex mh-signature-file-name
5098 @vindex mh-signature-separator
5099 @vindex mh-signature-separator-regexp
5101 The option @code{mh-signature-file-name} may also be a symbol, in
5102 which case that function is called. You may not want a signature
5103 separator to be added for you; instead you may want to insert one
5104 yourself. Options that you may find useful to do this include
5105 @code{mh-signature-separator} (when inserting a signature separator)
5106 and @code{mh-signature-separator-regexp} (for finding said separator).
5107 The function @code{mh-signature-separator-p}, which reports @code{t}
5108 if the buffer contains a separator, may be useful as well.
5110 @cindex signature separator
5111 @vindex mh-signature-separator-flag
5113 A signature separator (@code{"-- "}) will be added if the signature
5114 block does not contain one and @code{mh-signature-separator-flag} is
5115 on. It is not recommended that you change this option since various
5116 mail user agents, including MH-E, use the separator to present the
5117 signature differently, and to suppress the signature when replying or
5118 yanking a letter into a draft.
5120 @vindex mh-insert-signature-hook
5121 @vindex mh-signature-file-name
5123 The hook @code{mh-insert-signature-hook} is run after the signature is
5124 inserted. Hook functions may access the actual name of the file or the
5125 function used to insert the signature with
5126 @code{mh-signature-file-name}.
5128 The signature can also be inserted using Identities.
5129 @xref{Identities}.
5131 @node Picture, Adding Attachments, Signature, Editing Drafts
5132 @section Inserting Your Picture
5134 @cindex @file{.face}
5135 @cindex files, @file{.face}
5136 @vindex mh-x-face-file
5138 You can insert your picture in the header of your mail message so that
5139 recipients see your face in the @samp{From:} header field if their
5140 mail user agent is sophisticated enough. In MH-E, this is done by
5141 placing your image in the file named by the option
5142 @code{mh-x-face-file} which is @file{~/.face} by default.
5144 @cindex @samp{Face:} header field
5145 @cindex @samp{X-Face:} header field
5146 @cindex @samp{X-Image-URL:} header field
5147 @cindex header field, @samp{Face:}
5148 @cindex header field, @samp{X-Face:}
5149 @cindex header field, @samp{X-Image-URL:}
5151 If the file starts with either of the strings @samp{X-Face:},
5152 @samp{Face:} or @samp{X-Image-URL:} then the contents are added to the
5153 message header verbatim. Otherwise it is assumed that the file
5154 contains the value of the @samp{X-Face:} header field.
5156 @cindex @command{compface}
5157 @cindex Unix commands, @command{compface}
5159 The @samp{X-Face:} header field, which is a low-resolution, black and
5160 white image, can be generated using the
5161 @uref{ftp://ftp.cs.indiana.edu/pub/faces/compface/compface.tar.Z,
5162 @command{compface}} command. The @uref{http://www.dairiki.org/xface/,
5163 @cite{Online X-Face Converter}} is a useful resource for quick
5164 conversion of images into @samp{X-Face:} header fields.
5166 Use the @uref{http://quimby.gnus.org/circus/face/make-face,
5167 @command{make-face}} script to convert a JPEG image to the higher
5168 resolution, color, @samp{Face:} header field.
5170 The URL of any image can be used for the @samp{X-Image-URL:} field and
5171 no processing of the image is required.
5173 @vindex mh-x-face-file
5175 To prevent the setting of any of these header fields, either set
5176 @code{mh-x-face-file} to @code{nil}, or simply ensure that the file
5177 defined by this option doesn't exist.
5179 @xref{Viewing}, to see how these header fields are displayed in MH-E.
5181 @node Adding Attachments, Sending PGP, Picture, Editing Drafts
5182 @section Adding Attachments
5184 @cindex @command{mhbuild}
5185 @cindex @command{mhn}
5186 @cindex MH commands, @command{mhbuild}
5187 @cindex MH commands, @command{mhn}
5188 @cindex MIME
5189 @cindex multimedia mail
5191 MH-E has the capability to create multimedia messages. It uses the
5192 @sc{mime} (Multipurpose Internet Mail Extensions)
5193 protocol@footnote{@sc{mime} is defined in
5194 @uref{http://www.rfc-editor.org/rfc/rfc2045.txt, RFC 2045}.} The
5195 @sc{mime} protocol allows you to incorporate images, sound, video,
5196 binary files, and even commands that fetch a file with @samp{ftp} when
5197 your recipient reads the message!
5199 @kindex C-c C-m
5201 If you were to create a multimedia message with plain MH commands, you
5202 would insert @command{mhbuild} or @command{mhn} directives (henceforth
5203 called @dfn{MH-style directives} into your draft and use the
5204 @command{mhbuild} command in nmh or @command{mhn} command in MH and
5205 GNU mailutils to expand them. MH-E works in much the same way,
5206 although it provides a handful of commands prefixed with @kbd{C-c C-m}
5207 to insert the directives so you don't need to remember the syntax of
5208 them. Remember: you can always add MH-style directives by
5209 hand@footnote{See the section
5210 @uref{@value{MH-BOOK-HOME}/usimim.html#SeMIMa, Sending MIME Mail} in
5211 the MH book.}.
5213 @cindex MIME Meta Language (MML)
5214 @cindex MML
5215 @vindex mh-compose-insertion
5217 In addition to MH-style directives, MH-E also supports MML (@sc{mime}
5218 Meta Language) tags@footnote{
5219 @ifinfo
5220 @c Although the third argument should default to the
5221 @c first, makeinfo goes to the wrong Info file without it being
5222 @c different--it seems to be getting our own Composing node.
5223 @xref{Composing,,Composing with MML,emacs-mime}.
5224 @end ifinfo
5225 @ifnotinfo
5226 See the section Composing in
5227 @uref{http://www.gnus.org/manual/emacs-mime.html, @cite{The Emacs MIME
5228 Manual}}.
5229 @end ifnotinfo
5230 }. The option @code{mh-compose-insertion} can be used to choose
5231 between them. By default, this option is set to @samp{MML} if it is
5232 supported since it provides a lot more functionality. This option can
5233 also be set to @samp{MH} if MH-style directives are preferred.
5235 @cindex media types
5236 @cindex MIME, media types
5238 The MH-E @sc{mime} commands require a @dfn{media type} for each body
5239 part or attachment. For example, a PDF document is of type
5240 @samp{application/pdf} and an HTML document is of type
5241 @samp{text/html}. Some commands fill in the media type for you,
5242 whereas others require you to enter one.
5244 @cindex @command{file}
5245 @cindex @file{/etc/mime.types}
5246 @cindex files, @file{/etc/mime.types}
5247 @cindex Unix commands, @command{file}
5248 @findex mailcap-mime-types
5250 In the cases where MH-E can do so, it will determine the media type
5251 automatically. It uses the @command{file} command to do this. Failing
5252 that, the Emacs function @code{mailcap-mime-types} is used to provide
5253 a list from which to choose. This function usually reads the file
5254 @file{/etc/mime.types}.
5256 Whether the media type is chosen automatically, or you choose it from
5257 a list, use the type that seems to match best the file that you are
5258 including. In the case of binaries, the media type
5259 @samp{application/x-executable} can be useful. If you can't find an
5260 appropriate media type, use @samp{text/plain} for text messages and
5261 @samp{application/octet-stream} for everything else.
5263 @cindex content description
5264 @cindex MIME, content description
5266 You are also sometimes asked for a @dfn{content description}. This is
5267 simply an optional brief phrase, in your own words, that describes the
5268 object. If you don't care to enter a content description, just press
5269 return and none will be included; however, a reader may skip over
5270 multimedia fields unless the content description is compelling.
5272 You can also create your own @sc{mime} body parts. In the following
5273 example, I describe how you can create and edit a @samp{text/enriched}
5274 body part to liven up your plain text messages with boldface,
5275 underlining, and italics. I include an Emacs function which inserts
5276 enriched text tags.
5278 @smalllisp
5279 @group
5280 (defvar enriched-text-types '(("b" . "bold") ("i" . "italic")
5281                               ("u" . "underline")
5282                               ("s" . "smaller") ("B" . "bigger")
5283                               ("f" . "fixed")
5284                               ("c" . "center"))
5285   "Alist of (final-character . tag) choices for add-enriched-text.
5286 Additional types can be found in RFC 1563.")
5288 (defun add-enriched-text (begin end)
5289   "Add enriched text tags around region.
5290 The tag used comes from the list enriched-text-types and is
5291 specified by the last keystroke of the command.  When called from Lisp,
5292 arguments are BEGIN and END@."
5293   (interactive "r")
5294   ;; @r{Set type to the tag indicated by the last keystroke.}
5295   (let ((type (cdr (assoc (char-to-string (logior last-input-char ?@w{`}))
5296                           enriched-text-types))))
5297     (save-restriction               ; @r{restores state from narrow-to-region}
5298       (narrow-to-region begin end)      ; @r{narrow view to region}
5299       (goto-char (point-min))           ; @r{move to beginning of text}
5300       (insert "<" type ">")             ; @r{insert beginning tag}
5301       (goto-char (point-max))           ; @r{move to end of text}
5302       (insert "</" type ">"))))         ; @r{insert terminating tag}
5303 @i{Emacs function for entering enriched text}
5305 @end group
5306 @end smalllisp
5308 To use the function @code{add-enriched-text}, first add it to
5309 @file{~/.emacs} and create key bindings for it (@pxref{Composing}).
5311 Then, in your plain text message, set the mark with @kbd{C-@@} or
5312 @kbd{C-@key{SPC}}, type in the text to be highlighted, and type @kbd{C-c t
5313 b}. This adds @samp{<bold>} where you set the mark and adds
5314 @samp{</bold>} at the location of your cursor, giving you something
5315 like: @samp{You should be <bold>very</bold>}.
5317 Before sending this message, use @kbd{C-c C-m C-m}
5318 (@code{mh-mml-to-mime})@footnote{Use @kbd{C-c C-e}
5319 (@code{mh-mh-to-mime}) if you're using MH-style directives.} to add
5320 MIME header fields. Then replace @samp{text/plain} with
5321 @samp{text/enriched} in the @samp{Content-Type:} header field.
5323 You may also be interested in investigating @code{sgml-mode}.
5325 @subheading Including Files
5327 @cindex attachments, inserting
5328 @cindex images
5329 @cindex MIME, images
5330 @cindex MIME, sound
5331 @cindex MIME, video
5332 @cindex sound
5333 @cindex video
5334 @findex mh-compose-insertion
5335 @kindex C-c C-m C-i
5336 @kindex C-c C-m i
5337 @vindex mh-compose-insertion
5339 Binaries, images, sound, and video can be inserted in your message
5340 with the command @kbd{C-c C-m C-i} (@code{mh-compose-insertion}). You
5341 are prompted for the filename containing the object, the media type if
5342 it cannot be determined automatically, and a content description. If
5343 you're using MH-style directives, you will also be prompted for
5344 additional attributes.
5346 @subheading Forwarding Multimedia Messages
5348 @findex mh-compose-forward
5349 @kindex C-c C-m C-f
5350 @kindex C-c C-m f
5352 Mail may be forwarded with @sc{mime} using the command @kbd{C-c C-m
5353 C-f} (@code{mh-compose-forward}). You are prompted for a content
5354 description, the name of the folder in which the messages to forward
5355 are located, and a range of messages, which defaults to the current
5356 message in that folder. @xref{Ranges}.
5358 @subheading Including an FTP Reference
5360 @cindex @command{ftp}
5361 @cindex MIME, @command{ftp}
5362 @cindex Unix commands, @command{ftp}
5363 @findex mh-mh-compose-anon-ftp
5364 @kindex C-c C-m C-g
5365 @kindex C-c C-m g
5367 You can have your message initiate an @command{ftp} transfer when the
5368 recipient reads the message. To do this, use the command @kbd{C-c C-m
5369 C-g} (@code{mh-mh-compose-anon-ftp}). You are prompted for the remote
5370 host and filename, the media type, and the content description.
5372 @subheading Including tar Files
5374 @cindex @command{ftp}
5375 @cindex @command{tar}
5376 @cindex MIME, @command{ftp}
5377 @cindex MIME, @command{tar}
5378 @cindex Unix commands, @command{ftp}
5379 @cindex Unix commands, @command{tar}
5380 @findex mh-mh-compose-anon-ftp
5381 @findex mh-mh-compose-external-compressed-tar
5382 @kindex C-c C-m C-g
5383 @kindex C-c C-m C-t
5384 @kindex C-c C-m t
5386 If the remote file is a compressed tar file, you can use @kbd{C-c C-m
5387 C-t} (@code{mh-mh-compose-external-compressed-tar}). Then, in addition
5388 to retrieving the file via anonymous @emph{ftp} as per the command
5389 @kbd{C-c C-m C-g} (@code{mh-mh-compose-anon-ftp}), the file will also
5390 be uncompressed and untarred. You are prompted for the remote host and
5391 filename and the content description.
5393 @subheading Including Other External Files
5395 @findex mh-mh-compose-external-type
5396 @kindex C-c C-m C-x
5397 @kindex C-c C-m x
5399 The command @kbd{C-c C-m C-x} (@code{mh-mh-compose-external-type}) is
5400 a general utility for referencing external files. In fact, all of the
5401 other commands that insert tags to access external files call this
5402 command. You are prompted for the access type, remote host and
5403 filename, and content type. If you provide a prefix argument, you are
5404 also prompted for a content description, attributes, parameters, and a
5405 comment.
5407 @subheading Previewing Multimedia Messages
5409 When you are finished editing a @sc{mime} message, it might look like this:
5411 @cartouche
5412 @smallexample
5413 3 t08/24  root               received fax files on Wed Aug 24 11:00:
5414 4+t08/24  To:wohler          Test<<This is a test message to get the
5420 --:%%  @{+inbox@} 4 msgs (1-4)   Bot L4     (MH-Folder Show)---------------
5421 To: wohler
5423 Subject: Test of MIME
5424 --------
5425 Here is the SETI@@Home logo:
5427 <#part type="image/x-xpm" filename="~/lib/images/setiathome.xpm"
5428 disposition=inline description="SETI@@home logo">
5429 <#/part>
5430 --:**  @{draft@}   All L8     (MH-Letter)----------------------------------
5432 @end smallexample
5433 @end cartouche
5434 @i{MH-E @sc{mime} draft}
5436 @findex mh-mml-to-mime
5437 @kindex C-c C-m C-m
5438 @kindex C-c C-m m
5440 Typically, you send a message with attachments just like any other
5441 message (@pxref{Sending Message}).
5443 @findex mh-mml-to-mime
5444 @kindex C-c C-m C-m
5446 However, you may take a sneak preview of the @sc{mime} encoding if you
5447 wish by running the command @kbd{C-c C-m C-m} (@code{mh-mml-to-mime}).
5448 The following screen shows the @sc{mime} encoding specified by the
5449 tags. You can see why mail user agents are usually built to hide these
5450 details from the user.
5452 @cartouche
5453 @smallexample
5454 To: wohler
5456 Subject: Test of MIME
5457 X-Mailer: MH-E 8.1; nmh 1.1; GNU Emacs 23.1
5458 MIME-Version: 1.0
5459 Content-Type: multipart/mixed; boundary="=-=-="
5460 --------
5461 --=-=-=
5463 Here is the SETI@@Home logo:
5466 --=-=-=
5467 Content-Type: image/x-xpm
5468 Content-Disposition: inline; filename=setiathome.xpm
5469 Content-Transfer-Encoding: base64
5470 Content-Description: SETI@@home logo
5472 LyogWFBNICovCnN0YXRpYyBjaGFyICogc2V0aWF0aG9tZV94cG1bXSA9IHsKIjQ1IDQ1IDc2N
5473 --:--  @{draft@}   Top L1     (MH-Letter)----------------------------------
5475 @end smallexample
5476 @end cartouche
5477 @i{MH-E @sc{mime} draft ready to send}
5479 @cindex undo effects of mh-mml-to-mime
5481 This action can be undone by running @kbd{C-_} (@code{undo}).
5483 @cindex @command{mhbuild}
5484 @cindex @command{mhn}
5485 @cindex MH commands, @command{mhbuild}
5486 @cindex MH commands, @command{mhn}
5487 @cindex undo effects of mh-mh-to-mime
5488 @findex mh-mh-to-mime
5489 @findex mh-mh-to-mime-undo
5490 @kindex C-c C-e
5491 @kindex C-c C-m C-m
5492 @kindex C-c C-m C-u
5493 @kindex C-c C-m u
5495 If you're using MH-style directives, use @kbd{C-c C-e}
5496 (@code{mh-mh-to-mime}) instead of @kbd{C-c C-m C-m}. This runs the
5497 command @command{mhbuild} (@command{mhn}) on the message which expands
5498 the tags@footnote{See the section
5499 @uref{@value{MH-BOOK-HOME}/usimim.html#SeMIMa, Sending MIME Mail} in
5500 the MH book.}. This action can be undone by running @kbd{C-c C-m C-u}
5501 (@code{mh-mh-to-mime-undo}), which works by reverting to a backup
5502 file. You are prompted to confirm this action, but you can avoid the
5503 confirmation by adding an argument (for example, @kbd{C-u C-c C-m
5504 C-u}).
5506 @kindex C-c C-e
5507 @vindex mh-mh-to-mime-args
5509 If you wish to pass additional arguments to @command{mhbuild}
5510 (@command{mhn}) to affect how it builds your message, use the option
5511 @code{mh-mh-to-mime-args}. For example, you can build a consistency
5512 check into the message by setting @code{mh-mh-to-mime-args} to
5513 @samp{-check}. The recipient of your message can then run
5514 @samp{mhbuild -check} on the message---@command{mhbuild}
5515 (@command{mhn}) will complain if the message has been corrupted on the
5516 way. The command @kbd{C-c C-e} only consults this option when given a
5517 prefix argument (as in @kbd{C-u C-c C-e}).
5519 @kindex C-c C-e
5520 @vindex mh-mh-to-mime-hook
5522 The hook @code{mh-mh-to-mime-hook} is called after the message has
5523 been formatted by @kbd{C-c C-e}.
5525 @node Sending PGP, Checking Recipients, Adding Attachments, Editing Drafts
5526 @section Signing and Encrypting Messages
5528 @cindex signing messages
5529 @cindex encrypting messages
5530 @cindex RFC 3156
5532 MH-E can sign and encrypt messages as defined in
5533 @uref{http://www.rfc-editor.org/rfc/rfc3156.txt, RFC 3156}. If you
5534 should choose to sign or encrypt your message, use one of the
5535 following commands to do so any time before sending your message.
5537 @findex mh-mml-secure-message-encrypt
5538 @findex mh-mml-secure-message-sign
5539 @findex mh-mml-secure-message-signencrypt
5540 @kindex C-c C-m C-e
5541 @kindex C-c C-m C-s
5542 @kindex C-c C-m e e
5543 @kindex C-c C-m e s
5544 @kindex C-c C-m s e
5545 @kindex C-c C-m s s
5547 The command @kbd{C-c C-m C-s} (@code{mh-mml-secure-message-sign})
5548 inserts the following tag:
5550 @smallexample
5551 <#secure method=pgpmime mode=sign>
5552 @end smallexample
5554 This is used to sign your message digitally. Likewise, the command
5555 @kbd{C-c C-m C-e} (@code{mh-mml-secure-message-encrypt}) inserts the
5556 following tag:
5558 @smallexample
5559 <#secure method=pgpmime mode=encrypt>
5560 @end smallexample
5562 This is used to encrypt your message. Finally, the command @kbd{C-c
5563 C-m s e} (@code{mh-mml-secure-message-signencrypt}) inserts the
5564 following tag:
5566 @smallexample
5567 <#secure method=pgpmime mode=signencrypt>
5568 @end smallexample
5570 @findex mh-mml-unsecure-message
5571 @kindex C-c C-m C-n
5572 @kindex C-c C-m n
5573 @vindex mh-mml-method-default
5575 This is used to sign and encrypt your message. In each of these cases,
5576 a proper multipart message is created for you when you send the
5577 message. Use the command @kbd{C-c C-m C-n}
5578 (@code{mh-mml-unsecure-message}) to remove these tags. Use a prefix
5579 argument (as in @kbd{C-u C-c C-m s e}) to be prompted for one of the
5580 possible security methods (see @code{mh-mml-method-default}).
5582 @vindex mh-mml-method-default
5584 The option @code{mh-mml-method-default} is used to select between a
5585 variety of mail security mechanisms. The default is @samp{PGP (MIME)}
5586 if it is supported; otherwise, the default is @samp{None}. Other
5587 mechanisms include vanilla @samp{PGP} and @samp{S/MIME}.
5589 @cindex @samp{pgg} customization group
5590 @cindex PGG
5591 @cindex customization group, @samp{pgg}
5593 The @samp{pgg} customization group may have some settings which may
5594 interest you.
5595 @iftex
5596 See @cite{The PGG Manual}.
5597 @end iftex
5598 @ifinfo
5599 @xref{Top, , The PGG Manual, pgg, The PGG Manual}.
5600 @end ifinfo
5601 @ifhtml
5603 @uref{http://www.gnu.org/software/emacs/manual/pgg.html,
5604 @cite{The PGG Manual}}.
5605 @end ifhtml
5607 @cindex header field, @samp{Fcc:}
5608 @cindex @samp{Fcc:} header field
5609 @vindex pgg-encrypt-for-me
5611 In particular, I turn on the option @code{pgg-encrypt-for-me} so that
5612 all messages I encrypt are encrypted with my public key as well. If
5613 you keep a copy of all of your outgoing mail with a @samp{Fcc:} header
5614 field, this setting is vital so that you can read the mail you write!
5616 @node Checking Recipients, Sending Message, Sending PGP, Editing Drafts
5617 @section Checking Recipients
5619 @cindex @samp{*MH-E Recipients*}
5620 @cindex @command{whom}
5621 @cindex MH commands, @command{whom}
5622 @cindex buffers, @samp{*MH-E Recipients*}
5623 @cindex checking recipients
5624 @cindex recipients, checking
5625 @findex mh-check-whom
5626 @kindex C-c C-w
5628 The command @kbd{C-c C-w} (@code{mh-check-whom}) expands aliases so
5629 you can check the actual address(es) in the alias. A new buffer named
5630 @samp{*MH-E Recipients*} is created with the output of @command{whom}
5631 (@pxref{Miscellaneous})@footnote{See the section
5632 @uref{@value{MH-BOOK-HOME}/senove.html#WhaPro, What now?---and the
5633 whatnow Program} in the MH book.}.
5635 @node Sending Message, Killing Draft, Checking Recipients, Editing Drafts
5636 @section Sending a Message
5638 @cindex buffers, @samp{*MH-E Mail Delivery*}
5639 @cindex @samp{*MH-E Mail Delivery*}
5640 @cindex sending mail
5641 @findex mh-send-letter
5642 @kindex C-c C-c
5644 When you are all through editing a message, you send it with the
5645 command @kbd{C-c C-c} (@code{mh-send-letter}). You can give a prefix
5646 argument (as in @kbd{C-u C-c C-c}) to monitor the first stage of the
5647 delivery; this output can be found in a buffer called @samp{*MH-E Mail
5648 Delivery*} (@pxref{Miscellaneous}).
5650 @cindex sending mail
5651 @cindex spell check
5652 @findex ispell-message
5653 @kindex C-c C-c
5654 @vindex mh-before-send-letter-hook
5656 The hook @code{mh-before-send-letter-hook} is run at the beginning of
5657 the command @kbd{C-c C-c}. For example, if you want to check your
5658 spelling in your message before sending, add the function
5659 @code{ispell-message}.
5661 @cindex @command{send}
5662 @cindex MH commands, @command{send}
5663 @vindex mh-send-prog
5665 In case the MH @command{send} program@footnote{See the section
5666 @uref{@value{MH-BOOK-HOME}/sensen.html, Sending Some Mail: comp send}
5667 in the MH book.} is installed under a different name, use
5668 @code{mh-send-prog} to tell MH-E the name.
5670 The hook @code{mh-annotate-msg-hook} is run after annotating the
5671 message and scan line (@pxref{Sending Mail}).
5673 @node Killing Draft,  , Sending Message, Editing Drafts
5674 @section Killing the Draft
5676 @cindex killing draft
5677 @findex kill-buffer
5678 @findex mh-fully-kill-draft
5679 @kindex C-c C-q
5680 @kindex C-x k
5682 If for some reason you are not happy with the draft, you can use the
5683 command @kbd{C-c C-q} (@code{mh-fully-kill-draft}) to kill the draft
5684 buffer and delete the draft message. Use the command @kbd{C-x k}
5685 (@code{kill-buffer}) if you don't want to delete the draft message.
5687 @node Aliases, Identities, Editing Drafts, Top
5688 @chapter Aliases
5690 @cindex aliases
5692 MH aliases are used in the same way in MH-E as they are in MH@. Any
5693 alias listed as a recipient will be expanded when the message is sent.
5694 This chapter discusses other things you can do with aliases in MH-E.
5696 @cindex MH-Letter mode
5697 @cindex modes, MH-Letter
5699 The following commands are available in MH-Letter mode with the
5700 exception of @code{mh-alias-reload} which can be called from anywhere.
5702 @table @kbd
5703 @kindex @key{SPC}
5704 @findex mh-letter-complete-or-space
5705 @item @key{SPC}
5706 Perform completion or insert space (@code{mh-letter-complete-or-space}).
5707 @c -------------------------
5708 @kindex M-@key{TAB}
5709 @findex mh-letter-complete
5710 @item M-@key{TAB}
5711 Perform completion on header field or word preceding point
5712 (@code{mh-letter-complete}).
5713 @c -------------------------
5714 @findex mh-alias-apropos
5715 @item mh-alias-apropos
5716 Show all aliases or addresses that match a regular expression.
5717 @c -------------------------
5718 @findex mh-alias-grab-from-field
5719 @item mh-alias-grab-from-field
5720 Add alias for the sender of the current message
5721 @c -------------------------
5722 @findex mh-alias-reload
5723 @item mh-alias-reload
5724 Reload MH aliases.
5725 @end table
5727 @cindex @samp{mh-alias} customization group
5728 @cindex customization group, @samp{mh-alias}
5730 The @samp{mh-alias} customization group contains options associated
5731 with aliases.
5733 @vtable @code
5734 @item mh-alias-completion-ignore-case-flag
5735 On means don't consider case significant in MH alias completion
5736 (default: @samp{on}).
5737 @c -------------------------
5738 @item mh-alias-expand-aliases-flag
5739 On means to expand aliases entered in the minibuffer (default:
5740 @samp{off}).
5741 @c -------------------------
5742 @item mh-alias-flash-on-comma
5743 Specify whether to flash address or warn on translation (default: @samp{Flash
5744 but Don't Warn If No Alias}).
5745 @c -------------------------
5746 @item mh-alias-insert-file
5747 Filename used to store a new MH-E alias (default: @samp{Use Aliasfile
5748 Profile Component}).
5749 @c -------------------------
5750 @item mh-alias-insertion-location
5751 Specifies where new aliases are entered in alias files (default:
5752 @samp{Alphabetical}).
5753 @c -------------------------
5754 @item mh-alias-local-users
5755 If @samp{on}, local users are added to alias completion (default:
5756 @samp{on}).
5757 @c -------------------------
5758 @item mh-alias-local-users-prefix
5759 String prefixed to the real names of users from the password file
5760 (default: @code{"local."}.
5761 @c -------------------------
5762 @item mh-alias-passwd-gecos-comma-separator-flag
5763 On means the GECOS field in the password file uses a comma separator
5764 (default: @samp{on}).
5765 @end vtable
5767 The following hook is available.
5769 @vtable @code
5770 @item mh-alias-reloaded-hook
5771 Hook run by @code{mh-alias-reload} after loading aliases (default:
5772 @code{nil}).
5773 @end vtable
5775 @subheading Adding Addresses to Draft
5777 You can use aliases when you are adding recipients to a message.
5779 @findex minibuffer-complete
5780 @kindex @key{TAB}
5781 @vindex mh-alias-expand-aliases-flag
5782 @vindex mh-compose-prompt-flag
5784 In order to use minibuffer prompting for recipients and the subject
5785 line in the minibuffer, turn on the option
5786 @code{mh-compose-prompt-flag} (@pxref{Composing}), and use the
5787 @key{TAB} (@code{minibuffer-complete}) command to complete aliases
5788 (and optionally local logins) when prompted for the recipients. Turn
5789 on the option @code{mh-alias-expand-aliases-flag} if you want these
5790 aliases to be expanded to their respective addresses in the draft.
5792 @findex mh-letter-complete
5793 @findex mh-letter-complete-or-space
5794 @kindex @key{SPC}
5795 @kindex M-@key{TAB}
5797 Otherwise, you can complete aliases in the header of the draft with
5798 @kbd{M-@key{TAB}} (@code{mh-letter-complete}) or @key{SPC}
5799 (@code{mh-letter-complete-or-space}).
5801 @vindex mh-alias-completion-ignore-case-flag
5803 As MH ignores case in the aliases, so too does MH-E@. However, you may
5804 turn off the option @code{mh-alias-completion-ignore-case-flag} to
5805 make case significant which can be used to segregate completion of
5806 your aliases. You might use uppercase for mailing lists and lowercase
5807 for people. For example, you might have:
5809 @smallexample
5810 mark.baushke: Mark Baushke <mdb@@stop.mail-abuse.org>
5811 MH-E: MH-E Mailing List <mh-e-devel@@stop.mail-abuse.org>
5812 @end smallexample
5814 When this option is turned off, if you were to type @kbd{M} in the
5815 @samp{To:} field and then @kbd{M-@key{TAB}}, then you'd get the list;
5816 if you started with @kbd{m} and then entered @kbd{M-@key{TAB}}, then
5817 you'd get Mark's address. Note that this option affects completion
5818 only. If you were to enter @kbd{Mark.Baushke}, it would still be
5819 identified with your @samp{mark.baushke} alias.
5821 @findex mh-alias-minibuffer-confirm-address
5822 @findex mh-letter-confirm-address
5823 @vindex mh-alias-flash-on-comma
5824 @vindex mh-compose-prompt-flag
5826 To verify that the alias you've entered is valid, the alias will be
5827 displayed in the minibuffer when you type a comma
5828 (@code{mh-letter-confirm-address} or
5829 @code{mh-alias-minibuffer-confirm-address} if the option
5830 @code{mh-compose-prompt-flag} is turned on). @xref{Composing}. This
5831 behavior can be controlled with the option
5832 @code{mh-alias-flash-on-comma} which provides three choices:
5833 @samp{Flash but Don't Warn If No Alias}, @samp{Flash and Warn If No
5834 Alias}, and @samp{Don't Flash Nor Warn If No Alias}.
5836 For another way to verify the alias expansion, see @ref{Checking
5837 Recipients}.
5839 @subheading Loading Aliases
5841 @cindex @command{ali}
5842 @cindex @file{/etc/nmh/MailAliases}
5843 @cindex @samp{Aliasfile:} MH profile component
5844 @cindex MH commands, @command{ali}
5845 @cindex MH profile component, @samp{Aliasfile:}
5846 @cindex files, @file{/etc/nmh/MailAliases}
5848 MH-E loads aliases for completion and folder name hints from various
5849 places. It uses the MH command @command{ali}@footnote{See the section
5850 @uref{@value{MH-BOOK-HOME}/mh.html, MH Aliases} in the MH book.} to
5851 read aliases from the files listed in the profile component
5852 @samp{Aliasfile:} as well as system-wide aliases (for example,
5853 @file{/etc/nmh/MailAliases}).
5855 @cindex @file{/etc/passwd}
5856 @cindex files, @file{/etc/passwd}
5858 In addition, aliases are created from @file{/etc/passwd} entries with
5859 a user ID larger than a magical number, typically 200. This can be a
5860 handy tool on a machine where you and co-workers exchange messages.
5861 These aliases have the form @samp{local.@var{first.last}} if a real
5862 name is present in the password file. Otherwise, the alias will have
5863 the form @samp{local.@var{login}}.
5865 @vindex mh-alias-local-users-prefix
5867 The prefix @samp{local.} can be modified via the option
5868 @code{mh-alias-local-users-prefix}. This option can also be set to
5869 @samp{Use Login}.
5871 For example, consider the following password file entry:
5873 @smallexample
5874 psg:x:1000:1000:Peter S Galbraith,,,:/home/psg:/bin/tcsh
5875 @end smallexample
5877 @vindex mh-alias-local-users-prefix
5879 The following settings of option @code{mh-alias-local-users-prefix}
5880 will produce the associated aliases:
5882 @table @code
5883 @item "local."
5884 local.peter.galbraith
5885 @c -------------------------
5886 @item ""
5887 peter.galbraith
5888 @c -------------------------
5889 @item Use Login
5891 @end table
5893 @vindex mh-alias-passwd-gecos-comma-separator-flag
5895 In the example above, commas are used to separate different values
5896 within the so-called GECOS field. This is a fairly common usage.
5897 However, in the rare case that the GECOS field in your password file
5898 is not separated by commas and whose contents may contain commas, you
5899 can turn the option @code{mh-alias-passwd-gecos-comma-separator-flag}
5900 off.
5902 @cindex NIS, obtaining local aliases from
5903 @cindex @samp{ypcat passwd}
5904 @vindex mh-alias-local-users
5906 If you're on a system with thousands of users you don't know, and the
5907 loading of local aliases slows MH-E down noticeably, then the local
5908 alias feature can be disabled by turning off the option
5909 @code{mh-alias-local-users}. This option also takes a string which is
5910 executed to generate the password file. For example, use @samp{ypcat
5911 passwd} to obtain the NIS password file.
5913 @findex mh-alias-reload
5914 @kindex M-x mh-alias-reload
5915 @vindex mh-alias-reloaded-hook
5917 Since aliases are updated frequently, MH-E reloads aliases
5918 automatically whenever an alias lookup occurs if an alias source has
5919 changed. However, you can reload your aliases manually by calling the
5920 command @kbd{M-x mh-alias-reload} directly. This command runs
5921 @code{mh-alias-reloaded-hook} after the aliases have been loaded.
5923 @subheading Adding Aliases
5925 In the past, you have manually added aliases to your alias file(s)
5926 listed in your @samp{Aliasfile:} profile component. MH-E provides
5927 other methods for maintaining your alias file(s).
5929 @findex mh-alias-add-alias
5930 @kindex M-x mh-alias-add-alias
5932 You can use the @kbd{M-x mh-alias-add-alias} command which will prompt
5933 you for the alias and address that you would like to add. If the alias
5934 exists already, you will have the choice of inserting the new alias
5935 before or after the old alias. In the former case, this alias will be
5936 used when sending mail to this alias. In the latter case, the alias
5937 serves as an additional folder name hint when filing messages
5938 (@pxref{Folder Selection}).
5940 Earlier, the alias prefix @samp{local} was presented. You can use
5941 other prefixes to organize your aliases or disambiguate entries. You
5942 might use prefixes for locales, jobs, or activities. For example, I
5943 have:
5945 @smallexample
5946 @group
5947 ; Work
5948 attensity.don.mitchell: Don Mitchell <dmitchell@@stop.mail-abuse.com>
5949 isharp.don.mitchell: Don Mitchell <donaldsmitchell@@stop.mail-abuse.com>
5951 ; Sport
5952 diving.ken.mayer: Ken Mayer <kmayer@@stop.mail-abuse.com>
5953 sailing.mike.maloney: Mike Maloney <mmaloney@@stop.mail-abuse.com>
5955 ; Personal
5956 ariane.kolkmann: Ariane Kolkmann <ArianeKolkmann@@stop.mail-abuse.com>
5958 @end group
5959 @end smallexample
5961 Using prefixes instead of postfixes helps you explore aliases during
5962 completion. If you forget the name of an old dive buddy, you can enter
5963 @samp{div} and then @key{SPC} to get a listing of all your dive buddies.
5965 @kindex M-x mh-alias-add-address-under-point
5966 @kindex M-x mh-alias-grab-from-field
5968 An alias for the sender of the current message is added automatically
5969 by clicking on the @samp{Grab From alias} tool bar button or by running
5970 the @kbd{M-x mh-alias-grab-from-field} command. Aliases for other
5971 recipients of the current message are added by placing your cursor
5972 over the desired recipient and giving the @kbd{M-x
5973 mh-alias-add-address-under-point} command.
5975 @vindex mh-alias-insert-file
5976 @vindex mh-alias-insertion-location
5978 The options @code{mh-alias-insert-file} and
5979 @code{mh-alias-insertion-location} controls how and where these aliases
5980 are inserted.
5982 @vindex mh-alias-insert-file
5984 The default setting of option @code{mh-alias-insert-file} is @samp{Use
5985 Aliasfile Profile Component}. This option can also hold the name of a
5986 file or a list a file names. If this option is set to a list of file
5987 names, or the @samp{Aliasfile:} profile component contains more than
5988 one file name, MH-E will prompt for one of them.
5990 @vindex mh-alias-insertion-location
5992 The option @code{mh-alias-insertion-location} is set to
5993 @samp{Alphabetical} by default. If you organize your alias file in
5994 other ways, then the settings @samp{Top} and @samp{Bottom} might be
5995 more appropriate.
5997 @subheading Querying Aliases
5999 @cindex regular expressions, @code{mh-alias-apropos}
6000 @findex mh-alias-apropos
6001 @kindex M-x mh-alias-apropos
6003 If you can't quite remember an alias, you can use @kbd{M-x
6004 mh-alias-apropos} to show all aliases or addresses that match a
6005 regular expression
6006 @ifnothtml
6007 (@pxref{Regexps, , Syntax of Regular Expressions, emacs, The
6008 GNU Emacs Manual}).
6009 @end ifnothtml
6010 @ifhtml
6011 (see the section
6012 @uref{http://www.gnu.org/software/emacs/manual/html_node/emacs/Regexps.html,
6013 Syntax of Regular Expressions} in
6014 @cite{The GNU Emacs Manual}).
6015 @end ifhtml
6017 @node Identities, Speedbar, Aliases, Top
6018 @chapter Identities
6020 @cindex identities
6021 @cindex multiple personalities
6023 MH-E supports the concept of multiple personalities or identities.
6024 This means that you can easily have a different header and signature
6025 at home and at work.
6027 @cindex @samp{Identity} menu
6028 @cindex menu, @samp{Identity}
6030 A couple of commands are used to insert identities in MH-Letter mode
6031 which are also found in the @samp{Identity} menu.
6033 @table @kbd
6034 @kindex C-c C-d
6035 @findex mh-insert-identity
6036 @item C-c C-d
6037 Insert fields specified by given identity (@code{mh-insert-identity}).
6038 @c -------------------------
6039 @cindex @samp{Identity > Insert Auto Fields} menu item
6040 @cindex menu item, @samp{Identity > Insert Auto Fields}
6041 @kindex C-c M-d
6042 @findex mh-insert-auto-fields
6043 @item C-c M-d
6044 Insert custom fields if recipient found in @code{mh-auto-fields-list}
6045 (@code{mh-insert-auto-fields}).
6046 @end table
6048 @cindex @samp{mh-identity} customization group
6049 @cindex customization group, @samp{mh-identity}
6051 The @samp{mh-identity} customization group contains the following
6052 options.
6054 @vtable @code
6055 @item mh-auto-fields-list
6056 List of recipients for which header lines are automatically inserted
6057 (default: @code{nil}).
6058 @c -------------------------
6059 @item mh-auto-fields-prompt-flag
6060 On means to prompt before sending if fields inserted (default:
6061 @samp{on})
6062 @c -------------------------
6063 @item mh-identity-default
6064 Default identity to use when @code{mh-letter-mode} is called (default:
6065 @samp{None}).
6066 @c -------------------------
6067 @item mh-identity-handlers
6068 Handler functions for fields in @code{mh-identity-list}.
6069 @c -------------------------
6070 @item mh-identity-list
6071 List of identities (default: @code{nil}).
6072 @end vtable
6074 Some of the common header fields that people change depending on the
6075 context are the @samp{From:} and @samp{Organization:} fields, as well
6076 as the signature.
6078 @vindex mh-identity-list
6080 This is done by customizing the option @code{mh-identity-list}. In the
6081 customization buffer for this option, click on the @samp{INS} button
6082 and enter a label such as @samp{Home} or @samp{Work}. Then click on
6083 the @samp{INS} button with the label @samp{Add at least one item
6084 below}. The @samp{Value Menu} has the following menu items:
6086 @table @samp
6087 @cindex header field, @samp{From:}
6088 @cindex @samp{From:} header field
6089 @item From Field
6090 Specify an alternate @samp{From:} header field. You must include a
6091 valid email address. A standard format is @samp{First Last
6092 <login@@host.domain>}. If you use an initial with a period, then you
6093 must quote your name as in @samp{"First I. Last"
6094 <login@@host.domain>}.
6095 @c -------------------------
6096 @cindex header field, @samp{Organization:}
6097 @cindex @samp{Organization:} header field
6098 @item Organization Field
6099 People usually list the name of the company where they work here.
6100 @c -------------------------
6101 @item Other Field
6102 Set any arbitrary header field and value here. Unless the header field
6103 is a standard one, precede the name of your field's label with
6104 @samp{X-}, as in @samp{X-Fruit-of-the-Day:}.
6105 @c -------------------------
6106 @item Attribution Verb
6107 This value overrides the setting of
6108 @code{mh-extract-from-attribution-verb}. @xref{Inserting Letter}.
6109 @c -------------------------
6110 @cindex signature
6111 @vindex mh-signature-file-name
6112 @item Signature
6113 Set your signature with this item. You can specify the contents of
6114 @code{mh-signature-file-name}, a file, or a function.
6115 @xref{Signature}.
6116 @c -------------------------
6117 @item GPG Key ID
6118 Specify a different key to sign or encrypt messages.
6119 @end table
6121 @cindex Identity menu
6122 @cindex menu, Identity
6123 @findex mh-insert-identity
6124 @kindex C-c C-d
6126 You can select the identities you have added via the menu called
6127 @samp{Identity} in the MH-Letter buffer. You can also use @kbd{C-c
6128 C-d} (@code{mh-insert-identity}). To clear the fields and signature
6129 added by the identity, select the @samp{None} identity.
6131 @cindex menu item, @samp{Identity > Customize Identities}
6132 @cindex menu item, @samp{Identity > Save as Default}
6133 @cindex menu item, @samp{Identity > Set Default for Session}
6134 @cindex @samp{Identity > Customize Identities} menu item
6135 @cindex @samp{Identity > Save as Default} menu item
6136 @cindex @samp{Identity > Set Default for Session} menu item
6137 @vindex mh-identity-default
6139 The @samp{Identity} menu contains two other items to save you from
6140 having to set the identity on every message. The menu item @samp{Set
6141 Default for Session} can be used to set the default identity to the
6142 current identity until you exit Emacs. The menu item @samp{Save as
6143 Default} sets the option @code{mh-identity-default} to the current
6144 identity setting. You can also customize the option
6145 @code{mh-identity-default} in the usual fashion. If you find that you
6146 need to add another identity, the menu item @samp{Customize
6147 Identities} is available for your convenience.
6149 @cindex regular expressions, @code{mh-auto-fields-list}
6150 @vindex mh-auto-fields-list
6152 The option @code{mh-auto-fields-list} can also be used to set the
6153 identity depending on the recipient to provide even more control. To
6154 customize @code{mh-auto-fields-list}, click on the @samp{INS} button
6155 and enter a regular expression for the recipient's address
6156 @ifnothtml
6157 (@pxref{Regexps, , Syntax of Regular Expressions, emacs, The
6158 GNU Emacs Manual}).
6159 @end ifnothtml
6160 @ifhtml
6161 (see the section
6162 @uref{http://www.gnu.org/software/emacs/manual/html_node/emacs/Regexps.html,
6163 Syntax of Regular Expressions} in
6164 @cite{The GNU Emacs Manual}).
6165 @end ifhtml
6166 Click on the @samp{INS} button with the @samp{Add at least one item
6167 below} label. The @samp{Value Menu} contains the following menu items:
6169 @table @samp
6170 @item Identity
6171 Select an identity from those configured in @code{mh-identity-list}.
6172 All of the information for that identity will be added if the
6173 recipient matches.
6174 @c -------------------------
6175 @cindex @samp{Fcc:} header field
6176 @cindex header field, @samp{Fcc:}
6177 @item Fcc Field
6178 Insert an @samp{Fcc:} header field with the folder you provide. When
6179 you send the message, MH will put a copy of your message in this
6180 folder.
6181 @c -------------------------
6182 @cindex @samp{Mail-Followup-To:} header field
6183 @cindex header field, @samp{Mail-Followup-To:}
6184 @item Mail-Followup-To Field
6185 Insert an @samp{Mail-Followup-To:} header field with the recipients
6186 you provide. If the recipient's mail user agent supports this header
6187 field@footnote{@samp{Mail-Followup-To:} is supported by nmh.}, then
6188 their replies will go to the addresses listed. This is useful if their
6189 replies go both to the list and to you and you don't have a mechanism
6190 to suppress duplicates. If you reply to someone not on the list, you
6191 must either remove the @samp{Mail-Followup-To:} field, or ensure the
6192 recipient is also listed there so that he receives replies to your
6193 reply.
6194 @c -------------------------
6195 @item Other Field
6196 Other header fields may be added using this menu item.
6197 @end table
6199 @findex mh-insert-auto-fields
6200 @kindex C-c M-d
6201 @vindex mh-auto-fields-prompt-flag
6203 These fields can only be added after the recipient is known. Because
6204 you can continue to add recipients as you edit the draft, MH-E waits
6205 until the message is sent to perform the auto-insertions. This seems
6206 strange at first, but you'll get used to it. There are two ways to
6207 help you feel that the desired fields are added. The first is the
6208 action when the message is sent: if any fields are added
6209 automatically, you are given a chance to see and to confirm these
6210 fields before the message is actually sent. You can do away with this
6211 confirmation by turning off the option
6212 @code{mh-auto-fields-prompt-flag}. The second method is manual: once
6213 the header contains one or more recipients, you may run the command
6214 @kbd{C-c M-d} (@code{mh-insert-auto-fields}) or choose the
6215 @samp{Identity -> Insert Auto Fields} menu item to insert these fields
6216 manually. However, if you use this command, the automatic insertion
6217 when the message is sent is disabled.
6219 @vindex mh-auto-fields-list
6220 @vindex mh-identity-list
6222 You should avoid using the same header field in
6223 @code{mh-auto-fields-list} and @code{mh-identity-list} definitions
6224 that may apply to the same message as the result is undefined.
6226 @vindex mh-identity-handlers
6227 @vindex mh-identity-list
6229 The option @code{mh-identity-handlers} is used to change the way that
6230 fields, signatures, and attributions in @code{mh-identity-list} are
6231 added. To customize @code{mh-identity-handlers}, replace the name of
6232 an existing handler function associated with the field you want to
6233 change with the name of a function you have written. You can also
6234 click on an @samp{INS} button and insert a field of your choice and
6235 the name of the function you have written to handle it.
6237 @vindex mh-identity-list
6239 The @samp{Field} field can be any field that you've used in your
6240 @code{mh-identity-list}. The special fields @samp{:attribution-verb},
6241 @samp{:signature}, or @samp{:pgg-default-user-id} are used for the
6242 @code{mh-identity-list} choices @samp{Attribution Verb},
6243 @samp{Signature}, and @samp{GPG Key ID} respectively.
6245 The handler associated with the @samp{:default} field is used when no
6246 other field matches.
6248 The handler functions are passed two or three arguments: the field
6249 itself (for example, @samp{From}), or one of the special fields (for
6250 example, @samp{:signature}), and the action @samp{'remove} or
6251 @samp{'add}. If the action is @samp{'add}, an additional argument
6252 containing the value for the field is given.
6254 @node Speedbar, Menu Bar, Identities, Top
6255 @chapter The Speedbar
6257 @cindex folder navigation
6258 @cindex speedbar
6259 @findex mh-visit-folder
6260 @kindex F v
6261 @kindex M-x speedbar
6262 @kindex Mouse-2
6264 You can also use the speedbar
6265 @ifnothtml
6266 (@pxref{Speedbar, , Speedbar Frames, emacs, The GNU Emacs Manual},)
6267 @end ifnothtml
6268 @ifhtml
6269 (see the section
6270 @uref{http://www.gnu.org/software/emacs/manual/html_node/emacs/Speedbar.html,
6271 Speedbar Frames} in @cite{The GNU Emacs Manual})
6272 @end ifhtml
6273 to view your folders. To bring up the speedbar, run @kbd{M-x speedbar
6274 @key{RET}}. You will see a new frame appear with all of your MH
6275 folders. Folders with unseen messages appear in boldface. Click on a
6276 folder name with @kbd{Mouse-2} to visit that folder in a similar
6277 fashion to the command @kbd{F v} (@code{mh-visit-folder})
6278 (@pxref{Folders}). Click on the @samp{+} icon to expand and view the
6279 sub-folders of that folder.
6281 The speedbar can be manipulated with the keyboard as well. Use the
6282 Emacs navigational keys (like the arrow keys, or @kbd{C-n}) to move
6283 the cursor over the desired folder and then use the shortcuts for the
6284 menu items listed in the table below.
6286 @table @samp
6287 @findex mh-speed-view
6288 @item Visit Folder (@key{RET})
6289 Visits the selected folder just as if you had used @kbd{F v}
6290 (@code{mh-speed-view}).
6291 @c -------------------------
6292 @findex mh-speed-expand-folder
6293 @item Expand Nested Folders (@kbd{+})
6294 Expands the selected folder in the speedbar, exposing the children
6295 folders inside it (@code{mh-speed-expand-folder}).
6296 @c -------------------------
6297 @findex mh-speed-contract-folder
6298 @item Contract Nested Folders (@kbd{-})
6299 Contracts or collapses the selected folder in the speedbar, hiding the
6300 children folders inside it (@code{mh-speed-contract-folder}).
6301 @c -------------------------
6302 @findex mh-speed-refresh
6303 @item Refresh Speedbar (@kbd{r})
6304 Regenerates the list of folders in the speedbar. Run this command if
6305 you've added or deleted a folder, or want to update the unseen message
6306 count before the next automatic update (@code{mh-speed-refresh}).
6307 @end table
6309 @findex delete-frame
6310 @kindex C-x 5 0
6311 @kindex Mouse-3
6313 You can click on @kbd{Mouse-3} to bring up a context menu that
6314 contains these items. Dismiss the speedbar with @kbd{C-x 5 0}
6315 (@code{delete-frame}).
6317 @cindex @command{flists}
6318 @cindex MH commands, @command{flists}
6319 @cindex @samp{mh-speedbar} customization group
6320 @cindex customization group, @samp{mh-speedbar}
6322 The MH-E speedbar uses the MH command @command{flists}@footnote{See
6323 the section @uref{@value{MH-BOOK-HOME}/morseq.html#flist, Searching for
6324 Sequences with flist} in the MH book.} to generate the list of
6325 folders. The @samp{mh-speedbar} customization group contains the
6326 following option which controls how often the speedbar calls
6327 @command{flists}.
6329 @vtable @code
6330 @item mh-speed-update-interval
6331 Time between speedbar updates in seconds (default: 60). Set to 0 to
6332 disable automatic update.
6333 @end vtable
6335 You can modify the appearance of the folders in the speedbar by
6336 customizing the following faces.
6338 @vtable @code
6339 @item mh-speedbar-folder
6340 Basic folder face.
6341 @c -------------------------
6342 @item mh-speedbar-folder-with-unseen-messages
6343 Folder face when folder contains unread messages.
6344 @c -------------------------
6345 @item mh-speedbar-selected-folder
6346 Selected folder face.
6347 @c -------------------------
6348 @item mh-speedbar-selected-folder-with-unseen-messages
6349 Selected folder face when folder contains unread messages.
6350 @end vtable
6352 @node Menu Bar, Tool Bar, Speedbar, Top
6353 @chapter The Menu Bar
6355 @cindex @samp{Folder} menu
6356 @cindex @samp{Identity} menu
6357 @cindex @samp{Letter} menu
6358 @cindex @samp{Message} menu
6359 @cindex @samp{Search} menu
6360 @cindex @samp{Sequence} menu
6361 @cindex Folder menu
6362 @cindex Identity menu
6363 @cindex Letter menu
6364 @cindex MH-Folder mode
6365 @cindex MH-Letter mode
6366 @cindex MH-Search mode
6367 @cindex Message menu
6368 @cindex Search menu
6369 @cindex Sequence menu
6370 @cindex menu bar
6371 @cindex menu, Folder
6372 @cindex menu, Identity
6373 @cindex menu, Letter
6374 @cindex menu, Message
6375 @cindex menu, Search
6376 @cindex menu, Sequence
6377 @cindex menu, @samp{Folder}
6378 @cindex menu, @samp{Identity}
6379 @cindex menu, @samp{Letter}
6380 @cindex menu, @samp{Message}
6381 @cindex menu, @samp{Search}
6382 @cindex menu, @samp{Sequence}
6383 @cindex modes, MH-Folder
6384 @cindex modes, MH-Letter
6385 @cindex modes, MH-Search
6387 For those of you who prefer to mouse and menu instead of using the
6388 meta-coke-bottle-bucky keys, MH-E provides menu items for most of its
6389 functions. The MH-Folder buffer adds the @samp{Folder},
6390 @samp{Message}, and @samp{Sequence} menus. The MH-Letter buffer adds
6391 the @samp{Identity} and @samp{Letter} menus. The MH-Search buffer adds
6392 the @samp{Search} menu. There's no need to list the actual items here,
6393 as you can more easily see them for yourself, and the functions are
6394 already described elsewhere in this manual.
6396 For a description of the menu bar, please
6397 @ifnothtml
6398 @xref{Menu Bar, , The Menu Bar, emacs, The GNU Emacs Manual}.
6399 @end ifnothtml
6400 @ifhtml
6401 see the section
6402 @uref{http://www.gnu.org/software/emacs/manual/html_node/emacs/Menu-Bar.html,
6403 The Menu Bar} in @cite{The GNU Emacs Manual}.
6404 @end ifhtml
6406 The Emacs manual describes how to get online help for a particular
6407 menu item. You can also look up a menu item in the index of this
6408 manual in two ways: all of the menu items are listed alphabetically,
6409 and you can also browse all of the items under the index entry
6410 @samp{menu item}.
6412 @node Tool Bar, Searching, Menu Bar, Top
6413 @chapter The Tool Bar
6415 @cindex tool bar
6417 Emacs also provides a graphical tool bar. For a description of the
6418 tool bar, please
6419 @ifnothtml
6420 @xref{Tool Bars, , Tool Bars, emacs, The GNU Emacs Manual}.
6421 @end ifnothtml
6422 @ifhtml
6423 see the section
6424 @uref{http://www.gnu.org/software/emacs/manual/html_node/emacs/Tool-Bars.html,
6425 Tool Bars} in @cite{The GNU Emacs Manual}.
6426 @end ifhtml
6428 @cindex @samp{mh-tool-bar} customization group
6429 @cindex customization group, @samp{mh-tool-bar}
6431 MH-E adds several icons to this tool bar; you can modify the MH-E
6432 aspects of the tool bar via the @samp{mh-tool-bar} customization group.
6434 @vtable @code
6435 @item mh-tool-bar-folder-buttons
6436 List of buttons to include in MH-Folder tool bar (default: a checklist
6437 too long to list here).
6438 @c -------------------------
6439 @item mh-tool-bar-letter-buttons
6440 List of buttons to include in MH-Letter tool bar (default: a checklist
6441 too long to list here).
6442 @c -------------------------
6443 @item mh-tool-bar-search-function
6444 Function called by the tool bar search button (default:
6445 @code{mh-search}).
6446 @c -------------------------
6447 @item mh-xemacs-tool-bar-position
6448 Tool bar location (default: @samp{Same As Default Tool Bar}).
6449 @c -------------------------
6450 @item mh-xemacs-use-tool-bar-flag
6451 If @samp{on}, use tool bar (default: @samp{on}, if supported).
6452 @end vtable
6454 In GNU Emacs, icons for some of MH-E's functions are added to the tool
6455 bar. In XEmacs, you have the opportunity to create a separate tool bar for
6456 the MH-E icons.
6458 @vindex mh-tool-bar-folder-buttons
6459 @vindex mh-tool-bar-letter-buttons
6461 In either case, you can select which of these functions you'd like to
6462 see by customizing the options @code{mh-tool-bar-folder-buttons} and
6463 @code{mh-tool-bar-letter-buttons}. As you probably guessed, the former
6464 customizes the tool bar in MH-Folder mode and the latter in MH-Letter
6465 mode. Both of these options present you with a list of functions;
6466 check the functions whose icons you want to see and clear the check
6467 boxes for those you don't.
6469 @findex mh-search
6470 @vindex mh-tool-bar-search-function
6472 The function associated with the searching icon can be set via the
6473 option @code{mh-tool-bar-search-function}. By default, this is set to
6474 @code{mh-search}. @xref{Searching}. You can also choose @samp{Other
6475 Function} from the @samp{Value Menu} and enter a function of your own
6476 choosing.
6478 @vindex mh-xemacs-use-tool-bar-flag
6480 XEmacs provides a couple of extra options. The first,
6481 @code{mh-xemacs-use-tool-bar-flag}, controls whether to show the MH-E
6482 icons at all. By default, this option is turned on if the window
6483 system supports tool bars. If your system doesn't support tool bars,
6484 then you won't be able to turn on this option.
6486 @vindex mh-xemacs-tool-bar-position
6488 The second extra option is @code{mh-xemacs-tool-bar-position} which
6489 controls the placement of the tool bar along the four edges of the
6490 frame. You can choose from one of @samp{Same As Default Tool Bar},
6491 @samp{Top}, @samp{Bottom}, @samp{Left}, or @samp{Right}. If this
6492 variable is set to anything other than @samp{Same As Default Tool Bar}
6493 and the default tool bar is in a different location, then two tool
6494 bars will be displayed: the MH-E tool bar and the default tool bar.
6496 @node Searching, Threading, Tool Bar, Top
6497 @chapter Searching Through Messages
6499 @cindex @samp{Search} menu
6500 @cindex menu, @samp{Search}
6501 @cindex searching
6502 @findex mh-search
6503 @kindex F s
6505 Earlier, the command @kbd{F s} (@code{mh-search}) was introduced which
6506 helps you find messages that lie buried in your folders
6507 (@pxref{Folders}). This chapter covers this command in more detail.
6508 Several commands are used to compose the search criteria and to start
6509 searching. A couple of them can be found in the @samp{Search} menu.
6511 @table @kbd
6512 @kindex C-c ?
6513 @findex mh-help
6514 @item C-c ?
6515 Display cheat sheet for the MH-E commands (@code{mh-help}).
6516 @c -------------------------
6517 @cindex @samp{Search > Perform Search} menu item
6518 @cindex menu item, @samp{Search > Perform Search}
6519 @kindex C-c C-c
6520 @findex mh-index-do-search
6521 @item C-c C-c
6522 Find messages using @code{mh-search-program}
6523 (@code{mh-index-do-search}).
6524 @c -------------------------
6525 @cindex @samp{Search > Search with pick} menu item
6526 @cindex menu item, @samp{Search > Search with pick}
6527 @kindex C-c C-p
6528 @findex mh-pick-do-search
6529 @item C-c C-p
6530 Find messages using @command{pick} (@code{mh-pick-do-search}).
6531 @c -------------------------
6532 @kindex C-c ?
6533 @findex mh-help
6534 @item C-c ?
6535 Display cheat sheet for the MH-E commands (@code{mh-help}).
6536 @c -------------------------
6537 @kindex C-c C-f C-a
6538 @kindex C-c C-f a
6539 @findex mh-to-field
6540 @item C-c C-f a
6541 @itemx C-c C-f C-a
6542 Move to @samp{Mail-Reply-To:} header field (@code{mh-to-field}).
6543 @c -------------------------
6544 @kindex C-c C-f C-b
6545 @kindex C-c C-f b
6546 @item C-c C-f b
6547 @itemx C-c C-f C-b
6548 Move to @samp{Bcc:} header field (@code{mh-to-field}).
6549 @c -------------------------
6550 @kindex C-c C-f C-c
6551 @kindex C-c C-f c
6552 @item C-c C-f c
6553 @itemx C-c C-f C-c
6554 Move to @samp{Cc:} header field (@code{mh-to-field}).
6555 @c -------------------------
6556 @kindex C-c C-f C-d
6557 @kindex C-c C-f d
6558 @item C-c C-f d
6559 @itemx C-c C-f C-d
6560 Move to @samp{Dcc:} header field (@code{mh-to-field}).
6561 @c -------------------------
6562 @kindex C-c C-f C-f
6563 @kindex C-c C-f f
6564 @item C-c C-f f
6565 @itemx C-c C-f C-f
6566 Move to @samp{Fcc:} header field (@code{mh-to-field}).
6567 @c -------------------------
6568 @kindex C-c C-f C-l
6569 @kindex C-c C-f l
6570 @item C-c C-f l
6571 @itemx C-c C-f C-l
6572 Move to @samp{Mail-Followup-To:} header field (@code{mh-to-field}).
6573 @c -------------------------
6574 @kindex C-c C-f C-m
6575 @kindex C-c C-f m
6576 @item C-c C-f m
6577 @itemx C-c C-f C-m
6578 Move to @samp{From:} header field (@code{mh-to-field}).
6579 @c -------------------------
6580 @kindex C-c C-f C-r
6581 @kindex C-c C-f r
6582 @item C-c C-f r
6583 @itemx C-c C-f C-r
6584 Move to @samp{Reply-To:} header field (@code{mh-to-field}).
6585 @c -------------------------
6586 @kindex C-c C-f C-s
6587 @kindex C-c C-f s
6588 @item C-c C-f s
6589 @itemx C-c C-f C-s
6590 Move to @samp{Subject:} header field (@code{mh-to-field}).
6591 @c -------------------------
6592 @kindex C-c C-f C-t
6593 @kindex C-c C-f t
6594 @item C-c C-f t
6595 @itemx C-c C-f C-t
6596 Move to @samp{To:} header field (@code{mh-to-field}).
6597 @end table
6599 Another few commands are available in the MH-Folder buffer resulting
6600 from a search.
6602 @table @kbd
6603 @kindex @key{TAB}
6604 @findex mh-index-next-folder
6605 @item @key{TAB}
6606 Jump to the next folder marker (@code{mh-index-next-folder}).
6607 @c -------------------------
6608 @kindex S-@key{TAB}
6609 @findex mh-index-previous-folder
6610 @item S-@key{TAB}
6611 Jump to the previous folder marker (@code{mh-index-previous-folder}).
6612 @c -------------------------
6613 @kindex v
6614 @findex mh-index-visit-folder
6615 @item v
6616 Visit original folder from where the message at point was found
6617 (@code{mh-index-visit-folder}).
6618 @end table
6620 @cindex @samp{mh-search} customization group
6621 @cindex customization group, @samp{mh-search}
6623 There is one option from the @samp{mh-search} customization group used
6624 in searching.
6626 @vtable @code
6627 @item mh-search-program
6628 Search program that MH-E shall use (default: @samp{Auto-detect}).
6629 @end vtable
6631 The following hook is available.
6633 @vtable @code
6634 @item mh-search-mode-hook
6635 Hook run upon entry to @code{mh-search-mode} (default: @code{nil}).
6636 @end vtable
6638 The following face is available.
6640 @vtable @code
6641 @item mh-search-folder
6642 Folder heading face in MH-Folder buffers created by searches.
6643 @end vtable
6645 @findex mh-search-folder
6646 @kindex F s
6648 The command @kbd{F s} (@code{mh-search-folder}) helps you find
6649 messages in your entire corpus of mail. You can search for messages to
6650 or from a particular person or about a particular subject. In fact,
6651 you can also search for messages containing selected strings in any
6652 arbitrary header field or any string found within the messages.
6654 @cindex @command{pick}
6655 @cindex MH commands, @command{pick}
6657 Out of the box, MH-E uses @command{pick} to find messages. With a
6658 little extra effort, you can set an indexing program which rewards you
6659 with extremely quick results. The drawback is that sometimes the index
6660 does not contain the words you're looking for. You can still use
6661 @command{pick} in these situations.
6663 You are prompted for the folder to search. This can be @samp{all} to
6664 search all folders. Note that the search works recursively on the
6665 listed folder.
6667 @cindex MH-Search mode
6668 @cindex modes, MH-Search
6670 Next, an MH-Search buffer appears where you can enter search criteria.
6672 @cartouche
6673 @smallexample
6674 From:
6677 Date:
6678 Subject:
6679 --------
6689 --:**  search-pattern   All L7     (MH-Search)---------------------------
6690 Type C-c C-c to search messages, C-c C-p to use pick, C-c ? for help
6691 @end smallexample
6692 @end cartouche
6693 @i{Search window}
6695 @cindex @command{pick}
6696 @cindex MH commands, @command{pick}
6698 Edit this template by entering your search criteria in an appropriate
6699 header field that is already there, or create a new field yourself. If
6700 the string you're looking for could be anywhere in a message, then
6701 place the string underneath the row of dashes.
6703 As an example, let's say that we want to find messages from Ginnean
6704 about horseback riding in the Kosciusko National Park (Australia)
6705 during January, 1994. Normally we would start with a broad search and
6706 narrow it down if necessary to produce a manageable amount of data,
6707 but we'll cut to the chase and create a fairly restrictive set of
6708 criteria as follows:
6710 @smallexample
6711 @group
6712 From: ginnean
6715 Date: Jan 1994
6716 Subject:
6717 --------
6718 horse
6719 kosciusko
6720 @end group
6721 @end smallexample
6723 @findex mh-to-field
6724 @kindex C-c C-f C-t
6726 As with MH-Letter mode, MH-Search provides commands like @kbd{C-c C-f
6727 C-t} (@code{mh-to-field}) to help you fill in the blanks.
6728 @xref{Editing Message}.
6730 @kindex F s
6731 @vindex mh-search-mode-hook
6733 If you find that you do the same thing over and over when editing the
6734 search template, you may wish to bind some shortcuts to keys. This can
6735 be done with the variable @code{mh-search-mode-hook}, which is called
6736 when @kbd{F s} is run on a new pattern.
6738 @findex mh-index-do-search
6739 @findex mh-pick-do-search
6740 @kindex C-c C-c
6741 @kindex C-c C-p
6743 To perform the search, type @kbd{C-c C-c} (@code{mh-index-do-search}).
6744 Sometimes you're searching for text that is either not indexed, or
6745 hasn't been indexed yet. In this case you can override the default
6746 method with the pick method by running the command @kbd{C-c C-p}
6747 (@code{mh-pick-do-search}).
6749 @cindex folders, @samp{+mhe-index}
6750 @cindex @samp{+mhe-index}
6751 @findex mh-index-next-folder
6752 @findex mh-index-previous-folder
6753 @kindex @key{TAB}
6754 @kindex S-@key{TAB}
6755 @vindex mh-search-folder
6757 The messages that are found are put in a temporary sub-folder of
6758 @samp{+mhe-index} and are displayed in an MH-Folder buffer. This
6759 buffer is special because it displays messages from multiple folders;
6760 each set of messages from a given folder has a heading with the folder
6761 name. The appearance of the heading can be modified by customizing the
6762 face @code{mh-search-folder}. You can jump back and forth between the
6763 headings using the commands @kbd{@key{TAB}}
6764 (@code{mh-index-next-folder}) and @kbd{S-@key{TAB}}
6765 (@code{mh-index-previous-folder}).
6767 @findex mh-index-visit-folder
6768 @findex mh-rescan-folder
6769 @kindex F r
6770 @kindex v
6772 In addition, the command @kbd{v} (@code{mh-index-visit-folder}) can be
6773 used to visit the folder of the message at point. Initially, only the
6774 messages that matched the search criteria are displayed in the folder.
6775 While the temporary buffer has its own set of message numbers, the
6776 actual messages numbers are shown in the visited folder. Thus, the
6777 command @kbd{v} is useful to find the actual message number of an
6778 interesting message, or to view surrounding messages with the command
6779 @kbd{F r} @code{mh-rescan-folder}. @xref{Folders}.
6781 @findex mh-kill-folder
6782 @kindex F k
6784 Because this folder is temporary, you'll probably get in the habit of
6785 killing it when you're done with @kbd{F k} (@code{mh-kill-folder}).
6786 @xref{Folders}.
6788 @kindex F s
6790 You can regenerate the results by running @kbd{F s} with a prefix
6791 argument.
6793 @cindex @command{procmail}
6794 @cindex Unix commands, @command{procmail}
6795 @cindex @samp{X-MHE-Checksum:} header field
6796 @cindex header field, @samp{X-MHE-Checksum:}
6798 Note: This command uses an @samp{X-MHE-Checksum:} header field to
6799 cache the MD5 checksum of a message. This means that if an incoming
6800 message already contains an @samp{X-MHE-Checksum:} field, that message
6801 might not be found by this command. The following @command{procmail}
6802 recipe avoids this problem by renaming the existing header field:
6804 @smallexample
6805 @group
6806 :0 wf
6807 | formail -R "X-MHE-Checksum" "X-Old-MHE-Checksum"
6808 @end group
6809 @end smallexample
6811 @xref{Limits}, for an alternative interface to searching.
6813 @section Configuring Indexed Searches
6815 @cindex @command{grep}
6816 @cindex @command{mairix}
6817 @cindex @command{namazu}
6818 @cindex @command{pick}
6819 @cindex @command{swish++}
6820 @cindex @command{swish-e}
6821 @cindex Unix commands, @command{grep}
6822 @cindex Unix commands, @command{mairix}
6823 @cindex Unix commands, @command{namazu}
6824 @cindex Unix commands, @command{pick}
6825 @cindex Unix commands, @command{swish++}
6826 @cindex Unix commands, @command{swish-e}
6827 @findex mh-search
6828 @kindex F s
6829 @vindex mh-search-program
6831 The command @kbd{F s} (@code{mh-search}) runs the command defined by
6832 the option @code{mh-search-program}. The default value is
6833 @samp{Auto-detect} which means that MH-E will automatically choose one
6834 of @command{swish++}, @command{swish-e}, @command{mairix},
6835 @command{namazu}, @command{pick} and @command{grep} in that order. If,
6836 for example, you have both @command{swish++} and @command{mairix}
6837 installed and you want to use @command{mairix}, then you can set this
6838 option to @samp{mairix}.
6840 The following sub-sections describe how to set up the various indexing
6841 programs to use with MH-E.
6843 @subsection swish++
6845 @cindex @command{swish++}
6846 @cindex Unix commands, @command{swish++}
6848 In the examples below, replace @file{/home/user/Mail} with the path to
6849 your MH directory.
6851 First create the directory @file{/home/user/Mail/.swish++}. Then
6852 create the file @file{/home/user/Mail/.swish++/swish++.conf} with the
6853 following contents:
6855 @smallexample
6856 @group
6857 IncludeMeta         Bcc Cc Comments Content-Description From Keywords
6858 IncludeMeta         Newsgroups Resent-To Subject To
6859 IncludeMeta         Message-Id References In-Reply-To
6860 IncludeFile         Mail    *
6861 IndexFile           /home/user/Mail/.swish++/swish++.index
6862 @end group
6863 @end smallexample
6865 Use the following command line to generate the swish index. Run this
6866 daily from cron:
6868 @smallexample
6869 @group
6870 find /home/user/Mail -path /home/user/Mail/mhe-index -prune \
6871                      -o -path /home/user/Mail/.swish++ -prune \
6872                      -o -name "[0-9]*" -print \
6873     | index -c /home/user/Mail/.swish++/swish++.conf -
6874 @end group
6875 @end smallexample
6877 This command does not index the folders that hold the results of your
6878 searches in @samp{+mhe-index} since they tend to be ephemeral and the
6879 original messages are indexed anyway.
6881 @cindex @command{index}
6882 @cindex Unix commands, @command{index}
6883 @cindex @command{index++}
6884 @cindex Unix commands, @command{index++}
6886 On some systems (Debian GNU/Linux, for example), use @command{index++}
6887 instead of @command{index}.
6889 @subsection swish
6891 @cindex @command{swish-e}
6892 @cindex Unix commands, @command{swish-e}
6894 In the examples below, replace @file{/home/user/Mail} with the path to
6895 your MH directory.
6897 First create the directory @file{/home/user/Mail/.swish}. Then create
6898 the file @file{/home/user/Mail/.swish/config} with the following
6899 contents:
6901 @smallexample
6902 @group
6903 DefaultContents TXT*
6904 IndexDir /home/user/Mail
6905 IndexFile /home/user/Mail/.swish/index
6906 IndexName "Mail Index"
6907 IndexDescription "Mail Index"
6908 IndexPointer "http://nowhere"
6909 IndexAdmin "nobody"
6910 #MetaNames automatic
6911 IndexReport 3
6912 FollowSymLinks no
6913 UseStemming no
6914 IgnoreTotalWordCountWhenRanking yes
6915 WordCharacters abcdefghijklmnopqrstuvwxyz0123456789-
6916 BeginCharacters abcdefghijklmnopqrstuvwxyz
6917 EndCharacters abcdefghijklmnopqrstuvwxyz0123456789
6918 IgnoreLimit 50 1000
6919 IndexComments 0
6920 FileRules filename contains \D
6921 FileRules pathname contains /home/user/Mail/.swish
6922 FileRules pathname contains /home/user/Mail/mhe-index
6923 FileRules filename is index
6924 @end group
6925 @end smallexample
6927 This configuration does not index the folders that hold the results of
6928 your searches in @samp{+mhe-index} since they tend to be ephemeral and
6929 the original messages are indexed anyway.
6931 If there are any directories you would like to ignore, append lines
6932 like the following to @file{config}:
6934 @smallexample
6935 FileRules pathname contains /home/user/Mail/scripts
6936 @end smallexample
6938 @cindex @command{swish-e}
6939 @cindex Unix commands, @command{swish-e}
6941 Use the following command line to generate the swish index. Run this
6942 daily from cron:
6944 @smallexample
6945 swish-e -c /home/user/Mail/.swish/config
6946 @end smallexample
6948 @subsection mairix
6950 @cindex @command{mairix}
6951 @cindex Unix commands, @command{mairix}
6953 In the examples below, replace @file{~/Mail} with the path to your MH
6954 directory.
6956 First create the directory @file{~/Mail/.mairix}. Then create the file
6957 @file{~/Mail/.mairix/config} with the following contents:
6959 @smallexample
6960 @group
6961 base=~/Mail
6963 # List of folders that should be indexed. 3 dots at the end means there
6964 # are subfolders within the folder
6965 mh=archive...:inbox:drafts:news:sent:trash
6967 mformat=mh
6968 database=~/Mail/.mairix/database
6969 @end group
6970 @end smallexample
6972 Use the following command line to generate the mairix index. Run this daily
6973 from cron:
6975 @smallexample
6976 mairix -f ~/Mail/.mairix/config
6977 @end smallexample
6979 @subsection namazu
6981 @cindex @command{namazu}
6982 @cindex Unix commands, @command{namazu}
6984 In the examples below, replace @file{/home/user/Mail} with the path to
6985 your MH directory.
6987 First create the directory @file{/home/user/Mail/.namazu}. Then create
6988 the file @file{/home/user/Mail/.namazu/mknmzrc} with the following
6989 contents:
6991 @smallexample
6992 @group
6993 package conf;  # Don't remove this line!
6994 $ADDRESS = 'user@@localhost';
6995 $ALLOW_FILE = "[0-9]*";
6996 $EXCLUDE_PATH = "^/home/user/Mail/(mhe-index|spam)";
6997 @end group
6998 @end smallexample
7000 This configuration does not index the folders that hold the results of
7001 your searches in @samp{+mhe-index} since they tend to be ephemeral and
7002 the original messages are indexed anyway.
7004 Use the following command line to generate the namazu index. Run this
7005 daily from cron:
7007 @smallexample
7008 mknmz -f /home/user/Mail/.namazu/mknmzrc -O /home/user/Mail/.namazu \
7009       -q /home/user/Mail
7010 @end smallexample
7012 @subsection pick
7014 @cindex @command{pick}
7015 @cindex MH commands, @command{pick}
7017 This search method does not require any setup.
7019 Read @command{pick}(1) or the section
7020 @uref{@value{MH-BOOK-HOME}/finpic.html, Finding Messages with pick} in
7021 the MH book to find out more about how to enter the criteria.
7023 @subsection grep
7025 @cindex @command{grep}
7026 @cindex Unix commands, @command{grep}
7028 This search method does not require any setup.
7030 Unlike the other search methods, this method does not use the
7031 MH-Search buffer. Instead, you simply enter a regular expression in
7032 the minibuffer. For help in constructing regular expressions, see your
7033 man page for @command{grep}.
7035 @node Threading, Limits, Searching, Top
7036 @chapter Viewing Message Threads
7038 @cindex threading
7040 MH-E groups messages by @dfn{threads} which are messages that are part
7041 of the same discussion and usually all have the same @samp{Subject:}
7042 header field. Other ways to organize messages in a folder include
7043 limiting (@pxref{Limits}) or using full-text indexed searches
7044 (@pxref{Searching}).
7046 @cindex root, in threads
7047 @cindex siblings, in threads
7048 @cindex ancestor, in threads
7050 A thread begins with a single message called a @dfn{root}. All replies
7051 to the same message are @dfn{siblings} of each other. Any message that
7052 has replies to it is an @dfn{ancestor} of those replies.
7054 There are several commands that you can use to navigate and operate on
7055 threads.
7057 @table @kbd
7058 @kindex T ?
7059 @findex mh-prefix-help
7060 @item T ?
7061 Display cheat sheet for the commands of the current prefix in
7062 minibuffer (@code{mh-prefix-help}).
7063 @c -------------------------
7064 @kindex T o
7065 @findex mh-thread-refile
7066 @item T o
7067 Refile (output) thread into folder (@code{mh-thread-refile}).
7068 @c -------------------------
7069 @kindex T d
7070 @findex mh-thread-delete
7071 @item T d
7072 Delete thread (@code{mh-thread-delete}).
7073 @c -------------------------
7074 @kindex T t
7075 @findex mh-toggle-threads
7076 @item T t
7077 Toggle threaded view of folder (@code{mh-toggle-threads}).
7078 @c -------------------------
7079 @kindex T n
7080 @findex mh-thread-next-sibling
7081 @item T n
7082 Display next sibling (@code{mh-thread-next-sibling}).
7083 @c -------------------------
7084 @kindex T p
7085 @findex mh-thread-previous-sibling
7086 @item T p
7087 Display previous sibling (@code{mh-thread-previous-sibling}).
7088 @c -------------------------
7089 @kindex T u
7090 @findex mh-thread-ancestor
7091 @item T u
7092 Display ancestor of current message (@code{mh-thread-ancestor}).
7093 @end table
7095 @cindex @samp{mh-thread} customization group
7096 @cindex customization group, @samp{mh-thread}
7098 The @samp{mh-thread} customization group contains one option.
7100 @vtable @code
7101 @item mh-show-threads-flag
7102 On means new folders start in threaded mode (default: @samp{off}).
7103 @end vtable
7105 @findex mh-toggle-threads
7106 @kindex T t
7107 @vindex mh-large-folder
7108 @vindex mh-show-threads-flag
7110 Threading large number of messages can be time consuming so the option
7111 @code{mh-show-threads-flag} is turned off by default. If you turn on
7112 this option, then threading will be done only if the number of
7113 messages being threaded is less than @code{mh-large-folder}. In any
7114 event, threading can be turned on (and off) with the command @kbd{T t}
7115 (@code{mh-toggle-threads}).
7117 @findex mh-thread-ancestor
7118 @findex mh-thread-next-sibling
7119 @findex mh-thread-previous-sibling
7120 @kindex T n
7121 @kindex T p
7122 @kindex T u
7124 There are a few commands to help you navigate threads. If you do not
7125 care for the way a particular thread has turned, you can move up the
7126 chain of messages with the command @kbd{T u}
7127 (@code{mh-thread-ancestor}. At any point you can use @kbd{T n}
7128 (@code{mh-thread-next-sibling} or @kbd{T p}
7129 (@code{mh-thread-previous-sibling}) to jump to the next or previous
7130 sibling, skipping the sub-threads. The command @kbd{T u} can also take
7131 a prefix argument to jump to the message that started everything.
7133 @findex mh-delete-subject-or-thread
7134 @findex mh-thread-delete
7135 @findex mh-thread-refile
7136 @kindex k
7137 @kindex T d
7138 @kindex T o
7140 There are threaded equivalents for the commands that delete and refile
7141 messages. For example, @kbd{T o} (@code{mh-thread-refile}) refiles the
7142 current message and all its children. Similarly, the command @kbd{T d}
7143 (@code{mh-thread-delete}) deletes the current message and all its
7144 children. These commands do not refile or delete sibling messages.
7145 @xref{Navigating}, for a description of the similar command @kbd{k}
7146 (@code{mh-delete-subject-or-thread}).
7148 @vindex mh-large-folder
7150 If you find that threading is too slow, it may be that you have
7151 @code{mh-large-folder} set too high. Also, threading is one of the few
7152 features of MH-E that really benefits from compiling. If you haven't
7153 compiled MH-E, I encourage you to do so@footnote{If you're not sure if
7154 MH-E has been byte-compiled, you could try running @samp{locate
7155 mh-thread.elc} or otherwise find MH-E on your system and ensure that
7156 @file{mh-thread.elc} exists. If you have multiple versions and you
7157 find that one is compiled but the other is not, then go into your
7158 @samp{*scratch*} buffer in Emacs, enter @kbd{load-path C-j}, and
7159 ensure that the byte-compiled version appears first in the
7160 @code{load-path}. If you find that MH-E is not compiled and you
7161 installed MH-E yourself, please refer to the installation directions
7162 in the file @file{README} in the distribution.}.
7164 @node Limits, Sequences, Threading, Top
7165 @chapter Limiting Display
7167 @cindex limits
7168 @cindex filters
7170 Another way to organize messages in a folder besides threading
7171 (@pxref{Threading}) or using full-text indexed searches
7172 (@pxref{Searching}) is by limiting the folder display to messages that
7173 are similar to the current message.
7175 @table @kbd
7176 @kindex / ?
7177 @findex mh-prefix-help
7178 @item / ?
7179 Display cheat sheet for the commands of the current prefix in
7180 minibuffer (@code{mh-prefix-help}).
7181 @c -------------------------
7182 @cindex @samp{Sequence > Narrow to Tick Sequence} menu item
7183 @cindex menu item, @samp{Sequence > Narrow to Tick Sequence}
7184 @kindex / '
7185 @findex mh-narrow-to-tick
7186 @item / '
7187 Limit to messages in the @samp{tick} sequence
7188 (@code{mh-narrow-to-tick}).
7189 @c -------------------------
7190 @kindex / c
7191 @findex mh-narrow-to-cc
7192 @item / c
7193 Limit to messages with the same @samp{Cc:} field
7194 (@code{mh-narrow-to-cc}).
7195 @c -------------------------
7196 @kindex / m
7197 @findex mh-narrow-to-from
7198 @item / m
7199 Limit to messages with the same @samp{From:} field
7200 (@code{mh-narrow-to-from}).
7201 @c -------------------------
7202 @kindex / g
7203 @findex mh-narrow-to-range
7204 @item / g
7205 Limit to range (@code{mh-narrow-to-range}).
7206 @c -------------------------
7207 @cindex @samp{Sequence > Narrow to Subject Sequence} menu item
7208 @cindex menu item, @samp{Sequence > Narrow to Subject Sequence}
7209 @kindex / s
7210 @findex mh-narrow-to-subject
7211 @item / s
7212 Limit to messages with the same @samp{Subject:} field
7213 (@code{mh-narrow-to-subject}).
7214 @c -------------------------
7215 @kindex / t
7216 @findex mh-narrow-to-to
7217 @item / t
7218 Limit to messages with the same @samp{To:} field
7219 (@code{mh-narrow-to-to}).
7220 @c -------------------------
7221 @cindex @samp{Sequence > Widen from Sequence} menu item
7222 @cindex menu item, @samp{Sequence > Widen from Sequence}
7223 @kindex / w
7224 @findex mh-widen
7225 @item / w
7226 Remove last restriction (@code{mh-widen}).
7227 @end table
7229 All of the limiting commands above refine the display in some way.
7231 @cindex @command{pick}
7232 @cindex MH commands, @command{pick}
7233 @findex mh-narrow-to-cc
7234 @findex mh-narrow-to-from
7235 @findex mh-narrow-to-subject
7236 @findex mh-narrow-to-to
7237 @kindex / c
7238 @kindex / m
7239 @kindex / s
7240 @kindex / t
7242 The commands @kbd{/ c} (@code{mh-narrow-to-cc}), @kbd{/ m}
7243 (@code{mh-narrow-to-from}), @kbd{/ s} (@code{mh-narrow-to-subject}),
7244 and @kbd{/ t} (@code{mh-narrow-to-to}) restrict the display to
7245 messages matching the content of the respective field in the current
7246 message. However, you can give any of these a prefix argument to edit
7247 the @command{pick} expression used to narrow the view@footnote{See
7248 @command{pick}(1) or the section
7249 @uref{@value{MH-BOOK-HOME}/finpic.html, Finding Messages with pick} in
7250 the MH book.}.
7252 @cindex @samp{tick} sequence
7253 @cindex sequence, @samp{tick}
7254 @cindex ticked messages, viewing
7255 @findex mh-narrow-to-range
7256 @findex mh-narrow-to-tick
7257 @kindex / '
7258 @kindex / g
7260 You can also limit the display to messages in the @samp{tick} sequence
7261 with the command @kbd{/ '} (@code{mh-narrow-to-tick}).
7262 @xref{Sequences}, for information on putting message into the
7263 @samp{tick} sequence. Use the @kbd{/ g} (@code{mh-narrow-to-range})
7264 command to limit the display to messages in a range (@pxref{Ranges}).
7266 @findex mh-widen
7267 @kindex / w
7269 Each limit can be undone in turn with the @kbd{/ w} (@code{mh-widen})
7270 command. Give this command a prefix argument to remove all limits.
7272 @node Sequences, Junk, Limits, Top
7273 @chapter Using Sequences
7275 @cindex @samp{Sequence} menu
7276 @cindex menu, @samp{Sequence}
7277 @cindex sequences
7279 For the whole scoop on MH sequences, refer to
7280 @samp{mh-sequence}(5)@footnote{See the section
7281 @uref{@value{MH-BOOK-HOME}/morseq.html, More About Sequences} in the MH
7282 book.}. As you've read, several of the MH-E commands can operate on a
7283 sequence, which is a shorthand for a range or group of messages. For
7284 example, you might want to forward several messages to a friend or
7285 colleague. Here's how to manipulate sequences. These commands are also
7286 available in the @samp{Sequence} menu.
7288 @table @kbd
7289 @cindex @samp{Sequence > Toggle Tick Mark} menu item
7290 @cindex menu item, @samp{Sequence > Toggle Tick Mark}
7291 @kindex '
7292 @findex mh-toggle-tick
7293 @item '
7294 Toggle tick mark of range (@code{mh-toggle-tick}).
7295 @c -------------------------
7296 @kindex S ?
7297 @findex mh-prefix-help
7298 @item S ?
7299 Display cheat sheet for the commands of the current prefix in
7300 minibuffer (@code{mh-prefix-help}).
7301 @c -------------------------
7302 @cindex @samp{Sequence > Narrow to Tick Sequence} menu item
7303 @cindex menu item, @samp{Sequence > Narrow to Tick Sequence}
7304 @kindex S '
7305 @findex mh-narrow-to-tick
7306 @item S '
7307 Limit to ticked messages (@code{mh-narrow-to-tick}).
7308 @c -------------------------
7309 @cindex @samp{Sequence > Delete Message from Sequence...} menu item
7310 @cindex menu item, @samp{Sequence > Delete Message from Sequence...}
7311 @kindex S d
7312 @findex mh-delete-msg-from-seq
7313 @item S d
7314 Delete range from sequence (@code{mh-delete-msg-from-seq}).
7315 @c -------------------------
7316 @cindex @samp{Sequence > Delete Sequence...} menu item
7317 @cindex menu item, @samp{Sequence > Delete Sequence...}
7318 @kindex S k
7319 @findex mh-delete-seq
7320 @item S k
7321 Delete sequence (@code{mh-delete-seq}).
7322 @c -------------------------
7323 @cindex @samp{Sequence > List Sequences in Folder...} menu item
7324 @cindex menu item, @samp{Sequence > List Sequences in Folder...}
7325 @kindex S l
7326 @findex mh-list-sequences
7327 @item S l
7328 List all sequences in folder (@code{mh-list-sequences}).
7329 @c -------------------------
7330 @cindex @samp{Sequence > Narrow to Sequence...} menu item
7331 @cindex menu item, @samp{Sequence > Narrow to Sequence...}
7332 @kindex S n
7333 @findex mh-narrow-to-seq
7334 @item S n
7335 Restrict display to messages in sequence (@code{mh-narrow-to-seq}).
7336 @c -------------------------
7337 @cindex @samp{Sequence > Add Message to Sequence...} menu item
7338 @cindex menu item, @samp{Sequence > Add Message to Sequence...}
7339 @kindex S p
7340 @findex mh-put-msg-in-seq
7341 @item S p
7342 Add range to sequence (@code{mh-put-msg-in-seq}).
7343 @c -------------------------
7344 @cindex @samp{Sequence > List Sequences for Message} menu item
7345 @cindex menu item, @samp{Sequence > List Sequences for Message}
7346 @kindex S s
7347 @findex mh-msg-is-in-seq
7348 @item S s
7349 Display the sequences in which the current message appears
7350 (@code{mh-msg-is-in-seq}).
7351 @c -------------------------
7352 @cindex @samp{Sequence > Widen from Sequence} menu item
7353 @cindex menu item, @samp{Sequence > Widen from Sequence}
7354 @kindex S w
7355 @findex mh-widen
7356 @item S w
7357 Remove last restriction (@code{mh-widen}).
7358 @c -------------------------
7359 @findex mh-update-sequences
7360 @item M-x mh-update-sequences
7361 Flush MH-E's state out to MH@.
7362 @end table
7364 @cindex @samp{mh-sequences} customization group
7365 @cindex customization group, @samp{mh-sequences}
7367 The @samp{mh-sequences} customization group contains the options
7368 associated with sequences.
7370 @vtable @code
7371 @item mh-refile-preserves-sequences-flag
7372 On means that sequences are preserved when messages are refiled
7373 (default: @samp{on}).
7374 @c -------------------------
7375 @item mh-tick-seq
7376 The name of the MH sequence for ticked messages (default: @samp{'tick}).
7377 @c -------------------------
7378 @item mh-update-sequences-after-mh-show-flag
7379 On means flush MH sequences to disk after message is shown (default:
7380 @samp{on}).
7381 @item mh-whitelist-preserves-sequences-flag
7382 On means that sequences are preserved when messages are whitelisted
7383 (default: @samp{on}).
7384 @end vtable
7386 The following hook is available.
7388 @vtable @code
7389 @item mh-unseen-updated-hook
7390 Hook run after the unseen sequence has been updated (default: @code{nil}).
7391 @end vtable
7393 @cindex @command{pick}
7394 @cindex MH commands, @command{pick}
7395 @findex mh-put-msg-in-seq
7396 @kindex S p
7398 To place a message in a sequence, use @kbd{S p}
7399 (@code{mh-put-msg-in-seq}). Give @kbd{S p} a range and you can add all
7400 the messages in a sequence to another sequence (for example, @kbd{C-u
7401 S p SourceSequence @key{RET} DestSequence @key{RET}}, @pxref{Ranges}).
7403 @cindex @samp{tick} sequence
7404 @cindex sequence, @samp{tick}
7405 @cindex ticking messages
7406 @findex mh-index-ticked-messages
7407 @findex mh-toggle-tick
7408 @kindex '
7409 @kindex F '
7410 @kindex S p
7412 One specific use of the @kbd{S p} command is @kbd{'}
7413 (@code{mh-toggle-tick}) which adds messages to the @samp{tick}
7414 sequence. This sequence can be viewed later with the @kbd{F '}
7415 (@code{mh-index-ticked-messages}) command (@pxref{Folders}).
7417 @vindex mh-tick-seq
7419 You can customize the option @code{mh-tick-seq} if you already use the
7420 @samp{tick} sequence for your own use. You can also disable all of the
7421 ticking functions by choosing the @samp{Disable Ticking} item but
7422 there isn't much advantage to that.
7424 @cindex MH-Folder mode
7425 @cindex modes, MH-Folder
7426 @findex mh-narrow-to-seq
7427 @findex mh-narrow-to-tick
7428 @findex mh-widen
7429 @kindex S '
7430 @kindex S n
7431 @kindex S w
7433 Once you've placed some messages in a sequence, you may wish to narrow
7434 the field of view to just those messages in the sequence you've
7435 created. To do this, use @kbd{S n} (@code{mh-narrow-to-seq}). You are
7436 prompted for the name of the sequence. What this does is show only
7437 those messages that are in the selected sequence in the MH-Folder
7438 buffer. In addition, it limits further MH-E searches to just those
7439 messages. To narrow the view to the messages in the @samp{tick}
7440 sequence, use @kbd{S '} (@code{mh-narrow-to-tick}). When you want to
7441 widen the view to all your messages again, use @kbd{S w}
7442 (@code{mh-widen}).
7444 @cindex buffers, @samp{*MH-E Sequences*}
7445 @cindex @samp{*MH-E Sequences*}
7446 @findex mh-list-sequences
7447 @findex mh-msg-is-in-seq
7448 @kindex S l
7449 @kindex S s
7451 You can see which sequences in which a message appears with the
7452 command @kbd{S s} (@code{mh-msg-is-in-seq}). Use a prefix argument to
7453 display the sequences in which another message appears (as in @kbd{C-u
7454 42 S s @key{RET}}). Or, you can list all sequences in a selected
7455 folder (default is current folder) with @kbd{S l}
7456 (@code{mh-list-sequences}). The list appears in a buffer named
7457 @samp{*MH-E Sequences*} (@pxref{Miscellaneous}).
7459 @cindex MH profile component, @samp{Previous-Sequence:}
7460 @cindex @samp{cur} sequence
7461 @cindex @samp{Previous-Sequence:} MH profile component
7462 @cindex sequence, @samp{cur}
7463 @cindex sequence, @samp{Previous-Sequence}
7464 @vindex mh-refile-preserves-sequences-flag
7466 If a message is in any sequence (except
7467 @samp{Previous-Sequence:}@footnote{See @samp{mh-profile}(5)).} and
7468 @samp{cur}) when it is refiled, then it will still be in those
7469 sequences in the destination folder. If this behavior is not desired,
7470 then turn off the option @code{mh-refile-preserves-sequences-flag}.
7472 @findex mh-delete-msg-from-seq
7473 @findex mh-delete-seq
7474 @kindex d
7475 @kindex S d
7476 @kindex S k
7478 If you want to remove a message (or range, @pxref{Ranges}) from a
7479 sequence, use @kbd{S d} (@code{mh-delete-msg-from-seq}). If you want
7480 to delete an entire sequence, use @kbd{S k} (@code{mh-delete-seq}). In
7481 the latter case you are prompted for the sequence to delete. Note that
7482 this deletes only the sequence, not the messages in the sequence. If
7483 you want to delete the messages, use @kbd{C-u d} (@pxref{Reading
7484 Mail}).
7486 @cindex @samp{Unseen-Sequence:} MH profile component
7487 @cindex @samp{cur} sequence
7488 @cindex @samp{tick} sequence
7489 @cindex MH profile component, @samp{Unseen-Sequence:}
7490 @cindex sequence, @samp{Unseen-Sequence}
7491 @cindex sequence, @samp{cur}
7492 @cindex sequence, @samp{tick}
7493 @findex mh-update-sequences
7494 @kindex M-x mh-update-sequences
7495 @kindex q
7496 @kindex x
7497 @vindex mh-tick-seq
7498 @vindex mh-update-sequences-after-mh-show-flag
7500 Three sequences are maintained internally by MH-E and pushed out to MH
7501 when a message is shown. They include the sequence specified by your
7502 @samp{Unseen-Sequence:} profile component, @samp{cur}, and the
7503 sequence listed by the option @code{mh-tick-seq} which is @samp{tick}
7504 by default. If you do not like this behavior, turn off the option
7505 @code{mh-update-sequences-after-mh-show-flag}. You can then update the
7506 state manually with the @kbd{x}, @kbd{q}, or @kbd{M-x
7507 mh-update-sequences} commands.
7509 @vindex mh-seen-list
7510 @vindex mh-unseen-updated-hook
7512 The hook @code{mh-unseen-updated-hook} is run after the unseen
7513 sequence has been updated. The variable @code{mh-seen-list} can be
7514 used by this hook to obtain the list of messages which were removed
7515 from the unseen sequence.
7517 @cindex @command{mark}
7518 @cindex MH commands, @command{mark}
7519 @kindex S n
7520 @kindex S w
7522 With the exceptions of @kbd{S n} and @kbd{S w}, the underlying MH
7523 command dealing with sequences is @command{mark}@footnote{See the
7524 section @uref{@value{MH-BOOK-HOME}/mmbwm.html, Make Message Bookmarks
7525 with mark} in the MH book.}.
7527 @node Junk, Miscellaneous, Sequences, Top
7528 @chapter Dealing With Junk Mail
7530 @cindex Marshall Rose
7531 @cindex junk mail
7532 @cindex spam
7534 Marshall Rose once wrote a paper on MH entitled, @cite{How to process
7535 200 messages a day and still get some real work done}. This chapter
7536 could be entitled, @cite{How to process 1000 spams a day and still get
7537 some real work done}.
7539 @cindex blacklisting
7540 @cindex ham
7541 @cindex viruses
7542 @cindex whitelisting
7543 @cindex worms
7545 We use the terms @dfn{junk mail} and @dfn{spam} interchangeably for
7546 any unwanted message which includes spam, @dfn{viruses}, and
7547 @dfn{worms}. The opposite of spam is @dfn{ham}. The act of classifying
7548 a sender as one who sends junk mail is called @dfn{blacklisting}; the
7549 opposite is called @dfn{whitelisting}.
7551 @table @kbd
7552 @kindex J ?
7553 @findex mh-prefix-help
7554 @item J ?
7555 Display cheat sheet for the commands of the current prefix in
7556 minibuffer (@code{mh-prefix-help}).
7557 @c -------------------------
7558 @kindex J b
7559 @findex mh-junk-blacklist
7560 @item J b
7561 Blacklist range as spam (@code{mh-junk-blacklist}).
7562 @c -------------------------
7563 @kindex J w
7564 @findex mh-junk-whitelist
7565 @item J w
7566 Whitelist range as ham (@code{mh-junk-whitelist}).
7567 @c -------------------------
7568 @item @code{mh-spamassassin-identify-spammers}
7569 Identify spammers who are repeat offenders.
7570 @end table
7572 @cindex @samp{mh-junk} customization group
7573 @cindex customization group, @samp{mh-junk}
7575 The following table lists the options from the @samp{mh-junk}
7576 customization group.
7578 @vtable @code
7579 @item mh-junk-background
7580 If on, spam programs are run in background (default: @samp{off}).
7581 @c -------------------------
7582 @item mh-junk-disposition
7583 Disposition of junk mail (default: @samp{Delete Spam}).
7584 @c -------------------------
7585 @item mh-junk-program
7586 Spam program that MH-E should use (default: @samp{Auto-detect}).
7587 @end vtable
7589 @cindex @samp{mh-sequences} customization group
7590 @cindex customization group, @samp{mh-sequences}
7592 The following option in the @samp{mh-sequences} customization group is
7593 also available.
7595 @vtable @code
7596 @item mh-whitelist-preserves-sequences-flag
7597 On means that sequences are preserved when messages are whitelisted
7598 (default: @samp{on}).
7599 @end vtable
7601 The following hooks are available.
7603 @vtable @code
7604 @item mh-blacklist-msg-hook
7605 Hook run by @kbd{J b} (@code{mh-junk-blacklist}) after marking each
7606 message for blacklisting (default: @code{nil}).
7607 @c -------------------------
7608 @item mh-whitelist-msg-hook
7609 Hook run by @kbd{J w} (@code{mh-junk-whitelist}) after marking each
7610 message for whitelisting (default @samp{nil}).
7611 @end vtable
7613 The following faces are available.
7615 @vtable @code
7616 @item mh-folder-blacklisted
7617 Blacklisted message face.
7618 @c -------------------------
7619 @item mh-folder-whitelisted
7620 Whitelisted message face
7621 @end vtable
7623 @cindex SpamProbe
7624 @cindex Spamassassin
7625 @cindex bogofilter
7626 @cindex spam filters, SpamProbe
7627 @cindex spam filters, Spamassassin
7628 @cindex spam filters, bogofilter
7630 MH-E depends on @uref{http://spamassassin.apache.org/, SpamAssassin},
7631 @uref{http://bogofilter.sourceforge.net/, bogofilter}, or
7632 @uref{http://spamprobe.sourceforge.net/, SpamProbe} to throw the dreck
7633 away. This chapter describes briefly how to configure these programs
7634 to work well with MH-E and how to use MH-E's interface that provides
7635 continuing education for these programs.
7637 @vindex mh-junk-program
7639 The default setting of the option @code{mh-junk-program} is
7640 @samp{Auto-detect} which means that MH-E will automatically choose one
7641 of SpamAssassin, bogofilter, or SpamProbe in that order. If, for
7642 example, you have both SpamAssassin and bogofilter installed and you
7643 want to use bogofilter, then you can set this option to
7644 @samp{Bogofilter}.
7646 @findex mh-junk-blacklist
7647 @kindex J b
7648 @vindex mh-junk-disposition
7650 The command @kbd{J b} (@code{mh-junk-blacklist}) trains the spam
7651 program in use with the content of the range (@pxref{Ranges}) and then
7652 handles the message(s) as specified by the option
7653 @code{mh-junk-disposition}. By default, this option is set to
7654 @samp{Delete Spam} but you can also specify the name of the folder
7655 which is useful for building a corpus of spam for training purposes.
7657 @findex mh-junk-whitelist
7658 @kindex J w
7660 In contrast, the command @kbd{J w} (@code{mh-junk-whitelist})
7661 reclassifies a range of messages (@pxref{Ranges}) as ham if it were
7662 incorrectly classified as spam. It then refiles the message into the
7663 @file{+inbox} folder.
7665 @cindex MH profile component, @samp{Previous-Sequence:}
7666 @cindex @samp{cur} sequence
7667 @cindex @samp{Previous-Sequence:} MH profile component
7668 @cindex sequence, @samp{cur}
7669 @cindex sequence, @samp{Previous-Sequence}
7670 @vindex mh-whitelist-preserves-sequences-flag
7672 If a message is in any sequence (except @samp{Previous-Sequence:} and
7673 @samp{cur}) when it is whitelisted, then it will still be in those
7674 sequences in the destination folder. If this behavior is not desired,
7675 then turn off the option @code{mh-whitelist-preserves-sequences-flag}.
7677 @cindex @samp{*MH-E Log*}
7678 @cindex buffers, @samp{*MH-E Log*}
7679 @findex call-process
7680 @vindex mh-junk-background
7682 By default, the programs are run in the foreground, but this can be
7683 slow when junking large numbers of messages. If you have enough memory
7684 or don't junk that many messages at the same time, you might try
7685 turning on the option @code{mh-junk-background}. @footnote{Note that
7686 the option @code{mh-junk-background} is used as the @code{display}
7687 argument in the call to @code{call-process}. Therefore, turning on
7688 this option means setting its value to @samp{0}. You can also set its
7689 value to @samp{t} to direct the programs' output to the @samp{*MH-E
7690 Log*} buffer; this may be useful for debugging.}
7692 The following sections discuss the various counter-spam measures that
7693 MH-E can work with.
7695 @cindex @file{.procmailrc}
7696 @cindex files, @file{.procmailrc}
7698 @subheading SpamAssassin
7700 @cindex Spamassassin
7701 @cindex spam filters, Spamassassin
7703 SpamAssassin is one of the more popular spam filtering programs. Get
7704 it from your local distribution or from the
7705 @uref{http://spamassassin.apache.org/, SpamAssassin web site}.
7707 To use SpamAssassin, add the following recipes to @file{~/.procmailrc}:
7709 @cindex @command{spamc}
7710 @cindex @samp{X-Spam-Level:} header field
7711 @cindex @samp{X-Spam-Status:} header field
7712 @cindex header field, @samp{X-Spam-Level:}
7713 @cindex header field, @samp{X-Spam-Status:}
7715 @smallexample
7716 PATH=$PATH:/usr/bin/mh
7717 MAILDIR=$HOME/`mhparam Path`
7719 # Fight spam with SpamAssassin.
7720 :0fw
7721 | spamc
7723 # Anything with a spam level of 10 or more is junked immediately.
7725 * ^X-Spam-Level: ..........
7726 /dev/null
7729 * ^X-Spam-Status: Yes
7730 spam/.
7731 @end smallexample
7733 If you don't use @command{spamc}, use @samp{spamassassin -P -a}.
7735 Note that one of the recipes above throws away messages with a score
7736 greater than or equal to 10. Here's how you can determine a value that
7737 works best for you.
7739 First, run @samp{spamassassin -t} on every mail message in your
7740 archive and use @command{gnumeric} to verify that the average plus the
7741 standard deviation of good mail is under 5, the SpamAssassin default
7742 for ``spam''.
7744 Using @command{gnumeric}, sort the messages by score and view the
7745 messages with the highest score. Determine the score which encompasses
7746 all of your interesting messages and add a couple of points to be
7747 conservative. Add that many dots to the @samp{X-Spam-Level:} header
7748 field above to send messages with that score down the drain.
7750 In the example above, messages with a score of 5--9 are set aside in
7751 the @samp{+spam} folder for later review. The major weakness of
7752 rules-based filters is a plethora of false positives so it is
7753 worthwhile to check.
7755 @findex mh-junk-blacklist
7756 @findex mh-junk-whitelist
7757 @kindex J b
7758 @kindex J w
7760 If SpamAssassin classifies a message incorrectly, or is unsure, you can
7761 use the MH-E commands @kbd{J b} (@code{mh-junk-blacklist}) and
7762 @kbd{J w} (@code{mh-junk-whitelist}).
7764 @cindex @command{sa-learn}
7765 @cindex @file{.spamassassin/user_prefs}
7766 @cindex files, @file{.spamassassin/user_prefs}
7768 The command @kbd{J b} (@code{mh-junk-blacklist}) adds a
7769 @samp{blacklist_from} entry to @file{~/spamassassin/user_prefs},
7770 deletes the message, and sends the message to the Razor, so that
7771 others might not see this spam. If the @command{sa-learn} command is
7772 available, the message is also recategorized as spam.
7774 The command@kbd{J w} (@code{mh-junk-whitelist}) adds a
7775 @samp{whitelist_from} rule to @samp{~/.spamassassin/user_prefs}. If
7776 the @command{sa-learn} command is available, the message is also
7777 recategorized as ham.
7779 Over time, you'll observe that the same host or domain occurs
7780 repeatedly in the @samp{blacklist_from} entries, so you might think
7781 that you could avoid future spam by blacklisting all mail from a
7782 particular domain. The utility function
7783 @code{mh-spamassassin-identify-spammers} helps you do precisely that.
7784 This function displays a frequency count of the hosts and domains in
7785 the @samp{blacklist_from} entries from the last blank line in
7786 @file{~/.spamassassin/user_prefs} to the end of the file. This
7787 information can be used so that you can replace multiple
7788 @samp{blacklist_from} entries with a single wildcard entry such as:
7790 @smallexample
7791 blacklist_from *@@*amazingoffersdirect2u.com
7792 @end smallexample
7794 In versions of SpamAssassin (2.50 and on) that support a Bayesian
7795 classifier, @kbd{J b} @code{(mh-junk-blacklist}) uses the program
7796 @command{sa-learn} to recategorize the message as spam. Neither MH-E,
7797 nor SpamAssassin, rebuilds the database after adding words, so you
7798 will need to run @samp{sa-learn --rebuild} periodically. This can be
7799 done by adding the following to your @file{crontab}:
7801 @smallexample
7802 0 * * * *       sa-learn --rebuild > /dev/null 2>&1
7803 @end smallexample
7805 @subheading Bogofilter
7807 @cindex bogofilter
7808 @cindex spam filters, bogofilter
7810 Bogofilter is a Bayesian spam filtering program. Get it from your
7811 local distribution or from the
7812 @uref{http://bogofilter.sourceforge.net/, bogofilter web site}.
7814 Bogofilter is taught by running:
7816 @smallexample
7817 bogofilter -n < good-message
7818 @end smallexample
7820 on every good message, and
7822 @smallexample
7823 bogofilter -s < spam-message
7824 @end smallexample
7826 @cindex full training
7828 on every spam message. This is called a @dfn{full training}; three
7829 other training methods are described in the FAQ that is distributed
7830 with bogofilter. Note that most Bayesian filters need 1000 to 5000 of
7831 each type of message to start doing a good job.
7833 To use bogofilter, add the following recipes to @file{~/.procmailrc}:
7835 @cindex @samp{X-Bogosity:} header field
7836 @cindex header field, @samp{X-Bogosity:}
7838 @smallexample
7839 PATH=$PATH:/usr/bin/mh
7840 MAILDIR=$HOME/`mhparam Path`
7842 # Fight spam with Bogofilter.
7843 :0fw
7844 | bogofilter -3 -e -p
7847 * ^X-Bogosity: Yes, tests=bogofilter
7848 spam/.
7851 * ^X-Bogosity: Unsure, tests=bogofilter
7852 spam/unsure/.
7853 @end smallexample
7855 @findex mh-junk-blacklist
7856 @findex mh-junk-whitelist
7857 @kindex J b
7858 @kindex J w
7860 If bogofilter classifies a message incorrectly, or is unsure, you can
7861 use the MH-E commands @kbd{J b} (@code{mh-junk-blacklist}) and @kbd{J
7862 w} (@code{mh-junk-whitelist}) to update bogofilter's training.
7864 The @cite{Bogofilter FAQ} suggests that you run the following
7865 occasionally to shrink the database:
7867 @smallexample
7868 bogoutil -d wordlist.db | bogoutil -l wordlist.db.new
7869 mv wordlist.db wordlist.db.prv
7870 mv wordlist.db.new wordlist.db
7871 @end smallexample
7873 The @cite{Bogofilter tuning HOWTO} describes how you can fine-tune
7874 bogofilter.
7876 @subheading SpamProbe
7878 @cindex SpamProbe
7879 @cindex spam filters, SpamProbe
7881 SpamProbe is a Bayesian spam filtering program. Get it from your local
7882 distribution or from the @uref{http://spamprobe.sourceforge.net,
7883 SpamProbe web site}.
7885 To use SpamProbe, add the following recipes to @file{~/.procmailrc}:
7887 @cindex @command{formail}
7888 @cindex @samp{X-SpamProbe:} header field
7889 @cindex header field, @samp{X-SpamProbe:}
7891 @smallexample
7892 PATH=$PATH:/usr/bin/mh
7893 MAILDIR=$HOME/`mhparam Path`
7895 # Fight spam with SpamProbe.
7897 SCORE=| spamprobe receive
7899 :0 wf
7900 | formail -I "X-SpamProbe: $SCORE"
7903 *^X-SpamProbe: SPAM
7904 spam/.
7905 @end smallexample
7907 @findex mh-junk-blacklist
7908 @findex mh-junk-whitelist
7909 @kindex J b
7910 @kindex J w
7912 If SpamProbe classifies a message incorrectly, you can use the MH-E
7913 commands @kbd{J b} (@code{mh-junk-blacklist}) and @kbd{J w}
7914 (@code{mh-junk-whitelist}) to update SpamProbe's training.
7916 @subheading Other Things You Can Do
7918 There are a couple of things that you can add to @file{~/.procmailrc}
7919 in order to filter out a lot of spam and viruses. The first is to
7920 eliminate any message with a Windows executable (which is most likely
7921 a virus). The second is to eliminate mail in character sets that you
7922 can't read.
7924 @cindex @samp{Content-Transfer-Encoding:} header field
7925 @cindex @samp{Content-Type:} header field
7926 @cindex @samp{Subject:} header field
7927 @cindex header field, @samp{Content-Transfer-Encoding:}
7928 @cindex header field, @samp{Content-Type:}
7929 @cindex header field, @samp{Subject:}
7931 @smallexample
7932 PATH=$PATH:/usr/bin/mh
7933 MAILDIR=$HOME/`mhparam Path`
7936 # Filter messages with w32 executables/virii.
7938 # These attachments are base64 and have a TVqQAAMAAAAEAAAA//8AALg
7939 # pattern. The string "this program cannot be run in MS-DOS mode"
7940 # encoded in base64 is 4fug4AtAnNIbg and helps to avoid false
7941 # positives (Roland Smith via Pete from the bogofilter mailing list).
7943 :0 B:
7944 * ^Content-Transfer-Encoding:.*base64
7945 * ^TVqQAAMAAAAEAAAA//8AALg
7946 * 4fug4AtAnNIbg
7947 spam/exe/.
7950 # Filter mail in unreadable character sets (from the Bogofilter FAQ).
7952 UNREADABLE='[^?"]*big5|iso-2022-jp|ISO-2022-KR|euc-kr|gb2312|ks_c_5601-1987'
7955 * 1^0 $ ^Subject:.*=\?($UNREADABLE)
7956 * 1^0 $ ^Content-Type:.*charset="?($UNREADABLE)
7957 spam/unreadable/.
7960 * ^Content-Type:.*multipart
7961 * B ?? $ ^Content-Type:.*^?.*charset="?($UNREADABLE)
7962 spam/unreadable/.
7963 @end smallexample
7965 @node Miscellaneous, Scan Line Formats, Junk, Top
7966 @chapter Miscellaneous Commands, Variables, and Buffers
7968 This chapter covers the following command and the various MH-E
7969 buffers,
7971 @ftable @code
7972 @item mh-version
7973 Display version information about MH-E and the MH mail handling
7974 system.
7975 @end ftable
7977 @cindex buffers, @samp{*MH-E Info*}
7978 @cindex MH-E version
7979 @cindex @samp{*MH-E Info*}
7980 @cindex version
7981 @kindex M-x mh-version
7983 One command worth noting is @kbd{M-x mh-version}. You can compare the
7984 version this command prints to the latest release (@pxref{Getting
7985 MH-E}). The output of @kbd{M-x mh-version}, found in a buffer named
7986 @samp{*MH-E Info*}, should usually be included with any bug report you
7987 submit (@pxref{Bug Reports}).
7989 @subheading MH-E Buffers
7991 Besides the MH-Folder, MH-Show, and MH-Letter buffers, MH-E creates
7992 several other buffers. They are:
7994 @table @samp
7995 @cindex @samp{*MH-E Folders*}
7996 @cindex buffers, @samp{*MH-E Folders*}
7997 @findex mh-list-folders
7998 @item *MH-E Folders*
7999 @kindex F l
8000 This buffer contains the output of @kbd{F l} (@code{mh-list-folders}).
8001 @xref{Folders}.
8002 @c -------------------------
8003 @cindex @samp{*MH-E Help*}
8004 @cindex buffers, @samp{*MH-E Help*}
8005 @findex mh-help
8006 @item *MH-E Help*
8007 @kindex ?
8008 @kindex C-c ?
8009 This buffer contains the output of @kbd{?} (@code{mh-help}) and
8010 @kbd{C-c ?} in MH-Letter mode. @xref{Using This Manual}.
8011 @c -------------------------
8012 @cindex @samp{*MH-E Info*}
8013 @cindex buffers, @samp{*MH-E Info*}
8014 @item *MH-E Info*
8015 This buffer contains the output of @kbd{M-x mh-version @key{RET}}.
8016 @c -------------------------
8017 @cindex @samp{*MH-E Log*}
8018 @cindex buffers, @samp{*MH-E Log*}
8019 @item *MH-E Log*
8020 This buffer contains the last 100 lines of the output of the various
8021 MH commands.
8022 @c -------------------------
8023 @cindex @samp{*MH-E Mail Delivery*}
8024 @cindex buffers, @samp{*MH-E Mail Delivery*}
8025 @item *MH-E Mail Delivery*
8026 This buffer contains the transcript of a mail delivery. @xref{Sending
8027 Message}.
8028 @c -------------------------
8029 @cindex @samp{*MH-E Recipients*}
8030 @cindex buffers, @samp{*MH-E Recipients*}
8031 @findex mh-check-whom
8032 @item *MH-E Recipients*
8033 @kindex C-c C-w
8034 This buffer contains the output of @kbd{C-c C-w}
8035 (@code{mh-check-whom}) and is killed when draft is sent.
8036 @xref{Checking Recipients}.
8037 @c -------------------------
8038 @cindex @samp{*MH-E Sequences*}
8039 @cindex buffers, @samp{*MH-E Sequences*}
8040 @item *MH-E Sequences*
8041 This buffer contains the output of @kbd{S l}
8042 (@code{mh-list-sequences}). @xref{Sequences}.
8043 @c -------------------------
8044 @cindex @samp{*mh-temp*}
8045 @cindex buffers, @samp{*mh-temp*}
8046 @item *mh-temp*
8047 This is a scratch, ephemeral, buffer used by MH-E functions. Note that
8048 it is hidden because the first character in the name is a space.
8049 You'll generally not have any need for this buffer.
8050 @end table
8052 @node Scan Line Formats, Procmail, Miscellaneous, Top
8053 @appendix Scan Line Formats
8055 @cindex scan line formats
8057 This appendix discusses how MH-E creates, parses, and manipulates scan
8058 lines. If you have your own MH scan or inc format files, you
8059 @strong{can} teach MH-E how to handle them, but it isn't easy as
8060 you'll see.
8062 @cindex @samp{mh-scan-line-formats} customization group
8063 @cindex customization group, @samp{mh-scan-line-formats}
8065 This table lists the options in the @samp{mh-scan-line-formats}
8066 customization group.
8068 @vtable @code
8069 @item mh-adaptive-cmd-note-flag
8070 On means that the message number width is determined dynamically
8071 (default: @samp{on}).
8072 @c -------------------------
8073 @item mh-scan-format-file
8074 Specifies the format file to pass to the scan program (default:
8075 @samp{Use MH-E scan Format}).
8076 @c -------------------------
8077 @item mh-scan-prog
8078 Program used to scan messages (default: @code{"scan"}).
8079 @end vtable
8081 @vindex mh-adaptive-cmd-note-flag
8083 There are a couple of caveats when creating your own scan format file.
8084 First, MH-E will not work if your scan lines do not include message
8085 numbers. It will work poorly if you don't dedicate a column for
8086 showing the current message and notations. It is also best to keep the
8087 first column empty to make room for the cursor and so that text isn't
8088 obscured by the current message's overlay arrow when running in a
8089 terminal. You won't be able to use the option
8090 @code{mh-adaptive-cmd-note-flag} or the threading features
8091 (@pxref{Threading}).
8093 @cindex message numbers
8094 @findex mh-set-cmd-note
8095 @vindex mh-adaptive-cmd-note-flag
8096 @vindex mh-scan-format-file
8098 If you've created your own format to handle long message numbers,
8099 you'll be pleased to know you no longer need it since MH-E adapts its
8100 internal format based upon the largest message number if
8101 @code{mh-adaptive-cmd-note-flag} is on (the default). If you prefer
8102 fixed-width message numbers, turn off @code{mh-adaptive-cmd-note-flag}
8103 and call @code{mh-set-cmd-note} with the width specified by your
8104 format file (see @code{mh-scan-format-file}). For example, the default
8105 width is 4, so you would use @samp{(mh-set-cmd-note 4)}.
8107 @vindex mh-adaptive-cmd-note-flag
8108 @vindex mh-scan-format-file
8109 @vindex mh-scan-format-mh
8110 @vindex mh-scan-format-nmh
8112 The default setting for @code{mh-scan-format-file} is @samp{Use MH-E
8113 scan Format}. This means that the format string will be taken from the
8114 either @code{mh-scan-format-mh} or @code{mh-scan-format-nmh} depending
8115 on whether MH or nmh (or GNU mailutils MH) is in use. This setting
8116 also enables you to turn on the option
8117 @code{mh-adaptive-cmd-note-flag}. You can also set this option to
8118 @samp{Use Default scan Format} to get the same output as you would get
8119 if you ran @command{scan} from the shell. If you have a format file
8120 that you want MH-E to use but not MH, you can set this option to
8121 @samp{Specify a scan Format File} and enter the name of your format
8122 file.
8124 @vindex mh-scan-format-file
8125 @vindex mh-scan-format-mh
8126 @vindex mh-scan-format-nmh
8128 The scan format that MH-E uses when @code{mh-scan-format-file} is set
8129 to its default of @samp{Use MH-E scan Format} is held in the variables
8130 @code{mh-scan-format-nmh} and @code{mh-scan-format-mh} depending on
8131 whether you are using nmh (or GNU mailutils MH) or not. Typically, you
8132 create your own format files rather than modifying these variables.
8133 The value of @code{mh-scan-format-nmh} is:
8135 @smallexample
8136 (concat
8137  "%4(msg)"
8138  "%<(cur)+%| %>"
8139  "%<@{replied@}-"
8140  "%?(nonnull(comp@{to@}))%<(mymbox@{to@})t%>"
8141  "%?(nonnull(comp@{cc@}))%<(mymbox@{cc@})c%>"
8142  "%?(nonnull(comp@{bcc@}))%<(mymbox@{bcc@})b%>"
8143  "%?(nonnull(comp@{newsgroups@}))n%>"
8144  "%<(zero) %>"
8145  "%02(mon@{date@})/%02(mday@{date@})%<@{date@} %|*%>"
8146  "%<(mymbox@{from@})%<@{to@}To:%14(decode(friendly@{to@}))%>%>"
8147  "%<(zero)%17(decode(friendly@{from@}))%>  "
8148  "%(decode@{subject@})%<@{body@}<<%@{body@}%>")
8149 @end smallexample
8151 @cindex decoding RFC 2047
8152 @cindex RFC 2047, decoding
8153 @vindex mh-scan-format-mh
8155 The setting for @code{mh-scan-format-mh} is similar, except that MH
8156 doesn't have the function @code{decode} (which is used to decode RFC
8157 2047 encodings).
8159 @cindex notations, scan line
8160 @cindex scan line notations
8162 These strings are passed to the @command{scan} program via the
8163 @option{-format} argument. The formats are identical to the defaults
8164 except that additional hints for fontification have been added to the
8165 existing notations in the fifth column (remember that in Emacs, the
8166 columns start at 0). The values of the fifth column, in priority
8167 order, are: @samp{-} if the message has been replied to, @samp{t} if
8168 an address in the @samp{To:} field matches one of the mailboxes of the
8169 current user, @samp{c} if the @samp{Cc:} field matches, @samp{b} if
8170 the @samp{Bcc:} field matches, and @samp{n} if a non-empty
8171 @samp{Newsgroups:} field is present.
8173 @cindex @command{scan}
8174 @cindex MH commands, @command{scan}
8175 @vindex mh-progs
8176 @vindex mh-scan-prog
8178 The name of the program that generates a listing of one line per
8179 message is held in @code{mh-scan-prog} (default: @code{"scan"}).
8180 Unless this variable contains an absolute pathname, it is assumed to
8181 be in the @code{mh-progs} directory (@pxref{Getting Started}). You may
8182 link another program to @command{scan} (see @samp{mh-profile}(5)) to
8183 produce a different type of listing@footnote{See the section
8184 @uref{@value{MH-BOOK-HOME}/faswsprs.html, Find and Specify with scan
8185 pick Ranges Sequences} in the MH book.}.
8187 @cindex regular expressions, scan line formats
8188 @findex mh-set-cmd-note
8189 @findex setq
8191 If you change the format of the scan lines you'll need to tell MH-E
8192 how to parse the new format. As you will see, quite a lot of variables
8193 are involved to do that. Use @kbd{M-x apropos @key{RET}
8194 mh-scan.*regexp @key{RET}} to obtain a list of these variables. You
8195 will also have to call @code{mh-set-cmd-note} if your notations are
8196 not in column 4 (columns in Emacs start with 0). Note that unlike most
8197 of the user options described in this manual, these are variables and
8198 must be set with @code{setq} instead of in a customization buffer. For
8199 help with regular expressions, see
8200 @ifnothtml
8201 @ref{Regexps, , Syntax of Regular Expressions, emacs, The
8202 GNU Emacs Manual}.
8203 @end ifnothtml
8204 @ifhtml
8205 section
8206 @uref{http://www.gnu.org/software/emacs/manual/html_node/emacs/Regexps.html,
8207 Syntax of Regular Expressions} in @cite{The GNU Emacs Manual}.
8208 @end ifhtml
8210 The first variable has to do with pruning out garbage.
8212 @vtable @code
8213 @cindex @command{inc}
8214 @cindex MH commands, @command{inc}
8215 @cindex @command{scan}
8216 @cindex MH commands, @command{scan}
8217 @item mh-scan-valid-regexp
8218 This regular expression describes a valid scan line. This is used to
8219 eliminate error messages that are occasionally produced by
8220 @command{inc}@footnote{See the section
8221 @uref{@value{MH-BOOK-HOME}/reapre.html, Reading Mail: inc show next
8222 prev} in the MH book.} or @command{scan} (default: @code{"^ *[0-9]"}).
8223 @end vtable
8225 Next, many variables control how the scan lines are parsed.
8227 @vtable @code
8228 @vindex mh-folder-body
8229 @vindex mh-folder-font-lock-keywords
8230 @item mh-scan-body-regexp
8231 This regular expression matches the message body fragment. Note that
8232 the default setting of @code{mh-folder-font-lock-keywords} expects
8233 this expression to contain at least one parenthesized expression which
8234 matches the body text as in the default of
8235 @code{"\\(<<\\([^\n]+\\)?\\)"}. If this regular expression is not
8236 correct, the body fragment will not be highlighted with the face
8237 @code{mh-folder-body}.
8238 @c -------------------------
8239 @vindex mh-folder-cur-msg-number
8240 @vindex mh-folder-font-lock-keywords
8241 @vindex mh-note-cur
8242 @item mh-scan-cur-msg-number-regexp
8243 This regular expression matches the current message. It must match
8244 from the beginning of the line. Note that the default setting of
8245 @code{mh-folder-font-lock-keywords} expects this expression to contain
8246 at least one parenthesized expression which matches the message number
8247 as in the default of @w{@code{"^\\( *[0-9]+\\+\\).*"}}. This
8248 expression includes the leading space and current message marker
8249 @samp{+} within the parenthesis since it looks better to highlight
8250 these items as well. The highlighting is done with the face
8251 @code{mh-folder-cur-msg-number}. This regular expression should be
8252 correct as it is needed by non-fontification functions. See also
8253 @code{mh-note-cur}.
8254 @c -------------------------
8255 @vindex mh-folder-date
8256 @vindex mh-folder-font-lock-keywords
8257 @vindex mh-scan-sent-to-me-sender-regexp
8258 @item mh-scan-date-regexp
8259 This regular expression matches a valid date. It must @strong{not} be
8260 anchored to the beginning or the end of the line. Note that the
8261 default setting of @code{mh-folder-font-lock-keywords} expects this
8262 expression to contain only one parenthesized expression which matches
8263 the date field as in the default of
8264 @code{"\\([0-9][0-9]/[0-9][0-9]\\)"}. If this regular expression is
8265 not correct, the date will not be highlighted with the face
8266 @code{mh-folder-date}.
8267 @c -------------------------
8268 @vindex mh-folder-deleted
8269 @vindex mh-folder-font-lock-keywords
8270 @vindex mh-note-deleted
8271 @item mh-scan-deleted-msg-regexp
8272 This regular expression matches deleted messages. It must match from
8273 the beginning of the line. Note that the default setting of
8274 @code{mh-folder-font-lock-keywords} expects this expression to contain
8275 at least one parenthesized expression which matches the message number
8276 as in the default of @code{"^\\( *[0-9]+\\)D"}. This expression
8277 includes the leading space within the parenthesis since it looks
8278 better to highlight it as well. The highlighting is done with the face
8279 @code{mh-folder-deleted}. This regular expression should be correct as
8280 it is needed by non-fontification functions. See also
8281 @code{mh-note-deleted}.
8282 @c -------------------------
8283 @vindex mh-folder-font-lock-keywords
8284 @vindex mh-folder-msg-number
8285 @item mh-scan-good-msg-regexp
8286 This regular expression matches ``good'' messages. It must match from
8287 the beginning of the line. Note that the default setting of
8288 @code{mh-folder-font-lock-keywords} expects this expression to contain
8289 at least one parenthesized expression which matches the message number
8290 as in the default of @w{@code{"^\\( *[0-9]+\\)[^D^0-9]"}}. This
8291 expression includes the leading space within the parenthesis since it
8292 looks better to highlight it as well. The highlighting is done with
8293 the face @code{mh-folder-msg-number}. This regular expression should
8294 be correct as it is needed by non-fontification functions.
8295 @c -------------------------
8296 @vindex mh-scan-format-file
8297 @item mh-scan-msg-format-regexp
8298 This regular expression finds the message number width in a scan
8299 format. Note that the message number must be placed in a parenthesized
8300 expression as in the default of @code{"%\\([0-9]*\\)(msg)"}. This
8301 variable is only consulted if @code{mh-scan-format-file} is set to
8302 @samp{Use MH-E scan Format}.
8303 @c -------------------------
8304 @vindex mh-scan-format-file
8305 @item mh-scan-msg-format-string
8306 This is a format string for the width of the message number in a scan
8307 format. Use @samp{0%d} for zero-filled message numbers. This variable
8308 is only consulted if @code{mh-scan-format-file} is set to @samp{Use
8309 MH-E scan Format} (default: @code{"%d"}).
8310 @c -------------------------
8311 @item mh-scan-msg-number-regexp
8312 This regular expression extracts the message number. It must match
8313 from the beginning of the line. Note that the message number must be
8314 placed in a parenthesized expression as in the default of @w{@code{"^
8315 *\\([0-9]+\\)"}}.
8316 @c -------------------------
8317 @item mh-scan-msg-overflow-regexp
8318 This regular expression matches overflowed message numbers (default:
8319 @code{"^[?0-9][0-9]"}).
8320 @c -------------------------
8321 @item mh-scan-msg-search-regexp
8322 This regular expression matches a particular message. It is a format
8323 string; use @samp{%d} to represent the location of the message number
8324 within the expression as in the default of @code{"^[^0-9]*%d[^0-9]"}.
8325 @c -------------------------
8326 @vindex mh-folder-address
8327 @vindex mh-folder-font-lock-keywords
8328 @vindex mh-folder-to
8329 @item mh-scan-rcpt-regexp
8330 This regular expression specifies the recipient in messages you sent.
8331 Note that the default setting of @code{mh-folder-font-lock-keywords}
8332 expects this expression to contain two parenthesized expressions. The
8333 first is expected to match the @samp{To:} that the default scan format
8334 file generates. The second is expected to match the recipient's name
8335 as in the default of @code{"\\(To:\\)\\(..............\\)"}. If this
8336 regular expression is not correct, the @samp{To:} string will not be
8337 highlighted with the face @code{mh-folder-to} and the recipient will not be
8338 highlighted with the face @code{mh-folder-address}.
8339 @c -------------------------
8340 @vindex mh-folder-font-lock-keywords
8341 @vindex mh-folder-refiled
8342 @vindex mh-note-refiled
8343 @item mh-scan-refiled-msg-regexp
8344 This regular expression matches refiled messages. It must match from
8345 the beginning of the line. Note that the default setting of
8346 @code{mh-folder-font-lock-keywords} expects this expression to contain
8347 at least one parenthesized expression which matches the message number
8348 as in the default of @w{@code{"^\\( *[0-9]+\\)\\^"}}. This expression
8349 includes the leading space within the parenthesis since it looks
8350 better to highlight it as well. The highlighting is done with the face
8351 @code{mh-folder-refiled}. This regular expression should be correct as
8352 it is needed by non-fontification functions. See also
8353 @code{mh-note-refiled}.
8354 @c -------------------------
8355 @vindex mh-folder-font-lock-keywords
8356 @vindex mh-folder-sent-to-me-sender
8357 @vindex mh-mh-folder-sent-to-me-hint
8358 @vindex mh-scan-format-nmh
8359 @item mh-scan-sent-to-me-sender-regexp
8360 This regular expression matches messages sent to us. Note that the
8361 default setting of @code{mh-folder-font-lock-keywords} expects this
8362 expression to contain at least two parenthesized expressions. The
8363 first should match the fontification hint (see
8364 @code{mh-scan-format-nmh}) and the second should match the user name
8365 as in the default of
8366 @w{@code{"^ *[0-9]+.\\([bct]\\).....[ ]*\\(..................\\)"}}.
8367 If this regular expression is not correct, the notation hints will not
8368 be highlighted with the face @code{mh-mh-folder-sent-to-me-hint} and
8369 the sender will not be highlighted with the face
8370 @code{mh-folder-sent-to-me-sender}.
8371 @c -------------------------
8372 @vindex mh-folder-followup
8373 @vindex mh-folder-font-lock-keywords
8374 @vindex mh-folder-subject
8375 @item mh-scan-subject-regexp
8376 This regular expression matches the subject. It must match from the
8377 beginning of the line. Note that the default setting of
8378 @samp{mh-folder-font-lock-keywords} expects this expression to contain
8379 at least three parenthesized expressions. The first is expected to
8380 match the @samp{Re:} string, if any, and is highlighted with the face
8381 @code{mh-folder-followup}. The second matches an optional bracketed
8382 number after @samp{Re:}, such as in @samp{Re[2]:} (and is thus a
8383 sub-expression of the first expression). The third is expected to
8384 match the subject line itself which is highlighted with the face
8385 @code{mh-folder-subject}. For example, the default is
8386 @w{@code{"^ *[0-9]+........[ ]*...................}}@*
8387 @w{@code{\\([Rr][Ee]\\(\\[[0-9]+\\]\\)?:\\s-*\\)*\\([^<\n]*\\)"}}.
8388 This regular expression should be correct as it is needed by
8389 non-fontification functions. Note that this example is broken up on
8390 two lines for readability, but is actually a single string.
8391 @end vtable
8393 Finally, there are a slew of variables that control how MH-E annotates
8394 the scan lines.
8396 @vtable @code
8397 @findex mh-set-cmd-note
8398 @vindex mh-adaptive-cmd-note-flag
8399 @item mh-cmd-note
8400 Column for notations (default: 4). This variable should be set with
8401 the function @code{mh-set-cmd-note}. This variable may be updated
8402 dynamically if @code{mh-adaptive-cmd-note-flag} is on. The following
8403 variables contain the notational characters. Note that columns in
8404 Emacs start with 0.
8405 @c -------------------------
8406 @item mh-note-copied
8407 Messages that have been copied are marked by this character (default:
8408 @code{?C}).
8409 @c -------------------------
8410 @vindex mh-scan-cur-msg-number-regexp
8411 @item mh-note-cur
8412 The current message (in MH, not in MH-E) is marked by this character
8413 (default: @code{?+}). See also @code{mh-scan-cur-msg-number-regexp}.
8414 @c -------------------------
8415 @vindex mh-scan-deleted-msg-regexp
8416 @item mh-note-deleted
8417 Messages that have been deleted are marked by this character (default:
8418 @code{?D}). See also @code{mh-scan-deleted-msg-regexp}.
8419 @c -------------------------
8420 @item mh-note-dist
8421 Messages that have been redistributed are marked by this character
8422 (default: @code{?R}).
8423 @c -------------------------
8424 @item mh-note-forw
8425 Messages that have been forwarded are marked by this character
8426 (default: @code{?F}).
8427 @c -------------------------
8428 @item mh-note-printed
8429 Messages that have been printed are marked by this character (default:
8430 @code{?P}).
8431 @c -------------------------
8432 @vindex mh-scan-refiled-msg-regexp
8433 @item mh-note-refiled
8434 Messages that have been refiled are marked by this character (default:
8435 @code{?^}). See also @code{mh-scan-refiled-msg-regexp}.
8436 @c -------------------------
8437 @item mh-note-repl
8438 Messages that have been replied to are marked by this character
8439 (default: @code{?-}).
8440 @c -------------------------
8441 @item mh-note-seq
8442 Messages in a user-defined sequence are marked by this character
8443 (default: @code{?%}). Messages in the @samp{search} sequence are
8444 marked by this character as well.
8445 @end vtable
8447 For example, let's say I have the following in @file{scan.format}
8448 which displays the sender, the subject, and the message number. This
8449 format places a @samp{+} after the message number for the current
8450 message according to MH; it also uses that column for notations.
8452 @smallexample
8453 %20(decode(friendly@{from@})) %50(decode@{subject@})  %4(msg)%<(cur)+%| %>
8454 @end smallexample
8456 @vindex mh-adaptive-cmd-note-flag
8457 @vindex mh-scan-format-file
8458 @vindex mh-scan-format-file, example
8460 The first thing you have to do is tell MH-E to use this file.
8461 Customize @code{mh-scan-format-file} and set its value to @samp{Use
8462 Default scan Format}. If you didn't get already turn off
8463 @code{mh-adaptive-cmd-note-flag}, you'll need to do that first.
8465 Next, tell MH-E what a valid scan line looks like so that you can at
8466 least display the output of scan in your MH-Folder buffer.
8468 @vindex mh-scan-valid-regexp, example
8470 @smalllisp
8471 (setq mh-scan-valid-regexp "[0-9]+[+D^ ]$")
8472 @end smalllisp
8474 Now, in order to get rid of the @samp{Cursor not pointing to message}
8475 message, you need to tell MH-E how to access the message number. You
8476 should also see why MH-E requires that you include a message number in
8477 the first place.
8479 @vindex mh-scan-msg-number-regexp, example
8480 @vindex mh-scan-msg-search-regexp, example
8482 @smalllisp
8483 (setq mh-scan-msg-number-regexp "^.* \\([0-9]+\\)[+D^ ]$")
8484 (setq mh-scan-msg-search-regexp " %d[+D^ ]$")
8485 @end smalllisp
8487 In order to get the next and previous commands working, add this.
8489 @vindex mh-scan-good-msg-regexp, example
8491 @smalllisp
8492 (setq mh-scan-good-msg-regexp "^.* \\([0-9]+\\)[+D^ ]$")
8493 @end smalllisp
8495 Note that the current message isn't marked with a @samp{+} when moving
8496 between the next and previous messages. Here is the code required to
8497 get this working.
8499 @vindex set-mh-cmd-note, example
8500 @vindex mh-scan-cur-msg-number-regexp, example
8502 @smalllisp
8503 (set-mh-cmd-note 76)
8504 (setq mh-scan-cur-msg-number-regexp "^.* \\([0-9]+\\)\\+$")
8505 @end smalllisp
8507 Finally, add the following to delete and refile messages.
8509 @vindex mh-scan-deleted-msg-regexp, example
8510 @vindex mh-scan-refiled-msg-regexp, example
8512 @smalllisp
8513 (setq mh-scan-deleted-msg-regexp "^.* \\([0-9]+\\)D$")
8514 (setq mh-scan-refiled-msg-regexp "^.* \\([0-9]+\\)\\^$")
8515 @end smalllisp
8517 This is just a bare minimum; it's best to adjust all of the regular
8518 expressions to ensure that MH-E and highlighting perform well.
8520 @node Procmail, Odds and Ends, Scan Line Formats, Top
8521 @appendix Reading Mailing Lists Effectively
8523 @cindex @command{procmail}
8524 @cindex @command{slocal}
8525 @cindex Gnus
8526 @cindex MH commands, @command{slocal}
8527 @cindex Unix commands, @command{procmail}
8528 @cindex mailing lists, reading
8530 This appendix explains how to use @uref{http://www.procmail.org/,
8531 procmail} to file mail from mailing lists into folders which can then
8532 be read easily with MH-E@footnote{The MH equivalent, @command{slocal},
8533 can be used as well, but procmail is more flexible and more packages
8534 exist for procmail than for slocal.}. Some mailing lists have such
8535 high traffic that Gnus must be used and I discuss how to use Gnus
8536 side-by-side with MH-E.
8538 @cindex @file{.procmailrc}
8539 @cindex files, @file{.procmailrc}
8541 First, I'll describe how to put mail from your mailing lists directly
8542 into an MH folder using @command{procmail}. First, add the following
8543 to @file{~/.procmailrc}. While the logging variables aren't strictly
8544 necessary, they are extremely useful.
8546 @smallexample
8547 [1]  # Update PATH so procmail can find myrcvstore, rcvstore and mhparam.
8548 [2]  PATH=$PATH:/usr/lib/mh:/usr/bin/mh:$HOME/bin
8550 [4]  # Point LOGFILE at the actual log file.
8551 [5]  LOGFILE=$HOME/.procmail.log
8553 [7]  # This setting provides just the right amount of information.
8554 [8]  LOGABSTRACT=all
8556 [10] # Uncomment the following line to see how your patterns match.
8557 [11] #VERBOSE=yes
8558 [12]
8559 [13] # Place mail sent to any MH-E mailing list in +mh-e.
8560 [14] :0 w: mh-e$LOCKEXT
8561 [15] * ^TO.*mh-e-.*@@.*sourceforge.net
8562 [16] | myrcvstore -create +mh-e
8563 @end smallexample
8565 @cindex @command{rcvstore}
8566 @cindex MH commands, @command{rcvstore}
8568 Line 14 creates a lock file in your mail directory based upon the name
8569 of the folder. This is done because @command{rcvstore} does not
8570 perform locking. While this lock file will prevent @command{procmail}
8571 from writing to a folder concurrently, there is a slight chance that
8572 you might lose a message if you're performing operations on a folder
8573 at the same time @command{rcvstore} is placing a message there. You
8574 have been warned. Now that that disclaimer is out of the way, note
8575 that I've been using this set-up for over a decade and haven't lost
8576 anything to my knowledge@footnote{See
8577 @uref{https://savannah.nongnu.org/bugs/?func=detailbug&bug_id=4361&group_id=2166,
8578 Savannah issue #4361} to see if @command{rcvstore} locking is still an
8579 issue.}.
8581 @cindex @samp{Unseen-Sequence:} MH profile component
8582 @cindex MH profile component, @samp{Unseen-Sequence:}
8584 Line 16 uses the following script, @code{myrcvstore}, to massage the
8585 message as described in the comment and file the message in the given
8586 folder@footnote{The @samp{-create} argument wasn't always the default
8587 to @command{rcvstore}.}.
8589 @smallexample
8590 #! /bin/sh
8592 # Accepts a message on standard input and passes it through rcvstore
8593 # after first passing it through any filters. All arguments are passed
8594 # on to rcvstore.
8596 # Force the "From user date" to become part of header. One reason this
8597 # is done is because the presence of the From field confuses dist so
8598 # that dist adds a new header, rather than using the existing header.
8599 # Note that this should not be done for any message that goes into a
8600 # Gnus incoming file (Gnus will thrown an error) nor should it be
8601 # applied to any message that goes to the system mailbox because the
8602 # entire mailbox will be incorporated as a single message.
8603 formail -c -z -R 'From ' X-Envelope-From: |
8604 rcvstore $@@
8605 @end smallexample
8607 If your version of @command{rcvstore} doesn't add messages to the
8608 @samp{unseen} sequence by default, add the following line to your MH
8609 profile:
8611 @smallexample
8612 Unseen-Sequence: unseen
8613 @end smallexample
8615 Now view your new messages with the speedbar (@pxref{Speedbar}) or with
8616 @kbd{F n} (@code{mh-index-new-messages}). @xref{Folders}.
8618 If you're on a mailing list that is so voluminous that it is
8619 impossible to read every message, it usually better to read the
8620 mailing list like a newsgroup in a news reader. Emacs has a built-in
8621 newsreader called Gnus. The remainder of this appendix talks about how
8622 to use Gnus with an MH message store. The version of Gnus that was
8623 used to prepare this manual was 5.10. Versions 5.8 through 5.10 should
8624 work but versions prior to 5.8 use different options.
8626 This table contains a list of Gnus options that you will have to
8627 modify. Note that for them to become accessible, you'll have to load
8628 @file{nnml.el} first. This can be done with @kbd{M-x load-library
8629 @key{RET} nnml @key{RET}}.
8631 @vtable @code
8632 @item gnus-secondary-select-methods
8633 Select the @samp{nnml} value. This select method uses directories for
8634 folders and individual files for messages, just like MH@. You do not
8635 have to set an address.
8636 @c -------------------------
8637 @item mail-sources
8638 Select the @samp{Several files in a directory} value, check the
8639 @samp{Path} box and enter @file{~/Mail} to tell Gnus where to find
8640 your mail.
8641 @c -------------------------
8642 @vindex mail-user-agent
8643 @item message-mail-user-agent
8644 In order to send mail within Gnus using MH-E, set this option to
8645 @samp{mail-user-agent} and set the @code{mail-user-agent} option to
8646 @samp{Emacs interface to MH}.
8647 @c -------------------------
8648 @item nnmail-keep-last-article
8649 Since Gnus keeps track of which messages you have read, it would be
8650 bad if Gnus expired the last message, for example, message 100, and
8651 @command{rcvstore} gave the next new message number 1. Gnus would then
8652 ignore it since it thinks that you've read messages 1--100. Turning on
8653 this option ensures that the last message is never removed thereby
8654 eliminating this problem.
8655 @end vtable
8657 Next add the following to @file{~/.procmailrc}. If you don't subscribe
8658 to the GnuCash mailing list, substitute one to which you are
8659 subscribed.
8661 @smallexample
8662 PATH=$PATH:/usr/bin/mh
8663 MAILDIR=$HOME/`mhparam Path`
8664 # Place mail sent to the GnuCash mailing list in gnucash.spool, where
8665 # Gnus will pick it up.
8667 * ^TO.*gnucash.*@@.*gnucash.org
8668 gnucash.spool
8669 @end smallexample
8671 Wait for some messages to appear in @file{gnucash.spool} and run Gnus
8672 with @kbd{M-x gnus @key{RET}}. To view the folder created in the
8673 example above, you would tell Gnus about it the first time only with
8674 @kbd{G m gnucash @key{RET} nnml @key{RET}}. In MH-E, this folder is
8675 known as @samp{+gnucash}.
8677 @node Odds and Ends, History, Procmail, Top
8678 @appendix Odds and Ends
8680 This appendix covers a few topics that don't fit elsewhere. Here I
8681 tell you how to report bugs and how to get on the MH-E mailing lists.
8682 I also point out some additional sources of information.
8684 @menu
8685 * Bug Reports::
8686 * Mailing Lists::
8687 * MH FAQ and Support::
8688 * Getting MH-E::
8689 @end menu
8691 @node Bug Reports, Mailing Lists, Odds and Ends, Odds and Ends
8692 @appendixsec Bug Reports
8694 @cindex bugs
8695 @cindex SourceForge
8696 @kindex M-x mh-version
8698 Bug reports should be filed at
8699 @uref{https://sourceforge.net/p/mh-e/bugs/, SourceForge}. You need to
8700 be a SourceForge user to submit bug reports, but this is easy enough
8701 to do that it shouldn't be a restriction for you. Please include the
8702 output of @kbd{M-x mh-version} (@pxref{Miscellaneous}) in any bug
8703 report you send unless you're 110% positive we won't ask for it.
8705 @node Mailing Lists, MH FAQ and Support, Bug Reports, Odds and Ends
8706 @appendixsec MH-E Mailing Lists
8708 @cindex SourceForge
8709 @cindex mailing lists
8711 There are several mailing lists for MH-E@. They are @i{mh-e-users at
8712 lists.sourceforge.net}, @i{mh-e-announce at lists.sourceforge.net},
8713 and @i{mh-e-devel at lists.sourceforge.net}. You can subscribe or view
8714 the archives at @uref{https://sourceforge.net/p/mh-e/mailman/,
8715 SourceForge}. Do not report bugs on these lists; please submit them
8716 via SourceForge (@pxref{Bug Reports}).
8718 @node MH FAQ and Support, Getting MH-E, Mailing Lists, Odds and Ends
8719 @appendixsec MH FAQ and Support
8721 @cindex FAQ
8722 @cindex MH FAQ
8724 The article @uref{http://www.newt.com/faq/mh.html, @cite{MH Frequently
8725 Asked Questions (FAQ) with Answers}} appears monthly in the newsgroup
8726 @samp{comp.mail.mh}. While very little is there that deals with MH-E
8727 specifically, there is an incredible wealth of material about MH
8728 itself which you will find useful.
8730 @cindex support
8732 You can find FAQs on MH-E by searching for @i{labels:support} on the
8733 @uref{https://sourceforge.net/p/mh-e/bugs/search/?q=labels%3Asupport,
8734 Tickets} page on SourceForge. If you don't find the answer to your
8735 question, file a ticket and your question will become a new FAQ!
8737 @node Getting MH-E,  , MH FAQ and Support, Odds and Ends
8738 @appendixsec Getting MH-E
8740 @cindex MH-E, obtaining
8741 @cindex getting MH-E
8742 @cindex obtaining MH-E
8744 Because MH-E is undergoing a phase of sustained growth, the version of
8745 MH-E in your Emacs is likely to be out of date although it is most
8746 likely to be more up to date than the copy that comes with the MH
8747 distribution in @file{miscellany/mh-e}.
8749 @cindex change log
8750 @cindex release notes
8752 New MH-E releases are always available for downloading at
8753 @uref{https://sourceforge.net/projects/mh-e/files/, SourceForge}
8754 before they appear in an Emacs release. You can read the release notes
8755 on that page to determine if the given release of MH-E is already
8756 installed in your version of Emacs. You can also read the change log
8757 to see if you are interested in what the given release of MH-E has to
8758 offer (although we have no doubt that you will be extremely interested
8759 in all new releases).
8761 @cindex Debian
8763 If you use Debian, you can install the Debian
8764 @uref{http://packages.debian.org/unstable/mail/mh-e, mh-e package}
8765 instead.
8767 @cindex files, @samp{MH-E-NEWS}
8768 @cindex files, @samp{README}
8769 @cindex news
8770 @cindex @samp{MH-E-NEWS}
8771 @cindex @samp{README}
8772 @kindex M-x mh-version
8774 After you download and extract the MH-E tarball, read the
8775 @file{README} file and @file{MH-E-NEWS}. These correspond to the
8776 release notes and change log mentioned above. The file @file{README}
8777 contains instructions on installing MH-E@. If you're already running
8778 Emacs, please quit that session and start again to load in the new
8779 MH-E@. Check that you're running the new version with the command
8780 @kbd{M-x mh-version}.
8782 @cindex contributed software
8783 @cindex manual
8784 @cindex documentation
8786 In addition to the mh-e package, the
8787 @uref{https://sourceforge.net/projects/mh-e/files/, SourceForge} site
8788 also contains doc and contrib packages. The former is the latest
8789 release of this manual, and the latter contains a few contributed
8790 packages you might find useful.
8792 @node History, GFDL, Odds and Ends, Top
8793 @appendix History of MH-E
8795 @cindex Bill Wohler
8796 @cindex Brian Reid
8797 @cindex Gildea, Stephen
8798 @cindex Jim Larus
8799 @cindex Larus, Jim
8800 @cindex MH-E, versions
8801 @cindex Reid, Brian
8802 @cindex SourceForge
8803 @cindex Stephen Gildea
8804 @cindex Wohler, Bill
8805 @cindex history of MH-E
8806 @cindex versions of MH-E
8808 MH-E was originally written by Brian Reid in 1983 and has changed
8809 hands several times since then. Jim Larus wanted to do something
8810 similar for GNU Emacs, and ended up completely rewriting it that same
8811 year. In 1989, Stephen Gildea picked it up and added many
8812 improvements. Bill Wohler then took over in 2000 and moved its
8813 development to @uref{http://sourceforge.net/, SourceForge} where it
8814 lives today.
8816 @menu
8817 * From Brian Reid::
8818 * From Jim Larus::
8819 * From Stephen Gildea::
8820 * From Bill Wohler::
8821 @end menu
8823 @node From Brian Reid, From Jim Larus, History, History
8824 @appendixsec From Brian Reid
8826 @cindex Brian Reid
8827 @cindex Reid, Brian
8829 One day in 1983 I got the flu and had to stay home from work for three
8830 days with nothing to do. I used that time to write MHE@. The
8831 fundamental idea behind MHE was that it was a ``puppeteer'' driving
8832 the MH programs underneath it. MH had a model that the editor was
8833 supposed to run as a sub-process of the mailer, which seemed to me at
8834 the time to be the tail wagging the dog. So I turned it around and
8835 made the editor drive the MH programs. I made sure that the UCI people
8836 (who were maintaining MH at the time) took in my changes and made them
8837 stick.
8839 Today, I still use my own version of MHE because I don't at all like
8840 the way that GNU MH-E works and I've never gotten to be good enough at
8841 hacking Emacs Lisp to make GNU MH-E do what I want. The Gosling-emacs
8842 version of MHE and the GNU Emacs version of MH-E have almost nothing
8843 in common except similar names. They work differently, have different
8844 conceptual models, and have different key bindings@footnote{After
8845 reading this article, I questioned Brian about his version of MHE, and
8846 received some great ideas for improving MH-E such as a dired-like
8847 method of selecting folders; and removing the prompting when sending
8848 mail, filling in the blanks in the draft buffer instead. I passed them
8849 on to Stephen Gildea, the current maintainer, and he was excited about
8850 the ideas as well. Perhaps one day, MH-E will again resemble MHE
8851 (draft form editing was introduced in version 7.4).}.
8853 Brian Reid, June 1994
8855 @node From Jim Larus, From Stephen Gildea, From Brian Reid, History
8856 @appendixsec From Jim Larus
8858 @cindex Jim Larus
8859 @cindex Larus, Jim
8861 Brian Reid, while at CMU or shortly after going to Stanford wrote a
8862 mail reading program called MHE for Gosling Emacs. It had much the
8863 same structure as MH-E (i.e., invoked MH programs), though it was
8864 simpler and the commands were slightly different. Unfortunately, I no
8865 longer have a copy so the differences are lost in the mists of time.
8867 In '82--83, I was working at BBN and wrote a lot of mlisp code in
8868 Gosling Emacs to make it look more like Tennex Emacs. One of the
8869 packages that I picked up and improved was Reid's mail system. In '83,
8870 I went back to Berkeley. About that time, Stallman's first version of
8871 GNU Emacs came out and people started to move to it from Gosling Emacs
8872 (as I recall, the transition took a year or two). I decided to port
8873 Reid's MHE and used the mlisp to Emacs Lisp translator that came with
8874 GNU Emacs. It did a lousy job and the resulting code didn't work, so I
8875 bit the bullet and rewrote the code by hand (it was a lot smaller and
8876 simpler then, so it took only a day or two).
8878 Soon after that, MH-E became part of the standard Emacs distribution
8879 and suggestions kept dribbling in for improvements. MH-E soon reached
8880 sufficient functionality to keep me happy, but I kept on improving it
8881 because I was a graduate student with plenty of time on my hands and
8882 it was more fun than my dissertation. In retrospect, the one thing
8883 that I regret is not writing any documentation, which seriously
8884 limited the use and appeal of the package.
8886 @cindex @command{xmh}, in MH-E history
8888 In '89, I came to Wisconsin as a professor and decided not to work on
8889 MH-E@. It was stable, except for minor bugs, and had enough
8890 functionality, so I let it be for a few years. Stephen Gildea of BBN
8891 began to pester me about the bugs, but I ignored them. In 1990, he
8892 went off to the X Consortium, said good bye, and said that he would
8893 now be using @command{xmh}. A few months later, he came back and said
8894 that he couldn't stand @command{xmh} and could I put a few more bug fixes
8895 into MH-E@. At that point, I had no interest in fixing MH-E, so I gave
8896 the responsibility of maintenance to him and he has done a fine job
8897 since then.
8899 Jim Larus, June 1994
8901 @node From Stephen Gildea, From Bill Wohler, From Jim Larus, History
8902 @appendixsec From Stephen Gildea
8904 @cindex Gildea, Stephen
8905 @cindex Stephen Gildea
8907 In 1987 I went to work for Bolt Beranek and Newman, as Jim had before
8908 me. In my previous job, I had been using RMAIL, but as my folders tend
8909 to run large, I was frustrated with the speed of RMAIL@. However, I
8910 stuck with it because I wanted the GNU Emacs interface. I am very
8911 familiar and comfortable with the Emacs interface (with just a few
8912 modifications of my own) and dislike having to use applications with
8913 embedded editors; they never live up to Emacs.
8915 MH is the mail reader of choice at BBN, so I converted to it. Since I
8916 didn't want to give up using an Emacs interface, I started using MH-E@.
8917 As is my wont, I started hacking on it almost immediately. I first
8918 used version 3.4m. One of the first features I added was to treat the
8919 folder buffer as a file-visiting buffer: you could lock it, save it,
8920 and be warned of unsaved changes when killing it. I also worked to
8921 bring its functionality a little closer to RMAIL@. Jim Larus was very
8922 cooperative about merging in my changes, and my efforts first appeared
8923 in version 3.6, distributed with Emacs 18.52 in 1988. Next I decided
8924 MH-E was too slow and optimized it a lot. Version, 3.7, distributed
8925 with Emacs 18.56 in 1990, was noticeably faster.
8927 When I moved to the X Consortium I became the first person there to
8928 not use xmh. (There is now one other engineer there using MH-E@.) About
8929 this point I took over maintenance of MH-E from Jim and was finally
8930 able to add some features Jim hadn't accepted, such as the backward
8931 searching undo. My first release was 3.8 (Emacs 18.58) in 1992.
8933 Now, in 1994, we see a flurry of releases, with both 4.0 and 5.0.
8934 Version 4.0 added many new features, including background folder
8935 collection and support for composing @sc{mime} messages. (Reading
8936 @sc{mime} messages remains to be done, alas.) While writing this book,
8937 Bill Wohler gave MH-E its closest examination ever, uncovering bugs
8938 and inconsistencies that required a new major version to fix, and so
8939 version 5 was released.
8941 Stephen Gildea, June 1994
8943 @node From Bill Wohler,  , From Stephen Gildea, History
8944 @appendixsec From Bill Wohler
8946 @cindex Wohler, Bill
8947 @cindex Bill Wohler
8949 The preface originally included the following text which I use to
8950 begin my story:
8952 @quotation
8953 But it's important to note a brief history of MH-E.
8955 @w{Version 3} was prevalent through the @w{Emacs 18} and early
8956 @w{Emacs 19} years. Then @w{Version 4} came out (@w{Emacs 19.23}),
8957 which introduced several new and changed commands. Next, @w{Version
8958 5.0} was released, which fixed some bugs and incompatibilities, and
8959 was incorporated into @w{Emacs 19.29}.
8960 @end quotation
8962 After a long break, Stephen handed the reins over to me in 2000. I
8963 moved the project to a new site called SourceForge and organized a
8964 great team of developers. Our first release in late 2001 was version
8965 6. It appeared around the time of Emacs 21.2 and had menus and tool
8966 bar buttons.
8968 Then, indexed searches, improved MIME handling, a speedbar, multiple
8969 identities, alias completion, an index view of unseen messages, spam
8970 software support, Face and X-Image-URL header field support, Fcc
8971 completion, arbitrary range handling, and draft form editing were
8972 introduced in the version 7 series around the time of Emacs 21.4
8973 (2004). Still, Emacs itself contained version 5 of MH-E released back
8974 in 1994.
8976 Version 8 development was mostly driven by the rewrite of the manual.
8977 It also brought GNU mailutils MH support, S/MIME support, picon
8978 support, and an improved interface for hiding header fields. The CVS
8979 repository was migrated from SourceForge to Savannah (only for those
8980 files that were already part of Emacs) and the software was completely
8981 reorganized to push back two decades of entropy. Version 8 appeared in
8982 Emacs 22.1 in 2006.
8984 Development was then quiet for a couple of years. Emacs 23.1, which is
8985 due out in 2009, will contain version 8.1. This version includes a few
8986 new features and several bug fixes.
8988 Bill Wohler, August 2008
8990 @node GFDL, GPL, History, Top
8991 @appendix GNU Free Documentation License
8992 @include doclicense.texi
8994 @node GPL, Key Index, GFDL, Top
8995 @appendix GNU General Public License
8996 @include gpl.texi
8998 @node Key Index, Command Index, GPL, Top
8999 @unnumbered Key (Character) Index
9000 @printindex ky
9002 @node Command Index, Option Index, Key Index, Top
9003 @unnumbered Command Index
9004 @printindex fn
9006 @node Option Index, Concept Index, Command Index, Top
9007 @unnumbered Option (Variable) Index
9008 @printindex vr
9010 @node Concept Index,  , Option Index, Top
9011 @unnumbered Concept Index
9012 @printindex cp
9014 @bye
9016 @c Ispell Helpers
9018 @c The following are words that ispell should ignore that would not
9019 @c normally be in a dictionary (global or personal). Be careful not to
9020 @c include words here that could potentially be typos of other words
9021 @c (such as url, elisp, or MHE).
9023 @c LocalWords: CTRL ESC SPC f's
9024 @c LocalWords: addr Aliasfile alist
9025 @c LocalWords: Baushke Bcc BBN Beranek bogofilter bogofilter's
9026 @c LocalWords: cmd CMU contrib cron
9027 @c LocalWords: DesBrisay Dcc devel dir dired docstring filll forw
9028 @c LocalWords: GECOS Gildea Gildea's Ginnean GnuCash goto gnuserv htm
9029 @c LocalWords: ImageMagick inbox ispell keychain
9030 @c LocalWords: Larus licensor LocalWords lookup lpr
9031 @c LocalWords: makeinfo mairix mbox mh mhbuild mhl mhpath mlisp
9032 @c LocalWords: MML msg multipart
9033 @c LocalWords: Namazu NIS nenscript nnml num
9034 @c LocalWords: packmbox passphrase pathname prev procmail prog repl
9035 @c LocalWords: slocal sortm SpamAssassin spammers SpamProbe SpamProbe's
9036 @c LocalWords: sublicense supercite speedbar
9037 @c LocalWords: Tennex texi texinfo Thelen thelenm
9038 @c LocalWords: UCI undeleted whatnow wohler xmh ypcat
9040 @c See http://www.oreilly.com/oreilly/author/stylesheet.html.
9041 @c See http://en.wikipedia.org/.
9043 @c Note the lowercase mh which is needed to avoid hits in the
9044 @c functions and variables. Occasionally, check for accidental
9045 @c inclusion of mh in text by uncommenting the following and executing
9046 @c it with C-x C-e. You want to see "Search failed"
9047 @c   (let ((case-fold-search nil))
9048 @c        (goto-char (point-min))
9049 @c        (search-forward-regexp "^mh\\( \\|$\\)"))
9051 @c An extremely useful setting for texinfo-mode-hook is:
9052 @c   (add-to-list
9053 @c    'ispell-skip-region-alist
9054 @c    (list
9055 @c     (concat "\\(@\\(small\\)?\\(example\\|lisp\\)"
9056 @c             "\\(@\\([irw]\\|code\\|var\\){[^}]+}\\|"
9057 @c             "@[@{}.]\\|"
9058 @c             "[^@]\\|"
9059 @c             "@\\(end \\)?group\\|"
9060 @c             "@\\(end \\)?cartouche\\)+"
9061 @c             "@end \\(small\\)?\\(example\\|lisp\\)\\|"
9062 @c             "@\\(code\\|command\\|file\\|kbd\\|sc\\){[^}]+}\\|"
9063 @c             "^@end [a-z]+$\\|"
9064 @c             "^@\\([fv]\\|print\\)index .*$\\|"
9065 @c             "@uref{[^,]+,\\|"
9066 @c             "@[a-z]+\\|"
9067 @c             "/[a-z.]+[/}]\\)")))))
9069 @c Cross References
9071 @c See existing cross-references to the Emacs manual and the Emacs
9072 @c Lisp manual (search for ``GNU Emacs Manual'' and ``GNU
9073 @c Emacs Lisp Reference Manual'' respectively).
9075 @c @ftable Sorting
9077 @c As per index (sort of): Punctuation, keyboard characters (such as
9078 @c RET and BS) upper and lowercase mixed (lower comes before
9079 @c uppercase), control characters go with uppercase C, meta characters
9080 @c go with uppercase M.
9081 @c In some cases, the sort isn't strictly ASCII.
9082 @c For example, SPC (mh-page-msg) reads better before BS
9083 @c (mh-previous-page) and . (mh-show) is better before ,
9084 @c (mh-header-display).
9086 @c @vtable Sorting
9088 @c Alphabetical, pull hooks into their own table.
9090 @c Local Variables:
9091 @c sentence-end-double-space: nil
9092 @c End: