Merge from origin/emacs-26
[emacs.git] / doc / misc / mh-e.texi
blob85455257475dbb71c939a10fff98394a5f83d791
1 \input texinfo   @c -*- mode: texinfo; coding: utf-8; -*-
2 @c
3 @c Note: This document requires makeinfo version 4.6 or greater to build.
4 @c
5 @c %**start of header
6 @setfilename ../../info/mh-e.info
7 @settitle The MH-E Manual
8 @include docstyle.texi
9 @c %**end of header
11 @c Version of the software and manual.
12 @set VERSION 8.6
13 @c Edition of the manual. It is either empty for the first edition or
14 @c has the form ", nth Edition" (without the quotes).
15 @set EDITION
16 @set UPDATED 2016-04-29
17 @set UPDATE-MONTH April, 2016
19 @c Other variables.
20 @set MH-BOOK-HOME http://rand-mh.sourceforge.net/book/mh
21 @set MH-E-HOME http://mh-e.sourceforge.net/
23 @c Copyright
24 @copying
25 This is version @value{VERSION}@value{EDITION} of @cite{The MH-E
26 Manual}, last updated @value{UPDATED}.
28 Copyright @copyright{} 1995, 2001--2003, 2005--2018 Free Software
29 Foundation, Inc.
31 @c This dual license has been agreed upon by the FSF.
33 @quotation
34 Permission is granted to copy, distribute and/or modify this document
35 under the terms of either:
37 @enumerate a
38 @item
39 the GNU Free Documentation License, Version 1.3 or any later version
40 published by the Free Software Foundation; with no Invariant Sections,
41 with the Front-Cover Texts being ``A GNU Manual,'' and with the
42 Back-Cover Texts as in (a) below. A copy of the license is included in
43 the section entitled ``GNU Free Documentation License.''
45 (a) The FSF's Back-Cover Text is: ``You have the freedom to copy and
46 modify this GNU manual.''
48 @item
49 the GNU General Public License as published by the Free Software
50 Foundation; either version 3, or (at your option) any later version. A
51 copy of the license is included in the section entitled ``GNU General
52 Public License.''
53 @end enumerate
55 @end quotation
56 @end copying
58 @c Info Directory Entry
59 @dircategory Emacs network features
60 @direntry
61 * MH-E: (mh-e).                 Emacs interface to the MH mail system.
62 @end direntry
64 @c Title Page
65 @titlepage
66 @title The MH-E Manual
67 @subtitle Version @value{VERSION}@value{EDITION}
68 @subtitle @value{UPDATE-MONTH}
69 @author Bill Wohler
71 @c Copyright Page
72 @page
73 @vskip 0pt plus 1filll
74 @insertcopying
75 @end titlepage
77 @ifnottex
78 @html
79 <!--
80 @end html
81 @node Top, Preface, (dir), (dir)
82 @top The MH-E Manual
83 @html
84 -->
85 @end html
86 @insertcopying
87 @end ifnottex
89 @c Table of Contents
90 @contents
92 @html
93 <!--
94 @end html
96 @menu
97 * Preface::                     Preface
98 * Conventions::                 GNU Emacs Terms and Conventions
99 * Getting Started::             Getting Started
100 * Tour Through MH-E::           Tour Through MH-E
101 * Using This Manual::           Using This Manual
102 * Incorporating Mail::          Incorporating Mail
103 * Reading Mail::                Reading Mail
104 * Folders::                     Organizing Your Mail with Folders
105 * Sending Mail::                Sending Mail
106 * Editing Drafts::              Editing a Draft
107 * Aliases::                     Aliases
108 * Identities::                  Identities
109 * Speedbar::                    The Speedbar
110 * Menu Bar::                    The Menu Bar
111 * Tool Bar::                    The Tool Bar
112 * Searching::                   Searching Through Messages
113 * Threading::                   Viewing Message Threads
114 * Limits::                      Limiting Display
115 * Sequences::                   Using Sequences
116 * Junk::                        Dealing With Junk Mail
117 * Miscellaneous::               Miscellaneous Commands, Variables, and Buffers
118 * Scan Line Formats::           Scan Line Formats
119 * Procmail::                    Reading Mailing Lists Effectively
120 * Odds and Ends::               Odds and Ends
121 * History::                     History of MH-E
122 * GFDL::                        GNU Free Documentation License
123 * GPL::                         GNU General Public License
124 * Key Index::                   Key (Character) Index
125 * Command Index::               Command Index
126 * Option Index::                Option (Variable) Index
127 * Concept Index::               Concept Index
129 @detailmenu
130  --- The Detailed Node Listing ---
132 Tour Through MH-E
134 * Sending Mail Tour::
135 * Reading Mail Tour::
136 * Processing Mail Tour::
137 * Leaving MH-E::
138 * More About MH-E::
140 Using This Manual
142 * Options::
143 * Ranges::
144 * Folder Selection::
146 Reading Your Mail
148 * Viewing::
149 * Viewing Attachments::
150 * HTML::
151 * Digests::
152 * Reading PGP::
153 * Printing::
154 * Files and Pipes::
155 * Navigating::
156 * Miscellaneous Commands and Options::
158 Sending Mail
160 * Composing::
161 * Replying::
162 * Forwarding::
163 * Redistributing::
164 * Editing Again::
166 Editing a Draft
168 * Editing Message::
169 * Inserting Letter::
170 * Inserting Messages::
171 * Signature::
172 * Picture::
173 * Adding Attachments::
174 * Sending PGP::
175 * Checking Recipients::
176 * Sending Message::
177 * Killing Draft::
179 Odds and Ends
181 * Bug Reports::
182 * Mailing Lists::
183 * MH FAQ and Support::
184 * Getting MH-E::
186 History of MH-E
188 * From Brian Reid::
189 * From Jim Larus::
190 * From Stephen Gildea::
191 * From Bill Wohler::
193 @end detailmenu
194 @end menu
196 @html
198 @end html
200 @node Preface, Conventions, Top, Top
201 @unnumbered Preface
203 @cindex Emacs
204 @cindex Unix commands, Emacs
205 @cindex preface
207 This manual introduces another interface to the MH mail system that is
208 accessible through the GNU Emacs editor, namely, @emph{MH-E}. MH-E is
209 easy to use. I don't assume that you know GNU Emacs or even MH at this
210 point, since I didn't know either of them when I discovered MH-E@.
211 However, MH-E was the tip of the iceberg, and I discovered more and
212 more niceties about GNU Emacs and MH@. Now I'm fully hooked on both of
213 them.
215 The MH-E package is distributed with Emacs@footnote{Version
216 @value{VERSION} of MH-E appeared in Emacs 24.4. It is supported in GNU
217 Emacs 23 and higher, as well as XEmacs 21.4.22 and 21.5.31. MH-E is
218 known not to work with GNU Emacs versions 20 and below, and XEmacs
219 version 21.5.9--21.5.16. It is compatible with MH versions 6.8.4 and
220 higher, all versions of nmh, and GNU mailutils 1.0 and higher}, so you
221 shouldn't have to do anything special to use it. Gnus is also
222 required; version 5.10 or higher is recommended. This manual covers
223 MH-E version @value{VERSION}. To help you decide which version you
224 have, see @ref{Getting Started}.
226 @findex help-with-tutorial
227 @kindex C-h t
229 If you don't already use GNU Emacs but want to learn more, you can
230 read a built-in tutorial by starting GNU Emacs and typing @kbd{C-h t}
231 (@code{help-with-tutorial}). (To learn about this notation, see
232 @ref{Conventions}.) If you want to take the plunge, consult the
233 @iftex
234 @cite{GNU Emacs Manual},
235 @end iftex
236 @ifinfo
237 @ref{Top, , GNU Emacs Manual, emacs, GNU Emacs Manual},
238 @end ifinfo
239 @ifhtml
240 @uref{https://www.gnu.org/software/emacs/manual/html_node/emacs/,
241 @cite{GNU Emacs Manual}},
242 @end ifhtml
243 from the Free Software Foundation.
245 If more information is needed, you can go to the Unix manual pages of
246 the individual MH commands. When the name is not obvious, I'll guide
247 you to a relevant MH manual page that describes the action more fully.
249 @c ":" does not work in index entries in Info.
250 @cindex @cite{MH & nmh - Email for Users & Programmers}
251 @cindex MH book
252 @cindex info
253 @kindex C-h i
255 This manual is available in both Info and online formats. The Info
256 version is distributed with Emacs and can be accessed with the
257 @command{info} command (@samp{info mh-e}) or within Emacs (@kbd{C-h i
258 m mh-e @key{RET}}). The online version is available at
259 @uref{http://mh-e.sourceforge.net/manual/, SourceForge}. Another great
260 online resource is the book
261 @uref{http://rand-mh.sourceforge.net/book/, @cite{MH & nmh: Email for
262 Users & Programmers}} (also known as @dfn{the MH book}).
264 I hope you enjoy this manual! If you have any comments, or suggestions
265 for this document, please let me know.
267 @cindex Bill Wohler
268 @cindex Wohler, Bill
270 @noindent
271 Bill Wohler <@i{wohler at newt.com}>@*
272 8 February 1995@*
273 24 February 2006
275 @node Conventions, Getting Started, Preface, Top
276 @chapter GNU Emacs Terms and Conventions
278 @cindex Emacs
279 @cindex Emacs, conventions
280 @cindex Emacs, terms
281 @cindex Unix commands, Emacs
282 @cindex conventions, Emacs
283 @cindex terms, Emacs
285 If you're an experienced Emacs user, you can skip the following
286 conventions and definition of terms and go directly to the next
287 section (@pxref{Getting Started}).
289 @cindex Emacs commands
290 @cindex MH commands
291 @cindex Unix commands
292 @cindex commands
293 @cindex commands, MH
294 @cindex commands, Unix
295 @cindex commands, shell
296 @cindex functions
297 @cindex shell commands
299 In general, @dfn{functions} in this text refer to Emacs Lisp functions
300 that one would call from within Emacs Lisp programs (for example,
301 @code{(mh-inc-folder)}). On the other hand, @dfn{commands} are those
302 things that are run by the user, such as @kbd{i} or @kbd{M-x
303 mh-inc-folder}. Programs outside of Emacs are specifically called MH
304 commands, shell commands, or Unix commands.
306 @cindex conventions, key names
307 @cindex key names
309 The conventions for key names are as follows:
311 @table @kbd
312 @item C-x
313 Hold down the @key{CTRL} (Control) key and press the @kbd{x} key.
314 @c -------------------------
315 @item M-x
316 Hold down the @key{META} or @key{ALT} key and press the @kbd{x} key.
318 Since some keyboards don't have a @key{META} key, you can generate
319 @kbd{M-x}, for example, by pressing @key{ESC} (Escape),
320 @emph{releasing it}, and then pressing the @kbd{x} key.
321 @c -------------------------
322 @item @key{RET}
323 Press the @key{RETURN} or @key{ENTER} key. This is normally used to
324 complete a command.
325 @c -------------------------
326 @item @key{SPC}
327 Press the space bar.
328 @c -------------------------
329 @item @key{TAB}
330 Press the @key{TAB} key.
331 @c -------------------------
332 @item @key{DEL}
333 Press the @key{DELETE} key.
334 @c -------------------------
335 @item @key{BS}
336 Press the @key{BACKSPACE} key@footnote{If you are using Version 20 or
337 earlier of Emacs, you will need to use the @key{DEL} key.}.
338 @end table
340 @cindex Emacs, prefix argument
341 @cindex prefix argument
342 @kindex C-u
344 A @dfn{prefix argument} allows you to pass an argument to any Emacs
345 function. To pass an argument, type @kbd{C-u} before the Emacs command
346 or keystroke. Numeric arguments can be passed as well. For example, to
347 insert five f's, use @kbd{C-u 5 f}. There is a default of four when
348 using @kbd{C-u}, and you can use multiple prefix arguments to provide
349 arguments of powers of four. To continue our example, you could insert
350 four f's with @kbd{C-u f}, 16 f's with @kbd{C-u C-u f}, 64 f's with
351 @kbd{C-u C-u C-u f}, and so on. Numeric and valueless negative
352 arguments can also be inserted with the @key{META} key. Examples
353 include @kbd{M-5} to specify an argument of 5, or @kbd{M--} which
354 specifies a negative argument with no particular value.
356 @sp 1
357 @center @strong{NOTE}
359 @quotation
360 The prefix @kbd{C-u} or @kbd{M-} is not necessary in MH-E's MH-Folder
361 mode (@pxref{Reading Mail Tour}). In this mode, simply enter the
362 numerical argument before entering the command.
363 @end quotation
364 @sp 1
366 @cindex @file{.emacs}
367 @cindex Emacs, variables
368 @cindex files, @file{.emacs}
369 @cindex variables
370 @findex setq
372 Emacs uses @dfn{variables} to hold values. These can be changed via
373 calls to the function @code{setq} in @file{~/.emacs}.
375 @cindex Emacs, options
376 @cindex options
377 @findex customize-group
378 @findex customize-option
380 Variables in MH-E that are normally modified by the user are called
381 @dfn{options} and are modified through the customize functions (such
382 as @kbd{M-x customize-option} or @kbd{M-x customize-group}).
383 @ifnothtml
384 @xref{Easy Customization,,,emacs,The GNU Emacs Manual}, in @cite{The
385 GNU Emacs Manual}.
386 @end ifnothtml
387 @ifhtml
388 See section
389 @uref{https://www.gnu.org/software/emacs/manual/html_node/emacs/Easy-Customization.html,
390 Easy Customization} in @cite{The GNU Emacs Manual}.
391 @end ifhtml
392 @xref{Options}.
394 @cindex Emacs, faces
395 @cindex faces
396 @cindex highlighting
397 @findex customize-face
399 You can specify various styles for displaying text using @dfn{faces}.
400 MH-E provides a set of faces that you can use to personalize the look
401 of your MH-E buffers. Use the command @kbd{M-x customize-face} to do
402 this.
403 @ifnothtml
404 @xref{Face Customization,,,emacs,The GNU Emacs Manual}, in @cite{The
405 GNU Emacs Manual}.
406 @end ifnothtml
407 @ifhtml
408 See section
409 @uref{https://www.gnu.org/software/emacs/manual/html_node/emacs/Face-Customization.html,
410 Face Customization} in @cite{The GNU Emacs Manual}.
411 @end ifhtml
413 @cindex abnormal hooks
414 @cindex hooks
415 @cindex normal hooks
416 @findex add-hook
417 @findex customize-option
419 Commands often offer @dfn{hooks} which enable you to extend or modify
420 the way a command works.
421 @ifnothtml
422 @ref{Hooks, , Hooks, emacs, The GNU Emacs Manual}, in @cite{The GNU
423 Emacs Manual}
424 @end ifnothtml
425 @ifhtml
426 See section
427 @uref{https://www.gnu.org/software/emacs/manual/html_node/emacs/Hooks.html,
428 Hooks} in @cite{The GNU Emacs Manual}
429 @end ifhtml
430 for a description about @dfn{normal hooks} and @dfn{abnormal hooks}.
431 MH-E uses normal hooks in nearly all cases, so you can assume that we
432 are talking about normal hooks unless we explicitly mention that a
433 hook is abnormal. We also follow the conventions described in that
434 section: the name of the abnormal hooks end in @code{-functions} and all
435 the rest of the MH-E hooks end in @code{-hook}. You can add hooks with
436 either @code{customize-option} or @code{add-hook}.
438 @cindex Emacs, mark
439 @cindex Emacs, point
440 @cindex Emacs, region
441 @cindex mark
442 @cindex point
443 @cindex region
444 @kindex C-@@
445 @kindex C-SPC
447 There are several other terms that are used in Emacs that you should
448 know. The @dfn{point} is where the cursor currently is. You can save
449 your current place in the file by setting a @dfn{mark}. This operation
450 is useful in several ways. The mark can be later used when defining a
451 @dfn{region}, which is the text between the point and mark. Many
452 commands operate on regions, such as those for deleting text or
453 filling paragraphs. A mark can be set with @kbd{C-@@} (or
454 @kbd{C-@key{SPC}}).
456 @cindex completion
457 @cindex Emacs, completion
458 @cindex Emacs, file completion
459 @cindex Emacs, folder completion
460 @cindex Emacs, minibuffer
461 @cindex file completion
462 @cindex folder completion
463 @cindex minibuffer
464 @kindex SPC
465 @kindex TAB
467 The @dfn{minibuffer} is the bottom line of the Emacs window, where all
468 prompting and multiple-character input is directed. You can use
469 @dfn{completion} to enter values such as folders. Completion means
470 that Emacs fills in text for you when you type @key{SPC} or @key{TAB}.
471 A second @key{SPC} or @key{TAB} will list all possibilities at that
472 point.
473 @ifnothtml
474 @xref{Completion, , Completion, emacs, The GNU Emacs Manual}.
475 @end ifnothtml
476 @ifhtml
477 See the section
478 @uref{https://www.gnu.org/software/emacs/manual/html_node/emacs/Completion.html,
479 Completion} in @cite{The GNU Emacs Manual}.
480 @end ifhtml
481 Note that @key{SPC} cannot be used for completing filenames and
482 folders.
484 @findex help-with-tutorial
485 @kindex C-h t
486 @kindex M-x
488 The minibuffer is also where you enter Emacs function names after
489 typing @kbd{M-x}. For example, in the preface, I mentioned that you
490 could obtain help with @kbd{C-h t} (@code{help-with-tutorial}). What
491 this means is that you can get a tutorial by typing either @kbd{C-h t}
492 or @kbd{M-x help-with-tutorial}. In the latter case, you are prompted
493 for @samp{help-with-tutorial} in the minibuffer after typing
494 @kbd{M-x}.
496 @cindex ~
498 The @samp{~} notation in filenames represents your home directory.
499 This notation is used by many shells including @command{bash},
500 @code{tcsh}, and @command{csh}. It is analogous to the environment
501 variable @samp{$HOME}. For example, @file{~/.emacs} can be written
502 @file{$HOME/.emacs} or using the absolute path as in
503 @file{/home/wohler/.emacs} instead.
505 @cindex Emacs, interrupting
506 @cindex Emacs, quitting
507 @cindex interrupting
508 @cindex quitting
510 @i{In case of trouble:} Emacs can be interrupted at any time with
511 @kbd{C-g}. For example, if you've started a command that requests that
512 you enter something in the minibuffer, but then you change your mind,
513 type @kbd{C-g} and you'll be back where you started. If you want to
514 exit Emacs entirely, use @kbd{C-x C-c}.
516 @node Getting Started, Tour Through MH-E, Conventions, Top
517 @chapter Getting Started
519 @cindex MH-E, versions
520 @cindex history
521 @cindex versions of MH-E
523 Because there are many old versions of MH-E out there, it is important
524 to know which version you have. I'll be talking about @w{Version 8}
525 which is pretty close to @w{Version 6} and @w{Version 7}. It differs
526 from @w{Version 4} and @w{Version 5} and is vastly different from
527 @w{Version 3}. @xref{History}.
529 @findex mh-version
531 To determine which version of MH-E that you have, enter @kbd{M-x
532 mh-version @key{RET}}. Hopefully it says that you're running
533 @w{Version @value{VERSION}} which is the latest version as of this
534 printing.
536 If your version is much older than this, please consider upgrading.
537 You can have your system administrator upgrade the system-wide
538 version, or you can install your own personal version. It's really
539 quite easy. @xref{Getting MH-E}, for instructions for getting and
540 installing MH-E.
542 If the @code{mh-version} command displays @samp{No MH variant
543 detected}@footnote{In very old versions of MH-E, you may get the error
544 message, @samp{Cannot find the commands `inc' and `mhl' and the file
545 `components'} if MH-E can't find MH@. In this case, you need to update
546 MH-E, and you may need to install MH too. However, newer versions of
547 MH-E are better at finding MH if it is on your system.}, then you need
548 to install MH or tell MH-E where to find MH.
550 @cindex Debian
551 @cindex nmh
552 @cindex GNU mailutils MH
554 If you don't have MH on your system already, you must install a
555 variant of MH@. The Debian mh-e package does this for you
556 automatically (@pxref{Getting MH-E}). Most people use
557 @uref{http://www.nongnu.org/nmh/, nmh}, but you may be interested in
558 trying out @uref{http://mailutils.org/, GNU mailutils MH}, which
559 supports IMAP@. Your GNU/Linux distribution probably has packages for
560 both of these.
562 @cindex @command{install-mh}
563 @cindex MH commands, @command{install-mh}
564 @cindex MH book
566 If you've never run MH before, you need to run @command{install-mh}
567 from the shell before you continue. This sets up your personal MH
568 environment@footnote{See the section
569 @uref{@value{MH-BOOK-HOME}/../overall/setup.html, Setting Up MH} in the
570 MH book.}. If you don't, you'll be greeted with the error message:
571 @samp{Install MH and run install-mh before running MH-E}. This is all
572 you need to know about MH to use MH-E, but the more you know about MH,
573 the more you can leverage its power. See the
574 @uref{@value{MH-BOOK-HOME}/../, MH book} to learn more about MH.
576 @cindex @samp{Path} MH profile component
577 @cindex MH profile
578 @cindex MH profile component
579 @cindex MH profile component, @samp{Path}
581 Your MH environment includes your @dfn{MH profile} which is found in
582 the file @file{~/.mh_profile}, or the file named in the environment
583 variable @samp{$MH}. This file contains a number of @dfn{MH
584 profile components}. For example, the @samp{Path:} MH profile
585 component contains the path to your mail directory, which is
586 @file{~/Mail} by default.
588 @cindex @command{mhparam}
589 @cindex MH commands, @command{mhparam}
590 @vindex exec-path
591 @vindex mh-path
592 @vindex mh-sys-path
593 @vindex mh-variant
594 @vindex mh-variant-in-use
596 There are several options MH-E uses to interact with your MH
597 installation. The option @code{mh-variant} specifies the variant used
598 by MH-E (@pxref{Options}). The default setting of this option is
599 @samp{Auto-detect} which means that MH-E will automatically choose the
600 first of nmh, MH, or GNU mailutils MH that it finds in the directories
601 listed in @code{mh-path} (which you can customize),
602 @code{mh-sys-path}, and @code{exec-path}. If MH-E can't find MH at
603 all, you may have to customize @code{mh-path} and add the directory in
604 which the command @command{mhparam} is located. If, on the other hand,
605 you have both nmh and GNU mailutils MH installed (for example) and
606 @code{mh-variant-in-use} was initialized to nmh but you want to use
607 GNU mailutils MH, then you can set @code{mh-variant} to
608 @samp{gnu-mh}.
610 @vindex mh-flists-present-flag
611 @vindex mh-lib
612 @vindex mh-lib-progs
613 @vindex mh-progs
615 When @code{mh-variant} is changed, MH-E resets @code{mh-progs},
616 @code{mh-lib}, @code{mh-lib-progs}, @code{mh-flists-present-flag}, and
617 @code{mh-variant-in-use} accordingly.
619 @cindex @file{.emacs}
620 @cindex files, @file{.emacs}
622 @sp 1
623 @center @strong{NOTE}
625 @quotation
626 Prior to version 8, it was often necessary to set some of these
627 variables in @file{~/.emacs}; now it is no longer necessary and can
628 actually cause problems.
629 @end quotation
630 @sp 1
632 @cindex MH profile component, @samp{Draft-Folder}
633 @cindex MH profile component, @samp{Path}
634 @cindex MH profile component, @samp{Previous-Sequence}
635 @cindex MH profile component, @samp{Unseen-Sequence}
636 @cindex @samp{Draft-Folder} MH profile component
637 @cindex @samp{Path} MH profile component
638 @cindex @samp{Previous-Sequence} MH profile component
639 @cindex @samp{Unseen-Sequence} MH profile component
640 @findex mh-find-path
641 @vindex mh-draft-folder
642 @vindex mh-find-path-hook
643 @vindex mh-inbox
644 @vindex mh-previous-seq
645 @vindex mh-unseen-seq
646 @vindex mh-user-path
648 In addition to setting variables that point to MH itself, MH-E also
649 sets a handful of variables that point to where you keep your mail.
650 During initialization, the function @code{mh-find-path} sets
651 @code{mh-user-path} from your @samp{Path:} MH profile component (but
652 defaults to @samp{Mail} if one isn't present), @code{mh-draft-folder}
653 from @samp{Draft-Folder:}, @code{mh-unseen-seq} from
654 @samp{Unseen-Sequence:}, @code{mh-previous-seq} from
655 @samp{Previous-Sequence:}, and @code{mh-inbox} from @samp{Inbox:}
656 (defaults to @samp{+inbox}). The hook @code{mh-find-path-hook} is run
657 after these variables have been set. This hook can be used the change
658 the value of these variables if you need to run with different values
659 between MH and MH-E.
661 @node Tour Through MH-E, Using This Manual, Getting Started, Top
662 @chapter Tour Through MH-E
664 @cindex introduction
665 @cindex tour
666 @cindex tutorial
668 This chapter introduces some of the terms you'll need to know and then
669 takes you on a tour of MH-E@footnote{The keys mentioned in these
670 chapters refer to the default key bindings. If you've changed the
671 bindings, refer to the command summaries at the beginning of each
672 chapter for a mapping between default key bindings and function
673 names.}. When you're done, you'll be able to send, read, and file
674 mail, which is all that a lot of people ever do. But if you're the
675 curious or adventurous type, read the rest of the manual to be able to
676 use all the features of MH-E@. I suggest you read this chapter first to
677 get the big picture, and then you can read the manual as you wish.
679 @menu
680 * Sending Mail Tour::
681 * Reading Mail Tour::
682 * Processing Mail Tour::
683 * Leaving MH-E::
684 * More About MH-E::
685 @end menu
687 @node Sending Mail Tour, Reading Mail Tour, Tour Through MH-E, Tour Through MH-E
688 @section Sending Mail
690 @cindex MH-Letter mode
691 @cindex mode
692 @cindex modes, MH-Letter
693 @cindex sending mail
694 @findex mh-smail
696 Let's start our tour by sending ourselves a message which we can later
697 read and process. Enter @kbd{M-x mh-smail} to invoke the MH-E program
698 to send messages. Your message appears in an Emacs buffer whose
699 mode@footnote{A @dfn{mode} changes Emacs to make it easier to edit a
700 particular type of text.} is MH-Letter.
702 Enter your login name in the @samp{To:} header field. Press the
703 @key{TAB} twice to move the cursor past the @samp{Cc:} field, since no
704 carbon copies are to be sent, and on to the @samp{Subject:} field.
705 Enter @kbd{Test} or anything else that comes to mind.
707 Press @key{TAB} again to move the cursor to the body of the message.
708 Enter some text, using normal Emacs commands. You should now have
709 something like this@footnote{If you're running Emacs under the X
710 Window System, then you would also see a menu bar and a tool bar. I've
711 left out the menu bar and tool bar in all of the example screens.}:
713 @cartouche
714 @smallexample
721 --:--  *scratch*   All L1     (Lisp Interaction)-------------------------
722 To: wohler
724 Subject: Test
725 X-Mailer: MH-E 8.1; nmh 1.1; GNU Emacs 23.1
726 --------
727 This is a test message to get the wheels churning...#
730 --:**  @{draft@}   All L5     (MH-Letter)----------------------------------
731 Type C-c C-c to send message, C-C ? for help
732 @end smallexample
733 @end cartouche
734 @i{MH-E message composition window}
736 Note the line of dashes that separates the header and the body of the
737 message. It is essential that these dashes (or a blank line) are
738 present or the body of your message will be considered to be part of
739 the header.
741 @cindex help
742 @findex describe-mode
743 @kindex C-c ?
744 @kindex C-c C-c
745 @kindex C-h m
747 There are several commands specific to MH-Letter mode@footnote{You can
748 get quick help for the commands used most often with @kbd{C-c ?} or
749 more complete help with the @kbd{C-h m} (@code{describe-mode})
750 command.}, but at this time we'll only use @kbd{C-c C-c} to send your
751 message. Type @kbd{C-c C-c} now. That's all there is to it!
753 @node Reading Mail Tour, Processing Mail Tour, Sending Mail Tour, Tour Through MH-E
754 @section Receiving Mail
756 @cindex @command{inc}
757 @cindex @command{scan}
758 @cindex MH commands, @command{inc}
759 @cindex MH commands, @command{scan}
760 @cindex MH-Folder mode
761 @cindex modes, MH-Folder
762 @cindex reading mail
763 @findex mh-rmail
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
779 @sp 1
780 @center @strong{NOTE}
782 @quotation
784 The @kbd{M-x mh-rmail} command will show you only new mail, not mail
785 you have already read. If you were to run this tour again, you would
786 use @kbd{F r} to pull all your messages into MH-E.
787 @end quotation
788 @sp 1
790 @kindex RET
791 @kindex n
792 @kindex p
794 You should see the scan line for your message, and perhaps others. Use
795 @kbd{n} or @kbd{p} to move the cursor to your test message and type
796 @key{RET} to read your message. You should see something like:
798 @cartouche
799 @smallexample
800   3 t08/24 root       received fax files on Wed Aug 24 11:00:13 PDT 1
801 # 4+t08/24 To:wohler  Test<<This is a test message to get the wheels
803 -:%%  @{+inbox/select@} 4 msgs (1-4)   Bot L4     (MH-Folder Show)---------
804 To: wohler
805 Subject: Test
806 X-Mailer: MH-E 8.1; nmh 1.1; GNU Emacs 23.1
807 Date: Fri, 17 Mar 2006 10:49:11 -0800
808 From: Bill Wohler <wohler@@stop.mail-abuse.org>
810 This is a test message to get the wheels churning...
814 --:--  @{show-+inbox@} 4   All L1     (MH-Show)----------------------------
816 @end smallexample
817 @end cartouche
818 @i{After incorporating new messages}
820 @kindex DEL
821 @kindex SPC
823 If you typed a long message, you can view subsequent pages with
824 @key{SPC} and previous pages with @key{DEL}.
826 @node Processing Mail Tour, Leaving MH-E, Reading Mail Tour, Tour Through MH-E
827 @section Processing Mail
829 @cindex processing mail
830 @kindex RET
831 @kindex r
833 The first thing we want to do is reply to the message that we sent
834 ourselves. Ensure that the cursor is still on the same line as your
835 test message and type @kbd{r}. You are prompted in the minibuffer with
836 @samp{Reply to whom:}. Here MH-E is asking whether you'd like to reply
837 to the original sender only, to the sender and primary recipients, or
838 to the sender and all recipients. You can press @key{TAB} to see these
839 choices. If you simply press @key{RET}, you'll reply only to the
840 sender. Press @key{RET} now.
842 You'll find yourself in an Emacs buffer similar to that when you were
843 sending the original message, like this:
845 @cartouche
846 @smallexample
849 Subject: Re: Test
850 In-Reply-To: <31054.1142621351@@stop.mail-abuse.org>
851 References: <31054.1142621351@@stop.mail-abuse.org>
852 Comments: In-Reply-To Bill Wohler <wohler@@stop.mail-abuse.org>
853    message dated "Fri, 17 Mar 2006 10:49:11 -0800."
854 X-Mailer: MH-E 8.1; nmh 1.1; GNU Emacs 23.1
855 --------
858 --:--  @{draft@}  All L10     (MH-Letter)----------------------------------
859 To: wohler
860 Subject: Test
861 X-Mailer: MH-E 8.1; nmh 1.1; GNU Emacs 23.1
862 Date: Fri, 17 Mar 2006 10:49:11 -0800
863 From: Bill Wohler <wohler@@stop.mail-abuse.org>
865 This is a test message to get the wheels churning...
867 --:--  @{show-+inbox@} 4   All L1     (MH-Show)----------------------------
868 Type C-c C-c to send message, C-c ? for help
869 @end smallexample
870 @end cartouche
871 @i{Composition window during reply}
873 @findex backward-char
874 @findex forward-char
875 @findex next-line
876 @findex previous-line
877 @kindex C-b
878 @kindex C-c C-c
879 @kindex C-c C-f C-t
880 @kindex C-f
881 @kindex C-n
882 @kindex C-p
883 @kindex BS
885 By default, MH will not add you to the address list of your replies,
886 so if you find that the @samp{To:} header field is missing, don't
887 worry. In this case, type @kbd{C-c C-f C-t} to create and go to the
888 @samp{To:} field, where you can type your login name again. You can
889 move around with the arrow keys or with @kbd{C-p}
890 (@code{previous-line}), @kbd{C-n} (@code{next-line}), @kbd{C-b}
891 (@code{backward-char}), and @kbd{C-f} (@code{forward-char}) and can
892 delete the previous character with @key{BS}. When you're finished
893 editing your message, send it with @kbd{C-c C-c} as before.
895 @cindex @command{refile}
896 @cindex MH commands, @command{refile}
897 @cindex folders
898 @kindex SPC
899 @kindex o
901 You'll often want to save messages that were sent to you in an
902 organized fashion. This is done with @dfn{folders}. You can use
903 folders to keep messages from your friends, or messages related to a
904 particular topic. With your cursor in the MH-Folder buffer and
905 positioned on the message you sent to yourself, type @kbd{o} to output
906 (@command{refile} in MH parlance) that message to a folder. Enter
907 @kbd{test} at the @samp{Destination folder:} prompt and type @kbd{y}
908 (or @key{SPC}) when MH-E asks to create the folder @samp{+test}. Note
909 that a @samp{^} (caret) appears next to the message number, which
910 means that the message has been marked for refiling but has not yet
911 been refiled. We'll talk about how the refile is actually carried out
912 in a moment.
914 @cindex MH-Folder mode
915 @cindex modes, MH-Folder
916 @kindex d
917 @kindex i
918 @kindex RET
919 @kindex n
920 @kindex p
921 @kindex x
923 Your previous reply is now waiting in the system mailbox. You
924 incorporate this mail into your MH-Folder buffer named @samp{+inbox}
925 with the @kbd{i} command. Do this now. After the mail is incorporated,
926 use @kbd{n} or @kbd{p} to move the cursor to the new message, and read
927 it with @key{RET}. Let's delete this message by typing @kbd{d}. Note
928 that a @samp{D} appears next to the message number. This means that
929 the message is marked for deletion but is not yet deleted. To perform
930 the deletion (and the refile we did previously), use the @kbd{x}
931 command.
933 @findex mh-smail
934 @kindex m
936 If you want to send another message you can use @kbd{m} instead of
937 @kbd{M-x mh-smail}. So go ahead, send some mail to your friends!
939 @cindex help
940 @cindex prefix characters
941 @findex describe-mode
942 @kindex ?
943 @kindex C-h m
944 @kindex F ?
946 You can get a quick reminder about these commands by typing @kbd{?}.
947 This lists several @dfn{prefix characters}. To list the commands
948 available via the prefix characters, type the prefix character
949 followed by a @kbd{?}, for example, @kbd{F ?}. More complete help is
950 available with the @kbd{C-h m} (@code{describe-mode}) command.
952 @node Leaving MH-E, More About MH-E, Processing Mail Tour, Tour Through MH-E
953 @section Leaving MH-E
955 @cindex Emacs, quitting
956 @cindex quitting
957 @kindex C-x C-c
958 @kindex x
960 You may now wish to exit @command{emacs} entirely. Use @kbd{C-x C-c}
961 to exit @command{emacs}. If you exited without running @kbd{x} in the
962 @samp{+inbox} buffer, Emacs will offer to save it for you. Type
963 @kbd{y} or @key{SPC} to save @samp{+inbox} changes, which means to
964 perform any refiles and deletes that you did there.
966 @findex mh-rmail
967 @kindex C-x b
968 @kindex C-x k
969 @kindex q
971 If you don't want to leave Emacs, you can type @kbd{q} to bury (hide)
972 the MH-E folder or delete it entirely with @kbd{C-x k}. You can then
973 later recall it with @kbd{C-x b} or @kbd{M-x mh-rmail}.
975 @cindex @command{packf}
976 @cindex MH commands, @command{packf}
977 @cindex exporting folders
978 @cindex folders, exporting
979 @cindex mbox-style folder
981 On the other hand, if you no longer want to use MH and MH-E, you can
982 take your mail with you. You can copy all of your mail into a single
983 file, mbox-style, by using the MH command @command{packf}. For
984 example, to create a file called @file{msgbox} with the messages in
985 your @samp{+inbox} folder, use @samp{packf +inbox}. The
986 @command{packf} command will append the messages to the file if it
987 already exists, so you can use @samp{folders -recurse -fast} in a
988 script to copy all of your messages into a single file, or using the
989 @samp{-file} argument, a file for each folder.
991 @node More About MH-E,  , Leaving MH-E, Tour Through MH-E
992 @section More About MH-E
994 These are the basic commands to get you going, but there are plenty
995 more. If you think that MH-E is for you, read the rest of the manual
996 to find out how you can:
998 @itemize @bullet
999 @item
1000 Print your messages (@pxref{Printing}).
1001 @c -------------------------
1002 @item
1003 Edit messages and include your signature (@pxref{Editing Drafts}).
1004 @c -------------------------
1005 @item
1006 Forward messages (@pxref{Forwarding}).
1007 @c -------------------------
1008 @item
1009 Read digests (@pxref{Digests}).
1010 @c -------------------------
1011 @item
1012 Edit bounced messages (@pxref{Editing Again}).
1013 @c -------------------------
1014 @item
1015 Send multimedia messages (@pxref{Adding Attachments}).
1016 @c -------------------------
1017 @item
1018 Read HTML messages (@pxref{HTML}).
1019 @c -------------------------
1020 @item
1021 Use aliases and identities (see @ref{Aliases}, @pxref{Identities}).
1022 @c -------------------------
1023 @item
1024 Create different views of your mail (see @ref{Threading}, @pxref{Limits}).
1025 @c -------------------------
1026 @item
1027 Deal with junk mail (@pxref{Junk}).
1028 @c -------------------------
1029 @item
1030 Handle signed and encrypted messages (see @ref{Reading PGP},
1031 @pxref{Sending PGP}).
1032 @c -------------------------
1033 @item
1034 Process mail that was sent with @command{shar} or @command{uuencode}
1035 (@pxref{Files and Pipes}).
1036 @c -------------------------
1037 @item
1038 Use sequences conveniently (@pxref{Sequences}).
1039 @c -------------------------
1040 @item
1041 Use the speedbar, tool bar, and menu bar (see @ref{Speedbar}, see @ref{Tool
1042 Bar}, @pxref{Menu Bar}).
1043 @c -------------------------
1044 @item
1045 Show header fields in different fonts (@pxref{Reading Mail}).
1046 @c -------------------------
1047 @item
1048 Find previously refiled messages (@pxref{Searching}).
1049 @c -------------------------
1050 @item
1051 Place messages in a file (@pxref{Files and Pipes}).
1052 @end itemize
1054 Remember that you can also use MH commands when you're not running
1055 MH-E (and when you are!).
1057 @node Using This Manual, Incorporating Mail, Tour Through MH-E, Top
1058 @chapter Using This Manual
1060 This chapter begins the meat of the manual which goes into more detail
1061 about every MH-E command and option.
1063 @cindex Emacs, info
1064 @cindex Emacs, built-in help
1065 @cindex info
1066 @cindex built-in help
1067 @findex describe-mode
1068 @findex mh-help
1069 @kindex ?
1070 @kindex C-c ?
1071 @kindex C-h C-h
1072 @kindex C-h C-k i
1073 @kindex C-h i
1074 @kindex C-h m
1076 There are many commands, but don't get intimidated. There are command
1077 summaries at the beginning of each chapter. In case you have or would
1078 like to rebind the keys, the command summaries also list the
1079 associated Emacs Lisp function. Furthermore, even if you're stranded
1080 on a desert island with a laptop and are without your manuals, you can
1081 get a summary of all these commands with GNU Emacs built-in help: use
1082 @kbd{C-h m} (@code{describe-mode}) for a brief summary of commands,
1083 @kbd{?} (@code{mh-help}) for an even briefer summary@footnote{This
1084 help appears in a buffer called @file{*MH-E Help*}
1085 (@pxref{Miscellaneous}).} (@kbd{C-c ?} in MH-Letter mode), or @kbd{C-h
1086 i} to read this manual via Info. The built-in help is quite good; try
1087 running @kbd{C-h C-h}. This brings up a list of available help topics,
1088 one of which displays the documentation for a given key (like @kbd{C-h
1089 k C-n}). Another useful help feature is to view the manual section
1090 that describes a given key (such as @kbd{C-h K i}). In addition,
1091 review @ref{Conventions}, if any of the GNU Emacs conventions are
1092 strange to you.
1094 In addition to all of the commands, it is also possible to reconfigure
1095 MH-E to fit the needs of even the most demanding user. The following
1096 chapters also describe all of the options, show the defaults, and make
1097 recommendations for customization.
1099 However, when customizing your mail environment, first try to change
1100 what you want in MH, and only change MH-E if changing MH is not
1101 possible. That way you will get the same behavior inside and outside
1102 GNU Emacs. Note that MH-E does not provide hooks for customizations
1103 that can be done in MH; this omission is intentional.
1105 @cindex Emacs Lisp Manual
1106 @cindex Emacs, Emacs Lisp Manual
1107 @cindex Emacs, info
1108 @cindex Emacs, online help
1109 @cindex info
1110 @cindex online help
1112 I hope I've included enough examples here to get you well on your way.
1113 If you want to explore Emacs Lisp further, a programming manual does
1114 exist,
1115 @c Yes, some of the stuff in the following sections is redundant, but
1116 @c TeX barfs if the @ifs are inside the @footnote.
1117 @iftex
1118 @footnote{The @cite{GNU Emacs Lisp Reference Manual} should be available
1119 via the Info system by typing @kbd{C-h i m Emacs Lisp
1120 @key{RET}}. It is also available online at @*
1121 @uref{https://www.gnu.org/software/emacs/manual/elisp.html}.}
1122 @end iftex
1123 @ifinfo
1124 @footnote{@xref{Top, The GNU Emacs Lisp Reference Manual, , elisp, GNU
1125 Emacs Lisp Reference Manual}, which should be available via the
1126 Info system. It is also available online at
1127 @uref{https://www.gnu.org/software/emacs/manual/elisp.html}.}
1128 @end ifinfo
1129 @ifhtml
1130 @footnote{The
1131 @uref{https://www.gnu.org/software/emacs/manual/elisp.html,
1132 The GNU Emacs Lisp Reference Manual} should be available via
1133 the Info system by typing @kbd{C-h i m Emacs Lisp @key{RET}}.}
1134 @end ifhtml
1135 and you can look at the code itself for examples. Look in the Emacs
1136 Lisp directory on your system (such as
1137 @file{/usr/local/share/emacs/lisp/mh-e}) and find all the @file{mh-*.el}
1138 files there. When calling MH-E and other Emacs Lisp functions directly
1139 from Emacs Lisp code, you'll need to know the correct arguments. Use
1140 the built-in help for this. For example, try @kbd{C-h f
1141 mh-execute-commands @key{RET}}. If you write your own functions,
1142 please do not prefix your symbols (variables and functions) with
1143 @samp{mh-}. This prefix is reserved for the MH-E package. To avoid
1144 conflicts with existing MH-E symbols, use a prefix like @samp{my-} or
1145 your initials. (Unless, of course, your initials happen to be @emph{mh}!)
1147 @menu
1148 * Options::
1149 * Ranges::
1150 * Folder Selection::
1151 @end menu
1153 @node Options, Ranges, Using This Manual, Using This Manual
1154 @section Options
1156 @cindex Emacs, customizing
1157 @cindex Emacs, setting options
1158 @cindex customizing MH-E
1159 @cindex setting options
1160 @findex customize-option
1161 @vindex mh-lpr-command-format@r{, example}
1163 Many string or integer options are easy to modify using @kbd{M-x
1164 customize-option}. For example, to modify the option that controls
1165 printing, you would run @kbd{M-x customize-option @key{RET}
1166 mh-lpr-command-format @key{RET}}. In the buffer that appears, modify
1167 the string to the right of the variable. For example, you may change
1168 the @command{lpr} command with @samp{nenscript -G -r -2 -i'%s'}. Then
1169 use the @samp{State} combo box and select @samp{Save for Future
1170 Sessions}. To read more about @code{mh-lpr-command-format}, see
1171 @ref{Printing}.
1173 @cindex nil
1174 @cindex off, option
1175 @cindex on, option
1176 @cindex option, turning on and off
1177 @cindex t
1178 @findex customize-option
1179 @vindex mh-bury-show-buffer-flag@r{, example}
1181 Options can also hold boolean values. In Emacs Lisp, the boolean
1182 values are @code{nil}, which means false, and @code{t}, which means
1183 true. The @code{customize-option} function makes it easy to change
1184 boolean values; simply click on the toggle button in the customize
1185 buffer to switch between @samp{on} (@code{t}) and @samp{off}
1186 (@code{nil}). For example, try setting @code{mh-bury-show-buffer-flag}
1187 to @samp{off} to keep the MH-Show buffer at the top of the buffer
1188 stack. Use the @samp{State} combo box and choose @samp{Set for Current
1189 Session} to see how the option affects the show buffer. Then choose
1190 the @samp{Erase Customization} menu item to reset the option to the
1191 default, which places the MH-Show buffer at the bottom of the buffer
1192 stack.
1194 @vindex mh-mhl-format-file@r{, example}
1196 The text usually says to turn on an option by setting it to a
1197 @emph{non-@code{nil}} value, because sometimes values other than
1198 @samp{on} are meaningful. An example of this is the variable
1199 @code{mh-mhl-format-file} (@pxref{Viewing}). Other options, such as
1200 hooks, involve a little more Emacs Lisp programming expertise.
1202 @cindex customization group, @samp{mh}
1203 @cindex @samp{mh} customization group
1204 @findex customize-group
1205 @findex mh-customize
1207 You can browse all of the MH-E options with the @code{customize-group}
1208 function. Try entering @kbd{M-x customize-group @key{RET} mh
1209 @key{RET}} to view the top-level options as well as buttons for all of
1210 the MH-E customization groups. Another way to view the MH-E
1211 customization group is to use @kbd{M-x mh-customize @key{RET}}.
1213 @node Ranges, Folder Selection, Options, Using This Manual
1214 @section Ranges
1216 @c Sync with mh-folder-mode docstring.
1218 @cindex message abbreviations
1219 @cindex message ranges
1220 @cindex ranges
1222 Many commands that operate on individual messages, such as
1223 @code{mh-forward} or @code{mh-refile-msg} take a @code{RANGE}
1224 argument. This argument can be used in several ways.
1226 @kindex C-u@r{, with ranges}
1228 If you provide the prefix argument @kbd{C-u} to these commands, then
1229 you will be prompted for the message range. This can be any valid MH
1230 range which can include messages, sequences (@pxref{Sequences}), and
1231 the abbreviations (described in the @command{mh}(1) man page):
1233 @table @samp
1234 @item <num1>-<num2>
1235 Indicates all messages in the range <num1> to <num2>, inclusive. The
1236 range must be nonempty.
1237 @c -------------------------
1238 @item <num>:N
1239 @itemx <num>:+N
1240 @itemx <num>:-N
1241 Up to N messages beginning with (or ending with) message num. Num may
1242 be any of the predefined symbols: first, prev, cur, next or last.
1243 @c -------------------------
1244 @item first:N
1245 @itemx prev:N
1246 @itemx next:N
1247 @itemx last:N
1248 The first, previous, next or last messages, if they exist.
1249 @c -------------------------
1250 @item all
1251 All of the messages.
1252 @end table
1254 For example, a range that shows all of these things is @samp{1 2 3
1255 5-10 last:5 unseen}.
1257 @vindex transient-mark-mode
1259 If the option @code{transient-mark-mode} is turned on and you set a
1260 region in the MH-Folder buffer, then the MH-E command will perform the
1261 operation on all messages in that region.
1263 @cindex @samp{mh-range} customization group
1264 @cindex customization group, @samp{mh-range}
1266 The @samp{mh-range} customization group contains a single option which
1267 affects how ranges are interpreted.
1269 @vtable @code
1270 @item mh-interpret-number-as-range-flag
1271 On means interpret a number as a range (default: @samp{on}).
1272 @end vtable
1274 @vindex mh-interpret-number-as-range-flag
1276 Since one of the most frequent ranges used is @samp{last:N}, MH-E will
1277 interpret input such as @samp{200} as @samp{last:200} if the
1278 @code{mh-interpret-number-as-range-flag} option is on (which is the
1279 default). If you need to scan just the message 200, then use the range
1280 @samp{200:1} or @samp{200-200}.
1282 @node Folder Selection,  , Ranges, Using This Manual
1283 @section Folder Selection
1285 @cindex completion, folders
1286 @cindex folders, completion
1287 @cindex folders, selecting
1289 When you choose a folder in MH-E via a command such as @kbd{o}
1290 (@code{mh-refile-msg}), completion is used to enter the folder
1291 @ifnothtml
1292 (@pxref{Completion, , , emacs, The GNU Emacs Manual}).
1293 @end ifnothtml
1294 @ifhtml
1295 (see the section
1296 @uref{https://www.gnu.org/software/emacs/manual/html_node/emacs/Completion.html,
1297 Completion} in @cite{The GNU Emacs Manual}).
1298 @end ifhtml
1299 In addition, MH-E has several ways of choosing a suitable default so
1300 that the folder can often be selected with a single @key{RET} key.
1302 @cindex customization group, @samp{mh-folder-selection}
1303 @cindex @samp{mh-folder-selection} customization group
1305 The @samp{mh-folder-selection} customization group contains some
1306 options which are used to help with this.
1308 @vtable @code
1309 @item mh-default-folder-for-message-function
1310 Function to select a default folder for refiling or @samp{Fcc:}
1311 (default: @code{nil}).
1312 @c -------------------------
1313 @item mh-default-folder-list
1314 List of addresses and folders (default: @code{nil}).
1315 @c -------------------------
1316 @item mh-default-folder-must-exist-flag
1317 On means guessed folder name must exist to be used (default:
1318 @samp{on}).
1319 @c -------------------------
1320 @item mh-default-folder-prefix
1321 Prefix used for folder names generated from aliases (default: @code{""}).
1322 @end vtable
1324 @vindex mh-default-folder-for-message-function
1326 You can set the option @code{mh-default-folder-for-message-function}
1327 to a function that provides a default folder for the message to be
1328 refiled. When this function is called, the current buffer contains the
1329 message being refiled and point is at the start of the message. This
1330 function should return the default folder as a string with a leading
1331 @samp{+} sign. It can also return @code{nil} so that the last folder
1332 name is used as the default, or an empty string to suppress the
1333 default entirely.
1335 Otherwise, the name of the destination folder is derived from the
1336 sender as follows:
1338 @enumerate
1339 @vindex mh-default-folder-list
1340 @item
1341 The folder name associated with the first address found in the list
1342 @code{mh-default-folder-list} is used. Each element in this list
1343 contains a @samp{Check Recipient} item. If this item is turned on,
1344 then the address is checked against the recipient instead of the
1345 sender. This is useful for mailing lists.
1346 @c -------------------------
1347 @vindex mh-default-folder-prefix
1348 @item
1349 An alias prefixed by @code{mh-default-folder-prefix} corresponding to
1350 the address is used. The prefix is used to prevent clutter in your
1351 mail directory. @xref{Aliases}.
1352 @end enumerate
1354 @vindex mh-default-folder-must-exist-flag
1356 If the derived folder does not exist, and
1357 @code{mh-default-folder-must-exist-flag} is @code{t}, then the last
1358 folder name used is suggested. This is useful if you get mail from
1359 various people for whom you have an alias, but file them all in the
1360 same project folder.
1362 @node Incorporating Mail, Reading Mail, Using This Manual, Top
1363 @chapter Incorporating Your Mail
1365 @cindex @samp{Folder} menu
1366 @cindex incorporating
1367 @cindex menu, @samp{Folder}
1369 This chapter talks about getting mail from your system mailbox into
1370 your MH @samp{+inbox} folder. The following command accomplishes that
1371 and is found in the @samp{Folder} menu.
1373 @table @kbd
1374 @cindex @samp{Folder > Incorporate New Mail} menu item
1375 @cindex menu item, @samp{Folder > Incorporate New Mail}
1376 @findex mh-inc-folder
1377 @kindex i
1378 @item i
1379 Incorporate new mail into a folder (@code{mh-inc-folder}).
1380 @end table
1382 @cindex @samp{mh-inc} customization group
1383 @cindex customization group, @samp{mh-inc}
1385 The following options in the @samp{mh-inc} customization group are
1386 used.
1388 @vtable @code
1389 @item mh-inc-prog
1390 Program to incorporate mail (default: @code{"inc"}).
1391 @c -------------------------
1392 @item mh-inc-spool-list
1393 Alternate spool files (default: @code{nil}).
1394 @end vtable
1396 The following hook is available.
1398 @vtable @code
1399 @findex mh-inc-folder
1400 @item mh-inc-folder-hook
1401 Hook run by @code{mh-inc-folder} after incorporating mail into a
1402 folder (default: @code{nil}).
1403 @end vtable
1405 @cindex @samp{+inbox}
1406 @findex mh-inc-folder
1407 @kindex i
1409 If at any time you receive new mail, incorporate the new mail into
1410 your @samp{+inbox} buffer with @kbd{i} (@code{mh-inc-folder}). Note
1411 that @kbd{i} will display the @samp{+inbox} buffer, even if there
1412 isn't any new mail. You can incorporate mail from any file into the
1413 current folder by specifying a prefix argument; you'll be prompted for
1414 the name of the file to use as well as the destination folder (for
1415 example, @kbd{C-u i ~/mbox @key{RET} +tmp @key{RET}}).
1417 @cindex @file{.emacs}
1418 @cindex Emacs, notification of new mail
1419 @cindex files, @file{.emacs}
1420 @cindex new mail
1421 @cindex notification of new mail
1423 Emacs can notify you when you have new mail by displaying @samp{Mail}
1424 in the mode line. To enable this behavior, and to have a clock in the
1425 mode line as well, add the following to @file{~/.emacs}:
1427 @findex display-time
1429 @smalllisp
1430 (display-time)
1431 @end smalllisp
1433 @cindex @command{inc}
1434 @cindex incorporating
1435 @cindex MH commands, @command{inc}
1436 @vindex mh-inc-prog
1437 @vindex mh-progs
1439 The name of the program that incorporates new mail is stored in
1440 @code{mh-inc-prog}; it is @code{"inc"} by default. This program
1441 generates a one-line summary for each of the new messages. Unless it
1442 is an absolute pathname, the file is assumed to be in the
1443 @code{mh-progs} directory (@pxref{Getting Started}). You may also link
1444 a file to @command{inc} that uses a different format (see
1445 @samp{mh-profile}(5), and sections
1446 @uref{@value{MH-BOOK-HOME}/reapre.html, Reading Mail: inc show next
1447 prev} and @uref{@value{MH-BOOK-HOME}/mhstr.html, MH Format Strings} in
1448 the MH book). You'll then need to modify several variables
1449 appropriately (@pxref{Scan Line Formats}).
1451 @vindex mh-inc-spool-list
1453 You can use the @code{mh-inc-spool-list} variable to direct MH-E to
1454 retrieve mail from arbitrary spool files other than your system
1455 mailbox, file it in folders other than your @samp{+inbox}, and assign
1456 key bindings to incorporate this mail.
1458 @cindex @command{procmail}
1459 @cindex @file{.procmailrc}
1460 @cindex Unix commands, @command{procmail}
1461 @cindex files, @file{.procmailrc}
1463 Suppose you are subscribed to the @i{mh-e-devel} mailing list and you
1464 use @command{procmail} to filter this mail into @file{~/mail/mh-e}
1465 with the following recipe in @file{.procmailrc}:
1467 @smallexample
1468 PATH=$PATH:/usr/bin/mh
1469 MAILDIR=$HOME/`mhparam Path`
1471 * ^From mh-e-devel-admin@@stop.mail-abuse.org
1472 mh-e
1473 @end smallexample
1475 @findex mh-inc-spool-*
1476 @kindex I *
1478 In order to incorporate @file{~/mail/mh-e} into @samp{+mh-e} with an
1479 @kbd{I m} (@code{mh-inc-spool-mh-e}) command, customize this option,
1480 and click on the @samp{INS} button. Enter a @samp{Spool File} of
1481 @samp{~/mail/mh-e}, a @samp{Folder} of @samp{mh-e}, and a @samp{Key
1482 Binding} of @samp{m}.
1484 @cindex @command{emacsclient}
1485 @cindex @command{gnuclient}
1486 @cindex @command{xbuffy}
1487 @cindex @samp{gnuserv}
1488 @cindex Unix commands, @command{emacsclient}
1489 @cindex Unix commands, @command{gnuclient}
1490 @cindex Unix commands, @command{xbuffy}
1492 You can use @command{xbuffy} to automate the incorporation of this
1493 mail using the Emacs 23 command @command{emacsclient} as follows:
1495 @smallexample
1496 box ~/mail/mh-e
1497     title mh-e
1498     origMode
1499     polltime 10
1500     headertime 0
1501     command emacsclient --eval '(mh-inc-spool-mh-e)'
1502 @end smallexample
1504 In XEmacs, the command @command{gnuclient} is used in a similar
1505 fashion.
1507 @findex mh-inc-folder
1508 @kindex i
1509 @vindex mh-inc-folder-hook
1511 You can set the hook @code{mh-inc-folder-hook}, which is called after
1512 new mail is incorporated by the @kbd{i} (@code{mh-inc-folder})
1513 command. A good use of this hook is to rescan the whole folder either
1514 after running @kbd{M-x mh-rmail} the first time or when you've changed
1515 the message numbers from outside of MH-E.
1517 @findex mh-execute-commands
1518 @findex mh-rescan-folder@r{, example}
1519 @findex mh-show@r{, example}
1520 @vindex mh-inc-folder-hook@r{, example}
1522 @smalllisp
1523 @group
1524 (defun my-mh-inc-folder-hook ()
1525   "Hook to rescan folder after incorporating mail."
1526   (if (buffer-modified-p)            ; @r{if outstanding refiles and deletes,}
1527       (mh-execute-commands))         ;   @r{carry them out}
1528   (mh-rescan-folder)                 ; @r{synchronize with +inbox}
1529   (mh-show))                         ; @r{show the current message}
1531 (add-hook 'mh-inc-folder-hook 'my-mh-inc-folder-hook)
1533 @i{Rescan folder after incorporating new mail via mh-inc-folder-hook}
1535 @end group
1536 @end smalllisp
1538 @node Reading Mail, Folders, Incorporating Mail, Top
1539 @chapter Reading Your Mail
1541 @cindex @samp{+inbox}
1542 @cindex MH-Folder mode
1543 @cindex MH-Show mode
1544 @cindex modes, MH-Folder
1545 @cindex modes, MH-Show
1546 @cindex reading mail
1547 @findex mh-rmail
1548 @kindex F r
1549 @kindex F v
1551 The MH-E entry point for reading mail is @kbd{M-x mh-rmail}. This
1552 command incorporates your mail and creates a buffer called
1553 @samp{+inbox} in MH-Folder mode. The command @kbd{M-x mh-rmail} shows
1554 you only new mail, not mail you have already read@footnote{If you want
1555 to see your old mail as well, use @kbd{F r} to pull all your messages
1556 into MH-E@. Or, give a prefix argument to @code{mh-rmail} so it will
1557 prompt you for folder to visit like @kbd{F v} (for example, @kbd{C-u
1558 M-x mh-rmail @key{RET} bob @key{RET}}). @xref{Folders}.}.
1560 @findex display-time
1561 @vindex read-mail-command
1563 There are some commands that need to read mail, such as @kbd{mouse-2}
1564 over the @samp{Mail} button that @code{display-time} adds to the mode
1565 line. You can configure Emacs to have these commands use MH-E by
1566 setting the option @code{read-mail-command} to @samp{mh-rmail}.
1568 @cindex @command{scan}
1569 @cindex @samp{Message} menu
1570 @cindex MH commands, @command{scan}
1571 @cindex menu, @samp{Message}
1572 @cindex scan lines
1574 The @samp{+inbox} buffer contains @dfn{scan lines}, which are one-line
1575 summaries of each incorporated message. You can perform most MH
1576 commands on these messages via one- or two-letter commands in either
1577 the MH-Folder or MH-Show buffers or by using the @samp{Message} menu.
1578 See @command{scan}(1) for a description of the contents of the scan
1579 lines, and see the Figure in @ref{Reading Mail Tour}, for an example.
1581 @table @kbd
1582 @kindex ?
1583 @findex mh-help
1584 @item ?
1585 Display cheat sheet for the MH-E commands (@code{mh-help}).
1586 @c -------------------------
1587 @cindex @samp{Message > Show Message} menu item
1588 @cindex menu item, @samp{Message > Show Message}
1589 @kindex RET
1590 @findex mh-show
1591 @item @key{RET}
1592 Display message (@code{mh-show}).
1593 @c -------------------------
1594 @cindex @samp{Message > Show Message with Header} menu item
1595 @cindex menu item, @samp{Message > Show Message with Header}
1596 @kindex , @r{(comma)}
1597 @findex mh-header-display
1598 @item , (comma)
1599 Display message with all header fields (@code{mh-header-display}).
1600 @c -------------------------
1601 @cindex @samp{Message > Show Message with Preferred Alternative} menu item
1602 @cindex menu item, @samp{Message > Show Message with Preferred Alternative}
1603 @kindex : @r{(colon)}
1604 @findex mh-show-preferred-alternative
1605 @item : (colon)
1606 Display message with the default preferred alternative
1607 (@code{mh-show-preferred-alternative}).
1608 @c -------------------------
1609 @kindex ; @r{(semicolon)}
1610 @findex mh-toggle-mh-decode-mime-flag
1611 @item ; (semicolon)
1612 Toggle the value of @code{mh-decode-mime-flag}
1613 (@code{mh-toggle-mh-decode-mime-flag}).
1614 @c -------------------------
1615 @kindex SPC
1616 @findex mh-page-msg
1617 @item @key{SPC}
1618 Display next page in message (@code{mh-page-msg}).
1619 @c -------------------------
1620 @kindex BS
1621 @findex mh-previous-page
1622 @item @key{BS}
1623 Display previous page in message (@code{mh-previous-page}).
1624 @c -------------------------
1625 @cindex @samp{Message > Write Message to File...} menu item
1626 @cindex menu item, @samp{Message > Write Message to File...}
1627 @kindex >
1628 @findex mh-write-msg-to-file
1629 @item >
1630 Append message to end of file (@code{mh-write-msg-to-file}).
1631 @c -------------------------
1632 @cindex @samp{Message > Pipe Message to Command...} menu item
1633 @cindex menu item, @samp{Message > Pipe Message to Command...}
1634 @kindex |
1635 @findex mh-pipe-msg
1636 @item |
1637 Pipe message through shell command (@code{mh-pipe-msg}).
1638 @c -------------------------
1639 @kindex C-d
1640 @findex mh-delete-msg-no-motion
1641 @item C-d
1642 Delete range, don't move to next message
1643 (@code{mh-delete-msg-no-motion}).
1644 @c -------------------------
1645 @cindex @samp{Message > Delete Message} menu item
1646 @cindex menu item, @samp{Message > Delete Message}
1647 @kindex d
1648 @findex mh-delete-msg
1649 @item d
1650 Delete range (@code{mh-delete-msg}).
1651 @c -------------------------
1652 @kindex D ?
1653 @findex mh-prefix-help
1654 @item D ?
1655 Display cheat sheet for the commands of the current prefix in
1656 minibuffer (@code{mh-prefix-help}).
1657 @c -------------------------
1658 @kindex D SPC
1659 @findex mh-page-digest
1660 @item D @key{SPC}
1661 Display next message in digest (@code{mh-page-digest}).
1662 @c -------------------------
1663 @kindex D BS
1664 @findex mh-page-digest-backwards
1665 @item D @key{BS}
1666 Display previous message in digest (@code{mh-page-digest-backwards}).
1667 @c -------------------------
1668 @cindex @samp{Message > Burst Digest Message} menu item
1669 @cindex menu item, @samp{Message > Burst Digest Message}
1670 @kindex D b
1671 @findex mh-burst-digest
1672 @item D b
1673 Break up digest into separate messages (@code{mh-burst-digest}).
1674 @c -------------------------
1675 @cindex @samp{Message > Go to Message by Number...} menu item
1676 @cindex menu item, @samp{Message > Go to Message by Number...}
1677 @kindex g
1678 @findex mh-goto-msg
1679 @item g
1680 Go to a message (@code{mh-goto-msg}).
1681 @c -------------------------
1682 @kindex k
1683 @findex mh-delete-subject-or-thread
1684 @item k
1685 Delete messages with same subject or thread
1686 (@code{mh-delete-subject-or-thread}).
1687 @c -------------------------
1688 @kindex K ?
1689 @findex mh-prefix-help
1690 @item K ?
1691 Display cheat sheet for the commands of the current prefix in
1692 minibuffer (@code{mh-prefix-help}).
1693 @c -------------------------
1694 @kindex K TAB
1695 @findex mh-next-button
1696 @item K @key{TAB}
1697 Go to the next button (@code{mh-next-button}).
1698 @c -------------------------
1699 @kindex K S-TAB
1700 @findex mh-prev-button
1701 @item K S-@key{TAB}
1702 Go to the previous button (@code{mh-prev-button}).
1703 @c -------------------------
1704 @kindex K a
1705 @findex mh-mime-save-parts
1706 @item K a
1707 Save attachments (@code{mh-mime-save-parts}).
1708 @c -------------------------
1709 @kindex K e
1710 @findex mh-display-with-external-viewer
1711 @item K e
1712 View attachment externally (@code{mh-display-with-external-viewer}).
1713 @c -------------------------
1714 @kindex K i
1715 @findex mh-folder-inline-mime-part
1716 @item K i
1717 Show attachment verbatim (@code{mh-folder-inline-mime-part}).
1718 @c -------------------------
1719 @kindex K o
1720 @findex mh-folder-save-mime-part
1721 @item K o
1722 Save (output) attachment (@code{mh-folder-save-mime-part}).
1723 @c -------------------------
1724 @kindex K t
1725 @findex mh-toggle-mime-buttons
1726 @item K t
1727 Toggle option @code{mh-display-buttons-for-inline-parts-flag}
1728 (@code{mh-toggle-mime-buttons}).
1729 @c -------------------------
1730 @kindex K v
1731 @findex mh-folder-toggle-mime-part
1732 @item K v
1733 View attachment (@code{mh-folder-toggle-mime-part}).
1734 @c -------------------------
1735 @cindex @samp{Message > Modify Message} menu item
1736 @cindex menu item, @samp{Message > Modify Message}
1737 @kindex M
1738 @findex mh-modify
1739 @item M
1740 Edit message (@code{mh-modify}).
1741 @c -------------------------
1742 @cindex @samp{Message > Go to First Message} menu item
1743 @cindex menu item, @samp{Message > Go to First Message}
1744 @kindex M-<
1745 @findex mh-first-msg
1746 @item M-<
1747 Display first message (@code{mh-first-msg}).
1748 @c -------------------------
1749 @cindex @samp{Message > Go to Last Message} menu item
1750 @cindex menu item, @samp{Message > Go to Last Message}
1751 @kindex M->
1752 @findex mh-last-msg
1753 @item M->
1754 Display last message (@code{mh-last-msg}).
1755 @c -------------------------
1756 @kindex M-n
1757 @findex mh-next-unread-msg
1758 @item M-n
1759 Display next unread message (@code{mh-next-unread-msg}).
1760 @c -------------------------
1761 @kindex M-p
1762 @findex mh-previous-unread-msg
1763 @item M-p
1764 Display previous unread message (@code{mh-previous-unread-msg}).
1765 @c -------------------------
1766 @cindex @samp{Message > Next Message} menu item
1767 @cindex menu item, @samp{Message > Next Message}
1768 @kindex n
1769 @findex mh-next-undeleted-msg
1770 @item n
1771 Display next message (@code{mh-next-undeleted-msg}).
1772 @c -------------------------
1773 @cindex @samp{Message > Previous Message} menu item
1774 @cindex menu item, @samp{Message > Previous Message}
1775 @kindex p
1776 @findex mh-previous-undeleted-msg
1777 @item p
1778 Display previous message (@code{mh-previous-undeleted-msg}).
1779 @c -------------------------
1780 @kindex P ?
1781 @findex mh-prefix-help
1782 @item P ?
1783 Display cheat sheet for the commands of the current prefix in
1784 minibuffer (@code{mh-prefix-help}).
1785 @c -------------------------
1786 @kindex P C
1787 @findex mh-ps-print-toggle-color
1788 @item P C
1789 Toggle whether color is used in printing messages
1790 (@code{mh-ps-print-toggle-color}).
1791 @c -------------------------
1792 @kindex P F
1793 @findex mh-ps-print-toggle-faces
1794 @item P F
1795 Toggle whether printing is done with faces or not
1796 (@code{mh-ps-print-toggle-faces}).
1797 @c -------------------------
1798 @kindex P f
1799 @findex mh-ps-print-msg-file
1800 @item P f
1801 Print range to file (@code{mh-ps-print-msg-file}).
1802 @c -------------------------
1803 @cindex @samp{Message > Print Message} menu item
1804 @cindex menu item, @samp{Message > Print Message}
1805 @kindex P l
1806 @findex mh-print-msg
1807 @item P l
1808 Print range the old fashioned way
1809 (@code{mh-print-msg}).
1810 @c -------------------------
1811 @kindex P p
1812 @findex mh-ps-print-msg
1813 @item P p
1814 Print range (@code{mh-ps-print-msg}).
1815 @c -------------------------
1816 @kindex X ?
1817 @findex mh-prefix-help
1818 @item X ?
1819 Display cheat sheet for the commands of the current prefix in
1820 minibuffer (@code{mh-prefix-help}).
1821 @c -------------------------
1822 @cindex @samp{Message > Unpack Uuencoded Message...} menu item
1823 @cindex menu item, @samp{Message > Unpack Uuencoded Message...}
1824 @kindex X s
1825 @kindex X u
1826 @findex mh-store-msg
1827 @item X s
1828 @itemx X u
1829 Unpack message created with @command{uudecode} or @command{shar}
1830 (@code{mh-store-msg}).
1831 @c -------------------------
1832 @kindex mouse-2
1833 @findex mh-show-mouse
1834 @item mouse-2
1835 Move point to mouse event and show message (@code{mh-show-mouse}).
1836 @end table
1838 Within the MH-Show buffer, the following command is defined.
1840 @table @kbd
1841 @kindex RET
1842 @kindex mouse-1
1843 @kindex mouse-2
1844 @findex mh-press-button
1845 @item @key{RET}
1846 @itemx mouse-1
1847 @itemx mouse-2
1848 View contents of button (@code{mh-press-button}).
1849 @end table
1851 @cindex @samp{mh-show} customization group
1852 @cindex customization group, @samp{mh-show}
1854 The following table lists options in the @samp{mh-show} customization
1855 group that are used while reading mail.
1857 @vtable @code
1858 @item mh-bury-show-buffer-flag
1859 On means show buffer is buried (default: @samp{on}).
1860 @c -------------------------
1861 @item mh-clean-message-header-flag
1862 On means remove extraneous header fields (default: @samp{on}).
1863 @c -------------------------
1864 @item mh-decode-mime-flag
1865 On means attachments are handled (default: @samp{on} if the Gnus
1866 @samp{mm-decode} package is present).
1867 @c -------------------------
1868 @item mh-display-buttons-for-alternatives-flag
1869 On means display buttons for all alternative attachments (default:
1870 @samp{off}).
1871 @c -------------------------
1872 @item mh-display-buttons-for-inline-parts-flag
1873 On means display buttons for all inline attachments (default:
1874 @samp{off}).
1875 @c -------------------------
1876 @item mh-do-not-confirm-flag
1877 On means non-reversible commands do not prompt for confirmation
1878 (default: @samp{off}).
1879 @c -------------------------
1880 @item mh-fetch-x-image-url
1881 Control fetching of @samp{X-Image-URL:} header field image (default:
1882 @samp{Never Fetch}).
1883 @c -------------------------
1884 @item mh-graphical-smileys-flag
1885 On means graphical smileys are displayed (default: @samp{on}).
1886 @c -------------------------
1887 @item mh-graphical-emphasis-flag
1888 On means graphical emphasis is displayed (default: @samp{on}).
1889 @c -------------------------
1890 @item mh-highlight-citation-style
1891 Style for highlighting citations (default: @samp{Multicolor}).
1892 @c -------------------------
1893 @item mh-invisible-header-fields-default
1894 List of hidden header fields (default: a checklist too long to list
1895 here).
1896 @c -------------------------
1897 @item mh-invisible-header-fields
1898 Additional header fields to hide (default: @code{nil}).
1899 @c -------------------------
1900 @item mh-lpr-command-format
1901 Command used to print (default: @code{"lpr -J '%s'"}).
1902 @c -------------------------
1903 @item mh-max-inline-image-height
1904 Maximum inline image height if @samp{Content-Disposition:} is not
1905 present (default: 0).
1906 @c -------------------------
1907 @item mh-max-inline-image-width
1908 Maximum inline image width if @samp{Content-Disposition:} is not
1909 present(default: 0).
1910 @c -------------------------
1911 @item mh-mhl-format-file
1912 Specifies the format file to pass to the @command{mhl} program
1913 (default: @samp{Use Default mhl Format (Printing Only)}).
1914 @c -------------------------
1915 @item mh-mime-save-parts-default-directory
1916 Default directory to use for @kbd{K a}.
1917 @c -------------------------
1918 @item mh-print-background-flag
1919 On means messages should be printed in the background (default:
1920 @samp{off}).
1921 @c -------------------------
1922 @item mh-show-buffer-mode-line-buffer-id
1923 Format string to produce @code{mode-line-buffer-identification} for
1924 show buffers (default: @code{"    @{show-%s@} %d"}).
1925 @c -------------------------
1926 @item mh-show-maximum-size
1927 Maximum size of message (in bytes) to display automatically (default:
1929 @c -------------------------
1930 @item mh-show-use-xface-flag
1931 On means display face images in MH-Show buffers (default: @samp{on}).
1932 @c -------------------------
1933 @item mh-store-default-directory
1934 Default directory for @kbd{X s} (default: @samp{Current}).
1935 @c -------------------------
1936 @item mh-summary-height
1937 Number of lines in MH-Folder buffer (including the mode line)
1938 (default: depends on size of frame).
1939 @end vtable
1941 The following hooks are available.
1943 @vtable @code
1944 @item mh-delete-msg-hook
1945 Hook run after marking each message for deletion (default: @code{nil}).
1946 @c -------------------------
1947 @item mh-show-hook
1948 Hook run after @key{RET} shows a message (default: @code{nil}).
1949 @c -------------------------
1950 @item mh-show-mode-hook
1951 Hook run upon entry to @code{mh-show-mode} (default: @code{nil}).
1952 @end vtable
1954 The following faces are available.
1956 @vtable @code
1957 @item mh-show-cc
1958 Face used to highlight @samp{cc:} header fields.
1959 @c -------------------------
1960 @item mh-show-date
1961 Face used to highlight @samp{Date:} header fields.
1962 @c -------------------------
1963 @item mh-show-from
1964 Face used to highlight @samp{From:} header fields.
1965 @c -------------------------
1966 @item mh-show-header
1967 Face used to deemphasize less interesting header fields.
1968 @c -------------------------
1969 @item mh-show-pgg-bad
1970 Bad PGG signature face.
1971 @c -------------------------
1972 @item mh-show-pgg-good
1973 Good PGG signature face.
1974 @c -------------------------
1975 @item mh-show-pgg-unknown
1976 Unknown or untrusted PGG signature face.
1977 @c -------------------------
1978 @item mh-show-signature
1979 Signature face.
1980 @c -------------------------
1981 @item mh-show-subject
1982 Face used to highlight @samp{Subject:} header fields.
1983 @c -------------------------
1984 @item mh-show-to
1985 Face used to highlight @samp{To:} header fields.
1986 @c -------------------------
1987 @item mh-show-xface
1988 X-Face image face.
1989 @end vtable
1991 The functions and variables introduced here are explained in more
1992 detail in the following sections.
1994 @menu
1995 * Viewing::
1996 * Viewing Attachments::
1997 * HTML::
1998 * Digests::
1999 * Reading PGP::
2000 * Printing::
2001 * Files and Pipes::
2002 * Navigating::
2003 * Miscellaneous Commands and Options::
2004 @end menu
2006 @node Viewing, Viewing Attachments, Reading Mail, Reading Mail
2007 @section Viewing Your Mail
2009 @findex mh-header-display
2010 @findex mh-page-msg
2011 @findex mh-previous-page
2012 @findex mh-show
2013 @findex mh-show-mouse
2014 @kindex , @r{(comma)}
2015 @kindex . @r{(period)}
2016 @kindex BS
2017 @kindex RET
2018 @kindex SPC
2019 @kindex mouse-2
2021 The command @key{RET} (@code{mh-show}) displays the message that the
2022 cursor is on while @kbd{mouse-2} (@code{mh-show-mouse}) displays the
2023 message that the mouse cursor is on. If the message is already
2024 displayed, it scrolls to the beginning of the message. Use @key{SPC}
2025 (@code{mh-page-msg}) and @key{BS} (@code{mh-previous-page}) to move
2026 forwards and backwards one page at a time through the message. You can
2027 give either of these commands a prefix argument that specifies the
2028 number of lines to scroll (such as @kbd{10 @key{SPC}}). The @key{SPC}
2029 command will also show the next undeleted message if it is used at the
2030 bottom of a message. MH-E normally hides a lot of the superfluous
2031 header fields that mailers add to a message, but if you wish to see
2032 all of them, use the command @kbd{,} (comma;
2033 @code{mh-header-display}).
2035 @vindex mh-show-maximum-size
2037 The option @code{mh-show-maximum-size} provides an opportunity to skip
2038 over large messages which may be slow to load. The default value of 0
2039 means that all message are shown regardless of size.
2041 A litany of options control what displayed messages look like.
2043 @vindex mh-show-cc
2044 @vindex mh-show-date
2045 @vindex mh-show-from
2046 @vindex mh-show-header
2047 @vindex mh-show-subject
2048 @vindex mh-show-to
2050 First, the appearance of the header fields can be modified by
2051 customizing the associated face: @code{mh-show-to}, @code{mh-show-cc},
2052 @code{mh-show-from}, @code{mh-show-date}, and @code{mh-show-subject}.
2053 The face @code{mh-show-header} is used to deemphasize the other, less
2054 interesting, header fields.
2056 @cindex regular expressions, @code{mh-invisible-header-fields}
2057 @vindex mh-clean-message-header-flag
2058 @vindex mh-invisible-header-fields
2059 @vindex mh-invisible-header-fields-default
2061 Normally messages are delivered with a handful of uninteresting header
2062 fields. These are hidden by turning on the option
2063 @code{mh-clean-message-header-flag} (which it is by default). The
2064 header fields listed in the option
2065 @code{mh-invisible-header-fields-default} are hidden, although you can
2066 check off any field that you would like to see. Header fields that you
2067 would like to hide that aren't listed can be added to the option
2068 @code{mh-invisible-header-fields} with a couple of caveats. Regular
2069 expressions are not allowed. Unique fields should have a @samp{:}
2070 suffix; otherwise, the element can be used to render invisible an
2071 entire class of fields that start with the same prefix. If you think a
2072 header field should be generally ignored, please update
2073 @uref{https://sourceforge.net/p/mh-e/bugs/245/, SF #245}.
2075 @cindex header field, @samp{Face}
2076 @cindex header field, @samp{X-Face}
2077 @cindex header field, @samp{X-Image-URL}
2078 @cindex @samp{Face} header field
2079 @cindex @samp{X-Face} header field
2080 @cindex @samp{X-Image-URL} header field
2081 @vindex mh-show-use-xface-flag
2083 MH-E can display the content of @samp{Face:}, @samp{X-Face:}, and
2084 @samp{X-Image-URL:} header fields. If any of these fields occur in the
2085 header of your message, the sender's face will appear in the
2086 @samp{From:} header field. If more than one of these fields appear,
2087 then the first field found in the order @samp{Face:}, @samp{X-Face:},
2088 and @samp{X-Image-URL:} will be used. The option
2089 @code{mh-show-use-xface-flag} is used to turn this feature on and off.
2090 This feature will be turned on by default if your system supports it.
2092 The first header field used, if present, is the Gnus-specific
2093 @samp{Face:} field@footnote{The @samp{Face:} field appeared in GNU
2094 Emacs 21 and XEmacs. For more information, see
2095 @uref{http://quimby.gnus.org/circus/face/}.}.
2097 @cindex @command{uncompface}
2098 @cindex Emacs, packages, @samp{x-face}
2099 @cindex Unix commands, @command{uncompface}
2100 @cindex @samp{x-face} package
2101 @vindex mh-show-xface
2103 Next is the traditional @samp{X-Face:} header field@footnote{The
2104 display of this field requires the
2105 @uref{ftp://ftp.cs.indiana.edu/pub/faces/compface/compface.tar.Z,
2106 @command{uncompface} program}. Recent versions of XEmacs have internal
2107 support for @samp{X-Face:} images. If your version of XEmacs does not,
2108 then you'll need both @command{uncompface} and the
2109 @uref{http://www.jpl.org/ftp/pub/elisp/, @samp{x-face} package}.}. MH-E
2110 renders the foreground and background of the image using the
2111 associated attributes of the face @code{mh-show-xface}.
2113 @cindex @command{convert}
2114 @cindex @command{wget}
2115 @cindex ImageMagick
2116 @cindex Unix commands, @command{convert}
2117 @cindex Unix commands, @command{wget}
2118 @vindex mh-fetch-x-image-url
2120 Finally, MH-E will display images referenced by the
2121 @samp{X-Image-URL:} header field if neither the @samp{Face:} nor the
2122 @samp{X-Face:} fields are present@footnote{The display of the images
2123 requires the @uref{https://www.gnu.org/software/wget/wget.html,
2124 @command{wget} program} to fetch the image and the @command{convert}
2125 program from the @uref{http://www.imagemagick.org/script/index.php,
2126 ImageMagick suite}.}. Of the three header fields this is the most
2127 efficient in terms of network usage since the image doesn't need to be
2128 transmitted with every single mail. The option
2129 @code{mh-fetch-x-image-url} controls the fetching of the
2130 @samp{X-Image-URL:} header field image with the following values:
2132 @table @samp
2133 @item Ask Before Fetching
2134 You are prompted before the image is fetched. MH-E will remember your
2135 reply and will either use the already fetched image the next time the
2136 same URL is encountered or silently skip it if you didn't fetch it the
2137 first time. This is a good setting.
2138 @c -------------------------
2139 @item Never Fetch
2140 Images are never fetched and only displayed if they are already
2141 present in the cache. This is the default.
2142 @end table
2144 There isn't a value of @samp{Always Fetch} for privacy and DOS (denial
2145 of service) reasons. For example, fetching a URL can tip off a spammer
2146 that you've read his email (which is why you shouldn't blindly answer
2147 yes if you've set this option to @samp{Ask Before Fetching}). Someone
2148 may also flood your network and fill your disk drive by sending a
2149 torrent of messages, each specifying a unique URL to a very large
2150 file.
2152 @cindex @file{.mhe-x-image-cache}
2153 @cindex files, @file{.mhe-x-image-cache}
2155 The cache of images is found in the directory
2156 @file{.mhe-x-image-cache} within your MH directory. You can add your
2157 own face to the @samp{From:} field too. @xref{Picture}.
2159 @cindex @command{mhl}
2160 @cindex MH commands, @command{mhl}
2161 @vindex mh-mhl-format-file
2163 Normally MH-E takes care of displaying messages itself (rather than
2164 calling an MH program to do the work). If you'd rather have
2165 @command{mhl} display the message (within MH-E), change the option
2166 @code{mh-mhl-format-file} from its default value of @samp{Use Default
2167 mhl Format (Printing Only)}. You can set this option to @samp{Use
2168 Default mhl Format} to get the same output as you would get if you ran
2169 @command{mhl} from the shell. If you have a format file that you want
2170 MH-E to use, you can set this option to @samp{Specify an mhl Format
2171 File} and enter the name of your format file (@command{mhl}(1) or
2172 section @uref{@value{MH-BOOK-HOME}/shomes.html#Usisho, Using mhl} in
2173 the MH book tells you how to write one). Your format file should
2174 specify a non-zero value for @samp{overflowoffset} to allow MH-E to
2175 parse the header. Note that @command{mhl} is always used for printing
2176 and forwarding; in this case, the value of @code{mh-mhl-format-file}
2177 is consulted if you have specified a format file.
2179 @cindex citations, highlighting
2180 @cindex highlighting citations
2181 @vindex mh-highlight-citation-style
2183 If the sender of the message has cited other messages in his message,
2184 then MH-E will highlight these citations to emphasize the sender's
2185 actual response. The option @code{mh-highlight-citation-style} can be
2186 customized to change the highlighting style. The @samp{Multicolor}
2187 method uses a different color for each indentation while the
2188 @samp{Monotone} method highlights all citations in red. To disable
2189 highlighting of citations entirely, choose @samp{None}.
2191 @cindex URLs, highlighting
2192 @cindex email addresses, highlighting
2193 @cindex highlighting URLs
2194 @cindex highlighting email addresses
2195 @cindex links, following
2196 @findex goto-address-at-point
2197 @kindex C-c RET
2198 @kindex mouse-2
2199 @vindex goto-address-highlight-p
2201 Email addresses and URLs in the message are highlighted if the option
2202 @code{goto-address-highlight-p} is on, which it is by default. To view
2203 the web page for a highlighted URL or to send a message using a
2204 highlighted email address, use @kbd{mouse-2} or @kbd{C-c @key{RET}}
2205 (@code{goto-address-at-point}). @xref{Sending Mail}, to see how to
2206 configure Emacs to send the message using MH-E.
2208 @cindex boldface, showing
2209 @cindex emphasis
2210 @cindex italics, showing
2211 @cindex smileys
2212 @cindex typesetting
2213 @cindex underline, showing
2214 @vindex gnus-emphasis-alist
2215 @vindex mh-decode-mime-flag
2216 @vindex mh-graphical-emphasis-flag
2217 @vindex mh-graphical-smileys-flag
2219 It is a long standing custom to inject body language using a
2220 cornucopia of punctuation, also known as the @dfn{smileys}. MH-E can
2221 render these as graphical widgets if the option
2222 @code{mh-graphical-smileys-flag} is turned on, which it is by default.
2223 Smileys include patterns such as :-) and ;-). Similarly, a few
2224 typesetting features are indicated in ASCII text with certain
2225 characters. If your terminal supports it, MH-E can render these
2226 typesetting directives naturally if the option
2227 @code{mh-graphical-emphasis-flag} is turned on, which it is by
2228 default. For example, _underline_ will be
2229 @ifhtml
2230 @html
2231 <u>underlined</u>,
2232 @end html
2233 @end ifhtml
2234 @ifnothtml
2235 underlined,
2236 @end ifnothtml
2237 *bold* will appear in @b{bold}, /italics/ will appear in @i{italics},
2238 and so on. See the option @code{gnus-emphasis-alist} for the whole
2239 list. Both of these options are disabled if the option
2240 @code{mh-decode-mime-flag} is turned off. @xref{Viewing Attachments}.
2242 @cindex signature separator
2243 @cindex vCard
2244 @vindex mh-show-signature
2246 MH-E normally renders signatures and vCards in italics so that the
2247 body of the message stands out more. MH-E depends on the presence of
2248 the @dfn{signature separator} (@code{"-- "}) to do this. You can also
2249 customize the face @code{mh-show-signature} so the appearance of the
2250 signature block is more to your liking.
2252 @vindex mh-show-hook
2253 @vindex mh-show-mode-hook
2255 Two hooks can be used to control how messages are displayed. The first
2256 hook, @code{mh-show-mode-hook}, is called early on in the process of
2257 the message display. It is usually used to perform some action on the
2258 message's content. The second hook, @code{mh-show-hook}, is the last
2259 thing called after messages are displayed. It's used to affect the
2260 behavior of MH-E in general or when @code{mh-show-mode-hook} is too
2261 early.
2263 @cindex MH-Show mode
2264 @cindex modes, MH-Show
2265 @vindex mh-show-buffer-mode-line-buffer-id
2267 For those who like to modify their mode lines, use
2268 @code{mh-show-buffer-mode-line-buffer-id} to modify the mode line in
2269 the MH-Show buffers. Place the two escape strings @samp{%s} and
2270 @samp{%d}, which will display the folder name and the message number,
2271 respectively, somewhere in the string in that order. The default value
2272 of @code{"@{show-%s@} %d"} yields a mode line of
2274 @smallexample
2275 -----@{show-+inbox@} 4      (MH-Show)--Bot--------------------------------
2276 @end smallexample
2278 @node Viewing Attachments, HTML, Viewing, Reading Mail
2279 @section Viewing Attachments
2281 @cindex attachments
2282 @cindex body parts
2283 @cindex @command{mhshow}
2284 @cindex @command{show}
2285 @cindex MH commands, @command{mhshow}
2286 @cindex MH commands, @command{show}
2287 @cindex MIME
2288 @cindex multimedia mail
2290 MH has the ability to display @dfn{@sc{mime}} (Multipurpose Internet
2291 Mail Extensions) messages which are simply messages with additional
2292 @dfn{body parts} or @dfn{attachments}. You can use the MH commands
2293 @command{show}@footnote{See the section
2294 @uref{@value{MH-BOOK-HOME}/reapre.html, Reading Mail: inc show next
2295 prev} in the MH book.} or @command{mhshow}@footnote{See the section
2296 @uref{@value{MH-BOOK-HOME}/usimim.html#ReMIMa, Reading MIME Mail} in
2297 the MH book.} from the shell to read @sc{mime} messages@footnote{You
2298 can call them directly from Emacs if you're running the X Window
2299 System: type @kbd{M-! xterm -e mhshow @var{message-number}}. You can
2300 leave out the @samp{xterm -e} if you use @command{mhlist} or
2301 @command{mhstore}.}.
2303 @cindex Emacs, packages, @samp{mm-decode}
2304 @cindex @samp{mm-decode} package
2305 @findex mh-toggle-mh-decode-mime-flag
2306 @kindex ; @r{(semicolon)}
2307 @vindex mh-decode-mime-flag
2309 MH-E can handle attachments as well if the Gnus @samp{mm-decode}
2310 package is present. If so, the option @code{mh-decode-mime-flag} will
2311 be on. Otherwise, you'll see the @sc{mime} body parts rather than text
2312 or attachments. There isn't much point in turning off the option
2313 @code{mh-decode-mime-flag}; however, you can inspect it if it appears
2314 that the body parts are not being interpreted correctly or toggle it
2315 with the command @kbd{;} (semicolon;
2316 @code{mh-toggle-mh-decode-mime-flag}) to view the raw message. This
2317 option also controls the display of quoted-printable messages and
2318 other graphical widgets. @xref{Viewing}.
2320 @cindex buttons
2322 Attachments in MH-E are indicated by @dfn{buttons} like this:
2324 @smallexample
2325 [1. image/jpeg; foo.jpg]...
2326 @end smallexample
2328 @findex mh-next-button
2329 @findex mh-press-button
2330 @findex mh-prev-button
2331 @kindex RET
2332 @kindex K TAB
2333 @kindex K S-TAB
2334 @kindex mouse-1
2335 @kindex mouse-2
2337 To view the contents of the button, use either @kbd{mouse-1} or
2338 @kbd{mouse-2} on the button or @key{RET} (@code{mh-press-button}) when
2339 the cursor is over the button. This command is a toggle so if you use
2340 it again on the same attachment, it is hidden. If Emacs does not know
2341 how to display the attachment, then Emacs offers to save the
2342 attachment in a file. To move the cursor to the next button, use the
2343 command @kbd{K @key{TAB}} (@code{mh-next-button}). If the end of the
2344 buffer is reached then the search wraps over to the start of the
2345 buffer. To move the cursor to the previous button, use the command
2346 @kbd{K S-@key{TAB}} (@code{mh-prev-button}). If the beginning of the
2347 buffer is reached then the search wraps over to the end of the buffer.
2349 @cindex attachments, viewing
2350 @cindex viewing attachments
2351 @findex mh-folder-toggle-mime-part
2352 @kindex K v
2354 Another way to view the contents of a button is to use the command
2355 @kbd{K v} (@code{mh-folder-toggle-mime-part}). This command displays
2356 (or hides) the attachment associated with the button under the cursor.
2357 If the cursor is not located over a button, then the cursor first
2358 moves to the next button, wrapping to the beginning of the message if
2359 necessary. This command has the advantage over the previous commands
2360 of working from the MH-Folder buffer. You can also provide a numeric
2361 prefix argument (as in @kbd{4 K v}) to view the attachment labeled
2362 with that number. If Emacs does not know how to display the
2363 attachment, then Emacs offers to save the attachment in a file.
2365 @cindex @file{/etc/mailcap}
2366 @cindex files, @file{/etc/mailcap}
2367 @findex mailcap-mime-info
2368 @findex mh-display-with-external-viewer
2369 @kindex K e
2371 If Emacs does not know how to view an attachment, you could save it
2372 into a file and then run some program to open it. It is easier,
2373 however, to launch the program directly from MH-E with the command
2374 @kbd{K e} (@code{mh-display-with-external-viewer}). While you'll most
2375 likely use this to view spreadsheets and documents, it is also useful
2376 to use your browser to view HTML attachments with higher fidelity than
2377 what Emacs can provide. This command displays the attachment
2378 associated with the button under the cursor. If the cursor is not
2379 located over a button, then the cursor first moves to the next button,
2380 wrapping to the beginning of the message if necessary. You can provide
2381 a numeric prefix argument (as in @kbd{4 K e}) to view the attachment
2382 labeled with that number. This command tries to provide a reasonable
2383 default for the viewer by calling the Emacs function
2384 @code{mailcap-mime-info}. This function usually reads the file
2385 @file{/etc/mailcap}.
2387 @cindex attachments, saving
2388 @cindex saving attachments
2389 @findex mh-folder-save-mime-part
2390 @kindex K o
2392 Use the command @kbd{K o} (@code{mh-folder-save-mime-part}) to save
2393 attachments (the mnemonic is ``output''). This command saves the
2394 attachment associated with the button under the cursor. If the cursor
2395 is not located over a button, then the cursor first moves to the next
2396 button, wrapping to the beginning of the message if necessary. You can
2397 also provide a numeric prefix argument (as in @kbd{3 K o}) to save the
2398 attachment labeled with that number. This command prompts you for a
2399 filename and suggests a specific name if it is available.
2401 @cindex @command{mhn}
2402 @cindex @command{mhstore}
2403 @cindex MH commands, @command{mhn}
2404 @cindex MH commands, @command{mhstore}
2405 @findex mh-mime-save-parts
2406 @kindex K a
2407 @vindex mh-mime-save-parts-default-directory
2409 You can save all of the attachments at once with the command @kbd{K a}
2410 (@code{mh-mime-save-parts}). The attachments are saved in the
2411 directory specified by the option
2412 @code{mh-mime-save-parts-default-directory} unless you use a prefix
2413 argument (as in @kbd{C-u K a}) in which case you are prompted for the
2414 directory. These directories may be superseded by MH profile
2415 components, since this function calls on @command{mhstore}
2416 (@command{mhn}) to do the work.
2418 @vindex mh-mime-save-parts-default-directory
2420 The default value for the option
2421 @code{mh-mime-save-parts-default-directory} is @samp{Prompt Always} so
2422 that you are always prompted for the directory in which to save the
2423 attachments. However, if you usually use the same directory within a
2424 session, then you can set this option to @samp{Prompt the First Time}
2425 to avoid the prompt each time. you can make this directory permanent
2426 by choosing @samp{Directory} and entering the directory's name.
2428 @cindex attachments, inline
2429 @cindex inline attachments
2430 @findex mh-toggle-mime-buttons
2431 @kindex K t
2432 @vindex mh-display-buttons-for-inline-parts-flag
2434 The sender can request that attachments should be viewed inline so
2435 that they do not really appear like an attachment at all to the
2436 reader. Most of the time, this is desirable, so by default MH-E
2437 suppresses the buttons for inline attachments. On the other hand, you
2438 may receive code or HTML which the sender has added to his message as
2439 inline attachments so that you can read them in MH-E@. In this case, it
2440 is useful to see the buttons so that you know you don't have to cut
2441 and paste the code into a file; you can simply save the attachment. If
2442 you want to make the buttons visible for inline attachments, you can
2443 use the command @kbd{K t} (@code{mh-toggle-mime-buttons}) to toggle
2444 the visibility of these buttons. You can turn on these buttons
2445 permanently by turning on the option
2446 @code{mh-display-buttons-for-inline-parts-flag}.
2448 MH-E cannot display all attachments inline however. It can display
2449 text (including @sc{html}) and images.
2451 @cindex header field, @samp{Content-Disposition}
2452 @cindex inline images
2453 @cindex @samp{Content-Disposition} header field
2454 @vindex mh-max-inline-image-height
2455 @vindex mh-max-inline-image-width
2457 Some older mail programs do not insert the needed
2458 plumbing@footnote{This plumbing is the @samp{Content-Disposition:}
2459 header field.} to tell MH-E whether to display the attachments inline
2460 or not. If this is the case, MH-E will display these images inline if
2461 they are smaller than the window. However, you might want to allow
2462 larger images to be displayed inline. To do this, you can change the
2463 options @code{mh-max-inline-image-width} and
2464 @code{mh-max-inline-image-height} from their default value of zero to
2465 a large number. The size of your screen is a good choice for these
2466 numbers.
2468 @cindex alternatives
2469 @cindex attachments, alternatives
2470 @vindex mh-display-buttons-for-alternatives-flag
2472 Sometimes, a mail program will produce multiple alternatives of an
2473 attachment in increasing degree of faithfulness to the original
2474 content. By default, only the preferred alternative is displayed. If
2475 the option @code{mh-display-buttons-for-alternatives-flag} is on, then
2476 the preferred part is shown inline and buttons are shown for each of
2477 the other alternatives.
2479 @vindex mm-discouraged-alternatives
2481 Many people prefer to see the @samp{text/plain} alternative rather
2482 than the @samp{text/html} alternative. To do this in MH-E, customize
2483 the option @code{mm-discouraged-alternatives}, and add
2484 @samp{text/html}. The next best alternative, if any, will be shown.
2486 @findex mh-show-preferred-alternative
2487 @kindex : @r{(colon)}
2489 Occasionally, though, you might want to see the preferred alternative.
2490 The command @kbd{:} (@code{mh-show-preferred-alternative}) displays
2491 the message with the default preferred alternative. This is as if
2492 @code{mm-discouraged-alternatives} is set to @samp{nil}. Use the
2493 command @key{RET} (@code{mh-show}) to show the message normally again.
2495 @kindex K i
2496 @findex mh-folder-inline-mime-part
2498 You can view the raw contents of an attachment with the command @kbd{K
2499 i} (@code{mh-folder-inline-mime-part}). This command displays (or
2500 hides) the contents of the attachment associated with the button under
2501 the cursor verbatim. If the cursor is not located over a button, then
2502 the cursor first moves to the next button, wrapping to the beginning
2503 of the message if necessary. You can also provide a numeric prefix
2504 argument (as in @kbd{4 K i}) to view the attachment labeled with that
2505 number.
2507 For additional information on buttons, see
2508 @ifinfo
2509 @ref{Article Buttons,,,gnus}, and @ref{MIME Commands,,,gnus}.
2510 @end ifinfo
2511 @ifnotinfo
2512 the chapters @uref{http://www.gnus.org/manual/gnus_101.html#SEC101,
2513 Article Buttons} and
2514 @uref{http://www.gnus.org/manual/gnus_108.html#SEC108, MIME Commands}
2515 in the @cite{The Gnus Manual}.
2516 @end ifnotinfo
2518 @node HTML, Digests, Viewing Attachments, Reading Mail
2519 @section HTML
2521 @cindex HTML
2522 @cindex Gnus
2524 MH-E can display messages that have been sent in HTML. The
2525 content of the message will appear in the MH-Show buffer as you would
2526 expect if the entire message is HTML, or there is an inline HTML body
2527 part. However, if there is an HTML body part that is an attachment,
2528 then you'll see a button like this:
2530 @smallexample
2531 [1. text/html; foo.html]...
2532 @end smallexample
2534 To see how to read the contents of this body part, see @ref{Viewing
2535 Attachments}.
2537 @vindex mm-text-html-renderer
2539 The browser that MH-E uses is determined by the option
2540 @code{mm-text-html-renderer}. The default setting is set automatically
2541 based upon the presence of a known browser on your system. If you wish
2542 to use a different browser, then set this option accordingly. See the
2543 documentation for the browser you use for additional information on
2544 how to use it. In particular, find and disable the option to render
2545 images, as displaying remote images can tip off spammers that the
2546 email address they have used is valid.
2548 @vindex mm-text-html-renderer
2550 If you're confused about which @code{mm-text-html-renderer} to use,
2551 here's a brief description of each, sorted by name.
2553 @table @asis
2554 @cindex browser, @samp{gnus-w3m}
2555 @cindex @samp{gnus-w3m}
2556 @cindex browser, @samp{w3m}
2557 @cindex @samp{w3m}
2558 @item @samp{gnus-w3m}
2559 The @samp{gnus-w3m} browser requires an external program. It's quick,
2560 produces pretty nice output, and it highlights links. It renders
2561 @samp{&ndash;} and @samp{&reg;} okay. It sometimes fails to wrap lines
2562 properly. It always downloads remote images.
2563 @c -------------------------
2564 @cindex browser, @samp{html2text}
2565 @cindex @samp{html2text}
2566 @item @samp{html2text}
2567 The @samp{html2text} browser requires an external program. Some users
2568 have reported problems with it, such as filling the entire message as
2569 if it were one paragraph, or displaying chunks of raw HTML.
2570 @c -------------------------
2571 @cindex browser, @samp{links}
2572 @cindex @samp{links}
2573 @item @samp{links}
2574 The @samp{links} browser requires an external program. It's quick, and
2575 produces nicer output than @samp{lynx} on single column mails in
2576 tables. However, it doesn't show links and it doesn't do as nice a job
2577 on multi-column tables as some lines wrap. It does do a good job of
2578 fitting text within 80 columns. It appears to render special
2579 characters using ASCII equivalents. For example, @samp{&reg;} appears
2580 as (R). It does not download images.
2581 @c -------------------------
2582 @cindex browser, @samp{lynx}
2583 @cindex @samp{lynx}
2584 @item @samp{lynx}
2585 The @samp{lynx} browser requires an external program. It's quick and
2586 produces pretty decent output but it doesn't show links. It doesn't
2587 seem to do multi-column tables which makes output much cleaner. It
2588 centers the output and wraps long lines more than most. It does not
2589 always handle special characters like @samp{&reg;} or @samp{&ndash;}.
2590 It does not download images.
2591 @c -------------------------
2592 @item @samp{shr}
2593 @cindex @samp{shr}
2594 This choice does not require an external program, but it does require
2595 that Emacs be configured at build time to use @samp{libxml2}. It is
2596 fairly quick, it highlights links, and it supports HTML color
2597 declarations. It renders @samp{&ndash;} and @samp{&reg;} okay. It
2598 sometimes truncates text, particularly if the message tries to have
2599 fancy text layout. By default it does not download images; this
2600 behavior is controlled by the options @code{mm-html-blocked-images}
2601 and @code{mm-html-inhibit-images}
2602 @ifinfo
2603 (@pxref{Display Customization,,,emacs-mime}).
2604 @end ifinfo
2605 @ifnotinfo
2606 (see section @uref{http://www.gnus.org/manual/emacs-mime_6.html,
2607 Display Customization} in the @cite{The Emacs MIME Manual}).
2608 @end ifnotinfo
2609 @c -------------------------
2610 @cindex browser, @samp{w3m}
2611 @cindex @samp{w3m}
2612 @kindex mouse-2
2613 @item @samp{w3m}
2614 The @samp{w3m} browser requires an external program. It's quick,
2615 produces pretty nice output, and it highlights links. These can be
2616 clicked with @kbd{mouse-2} to view the content of the link in
2617 @samp{w3m}. The @samp{w3m} browser handles tables well and actually
2618 respects the table's width parameter (which can cause text to wrap if
2619 the author didn't anticipate that the page would be viewed in Emacs).
2620 It does not download images by default; this behavior is controlled by
2621 the option @code{mm-w3m-safe-url-regexp}
2622 @ifinfo
2623 (@pxref{Display Customization,,,emacs-mime}).
2624 @end ifinfo
2625 @ifnotinfo
2626 (see section @uref{http://www.gnus.org/manual/emacs-mime_6.html,
2627 Display Customization} in the @cite{The Emacs MIME Manual}).
2628 @end ifnotinfo
2629 @c -------------------------
2630 @cindex browser, @samp{w3m-standalone}
2631 @cindex @samp{w3m-standalone}
2632 @cindex browser, @samp{w3m}
2633 @cindex @samp{w3m}
2634 @item @samp{w3m-standalone}
2635 This browser is quick, but does not show links. It handles simple
2636 tables but some tables get rendered much wider than the Emacs frame.
2637 This browser renders @samp{&ndash;} and @samp{&reg;} okay. It does not
2638 download images.
2639 @end table
2641 @vindex mm-text-html-renderer
2643 For a couple more sources of information about
2644 @code{mm-text-html-renderer},
2645 @ifinfo
2646 @xref{Display Customization,,,emacs-mime}, and the documentation for
2647 the Gnus command @kbd{W h} (@pxref{Article Washing,,,gnus}).
2648 @end ifinfo
2649 @ifnotinfo
2650 see section @uref{http://www.gnus.org/manual/emacs-mime_6.html,
2651 Display Customization} in the @cite{The Emacs MIME Manual} and the
2652 documentation for the Gnus command @kbd{W h} (see section
2653 @uref{http://www.gnus.org/manual/gnus_48.html#Article-Washing, Article
2654 Washing} in the
2655 @cite{The Gnus Manual}).
2656 @end ifnotinfo
2658 @cindex @file{.emacs}
2659 @cindex files, @file{.emacs}
2660 @findex browse-url-at-mouse
2661 @kindex S-mouse-2
2663 A useful key binding that you can add to @file{~/.emacs} is the
2664 following which displays an HTML link or textual URL in an external
2665 browser when clicked with @kbd{S-mouse-2}. This binding works in any
2666 buffer, including HTML buffers.
2668 @smalllisp
2669 (global-set-key [S-mouse-2] 'browse-url-at-mouse)
2670 @end smalllisp
2672 @node Digests, Reading PGP, HTML, Reading Mail
2673 @section Digests
2675 @cindex digests
2676 @findex mh-page-digest
2677 @findex mh-page-digest-backwards
2678 @kindex D BS
2679 @kindex D SPC
2680 @kindex BS
2681 @kindex SPC
2683 A digest is a message that contains other messages. Special MH-E
2684 commands let you read digests conveniently. You can use @key{SPC} and
2685 @key{BS} to page through the digest as if it were a normal message,
2686 but if you wish to skip to the next message in the digest, use
2687 @kbd{D @key{SPC}} (@code{mh-page-digest}). To return to a previous message,
2688 use @kbd{D @key{BS}} (@code{mh-page-digest-backwards}).
2690 @cindex @command{burst}
2691 @cindex MH commands, @command{burst}
2692 @cindex MH-Folder Show mode
2693 @cindex modes, MH-Folder Show
2694 @findex mh-burst-digest
2695 @kindex d
2696 @kindex D b
2697 @kindex t
2699 Another handy command is @kbd{D b} (@code{mh-burst-digest}). This
2700 command uses the MH command @command{burst}@footnote{See the section
2701 @uref{@value{MH-BOOK-HOME}/burdig.html, Bursting Messages} in the MH
2702 book.} to break out each message in the digest into its own message.
2703 Using this command, you can quickly delete unwanted messages, like
2704 this: Once the digest is split up, toggle out of MH-Folder Show mode
2705 with @kbd{t} (@pxref{Folders}) so that the scan lines fill the screen
2706 and messages aren't displayed. Then use @kbd{d} (@pxref{Reading Mail})
2707 to quickly delete messages that you don't want to read (based on the
2708 @samp{Subject:} header field). You can also burst the digest to reply
2709 directly to the people who posted the messages in the digest. One
2710 problem you may encounter is that the @samp{From:} header fields are
2711 preceded with a @samp{>} so that your reply can't create the
2712 @samp{To:} field correctly. In this case, you must correct the
2713 @samp{To:} field yourself. This is described later (@pxref{Editing
2714 Drafts}).
2716 @node Reading PGP, Printing, Digests, Reading Mail
2717 @section Signed and Encrypted Messages
2719 @cindex GPG
2720 @cindex GnuPG
2721 @cindex Gnus
2722 @cindex OpenPGP
2723 @cindex PGP
2724 @cindex RFC 3156
2725 @cindex encrypted messages
2726 @cindex security
2727 @cindex signed messages
2729 You can read encrypted or signed PGP or GPG messages with
2730 MH-E@footnote{This feature depends on post-5.10 versions of Gnus.
2731 @cite{MIME Security with OpenPGP} is documented in
2732 @uref{http://www.rfc-editor.org/rfc/rfc3156.txt, RFC 3156}. However,
2733 MH-E can also decrypt old-style PGP messages that are not in MIME
2734 format.}. This section assumes that you already have a good
2735 understanding of GPG and have set up your keys appropriately.
2737 If someone sends you a signed message, here is what you'll see:
2739 @smallexample
2740 @group
2741 [[PGP Signed Part:Bill Wohler <wohler@@stop.mail-abuse.org>]]
2742 This is a signed message.
2744 [[End of PGP Signed Part]]
2745 @end group
2746 @end smallexample
2748 @cindex keychain
2749 @cindex key server
2750 @cindex signed messages
2752 If the key for the given signature is not in your keychain, you'll be
2753 given the opportunity to fetch the key from a key server and verify
2754 the key. If the message is really large, the verification process can
2755 take a long time. You can press @kbd{C-g} at any time to
2756 cancel@footnote{Unfortunately in the current version, the validation
2757 process doesn't display a message so it appears that MH-E has hung. We
2758 hope that this will be fixed in the future.}.
2760 If the signature doesn't check out, you might see something like this:
2762 @smallexample
2763 @group
2764 [[PGP Signed Part:Failed]]
2765 This is a signed message.
2766 This is garbage added after the signature was made.
2768 [[End of PGP Signed Part]]
2769 @end group
2770 @end smallexample
2772 @cindex decrypting messages
2774 If someone sends you an encrypted message, MH-E will ask for your
2775 passphrase to decrypt the message. You should see something like this:
2777 @smallexample
2778 @group
2779 [[PGP Encrypted Part:OK]]
2781 [[PGP Signed Part:Bill Wohler <wohler@@stop.mail-abuse.org>]]
2782 This is the secret message.
2784 [[End of PGP Signed Part]]
2786 [[End of PGP Encrypted Part]]
2787 @end group
2788 @end smallexample
2790 If there is a problem decrypting the message, the button will say:
2792 @smallexample
2793 [[PGP Encrypted Part:Failed]]
2794 @end smallexample
2796 You can read the contents of this button using the methods described in
2797 @ref{Viewing Attachments}. If the message were corrupted, you'd see
2798 this:
2800 @smallexample
2801 [[PGP Encrypted Part:Failed]
2802 Invalid base64 data]
2803 @end smallexample
2805 If your passphrase were incorrect, you'd see something like this:
2807 @smallexample
2808 [GNUPG:] ENC_TO CD9C88BB610BD9AD 1 0
2809 [GNUPG:] USERID_HINT CD9C88BB610BD9AD Bill Wohler <wohler@@stop.mail-abuse.org>
2810 [GNUPG:] NEED_PASSPHRASE CD9C88BB610BD9AD CD9C88BB610BD9AD 1 0
2811 [GNUPG:] BAD_PASSPHRASE CD9C88BB610BD9AD
2812 gpg: encrypted with 1024-bit RSA key, ID 610BD9AD, created 1997-09-09
2813       "Bill Wohler <wohler@@stop.mail-abuse.org>"
2814 gpg: public key decryption failed: bad passphrase
2815 [GNUPG:] BEGIN_DECRYPTION
2816 [GNUPG:] DECRYPTION_FAILED
2817 gpg: decryption failed: secret key not available
2818 [GNUPG:] END_DECRYPTION
2820 gpg exited abnormally: '2'
2821 @end smallexample
2823 @vindex mh-show-pgg-bad
2824 @vindex mh-show-pgg-good
2825 @vindex mh-show-pgg-unknown
2827 The appearance of the buttons is controlled by the faces
2828 @code{mh-show-pgg-good}, @code{mh-show-pgg-bad}, and
2829 @code{mh-show-pgg-unknown} depending on the validity of the signature.
2830 The latter is used whether the signature is unknown or untrusted.
2832 @cindex @samp{pgg} customization group
2833 @cindex PGG
2834 @cindex customization group, @samp{pgg}
2836 The @samp{pgg} customization group may have some settings which may
2837 interest you.
2838 @iftex
2839 See @cite{The PGG Manual}.
2840 @end iftex
2841 @ifinfo
2842 @xref{Top, , The PGG Manual, pgg, The PGG Manual}.
2843 @end ifinfo
2844 @ifhtml
2846 @uref{https://www.gnu.org/software/emacs/manual/pgg.html,
2847 @cite{The PGG Manual}}.
2848 @end ifhtml
2850 @node Printing, Files and Pipes, Reading PGP, Reading Mail
2851 @section Printing Your Mail
2853 @cindex printing
2854 @findex mh-ps-print-msg
2855 @findex mh-ps-print-msg-file
2856 @kindex P f
2857 @kindex P p
2858 @vindex mh-lpr-command-format
2859 @vindex mh-print-background-flag
2861 To print messages in MH-E, use the command @kbd{P p}
2862 (@code{mh-ps-print-msg}). You can print all the messages in a range
2863 (as in @kbd{C-u P p 1 3 5-7 last:5 frombob @key{RET}},
2864 @pxref{Ranges}). You can also send the output to a file with @kbd{P f}
2865 (@code{mh-ps-print-msg-file}). This command will print inline text
2866 attachments but will not decrypt messages. However, when a message is
2867 displayed in an MH-Show buffer, then that buffer is used verbatim for
2868 printing with the caveat that only text attachments, if opened inline,
2869 are printed. Therefore, encrypted messages can be printed by showing
2870 and decrypting them first. The commands @kbd{P p} and @kbd{P f} do not
2871 use the options @code{mh-lpr-command-format} or
2872 @code{mh-print-background-flag}, described below.
2874 @findex mh-ps-print-toggle-color
2875 @kindex P C
2876 @vindex ps-print-color-p
2878 Colors are emulated on black-and-white printers with shades of gray.
2879 This might produce illegible output, even if your screen colors only
2880 use shades of gray. If this is the case, try using the command @kbd{P
2881 C} (@code{mh-ps-print-toggle-color}) to toggle between color, no
2882 color, and a black and white representation of the colors and see
2883 which works best. You change this setting permanently by customizing
2884 the option @code{ps-print-color-p}.
2886 @findex mh-ps-print-toggle-faces
2887 @kindex P F
2889 Another related function is the command @kbd{P F}
2890 (@code{mh-ps-print-toggle-faces}). This command toggles between using
2891 faces and not. When faces are enabled, the printed message will look
2892 very similar to the message in the MH-Show buffer.
2894 @cindex @samp{ps-print} package
2895 @cindex Emacs, packages, @samp{ps-print}
2897 MH-E uses the @samp{ps-print} package to do the printing, so you can
2898 customize the printing further by going to the @samp{ps-print}
2899 customization group.
2901 @cindex @command{lpr}
2902 @cindex @command{mhl}
2903 @cindex MH commands, @command{mhl}
2904 @cindex Unix commands, @command{lpr}
2905 @findex mh-print-msg
2906 @kindex P l
2908 An alternative to using the @samp{ps-print} package is the command
2909 @kbd{P l} (@code{mh-print-msg}) (the @i{l} is for @i{l}ine printer or
2910 @i{l}pr). You can print all the messages in a range. The message is
2911 formatted with @command{mhl}@footnote{See the section
2912 @uref{@value{MH-BOOK-HOME}/shomes.html#Usisho, Using mhl} in the MH
2913 book.} and printed with the @command{lpr} command.
2915 @kindex P f
2916 @kindex P l
2917 @kindex P p
2918 @vindex mh-lpr-command-format
2919 @vindex mh-print-background-flag
2921 The command @kbd{P l} uses two options. The option
2922 @code{mh-lpr-command-format} contains the Unix command line which
2923 performs the actual printing. The string can contain one escape,
2924 @samp{%s}, which is replaced by the name of the folder and the message
2925 number and is useful for print job names. The default setting is
2926 @code{"lpr -J '%s'"}. I use @code{"mpage -h'%s' -b Letter -H1of -mlrtb
2927 -P"} which produces a nice header and adds a bit of margin so the text
2928 fits within my printer's margins. Normally messages are printed in the
2929 foreground. If this is slow on your system, you may elect to turn on
2930 the option @code{mh-print-background-flag} to print in the background.
2931 If you do this, do not delete the message until it is printed or else
2932 the output may be truncated. These options are not used by the
2933 commands @kbd{P p} or @kbd{P f}.
2935 @node Files and Pipes, Navigating, Printing, Reading Mail
2936 @section Files and Pipes
2938 @cindex files
2939 @cindex pipes
2940 @findex mh-refile-or-write-again
2941 @findex mh-write-msg-to-file
2942 @kindex >
2943 @kindex !
2945 MH-E does offer a couple of commands that are not a part of MH@. The
2946 first one, @kbd{>} (@code{mh-write-msg-to-file}), writes a message to
2947 a file. You are prompted for the filename. If the file already exists,
2948 the message is appended to it. You can also write the message to the
2949 file without the header by specifying a prefix argument (such as
2950 @kbd{C-u > /tmp/foobar @key{RET}}). Subsequent writes to the same file
2951 can be made with the command @kbd{!}
2952 (@code{mh-refile-or-write-again}).
2954 @findex mh-pipe-msg
2955 @kindex |
2956 @kindex l
2958 You can also pipe the message through a Unix shell command with the
2959 command @kbd{|} (@code{mh-pipe-msg}). You are prompted for the Unix
2960 command through which you wish to run your message. If you give a
2961 prefix argument to this command, the message header is included in the
2962 text passed to the command (the contrived example @kbd{C-u | lpr}
2963 would be done with the @kbd{l} command instead).
2965 @cindex @command{shar}
2966 @cindex @command{uuencode}
2967 @cindex Unix commands, @command{shar}
2968 @cindex Unix commands, @command{uuencode}
2969 @findex mh-store-msg
2970 @kindex X s
2971 @vindex mh-store-default-directory
2973 If the message is a shell archive @command{shar} or has been run
2974 through @command{uuencode} use @kbd{X s} (@code{mh-store-msg}) to
2975 extract the body of the message. The default directory for extraction
2976 is the current directory; however, you have a chance to specify a
2977 different extraction directory. The next time you use this command,
2978 the default directory is the last directory you used. If you would
2979 like to change the initial default directory, customize the option
2980 @code{mh-store-default-directory}, change the value from
2981 @samp{Current} to @samp{Directory}, and then enter the name of the
2982 directory for storing the content of these messages.
2984 @findex mh-store-buffer
2985 @kindex RET
2986 @kindex X s
2988 By the way, @kbd{X s} calls the Emacs Lisp function
2989 @code{mh-store-buffer}. I mention this because you can use it directly
2990 if you're editing a buffer that contains a file that has been run
2991 through @command{uuencode} or @command{shar}. For example, you can
2992 extract the contents of the current buffer in your home directory by
2993 typing @kbd{M-x mh-store-buffer @key{RET} ~ @key{RET}}.
2995 @node Navigating, Miscellaneous Commands and Options, Files and Pipes, Reading Mail
2996 @section Navigating
2998 @cindex moving between messages
2999 @cindex navigation
3000 @findex mh-first-msg
3001 @findex mh-goto-msg
3002 @findex mh-last-msg
3003 @findex mh-next-undeleted-msg
3004 @findex mh-next-unread-msg
3005 @findex mh-previous-undeleted-msg
3006 @findex mh-previous-unread-msg
3007 @kindex g
3008 @kindex M-<
3009 @kindex M->
3010 @kindex M-n
3011 @kindex M-p
3012 @kindex n
3013 @kindex p
3015 To move on to the next message, use the command @kbd{n}
3016 (@code{mh-next-undeleted-msg}); use @kbd{p}
3017 (@code{mh-previous-undeleted-msg}) to read the previous message. To
3018 move to the next unread message, use @kbd{M-n}
3019 (@code{mh-next-unread-msg}); use @kbd{M-p}
3020 (@code{mh-previous-unread-msg}) to move to the previous unread
3021 message. These commands can be given a prefix argument to specify how
3022 many messages to skip (for example, @kbd{5 n}). You can also move to a
3023 specific message with @kbd{g} (@code{mh-goto-msg}). You can enter the
3024 message number either before or after typing @kbd{g}. In the latter
3025 case, Emacs prompts you. Finally, you can go to the first or last
3026 message with @kbd{M-<} (@code{mh-first-msg}) and @kbd{M->}
3027 (@code{mh-last-msg}) respectively.
3029 @cindex MH-Folder mode
3030 @cindex modes, MH-Folder
3031 @findex next-line
3032 @findex previous-line
3033 @kindex C-n
3034 @kindex C-p
3035 @kindex RET
3037 You can also use the Emacs commands @kbd{C-p} (@code{previous-line})
3038 and @kbd{C-n} (@code{next-line}) to move up and down the scan lines in
3039 the MH-Folder window. These commands can be used in conjunction with
3040 @key{RET} to look at deleted or refiled messages.
3042 @cindex deleting messages
3043 @findex mh-delete-msg
3044 @kindex d
3045 @kindex n
3046 @kindex p
3048 To mark a message for deletion, use the command @kbd{d}
3049 (@code{mh-delete-msg}). A @samp{D} is placed by the message in the
3050 scan window, and the next undeleted message is displayed. If the
3051 previous command had been @kbd{p}, then the next message displayed is
3052 the first undeleted message previous to the message just deleted. Use
3053 @kbd{n} to force subsequent @kbd{d} commands to move forward to the
3054 next undeleted message after deleting the message under the cursor.
3055 You may also specify a range (for example, @kbd{C-u d 1 3 5-7 last:5
3056 frombob @key{RET}}, @pxref{Ranges}).
3058 @findex mh-delete-msg-no-motion
3059 @kindex C-d
3061 The command @kbd{C-d} (@code{mh-delete-msg-no-motion}) marks the
3062 message (or messages in range) for deletion but leaves the cursor at
3063 the current message in case you wish to perform other operations on
3064 the message.
3066 @findex mh-delete-subject
3067 @findex mh-delete-subject-or-thread
3068 @findex mh-thread-delete
3069 @findex mh-undo
3070 @kindex k
3071 @kindex T d
3072 @kindex u
3074 And to delete more messages faster, you can use @kbd{k}
3075 (@code{mh-delete-subject-or-thread}) to delete all the messages with
3076 the same subject as the current message. This command puts these
3077 messages in a sequence named @samp{subject}. You can undo this action
3078 by using @kbd{u} (@code{mh-undo}) with a prefix argument and then
3079 specifying the @samp{subject} sequence. However, if the buffer is
3080 displaying a threaded view of the folder then @kbd{k} behaves like
3081 @kbd{T d} (@code{mh-thread-delete}). @xref{Threading}.
3083 @findex mh-execute-commands
3084 @kindex x
3086 However you mark a message for deletion, the command @kbd{x}
3087 (@code{mh-execute-commands}) actually carries out the deletion
3088 (@pxref{Folders}).
3090 @vindex mh-delete-msg-hook
3092 The hook @code{mh-delete-msg-hook} is called after you mark a message
3093 for deletion. For example, a past maintainer of MH-E used this once
3094 when he kept statistics on his mail usage.
3096 @node Miscellaneous Commands and Options,  , Navigating, Reading Mail
3097 @section Miscellaneous Commands and Options
3099 This section contains a few more miscellaneous commands and options.
3101 @cindex editing message
3102 @findex mh-modify
3103 @kindex M
3105 There are times when you need to edit a message. For example, you may
3106 need to fix a broken Content-Type header field. You can do this with
3107 the command @kbd{M} (@code{mh-modify}). It displays the raw message in
3108 an editable buffer. When you are done editing, save and kill the
3109 buffer as you would any other.
3111 @findex mh-kill-folder
3112 @findex mh-pack-folder
3113 @vindex mh-do-not-confirm-flag
3115 Commands such as @code{mh-pack-folder} prompt to confirm whether to
3116 process outstanding moves and deletes or not before continuing.
3117 Turning on the option @code{mh-do-not-confirm-flag} means that these
3118 actions will be performed---which is usually desired but cannot be
3119 retracted---without question@footnote{In previous versions of MH-E,
3120 this option suppressed the confirmation in @code{mh-kill-folder}.
3121 Since this kept most users from setting this option,
3122 @code{mh-kill-folder} was modified in version 6.0 to always ask for
3123 confirmation subject to @code{mh-kill-folder-suppress-prompt-hook}.
3124 @xref{Folders}.}.
3126 @cindex MH-Folder mode
3127 @cindex modes, MH-Folder
3128 @vindex mh-summary-height
3130 The option @code{mh-summary-height} controls the number of scan lines
3131 displayed in the MH-Folder window, including the mode line. The
3132 default value of this option is @samp{Automatic} which means that the
3133 MH-Folder buffer will maintain the same proportional size if the frame
3134 is resized. If you'd prefer a fixed height, then choose the
3135 @samp{Fixed Size} option and enter the number of lines you'd like to
3136 see.
3138 @vindex mh-bury-show-buffer-flag
3140 Normally the buffer for displaying messages is buried at the bottom at
3141 the buffer stack. You may wish to disable this feature by turning off
3142 the option @code{mh-bury-show-buffer-flag}. One advantage of not
3143 burying the show buffer is that one can delete the show buffer more
3144 easily in an electric buffer list because of its proximity to its
3145 associated MH-Folder buffer. Try running @kbd{M-x
3146 electric-buffer-list} to see what I mean.
3148 @cindex @file{.emacs}
3149 @cindex files, @file{.emacs}
3150 @cindex reading mail
3152 Before we leave this section, I'll include a function that I use as a
3153 front end to MH-E@footnote{Stephen Gildea's favorite binding is
3154 @kbd{(global-set-key "\C-cr" 'mh-rmail)}.}. It toggles between your
3155 working window configuration, which may be quite involved---windows
3156 filled with source, compilation output, man pages, and other
3157 documentation---and your MH-E window configuration. Like the rest of
3158 the customization described in this section, simply add the following
3159 code to @file{~/.emacs}.
3161 @iftex
3162 @filbreak
3163 @end iftex
3165 @findex mh-rmail@r{, example}
3167 @smalllisp
3168 @group
3169 (defvar my-mh-screen-saved nil
3170   "Set to non-nil when MH-E window configuration shown.")
3171 (defvar my-normal-screen nil "Normal window configuration.")
3172 (defvar my-mh-screen nil "MH-E window configuration.")
3174 (defun my-mh-rmail (&optional arg)
3175   "Toggle between MH-E and normal screen configurations.
3176 With non-nil or prefix argument, include mailbox as well
3177 when going into mail."
3178   (interactive "P")                 ; @r{user callable function, P=prefix arg}
3179   (setq my-mh-screen-saved          ; @r{save state}
3180         (cond
3181          ;; @r{Bring up MH-E screen if arg or normal window configuration.}
3182          ;; @r{If arg or +inbox buffer doesn't exist, run mh-rmail.}
3183          ((or arg (null my-mh-screen-saved))
3184           (setq my-normal-screen (current-window-configuration))
3185           (if (or arg (null (get-buffer "+inbox")))
3186               (mh-rmail)
3187             (set-window-configuration my-mh-screen))
3188           t)                        ; @r{set my-mh-screen-saved to @code{t}}
3189          ;; @r{Otherwise, save MH-E screen and restore normal screen.}
3190          (t
3191           (setq my-mh-screen (current-window-configuration))
3192           (set-window-configuration my-normal-screen)
3193           nil))))                   ; @r{set my-mh-screen-saved to nil}
3195 (global-set-key "\C-x\r" 'my-mh-rmail)  ;@r{ call with C-x @key{RET}}
3197 @i{Starting MH-E}
3199 @end group
3200 @end smalllisp
3202 If you type an argument (@kbd{C-u}) or if @code{my-mh-screen-saved} is
3203 @code{nil} (meaning a non-MH-E window configuration), the current
3204 window configuration is saved, either the @samp{+inbox} buffer is
3205 displayed or @code{mh-rmail} is run, and the MH-E window configuration
3206 is shown. Otherwise, the MH-E window configuration is saved and the
3207 original configuration is displayed.
3209 @node Folders, Sending Mail, Reading Mail, Top
3210 @chapter Organizing Your Mail with Folders
3212 @cindex @samp{Folder} menu
3213 @cindex @samp{Message} menu
3214 @cindex folders
3215 @cindex menu, @samp{Folder}
3216 @cindex menu, @samp{Message}
3217 @cindex using folders
3219 This chapter discusses the things you can do with folders within MH-E@.
3220 The commands in this chapter are also found in the @samp{Folder} and
3221 @samp{Message} menus.
3223 @table @kbd
3224 @kindex ?
3225 @findex mh-help
3226 @item ?
3227 Display cheat sheet for the MH-E commands (@code{mh-help}).
3228 @c -------------------------
3229 @kindex !
3230 @findex mh-refile-or-write-again
3231 @item !
3232 Repeat last output command (@code{mh-refile-or-write-again}).
3233 @c -------------------------
3234 @cindex @samp{Message > Copy Message to Folder...} menu item
3235 @cindex menu item, @samp{Message > Copy Message to Folder...}
3236 @kindex c
3237 @findex mh-copy-msg
3238 @item c
3239 Copy range to folder (@code{mh-copy-msg}).
3240 @c -------------------------
3241 @kindex F ?
3242 @findex mh-prefix-help
3243 @item F ?
3244 Display cheat sheet for the commands of the current prefix in
3245 minibuffer (@code{mh-prefix-help}).
3246 @c -------------------------
3247 @kindex F '
3248 @findex mh-index-ticked-messages
3249 @item F '
3250 Display ticked messages (@code{mh-index-ticked-messages}).
3251 @c -------------------------
3252 @kindex F c
3253 @findex mh-catchup
3254 @item F c
3255 Delete range from the @samp{unseen} sequence (@code{mh-catchup}).
3256 @c -------------------------
3257 @kindex F k
3258 @findex mh-kill-folder
3259 @item F k
3260 Remove folder (@code{mh-kill-folder}).
3261 @c -------------------------
3262 @cindex @samp{Folder > List Folders} menu item
3263 @cindex menu item, @samp{Folder > List Folders}
3264 @kindex F l
3265 @findex mh-list-folders
3266 @item F l
3267 List all folders (@code{mh-list-folders}).
3268 @c -------------------------
3269 @cindex @samp{Folder > View New Messages} menu item
3270 @cindex menu item, @samp{Folder > View New Messages}
3271 @kindex F n
3272 @findex mh-index-new-messages
3273 @item F n
3274 Display unseen messages (@code{mh-index-new-messages}).
3275 @c -------------------------
3276 @cindex @samp{Folder > Pack Folder} menu item
3277 @cindex menu item, @samp{Folder > Pack Folder}
3278 @kindex F p
3279 @findex mh-pack-folder
3280 @item F p
3281 Pack folder (@code{mh-pack-folder}).
3282 @c -------------------------
3283 @kindex F q
3284 @findex mh-index-sequenced-messages
3285 @item F q
3286 Display messages in any sequence (@code{mh-index-sequenced-messages}).
3287 @c -------------------------
3288 @cindex @samp{Folder > Rescan Folder} menu item
3289 @cindex menu item, @samp{Folder > Rescan Folder}
3290 @kindex F r
3291 @findex mh-rescan-folder
3292 @item F r
3293 Rescan folder (@code{mh-rescan-folder}).
3294 @c -------------------------
3295 @cindex @samp{Folder > Search...} menu item
3296 @cindex menu item, @samp{Folder > Search...}
3297 @kindex F s
3298 @findex mh-search
3299 @item F s
3300 Search your MH mail (@code{mh-search}).
3301 @c -------------------------
3302 @cindex @samp{Folder > Sort Folder} menu item
3303 @cindex menu item, @samp{Folder > Sort Folder}
3304 @kindex F S
3305 @findex mh-sort-folder
3306 @item F S
3307 Sort folder (@code{mh-sort-folder}).
3308 @c -------------------------
3309 @kindex F u
3310 @findex mh-undo-folder
3311 @item F u
3312 Undo all refiles and deletes in the current folder (@code{mh-undo-folder}).
3313 @c -------------------------
3314 @cindex @samp{Folder > Visit a Folder...} menu item
3315 @cindex menu item, @samp{Folder > Visit a Folder...}
3316 @kindex F v
3317 @findex mh-visit-folder
3318 @item F v
3319 Visit folder (@code{mh-visit-folder}).
3320 @c -------------------------
3321 @cindex @samp{Message > Refile Message} menu item
3322 @cindex menu item, @samp{Message > Refile Message}
3323 @kindex o
3324 @findex mh-refile-msg
3325 @item o
3326 Refile (output) range into folder (@code{mh-refile-msg}).
3327 @c -------------------------
3328 @cindex @samp{Folder > Quit MH-E} menu item
3329 @cindex menu item, @samp{Folder > Quit MH-E}
3330 @kindex q
3331 @findex mh-quit
3332 @item q
3333 Quit the current MH-E folder (@code{mh-quit}).
3334 @c -------------------------
3335 @cindex @samp{Folder > Toggle Show/Folder} menu item
3336 @cindex menu item, @samp{Folder > Toggle Show/Folder}
3337 @kindex t
3338 @findex mh-toggle-showing
3339 @item t
3340 Toggle between MH-Folder and MH-Folder Show modes
3341 (@code{mh-toggle-showing}).
3342 @c -------------------------
3343 @cindex @samp{Message > Undo Delete/Refile} menu item
3344 @cindex menu item, @samp{Message > Undo Delete/Refile}
3345 @kindex u
3346 @findex mh-undo
3347 @item u
3348 Undo pending deletes or refiles in range (@code{mh-undo}).
3349 @c -------------------------
3350 @cindex @samp{Message > Execute Delete/Refile} menu item
3351 @cindex menu item, @samp{Message > Execute Delete/Refile}
3352 @kindex x
3353 @findex mh-execute-commands
3354 @item x
3355 Process outstanding delete and refile requests
3356 (@code{mh-execute-commands}).
3357 @end table
3359 @cindex @samp{mh-folder} customization group
3360 @cindex customization group, @samp{mh-folder}
3362 The @samp{mh-folder} customization group is used to tune these
3363 commands.
3365 @vtable @code
3366 @item mh-new-messages-folders
3367 Folders searched for the @samp{unseen} sequence (default:
3368 @code{Inbox}).
3369 @c -------------------------
3370 @item mh-ticked-messages-folders
3371 Folders searched for @code{mh-tick-seq} (default: @code{t}).
3372 @c -------------------------
3373 @item mh-large-folder
3374 The number of messages that indicates a large folder (default: 200).
3375 @c -------------------------
3376 @item mh-recenter-summary-flag
3377 On means to recenter the summary window (default: @samp{off}).
3378 @c -------------------------
3379 @item mh-recursive-folders-flag
3380 On means that commands which operate on folders do so recursively
3381 (default: @samp{off}).
3382 @c -------------------------
3383 @item mh-sortm-args
3384 Additional arguments for @command{sortm} (default: @code{nil}).
3385 @end vtable
3387 The following hooks are available.
3389 @vtable @code
3390 @item mh-after-commands-processed-hook
3391 Hook run by @kbd{x} after performing outstanding refile and delete
3392 requests (default: @code{nil}).
3393 @c -------------------------
3394 @item mh-before-commands-processed-hook
3395 Hook run by @kbd{x} before performing outstanding refile and delete
3396 requests (default: @code{nil}).
3397 @c -------------------------
3398 @item mh-before-quit-hook
3399 Hook run by q before quitting MH-E (default: @code{nil}).
3400 @c -------------------------
3401 @item mh-folder-mode-hook
3402 Hook run by @code{mh-folder-mode} when visiting a new folder (default:
3403 @code{nil}).
3404 @c -------------------------
3405 @item mh-kill-folder-suppress-prompt-hook
3406 Abnormal hook run at the beginning of @code{mh-kill-folder} (default:
3407 @code{'mh-search-p}).
3408 @c -------------------------
3409 @item mh-pack-folder-hook
3410 Hook run by @code{mh-pack-folder} after renumbering the messages
3411 (default: @code{nil}).
3412 @c -------------------------
3413 @item mh-quit-hook
3414 Hook run by q after quitting MH-E (default: @code{nil}).
3415 @c -------------------------
3416 @item mh-refile-msg-hook
3417 Hook run by o after marking each message for refiling (default:
3418 @code{nil}).
3419 @end vtable
3421 The following faces are available for customizing the appearance of
3422 the MH-Folder buffer. @xref{Scan Line Formats}.
3424 @vtable @code
3425 @item mh-folder-address
3426 Recipient face.
3427 @c -------------------------
3428 @item mh-folder-body
3429 Body text face.
3430 @c -------------------------
3431 @item mh-folder-cur-msg-number
3432 Current message number face.
3433 @c -------------------------
3434 @item mh-folder-date
3435 Date face.
3436 @c -------------------------
3437 @item mh-folder-deleted
3438 Deleted message face.
3439 @c -------------------------
3440 @item mh-folder-followup
3441 @samp{Re:} face.
3442 @c -------------------------
3443 @item mh-folder-msg-number
3444 Message number face.
3445 @c -------------------------
3446 @item mh-folder-refiled
3447 Refiled message face.
3448 @c -------------------------
3449 @vindex mh-scan-format-nmh
3450 @vindex mh-scan-sent-to-me-sender-regexp
3451 @item mh-folder-sent-to-me-hint
3452 Fontification hint face in messages sent directly to us. The detection
3453 of messages sent to us is governed by the scan format
3454 @code{mh-scan-format-nmh} and regular expression
3455 @code{mh-scan-sent-to-me-sender-regexp}.
3456 @c -------------------------
3457 @vindex mh-scan-format-nmh
3458 @vindex mh-scan-sent-to-me-sender-regexp
3459 @item mh-folder-scan-format
3460 Sender face in messages sent directly to us. The detection of messages
3461 sent to us is governed by the scan format @code{mh-scan-format-nmh}
3462 and regular expression @code{mh-scan-sent-to-me-sender-regexp}.
3463 @c -------------------------
3464 @item mh-folder-subject
3465 Subject face.
3466 @c -------------------------
3467 @item mh-folder-tick
3468 Ticked message face.
3469 @c -------------------------
3470 @item mh-folder-to
3471 @samp{To:} face.
3472 @end vtable
3474 @vindex mh-folder-mode-hook
3476 The hook @code{mh-folder-mode-hook} is called when visiting a new
3477 folder in MH-Folder mode. This could be used to set your own key
3478 bindings, for example:
3480 @vindex mh-folder-mode-hook@r{, example}
3482 @smalllisp
3483 @group
3484 (defvar my-mh-init-done nil
3485   "Non-nil when one-time MH-E settings made.")
3487 (defun my-mh-folder-mode-hook ()
3488   "Hook to set key bindings in MH-Folder mode."
3489   (if (not my-mh-init-done)             ; @r{only need to bind the keys once }
3490       (progn
3491         (local-set-key "//" 'my-search-msg)
3492         (local-set-key "b" 'mh-burst-digest)    ; @r{better use of @kbd{b}}
3493         (setq my-mh-init-done t))))
3495 (add-hook 'mh-folder-mode-hook 'my-mh-folder-mode-hook)
3497 (defun my-search-msg ()
3498   "Search for a regexp in the current message."
3499   (interactive)                         ; @r{user function}
3500   (save-window-excursion
3501     (other-window 1)                    ; @r{go to next window}
3502     (isearch-forward-regexp)))          ; @r{string search; hit return}
3503                                         ; @r{  when done}
3505 @i{Create additional key bindings via mh-folder-mode-hook}
3507 @end group
3508 @end smalllisp
3510 @cindex @command{folder}
3511 @cindex @command{refile}
3512 @cindex MH commands, @command{folder}
3513 @cindex MH commands, @command{refile}
3514 @findex mh-refile-msg
3515 @kindex o
3516 @vindex mh-refile-msg-hook
3518 MH-E has analogies for each of the MH @command{folder} and
3519 @command{refile} commands@footnote{See the sections
3520 @uref{@value{MH-BOOK-HOME}/fol.html#Youfol, Your Current Folder:
3521 folder} and @uref{@value{MH-BOOK-HOME}/fol.html#Movref, Moving and
3522 Linking Messages: refile} in the MH book.}. To refile a message in
3523 another folder, use the command @kbd{o} (@code{mh-refile-msg})
3524 (mnemonic: ``output''). You are prompted for the folder name
3525 (@pxref{Folder Selection}). Note that this command can also be used to
3526 create folders. If you specify a folder that does not exist, you will
3527 be prompted to create it. The hook @code{mh-refile-msg-hook} is called
3528 after a message is marked to be refiled.
3530 @findex mh-write-msg-to-file
3531 @kindex !
3533 If you are refiling several messages into the same folder, you can use
3534 the command @kbd{!} (@code{mh-refile-or-write-again}) to repeat the
3535 last refile or write (for the description of @kbd{>}
3536 (@code{mh-write-msg-to-file}), @pxref{Files and Pipes}). You can use a
3537 range in either case (for example, @kbd{C-u o 1 3 5-7 last:5 frombob
3538 @key{RET}}, @pxref{Ranges}).
3540 @cindex expunging refiles and deletes
3541 @cindex undoing refiles and deletes
3542 @findex mh-undo
3543 @kindex u
3545 If you've deleted a message or refiled it, but changed your mind, you
3546 can cancel the action before you've executed it. Use @kbd{u}
3547 (@code{mh-undo}) to undo a refile on or deletion of a single message.
3548 You can also undo refiles and deletes for messages that are found in a
3549 given range (@pxref{Ranges}).
3551 @findex mh-undo-folder
3552 @kindex F u
3554 Alternatively, you can use @kbd{F u} (@code{mh-undo-folder}) to undo
3555 all refiles and deletes in the current folder.
3557 @findex mh-execute-commands
3558 @kindex x
3560 If you've marked messages to be deleted or refiled and you want to go
3561 ahead and delete or refile the messages, use @kbd{x}
3562 (@code{mh-execute-commands}). Many MH-E commands that may affect the
3563 numbering of the messages (such as @kbd{F r} or @kbd{F p}) will ask if
3564 you want to process refiles or deletes first and then either run
3565 @kbd{x} for you or undo the pending refiles and deletes.
3567 @kindex x
3568 @vindex mh-after-commands-processed-hook
3569 @vindex mh-before-commands-processed-hook
3570 @vindex mh-current-folder
3572 The command @kbd{x} runs @code{mh-before-commands-processed-hook}
3573 before the commands are processed and
3574 @code{mh-after-commands-processed-hook} after the commands are
3575 processed. Variables that are useful with the former hook include
3576 @code{mh-delete-list} and @code{mh-refile-list} which can be used to
3577 see which changes will be made to the current folder,
3578 @code{mh-current-folder}. Variables that are useful with the latter
3579 hook include @code{mh-folders-changed}, which lists which folders were
3580 affected by deletes and refiles. This list will always include the
3581 current folder @code{mh-current-folder}.
3583 @findex mh-copy-msg
3584 @kindex c
3585 @kindex o
3587 If you wish to copy a message to another folder, you can use the
3588 command @kbd{c} (@code{mh-copy-msg}) (see the @option{-link} argument
3589 to @command{refile}(1)). Like the command @kbd{o}, this command
3590 prompts you for the name of the target folder and you can specify a
3591 range (@pxref{Ranges}). Note that unlike the command @kbd{o}, the copy
3592 takes place immediately. The original copy remains in the current
3593 folder.
3595 @cindex junk mail
3596 @cindex MH-Folder mode
3597 @cindex MH-Folder Show mode
3598 @cindex modes, MH-Folder
3599 @cindex modes, MH-Folder Show
3600 @cindex spam
3601 @findex mh-toggle-showing
3602 @kindex t
3604 The command @kbd{t} (@code{mh-toggle-showing}) switches between
3605 MH-Folder mode and MH-Folder Show mode@footnote{For you Emacs wizards,
3606 this is implemented as an Emacs minor mode.}. MH-Folder mode turns off
3607 the associated show buffer so that you can perform operations on the
3608 messages quickly without reading them. This is an excellent way to
3609 prune out your junk mail or to refile a group of messages to another
3610 folder for later examination.
3612 @cindex MH-Folder mode
3613 @cindex MH-Show mode
3614 @cindex modes, MH-Folder
3615 @cindex modes, MH-Show
3616 @cindex moving between messages
3617 @kindex t
3618 @vindex mh-recenter-summary-flag
3620 When you use @kbd{t} to toggle from MH-Folder Show mode to MH-Folder
3621 mode, the MH-Show buffer is hidden and the MH-Folder buffer is left
3622 alone. Setting @code{mh-recenter-summary-flag} to a non-@code{nil}
3623 value causes the toggle to display as many scan lines as possible,
3624 with the cursor at the middle. The effect of
3625 @code{mh-recenter-summary-flag} is rather useful, but it can be
3626 annoying on a slow network connection.
3628 @findex mh-visit-folder
3629 @kindex F v
3630 @vindex mh-large-folder
3632 When you want to read the messages that you have refiled into folders,
3633 use the command @kbd{F v} (@code{mh-visit-folder}) to visit the
3634 folder. You are prompted for the folder name. The folder buffer will
3635 show just unseen messages if there are any; otherwise, it will show
3636 all the messages in the buffer as long there are fewer than
3637 @code{mh-large-folder} messages. If there are more, then you are
3638 prompted for a range of messages to scan. You can provide a prefix
3639 argument in order to specify a range of messages to show when you
3640 visit the folder (@pxref{Ranges}). In this case, regions are not used
3641 to specify the range and @code{mh-large-folder} is ignored. Note that
3642 this command can also be used to create folders. If you specify a
3643 folder that does not exist, you will be prompted to create it.
3645 @findex mh-search
3646 @kindex F s
3648 If you forget where you've refiled your messages, you can find them
3649 using @kbd{F s} (@code{mh-search}). @xref{Searching}.
3651 @cindex @command{procmail}
3652 @cindex @samp{unseen} sequence
3653 @cindex sequence, @samp{unseen}
3654 @cindex Unix commands, @command{procmail}
3655 @cindex unseen messages, viewing
3656 @findex mh-index-new-messages
3657 @kindex F n
3658 @vindex mh-new-messages-folders
3660 If you use a program such as @command{procmail} to file your incoming
3661 mail automatically, you can display new, unseen, messages using the
3662 command @kbd{F n} (@code{mh-index-new-messages}). All messages in the
3663 @samp{unseen} sequence from the folders in
3664 @code{mh-new-messages-folders} are listed. However, this list of
3665 folders can be overridden with a prefix argument: with a prefix
3666 argument, enter a space-separated list of folders, or nothing to
3667 search all folders.
3669 @cindex @samp{tick} sequence
3670 @cindex sequence, @samp{tick}
3671 @cindex ticked messages, viewing
3672 @findex mh-index-ticked-messages
3673 @kindex F '
3674 @vindex mh-ticked-messages-folders
3676 If you have ticked messages (@pxref{Sequences}), you can display them
3677 using the command @kbd{F '} (@code{mh-index-ticked-messages}). All
3678 messages in the @samp{tick} sequence from the folders in
3679 @code{mh-ticked-messages-folders} are listed. With a prefix argument,
3680 enter a space-separated list of folders, or nothing to search all
3681 folders.
3683 @findex mh-index-sequenced-messages
3684 @kindex F q
3685 @vindex mh-new-messages-folders
3687 You can display messages in any sequence with the command @kbd{F q}
3688 (@code{mh-index-sequenced-messages}). All messages from the folders in
3689 @code{mh-new-messages-folders} in the sequence you provide are listed.
3690 With a prefix argument, enter a space-separated list of folders at the
3691 prompt, or nothing to search all folders.
3693 @vindex mh-new-messages-folders
3694 @vindex mh-recursive-folders-flag
3695 @vindex mh-ticked-messages-folders
3697 Set the options @code{mh-new-messages-folders} and
3698 @code{mh-ticked-messages-folders} to @samp{Inbox} to search the
3699 @samp{+inbox} folder or @samp{All} to search all of the top level
3700 folders. Otherwise, list the folders that should be searched with the
3701 @samp{Choose Folders} menu item. See @code{mh-recursive-folders-flag}.
3703 @cindex buffers, @file{*MH-E Folders*}
3704 @cindex @file{*MH-E Folders*}
3705 @findex mh-kill-folder
3706 @findex mh-list-folders
3707 @findex mh-pack-folder
3708 @findex mh-rescan-folder
3709 @findex mh-sort-folder
3710 @kindex F k
3711 @kindex F l
3712 @kindex F p
3713 @kindex F r
3714 @kindex F S
3716 Other commands you can perform on folders include: @kbd{F l}
3717 (@code{mh-list-folders}), to place a listing of all the folders in
3718 your mail directory in a buffer called @file{*MH-E Folders*}
3719 (@pxref{Miscellaneous}); @kbd{F k} (@code{mh-kill-folder}), to remove
3720 a folder; @kbd{F S} (@code{mh-sort-folder}), to sort the messages by
3721 date (see @command{sortm}(1) to see how to sort by other criteria);
3722 @kbd{F p} (@code{mh-pack-folder}), to pack a folder, removing gaps
3723 from the numbering sequence; and @kbd{F r} (@code{mh-rescan-folder}),
3724 to rescan the folder, which is useful to grab all messages in your
3725 @samp{+inbox} after processing your new mail for the first time. If
3726 you don't want to rescan the entire folder, the commands @kbd{F r} or
3727 @kbd{F p} will accept a range (@pxref{Ranges}).
3729 @kindex F p
3730 @vindex mh-pack-folder-hook
3732 The command @kbd{F p} runs @code{mh-pack-folder-hook} after
3733 renumbering the messages. A variable that is useful with this hook
3734 is @code{mh-current-folder}.
3736 @kindex TAB
3737 @vindex mh-recursive-folders-flag
3739 By default, operations on folders work only one level at a time. Set
3740 @code{mh-recursive-folders-flag} to non-@code{nil} to operate on all
3741 folders. This mostly means that you'll be able to see all your folders
3742 when you press @key{TAB} when prompted for a folder name.
3744 @findex mh-search-p
3745 @kindex k
3746 @vindex mh-kill-folder-suppress-prompt-functions
3748 The hook @code{mh-kill-folder-suppress-prompt-functions} is an abnormal
3749 hook run at the beginning of the command @kbd{k}. The hook functions
3750 are called with no arguments and should return a non-@code{nil} value to
3751 suppress the normal prompt when you remove a folder. This is useful
3752 for folders that are easily regenerated. The default value of
3753 @code{mh-search-p} suppresses the prompt on folders generated by
3754 searching.
3756 @sp 1
3757 @center @strong{NOTE}
3759 @quotation
3760 Use this hook with care. If there is a bug in your hook which returns
3761 @code{t} on @samp{+inbox} and you press @kbd{k} by accident in the
3762 @code{+inbox} folder, you will not be happy.
3763 @end quotation
3764 @sp 1
3766 @cindex @command{sortm}
3767 @cindex @file{.mh_profile}
3768 @cindex files, @file{.mh_profile}
3769 @cindex MH commands, @command{sortm}
3770 @cindex MH profile component, @samp{sortm}
3771 @cindex @samp{sortm} MH profile component
3772 @kindex F S
3773 @vindex mh-sortm-args
3775 The option @code{mh-sortm-args} holds extra arguments to pass on to
3776 the command @command{sortm}@footnote{See the section
3777 @uref{@value{MH-BOOK-HOME}/sorsor.html, Sorting Messages: sortm} in the
3778 MH book.} when a prefix argument is used with @kbd{F S}. Normally
3779 default arguments to @command{sortm} are specified in the MH profile.
3780 This option may be used to provide an alternate view. For example,
3781 @samp{'(\"-nolimit\" \"-textfield\" \"subject\")} is a useful setting.
3783 @cindex exiting
3784 @cindex quitting
3785 @findex mh-quit
3786 @kindex q
3788 When you want to quit using MH-E and go back to editing, you can use
3789 the @kbd{q} (@code{mh-quit}) command. This buries the buffers of the
3790 current MH-E folder and restores the buffers that were present when
3791 you first ran @kbd{M-x mh-rmail}. It also removes any MH-E working
3792 buffers whose name begins with @samp{ *mh-} or @file{*MH-E }
3793 (@pxref{Miscellaneous}). You can later restore your MH-E session by
3794 selecting the @samp{+inbox} buffer or by running @kbd{M-x mh-rmail}
3795 again.
3797 @findex mh-execute-commands
3798 @kindex q
3799 @vindex mh-before-quit-hook
3800 @vindex mh-before-quit-hook@r{, example}
3801 @vindex mh-quit-hook
3802 @vindex mh-quit-hook@r{, example}
3804 The two hooks @code{mh-before-quit-hook} and @code{mh-quit-hook} are
3805 called by @kbd{q}. The former one is called before the quit occurs, so
3806 you might use it to perform any MH-E operations; you could perform
3807 some query and abort the quit or call @code{mh-execute-commands}, for
3808 example. The latter is not run in an MH-E context, so you might use it
3809 to modify the window setup. If you find that @kbd{q} buries a lot of
3810 buffers that you would rather remove, you can use both
3811 @code{mh-before-quit-hook} and @code{mh-quit-hook} to accomplish that.
3813 @smalllisp
3814 @group
3815 (defvar my-mh-folder-buffer-to-delete nil
3816   "Folder buffer that is being quit.")
3818 (defun my-mh-before-quit-hook ()
3819   "Save folder buffer that is to be deleted."
3820   (setq my-mh-folder-buffer-to-delete (current-buffer)))
3822 (defun my-mh-quit-hook ()
3823   "Kill folder buffer rather than just bury it."
3824   (set-buffer my-mh-folder-buffer-to-delete)
3825   (if (get-buffer mh-show-buffer)
3826       (kill-buffer mh-show-buffer))
3827   (kill-buffer (current-buffer)))
3829 @i{Kill MH-Folder buffer instead of burying it}
3830 @end group
3831 @end smalllisp
3833 @cindex folders, renaming
3834 @cindex renaming folders
3835 @findex dired
3836 @findex dired-do-rename
3838 You can use dired to manipulate the folders themselves. For example, I
3839 renamed my @samp{+out} folder to the more common @samp{+outbox} by
3840 running dired on my mail directory (@kbd{M-x dired @key{RET} ~/Mail
3841 @key{RET}}), moving my cursor to @samp{out} and using the command
3842 @kbd{R} (@code{dired-do-rename}).
3844 @node Sending Mail, Editing Drafts, Folders, Top
3845 @chapter Sending Mail
3847 @cindex sending mail
3848 @findex mh-smail
3850 You can send a mail message in several ways. You can call @kbd{M-x
3851 mh-smail} directly, or from the command line like this:
3853 @cindex starting from command line
3855 @smallexample
3856 $ @kbd{emacs -f mh-smail}
3857 @end smallexample
3859 @findex goto-address-at-point
3860 @vindex mail-user-agent
3862 There are some commands that need to send a mail message, such as
3863 @code{goto-address-at-point}. You can configure Emacs to have these
3864 commands use MH-E by setting the option @code{mail-user-agent} to
3865 @samp{Emacs interface to MH}.
3867 @cindex @samp{Message} menu
3868 @cindex menu, @samp{Message}
3870 From within MH-E's MH-Folder mode, other methods of sending mail are
3871 available as well. These can also be found in the @samp{Message} menu.
3873 @table @kbd
3874 @cindex @samp{Message > Edit Message Again} menu item
3875 @cindex menu item, @samp{Message > Edit Message Again}
3876 @kindex e
3877 @findex mh-edit-again
3878 @item e
3879 Edit a message to send it again (@code{mh-edit-again}).
3880 @c -------------------------
3881 @cindex @samp{Message > Re-edit a Bounced Message} menu item
3882 @cindex menu item, @samp{Message > Re-edit a Bounced Message}
3883 @kindex E
3884 @findex mh-extract-rejected-mail
3885 @item E
3886 Edit a message that was returned by the mail system
3887 (@code{mh-extract-rejected-mail}).
3888 @c -------------------------
3889 @cindex @samp{Message > Forward Message...} menu item
3890 @cindex menu item, @samp{Message > Forward Message...}
3891 @kindex f
3892 @findex mh-forward
3893 @item f
3894 Forward message (@code{mh-forward}).
3895 @c -------------------------
3896 @cindex @samp{Message > Reply to Message...} menu item
3897 @cindex menu item, @samp{Message > Reply to Message...}
3898 @kindex r
3899 @findex mh-reply
3900 @item r
3901 Reply to a message (@code{mh-reply}).
3902 @c -------------------------
3903 @cindex @samp{Message > Compose a New Message} menu item
3904 @cindex menu item, @samp{Message > Compose a New Message}
3905 @kindex s
3906 @findex mh-send
3907 @item s
3908 Compose a message (@code{mh-send}).
3909 @c -------------------------
3910 @cindex @samp{Message > Redistribute Message...} menu item
3911 @cindex menu item, @samp{Message > Redistribute Message...}
3912 @kindex M-d
3913 @findex mh-redistribute
3914 @item M-d
3915 Redistribute a message (@code{mh-redistribute}).
3916 @c -------------------------
3917 @findex mh-smail
3918 @item M-x mh-smail
3919 Compose a message with the MH mail system.
3920 @c -------------------------
3921 @findex mh-smail-other-window
3922 @item M-x mh-smail-other-window
3923 Compose a message with the MH mail system in other window.
3924 @end table
3926 @cindex @samp{mh-sending-mail} customization group
3927 @cindex customization group, @samp{mh-sending-mail}
3929 In addition, several options from the @samp{mh-sending-mail}
3930 customization group are useful when sending mail or replying to mail.
3931 They are summarized in the following table.
3933 @vtable @code
3934 @item mh-compose-forward-as-mime-flag
3935 On means that messages are forwarded as attachments (default:
3936 @samp{on}).
3937 @c -------------------------
3938 @item mh-compose-letter-function
3939 Hook run when starting a new draft (default: @code{nil}).
3940 @c -------------------------
3941 @item mh-compose-prompt-flag
3942 On means prompt for header fields when composing a new draft (default:
3943 @samp{off}).
3944 @c -------------------------
3945 @item mh-forward-subject-format
3946 Format string for forwarded message subject (default: @code{"%s:
3947 %s"}).
3948 @c -------------------------
3949 @item mh-insert-x-mailer-flag
3950 On means append an @samp{X-Mailer:} header field to the header
3951 (default: @samp{on}).
3952 @c -------------------------
3953 @item mh-redist-full-contents-flag
3954 On means the @command{dist} command needs entire letter for
3955 redistribution (default: @samp{off}).
3956 @c -------------------------
3957 @item mh-reply-default-reply-to
3958 Sets the person or persons to whom a reply will be sent (default:
3959 @samp{Prompt}).
3960 @c -------------------------
3961 @item mh-reply-show-message-flag
3962 On means the MH-Show buffer is displayed using @kbd{r}
3963 (@code{mh-reply}) (default: @samp{on}).
3964 @end vtable
3966 The following hooks are available.
3968 @vtable @code
3969 @item mh-annotate-msg-hook
3970 Hook run by @code{mh-annotate-msg} after annotation (default:
3971 @code{nil}).
3972 @c -------------------------
3973 @item mh-forward-hook
3974 Hook run by @code{mh-forward} on a forwarded letter (default:
3975 @code{nil}).
3976 @c -------------------------
3977 @item mh-letter-mode-hook
3978 Hook run by @code{mh-letter-mode} on a new letter (default:
3979 @code{nil}).
3980 @end vtable
3982 @findex mh-annotate-msg
3983 @vindex mh-annotate-list
3984 @vindex mh-annotate-msg-hook
3985 @vindex mh-current-folder
3987 A hook that is called whenever a message is sent and after the scan
3988 lines and message are annotated is @code{mh-annotate-msg-hook}. Hook
3989 functions can access the current folder name with
3990 @code{mh-current-folder} and obtain the message numbers of the
3991 annotated messages with @code{mh-annotate-list}.
3993 The rest of the functions and options introduced here are explained in
3994 more detail in the following sections.
3996 @menu
3997 * Composing::
3998 * Replying::
3999 * Forwarding::
4000 * Redistributing::
4001 * Editing Again::
4002 @end menu
4004 @node Composing, Replying, Sending Mail, Sending Mail
4005 @section Composing
4007 @cindex @file{.emacs}
4008 @cindex MH-Folder mode
4009 @cindex composing mail
4010 @cindex draft
4011 @cindex files, @file{.emacs}
4012 @cindex modes, MH-Folder
4013 @cindex sending mail
4014 @findex mh-smail
4015 @findex mh-smail-other-window
4017 Outside of an MH-Folder buffer, you must call either @kbd{M-x
4018 mh-smail} or @kbd{M-x mh-smail-other-window} to compose a new message.
4019 The former command always creates a two-window layout with the current
4020 buffer on top and the draft on the bottom. Use the latter command if
4021 you would rather preserve the window layout. You may find adding the
4022 following key bindings to @file{~/.emacs} useful:
4024 @smalllisp
4025 (global-set-key "\C-xm" 'mh-smail)
4026 (global-set-key "\C-x4m" 'mh-smail-other-window)
4027 @end smalllisp
4029 @cindex draft folder
4030 @cindex MH-Letter mode
4031 @cindex modes, MH-Letter
4032 @findex mh-send
4033 @kindex m
4035 From within a MH-Folder buffer, you can simply use the command @kbd{m}
4036 (@code{mh-send}). However you invoke @code{mh-send}, your letter
4037 appears in an Emacs buffer whose mode is MH-Letter (to see what the
4038 buffer looks like, @pxref{Sending Mail Tour}). MH-Letter mode allows
4039 you to edit your message, to check the validity of the recipients, to
4040 insert attachments and other messages into your message, and to send
4041 the message. We'll go more into depth about editing a
4042 @dfn{draft}@footnote{I highly recommend that you use a @dfn{draft
4043 folder} so that you can edit several drafts in parallel. To do so,
4044 create a folder named @samp{+drafts} for example, and add the profile
4045 component @samp{Draft-Folder: drafts} (see @code{mh-profile}(5)).} (a
4046 message you're composing) in just a moment (@pxref{Editing Drafts}).
4048 @vindex mh-compose-prompt-flag
4050 If you prefer to be prompted for the recipient and subject fields
4051 before the MH-Letter buffer appears, turn on the option
4052 @code{mh-compose-prompt-flag}.
4054 @cindex header field, @samp{X-Mailer}
4055 @cindex @samp{X-Mailer} header field
4056 @vindex mh-insert-x-mailer-flag
4058 MH-E adds an @samp{X-Mailer:} header field to the header that includes
4059 the version of MH-E and Emacs that you are using. If you don't want to
4060 participate in our marketing, you can turn off the option
4061 @code{mh-insert-x-mailer-flag}.
4063 @cindex @command{repl}
4064 @cindex @file{components}
4065 @cindex MH commands, @command{repl}
4066 @cindex MH-Letter mode
4067 @cindex Mail mode
4068 @cindex files, @file{components}
4069 @cindex modes, MH-Letter
4070 @cindex modes, Mail
4071 @vindex mail-mode-hook
4072 @vindex mh-letter-mode-hook
4073 @vindex text-mode-hook
4075 Two hooks are provided to run commands on your freshly created draft.
4076 The first hook, @code{mh-letter-mode-hook}, allows you to do some
4077 processing before editing a letter@footnote{Actually, because
4078 MH-Letter mode inherits from Mail mode, the hooks
4079 @code{text-mode-hook} and @code{mail-mode-hook} are run (in that
4080 order) before @code{mh-letter-mode-hook}.}. For example, you may wish
4081 to modify the header after @command{repl} has done its work, or you
4082 may have a complicated @file{components} file and need to tell MH-E
4083 where the cursor should go. Here's an example of how you would use
4084 this hook.
4086 @findex mh-insert-signature@r{, example}
4088 @smalllisp
4089 @group
4090 (defvar letter-mode-init-done-flag nil
4091   "Non-nil means one-time MH-E settings have been made.")
4093 (defun my-mh-letter-mode-hook ()
4094   "Prepare letter for editing."
4095   (when (not letter-mode-init-done)     ; @r{only need to bind the keys once}
4096     (local-set-key "\C-ctb" 'add-enriched-text)
4097     (local-set-key "\C-cti" 'add-enriched-text)
4098     (local-set-key "\C-ctf" 'add-enriched-text)
4099     (local-set-key "\C-cts" 'add-enriched-text)
4100     (local-set-key "\C-ctB" 'add-enriched-text)
4101     (local-set-key "\C-ctu" 'add-enriched-text)
4102     (local-set-key "\C-ctc" 'add-enriched-text)
4103     (setq letter-mode-init-done t))
4104   (save-excursion
4105     (goto-char (point-max))             ; @r{go to end of message to}
4106     (mh-insert-signature)))             ;   @r{insert signature}
4108 @i{Prepare draft for editing via mh-letter-mode-hook}
4110 @end group
4111 @end smalllisp
4113 The function, @code{add-enriched-text} is defined in the example in
4114 @ref{Adding Attachments}.
4116 @vindex mh-compose-letter-function
4117 @vindex mh-letter-mode-hook
4119 The second hook, a function really, is
4120 @code{mh-compose-letter-function}. Like @code{mh-letter-mode-hook}, it
4121 is called just before editing a new message; however, it is the last
4122 function called before you edit your message. The consequence of this
4123 is that you can write a function to write and send the message for
4124 you. This function is passed three arguments: the contents of the
4125 @samp{To:}, @samp{Subject:}, and @samp{Cc:} header fields.
4127 @node Replying, Forwarding, Composing, Sending Mail
4128 @section Replying to Mail
4130 @cindex @command{mhl}
4131 @cindex @file{mhl.reply}
4132 @cindex MH commands, @command{mhl}
4133 @cindex files, @file{mhl.reply}
4134 @cindex replying
4135 @findex mh-reply
4136 @kindex r
4138 To compose a reply to a message, use the @kbd{r} (@code{mh-reply})
4139 command.
4141 When you reply to a message, you are first prompted with @samp{Reply
4142 to whom?}. You have several choices here.
4144 @quotation
4145 @multitable @columnfractions .20 .80
4146 @c @headitem Response @tab Reply Goes To
4147 @c XXX @headitem not yet supported by SourceForge's texi2pdf.
4148 @item @b{Response} @tab @b{Reply Goes To}
4149 @c -------------------------
4150 @item @kbd{from}
4151 @tab
4152 The person who sent the message. This is the default, so @key{RET} is
4153 sufficient.
4154 @c -------------------------
4155 @item @kbd{to}
4156 @tab
4157 Replies to the sender, plus all recipients in the @samp{To:} header field.
4158 @c -------------------------
4159 @item @kbd{cc}@*@kbd{all}
4160 @tab
4161 Forms a reply to the addresses in the @samp{Mail-Followup-To:} header
4162 field if one exists; otherwise forms a reply to the sender, plus all
4163 recipients.
4164 @end multitable
4165 @end quotation
4167 @cindex @command{repl}
4168 @cindex MH commands, @command{repl}
4169 @vindex mh-reply-default-reply-to
4171 Depending on your answer, @command{repl}@footnote{See the section
4172 @uref{@value{MH-BOOK-HOME}/reprep.html, Replying to Messages: repl} in
4173 the MH book.} is given a different argument to form your reply.
4174 Specifically, a choice of @kbd{from} or none at all runs @samp{repl
4175 -nocc all}, and a choice of @kbd{to} runs @samp{repl -cc to}. Finally,
4176 either @kbd{cc} or @kbd{all} runs @samp{repl -cc all -nocc me}. If you
4177 find that most of the time you specify one of these choices when you
4178 reply to a message, you can change the option
4179 @code{mh-reply-default-reply-to} from its default value of
4180 @samp{Prompt} to one of the choices listed above. You can always edit
4181 the recipients in the draft.
4183 @cindex @samp{repl} MH profile component
4184 @cindex MH profile component, @samp{repl}
4185 @cindex MH-Letter mode
4186 @cindex MH-Show mode
4187 @cindex draft
4188 @cindex modes, MH-Letter
4189 @cindex modes, MH-Show
4191 Two windows are then created. One window contains the message to which
4192 you are replying in an MH-Show buffer. Your draft, in MH-Letter mode
4193 (@pxref{Editing Drafts}), is in the other window. If the reply draft
4194 was not one that you expected, check the things that affect the
4195 behavior of @command{repl} which include the @samp{repl:} profile
4196 component and the @file{replcomps} and @file{replgroupcomps} files.
4198 If you supply a prefix argument (as in @kbd{C-u r}), the message you
4199 are replying to is inserted in your reply after having first been run
4200 through @command{mhl} with the format file @file{mhl.reply}. See
4201 @command{mhl}(1) or the section
4202 @uref{@value{MH-BOOK-HOME}/shomes.html#Usisho, Using mhl} in the MH
4203 book to see how you can modify the default @file{mhl.reply} file.
4205 @vindex mh-yank-behavior
4207 Alternatively, you can customize the option @code{mh-yank-behavior}
4208 and choose one of its @samp{Automatically} variants to do the same
4209 thing. @xref{Inserting Letter}. If you do so, the prefix argument has
4210 no effect.
4212 Another way to include the message automatically in your draft is to
4213 use @samp{repl: -filter repl.filter} in your MH profile.
4215 @vindex mh-reply-show-message-flag
4217 If you include the message automatically, you can hide the MH-Show
4218 buffer by turning off the option @code{mh-reply-show-message-flag}.
4220 If you wish to customize the header or other parts of the reply draft,
4221 please see @command{repl}(1) and @code{mh-format}(5).
4223 @node Forwarding, Redistributing, Replying, Sending Mail
4224 @section Forwarding Mail
4226 @cindex @command{forw}
4227 @cindex draft
4228 @cindex forwarding
4229 @cindex MH commands, @command{forw}
4230 @findex mh-forward
4231 @kindex f
4232 @vindex mh-forward-hook
4234 To forward a message, use the @kbd{f} (@code{mh-forward}) command. You
4235 are prompted for the @samp{To:} and @samp{cc:} recipients. You are
4236 given a draft to edit that looks like it would if you had run the MH
4237 command @command{forw}@footnote{See the section
4238 @uref{@value{MH-BOOK-HOME}/forfor.html, Forwarding Messages: forw} in
4239 the MH book.}. You can then add some text (@pxref{Editing Drafts}).
4240 You can forward several messages by using a range (@pxref{Ranges}).
4241 All of the messages in the range are inserted into your draft. The
4242 hook @code{mh-forward-hook} is called on the draft.
4244 @cindex @file{.mh_profile}
4245 @cindex files, @file{.mh_profile}
4246 @cindex MH profile component, @samp{forw}
4247 @cindex @samp{forw} MH profile component
4248 @vindex mh-compose-forward-as-mime-flag
4250 By default, the option @code{mh-compose-forward-as-mime-flag} is on
4251 which means that the forwarded messages are included as attachments.
4252 These are inline attachments so the forwarded message should appear in
4253 the body of your recipient's mail program. If you would prefer to
4254 forward your messages verbatim (as text, inline), then turn off this
4255 option. Forwarding messages verbatim works well for short, textual
4256 messages, but your recipient won't be able to view any non-textual
4257 attachments that were in the forwarded message. Be aware that if you
4258 have @samp{forw: -mime} in your MH profile, then forwarded messages
4259 will always be included as attachments regardless of the settings of
4260 @code{mh-compose-forward-as-mime-flag}.
4262 @vindex mh-forward-subject-format
4264 The format of the @samp{Subject:} header field for forwarded messages
4265 is controlled by the option @code{mh-forward-subject-format}. This
4266 option is a string which includes two escapes (@samp{%s}). The first
4267 @samp{%s} is replaced with the sender of the original message, and the
4268 second one is replaced with the original @samp{Subject:}. The default
4269 value of @code{"%s: %s"} takes a message with the header:
4271 @smallexample
4272 @group
4273 To: Bill Wohler <wohler@@stop.mail-abuse.org>
4274 Subject: Re: 49er football
4275 From: Greg DesBrisay <gd@@stop.mail-abuse.org>
4276 @end group
4277 @end smallexample
4279 and creates a subject header field of:
4281 @smallexample
4282 Subject: Greg DesBrisay: Re: 49er football
4283 @end smallexample
4285 @node Redistributing, Editing Again, Forwarding, Sending Mail
4286 @section Redistributing Your Mail
4288 @cindex @command{dist}
4289 @cindex MH commands, @command{dist}
4290 @cindex redistributing
4291 @findex mh-redistribute
4292 @kindex M-d
4294 The command @kbd{M-d} (@code{mh-redistribute}) is similar in function
4295 to forwarding mail, but it does not allow you to edit the message, nor
4296 does it add your name to the @samp{From:} header field. It appears to
4297 the recipient as if the message had come from the original sender.
4298 When you run this command, you are prompted for the recipients.
4300 @findex mh-edit-again
4301 @kindex e
4303 For more information on redistributing messages, see
4304 @command{dist}(1). Also investigate the command @kbd{e}
4305 (@code{mh-edit-again}) for another way to redistribute messages
4306 (@pxref{Editing Again}).
4308 @cindex @command{send}
4309 @cindex MH commands, @command{send}
4310 @vindex mh-redist-full-contents-flag
4312 The option @code{mh-redist-full-contents-flag} must be turned on if
4313 @command{dist}@footnote{See the section
4314 @uref{@value{MH-BOOK-HOME}/disdis.html, Distributing Messages with
4315 dist} in the MH book.} requires the whole letter for redistribution,
4316 which is the case if @command{send}@footnote{See the section
4317 @uref{@value{MH-BOOK-HOME}/sensen.html, Sending Some Mail: comp send}
4318 in the MH book.} is compiled with the @sc{berk} option (which many
4319 people abhor). If you find that MH will not allow you to redistribute
4320 a message that has been redistributed before, turn off this option.
4322 The hook @code{mh-annotate-msg-hook} is run after annotating the
4323 message and scan line (@pxref{Sending Mail}).
4325 @node Editing Again,  , Redistributing, Sending Mail
4326 @section Editing Old Drafts and Bounced Messages
4328 @cindex @file{draft}
4329 @cindex files, @file{draft}
4330 @cindex re-editing drafts
4331 @findex mh-edit-again
4332 @kindex F v drafts
4333 @kindex e
4334 @kindex n
4336 If you don't complete a draft for one reason or another, and if the
4337 draft buffer is no longer available, you can pick your draft up again
4338 with @kbd{e} (@code{mh-edit-again}). If you don't use a draft
4339 folder, your last @file{draft} file will be used. If you use draft
4340 folders, you'll need to visit the draft folder with @kbd{F v drafts
4341 @key{RET}}, use @kbd{n} to move to the appropriate message, and then
4342 use @kbd{e} to prepare the message for editing.
4344 @kindex e
4346 The @kbd{e} command can also be used to take messages that were sent
4347 to you and to send them to more people.
4349 @cindex Mailer-Daemon
4350 @findex mh-extract-rejected-mail
4351 @kindex C-c C-c
4352 @kindex E
4354 Don't use @kbd{e} to re-edit a message from a @i{Mailer-Daemon} who
4355 complained that your mail wasn't posted for some reason or another. In
4356 this case, use @kbd{E} (@code{mh-extract-rejected-mail}) to prepare
4357 the message for editing by removing the @i{Mailer-Daemon} envelope and
4358 unneeded header fields. Fix whatever addressing problem you had, and
4359 send the message again with @kbd{C-c C-c}.
4361 @node Editing Drafts, Aliases, Sending Mail, Top
4362 @chapter Editing a Draft
4364 @cindex @samp{Letter} menu
4365 @cindex MH-Letter mode
4366 @cindex draft
4367 @cindex editing draft
4368 @cindex menu, @samp{Letter}
4369 @cindex modes, MH-Letter
4371 When you edit a message that you want to send (called a @dfn{draft} in
4372 this case), the mode used is MH-Letter. This mode provides several
4373 commands in addition to the normal Emacs editing commands to help you
4374 edit your draft. These can also be found in the @samp{Letter} menu.
4376 @table @kbd
4377 @kindex SPC
4378 @findex mh-letter-complete-or-space
4379 @item @key{SPC}
4380 Perform completion or insert space (@code{mh-letter-complete-or-space}).
4381 @c -------------------------
4382 @kindex M-TAB
4383 @findex mh-letter-complete
4384 @item M-@key{TAB}
4385 Perform completion on header field or word preceding point
4386 (@code{mh-letter-complete}).
4387 @c -------------------------
4388 @kindex , @r{(comma)}
4389 @findex mh-letter-confirm-address
4390 @item , (comma)
4391 Flash alias expansion (@code{mh-letter-confirm-address}).
4392 @c -------------------------
4393 @kindex TAB
4394 @findex mh-letter-next-header-field-or-indent
4395 @item @key{TAB}
4396 Cycle to next field (@code{mh-letter-next-header-field-or-indent}).
4397 @c -------------------------
4398 @kindex S-TAB
4399 @findex mh-letter-previous-header-field
4400 @item S-@key{TAB}
4401 Cycle to the previous header field
4402 (@code{mh-letter-previous-header-field}).
4403 @c -------------------------
4404 @kindex C-c ?
4405 @findex mh-help
4406 @item C-c ?
4407 Display cheat sheet for the MH-E commands (@code{mh-help}).
4408 @c -------------------------
4409 @cindex @samp{Letter > Send This Draft} menu item
4410 @cindex menu item, @samp{Letter > Send This Draft}
4411 @kindex C-c C-c
4412 @findex mh-send-letter
4413 @item C-c C-c
4414 Save draft and send message (@code{mh-send-letter}).
4415 @c -------------------------
4416 @kindex C-c C-d
4417 @findex mh-insert-identity
4418 @item C-c C-d
4419 Insert fields specified by the given identity
4420 (@code{mh-insert-identity}). @xref{Identities}.
4421 @c -------------------------
4422 @cindex @samp{Letter > Pull in All Compositions (MH)} menu item
4423 @cindex menu item, @samp{Letter > Pull in All Compositions (MH)}
4424 @kindex C-c C-e
4425 @findex mh-mh-to-mime
4426 @item C-c C-e
4427 Compose @sc{mime} message from MH-style directives
4428 (@code{mh-mh-to-mime}).
4429 @c -------------------------
4430 @kindex C-c C-f C-a
4431 @kindex C-c C-f a
4432 @findex mh-to-field
4433 @item C-c C-f C-a
4434 @itemx C-c C-f a
4435 Move to @samp{Mail-Reply-To:} header field (@code{mh-to-field}).
4436 @c -------------------------
4437 @kindex C-c C-f C-b
4438 @kindex C-c C-f b
4439 @item C-c C-f C-b
4440 @itemx C-c C-f b
4441 Move to @samp{Bcc:} header field (@code{mh-to-field}).
4442 @c -------------------------
4443 @kindex C-c C-f C-c
4444 @kindex C-c C-f c
4445 @item C-c C-f C-c
4446 @itemx C-c C-f c
4447 Move to @samp{Cc:} header field (@code{mh-to-field}).
4448 @c -------------------------
4449 @kindex C-c C-f C-d
4450 @kindex C-c C-f d
4451 @item C-c C-f C-d
4452 @itemx C-c C-f d
4453 Move to @samp{Dcc:} header field (@code{mh-to-field}).
4454 @c -------------------------
4455 @kindex C-c C-f C-f
4456 @kindex C-c C-f f
4457 @findex mh-to-fcc
4458 @item C-c C-f C-f
4459 @itemx C-c C-f f
4460 Move to @samp{Fcc:} header field (@code{mh-to-fcc}).
4461 @c -------------------------
4462 @kindex C-c C-f C-l
4463 @kindex C-c C-f l
4464 @item C-c C-f C-l
4465 @itemx C-c C-f l
4466 Move to @samp{Mail-Followup-To:} header field (@code{mh-to-field}).
4467 @c -------------------------
4468 @kindex C-c C-f C-m
4469 @kindex C-c C-f m
4470 @item C-c C-f C-m
4471 @itemx C-c C-f m
4472 Move to @samp{From:} header field (@code{mh-to-field}).
4473 @c -------------------------
4474 @kindex C-c C-f C-r
4475 @kindex C-c C-f r
4476 @item C-c C-f C-r
4477 @itemx C-c C-f r
4478 Move to @samp{Reply-To:} header field (@code{mh-to-field}).
4479 @c -------------------------
4480 @kindex C-c C-f C-s
4481 @kindex C-c C-f s
4482 @item C-c C-f C-s
4483 @itemx C-c C-f s
4484 Move to @samp{Subject:} header field (@code{mh-to-field}).
4485 @c -------------------------
4486 @kindex C-c C-f C-t
4487 @kindex C-c C-f t
4488 @item C-c C-f C-t
4489 @itemx C-c C-f t
4490 Move to @samp{To:} header field (@code{mh-to-field}).
4491 @c -------------------------
4492 @cindex @samp{Letter > Insert a Message...} menu item
4493 @cindex menu item, @samp{Letter > Insert a Message...}
4494 @kindex C-c C-i
4495 @findex mh-insert-letter
4496 @item C-c C-i
4497 Insert a message (@code{mh-insert-letter}).
4498 @c -------------------------
4499 @kindex C-c C-m C-e
4500 @findex mh-mml-secure-message-encrypt
4501 @item C-c C-m C-e
4502 Add tag to encrypt the message (@code{mh-mml-secure-message-encrypt}).
4503 @c -------------------------
4504 @cindex @samp{Letter > Compose Forward...} menu item
4505 @cindex menu item, @samp{Letter > Compose Forward...}
4506 @kindex C-c C-m C-f
4507 @kindex C-c C-m f
4508 @findex mh-compose-forward
4509 @item C-c C-m C-f
4510 @itemx C-c C-m f
4511 Add tag to forward a message (@code{mh-compose-forward}).
4512 @c -------------------------
4513 @cindex @samp{Letter > Compose Get File (MH)...} menu item
4514 @cindex menu item, @samp{Letter > Compose Get File (MH)...}
4515 @kindex C-c C-m C-g
4516 @kindex C-c C-m g
4517 @findex mh-mh-compose-anon-ftp
4518 @item C-c C-m C-g
4519 @itemx C-c C-m g
4520 Add tag to include anonymous ftp reference to a file
4521 (@code{mh-mh-compose-anon-ftp}).
4522 @c -------------------------
4523 @cindex @samp{Letter > Compose Insertion...} menu item
4524 @cindex menu item, @samp{Letter > Compose Insertion...}
4525 @kindex C-c C-m C-i
4526 @kindex C-c C-m i
4527 @findex mh-compose-insertion
4528 @item C-c C-m C-i
4529 @itemx C-c C-m i
4530 Add tag to include a file such as an image or sound
4531 (@code{mh-compose-insertion}).
4532 @c -------------------------
4533 @cindex @samp{Letter > Pull in All Compositions (MML)} menu item
4534 @cindex menu item, @samp{Letter > Pull in All Compositions (MML)}
4535 @kindex C-c C-m C-m
4536 @kindex C-c C-m m
4537 @findex mh-mml-to-mime
4538 @item C-c C-m C-m
4539 @itemx C-c C-m m
4540 Compose @sc{mime} message from MML tags (@code{mh-mml-to-mime}).
4541 @c -------------------------
4542 @kindex C-c C-m C-n
4543 @kindex C-c C-m n
4544 @findex mh-mml-unsecure-message
4545 @item C-c C-m C-n
4546 @itemx C-c C-m n
4547 Remove any secure message tags (@code{mh-mml-unsecure-message}).
4548 @c -------------------------
4549 @kindex C-c C-m C-s
4550 @findex mh-mml-secure-message-sign
4551 @item C-c C-m C-s
4552 Add tag to sign the message (@code{mh-mml-secure-message-sign}).
4553 @c -------------------------
4554 @cindex @samp{Letter > Compose Compressed tar (MH)...} menu item
4555 @cindex menu item, @samp{Letter > Compose Compressed tar (MH)...}
4556 @kindex C-c C-m C-t
4557 @kindex C-c C-m t
4558 @findex mh-mh-compose-external-compressed-tar
4559 @item C-c C-m C-t
4560 @itemx C-c C-m t
4561 Add tag to include anonymous ftp reference to a compressed tar file
4562 (@code{mh-mh-compose-external-compressed-tar}).
4563 @c -------------------------
4564 @cindex @samp{Letter > Revert to Non-MIME Edit (MH)} menu item
4565 @cindex menu item, @samp{Letter > Revert to Non-MIME Edit (MH)}
4566 @kindex C-c C-m C-u
4567 @kindex C-c C-m u
4568 @findex mh-mh-to-mime-undo
4569 @item C-c C-m C-u
4570 @itemx C-c C-m u
4571 Undo effects of @kbd{C-c C-e} (@code{mh-mh-to-mime-undo}).
4572 @c -------------------------
4573 @kindex C-c C-m C-x
4574 @kindex C-c C-m x
4575 @findex mh-mh-compose-external-type
4576 @item C-c C-m C-x
4577 @itemx C-c C-m x
4578 Add tag to refer to a remote file
4579 (@code{mh-mh-compose-external-type}).
4580 @c -------------------------
4581 @kindex C-c C-m e e
4582 @findex mh-mml-secure-message-encrypt
4583 @item C-c C-m e e
4584 Add tag to encrypt the message (@code{mh-mml-secure-message-encrypt}).
4585 @c -------------------------
4586 @kindex C-c C-m e s
4587 @findex mh-mml-secure-message-signencrypt
4588 @item C-c C-m e s
4589 Add tag to encrypt and sign the message@*
4590 (@code{mh-mml-secure-message-signencrypt}).
4591 @c -------------------------
4592 @kindex C-c C-m s e
4593 @findex mh-mml-secure-message-signencrypt
4594 @item C-c C-m s e
4595 Add tag to encrypt and sign the message@*
4596 (@code{mh-mml-secure-message-signencrypt}).
4597 @c -------------------------
4598 @kindex C-c C-m s s
4599 @findex mh-mml-secure-message-sign
4600 @item C-c C-m s s
4601 Add tag to sign the message (@code{mh-mml-secure-message-sign}).
4602 @c -------------------------
4603 @cindex @samp{Letter > Split Current Line} menu item
4604 @cindex menu item, @samp{Letter > Split Current Line}
4605 @kindex C-c C-o
4606 @findex mh-open-line
4607 @item C-c C-o
4608 Insert a newline and leave point before it (@code{mh-open-line}).
4609 @c -------------------------
4610 @cindex @samp{Letter > Kill This Draft} menu item
4611 @cindex menu item, @samp{Letter > Kill This Draft}
4612 @kindex C-c C-q
4613 @findex mh-fully-kill-draft
4614 @item C-c C-q
4615 Quit editing and delete draft message (@code{mh-fully-kill-draft}).
4616 @c -------------------------
4617 @cindex @samp{Letter > Insert Signature} menu item
4618 @cindex menu item, @samp{Letter > Insert Signature}
4619 @kindex C-c C-s
4620 @findex mh-insert-signature
4621 @item C-c C-s
4622 Insert signature in message (@code{mh-insert-signature}).
4623 @c -------------------------
4624 @kindex C-c C-t
4625 @findex mh-letter-toggle-header-field-display
4626 @item C-c C-t
4627 Toggle display of header field at point
4628 (@code{mh-letter-toggle-header-field-display}).
4629 @c -------------------------
4630 @cindex @samp{Letter > Check Recipient} menu item
4631 @cindex menu item, @samp{Letter > Check Recipient}
4632 @kindex C-c C-w
4633 @findex mh-check-whom
4634 @item C-c C-w
4635 Verify recipients, showing expansion of any aliases
4636 (@code{mh-check-whom}).
4637 @c -------------------------
4638 @cindex @samp{Letter > Yank Current Message} menu item
4639 @cindex menu item, @samp{Letter > Yank Current Message}
4640 @kindex C-c C-y
4641 @findex mh-yank-cur-msg
4642 @item C-c C-y
4643 Insert the current message into the draft buffer
4644 (@code{mh-yank-cur-msg}).
4645 @c -------------------------
4646 @kindex C-c M-d
4647 @findex mh-insert-auto-fields
4648 @item C-c M-d
4649 Insert custom fields if recipient is found in
4650 @code{mh-auto-fields-list} (@code{mh-insert-auto-fields}).
4651 @xref{Identities}.
4652 @end table
4654 @cindex @samp{mh-letter} customization group
4655 @cindex customization group, @samp{mh-letter}
4657 Several options from the @samp{mh-letter} customization group are used
4658 while editing a draft.
4660 @vtable @code
4661 @item mh-compose-insertion
4662 Type of @sc{mime} message tags in messages (default: @samp{MML} if
4663 available; otherwise @samp{MH}).
4664 @c -------------------------
4665 @item mh-compose-skipped-header-fields
4666 List of header fields to skip over when navigating in draft (default:
4667 @code{'("From"} @code{"Organization"} @code{"References"}
4668 @code{"In-Reply-To"} @code{"X-Face"} @code{"Face"}
4669 @code{"X-Image-URL"} @code{"X-Mailer")}.
4670 @c -------------------------
4671 @item mh-compose-space-does-completion-flag
4672 On means @key{SPC} does completion in message header (default:
4673 @samp{off}).
4674 @c -------------------------
4675 @item mh-delete-yanked-msg-window-flag
4676 On means delete any window displaying the message (default: @samp{off}).
4677 @c -------------------------
4678 @item mh-extract-from-attribution-verb
4679 Verb to use for attribution when a message is yanked by @kbd{C-c C-y}
4680 (default: @code{"wrote:"}).
4681 @c -------------------------
4682 @item mh-ins-buf-prefix
4683 String to put before each line of a yanked or inserted message
4684 (default: @code{"> "}).
4685 @c -------------------------
4686 @item mh-letter-complete-function
4687 Function to call when completing outside of address or folder fields
4688 (default: @code{ispell-complete-word}).
4689 @c -------------------------
4690 @item mh-letter-fill-column
4691 Fill column to use in MH-Letter mode (default: 72).
4692 @c -------------------------
4693 @item mh-mml-method-default
4694 Default method to use in security tags (default: @samp{PGP (MIME)} if
4695 support for it is available; otherwise @samp{None}).
4696 @c -------------------------
4697 @item mh-signature-file-name
4698 Source of user's signature (default: @code{"~/.signature"}).
4699 @c -------------------------
4700 @item mh-signature-separator-flag
4701 On means a signature separator should be inserted (default:
4702 @samp{on}).
4703 @c -------------------------
4704 @item mh-x-face-file
4705 File containing X-Face or Face header field to insert in outgoing mail.
4706 (default: @code{"~/.face"}).
4707 @c -------------------------
4708 @item mh-yank-behavior
4709 Controls which part of a message is yanked by @kbd{C-c C-y} (default:
4710 @samp{Body With Attribution}).
4711 @end vtable
4713 The following hooks are available.
4715 @vtable @code
4716 @item mail-citation-hook
4717 Hook for modifying a citation just inserted in the mail buffer
4718 (default: @code{nil}).
4719 @c -------------------------
4720 @item mh-before-send-letter-hook
4721 Hook run at the beginning of the @kbd{C-c C-c} command (default:
4722 @samp{nil}).
4723 @c -------------------------
4724 @item mh-mh-to-mime-hook
4725 Hook run on the formatted letter by @kbd{C-c C-e} (default:
4726 @samp{nil}).
4727 @c -------------------------
4728 @item mh-insert-signature-hook
4729 Hook run by @kbd{C-c C-s} after signature has been inserted (default:
4730 @code{nil}).
4731 @end vtable
4733 The following face is available.
4735 @vtable @code
4736 @item mh-letter-header-field
4737 Editable header field value face in draft buffers.
4738 @end vtable
4740 The commands and options introduced here are explained in more
4741 detail in the following sections.
4743 @menu
4744 * Editing Message::
4745 * Inserting Letter::
4746 * Inserting Messages::
4747 * Signature::
4748 * Picture::
4749 * Adding Attachments::
4750 * Sending PGP::
4751 * Checking Recipients::
4752 * Sending Message::
4753 * Killing Draft::
4754 @end menu
4756 @node Editing Message, Inserting Letter, Editing Drafts, Editing Drafts
4757 @section Editing the Message
4759 @cindex @samp{Bcc} header field
4760 @cindex @samp{Cc} header field
4761 @cindex @samp{Dcc} header field
4762 @cindex @samp{From} header field
4763 @cindex @samp{Mail-Followup-To} header field
4764 @cindex @samp{Mail-Reply-To} header field
4765 @cindex @samp{Reply-To} header field
4766 @cindex @samp{Subject} header field
4767 @cindex @samp{To} header field
4768 @cindex editing header
4769 @cindex header field, @samp{Bcc}
4770 @cindex header field, @samp{Cc}
4771 @cindex header field, @samp{Dcc}
4772 @cindex header field, @samp{From}
4773 @cindex header field, @samp{Mail-Followup-To}
4774 @cindex header field, @samp{Mail-Reply-To}
4775 @cindex header field, @samp{Reply-To}
4776 @cindex header field, @samp{Subject}
4777 @cindex header field, @samp{To}
4778 @findex mh-to-field
4779 @kindex C-c C-f C-t
4780 @kindex C-c C-f t
4782 Because the header is part of the message, you can edit the header
4783 fields as you wish. However, several convenience commands exist to
4784 help you create and edit them. For example, the command @kbd{C-c C-f
4785 C-t} (@code{mh-to-field}; alternatively, @kbd{C-c C-f t}) moves the
4786 cursor to the @samp{To:} header field, creating it if necessary. The
4787 commands for moving to the @samp{Cc:}, @samp{Subject:}, @samp{From:},
4788 @samp{Reply-To:}, @samp{Mail-Reply-To:}, @samp{Mail-Followup-To},
4789 @samp{Bcc:}, and @samp{Dcc:} header fields are similar.
4791 @findex mh-to-fcc
4792 @kindex C-c C-f C-f
4793 @kindex C-c C-f f
4795 One command behaves differently from the others, namely, @kbd{C-c C-f
4796 C-f} (@code{mh-to-fcc}; alternatively, @kbd{C-c C-f f}). This command
4797 will prompt you for the folder name in which to file a copy of the
4798 draft. @xref{Folder Selection}.
4800 @findex indent-relative
4801 @findex mh-letter-next-header-field-or-indent
4802 @findex mh-letter-previous-header-field
4803 @kindex TAB
4804 @kindex S-TAB
4805 @vindex mh-compose-skipped-header-fields
4806 @vindex mh-letter-header-field
4808 Within the header of the message, the command@* @key{TAB}
4809 (@code{mh-letter-next-header-field-or-indent}) moves between fields
4810 that are highlighted with the face @code{mh-letter-header-field},
4811 skipping those fields listed in
4812 @code{mh-compose-skipped-header-fields}. After the last field, this
4813 command then moves point to the message body before cycling back to
4814 the first field. If point is already past the first line of the
4815 message body, then this command indents by calling
4816 @code{indent-relative} with the given prefix argument. The command
4817 @kbd{S-@key{TAB}} (@code{mh-letter-previous-header-field}) moves
4818 backwards between the fields and cycles to the body of the message
4819 after the first field. Unlike the command @key{TAB}, it will always
4820 take point to the last field from anywhere in the body.
4822 @cindex alias completion
4823 @cindex completion
4824 @cindex spell check
4825 @findex ispell-complete-word
4826 @findex mh-letter-complete
4827 @findex mh-letter-complete-or-space
4828 @findex mh-letter-confirm-address
4829 @kindex , @r{(comma)}
4830 @kindex SPC
4831 @kindex M-TAB
4832 @vindex mh-alias-flash-on-comma
4833 @vindex mh-compose-space-does-completion-flag
4834 @vindex mh-letter-complete-function
4836 If the field contains addresses (for example, @samp{To:} or
4837 @samp{Cc:}) or folders (for example, @samp{Fcc:}) then the command
4838 @kbd{M-@key{TAB}} (@code{mh-letter-complete}) will provide alias
4839 completion (@pxref{Aliases}). In the body of the message,
4840 @kbd{M-@key{TAB}} runs @code{mh-letter-complete-function} instead,
4841 which is set to @samp{'ispell-complete-word} by default. The command
4842 @kbd{M-@key{TAB}} (@code{mh-letter-complete}) takes a prefix argument
4843 that is passed to the @code{mh-letter-complete-function}. In addition,
4844 turn on the option @code{mh-compose-space-does-completion-flag} to use
4845 the command @key{SPC} (@code{mh-letter-complete-or-space}) to perform
4846 completion in the header as well; use a prefix argument to specify
4847 more than one space. Addresses are separated by a comma; when you
4848 press the comma, the command @code{mh-letter-confirm-address} flashes
4849 the alias expansion in the minibuffer if
4850 @code{mh-alias-flash-on-comma} is turned on.
4852 @c XXX Document the replacement for the inaccessible 'long argument.
4854 @findex mh-letter-toggle-header-field-display
4855 @kindex C-c C-t
4857 Use the command @kbd{C-c C-t}
4858 @code{mh-letter-toggle-header-field-display} to display truncated
4859 header fields. This command is a toggle so entering it again will hide
4860 the field. This command takes a prefix argument: if negative then the
4861 field is hidden, if positive then the field is displayed (for example,
4862 @kbd{C-u C-c C-t}).
4864 Be sure to leave a row of dashes or a blank line between the header
4865 and the body of the message.
4867 @vindex mh-letter-fill-column
4869 The body of the message is edited as you would edit any Emacs buffer
4870 although there are a few commands and options to assist you. You can
4871 change the fill column in MH-Letter mode with the option
4872 @code{mh-letter-fill-column}. By default, this option is 72 to allow
4873 others to quote your message without line wrapping.
4875 @cindex filling paragraphs
4876 @cindex paragraphs, filling
4877 @findex fill-paragraph
4878 @kindex M-q
4879 @vindex mh-ins-buf-prefix
4881 You'll often include messages that were sent from user agents that
4882 haven't yet realized that paragraphs consist of more than a single
4883 line. This makes for long lines that wrap in an ugly fashion. You'll
4884 find that @kbd{M-q} (@code{fill-paragraph}) works well even on these
4885 quoted messages, even if they are nested, just as long as all of the
4886 quotes match the value of @code{mh-ins-buf-prefix} (@pxref{Inserting
4887 Letter}). For example, let's assume you have the following in your
4888 draft:
4890 @smallexample
4891 @group
4892 > Hopefully this gives you an idea of what I'm currently doing. I'm \
4893 not sure yet whether I'm completely satisfied with my setup, but    \
4894 it's worked okay for me so far.
4895 @end group
4896 @end smallexample
4898 Running @kbd{M-q} on this paragraph produces:
4900 @smallexample
4901 @group
4902 > Hopefully this gives you an idea of what I'm currently doing. I'm not
4903 > sure yet whether I'm completely satisfied with my setup, but it's
4904 > worked okay for me so far.
4905 @end group
4906 @end smallexample
4908 @findex mh-open-line
4909 @findex open-line
4910 @kindex C-c C-o
4911 @kindex C-o
4913 The command @kbd{C-c C-o} (@code{mh-open-line}) is similar to the
4914 command @kbd{C-o} (@code{open-line}) in that it inserts a newline
4915 after point. It differs in that it also inserts the right number of
4916 quoting characters and spaces so that the next line begins in the same
4917 column as it was. This is useful when breaking up paragraphs in
4918 replies. For example, if this command was used when point was after
4919 the first period in the paragraph above, the result would be this:
4921 @smallexample
4922 @group
4923 > Hopefully this gives you an idea of what I'm currently doing.
4925 >                                                               I'm not
4926 > sure yet whether I'm completely satisfied with my setup, but it's
4927 > worked okay for me so far.
4928 @end group
4929 @end smallexample
4931 @node Inserting Letter, Inserting Messages, Editing Message, Editing Drafts
4932 @section Inserting Letter to Which You're Replying
4934 @cindex inserting messages
4935 @cindex replying to messages
4936 @cindex yanking messages
4937 @findex mh-yank-cur-msg
4938 @kindex C-c C-y
4939 @vindex mh-ins-buf-prefix
4941 It is often useful to insert a snippet of text from a letter that
4942 someone mailed to provide some context for your reply. The command
4943 @kbd{C-c C-y} (@code{mh-yank-cur-msg}) does this by adding an
4944 attribution, yanking a portion of text from the message to which
4945 you're replying, and inserting @code{mh-ins-buf-prefix} (@samp{> })
4946 before each line.
4948 @smallexample
4949 @group
4950 Michael W Thelen <thelenm@@stop.mail-abuse.org> wrote:
4952 > Hopefully this gives you an idea of what I'm currently doing. I'm not
4953 > sure yet whether I'm completely satisfied with my setup, but it's
4954 > worked okay for me so far.
4955 @end group
4956 @end smallexample
4958 @vindex mh-extract-from-attribution-verb
4960 The attribution consists of the sender's name and email address
4961 followed by the content of the option
4962 @code{mh-extract-from-attribution-verb}. This option can be set to
4963 @samp{wrote:}, @samp{a Ã©crit:}, and @samp{schrieb:}. You can also use
4964 the @samp{Custom String} menu item to enter your own verb.
4966 @vindex mail-citation-hook
4967 @vindex mh-ins-buf-prefix
4968 @vindex mh-yank-behavior
4970 The prefix @code{"> "} is the default setting for the option
4971 @code{mh-ins-buf-prefix}. I suggest that you not modify this option
4972 since it is used by many mailers and news readers: messages are far
4973 easier to read if several included messages have all been indented by
4974 the same string. This prefix is not inserted if you use one of the
4975 supercite flavors of @code{mh-yank-behavior} or you have added a
4976 @code{mail-citation-hook} as described below.
4978 @vindex mh-delete-yanked-msg-window-flag
4980 You can also turn on the @code{mh-delete-yanked-msg-window-flag}
4981 option to delete the window containing the original message after
4982 yanking it to make more room on your screen for your reply.
4984 @cindex Emacs, packages, @samp{supercite}
4985 @cindex @samp{supercite} package
4986 @kindex r
4987 @vindex mail-citation-hook
4988 @vindex mh-yank-behavior
4990 You can control how the message to which you are replying is yanked
4991 into your reply using @code{mh-yank-behavior}. To include the entire
4992 message, including the entire header, use @samp{Body and
4993 Header}@footnote{If you'd rather have the header cleaned up, use
4994 @kbd{C-u r} instead of @kbd{r} when replying
4995 (@pxref{Replying}).}@footnote{In the past you would use this setting
4996 and set @code{mail-citation-hook} to @samp{supercite}, but this usage
4997 is now deprecated in favor of the @samp{Invoke supercite} setting.}.
4998 Use @samp{Body} to yank just the body without the header. To yank only
4999 the portion of the message following the point, set this option to
5000 @samp{Below Point}.
5002 Choose @samp{Invoke supercite}@footnote{@emph{Supercite} is a
5003 full-bodied, full-featured, citation package that comes standard with
5004 Emacs.} to pass the entire message and header through supercite.
5006 @vindex mh-extract-from-attribution-verb
5008 If the @samp{Body With Attribution} setting is used, then the message
5009 minus the header is yanked and a simple attribution line is added at
5010 the top using the value of the option
5011 @code{mh-extract-from-attribution-verb}. This is the default.
5013 @kindex C-c C-y
5014 @vindex mh-delete-yanked-msg-window-flag
5016 If the @samp{Invoke supercite} or @samp{Body With Attribution}
5017 settings are used, the @samp{-noformat} argument is passed to the
5018 @command{repl} program to override a @samp{-filter} or @samp{-format}
5019 argument. These settings also have @samp{Automatically} variants that
5020 perform the action automatically when you reply so that you don't need
5021 to use @kbd{C-c C-y} at all. Note that this automatic action is only
5022 performed if the show buffer matches the message being replied to.
5023 People who use the automatic variants tend to turn on the option
5024 @code{mh-delete-yanked-msg-window-flag} as well so that the show
5025 window is never displayed.
5027 @vindex mh-yank-behavior
5029 If the show buffer has a region, the option @code{mh-yank-behavior} is
5030 ignored unless its value is one of @samp{Attribution} variants in
5031 which case the attribution is added to the yanked region.
5033 @findex trivial-cite
5034 @vindex mail-citation-hook
5035 @vindex mh-ins-buf-prefix
5036 @vindex mh-yank-behavior
5038 If this isn't enough, you can gain full control over the appearance of
5039 the included text by setting @code{mail-citation-hook} to a function
5040 that modifies it. This hook is ignored if the option
5041 @code{mh-yank-behavior} is set to one of the supercite flavors.
5042 Otherwise, this option controls how much of the message is passed to
5043 the hook. The function can find the citation between point and mark
5044 and it should leave point and mark around the modified citation text
5045 for the next hook function. The standard prefix
5046 @code{mh-ins-buf-prefix} is not added if this hook is set.
5048 @cindex Emacs, packages, @samp{trivial-cite}
5049 @cindex @samp{trivial-cite} package
5050 @vindex mh-yank-behavior
5052 For example, if you use the hook function
5053 @uref{http://www.emacswiki.org/emacs/TrivialCite,
5054 @code{trivial-cite}} (which is NOT part of Emacs), set
5055 @code{mh-yank-behavior} to @samp{Body and Header}.
5057 @node Inserting Messages, Signature, Inserting Letter, Editing Drafts
5058 @section Inserting Messages
5060 @cindex inserting messages
5061 @findex mh-insert-letter
5062 @findex mh-yank-behavior
5063 @kindex C-c C-i
5064 @vindex mh-ins-buf-prefix
5065 @vindex mh-invisible-header-fields-compiled
5066 @vindex mh-yank-behavior
5068 Messages can be inserted with @kbd{C-c C-i} (@code{mh-insert-letter}).
5069 This command prompts you for the folder and message number, which
5070 defaults to the current message in that folder. It then inserts the
5071 messages, indented by @code{mh-ins-buf-prefix} (@samp{> }) unless
5072 @code{mh-yank-behavior} is set to one of the supercite flavors in
5073 which case supercite is used to format the message. Certain
5074 undesirable header fields (see
5075 @code{mh-invisible-header-fields-compiled}) are removed before
5076 insertion.
5078 If given a prefix argument (like @kbd{C-u C-c C-i}), the header is
5079 left intact, the message is not indented, and @samp{> } is not
5080 inserted before each line. This command leaves the mark before the
5081 letter and point after it.
5083 @node Signature, Picture, Inserting Messages, Editing Drafts
5084 @section Inserting Your Signature
5086 @cindex signature
5087 @findex mh-insert-signature
5088 @kindex C-c C-s
5090 You can insert your signature at the current cursor location with the
5091 command @kbd{C-c C-s} (@code{mh-insert-signature}).
5093 @cindex files, @file{.signature}
5094 @cindex @file{.signature}
5095 @cindex vCard
5096 @vindex mh-signature-file-name
5098 By default, the text of your signature is taken from the file
5099 @file{~/.signature}. You can read from other sources by changing the
5100 option @code{mh-signature-file-name}. This file may contain a
5101 @dfn{vCard} in which case an attachment is added with the vCard.
5103 @findex mh-signature-separator-p
5104 @vindex mh-signature-file-name
5105 @vindex mh-signature-separator
5106 @vindex mh-signature-separator-regexp
5108 The option @code{mh-signature-file-name} may also be a symbol, in
5109 which case that function is called. You may not want a signature
5110 separator to be added for you; instead you may want to insert one
5111 yourself. Options that you may find useful to do this include
5112 @code{mh-signature-separator} (when inserting a signature separator)
5113 and @code{mh-signature-separator-regexp} (for finding said separator).
5114 The function @code{mh-signature-separator-p}, which reports @code{t}
5115 if the buffer contains a separator, may be useful as well.
5117 @cindex signature separator
5118 @vindex mh-signature-separator-flag
5120 A signature separator (@code{"-- "}) will be added if the signature
5121 block does not contain one and @code{mh-signature-separator-flag} is
5122 on. It is not recommended that you change this option since various
5123 mail user agents, including MH-E, use the separator to present the
5124 signature differently, and to suppress the signature when replying or
5125 yanking a letter into a draft.
5127 @vindex mh-insert-signature-hook
5128 @vindex mh-signature-file-name
5130 The hook @code{mh-insert-signature-hook} is run after the signature is
5131 inserted. Hook functions may access the actual name of the file or the
5132 function used to insert the signature with
5133 @code{mh-signature-file-name}.
5135 The signature can also be inserted using Identities.
5136 @xref{Identities}.
5138 @node Picture, Adding Attachments, Signature, Editing Drafts
5139 @section Inserting Your Picture
5141 @cindex @file{.face}
5142 @cindex files, @file{.face}
5143 @vindex mh-x-face-file
5145 You can insert your picture in the header of your mail message so that
5146 recipients see your face in the @samp{From:} header field if their
5147 mail user agent is sophisticated enough. In MH-E, this is done by
5148 placing your image in the file named by the option
5149 @code{mh-x-face-file} which is @file{~/.face} by default.
5151 @cindex @samp{Face} header field
5152 @cindex @samp{X-Face} header field
5153 @cindex @samp{X-Image-URL} header field
5154 @cindex header field, @samp{Face}
5155 @cindex header field, @samp{X-Face}
5156 @cindex header field, @samp{X-Image-URL}
5158 If the file starts with either of the strings @samp{X-Face:},
5159 @samp{Face:} or @samp{X-Image-URL:} then the contents are added to the
5160 message header verbatim. Otherwise it is assumed that the file
5161 contains the value of the @samp{X-Face:} header field.
5163 @cindex @command{compface}
5164 @cindex Unix commands, @command{compface}
5166 The @samp{X-Face:} header field, which is a low-resolution, black and
5167 white image, can be generated using the
5168 @uref{ftp://ftp.cs.indiana.edu/pub/faces/compface/compface.tar.Z,
5169 @command{compface}} command. The @uref{http://www.dairiki.org/xface/,
5170 @cite{Online X-Face Converter}} is a useful resource for quick
5171 conversion of images into @samp{X-Face:} header fields.
5173 Use the @uref{http://quimby.gnus.org/circus/face/make-face,
5174 @command{make-face}} script to convert a JPEG image to the higher
5175 resolution, color, @samp{Face:} header field.
5177 The URL of any image can be used for the @samp{X-Image-URL:} field and
5178 no processing of the image is required.
5180 @vindex mh-x-face-file
5182 To prevent the setting of any of these header fields, either set
5183 @code{mh-x-face-file} to @code{nil}, or simply ensure that the file
5184 defined by this option doesn't exist.
5186 @xref{Viewing}, to see how these header fields are displayed in MH-E.
5188 @node Adding Attachments, Sending PGP, Picture, Editing Drafts
5189 @section Adding Attachments
5191 @cindex @command{mhbuild}
5192 @cindex @command{mhn}
5193 @cindex MH commands, @command{mhbuild}
5194 @cindex MH commands, @command{mhn}
5195 @cindex MIME
5196 @cindex multimedia mail
5198 MH-E has the capability to create multimedia messages. It uses the
5199 @sc{mime} (Multipurpose Internet Mail Extensions)
5200 protocol@footnote{@sc{mime} is defined in
5201 @uref{http://www.rfc-editor.org/rfc/rfc2045.txt, RFC 2045}.} The
5202 @sc{mime} protocol allows you to incorporate images, sound, video,
5203 binary files, and even commands that fetch a file with @samp{ftp} when
5204 your recipient reads the message!
5206 @kindex C-c C-m
5208 If you were to create a multimedia message with plain MH commands, you
5209 would insert @command{mhbuild} or @command{mhn} directives (henceforth
5210 called @dfn{MH-style directives} into your draft and use the
5211 @command{mhbuild} command in nmh or @command{mhn} command in MH and
5212 GNU mailutils to expand them. MH-E works in much the same way,
5213 although it provides a handful of commands prefixed with @kbd{C-c C-m}
5214 to insert the directives so you don't need to remember the syntax of
5215 them. Remember: you can always add MH-style directives by
5216 hand@footnote{See the section
5217 @uref{@value{MH-BOOK-HOME}/usimim.html#SeMIMa, Sending MIME Mail} in
5218 the MH book.}.
5220 @cindex MIME Meta Language (MML)
5221 @cindex MML
5222 @vindex mh-compose-insertion
5224 In addition to MH-style directives, MH-E also supports MML (@sc{mime}
5225 Meta Language) tags@footnote{
5226 @ifinfo
5227 @c Although the third argument should default to the
5228 @c first, makeinfo goes to the wrong Info file without it being
5229 @c different--it seems to be getting our own Composing node.
5230 @xref{Composing,,Composing with MML,emacs-mime}.
5231 @end ifinfo
5232 @ifnotinfo
5233 See the section Composing in
5234 @uref{http://www.gnus.org/manual/emacs-mime.html, @cite{The Emacs MIME
5235 Manual}}.
5236 @end ifnotinfo
5237 }. The option @code{mh-compose-insertion} can be used to choose
5238 between them. By default, this option is set to @samp{MML} if it is
5239 supported since it provides a lot more functionality. This option can
5240 also be set to @samp{MH} if MH-style directives are preferred.
5242 @cindex media types
5243 @cindex MIME, media types
5245 The MH-E @sc{mime} commands require a @dfn{media type} for each body
5246 part or attachment. For example, a PDF document is of type
5247 @samp{application/pdf} and an HTML document is of type
5248 @samp{text/html}. Some commands fill in the media type for you,
5249 whereas others require you to enter one.
5251 @cindex @command{file}
5252 @cindex @file{/etc/mime.types}
5253 @cindex files, @file{/etc/mime.types}
5254 @cindex Unix commands, @command{file}
5255 @findex mailcap-mime-types
5257 In the cases where MH-E can do so, it will determine the media type
5258 automatically. It uses the @command{file} command to do this. Failing
5259 that, the Emacs function @code{mailcap-mime-types} is used to provide
5260 a list from which to choose. This function usually reads the file
5261 @file{/etc/mime.types}.
5263 Whether the media type is chosen automatically, or you choose it from
5264 a list, use the type that seems to match best the file that you are
5265 including. In the case of binaries, the media type
5266 @samp{application/x-executable} can be useful. If you can't find an
5267 appropriate media type, use @samp{text/plain} for text messages and
5268 @samp{application/octet-stream} for everything else.
5270 @cindex content description
5271 @cindex MIME, content description
5273 You are also sometimes asked for a @dfn{content description}. This is
5274 simply an optional brief phrase, in your own words, that describes the
5275 object. If you don't care to enter a content description, just press
5276 return and none will be included; however, a reader may skip over
5277 multimedia fields unless the content description is compelling.
5279 You can also create your own @sc{mime} body parts. In the following
5280 example, I describe how you can create and edit a @samp{text/enriched}
5281 body part to liven up your plain text messages with boldface,
5282 underlining, and italics. I include an Emacs function which inserts
5283 enriched text tags.
5285 @smalllisp
5286 @group
5287 (defvar enriched-text-types '(("b" . "bold") ("i" . "italic")
5288                               ("u" . "underline")
5289                               ("s" . "smaller") ("B" . "bigger")
5290                               ("f" . "fixed")
5291                               ("c" . "center"))
5292   "Alist of (final-character . tag) choices for add-enriched-text.
5293 Additional types can be found in RFC 1563.")
5295 (defun add-enriched-text (begin end)
5296   "Add enriched text tags around region.
5297 The tag used comes from the list enriched-text-types and is
5298 specified by the last keystroke of the command.  When called from Lisp,
5299 arguments are BEGIN and END@."
5300   (interactive "r")
5301   ;; @r{Set type to the tag indicated by the last keystroke.}
5302   (let ((type (cdr (assoc (char-to-string (logior last-input-char ?@w{`}))
5303                           enriched-text-types))))
5304     (save-restriction               ; @r{restores state from narrow-to-region}
5305       (narrow-to-region begin end)      ; @r{narrow view to region}
5306       (goto-char (point-min))           ; @r{move to beginning of text}
5307       (insert "<" type ">")             ; @r{insert beginning tag}
5308       (goto-char (point-max))           ; @r{move to end of text}
5309       (insert "</" type ">"))))         ; @r{insert terminating tag}
5310 @i{Emacs function for entering enriched text}
5312 @end group
5313 @end smalllisp
5315 To use the function @code{add-enriched-text}, first add it to
5316 @file{~/.emacs} and create key bindings for it (@pxref{Composing}).
5318 Then, in your plain text message, set the mark with @kbd{C-@@} or
5319 @kbd{C-@key{SPC}}, type in the text to be highlighted, and type @kbd{C-c t
5320 b}. This adds @samp{<bold>} where you set the mark and adds
5321 @samp{</bold>} at the location of your cursor, giving you something
5322 like: @samp{You should be <bold>very</bold>}.
5324 Before sending this message, use @kbd{C-c C-m C-m}
5325 (@code{mh-mml-to-mime})@footnote{Use @kbd{C-c C-e}
5326 (@code{mh-mh-to-mime}) if you're using MH-style directives.} to add
5327 MIME header fields. Then replace @samp{text/plain} with
5328 @samp{text/enriched} in the @samp{Content-Type:} header field.
5330 You may also be interested in investigating @code{sgml-mode}.
5332 @subheading Including Files
5334 @cindex attachments, inserting
5335 @cindex images
5336 @cindex MIME, images
5337 @cindex MIME, sound
5338 @cindex MIME, video
5339 @cindex sound
5340 @cindex video
5341 @findex mh-compose-insertion
5342 @kindex C-c C-m C-i
5343 @kindex C-c C-m i
5344 @vindex mh-compose-insertion
5346 Binaries, images, sound, and video can be inserted in your message
5347 with the command @kbd{C-c C-m C-i} (@code{mh-compose-insertion}). You
5348 are prompted for the filename containing the object, the media type if
5349 it cannot be determined automatically, and a content description. If
5350 you're using MH-style directives, you will also be prompted for
5351 additional attributes.
5353 @subheading Forwarding Multimedia Messages
5355 @findex mh-compose-forward
5356 @kindex C-c C-m C-f
5357 @kindex C-c C-m f
5359 Mail may be forwarded with @sc{mime} using the command @kbd{C-c C-m
5360 C-f} (@code{mh-compose-forward}). You are prompted for a content
5361 description, the name of the folder in which the messages to forward
5362 are located, and a range of messages, which defaults to the current
5363 message in that folder. @xref{Ranges}.
5365 @subheading Including an FTP Reference
5367 @cindex @command{ftp}
5368 @cindex MIME, @command{ftp}
5369 @cindex Unix commands, @command{ftp}
5370 @findex mh-mh-compose-anon-ftp
5371 @kindex C-c C-m C-g
5372 @kindex C-c C-m g
5374 You can have your message initiate an @command{ftp} transfer when the
5375 recipient reads the message. To do this, use the command @kbd{C-c C-m
5376 C-g} (@code{mh-mh-compose-anon-ftp}). You are prompted for the remote
5377 host and filename, the media type, and the content description.
5379 @subheading Including tar Files
5381 @cindex @command{ftp}
5382 @cindex @command{tar}
5383 @cindex MIME, @command{ftp}
5384 @cindex MIME, @command{tar}
5385 @cindex Unix commands, @command{ftp}
5386 @cindex Unix commands, @command{tar}
5387 @findex mh-mh-compose-anon-ftp
5388 @findex mh-mh-compose-external-compressed-tar
5389 @kindex C-c C-m C-g
5390 @kindex C-c C-m C-t
5391 @kindex C-c C-m t
5393 If the remote file is a compressed tar file, you can use @kbd{C-c C-m
5394 C-t} (@code{mh-mh-compose-external-compressed-tar}). Then, in addition
5395 to retrieving the file via anonymous @emph{ftp} as per the command
5396 @kbd{C-c C-m C-g} (@code{mh-mh-compose-anon-ftp}), the file will also
5397 be uncompressed and untarred. You are prompted for the remote host and
5398 filename and the content description.
5400 @subheading Including Other External Files
5402 @findex mh-mh-compose-external-type
5403 @kindex C-c C-m C-x
5404 @kindex C-c C-m x
5406 The command @kbd{C-c C-m C-x} (@code{mh-mh-compose-external-type}) is
5407 a general utility for referencing external files. In fact, all of the
5408 other commands that insert tags to access external files call this
5409 command. You are prompted for the access type, remote host and
5410 filename, and content type. If you provide a prefix argument, you are
5411 also prompted for a content description, attributes, parameters, and a
5412 comment.
5414 @subheading Previewing Multimedia Messages
5416 When you are finished editing a @sc{mime} message, it might look like this:
5418 @cartouche
5419 @smallexample
5420 3 t08/24  root               received fax files on Wed Aug 24 11:00:
5421 4+t08/24  To:wohler          Test<<This is a test message to get the
5427 --:%%  @{+inbox@} 4 msgs (1-4)   Bot L4     (MH-Folder Show)---------------
5428 To: wohler
5430 Subject: Test of MIME
5431 --------
5432 Here is the SETI@@Home logo:
5434 <#part type="image/x-xpm" filename="~/lib/images/setiathome.xpm"
5435 disposition=inline description="SETI@@home logo">
5436 <#/part>
5437 --:**  @{draft@}   All L8     (MH-Letter)----------------------------------
5439 @end smallexample
5440 @end cartouche
5441 @i{MH-E @sc{mime} draft}
5443 @findex mh-mml-to-mime
5444 @kindex C-c C-m C-m
5445 @kindex C-c C-m m
5447 Typically, you send a message with attachments just like any other
5448 message (@pxref{Sending Message}).
5450 @findex mh-mml-to-mime
5451 @kindex C-c C-m C-m
5453 However, you may take a sneak preview of the @sc{mime} encoding if you
5454 wish by running the command @kbd{C-c C-m C-m} (@code{mh-mml-to-mime}).
5455 The following screen shows the @sc{mime} encoding specified by the
5456 tags. You can see why mail user agents are usually built to hide these
5457 details from the user.
5459 @cartouche
5460 @smallexample
5461 To: wohler
5463 Subject: Test of MIME
5464 X-Mailer: MH-E 8.1; nmh 1.1; GNU Emacs 23.1
5465 MIME-Version: 1.0
5466 Content-Type: multipart/mixed; boundary="=-=-="
5467 --------
5468 --=-=-=
5470 Here is the SETI@@Home logo:
5473 --=-=-=
5474 Content-Type: image/x-xpm
5475 Content-Disposition: inline; filename=setiathome.xpm
5476 Content-Transfer-Encoding: base64
5477 Content-Description: SETI@@home logo
5479 LyogWFBNICovCnN0YXRpYyBjaGFyICogc2V0aWF0aG9tZV94cG1bXSA9IHsKIjQ1IDQ1IDc2N
5480 --:--  @{draft@}   Top L1     (MH-Letter)----------------------------------
5482 @end smallexample
5483 @end cartouche
5484 @i{MH-E @sc{mime} draft ready to send}
5486 @cindex undo effects of @code{mh-mml-to-mime}
5488 This action can be undone by running @kbd{C-_} (@code{undo}).
5490 @cindex @command{mhbuild}
5491 @cindex @command{mhn}
5492 @cindex MH commands, @command{mhbuild}
5493 @cindex MH commands, @command{mhn}
5494 @cindex undo effects of @code{mh-mh-to-mime}
5495 @findex mh-mh-to-mime
5496 @findex mh-mh-to-mime-undo
5497 @kindex C-c C-e
5498 @kindex C-c C-m C-m
5499 @kindex C-c C-m C-u
5500 @kindex C-c C-m u
5502 If you're using MH-style directives, use @kbd{C-c C-e}
5503 (@code{mh-mh-to-mime}) instead of @kbd{C-c C-m C-m}. This runs the
5504 command @command{mhbuild} (@command{mhn}) on the message which expands
5505 the tags@footnote{See the section
5506 @uref{@value{MH-BOOK-HOME}/usimim.html#SeMIMa, Sending MIME Mail} in
5507 the MH book.}. This action can be undone by running @kbd{C-c C-m C-u}
5508 (@code{mh-mh-to-mime-undo}), which works by reverting to a backup
5509 file. You are prompted to confirm this action, but you can avoid the
5510 confirmation by adding an argument (for example, @kbd{C-u C-c C-m
5511 C-u}).
5513 @kindex C-c C-e
5514 @vindex mh-mh-to-mime-args
5516 If you wish to pass additional arguments to @command{mhbuild}
5517 (@command{mhn}) to affect how it builds your message, use the option
5518 @code{mh-mh-to-mime-args}. For example, you can build a consistency
5519 check into the message by setting @code{mh-mh-to-mime-args} to
5520 @samp{-check}. The recipient of your message can then run
5521 @samp{mhbuild -check} on the message---@command{mhbuild}
5522 (@command{mhn}) will complain if the message has been corrupted on the
5523 way. The command @kbd{C-c C-e} only consults this option when given a
5524 prefix argument (as in @kbd{C-u C-c C-e}).
5526 @kindex C-c C-e
5527 @vindex mh-mh-to-mime-hook
5529 The hook @code{mh-mh-to-mime-hook} is called after the message has
5530 been formatted by @kbd{C-c C-e}.
5532 @node Sending PGP, Checking Recipients, Adding Attachments, Editing Drafts
5533 @section Signing and Encrypting Messages
5535 @cindex signing messages
5536 @cindex encrypting messages
5537 @cindex RFC 3156
5539 MH-E can sign and encrypt messages as defined in
5540 @uref{http://www.rfc-editor.org/rfc/rfc3156.txt, RFC 3156}. If you
5541 should choose to sign or encrypt your message, use one of the
5542 following commands to do so any time before sending your message.
5544 @findex mh-mml-secure-message-encrypt
5545 @findex mh-mml-secure-message-sign
5546 @findex mh-mml-secure-message-signencrypt
5547 @kindex C-c C-m C-e
5548 @kindex C-c C-m C-s
5549 @kindex C-c C-m e e
5550 @kindex C-c C-m e s
5551 @kindex C-c C-m s e
5552 @kindex C-c C-m s s
5554 The command @kbd{C-c C-m C-s} (@code{mh-mml-secure-message-sign})
5555 inserts the following tag:
5557 @smallexample
5558 <#secure method=pgpmime mode=sign>
5559 @end smallexample
5561 This is used to sign your message digitally. Likewise, the command
5562 @kbd{C-c C-m C-e} (@code{mh-mml-secure-message-encrypt}) inserts the
5563 following tag:
5565 @smallexample
5566 <#secure method=pgpmime mode=encrypt>
5567 @end smallexample
5569 This is used to encrypt your message. Finally, the command @kbd{C-c
5570 C-m s e} (@code{mh-mml-secure-message-signencrypt}) inserts the
5571 following tag:
5573 @smallexample
5574 <#secure method=pgpmime mode=signencrypt>
5575 @end smallexample
5577 @findex mh-mml-unsecure-message
5578 @kindex C-c C-m C-n
5579 @kindex C-c C-m n
5580 @vindex mh-mml-method-default
5582 This is used to sign and encrypt your message. In each of these cases,
5583 a proper multipart message is created for you when you send the
5584 message. Use the command @kbd{C-c C-m C-n}
5585 (@code{mh-mml-unsecure-message}) to remove these tags. Use a prefix
5586 argument (as in @kbd{C-u C-c C-m s e}) to be prompted for one of the
5587 possible security methods (see @code{mh-mml-method-default}).
5589 @vindex mh-mml-method-default
5591 The option @code{mh-mml-method-default} is used to select between a
5592 variety of mail security mechanisms. The default is @samp{PGP (MIME)}
5593 if it is supported; otherwise, the default is @samp{None}. Other
5594 mechanisms include vanilla @samp{PGP} and @samp{S/MIME}.
5596 @cindex @samp{pgg} customization group
5597 @cindex PGG
5598 @cindex customization group, @samp{pgg}
5600 The @samp{pgg} customization group may have some settings which may
5601 interest you.
5602 @iftex
5603 See @cite{The PGG Manual}.
5604 @end iftex
5605 @ifinfo
5606 @xref{Top, , The PGG Manual, pgg, The PGG Manual}.
5607 @end ifinfo
5608 @ifhtml
5610 @uref{https://www.gnu.org/software/emacs/manual/pgg.html,
5611 @cite{The PGG Manual}}.
5612 @end ifhtml
5614 @cindex header field, @samp{Fcc}
5615 @cindex @samp{Fcc} header field
5616 @vindex pgg-encrypt-for-me
5618 In particular, I turn on the option @code{pgg-encrypt-for-me} so that
5619 all messages I encrypt are encrypted with my public key as well. If
5620 you keep a copy of all of your outgoing mail with a @samp{Fcc:} header
5621 field, this setting is vital so that you can read the mail you write!
5623 @node Checking Recipients, Sending Message, Sending PGP, Editing Drafts
5624 @section Checking Recipients
5626 @cindex @file{*MH-E Recipients*}
5627 @cindex @command{whom}
5628 @cindex MH commands, @command{whom}
5629 @cindex buffers, @file{*MH-E Recipients*}
5630 @cindex checking recipients
5631 @cindex recipients, checking
5632 @findex mh-check-whom
5633 @kindex C-c C-w
5635 The command @kbd{C-c C-w} (@code{mh-check-whom}) expands aliases so
5636 you can check the actual address(es) in the alias. A new buffer named
5637 @file{*MH-E Recipients*} is created with the output of @command{whom}
5638 (@pxref{Miscellaneous})@footnote{See the section
5639 @uref{@value{MH-BOOK-HOME}/senove.html#WhaPro, What now?---and the
5640 whatnow Program} in the MH book.}.
5642 @node Sending Message, Killing Draft, Checking Recipients, Editing Drafts
5643 @section Sending a Message
5645 @cindex buffers, @file{*MH-E Mail Delivery*}
5646 @cindex @file{*MH-E Mail Delivery*}
5647 @cindex sending mail
5648 @findex mh-send-letter
5649 @kindex C-c C-c
5651 When you are all through editing a message, you send it with the
5652 command @kbd{C-c C-c} (@code{mh-send-letter}). You can give a prefix
5653 argument (as in @kbd{C-u C-c C-c}) to monitor the first stage of the
5654 delivery; this output can be found in a buffer called @file{*MH-E Mail
5655 Delivery*} (@pxref{Miscellaneous}).
5657 @cindex sending mail
5658 @cindex spell check
5659 @findex ispell-message
5660 @kindex C-c C-c
5661 @vindex mh-before-send-letter-hook
5663 The hook @code{mh-before-send-letter-hook} is run at the beginning of
5664 the command @kbd{C-c C-c}. For example, if you want to check your
5665 spelling in your message before sending, add the function
5666 @code{ispell-message}.
5668 @cindex @command{send}
5669 @cindex MH commands, @command{send}
5670 @vindex mh-send-prog
5672 In case the MH @command{send} program@footnote{See the section
5673 @uref{@value{MH-BOOK-HOME}/sensen.html, Sending Some Mail: comp send}
5674 in the MH book.} is installed under a different name, use
5675 @code{mh-send-prog} to tell MH-E the name.
5677 The hook @code{mh-annotate-msg-hook} is run after annotating the
5678 message and scan line (@pxref{Sending Mail}).
5680 @node Killing Draft,  , Sending Message, Editing Drafts
5681 @section Killing the Draft
5683 @cindex killing draft
5684 @findex kill-buffer
5685 @findex mh-fully-kill-draft
5686 @kindex C-c C-q
5687 @kindex C-x k
5689 If for some reason you are not happy with the draft, you can use the
5690 command @kbd{C-c C-q} (@code{mh-fully-kill-draft}) to kill the draft
5691 buffer and delete the draft message. Use the command @kbd{C-x k}
5692 (@code{kill-buffer}) if you don't want to delete the draft message.
5694 @node Aliases, Identities, Editing Drafts, Top
5695 @chapter Aliases
5697 @cindex aliases
5699 MH aliases are used in the same way in MH-E as they are in MH@. Any
5700 alias listed as a recipient will be expanded when the message is sent.
5701 This chapter discusses other things you can do with aliases in MH-E.
5703 @cindex MH-Letter mode
5704 @cindex modes, MH-Letter
5706 The following commands are available in MH-Letter mode with the
5707 exception of @code{mh-alias-reload} which can be called from anywhere.
5709 @table @kbd
5710 @kindex SPC
5711 @findex mh-letter-complete-or-space
5712 @item @key{SPC}
5713 Perform completion or insert space (@code{mh-letter-complete-or-space}).
5714 @c -------------------------
5715 @kindex M-TAB
5716 @findex mh-letter-complete
5717 @item M-@key{TAB}
5718 Perform completion on header field or word preceding point
5719 (@code{mh-letter-complete}).
5720 @c -------------------------
5721 @findex mh-alias-apropos
5722 @item mh-alias-apropos
5723 Show all aliases or addresses that match a regular expression.
5724 @c -------------------------
5725 @findex mh-alias-grab-from-field
5726 @item mh-alias-grab-from-field
5727 Add alias for the sender of the current message
5728 @c -------------------------
5729 @findex mh-alias-reload
5730 @item mh-alias-reload
5731 Reload MH aliases.
5732 @end table
5734 @cindex @samp{mh-alias} customization group
5735 @cindex customization group, @samp{mh-alias}
5737 The @samp{mh-alias} customization group contains options associated
5738 with aliases.
5740 @vtable @code
5741 @item mh-alias-completion-ignore-case-flag
5742 On means don't consider case significant in MH alias completion
5743 (default: @samp{on}).
5744 @c -------------------------
5745 @item mh-alias-expand-aliases-flag
5746 On means to expand aliases entered in the minibuffer (default:
5747 @samp{off}).
5748 @c -------------------------
5749 @item mh-alias-flash-on-comma
5750 Specify whether to flash address or warn on translation (default: @samp{Flash
5751 but Don't Warn If No Alias}).
5752 @c -------------------------
5753 @item mh-alias-insert-file
5754 Filename used to store a new MH-E alias (default: @samp{Use Aliasfile
5755 Profile Component}).
5756 @c -------------------------
5757 @item mh-alias-insertion-location
5758 Specifies where new aliases are entered in alias files (default:
5759 @samp{Alphabetical}).
5760 @c -------------------------
5761 @item mh-alias-local-users
5762 If @samp{on}, local users are added to alias completion (default:
5763 @samp{on}).
5764 @c -------------------------
5765 @item mh-alias-local-users-prefix
5766 String prefixed to the real names of users from the password file
5767 (default: @code{"local."}.
5768 @c -------------------------
5769 @item mh-alias-passwd-gecos-comma-separator-flag
5770 On means the GECOS field in the password file uses a comma separator
5771 (default: @samp{on}).
5772 @end vtable
5774 The following hook is available.
5776 @vtable @code
5777 @item mh-alias-reloaded-hook
5778 Hook run by @code{mh-alias-reload} after loading aliases (default:
5779 @code{nil}).
5780 @end vtable
5782 @subheading Adding Addresses to Draft
5784 You can use aliases when you are adding recipients to a message.
5786 @findex minibuffer-complete
5787 @kindex TAB
5788 @vindex mh-alias-expand-aliases-flag
5789 @vindex mh-compose-prompt-flag
5791 In order to use minibuffer prompting for recipients and the subject
5792 line in the minibuffer, turn on the option
5793 @code{mh-compose-prompt-flag} (@pxref{Composing}), and use the
5794 @key{TAB} (@code{minibuffer-complete}) command to complete aliases
5795 (and optionally local logins) when prompted for the recipients. Turn
5796 on the option @code{mh-alias-expand-aliases-flag} if you want these
5797 aliases to be expanded to their respective addresses in the draft.
5799 @findex mh-letter-complete
5800 @findex mh-letter-complete-or-space
5801 @kindex SPC
5802 @kindex M-TAB
5804 Otherwise, you can complete aliases in the header of the draft with
5805 @kbd{M-@key{TAB}} (@code{mh-letter-complete}) or @key{SPC}
5806 (@code{mh-letter-complete-or-space}).
5808 @vindex mh-alias-completion-ignore-case-flag
5810 As MH ignores case in the aliases, so too does MH-E@. However, you may
5811 turn off the option @code{mh-alias-completion-ignore-case-flag} to
5812 make case significant which can be used to segregate completion of
5813 your aliases. You might use uppercase for mailing lists and lowercase
5814 for people. For example, you might have:
5816 @smallexample
5817 mark.baushke: Mark Baushke <mdb@@stop.mail-abuse.org>
5818 MH-E: MH-E Mailing List <mh-e-devel@@stop.mail-abuse.org>
5819 @end smallexample
5821 When this option is turned off, if you were to type @kbd{M} in the
5822 @samp{To:} field and then @kbd{M-@key{TAB}}, then you'd get the list;
5823 if you started with @kbd{m} and then entered @kbd{M-@key{TAB}}, then
5824 you'd get Mark's address. Note that this option affects completion
5825 only. If you were to enter @kbd{Mark.Baushke}, it would still be
5826 identified with your @samp{mark.baushke} alias.
5828 @findex mh-alias-minibuffer-confirm-address
5829 @findex mh-letter-confirm-address
5830 @vindex mh-alias-flash-on-comma
5831 @vindex mh-compose-prompt-flag
5833 To verify that the alias you've entered is valid, the alias will be
5834 displayed in the minibuffer when you type a comma
5835 (@code{mh-letter-confirm-address} or
5836 @code{mh-alias-minibuffer-confirm-address} if the option
5837 @code{mh-compose-prompt-flag} is turned on). @xref{Composing}. This
5838 behavior can be controlled with the option
5839 @code{mh-alias-flash-on-comma} which provides three choices:
5840 @samp{Flash but Don't Warn If No Alias}, @samp{Flash and Warn If No
5841 Alias}, and @samp{Don't Flash Nor Warn If No Alias}.
5843 For another way to verify the alias expansion, see @ref{Checking
5844 Recipients}.
5846 @subheading Loading Aliases
5848 @cindex @command{ali}
5849 @cindex @file{/etc/nmh/MailAliases}
5850 @cindex @samp{Aliasfile} MH profile component
5851 @cindex MH commands, @command{ali}
5852 @cindex MH profile component, @samp{Aliasfile}
5853 @cindex files, @file{/etc/nmh/MailAliases}
5855 MH-E loads aliases for completion and folder name hints from various
5856 places. It uses the MH command @command{ali}@footnote{See the section
5857 @uref{@value{MH-BOOK-HOME}/mh.html, MH Aliases} in the MH book.} to
5858 read aliases from the files listed in the profile component
5859 @samp{Aliasfile:} as well as system-wide aliases (for example,
5860 @file{/etc/nmh/MailAliases}).
5862 @cindex @file{/etc/passwd}
5863 @cindex files, @file{/etc/passwd}
5865 In addition, aliases are created from @file{/etc/passwd} entries with
5866 a user ID larger than a magical number, typically 200. This can be a
5867 handy tool on a machine where you and co-workers exchange messages.
5868 These aliases have the form @samp{local.@var{first.last}} if a real
5869 name is present in the password file. Otherwise, the alias will have
5870 the form @samp{local.@var{login}}.
5872 @vindex mh-alias-local-users-prefix
5874 The prefix @samp{local.} can be modified via the option
5875 @code{mh-alias-local-users-prefix}. This option can also be set to
5876 @samp{Use Login}.
5878 For example, consider the following password file entry:
5880 @smallexample
5881 psg:x:1000:1000:Peter S Galbraith,,,:/home/psg:/bin/tcsh
5882 @end smallexample
5884 @vindex mh-alias-local-users-prefix
5886 The following settings of option @code{mh-alias-local-users-prefix}
5887 will produce the associated aliases:
5889 @table @code
5890 @item "local."
5891 local.peter.galbraith
5892 @c -------------------------
5893 @item ""
5894 peter.galbraith
5895 @c -------------------------
5896 @item Use Login
5898 @end table
5900 @vindex mh-alias-passwd-gecos-comma-separator-flag
5902 In the example above, commas are used to separate different values
5903 within the so-called GECOS field. This is a fairly common usage.
5904 However, in the rare case that the GECOS field in your password file
5905 is not separated by commas and whose contents may contain commas, you
5906 can turn the option @code{mh-alias-passwd-gecos-comma-separator-flag}
5907 off.
5909 @cindex NIS, obtaining local aliases from
5910 @cindex @samp{ypcat passwd}
5911 @vindex mh-alias-local-users
5913 If you're on a system with thousands of users you don't know, and the
5914 loading of local aliases slows MH-E down noticeably, then the local
5915 alias feature can be disabled by turning off the option
5916 @code{mh-alias-local-users}. This option also takes a string which is
5917 executed to generate the password file. For example, use @samp{ypcat
5918 passwd} to obtain the NIS password file.
5920 @findex mh-alias-reload
5921 @vindex mh-alias-reloaded-hook
5923 Since aliases are updated frequently, MH-E reloads aliases
5924 automatically whenever an alias lookup occurs if an alias source has
5925 changed. However, you can reload your aliases manually by calling the
5926 command @kbd{M-x mh-alias-reload} directly. This command runs
5927 @code{mh-alias-reloaded-hook} after the aliases have been loaded.
5929 @subheading Adding Aliases
5931 In the past, you have manually added aliases to your alias file(s)
5932 listed in your @samp{Aliasfile:} profile component. MH-E provides
5933 other methods for maintaining your alias file(s).
5935 @findex mh-alias-add-alias
5937 You can use the @kbd{M-x mh-alias-add-alias} command which will prompt
5938 you for the alias and address that you would like to add. If the alias
5939 exists already, you will have the choice of inserting the new alias
5940 before or after the old alias. In the former case, this alias will be
5941 used when sending mail to this alias. In the latter case, the alias
5942 serves as an additional folder name hint when filing messages
5943 (@pxref{Folder Selection}).
5945 Earlier, the alias prefix @samp{local} was presented. You can use
5946 other prefixes to organize your aliases or disambiguate entries. You
5947 might use prefixes for locales, jobs, or activities. For example, I
5948 have:
5950 @smallexample
5951 @group
5952 ; Work
5953 attensity.don.mitchell: Don Mitchell <dmitchell@@stop.mail-abuse.com>
5954 isharp.don.mitchell: Don Mitchell <donaldsmitchell@@stop.mail-abuse.com>
5956 ; Sport
5957 diving.ken.mayer: Ken Mayer <kmayer@@stop.mail-abuse.com>
5958 sailing.mike.maloney: Mike Maloney <mmaloney@@stop.mail-abuse.com>
5960 ; Personal
5961 ariane.kolkmann: Ariane Kolkmann <ArianeKolkmann@@stop.mail-abuse.com>
5963 @end group
5964 @end smallexample
5966 Using prefixes instead of postfixes helps you explore aliases during
5967 completion. If you forget the name of an old dive buddy, you can enter
5968 @samp{div} and then @key{SPC} to get a listing of all your dive buddies.
5970 @findex mh-alias-add-address-under-point
5971 @findex mh-alias-grab-from-field
5973 An alias for the sender of the current message is added automatically
5974 by clicking on the @samp{Grab From alias} tool bar button or by running
5975 the @kbd{M-x mh-alias-grab-from-field} command. Aliases for other
5976 recipients of the current message are added by placing your cursor
5977 over the desired recipient and giving the @kbd{M-x
5978 mh-alias-add-address-under-point} command.
5980 @vindex mh-alias-insert-file
5981 @vindex mh-alias-insertion-location
5983 The options @code{mh-alias-insert-file} and
5984 @code{mh-alias-insertion-location} controls how and where these aliases
5985 are inserted.
5987 @vindex mh-alias-insert-file
5989 The default setting of option @code{mh-alias-insert-file} is @samp{Use
5990 Aliasfile Profile Component}. This option can also hold the name of a
5991 file or a list a file names. If this option is set to a list of file
5992 names, or the @samp{Aliasfile:} profile component contains more than
5993 one file name, MH-E will prompt for one of them.
5995 @vindex mh-alias-insertion-location
5997 The option @code{mh-alias-insertion-location} is set to
5998 @samp{Alphabetical} by default. If you organize your alias file in
5999 other ways, then the settings @samp{Top} and @samp{Bottom} might be
6000 more appropriate.
6002 @subheading Querying Aliases
6004 @cindex regular expressions, @code{mh-alias-apropos}
6005 @findex mh-alias-apropos
6007 If you can't quite remember an alias, you can use @kbd{M-x
6008 mh-alias-apropos} to show all aliases or addresses that match a
6009 regular expression
6010 @ifnothtml
6011 (@pxref{Regexps, , Syntax of Regular Expressions, emacs, The
6012 GNU Emacs Manual}).
6013 @end ifnothtml
6014 @ifhtml
6015 (see the section
6016 @uref{https://www.gnu.org/software/emacs/manual/html_node/emacs/Regexps.html,
6017 Syntax of Regular Expressions} in
6018 @cite{The GNU Emacs Manual}).
6019 @end ifhtml
6021 @node Identities, Speedbar, Aliases, Top
6022 @chapter Identities
6024 @cindex identities
6025 @cindex multiple personalities
6027 MH-E supports the concept of multiple personalities or identities.
6028 This means that you can easily have a different header and signature
6029 at home and at work.
6031 @cindex @samp{Identity} menu
6032 @cindex menu, @samp{Identity}
6034 A couple of commands are used to insert identities in MH-Letter mode
6035 which are also found in the @samp{Identity} menu.
6037 @table @kbd
6038 @kindex C-c C-d
6039 @findex mh-insert-identity
6040 @item C-c C-d
6041 Insert fields specified by given identity (@code{mh-insert-identity}).
6042 @c -------------------------
6043 @cindex @samp{Identity > Insert Auto Fields} menu item
6044 @cindex menu item, @samp{Identity > Insert Auto Fields}
6045 @kindex C-c M-d
6046 @findex mh-insert-auto-fields
6047 @item C-c M-d
6048 Insert custom fields if recipient found in @code{mh-auto-fields-list}
6049 (@code{mh-insert-auto-fields}).
6050 @end table
6052 @cindex @samp{mh-identity} customization group
6053 @cindex customization group, @samp{mh-identity}
6055 The @samp{mh-identity} customization group contains the following
6056 options.
6058 @vtable @code
6059 @item mh-auto-fields-list
6060 List of recipients for which header lines are automatically inserted
6061 (default: @code{nil}).
6062 @c -------------------------
6063 @item mh-auto-fields-prompt-flag
6064 On means to prompt before sending if fields inserted (default:
6065 @samp{on})
6066 @c -------------------------
6067 @item mh-identity-default
6068 Default identity to use when @code{mh-letter-mode} is called (default:
6069 @samp{None}).
6070 @c -------------------------
6071 @item mh-identity-handlers
6072 Handler functions for fields in @code{mh-identity-list}.
6073 @c -------------------------
6074 @item mh-identity-list
6075 List of identities (default: @code{nil}).
6076 @end vtable
6078 Some of the common header fields that people change depending on the
6079 context are the @samp{From:} and @samp{Organization:} fields, as well
6080 as the signature.
6082 @vindex mh-identity-list
6084 This is done by customizing the option @code{mh-identity-list}. In the
6085 customization buffer for this option, click on the @samp{INS} button
6086 and enter a label such as @samp{Home} or @samp{Work}. Then click on
6087 the @samp{INS} button with the label @samp{Add at least one item
6088 below}. The @samp{Value Menu} has the following menu items:
6090 @table @samp
6091 @cindex header field, @samp{From}
6092 @cindex @samp{From} header field
6093 @item From Field
6094 Specify an alternate @samp{From:} header field. You must include a
6095 valid email address. A standard format is @samp{First Last
6096 <login@@host.domain>}. If you use an initial with a period, then you
6097 must quote your name as in @samp{"First I. Last"
6098 <login@@host.domain>}.
6099 @c -------------------------
6100 @cindex header field, @samp{Organization}
6101 @cindex @samp{Organization} header field
6102 @item Organization Field
6103 People usually list the name of the company where they work here.
6104 @c -------------------------
6105 @item Other Field
6106 Set any arbitrary header field and value here. Unless the header field
6107 is a standard one, precede the name of your field's label with
6108 @samp{X-}, as in @samp{X-Fruit-of-the-Day:}.
6109 @c -------------------------
6110 @item Attribution Verb
6111 This value overrides the setting of
6112 @code{mh-extract-from-attribution-verb}. @xref{Inserting Letter}.
6113 @c -------------------------
6114 @cindex signature
6115 @vindex mh-signature-file-name
6116 @item Signature
6117 Set your signature with this item. You can specify the contents of
6118 @code{mh-signature-file-name}, a file, or a function.
6119 @xref{Signature}.
6120 @c -------------------------
6121 @item GPG Key ID
6122 Specify a different key to sign or encrypt messages.
6123 @end table
6125 @cindex Identity menu
6126 @cindex menu, Identity
6127 @findex mh-insert-identity
6128 @kindex C-c C-d
6130 You can select the identities you have added via the menu called
6131 @samp{Identity} in the MH-Letter buffer. You can also use @kbd{C-c
6132 C-d} (@code{mh-insert-identity}). To clear the fields and signature
6133 added by the identity, select the @samp{None} identity.
6135 @cindex menu item, @samp{Identity > Customize Identities}
6136 @cindex menu item, @samp{Identity > Save as Default}
6137 @cindex menu item, @samp{Identity > Set Default for Session}
6138 @cindex @samp{Identity > Customize Identities} menu item
6139 @cindex @samp{Identity > Save as Default} menu item
6140 @cindex @samp{Identity > Set Default for Session} menu item
6141 @vindex mh-identity-default
6143 The @samp{Identity} menu contains two other items to save you from
6144 having to set the identity on every message. The menu item @samp{Set
6145 Default for Session} can be used to set the default identity to the
6146 current identity until you exit Emacs. The menu item @samp{Save as
6147 Default} sets the option @code{mh-identity-default} to the current
6148 identity setting. You can also customize the option
6149 @code{mh-identity-default} in the usual fashion. If you find that you
6150 need to add another identity, the menu item @samp{Customize
6151 Identities} is available for your convenience.
6153 @cindex regular expressions, @code{mh-auto-fields-list}
6154 @vindex mh-auto-fields-list
6156 The option @code{mh-auto-fields-list} can also be used to set the
6157 identity depending on the recipient to provide even more control. To
6158 customize @code{mh-auto-fields-list}, click on the @samp{INS} button
6159 and enter a regular expression for the recipient's address
6160 @ifnothtml
6161 (@pxref{Regexps, , Syntax of Regular Expressions, emacs, The
6162 GNU Emacs Manual}).
6163 @end ifnothtml
6164 @ifhtml
6165 (see the section
6166 @uref{https://www.gnu.org/software/emacs/manual/html_node/emacs/Regexps.html,
6167 Syntax of Regular Expressions} in
6168 @cite{The GNU Emacs Manual}).
6169 @end ifhtml
6170 Click on the @samp{INS} button with the @samp{Add at least one item
6171 below} label. The @samp{Value Menu} contains the following menu items:
6173 @table @samp
6174 @item Identity
6175 Select an identity from those configured in @code{mh-identity-list}.
6176 All of the information for that identity will be added if the
6177 recipient matches.
6178 @c -------------------------
6179 @cindex @samp{Fcc} header field
6180 @cindex header field, @samp{Fcc}
6181 @item Fcc Field
6182 Insert an @samp{Fcc:} header field with the folder you provide. When
6183 you send the message, MH will put a copy of your message in this
6184 folder.
6185 @c -------------------------
6186 @cindex @samp{Mail-Followup-To} header field
6187 @cindex header field, @samp{Mail-Followup-To}
6188 @item Mail-Followup-To Field
6189 Insert an @samp{Mail-Followup-To:} header field with the recipients
6190 you provide. If the recipient's mail user agent supports this header
6191 field@footnote{@samp{Mail-Followup-To:} is supported by nmh.}, then
6192 their replies will go to the addresses listed. This is useful if their
6193 replies go both to the list and to you and you don't have a mechanism
6194 to suppress duplicates. If you reply to someone not on the list, you
6195 must either remove the @samp{Mail-Followup-To:} field, or ensure the
6196 recipient is also listed there so that he receives replies to your
6197 reply.
6198 @c -------------------------
6199 @item Other Field
6200 Other header fields may be added using this menu item.
6201 @end table
6203 @findex mh-insert-auto-fields
6204 @kindex C-c M-d
6205 @vindex mh-auto-fields-prompt-flag
6207 These fields can only be added after the recipient is known. Because
6208 you can continue to add recipients as you edit the draft, MH-E waits
6209 until the message is sent to perform the auto-insertions. This seems
6210 strange at first, but you'll get used to it. There are two ways to
6211 help you feel that the desired fields are added. The first is the
6212 action when the message is sent: if any fields are added
6213 automatically, you are given a chance to see and to confirm these
6214 fields before the message is actually sent. You can do away with this
6215 confirmation by turning off the option
6216 @code{mh-auto-fields-prompt-flag}. The second method is manual: once
6217 the header contains one or more recipients, you may run the command
6218 @kbd{C-c M-d} (@code{mh-insert-auto-fields}) or choose the
6219 @samp{Identity -> Insert Auto Fields} menu item to insert these fields
6220 manually. However, if you use this command, the automatic insertion
6221 when the message is sent is disabled.
6223 @vindex mh-auto-fields-list
6224 @vindex mh-identity-list
6226 You should avoid using the same header field in
6227 @code{mh-auto-fields-list} and @code{mh-identity-list} definitions
6228 that may apply to the same message as the result is undefined.
6230 @vindex mh-identity-handlers
6231 @vindex mh-identity-list
6233 The option @code{mh-identity-handlers} is used to change the way that
6234 fields, signatures, and attributions in @code{mh-identity-list} are
6235 added. To customize @code{mh-identity-handlers}, replace the name of
6236 an existing handler function associated with the field you want to
6237 change with the name of a function you have written. You can also
6238 click on an @samp{INS} button and insert a field of your choice and
6239 the name of the function you have written to handle it.
6241 @vindex mh-identity-list
6243 The @samp{Field} field can be any field that you've used in your
6244 @code{mh-identity-list}. The special fields @samp{:attribution-verb},
6245 @samp{:signature}, or @samp{:pgg-default-user-id} are used for the
6246 @code{mh-identity-list} choices @samp{Attribution Verb},
6247 @samp{Signature}, and @samp{GPG Key ID} respectively.
6249 The handler associated with the @samp{:default} field is used when no
6250 other field matches.
6252 The handler functions are passed two or three arguments: the field
6253 itself (for example, @samp{From}), or one of the special fields (for
6254 example, @samp{:signature}), and the action @samp{'remove} or
6255 @samp{'add}. If the action is @samp{'add}, an additional argument
6256 containing the value for the field is given.
6258 @node Speedbar, Menu Bar, Identities, Top
6259 @chapter The Speedbar
6261 @cindex folder navigation
6262 @cindex speedbar
6263 @findex mh-visit-folder
6264 @findex speedbar
6265 @kindex F v
6266 @kindex mouse-2
6268 You can also use the speedbar
6269 @ifnothtml
6270 (@pxref{Speedbar, , Speedbar Frames, emacs, The GNU Emacs Manual},)
6271 @end ifnothtml
6272 @ifhtml
6273 (see the section
6274 @uref{https://www.gnu.org/software/emacs/manual/html_node/emacs/Speedbar.html,
6275 Speedbar Frames} in @cite{The GNU Emacs Manual})
6276 @end ifhtml
6277 to view your folders. To bring up the speedbar, run @kbd{M-x speedbar
6278 @key{RET}}. You will see a new frame appear with all of your MH
6279 folders. Folders with unseen messages appear in boldface. Click on a
6280 folder name with @kbd{mouse-2} to visit that folder in a similar
6281 fashion to the command @kbd{F v} (@code{mh-visit-folder})
6282 (@pxref{Folders}). Click on the @samp{+} icon to expand and view the
6283 sub-folders of that folder.
6285 The speedbar can be manipulated with the keyboard as well. Use the
6286 Emacs navigational keys (like the arrow keys, or @kbd{C-n}) to move
6287 the cursor over the desired folder and then use the shortcuts for the
6288 menu items listed in the table below.
6290 @table @samp
6291 @findex mh-speed-view
6292 @item Visit Folder (@key{RET})
6293 Visits the selected folder just as if you had used @kbd{F v}
6294 (@code{mh-speed-view}).
6295 @c -------------------------
6296 @findex mh-speed-expand-folder
6297 @item Expand Nested Folders (@kbd{+})
6298 Expands the selected folder in the speedbar, exposing the children
6299 folders inside it (@code{mh-speed-expand-folder}).
6300 @c -------------------------
6301 @findex mh-speed-contract-folder
6302 @item Contract Nested Folders (@kbd{-})
6303 Contracts or collapses the selected folder in the speedbar, hiding the
6304 children folders inside it (@code{mh-speed-contract-folder}).
6305 @c -------------------------
6306 @findex mh-speed-refresh
6307 @item Refresh Speedbar (@kbd{r})
6308 Regenerates the list of folders in the speedbar. Run this command if
6309 you've added or deleted a folder, or want to update the unseen message
6310 count before the next automatic update (@code{mh-speed-refresh}).
6311 @end table
6313 @findex delete-frame
6314 @kindex C-x 5 0
6315 @kindex mouse-3
6317 You can click on @kbd{mouse-3} to bring up a context menu that
6318 contains these items. Dismiss the speedbar with @kbd{C-x 5 0}
6319 (@code{delete-frame}).
6321 @cindex @command{flists}
6322 @cindex MH commands, @command{flists}
6323 @cindex @samp{mh-speedbar} customization group
6324 @cindex customization group, @samp{mh-speedbar}
6326 The MH-E speedbar uses the MH command @command{flists}@footnote{See
6327 the section @uref{@value{MH-BOOK-HOME}/morseq.html#flist, Searching for
6328 Sequences with flist} in the MH book.} to generate the list of
6329 folders. The @samp{mh-speedbar} customization group contains the
6330 following option which controls how often the speedbar calls
6331 @command{flists}.
6333 @vtable @code
6334 @item mh-speed-update-interval
6335 Time between speedbar updates in seconds (default: 60). Set to 0 to
6336 disable automatic update.
6337 @end vtable
6339 You can modify the appearance of the folders in the speedbar by
6340 customizing the following faces.
6342 @vtable @code
6343 @item mh-speedbar-folder
6344 Basic folder face.
6345 @c -------------------------
6346 @item mh-speedbar-folder-with-unseen-messages
6347 Folder face when folder contains unread messages.
6348 @c -------------------------
6349 @item mh-speedbar-selected-folder
6350 Selected folder face.
6351 @c -------------------------
6352 @item mh-speedbar-selected-folder-with-unseen-messages
6353 Selected folder face when folder contains unread messages.
6354 @end vtable
6356 @node Menu Bar, Tool Bar, Speedbar, Top
6357 @chapter The Menu Bar
6359 @cindex @samp{Folder} menu
6360 @cindex @samp{Identity} menu
6361 @cindex @samp{Letter} menu
6362 @cindex @samp{Message} menu
6363 @cindex @samp{Search} menu
6364 @cindex @samp{Sequence} menu
6365 @cindex Folder menu
6366 @cindex Identity menu
6367 @cindex Letter menu
6368 @cindex MH-Folder mode
6369 @cindex MH-Letter mode
6370 @cindex MH-Search mode
6371 @cindex Message menu
6372 @cindex Search menu
6373 @cindex Sequence menu
6374 @cindex menu bar
6375 @cindex menu, Folder
6376 @cindex menu, Identity
6377 @cindex menu, Letter
6378 @cindex menu, Message
6379 @cindex menu, Search
6380 @cindex menu, Sequence
6381 @cindex menu, @samp{Folder}
6382 @cindex menu, @samp{Identity}
6383 @cindex menu, @samp{Letter}
6384 @cindex menu, @samp{Message}
6385 @cindex menu, @samp{Search}
6386 @cindex menu, @samp{Sequence}
6387 @cindex modes, MH-Folder
6388 @cindex modes, MH-Letter
6389 @cindex modes, MH-Search
6391 For those of you who prefer to mouse and menu instead of using the
6392 meta-coke-bottle-bucky keys, MH-E provides menu items for most of its
6393 functions. The MH-Folder buffer adds the @samp{Folder},
6394 @samp{Message}, and @samp{Sequence} menus. The MH-Letter buffer adds
6395 the @samp{Identity} and @samp{Letter} menus. The MH-Search buffer adds
6396 the @samp{Search} menu. There's no need to list the actual items here,
6397 as you can more easily see them for yourself, and the functions are
6398 already described elsewhere in this manual.
6400 For a description of the menu bar, please
6401 @ifnothtml
6402 @xref{Menu Bar, , The Menu Bar, emacs, The GNU Emacs Manual}.
6403 @end ifnothtml
6404 @ifhtml
6405 see the section
6406 @uref{https://www.gnu.org/software/emacs/manual/html_node/emacs/Menu-Bar.html,
6407 The Menu Bar} in @cite{The GNU Emacs Manual}.
6408 @end ifhtml
6410 The Emacs manual describes how to get help for a particular
6411 menu item. You can also look up a menu item in the index of this
6412 manual in two ways: all of the menu items are listed alphabetically,
6413 and you can also browse all of the items under the index entry
6414 @samp{menu item}.
6416 @node Tool Bar, Searching, Menu Bar, Top
6417 @chapter The Tool Bar
6419 @cindex tool bar
6421 Emacs also provides a graphical tool bar. For a description of the
6422 tool bar, please
6423 @ifnothtml
6424 @xref{Tool Bars, , Tool Bars, emacs, The GNU Emacs Manual}.
6425 @end ifnothtml
6426 @ifhtml
6427 see the section
6428 @uref{https://www.gnu.org/software/emacs/manual/html_node/emacs/Tool-Bars.html,
6429 Tool Bars} in @cite{The GNU Emacs Manual}.
6430 @end ifhtml
6432 @cindex @samp{mh-tool-bar} customization group
6433 @cindex customization group, @samp{mh-tool-bar}
6435 MH-E adds several icons to this tool bar; you can modify the MH-E
6436 aspects of the tool bar via the @samp{mh-tool-bar} customization group.
6438 @vtable @code
6439 @item mh-tool-bar-folder-buttons
6440 List of buttons to include in MH-Folder tool bar (default: a checklist
6441 too long to list here).
6442 @c -------------------------
6443 @item mh-tool-bar-letter-buttons
6444 List of buttons to include in MH-Letter tool bar (default: a checklist
6445 too long to list here).
6446 @c -------------------------
6447 @item mh-tool-bar-search-function
6448 Function called by the tool bar search button (default:
6449 @code{mh-search}).
6450 @c -------------------------
6451 @item mh-xemacs-tool-bar-position
6452 Tool bar location (default: @samp{Same As Default Tool Bar}).
6453 @c -------------------------
6454 @item mh-xemacs-use-tool-bar-flag
6455 If @samp{on}, use tool bar (default: @samp{on}, if supported).
6456 @end vtable
6458 In GNU Emacs, icons for some of MH-E's functions are added to the tool
6459 bar. In XEmacs, you have the opportunity to create a separate tool bar for
6460 the MH-E icons.
6462 @vindex mh-tool-bar-folder-buttons
6463 @vindex mh-tool-bar-letter-buttons
6465 In either case, you can select which of these functions you'd like to
6466 see by customizing the options @code{mh-tool-bar-folder-buttons} and
6467 @code{mh-tool-bar-letter-buttons}. As you probably guessed, the former
6468 customizes the tool bar in MH-Folder mode and the latter in MH-Letter
6469 mode. Both of these options present you with a list of functions;
6470 check the functions whose icons you want to see and clear the check
6471 boxes for those you don't.
6473 @findex mh-search
6474 @vindex mh-tool-bar-search-function
6476 The function associated with the searching icon can be set via the
6477 option @code{mh-tool-bar-search-function}. By default, this is set to
6478 @code{mh-search}. @xref{Searching}. You can also choose @samp{Other
6479 Function} from the @samp{Value Menu} and enter a function of your own
6480 choosing.
6482 @vindex mh-xemacs-use-tool-bar-flag
6484 XEmacs provides a couple of extra options. The first,
6485 @code{mh-xemacs-use-tool-bar-flag}, controls whether to show the MH-E
6486 icons at all. By default, this option is turned on if the window
6487 system supports tool bars. If your system doesn't support tool bars,
6488 then you won't be able to turn on this option.
6490 @vindex mh-xemacs-tool-bar-position
6492 The second extra option is @code{mh-xemacs-tool-bar-position} which
6493 controls the placement of the tool bar along the four edges of the
6494 frame. You can choose from one of @samp{Same As Default Tool Bar},
6495 @samp{Top}, @samp{Bottom}, @samp{Left}, or @samp{Right}. If this
6496 variable is set to anything other than @samp{Same As Default Tool Bar}
6497 and the default tool bar is in a different location, then two tool
6498 bars will be displayed: the MH-E tool bar and the default tool bar.
6500 @node Searching, Threading, Tool Bar, Top
6501 @chapter Searching Through Messages
6503 @cindex @samp{Search} menu
6504 @cindex menu, @samp{Search}
6505 @cindex searching
6506 @findex mh-search
6507 @kindex F s
6509 Earlier, the command @kbd{F s} (@code{mh-search}) was introduced which
6510 helps you find messages that lie buried in your folders
6511 (@pxref{Folders}). This chapter covers this command in more detail.
6512 Several commands are used to compose the search criteria and to start
6513 searching. A couple of them can be found in the @samp{Search} menu.
6515 @table @kbd
6516 @kindex C-c ?
6517 @findex mh-help
6518 @item C-c ?
6519 Display cheat sheet for the MH-E commands (@code{mh-help}).
6520 @c -------------------------
6521 @cindex @samp{Search > Perform Search} menu item
6522 @cindex menu item, @samp{Search > Perform Search}
6523 @kindex C-c C-c
6524 @findex mh-index-do-search
6525 @item C-c C-c
6526 Find messages using @code{mh-search-program}
6527 (@code{mh-index-do-search}).
6528 @c -------------------------
6529 @cindex @samp{Search > Search with pick} menu item
6530 @cindex menu item, @samp{Search > Search with pick}
6531 @kindex C-c C-p
6532 @findex mh-pick-do-search
6533 @item C-c C-p
6534 Find messages using @command{pick} (@code{mh-pick-do-search}).
6535 @c -------------------------
6536 @kindex C-c ?
6537 @findex mh-help
6538 @item C-c ?
6539 Display cheat sheet for the MH-E commands (@code{mh-help}).
6540 @c -------------------------
6541 @kindex C-c C-f C-a
6542 @kindex C-c C-f a
6543 @findex mh-to-field
6544 @item C-c C-f a
6545 @itemx C-c C-f C-a
6546 Move to @samp{Mail-Reply-To:} header field (@code{mh-to-field}).
6547 @c -------------------------
6548 @kindex C-c C-f C-b
6549 @kindex C-c C-f b
6550 @item C-c C-f b
6551 @itemx C-c C-f C-b
6552 Move to @samp{Bcc:} header field (@code{mh-to-field}).
6553 @c -------------------------
6554 @kindex C-c C-f C-c
6555 @kindex C-c C-f c
6556 @item C-c C-f c
6557 @itemx C-c C-f C-c
6558 Move to @samp{Cc:} header field (@code{mh-to-field}).
6559 @c -------------------------
6560 @kindex C-c C-f C-d
6561 @kindex C-c C-f d
6562 @item C-c C-f d
6563 @itemx C-c C-f C-d
6564 Move to @samp{Dcc:} header field (@code{mh-to-field}).
6565 @c -------------------------
6566 @kindex C-c C-f C-f
6567 @kindex C-c C-f f
6568 @item C-c C-f f
6569 @itemx C-c C-f C-f
6570 Move to @samp{Fcc:} header field (@code{mh-to-field}).
6571 @c -------------------------
6572 @kindex C-c C-f C-l
6573 @kindex C-c C-f l
6574 @item C-c C-f l
6575 @itemx C-c C-f C-l
6576 Move to @samp{Mail-Followup-To:} header field (@code{mh-to-field}).
6577 @c -------------------------
6578 @kindex C-c C-f C-m
6579 @kindex C-c C-f m
6580 @item C-c C-f m
6581 @itemx C-c C-f C-m
6582 Move to @samp{From:} header field (@code{mh-to-field}).
6583 @c -------------------------
6584 @kindex C-c C-f C-r
6585 @kindex C-c C-f r
6586 @item C-c C-f r
6587 @itemx C-c C-f C-r
6588 Move to @samp{Reply-To:} header field (@code{mh-to-field}).
6589 @c -------------------------
6590 @kindex C-c C-f C-s
6591 @kindex C-c C-f s
6592 @item C-c C-f s
6593 @itemx C-c C-f C-s
6594 Move to @samp{Subject:} header field (@code{mh-to-field}).
6595 @c -------------------------
6596 @kindex C-c C-f C-t
6597 @kindex C-c C-f t
6598 @item C-c C-f t
6599 @itemx C-c C-f C-t
6600 Move to @samp{To:} header field (@code{mh-to-field}).
6601 @end table
6603 Another few commands are available in the MH-Folder buffer resulting
6604 from a search.
6606 @table @kbd
6607 @kindex TAB
6608 @findex mh-index-next-folder
6609 @item @key{TAB}
6610 Jump to the next folder marker (@code{mh-index-next-folder}).
6611 @c -------------------------
6612 @kindex S-TAB
6613 @findex mh-index-previous-folder
6614 @item S-@key{TAB}
6615 Jump to the previous folder marker (@code{mh-index-previous-folder}).
6616 @c -------------------------
6617 @kindex v
6618 @findex mh-index-visit-folder
6619 @item v
6620 Visit original folder from where the message at point was found
6621 (@code{mh-index-visit-folder}).
6622 @end table
6624 @cindex @samp{mh-search} customization group
6625 @cindex customization group, @samp{mh-search}
6627 There is one option from the @samp{mh-search} customization group used
6628 in searching.
6630 @vtable @code
6631 @item mh-search-program
6632 Search program that MH-E shall use (default: @samp{Auto-detect}).
6633 @end vtable
6635 The following hook is available.
6637 @vtable @code
6638 @item mh-search-mode-hook
6639 Hook run upon entry to @code{mh-search-mode} (default: @code{nil}).
6640 @end vtable
6642 The following face is available.
6644 @vtable @code
6645 @item mh-search-folder
6646 Folder heading face in MH-Folder buffers created by searches.
6647 @end vtable
6649 @findex mh-search-folder
6650 @kindex F s
6652 The command @kbd{F s} (@code{mh-search-folder}) helps you find
6653 messages in your entire corpus of mail. You can search for messages to
6654 or from a particular person or about a particular subject. In fact,
6655 you can also search for messages containing selected strings in any
6656 arbitrary header field or any string found within the messages.
6658 @cindex @command{pick}
6659 @cindex MH commands, @command{pick}
6661 Out of the box, MH-E uses @command{pick} to find messages. With a
6662 little extra effort, you can set an indexing program which rewards you
6663 with extremely quick results. The drawback is that sometimes the index
6664 does not contain the words you're looking for. You can still use
6665 @command{pick} in these situations.
6667 You are prompted for the folder to search. This can be @samp{all} to
6668 search all folders. Note that the search works recursively on the
6669 listed folder.
6671 @cindex MH-Search mode
6672 @cindex modes, MH-Search
6674 Next, an MH-Search buffer appears where you can enter search criteria.
6676 @cartouche
6677 @smallexample
6678 From:
6681 Date:
6682 Subject:
6683 --------
6693 --:**  search-pattern   All L7     (MH-Search)---------------------------
6694 Type C-c C-c to search messages, C-c C-p to use pick, C-c ? for help
6695 @end smallexample
6696 @end cartouche
6697 @i{Search window}
6699 @cindex @command{pick}
6700 @cindex MH commands, @command{pick}
6702 Edit this template by entering your search criteria in an appropriate
6703 header field that is already there, or create a new field yourself. If
6704 the string you're looking for could be anywhere in a message, then
6705 place the string underneath the row of dashes.
6707 As an example, let's say that we want to find messages from Ginnean
6708 about horseback riding in the Kosciusko National Park (Australia)
6709 during January, 1994. Normally we would start with a broad search and
6710 narrow it down if necessary to produce a manageable amount of data,
6711 but we'll cut to the chase and create a fairly restrictive set of
6712 criteria as follows:
6714 @smallexample
6715 @group
6716 From: ginnean
6719 Date: Jan 1994
6720 Subject:
6721 --------
6722 horse
6723 kosciusko
6724 @end group
6725 @end smallexample
6727 @findex mh-to-field
6728 @kindex C-c C-f C-t
6730 As with MH-Letter mode, MH-Search provides commands like @kbd{C-c C-f
6731 C-t} (@code{mh-to-field}) to help you fill in the blanks.
6732 @xref{Editing Message}.
6734 @kindex F s
6735 @vindex mh-search-mode-hook
6737 If you find that you do the same thing over and over when editing the
6738 search template, you may wish to bind some shortcuts to keys. This can
6739 be done with the variable @code{mh-search-mode-hook}, which is called
6740 when @kbd{F s} is run on a new pattern.
6742 @findex mh-index-do-search
6743 @findex mh-pick-do-search
6744 @kindex C-c C-c
6745 @kindex C-c C-p
6747 To perform the search, type @kbd{C-c C-c} (@code{mh-index-do-search}).
6748 Sometimes you're searching for text that is either not indexed, or
6749 hasn't been indexed yet. In this case you can override the default
6750 method with the pick method by running the command @kbd{C-c C-p}
6751 (@code{mh-pick-do-search}).
6753 @cindex folders, @samp{+mhe-index}
6754 @cindex @samp{+mhe-index}
6755 @findex mh-index-next-folder
6756 @findex mh-index-previous-folder
6757 @kindex TAB
6758 @kindex S-TAB
6759 @vindex mh-search-folder
6761 The messages that are found are put in a temporary sub-folder of
6762 @samp{+mhe-index} and are displayed in an MH-Folder buffer. This
6763 buffer is special because it displays messages from multiple folders;
6764 each set of messages from a given folder has a heading with the folder
6765 name. The appearance of the heading can be modified by customizing the
6766 face @code{mh-search-folder}. You can jump back and forth between the
6767 headings using the commands @kbd{@key{TAB}}
6768 (@code{mh-index-next-folder}) and @kbd{S-@key{TAB}}
6769 (@code{mh-index-previous-folder}).
6771 @findex mh-index-visit-folder
6772 @findex mh-rescan-folder
6773 @kindex F r
6774 @kindex v
6776 In addition, the command @kbd{v} (@code{mh-index-visit-folder}) can be
6777 used to visit the folder of the message at point. Initially, only the
6778 messages that matched the search criteria are displayed in the folder.
6779 While the temporary buffer has its own set of message numbers, the
6780 actual messages numbers are shown in the visited folder. Thus, the
6781 command @kbd{v} is useful to find the actual message number of an
6782 interesting message, or to view surrounding messages with the command
6783 @kbd{F r} @code{mh-rescan-folder}. @xref{Folders}.
6785 @findex mh-kill-folder
6786 @kindex F k
6788 Because this folder is temporary, you'll probably get in the habit of
6789 killing it when you're done with @kbd{F k} (@code{mh-kill-folder}).
6790 @xref{Folders}.
6792 @kindex F s
6794 You can regenerate the results by running @kbd{F s} with a prefix
6795 argument.
6797 @cindex @command{procmail}
6798 @cindex Unix commands, @command{procmail}
6799 @cindex @samp{X-MHE-Checksum} header field
6800 @cindex header field, @samp{X-MHE-Checksum}
6802 Note: This command uses an @samp{X-MHE-Checksum:} header field to
6803 cache the MD5 checksum of a message. This means that if an incoming
6804 message already contains an @samp{X-MHE-Checksum:} field, that message
6805 might not be found by this command. The following @command{procmail}
6806 recipe avoids this problem by renaming the existing header field:
6808 @smallexample
6809 @group
6810 :0 wf
6811 | formail -R "X-MHE-Checksum" "X-Old-MHE-Checksum"
6812 @end group
6813 @end smallexample
6815 @xref{Limits}, for an alternative interface to searching.
6817 @section Configuring Indexed Searches
6819 @cindex @command{grep}
6820 @cindex @command{mairix}
6821 @cindex @command{namazu}
6822 @cindex @command{pick}
6823 @cindex @command{swish++}
6824 @cindex @command{swish-e}
6825 @cindex Unix commands, @command{grep}
6826 @cindex Unix commands, @command{mairix}
6827 @cindex Unix commands, @command{namazu}
6828 @cindex Unix commands, @command{pick}
6829 @cindex Unix commands, @command{swish++}
6830 @cindex Unix commands, @command{swish-e}
6831 @findex mh-search
6832 @kindex F s
6833 @vindex mh-search-program
6835 The command @kbd{F s} (@code{mh-search}) runs the command defined by
6836 the option @code{mh-search-program}. The default value is
6837 @samp{Auto-detect} which means that MH-E will automatically choose one
6838 of @command{swish++}, @command{swish-e}, @command{mairix},
6839 @command{namazu}, @command{pick} and @command{grep} in that order. If,
6840 for example, you have both @command{swish++} and @command{mairix}
6841 installed and you want to use @command{mairix}, then you can set this
6842 option to @samp{mairix}.
6844 The following sub-sections describe how to set up the various indexing
6845 programs to use with MH-E.
6847 @subsection swish++
6849 @cindex @command{swish++}
6850 @cindex Unix commands, @command{swish++}
6852 In the examples below, replace @file{/home/user/Mail} with the path to
6853 your MH directory.
6855 First create the directory @file{/home/user/Mail/.swish++}. Then
6856 create the file @file{/home/user/Mail/.swish++/swish++.conf} with the
6857 following contents:
6859 @smallexample
6860 @group
6861 IncludeMeta         Bcc Cc Comments Content-Description From Keywords
6862 IncludeMeta         Newsgroups Resent-To Subject To
6863 IncludeMeta         Message-Id References In-Reply-To
6864 IncludeFile         Mail    *
6865 IndexFile           /home/user/Mail/.swish++/swish++.index
6866 @end group
6867 @end smallexample
6869 Use the following command line to generate the swish index. Run this
6870 daily from cron:
6872 @smallexample
6873 @group
6874 find /home/user/Mail -path /home/user/Mail/mhe-index -prune \
6875                      -o -path /home/user/Mail/.swish++ -prune \
6876                      -o -name "[0-9]*" -print \
6877     | index -c /home/user/Mail/.swish++/swish++.conf -
6878 @end group
6879 @end smallexample
6881 This command does not index the folders that hold the results of your
6882 searches in @samp{+mhe-index} since they tend to be ephemeral and the
6883 original messages are indexed anyway.
6885 @cindex @command{index}
6886 @cindex Unix commands, @command{index}
6887 @cindex @command{index++}
6888 @cindex Unix commands, @command{index++}
6890 On some systems (Debian GNU/Linux, for example), use @command{index++}
6891 instead of @command{index}.
6893 @subsection swish
6895 @cindex @command{swish-e}
6896 @cindex Unix commands, @command{swish-e}
6898 In the examples below, replace @file{/home/user/Mail} with the path to
6899 your MH directory.
6901 First create the directory @file{/home/user/Mail/.swish}. Then create
6902 the file @file{/home/user/Mail/.swish/config} with the following
6903 contents:
6905 @smallexample
6906 @group
6907 DefaultContents TXT*
6908 IndexDir /home/user/Mail
6909 IndexFile /home/user/Mail/.swish/index
6910 IndexName "Mail Index"
6911 IndexDescription "Mail Index"
6912 IndexPointer "http://nowhere"
6913 IndexAdmin "nobody"
6914 #MetaNames automatic
6915 IndexReport 3
6916 FollowSymLinks no
6917 UseStemming no
6918 IgnoreTotalWordCountWhenRanking yes
6919 WordCharacters abcdefghijklmnopqrstuvwxyz0123456789-
6920 BeginCharacters abcdefghijklmnopqrstuvwxyz
6921 EndCharacters abcdefghijklmnopqrstuvwxyz0123456789
6922 IgnoreLimit 50 1000
6923 IndexComments 0
6924 FileRules filename contains \D
6925 FileRules pathname contains /home/user/Mail/.swish
6926 FileRules pathname contains /home/user/Mail/mhe-index
6927 FileRules filename is index
6928 @end group
6929 @end smallexample
6931 This configuration does not index the folders that hold the results of
6932 your searches in @samp{+mhe-index} since they tend to be ephemeral and
6933 the original messages are indexed anyway.
6935 If there are any directories you would like to ignore, append lines
6936 like the following to @file{config}:
6938 @smallexample
6939 FileRules pathname contains /home/user/Mail/scripts
6940 @end smallexample
6942 @cindex @command{swish-e}
6943 @cindex Unix commands, @command{swish-e}
6945 Use the following command line to generate the swish index. Run this
6946 daily from cron:
6948 @smallexample
6949 swish-e -c /home/user/Mail/.swish/config
6950 @end smallexample
6952 @subsection mairix
6954 @cindex @command{mairix}
6955 @cindex Unix commands, @command{mairix}
6957 In the examples below, replace @file{~/Mail} with the path to your MH
6958 directory.
6960 First create the directory @file{~/Mail/.mairix}. Then create the file
6961 @file{~/Mail/.mairix/config} with the following contents:
6963 @smallexample
6964 @group
6965 base=~/Mail
6967 # List of folders that should be indexed. 3 dots at the end means there
6968 # are subfolders within the folder
6969 mh=archive...:inbox:drafts:news:sent:trash
6971 mformat=mh
6972 database=~/Mail/.mairix/database
6973 @end group
6974 @end smallexample
6976 Use the following command line to generate the mairix index. Run this daily
6977 from cron:
6979 @smallexample
6980 mairix -f ~/Mail/.mairix/config
6981 @end smallexample
6983 @subsection namazu
6985 @cindex @command{namazu}
6986 @cindex Unix commands, @command{namazu}
6988 In the examples below, replace @file{/home/user/Mail} with the path to
6989 your MH directory.
6991 First create the directory @file{/home/user/Mail/.namazu}. Then create
6992 the file @file{/home/user/Mail/.namazu/mknmzrc} with the following
6993 contents:
6995 @smallexample
6996 @group
6997 package conf;  # Don't remove this line!
6998 $ADDRESS = 'user@@localhost';
6999 $ALLOW_FILE = "[0-9]*";
7000 $EXCLUDE_PATH = "^/home/user/Mail/(mhe-index|spam)";
7001 @end group
7002 @end smallexample
7004 This configuration does not index the folders that hold the results of
7005 your searches in @samp{+mhe-index} since they tend to be ephemeral and
7006 the original messages are indexed anyway.
7008 Use the following command line to generate the namazu index. Run this
7009 daily from cron:
7011 @smallexample
7012 mknmz -f /home/user/Mail/.namazu/mknmzrc -O /home/user/Mail/.namazu \
7013       -q /home/user/Mail
7014 @end smallexample
7016 @subsection pick
7018 @cindex @command{pick}
7019 @cindex MH commands, @command{pick}
7021 This search method does not require any setup.
7023 Read @command{pick}(1) or the section
7024 @uref{@value{MH-BOOK-HOME}/finpic.html, Finding Messages with pick} in
7025 the MH book to find out more about how to enter the criteria.
7027 @subsection grep
7029 @cindex @command{grep}
7030 @cindex Unix commands, @command{grep}
7032 This search method does not require any setup.
7034 Unlike the other search methods, this method does not use the
7035 MH-Search buffer. Instead, you simply enter a regular expression in
7036 the minibuffer. For help in constructing regular expressions, see your
7037 man page for @command{grep}.
7039 @node Threading, Limits, Searching, Top
7040 @chapter Viewing Message Threads
7042 @cindex threading
7044 MH-E groups messages by @dfn{threads} which are messages that are part
7045 of the same discussion and usually all have the same @samp{Subject:}
7046 header field. Other ways to organize messages in a folder include
7047 limiting (@pxref{Limits}) or using full-text indexed searches
7048 (@pxref{Searching}).
7050 @cindex root, in threads
7051 @cindex siblings, in threads
7052 @cindex ancestor, in threads
7054 A thread begins with a single message called a @dfn{root}. All replies
7055 to the same message are @dfn{siblings} of each other. Any message that
7056 has replies to it is an @dfn{ancestor} of those replies.
7058 There are several commands that you can use to navigate and operate on
7059 threads.
7061 @table @kbd
7062 @kindex T ?
7063 @findex mh-prefix-help
7064 @item T ?
7065 Display cheat sheet for the commands of the current prefix in
7066 minibuffer (@code{mh-prefix-help}).
7067 @c -------------------------
7068 @kindex T o
7069 @findex mh-thread-refile
7070 @item T o
7071 Refile (output) thread into folder (@code{mh-thread-refile}).
7072 @c -------------------------
7073 @kindex T d
7074 @findex mh-thread-delete
7075 @item T d
7076 Delete thread (@code{mh-thread-delete}).
7077 @c -------------------------
7078 @kindex T t
7079 @findex mh-toggle-threads
7080 @item T t
7081 Toggle threaded view of folder (@code{mh-toggle-threads}).
7082 @c -------------------------
7083 @kindex T n
7084 @findex mh-thread-next-sibling
7085 @item T n
7086 Display next sibling (@code{mh-thread-next-sibling}).
7087 @c -------------------------
7088 @kindex T p
7089 @findex mh-thread-previous-sibling
7090 @item T p
7091 Display previous sibling (@code{mh-thread-previous-sibling}).
7092 @c -------------------------
7093 @kindex T u
7094 @findex mh-thread-ancestor
7095 @item T u
7096 Display ancestor of current message (@code{mh-thread-ancestor}).
7097 @end table
7099 @cindex @samp{mh-thread} customization group
7100 @cindex customization group, @samp{mh-thread}
7102 The @samp{mh-thread} customization group contains one option.
7104 @vtable @code
7105 @item mh-show-threads-flag
7106 On means new folders start in threaded mode (default: @samp{off}).
7107 @end vtable
7109 @findex mh-toggle-threads
7110 @kindex T t
7111 @vindex mh-large-folder
7112 @vindex mh-show-threads-flag
7114 Threading large number of messages can be time consuming so the option
7115 @code{mh-show-threads-flag} is turned off by default. If you turn on
7116 this option, then threading will be done only if the number of
7117 messages being threaded is less than @code{mh-large-folder}. In any
7118 event, threading can be turned on (and off) with the command @kbd{T t}
7119 (@code{mh-toggle-threads}).
7121 @findex mh-thread-ancestor
7122 @findex mh-thread-next-sibling
7123 @findex mh-thread-previous-sibling
7124 @kindex T n
7125 @kindex T p
7126 @kindex T u
7128 There are a few commands to help you navigate threads. If you do not
7129 care for the way a particular thread has turned, you can move up the
7130 chain of messages with the command @kbd{T u}
7131 (@code{mh-thread-ancestor}. At any point you can use @kbd{T n}
7132 (@code{mh-thread-next-sibling} or @kbd{T p}
7133 (@code{mh-thread-previous-sibling}) to jump to the next or previous
7134 sibling, skipping the sub-threads. The command @kbd{T u} can also take
7135 a prefix argument to jump to the message that started everything.
7137 @findex mh-delete-subject-or-thread
7138 @findex mh-thread-delete
7139 @findex mh-thread-refile
7140 @kindex k
7141 @kindex T d
7142 @kindex T o
7144 There are threaded equivalents for the commands that delete and refile
7145 messages. For example, @kbd{T o} (@code{mh-thread-refile}) refiles the
7146 current message and all its children. Similarly, the command @kbd{T d}
7147 (@code{mh-thread-delete}) deletes the current message and all its
7148 children. These commands do not refile or delete sibling messages.
7149 @xref{Navigating}, for a description of the similar command @kbd{k}
7150 (@code{mh-delete-subject-or-thread}).
7152 @vindex mh-large-folder
7154 If you find that threading is too slow, it may be that you have
7155 @code{mh-large-folder} set too high. Also, threading is one of the few
7156 features of MH-E that really benefits from compiling. If you haven't
7157 compiled MH-E, I encourage you to do so@footnote{If you're not sure if
7158 MH-E has been byte-compiled, you could try running @samp{locate
7159 mh-thread.elc} or otherwise find MH-E on your system and ensure that
7160 @file{mh-thread.elc} exists. If you have multiple versions and you
7161 find that one is compiled but the other is not, then go into your
7162 @file{*scratch*} buffer in Emacs, enter @kbd{load-path C-j}, and
7163 ensure that the byte-compiled version appears first in the
7164 @code{load-path}. If you find that MH-E is not compiled and you
7165 installed MH-E yourself, please refer to the installation directions
7166 in the file @file{README} in the distribution.}.
7168 @node Limits, Sequences, Threading, Top
7169 @chapter Limiting Display
7171 @cindex limits
7172 @cindex filters
7174 Another way to organize messages in a folder besides threading
7175 (@pxref{Threading}) or using full-text indexed searches
7176 (@pxref{Searching}) is by limiting the folder display to messages that
7177 are similar to the current message.
7179 @table @kbd
7180 @kindex / ?
7181 @findex mh-prefix-help
7182 @item / ?
7183 Display cheat sheet for the commands of the current prefix in
7184 minibuffer (@code{mh-prefix-help}).
7185 @c -------------------------
7186 @cindex @samp{Sequence > Narrow to Tick Sequence} menu item
7187 @cindex menu item, @samp{Sequence > Narrow to Tick Sequence}
7188 @kindex / '
7189 @findex mh-narrow-to-tick
7190 @item / '
7191 Limit to messages in the @samp{tick} sequence
7192 (@code{mh-narrow-to-tick}).
7193 @c -------------------------
7194 @kindex / c
7195 @findex mh-narrow-to-cc
7196 @item / c
7197 Limit to messages with the same @samp{Cc:} field
7198 (@code{mh-narrow-to-cc}).
7199 @c -------------------------
7200 @kindex / m
7201 @findex mh-narrow-to-from
7202 @item / m
7203 Limit to messages with the same @samp{From:} field
7204 (@code{mh-narrow-to-from}).
7205 @c -------------------------
7206 @kindex / g
7207 @findex mh-narrow-to-range
7208 @item / g
7209 Limit to range (@code{mh-narrow-to-range}).
7210 @c -------------------------
7211 @cindex @samp{Sequence > Narrow to Subject Sequence} menu item
7212 @cindex menu item, @samp{Sequence > Narrow to Subject Sequence}
7213 @kindex / s
7214 @findex mh-narrow-to-subject
7215 @item / s
7216 Limit to messages with the same @samp{Subject:} field
7217 (@code{mh-narrow-to-subject}).
7218 @c -------------------------
7219 @kindex / t
7220 @findex mh-narrow-to-to
7221 @item / t
7222 Limit to messages with the same @samp{To:} field
7223 (@code{mh-narrow-to-to}).
7224 @c -------------------------
7225 @cindex @samp{Sequence > Widen from Sequence} menu item
7226 @cindex menu item, @samp{Sequence > Widen from Sequence}
7227 @kindex / w
7228 @findex mh-widen
7229 @item / w
7230 Remove last restriction (@code{mh-widen}).
7231 @end table
7233 All of the limiting commands above refine the display in some way.
7235 @cindex @command{pick}
7236 @cindex MH commands, @command{pick}
7237 @findex mh-narrow-to-cc
7238 @findex mh-narrow-to-from
7239 @findex mh-narrow-to-subject
7240 @findex mh-narrow-to-to
7241 @kindex / c
7242 @kindex / m
7243 @kindex / s
7244 @kindex / t
7246 The commands @kbd{/ c} (@code{mh-narrow-to-cc}), @kbd{/ m}
7247 (@code{mh-narrow-to-from}), @kbd{/ s} (@code{mh-narrow-to-subject}),
7248 and @kbd{/ t} (@code{mh-narrow-to-to}) restrict the display to
7249 messages matching the content of the respective field in the current
7250 message. However, you can give any of these a prefix argument to edit
7251 the @command{pick} expression used to narrow the view@footnote{See
7252 @command{pick}(1) or the section
7253 @uref{@value{MH-BOOK-HOME}/finpic.html, Finding Messages with pick} in
7254 the MH book.}.
7256 @cindex @samp{tick} sequence
7257 @cindex sequence, @samp{tick}
7258 @cindex ticked messages, viewing
7259 @findex mh-narrow-to-range
7260 @findex mh-narrow-to-tick
7261 @kindex / '
7262 @kindex / g
7264 You can also limit the display to messages in the @samp{tick} sequence
7265 with the command @kbd{/ '} (@code{mh-narrow-to-tick}).
7266 @xref{Sequences}, for information on putting message into the
7267 @samp{tick} sequence. Use the @kbd{/ g} (@code{mh-narrow-to-range})
7268 command to limit the display to messages in a range (@pxref{Ranges}).
7270 @findex mh-widen
7271 @kindex / w
7273 Each limit can be undone in turn with the @kbd{/ w} (@code{mh-widen})
7274 command. Give this command a prefix argument to remove all limits.
7276 @node Sequences, Junk, Limits, Top
7277 @chapter Using Sequences
7279 @cindex @samp{Sequence} menu
7280 @cindex menu, @samp{Sequence}
7281 @cindex sequences
7283 For the whole scoop on MH sequences, refer to
7284 @samp{mh-sequence}(5)@footnote{See the section
7285 @uref{@value{MH-BOOK-HOME}/morseq.html, More About Sequences} in the MH
7286 book.}. As you've read, several of the MH-E commands can operate on a
7287 sequence, which is a shorthand for a range or group of messages. For
7288 example, you might want to forward several messages to a friend or
7289 colleague. Here's how to manipulate sequences. These commands are also
7290 available in the @samp{Sequence} menu.
7292 @table @kbd
7293 @cindex @samp{Sequence > Toggle Tick Mark} menu item
7294 @cindex menu item, @samp{Sequence > Toggle Tick Mark}
7295 @kindex '
7296 @findex mh-toggle-tick
7297 @item '
7298 Toggle tick mark of range (@code{mh-toggle-tick}).
7299 @c -------------------------
7300 @kindex S ?
7301 @findex mh-prefix-help
7302 @item S ?
7303 Display cheat sheet for the commands of the current prefix in
7304 minibuffer (@code{mh-prefix-help}).
7305 @c -------------------------
7306 @cindex @samp{Sequence > Narrow to Tick Sequence} menu item
7307 @cindex menu item, @samp{Sequence > Narrow to Tick Sequence}
7308 @kindex S '
7309 @findex mh-narrow-to-tick
7310 @item S '
7311 Limit to ticked messages (@code{mh-narrow-to-tick}).
7312 @c -------------------------
7313 @cindex @samp{Sequence > Delete Message from Sequence...} menu item
7314 @cindex menu item, @samp{Sequence > Delete Message from Sequence...}
7315 @kindex S d
7316 @findex mh-delete-msg-from-seq
7317 @item S d
7318 Delete range from sequence (@code{mh-delete-msg-from-seq}).
7319 @c -------------------------
7320 @cindex @samp{Sequence > Delete Sequence...} menu item
7321 @cindex menu item, @samp{Sequence > Delete Sequence...}
7322 @kindex S k
7323 @findex mh-delete-seq
7324 @item S k
7325 Delete sequence (@code{mh-delete-seq}).
7326 @c -------------------------
7327 @cindex @samp{Sequence > List Sequences in Folder...} menu item
7328 @cindex menu item, @samp{Sequence > List Sequences in Folder...}
7329 @kindex S l
7330 @findex mh-list-sequences
7331 @item S l
7332 List all sequences in folder (@code{mh-list-sequences}).
7333 @c -------------------------
7334 @cindex @samp{Sequence > Narrow to Sequence...} menu item
7335 @cindex menu item, @samp{Sequence > Narrow to Sequence...}
7336 @kindex S n
7337 @findex mh-narrow-to-seq
7338 @item S n
7339 Restrict display to messages in sequence (@code{mh-narrow-to-seq}).
7340 @c -------------------------
7341 @cindex @samp{Sequence > Add Message to Sequence...} menu item
7342 @cindex menu item, @samp{Sequence > Add Message to Sequence...}
7343 @kindex S p
7344 @findex mh-put-msg-in-seq
7345 @item S p
7346 Add range to sequence (@code{mh-put-msg-in-seq}).
7347 @c -------------------------
7348 @cindex @samp{Sequence > List Sequences for Message} menu item
7349 @cindex menu item, @samp{Sequence > List Sequences for Message}
7350 @kindex S s
7351 @findex mh-msg-is-in-seq
7352 @item S s
7353 Display the sequences in which the current message appears
7354 (@code{mh-msg-is-in-seq}).
7355 @c -------------------------
7356 @cindex @samp{Sequence > Widen from Sequence} menu item
7357 @cindex menu item, @samp{Sequence > Widen from Sequence}
7358 @kindex S w
7359 @findex mh-widen
7360 @item S w
7361 Remove last restriction (@code{mh-widen}).
7362 @c -------------------------
7363 @findex mh-update-sequences
7364 @item M-x mh-update-sequences
7365 Flush MH-E's state out to MH@.
7366 @end table
7368 @cindex @samp{mh-sequences} customization group
7369 @cindex customization group, @samp{mh-sequences}
7371 The @samp{mh-sequences} customization group contains the options
7372 associated with sequences.
7374 @vtable @code
7375 @item mh-refile-preserves-sequences-flag
7376 On means that sequences are preserved when messages are refiled
7377 (default: @samp{on}).
7378 @c -------------------------
7379 @item mh-tick-seq
7380 The name of the MH sequence for ticked messages (default: @samp{'tick}).
7381 @c -------------------------
7382 @item mh-update-sequences-after-mh-show-flag
7383 On means flush MH sequences to disk after message is shown (default:
7384 @samp{on}).
7385 @item mh-whitelist-preserves-sequences-flag
7386 On means that sequences are preserved when messages are whitelisted
7387 (default: @samp{on}).
7388 @end vtable
7390 The following hook is available.
7392 @vtable @code
7393 @item mh-unseen-updated-hook
7394 Hook run after the unseen sequence has been updated (default: @code{nil}).
7395 @end vtable
7397 @cindex @command{pick}
7398 @cindex MH commands, @command{pick}
7399 @findex mh-put-msg-in-seq
7400 @kindex S p
7402 To place a message in a sequence, use @kbd{S p}
7403 (@code{mh-put-msg-in-seq}). Give @kbd{S p} a range and you can add all
7404 the messages in a sequence to another sequence (for example, @kbd{C-u
7405 S p SourceSequence @key{RET} DestSequence @key{RET}}, @pxref{Ranges}).
7407 @cindex @samp{tick} sequence
7408 @cindex sequence, @samp{tick}
7409 @cindex ticking messages
7410 @findex mh-index-ticked-messages
7411 @findex mh-toggle-tick
7412 @kindex '
7413 @kindex F '
7414 @kindex S p
7416 One specific use of the @kbd{S p} command is @kbd{'}
7417 (@code{mh-toggle-tick}) which adds messages to the @samp{tick}
7418 sequence. This sequence can be viewed later with the @kbd{F '}
7419 (@code{mh-index-ticked-messages}) command (@pxref{Folders}).
7421 @vindex mh-tick-seq
7423 You can customize the option @code{mh-tick-seq} if you already use the
7424 @samp{tick} sequence for your own use. You can also disable all of the
7425 ticking functions by choosing the @samp{Disable Ticking} item but
7426 there isn't much advantage to that.
7428 @cindex MH-Folder mode
7429 @cindex modes, MH-Folder
7430 @findex mh-narrow-to-seq
7431 @findex mh-narrow-to-tick
7432 @findex mh-widen
7433 @kindex S '
7434 @kindex S n
7435 @kindex S w
7437 Once you've placed some messages in a sequence, you may wish to narrow
7438 the field of view to just those messages in the sequence you've
7439 created. To do this, use @kbd{S n} (@code{mh-narrow-to-seq}). You are
7440 prompted for the name of the sequence. What this does is show only
7441 those messages that are in the selected sequence in the MH-Folder
7442 buffer. In addition, it limits further MH-E searches to just those
7443 messages. To narrow the view to the messages in the @samp{tick}
7444 sequence, use @kbd{S '} (@code{mh-narrow-to-tick}). When you want to
7445 widen the view to all your messages again, use @kbd{S w}
7446 (@code{mh-widen}).
7448 @cindex buffers, @file{*MH-E Sequences*}
7449 @cindex @file{*MH-E Sequences*}
7450 @findex mh-list-sequences
7451 @findex mh-msg-is-in-seq
7452 @kindex S l
7453 @kindex S s
7455 You can see which sequences in which a message appears with the
7456 command @kbd{S s} (@code{mh-msg-is-in-seq}). Use a prefix argument to
7457 display the sequences in which another message appears (as in @kbd{C-u
7458 42 S s @key{RET}}). Or, you can list all sequences in a selected
7459 folder (default is current folder) with @kbd{S l}
7460 (@code{mh-list-sequences}). The list appears in a buffer named
7461 @file{*MH-E Sequences*} (@pxref{Miscellaneous}).
7463 @cindex MH profile component, @samp{Previous-Sequence}
7464 @cindex @samp{cur} sequence
7465 @cindex @samp{Previous-Sequence} MH profile component
7466 @cindex sequence, @samp{cur}
7467 @cindex sequence, @samp{Previous-Sequence}
7468 @vindex mh-refile-preserves-sequences-flag
7470 If a message is in any sequence (except
7471 @samp{Previous-Sequence:}@footnote{See @samp{mh-profile}(5)).} and
7472 @samp{cur}) when it is refiled, then it will still be in those
7473 sequences in the destination folder. If this behavior is not desired,
7474 then turn off the option @code{mh-refile-preserves-sequences-flag}.
7476 @findex mh-delete-msg-from-seq
7477 @findex mh-delete-seq
7478 @kindex d
7479 @kindex S d
7480 @kindex S k
7482 If you want to remove a message (or range, @pxref{Ranges}) from a
7483 sequence, use @kbd{S d} (@code{mh-delete-msg-from-seq}). If you want
7484 to delete an entire sequence, use @kbd{S k} (@code{mh-delete-seq}). In
7485 the latter case you are prompted for the sequence to delete. Note that
7486 this deletes only the sequence, not the messages in the sequence. If
7487 you want to delete the messages, use @kbd{C-u d} (@pxref{Reading
7488 Mail}).
7490 @cindex @samp{Unseen-Sequence} MH profile component
7491 @cindex @samp{cur} sequence
7492 @cindex @samp{tick} sequence
7493 @cindex MH profile component, @samp{Unseen-Sequence}
7494 @cindex sequence, @samp{Unseen-Sequence}
7495 @cindex sequence, @samp{cur}
7496 @cindex sequence, @samp{tick}
7497 @findex mh-update-sequences
7498 @kindex q
7499 @kindex x
7500 @vindex mh-tick-seq
7501 @vindex mh-update-sequences-after-mh-show-flag
7503 Three sequences are maintained internally by MH-E and pushed out to MH
7504 when a message is shown. They include the sequence specified by your
7505 @samp{Unseen-Sequence:} profile component, @samp{cur}, and the
7506 sequence listed by the option @code{mh-tick-seq} which is @samp{tick}
7507 by default. If you do not like this behavior, turn off the option
7508 @code{mh-update-sequences-after-mh-show-flag}. You can then update the
7509 state manually with the @kbd{x}, @kbd{q}, or @kbd{M-x
7510 mh-update-sequences} commands.
7512 @vindex mh-seen-list
7513 @vindex mh-unseen-updated-hook
7515 The hook @code{mh-unseen-updated-hook} is run after the unseen
7516 sequence has been updated. The variable @code{mh-seen-list} can be
7517 used by this hook to obtain the list of messages which were removed
7518 from the unseen sequence.
7520 @cindex @command{mark}
7521 @cindex MH commands, @command{mark}
7522 @kindex S n
7523 @kindex S w
7525 With the exceptions of @kbd{S n} and @kbd{S w}, the underlying MH
7526 command dealing with sequences is @command{mark}@footnote{See the
7527 section @uref{@value{MH-BOOK-HOME}/mmbwm.html, Make Message Bookmarks
7528 with mark} in the MH book.}.
7530 @node Junk, Miscellaneous, Sequences, Top
7531 @chapter Dealing With Junk Mail
7533 @cindex Marshall Rose
7534 @cindex junk mail
7535 @cindex spam
7537 Marshall Rose once wrote a paper on MH entitled, @cite{How to process
7538 200 messages a day and still get some real work done}. This chapter
7539 could be entitled, @cite{How to process 1000 spams a day and still get
7540 some real work done}.
7542 @cindex blacklisting
7543 @cindex ham
7544 @cindex viruses
7545 @cindex whitelisting
7546 @cindex worms
7548 We use the terms @dfn{junk mail} and @dfn{spam} interchangeably for
7549 any unwanted message which includes spam, @dfn{viruses}, and
7550 @dfn{worms}. The opposite of spam is @dfn{ham}. The act of classifying
7551 a sender as one who sends junk mail is called @dfn{blacklisting}; the
7552 opposite is called @dfn{whitelisting}.
7554 @table @kbd
7555 @kindex J ?
7556 @findex mh-prefix-help
7557 @item J ?
7558 Display cheat sheet for the commands of the current prefix in
7559 minibuffer (@code{mh-prefix-help}).
7560 @c -------------------------
7561 @kindex J b
7562 @findex mh-junk-blacklist
7563 @item J b
7564 Blacklist range as spam (@code{mh-junk-blacklist}).
7565 @c -------------------------
7566 @kindex J w
7567 @findex mh-junk-whitelist
7568 @item J w
7569 Whitelist range as ham (@code{mh-junk-whitelist}).
7570 @c -------------------------
7571 @item @code{mh-spamassassin-identify-spammers}
7572 Identify spammers who are repeat offenders.
7573 @end table
7575 @cindex @samp{mh-junk} customization group
7576 @cindex customization group, @samp{mh-junk}
7578 The following table lists the options from the @samp{mh-junk}
7579 customization group.
7581 @vtable @code
7582 @item mh-junk-background
7583 If on, spam programs are run in background (default: @samp{off}).
7584 @c -------------------------
7585 @item mh-junk-disposition
7586 Disposition of junk mail (default: @samp{Delete Spam}).
7587 @c -------------------------
7588 @item mh-junk-program
7589 Spam program that MH-E should use (default: @samp{Auto-detect}).
7590 @end vtable
7592 @cindex @samp{mh-sequences} customization group
7593 @cindex customization group, @samp{mh-sequences}
7595 The following option in the @samp{mh-sequences} customization group is
7596 also available.
7598 @vtable @code
7599 @item mh-whitelist-preserves-sequences-flag
7600 On means that sequences are preserved when messages are whitelisted
7601 (default: @samp{on}).
7602 @end vtable
7604 The following hooks are available.
7606 @vtable @code
7607 @item mh-blacklist-msg-hook
7608 Hook run by @kbd{J b} (@code{mh-junk-blacklist}) after marking each
7609 message for blacklisting (default: @code{nil}).
7610 @c -------------------------
7611 @item mh-whitelist-msg-hook
7612 Hook run by @kbd{J w} (@code{mh-junk-whitelist}) after marking each
7613 message for whitelisting (default @samp{nil}).
7614 @end vtable
7616 The following faces are available.
7618 @vtable @code
7619 @item mh-folder-blacklisted
7620 Blacklisted message face.
7621 @c -------------------------
7622 @item mh-folder-whitelisted
7623 Whitelisted message face
7624 @end vtable
7626 @cindex SpamProbe
7627 @cindex SpamAssassin
7628 @cindex bogofilter
7629 @cindex spam filters, SpamProbe
7630 @cindex spam filters, SpamAssassin
7631 @cindex spam filters, bogofilter
7633 MH-E depends on @uref{http://spamassassin.apache.org/, SpamAssassin},
7634 @uref{http://bogofilter.sourceforge.net/, bogofilter}, or
7635 @uref{http://spamprobe.sourceforge.net/, SpamProbe} to throw the dreck
7636 away. This chapter describes briefly how to configure these programs
7637 to work well with MH-E and how to use MH-E's interface that provides
7638 continuing education for these programs.
7640 @vindex mh-junk-program
7642 The default setting of the option @code{mh-junk-program} is
7643 @samp{Auto-detect} which means that MH-E will automatically choose one
7644 of SpamAssassin, bogofilter, or SpamProbe in that order. If, for
7645 example, you have both SpamAssassin and bogofilter installed and you
7646 want to use bogofilter, then you can set this option to
7647 @samp{Bogofilter}.
7649 @findex mh-junk-blacklist
7650 @kindex J b
7651 @vindex mh-junk-disposition
7653 The command @kbd{J b} (@code{mh-junk-blacklist}) trains the spam
7654 program in use with the content of the range (@pxref{Ranges}) and then
7655 handles the message(s) as specified by the option
7656 @code{mh-junk-disposition}. By default, this option is set to
7657 @samp{Delete Spam} but you can also specify the name of the folder
7658 which is useful for building a corpus of spam for training purposes.
7660 @findex mh-junk-whitelist
7661 @kindex J w
7663 In contrast, the command @kbd{J w} (@code{mh-junk-whitelist})
7664 reclassifies a range of messages (@pxref{Ranges}) as ham if it were
7665 incorrectly classified as spam. It then refiles the message into the
7666 @file{+inbox} folder.
7668 @cindex MH profile component, @samp{Previous-Sequence}
7669 @cindex @samp{cur} sequence
7670 @cindex @samp{Previous-Sequence} MH profile component
7671 @cindex sequence, @samp{cur}
7672 @cindex sequence, @samp{Previous-Sequence}
7673 @vindex mh-whitelist-preserves-sequences-flag
7675 If a message is in any sequence (except @samp{Previous-Sequence:} and
7676 @samp{cur}) when it is whitelisted, then it will still be in those
7677 sequences in the destination folder. If this behavior is not desired,
7678 then turn off the option @code{mh-whitelist-preserves-sequences-flag}.
7680 @cindex @file{*MH-E Log*}
7681 @cindex buffers, @file{*MH-E Log*}
7682 @findex call-process
7683 @vindex mh-junk-background
7685 By default, the programs are run in the foreground, but this can be
7686 slow when junking large numbers of messages. If you have enough memory
7687 or don't junk that many messages at the same time, you might try
7688 turning on the option @code{mh-junk-background}. @footnote{Note that
7689 the option @code{mh-junk-background} is used as the @code{display}
7690 argument in the call to @code{call-process}. Therefore, turning on
7691 this option means setting its value to @samp{0}. You can also set its
7692 value to @samp{t} to direct the programs' output to the @file{*MH-E
7693 Log*} buffer; this may be useful for debugging.}
7695 The following sections discuss the various counter-spam measures that
7696 MH-E can work with.
7698 @cindex @file{.procmailrc}
7699 @cindex files, @file{.procmailrc}
7701 @subheading SpamAssassin
7703 @cindex SpamAssassin
7704 @cindex spam filters, SpamAssassin
7706 SpamAssassin is one of the more popular spam filtering programs. Get
7707 it from your local distribution or from the
7708 @uref{http://spamassassin.apache.org/, SpamAssassin web site}.
7710 To use SpamAssassin, add the following recipes to @file{~/.procmailrc}:
7712 @cindex @command{spamc}
7713 @cindex @samp{X-Spam-Level} header field
7714 @cindex @samp{X-Spam-Status} header field
7715 @cindex header field, @samp{X-Spam-Level}
7716 @cindex header field, @samp{X-Spam-Status}
7718 @smallexample
7719 PATH=$PATH:/usr/bin/mh
7720 MAILDIR=$HOME/`mhparam Path`
7722 # Fight spam with SpamAssassin.
7723 :0fw
7724 | spamc
7726 # Anything with a spam level of 10 or more is junked immediately.
7728 * ^X-Spam-Level: ..........
7729 /dev/null
7732 * ^X-Spam-Status: Yes
7733 spam/.
7734 @end smallexample
7736 If you don't use @command{spamc}, use @samp{spamassassin -P -a}.
7738 Note that one of the recipes above throws away messages with a score
7739 greater than or equal to 10. Here's how you can determine a value that
7740 works best for you.
7742 First, run @samp{spamassassin -t} on every mail message in your
7743 archive and use @command{gnumeric} to verify that the average plus the
7744 standard deviation of good mail is under 5, the SpamAssassin default
7745 for ``spam''.
7747 Using @command{gnumeric}, sort the messages by score and view the
7748 messages with the highest score. Determine the score which encompasses
7749 all of your interesting messages and add a couple of points to be
7750 conservative. Add that many dots to the @samp{X-Spam-Level:} header
7751 field above to send messages with that score down the drain.
7753 In the example above, messages with a score of 5--9 are set aside in
7754 the @samp{+spam} folder for later review. The major weakness of
7755 rules-based filters is a plethora of false positives so it is
7756 worthwhile to check.
7758 @findex mh-junk-blacklist
7759 @findex mh-junk-whitelist
7760 @kindex J b
7761 @kindex J w
7763 If SpamAssassin classifies a message incorrectly, or is unsure, you can
7764 use the MH-E commands @kbd{J b} (@code{mh-junk-blacklist}) and
7765 @kbd{J w} (@code{mh-junk-whitelist}).
7767 @cindex @command{sa-learn}
7768 @cindex @file{.spamassassin/user_prefs}
7769 @cindex files, @file{.spamassassin/user_prefs}
7771 The command @kbd{J b} (@code{mh-junk-blacklist}) adds a
7772 @samp{blacklist_from} entry to @file{~/spamassassin/user_prefs},
7773 deletes the message, and sends the message to the Razor, so that
7774 others might not see this spam. If the @command{sa-learn} command is
7775 available, the message is also recategorized as spam.
7777 The command@kbd{J w} (@code{mh-junk-whitelist}) adds a
7778 @samp{whitelist_from} rule to @samp{~/.spamassassin/user_prefs}. If
7779 the @command{sa-learn} command is available, the message is also
7780 recategorized as ham.
7782 Over time, you'll observe that the same host or domain occurs
7783 repeatedly in the @samp{blacklist_from} entries, so you might think
7784 that you could avoid future spam by blacklisting all mail from a
7785 particular domain. The utility function
7786 @code{mh-spamassassin-identify-spammers} helps you do precisely that.
7787 This function displays a frequency count of the hosts and domains in
7788 the @samp{blacklist_from} entries from the last blank line in
7789 @file{~/.spamassassin/user_prefs} to the end of the file. This
7790 information can be used so that you can replace multiple
7791 @samp{blacklist_from} entries with a single wildcard entry such as:
7793 @smallexample
7794 blacklist_from *@@*amazingoffersdirect2u.com
7795 @end smallexample
7797 In versions of SpamAssassin (2.50 and on) that support a Bayesian
7798 classifier, @kbd{J b} @code{(mh-junk-blacklist}) uses the program
7799 @command{sa-learn} to recategorize the message as spam. Neither MH-E,
7800 nor SpamAssassin, rebuilds the database after adding words, so you
7801 will need to run @samp{sa-learn --rebuild} periodically. This can be
7802 done by adding the following to your @file{crontab}:
7804 @smallexample
7805 0 * * * *       sa-learn --rebuild > /dev/null 2>&1
7806 @end smallexample
7808 @subheading Bogofilter
7810 @cindex bogofilter
7811 @cindex spam filters, bogofilter
7813 Bogofilter is a Bayesian spam filtering program. Get it from your
7814 local distribution or from the
7815 @uref{http://bogofilter.sourceforge.net/, bogofilter web site}.
7817 Bogofilter is taught by running:
7819 @smallexample
7820 bogofilter -n < good-message
7821 @end smallexample
7823 on every good message, and
7825 @smallexample
7826 bogofilter -s < spam-message
7827 @end smallexample
7829 @cindex full training
7831 on every spam message. This is called a @dfn{full training}; three
7832 other training methods are described in the FAQ that is distributed
7833 with bogofilter. Note that most Bayesian filters need 1000 to 5000 of
7834 each type of message to start doing a good job.
7836 To use bogofilter, add the following recipes to @file{~/.procmailrc}:
7838 @cindex @samp{X-Bogosity} header field
7839 @cindex header field, @samp{X-Bogosity}
7841 @smallexample
7842 PATH=$PATH:/usr/bin/mh
7843 MAILDIR=$HOME/`mhparam Path`
7845 # Fight spam with Bogofilter.
7846 :0fw
7847 | bogofilter -3 -e -p
7850 * ^X-Bogosity: Yes, tests=bogofilter
7851 spam/.
7854 * ^X-Bogosity: Unsure, tests=bogofilter
7855 spam/unsure/.
7856 @end smallexample
7858 @findex mh-junk-blacklist
7859 @findex mh-junk-whitelist
7860 @kindex J b
7861 @kindex J w
7863 If bogofilter classifies a message incorrectly, or is unsure, you can
7864 use the MH-E commands @kbd{J b} (@code{mh-junk-blacklist}) and @kbd{J
7865 w} (@code{mh-junk-whitelist}) to update bogofilter's training.
7867 The @cite{Bogofilter FAQ} suggests that you run the following
7868 occasionally to shrink the database:
7870 @smallexample
7871 bogoutil -d wordlist.db | bogoutil -l wordlist.db.new
7872 mv wordlist.db wordlist.db.prv
7873 mv wordlist.db.new wordlist.db
7874 @end smallexample
7876 The @cite{Bogofilter tuning HOWTO} describes how you can fine-tune
7877 bogofilter.
7879 @subheading SpamProbe
7881 @cindex SpamProbe
7882 @cindex spam filters, SpamProbe
7884 SpamProbe is a Bayesian spam filtering program. Get it from your local
7885 distribution or from the @uref{http://spamprobe.sourceforge.net,
7886 SpamProbe web site}.
7888 To use SpamProbe, add the following recipes to @file{~/.procmailrc}:
7890 @cindex @command{formail}
7891 @cindex @samp{X-SpamProbe} header field
7892 @cindex header field, @samp{X-SpamProbe}
7894 @smallexample
7895 PATH=$PATH:/usr/bin/mh
7896 MAILDIR=$HOME/`mhparam Path`
7898 # Fight spam with SpamProbe.
7900 SCORE=| spamprobe receive
7902 :0 wf
7903 | formail -I "X-SpamProbe: $SCORE"
7906 *^X-SpamProbe: SPAM
7907 spam/.
7908 @end smallexample
7910 @findex mh-junk-blacklist
7911 @findex mh-junk-whitelist
7912 @kindex J b
7913 @kindex J w
7915 If SpamProbe classifies a message incorrectly, you can use the MH-E
7916 commands @kbd{J b} (@code{mh-junk-blacklist}) and @kbd{J w}
7917 (@code{mh-junk-whitelist}) to update SpamProbe's training.
7919 @subheading Other Things You Can Do
7921 There are a couple of things that you can add to @file{~/.procmailrc}
7922 in order to filter out a lot of spam and viruses. The first is to
7923 eliminate any message with a Windows executable (which is most likely
7924 a virus). The second is to eliminate mail in character sets that you
7925 can't read.
7927 @cindex @samp{Content-Transfer-Encoding} header field
7928 @cindex @samp{Content-Type} header field
7929 @cindex @samp{Subject} header field
7930 @cindex header field, @samp{Content-Transfer-Encoding}
7931 @cindex header field, @samp{Content-Type}
7932 @cindex header field, @samp{Subject}
7934 @smallexample
7935 PATH=$PATH:/usr/bin/mh
7936 MAILDIR=$HOME/`mhparam Path`
7939 # Filter messages with w32 executables/virii.
7941 # These attachments are base64 and have a TVqQAAMAAAAEAAAA//8AALg
7942 # pattern. The string "this program cannot be run in MS-DOS mode"
7943 # encoded in base64 is 4fug4AtAnNIbg and helps to avoid false
7944 # positives (Roland Smith via Pete from the bogofilter mailing list).
7946 :0 B:
7947 * ^Content-Transfer-Encoding:.*base64
7948 * ^TVqQAAMAAAAEAAAA//8AALg
7949 * 4fug4AtAnNIbg
7950 spam/exe/.
7953 # Filter mail in unreadable character sets (from the Bogofilter FAQ).
7955 UNREADABLE='[^?"]*big5|iso-2022-jp|ISO-2022-KR|euc-kr|gb2312|ks_c_5601-1987'
7958 * 1^0 $ ^Subject:.*=\?($UNREADABLE)
7959 * 1^0 $ ^Content-Type:.*charset="?($UNREADABLE)
7960 spam/unreadable/.
7963 * ^Content-Type:.*multipart
7964 * B ?? $ ^Content-Type:.*^?.*charset="?($UNREADABLE)
7965 spam/unreadable/.
7966 @end smallexample
7968 @node Miscellaneous, Scan Line Formats, Junk, Top
7969 @chapter Miscellaneous Commands, Variables, and Buffers
7971 This chapter covers the following command and the various MH-E
7972 buffers,
7974 @ftable @code
7975 @item mh-version
7976 Display version information about MH-E and the MH mail handling
7977 system.
7978 @end ftable
7980 @cindex buffers, @file{*MH-E Info*}
7981 @cindex MH-E version
7982 @cindex @file{*MH-E Info*}
7983 @cindex version
7984 @findex mh-version
7986 One command worth noting is @kbd{M-x mh-version}. You can compare the
7987 version this command prints to the latest release (@pxref{Getting
7988 MH-E}). The output of @kbd{M-x mh-version}, found in a buffer named
7989 @file{*MH-E Info*}, should usually be included with any bug report you
7990 submit (@pxref{Bug Reports}).
7992 @subheading MH-E Buffers
7994 Besides the MH-Folder, MH-Show, and MH-Letter buffers, MH-E creates
7995 several other buffers. They are:
7997 @table @samp
7998 @cindex @file{*MH-E Folders*}
7999 @cindex buffers, @file{*MH-E Folders*}
8000 @findex mh-list-folders
8001 @item *MH-E Folders*
8002 @kindex F l
8003 This buffer contains the output of @kbd{F l} (@code{mh-list-folders}).
8004 @xref{Folders}.
8005 @c -------------------------
8006 @cindex @file{*MH-E Help*}
8007 @cindex buffers, @file{*MH-E Help*}
8008 @findex mh-help
8009 @item *MH-E Help*
8010 @kindex ?
8011 @kindex C-c ?
8012 This buffer contains the output of @kbd{?} (@code{mh-help}) and
8013 @kbd{C-c ?} in MH-Letter mode. @xref{Using This Manual}.
8014 @c -------------------------
8015 @cindex @file{*MH-E Info*}
8016 @cindex buffers, @file{*MH-E Info*}
8017 @item *MH-E Info*
8018 This buffer contains the output of @kbd{M-x mh-version @key{RET}}.
8019 @c -------------------------
8020 @cindex @file{*MH-E Log*}
8021 @cindex buffers, @file{*MH-E Log*}
8022 @item *MH-E Log*
8023 This buffer contains the last 100 lines of the output of the various
8024 MH commands.
8025 @c -------------------------
8026 @cindex @file{*MH-E Mail Delivery*}
8027 @cindex buffers, @file{*MH-E Mail Delivery*}
8028 @item *MH-E Mail Delivery*
8029 This buffer contains the transcript of a mail delivery. @xref{Sending
8030 Message}.
8031 @c -------------------------
8032 @cindex @file{*MH-E Recipients*}
8033 @cindex buffers, @file{*MH-E Recipients*}
8034 @findex mh-check-whom
8035 @item *MH-E Recipients*
8036 @kindex C-c C-w
8037 This buffer contains the output of @kbd{C-c C-w}
8038 (@code{mh-check-whom}) and is killed when draft is sent.
8039 @xref{Checking Recipients}.
8040 @c -------------------------
8041 @cindex @file{*MH-E Sequences*}
8042 @cindex buffers, @file{*MH-E Sequences*}
8043 @item *MH-E Sequences*
8044 This buffer contains the output of @kbd{S l}
8045 (@code{mh-list-sequences}). @xref{Sequences}.
8046 @c -------------------------
8047 @cindex @file{*mh-temp*}
8048 @cindex buffers, @file{*mh-temp*}
8049 @item *mh-temp*
8050 This is a scratch, ephemeral, buffer used by MH-E functions. Note that
8051 it is hidden because the first character in the name is a space.
8052 You'll generally not have any need for this buffer.
8053 @end table
8055 @node Scan Line Formats, Procmail, Miscellaneous, Top
8056 @appendix Scan Line Formats
8058 @cindex scan line formats
8060 This appendix discusses how MH-E creates, parses, and manipulates scan
8061 lines. If you have your own MH scan or inc format files, you
8062 @strong{can} teach MH-E how to handle them, but it isn't easy as
8063 you'll see.
8065 @cindex @samp{mh-scan-line-formats} customization group
8066 @cindex customization group, @samp{mh-scan-line-formats}
8068 This table lists the options in the @samp{mh-scan-line-formats}
8069 customization group.
8071 @vtable @code
8072 @item mh-adaptive-cmd-note-flag
8073 On means that the message number width is determined dynamically
8074 (default: @samp{on}).
8075 @c -------------------------
8076 @item mh-scan-format-file
8077 Specifies the format file to pass to the scan program (default:
8078 @samp{Use MH-E scan Format}).
8079 @c -------------------------
8080 @item mh-scan-prog
8081 Program used to scan messages (default: @code{"scan"}).
8082 @end vtable
8084 @vindex mh-adaptive-cmd-note-flag
8086 There are a couple of caveats when creating your own scan format file.
8087 First, MH-E will not work if your scan lines do not include message
8088 numbers. It will work poorly if you don't dedicate a column for
8089 showing the current message and notations. It is also best to keep the
8090 first column empty to make room for the cursor and so that text isn't
8091 obscured by the current message's overlay arrow when running in a
8092 terminal. You won't be able to use the option
8093 @code{mh-adaptive-cmd-note-flag} or the threading features
8094 (@pxref{Threading}).
8096 @cindex message numbers
8097 @findex mh-set-cmd-note
8098 @vindex mh-adaptive-cmd-note-flag
8099 @vindex mh-scan-format-file
8101 If you've created your own format to handle long message numbers,
8102 you'll be pleased to know you no longer need it since MH-E adapts its
8103 internal format based upon the largest message number if
8104 @code{mh-adaptive-cmd-note-flag} is on (the default). If you prefer
8105 fixed-width message numbers, turn off @code{mh-adaptive-cmd-note-flag}
8106 and call @code{mh-set-cmd-note} with the width specified by your
8107 format file (see @code{mh-scan-format-file}). For example, the default
8108 width is 4, so you would use @samp{(mh-set-cmd-note 4)}.
8110 @vindex mh-adaptive-cmd-note-flag
8111 @vindex mh-scan-format-file
8112 @vindex mh-scan-format-mh
8113 @vindex mh-scan-format-nmh
8115 The default setting for @code{mh-scan-format-file} is @samp{Use MH-E
8116 scan Format}. This means that the format string will be taken from the
8117 either @code{mh-scan-format-mh} or @code{mh-scan-format-nmh} depending
8118 on whether MH or nmh (or GNU mailutils MH) is in use. This setting
8119 also enables you to turn on the option
8120 @code{mh-adaptive-cmd-note-flag}. You can also set this option to
8121 @samp{Use Default scan Format} to get the same output as you would get
8122 if you ran @command{scan} from the shell. If you have a format file
8123 that you want MH-E to use but not MH, you can set this option to
8124 @samp{Specify a scan Format File} and enter the name of your format
8125 file.
8127 @vindex mh-scan-format-file
8128 @vindex mh-scan-format-mh
8129 @vindex mh-scan-format-nmh
8131 The scan format that MH-E uses when @code{mh-scan-format-file} is set
8132 to its default of @samp{Use MH-E scan Format} is held in the variables
8133 @code{mh-scan-format-nmh} and @code{mh-scan-format-mh} depending on
8134 whether you are using nmh (or GNU mailutils MH) or not. Typically, you
8135 create your own format files rather than modifying these variables.
8136 The value of @code{mh-scan-format-nmh} is:
8138 @smallexample
8139 (concat
8140  "%4(msg)"
8141  "%<(cur)+%| %>"
8142  "%<@{replied@}-"
8143  "%?(nonnull(comp@{to@}))%<(mymbox@{to@})t%>"
8144  "%?(nonnull(comp@{cc@}))%<(mymbox@{cc@})c%>"
8145  "%?(nonnull(comp@{bcc@}))%<(mymbox@{bcc@})b%>"
8146  "%?(nonnull(comp@{newsgroups@}))n%>"
8147  "%<(zero) %>"
8148  "%02(mon@{date@})/%02(mday@{date@})%<@{date@} %|*%>"
8149  "%<(mymbox@{from@})%<@{to@}To:%14(decode(friendly@{to@}))%>%>"
8150  "%<(zero)%17(decode(friendly@{from@}))%>  "
8151  "%(decode@{subject@})%<@{body@}<<%@{body@}%>")
8152 @end smallexample
8154 @cindex decoding RFC 2047
8155 @cindex RFC 2047, decoding
8156 @vindex mh-scan-format-mh
8158 The setting for @code{mh-scan-format-mh} is similar, except that MH
8159 doesn't have the function @code{decode} (which is used to decode RFC
8160 2047 encodings).
8162 @cindex notations, scan line
8163 @cindex scan line notations
8165 These strings are passed to the @command{scan} program via the
8166 @option{-format} argument. The formats are identical to the defaults
8167 except that additional hints for fontification have been added to the
8168 existing notations in the fifth column (remember that in Emacs, the
8169 columns start at 0). The values of the fifth column, in priority
8170 order, are: @samp{-} if the message has been replied to, @samp{t} if
8171 an address in the @samp{To:} field matches one of the mailboxes of the
8172 current user, @samp{c} if the @samp{Cc:} field matches, @samp{b} if
8173 the @samp{Bcc:} field matches, and @samp{n} if a non-empty
8174 @samp{Newsgroups:} field is present.
8176 @cindex @command{scan}
8177 @cindex MH commands, @command{scan}
8178 @vindex mh-progs
8179 @vindex mh-scan-prog
8181 The name of the program that generates a listing of one line per
8182 message is held in @code{mh-scan-prog} (default: @code{"scan"}).
8183 Unless this variable contains an absolute pathname, it is assumed to
8184 be in the @code{mh-progs} directory (@pxref{Getting Started}). You may
8185 link another program to @command{scan} (see @samp{mh-profile}(5)) to
8186 produce a different type of listing@footnote{See the section
8187 @uref{@value{MH-BOOK-HOME}/faswsprs.html, Find and Specify with scan
8188 pick Ranges Sequences} in the MH book.}.
8190 @cindex regular expressions, scan line formats
8191 @findex mh-set-cmd-note
8192 @findex setq
8194 If you change the format of the scan lines you'll need to tell MH-E
8195 how to parse the new format. As you will see, quite a lot of variables
8196 are involved to do that. Use @kbd{M-x apropos @key{RET}
8197 mh-scan.*regexp @key{RET}} to obtain a list of these variables. You
8198 will also have to call @code{mh-set-cmd-note} if your notations are
8199 not in column 4 (columns in Emacs start with 0). Note that unlike most
8200 of the user options described in this manual, these are variables and
8201 must be set with @code{setq} instead of in a customization buffer. For
8202 help with regular expressions, see
8203 @ifnothtml
8204 @ref{Regexps, , Syntax of Regular Expressions, emacs, The
8205 GNU Emacs Manual}.
8206 @end ifnothtml
8207 @ifhtml
8208 section
8209 @uref{https://www.gnu.org/software/emacs/manual/html_node/emacs/Regexps.html,
8210 Syntax of Regular Expressions} in @cite{The GNU Emacs Manual}.
8211 @end ifhtml
8213 The first variable has to do with pruning out garbage.
8215 @vtable @code
8216 @cindex @command{inc}
8217 @cindex MH commands, @command{inc}
8218 @cindex @command{scan}
8219 @cindex MH commands, @command{scan}
8220 @item mh-scan-valid-regexp
8221 This regular expression describes a valid scan line. This is used to
8222 eliminate error messages that are occasionally produced by
8223 @command{inc}@footnote{See the section
8224 @uref{@value{MH-BOOK-HOME}/reapre.html, Reading Mail: inc show next
8225 prev} in the MH book.} or @command{scan} (default: @code{"^ *[0-9]"}).
8226 @end vtable
8228 Next, many variables control how the scan lines are parsed.
8230 @vtable @code
8231 @vindex mh-folder-body
8232 @vindex mh-folder-font-lock-keywords
8233 @item mh-scan-body-regexp
8234 This regular expression matches the message body fragment. Note that
8235 the default setting of @code{mh-folder-font-lock-keywords} expects
8236 this expression to contain at least one parenthesized expression which
8237 matches the body text as in the default of
8238 @code{"\\(<<\\([^\n]+\\)?\\)"}. If this regular expression is not
8239 correct, the body fragment will not be highlighted with the face
8240 @code{mh-folder-body}.
8241 @c -------------------------
8242 @vindex mh-folder-cur-msg-number
8243 @vindex mh-folder-font-lock-keywords
8244 @vindex mh-note-cur
8245 @item mh-scan-cur-msg-number-regexp
8246 This regular expression matches the current message. It must match
8247 from the beginning of the line. Note that the default setting of
8248 @code{mh-folder-font-lock-keywords} expects this expression to contain
8249 at least one parenthesized expression which matches the message number
8250 as in the default of @w{@code{"^\\( *[0-9]+\\+\\).*"}}. This
8251 expression includes the leading space and current message marker
8252 @samp{+} within the parenthesis since it looks better to highlight
8253 these items as well. The highlighting is done with the face
8254 @code{mh-folder-cur-msg-number}. This regular expression should be
8255 correct as it is needed by non-fontification functions. See also
8256 @code{mh-note-cur}.
8257 @c -------------------------
8258 @vindex mh-folder-date
8259 @vindex mh-folder-font-lock-keywords
8260 @vindex mh-scan-sent-to-me-sender-regexp
8261 @item mh-scan-date-regexp
8262 This regular expression matches a valid date. It must @strong{not} be
8263 anchored to the beginning or the end of the line. Note that the
8264 default setting of @code{mh-folder-font-lock-keywords} expects this
8265 expression to contain only one parenthesized expression which matches
8266 the date field as in the default of
8267 @code{"\\([0-9][0-9]/[0-9][0-9]\\)"}. If this regular expression is
8268 not correct, the date will not be highlighted with the face
8269 @code{mh-folder-date}.
8270 @c -------------------------
8271 @vindex mh-folder-deleted
8272 @vindex mh-folder-font-lock-keywords
8273 @vindex mh-note-deleted
8274 @item mh-scan-deleted-msg-regexp
8275 This regular expression matches deleted messages. It must match from
8276 the beginning of the line. Note that the default setting of
8277 @code{mh-folder-font-lock-keywords} expects this expression to contain
8278 at least one parenthesized expression which matches the message number
8279 as in the default of @code{"^\\( *[0-9]+\\)D"}. This expression
8280 includes the leading space within the parenthesis since it looks
8281 better to highlight it as well. The highlighting is done with the face
8282 @code{mh-folder-deleted}. This regular expression should be correct as
8283 it is needed by non-fontification functions. See also
8284 @code{mh-note-deleted}.
8285 @c -------------------------
8286 @vindex mh-folder-font-lock-keywords
8287 @vindex mh-folder-msg-number
8288 @item mh-scan-good-msg-regexp
8289 This regular expression matches ``good'' messages. It must match from
8290 the beginning of the line. Note that the default setting of
8291 @code{mh-folder-font-lock-keywords} expects this expression to contain
8292 at least one parenthesized expression which matches the message number
8293 as in the default of @w{@code{"^\\( *[0-9]+\\)[^D^0-9]"}}. This
8294 expression includes the leading space within the parenthesis since it
8295 looks better to highlight it as well. The highlighting is done with
8296 the face @code{mh-folder-msg-number}. This regular expression should
8297 be correct as it is needed by non-fontification functions.
8298 @c -------------------------
8299 @vindex mh-scan-format-file
8300 @item mh-scan-msg-format-regexp
8301 This regular expression finds the message number width in a scan
8302 format. Note that the message number must be placed in a parenthesized
8303 expression as in the default of @code{"%\\([0-9]*\\)(msg)"}. This
8304 variable is only consulted if @code{mh-scan-format-file} is set to
8305 @samp{Use MH-E scan Format}.
8306 @c -------------------------
8307 @vindex mh-scan-format-file
8308 @item mh-scan-msg-format-string
8309 This is a format string for the width of the message number in a scan
8310 format. Use @samp{0%d} for zero-filled message numbers. This variable
8311 is only consulted if @code{mh-scan-format-file} is set to @samp{Use
8312 MH-E scan Format} (default: @code{"%d"}).
8313 @c -------------------------
8314 @item mh-scan-msg-number-regexp
8315 This regular expression extracts the message number. It must match
8316 from the beginning of the line. Note that the message number must be
8317 placed in a parenthesized expression as in the default of @w{@code{"^
8318 *\\([0-9]+\\)"}}.
8319 @c -------------------------
8320 @item mh-scan-msg-overflow-regexp
8321 This regular expression matches overflowed message numbers (default:
8322 @code{"^[?0-9][0-9]"}).
8323 @c -------------------------
8324 @item mh-scan-msg-search-regexp
8325 This regular expression matches a particular message. It is a format
8326 string; use @samp{%d} to represent the location of the message number
8327 within the expression as in the default of @code{"^[^0-9]*%d[^0-9]"}.
8328 @c -------------------------
8329 @vindex mh-folder-address
8330 @vindex mh-folder-font-lock-keywords
8331 @vindex mh-folder-to
8332 @item mh-scan-rcpt-regexp
8333 This regular expression specifies the recipient in messages you sent.
8334 Note that the default setting of @code{mh-folder-font-lock-keywords}
8335 expects this expression to contain two parenthesized expressions. The
8336 first is expected to match the @samp{To:} that the default scan format
8337 file generates. The second is expected to match the recipient's name
8338 as in the default of @code{"\\(To:\\)\\(..............\\)"}. If this
8339 regular expression is not correct, the @samp{To:} string will not be
8340 highlighted with the face @code{mh-folder-to} and the recipient will not be
8341 highlighted with the face @code{mh-folder-address}.
8342 @c -------------------------
8343 @vindex mh-folder-font-lock-keywords
8344 @vindex mh-folder-refiled
8345 @vindex mh-note-refiled
8346 @item mh-scan-refiled-msg-regexp
8347 This regular expression matches refiled messages. It must match from
8348 the beginning of the line. Note that the default setting of
8349 @code{mh-folder-font-lock-keywords} expects this expression to contain
8350 at least one parenthesized expression which matches the message number
8351 as in the default of @w{@code{"^\\( *[0-9]+\\)\\^"}}. This expression
8352 includes the leading space within the parenthesis since it looks
8353 better to highlight it as well. The highlighting is done with the face
8354 @code{mh-folder-refiled}. This regular expression should be correct as
8355 it is needed by non-fontification functions. See also
8356 @code{mh-note-refiled}.
8357 @c -------------------------
8358 @vindex mh-folder-font-lock-keywords
8359 @vindex mh-folder-sent-to-me-sender
8360 @vindex mh-mh-folder-sent-to-me-hint
8361 @vindex mh-scan-format-nmh
8362 @item mh-scan-sent-to-me-sender-regexp
8363 This regular expression matches messages sent to us. Note that the
8364 default setting of @code{mh-folder-font-lock-keywords} expects this
8365 expression to contain at least two parenthesized expressions. The
8366 first should match the fontification hint (see
8367 @code{mh-scan-format-nmh}) and the second should match the user name
8368 as in the default of
8369 @w{@code{"^ *[0-9]+.\\([bct]\\).....[ ]*\\(..................\\)"}}.
8370 If this regular expression is not correct, the notation hints will not
8371 be highlighted with the face @code{mh-mh-folder-sent-to-me-hint} and
8372 the sender will not be highlighted with the face
8373 @code{mh-folder-sent-to-me-sender}.
8374 @c -------------------------
8375 @vindex mh-folder-followup
8376 @vindex mh-folder-font-lock-keywords
8377 @vindex mh-folder-subject
8378 @item mh-scan-subject-regexp
8379 This regular expression matches the subject. It must match from the
8380 beginning of the line. Note that the default setting of
8381 @samp{mh-folder-font-lock-keywords} expects this expression to contain
8382 at least three parenthesized expressions. The first is expected to
8383 match the @samp{Re:} string, if any, and is highlighted with the face
8384 @code{mh-folder-followup}. The second matches an optional bracketed
8385 number after @samp{Re:}, such as in @samp{Re[2]:} (and is thus a
8386 sub-expression of the first expression). The third is expected to
8387 match the subject line itself which is highlighted with the face
8388 @code{mh-folder-subject}. For example, the default is
8389 @w{@code{"^ *[0-9]+........[ ]*...................}}@*
8390 @w{@code{\\([Rr][Ee]\\(\\[[0-9]+\\]\\)?:\\s-*\\)*\\([^<\n]*\\)"}}.
8391 This regular expression should be correct as it is needed by
8392 non-fontification functions. Note that this example is broken up on
8393 two lines for readability, but is actually a single string.
8394 @end vtable
8396 Finally, there are a slew of variables that control how MH-E annotates
8397 the scan lines.
8399 @vtable @code
8400 @findex mh-set-cmd-note
8401 @vindex mh-adaptive-cmd-note-flag
8402 @item mh-cmd-note
8403 Column for notations (default: 4). This variable should be set with
8404 the function @code{mh-set-cmd-note}. This variable may be updated
8405 dynamically if @code{mh-adaptive-cmd-note-flag} is on. The following
8406 variables contain the notational characters. Note that columns in
8407 Emacs start with 0.
8408 @c -------------------------
8409 @item mh-note-copied
8410 Messages that have been copied are marked by this character (default:
8411 @code{?C}).
8412 @c -------------------------
8413 @vindex mh-scan-cur-msg-number-regexp
8414 @item mh-note-cur
8415 The current message (in MH, not in MH-E) is marked by this character
8416 (default: @code{?+}). See also @code{mh-scan-cur-msg-number-regexp}.
8417 @c -------------------------
8418 @vindex mh-scan-deleted-msg-regexp
8419 @item mh-note-deleted
8420 Messages that have been deleted are marked by this character (default:
8421 @code{?D}). See also @code{mh-scan-deleted-msg-regexp}.
8422 @c -------------------------
8423 @item mh-note-dist
8424 Messages that have been redistributed are marked by this character
8425 (default: @code{?R}).
8426 @c -------------------------
8427 @item mh-note-forw
8428 Messages that have been forwarded are marked by this character
8429 (default: @code{?F}).
8430 @c -------------------------
8431 @item mh-note-printed
8432 Messages that have been printed are marked by this character (default:
8433 @code{?P}).
8434 @c -------------------------
8435 @vindex mh-scan-refiled-msg-regexp
8436 @item mh-note-refiled
8437 Messages that have been refiled are marked by this character (default:
8438 @code{?^}). See also @code{mh-scan-refiled-msg-regexp}.
8439 @c -------------------------
8440 @item mh-note-repl
8441 Messages that have been replied to are marked by this character
8442 (default: @code{?-}).
8443 @c -------------------------
8444 @item mh-note-seq
8445 Messages in a user-defined sequence are marked by this character
8446 (default: @code{?%}). Messages in the @samp{search} sequence are
8447 marked by this character as well.
8448 @end vtable
8450 For example, let's say I have the following in @file{scan.format}
8451 which displays the sender, the subject, and the message number. This
8452 format places a @samp{+} after the message number for the current
8453 message according to MH; it also uses that column for notations.
8455 @smallexample
8456 %20(decode(friendly@{from@})) %50(decode@{subject@})  %4(msg)%<(cur)+%| %>
8457 @end smallexample
8459 @vindex mh-adaptive-cmd-note-flag
8460 @vindex mh-scan-format-file
8461 @vindex mh-scan-format-file@r{, example}
8463 The first thing you have to do is tell MH-E to use this file.
8464 Customize @code{mh-scan-format-file} and set its value to @samp{Use
8465 Default scan Format}. If you didn't get already turn off
8466 @code{mh-adaptive-cmd-note-flag}, you'll need to do that first.
8468 Next, tell MH-E what a valid scan line looks like so that you can at
8469 least display the output of scan in your MH-Folder buffer.
8471 @vindex mh-scan-valid-regexp@r{, example}
8473 @smalllisp
8474 (setq mh-scan-valid-regexp "[0-9]+[+D^ ]$")
8475 @end smalllisp
8477 Now, in order to get rid of the @samp{Cursor not pointing to message}
8478 message, you need to tell MH-E how to access the message number. You
8479 should also see why MH-E requires that you include a message number in
8480 the first place.
8482 @vindex mh-scan-msg-number-regexp@r{, example}
8483 @vindex mh-scan-msg-search-regexp@r{, example}
8485 @smalllisp
8486 (setq mh-scan-msg-number-regexp "^.* \\([0-9]+\\)[+D^ ]$")
8487 (setq mh-scan-msg-search-regexp " %d[+D^ ]$")
8488 @end smalllisp
8490 In order to get the next and previous commands working, add this.
8492 @vindex mh-scan-good-msg-regexp@r{, example}
8494 @smalllisp
8495 (setq mh-scan-good-msg-regexp "^.* \\([0-9]+\\)[+D^ ]$")
8496 @end smalllisp
8498 Note that the current message isn't marked with a @samp{+} when moving
8499 between the next and previous messages. Here is the code required to
8500 get this working.
8502 @vindex set-mh-cmd-note@r{, example}
8503 @vindex mh-scan-cur-msg-number-regexp@r{, example}
8505 @smalllisp
8506 (set-mh-cmd-note 76)
8507 (setq mh-scan-cur-msg-number-regexp "^.* \\([0-9]+\\)\\+$")
8508 @end smalllisp
8510 Finally, add the following to delete and refile messages.
8512 @vindex mh-scan-deleted-msg-regexp@r{, example}
8513 @vindex mh-scan-refiled-msg-regexp@r{, example}
8515 @smalllisp
8516 (setq mh-scan-deleted-msg-regexp "^.* \\([0-9]+\\)D$")
8517 (setq mh-scan-refiled-msg-regexp "^.* \\([0-9]+\\)\\^$")
8518 @end smalllisp
8520 This is just a bare minimum; it's best to adjust all of the regular
8521 expressions to ensure that MH-E and highlighting perform well.
8523 @node Procmail, Odds and Ends, Scan Line Formats, Top
8524 @appendix Reading Mailing Lists Effectively
8526 @cindex @command{procmail}
8527 @cindex @command{slocal}
8528 @cindex Gnus
8529 @cindex MH commands, @command{slocal}
8530 @cindex Unix commands, @command{procmail}
8531 @cindex mailing lists, reading
8533 This appendix explains how to use @uref{http://www.procmail.org/,
8534 procmail} to file mail from mailing lists into folders which can then
8535 be read easily with MH-E@footnote{The MH equivalent, @command{slocal},
8536 can be used as well, but procmail is more flexible and more packages
8537 exist for procmail than for slocal.}. Some mailing lists have such
8538 high traffic that Gnus must be used and I discuss how to use Gnus
8539 side-by-side with MH-E.
8541 @cindex @file{.procmailrc}
8542 @cindex files, @file{.procmailrc}
8544 First, I'll describe how to put mail from your mailing lists directly
8545 into an MH folder using @command{procmail}. First, add the following
8546 to @file{~/.procmailrc}. While the logging variables aren't strictly
8547 necessary, they are extremely useful.
8549 @smallexample
8550 [1]  # Update PATH so procmail can find myrcvstore, rcvstore and mhparam.
8551 [2]  PATH=$PATH:/usr/lib/mh:/usr/bin/mh:$HOME/bin
8553 [4]  # Point LOGFILE at the actual log file.
8554 [5]  LOGFILE=$HOME/.procmail.log
8556 [7]  # This setting provides just the right amount of information.
8557 [8]  LOGABSTRACT=all
8559 [10] # Uncomment the following line to see how your patterns match.
8560 [11] #VERBOSE=yes
8561 [12]
8562 [13] # Place mail sent to any MH-E mailing list in +mh-e.
8563 [14] :0 w: mh-e$LOCKEXT
8564 [15] * ^TO.*mh-e-.*@@.*sourceforge.net
8565 [16] | myrcvstore -create +mh-e
8566 @end smallexample
8568 @cindex @command{rcvstore}
8569 @cindex MH commands, @command{rcvstore}
8571 Line 14 creates a lock file in your mail directory based upon the name
8572 of the folder. This is done because @command{rcvstore} does not
8573 perform locking. While this lock file will prevent @command{procmail}
8574 from writing to a folder concurrently, there is a slight chance that
8575 you might lose a message if you're performing operations on a folder
8576 at the same time @command{rcvstore} is placing a message there. You
8577 have been warned. Now that that disclaimer is out of the way, note
8578 that I've been using this set-up for over a decade and haven't lost
8579 anything to my knowledge@footnote{See
8580 @uref{https://savannah.nongnu.org/bugs/?func=detailbug&bug_id=4361&group_id=2166,
8581 Savannah issue #4361} to see if @command{rcvstore} locking is still an
8582 issue.}.
8584 @cindex @samp{Unseen-Sequence} MH profile component
8585 @cindex MH profile component, @samp{Unseen-Sequence}
8587 Line 16 uses the following script, @code{myrcvstore}, to massage the
8588 message as described in the comment and file the message in the given
8589 folder@footnote{The @samp{-create} argument wasn't always the default
8590 to @command{rcvstore}.}.
8592 @smallexample
8593 #! /bin/sh
8595 # Accepts a message on standard input and passes it through rcvstore
8596 # after first passing it through any filters. All arguments are passed
8597 # on to rcvstore.
8599 # Force the "From user date" to become part of header. One reason this
8600 # is done is because the presence of the From field confuses dist so
8601 # that dist adds a new header, rather than using the existing header.
8602 # Note that this should not be done for any message that goes into a
8603 # Gnus incoming file (Gnus will thrown an error) nor should it be
8604 # applied to any message that goes to the system mailbox because the
8605 # entire mailbox will be incorporated as a single message.
8606 formail -c -z -R 'From ' X-Envelope-From: |
8607 rcvstore $@@
8608 @end smallexample
8610 If your version of @command{rcvstore} doesn't add messages to the
8611 @samp{unseen} sequence by default, add the following line to your MH
8612 profile:
8614 @smallexample
8615 Unseen-Sequence: unseen
8616 @end smallexample
8618 Now view your new messages with the speedbar (@pxref{Speedbar}) or with
8619 @kbd{F n} (@code{mh-index-new-messages}). @xref{Folders}.
8621 If you're on a mailing list that is so voluminous that it is
8622 impossible to read every message, it usually better to read the
8623 mailing list like a newsgroup in a news reader. Emacs has a built-in
8624 newsreader called Gnus. The remainder of this appendix talks about how
8625 to use Gnus with an MH message store. The version of Gnus that was
8626 used to prepare this manual was 5.10. Versions 5.8 through 5.10 should
8627 work but versions prior to 5.8 use different options.
8629 This table contains a list of Gnus options that you will have to
8630 modify. Note that for them to become accessible, you'll have to load
8631 @file{nnml.el} first. This can be done with @kbd{M-x load-library
8632 @key{RET} nnml @key{RET}}.
8634 @vtable @code
8635 @item gnus-secondary-select-methods
8636 Select the @samp{nnml} value. This select method uses directories for
8637 folders and individual files for messages, just like MH@. You do not
8638 have to set an address.
8639 @c -------------------------
8640 @item mail-sources
8641 Select the @samp{Several files in a directory} value, check the
8642 @samp{Path} box and enter @file{~/Mail} to tell Gnus where to find
8643 your mail.
8644 @c -------------------------
8645 @vindex mail-user-agent
8646 @item message-mail-user-agent
8647 In order to send mail within Gnus using MH-E, set this option to
8648 @samp{mail-user-agent} and set the @code{mail-user-agent} option to
8649 @samp{Emacs interface to MH}.
8650 @c -------------------------
8651 @item nnmail-keep-last-article
8652 Since Gnus keeps track of which messages you have read, it would be
8653 bad if Gnus expired the last message, for example, message 100, and
8654 @command{rcvstore} gave the next new message number 1. Gnus would then
8655 ignore it since it thinks that you've read messages 1--100. Turning on
8656 this option ensures that the last message is never removed thereby
8657 eliminating this problem.
8658 @end vtable
8660 Next add the following to @file{~/.procmailrc}. If you don't subscribe
8661 to the GnuCash mailing list, substitute one to which you are
8662 subscribed.
8664 @smallexample
8665 PATH=$PATH:/usr/bin/mh
8666 MAILDIR=$HOME/`mhparam Path`
8667 # Place mail sent to the GnuCash mailing list in gnucash.spool, where
8668 # Gnus will pick it up.
8670 * ^TO.*gnucash.*@@.*gnucash.org
8671 gnucash.spool
8672 @end smallexample
8674 Wait for some messages to appear in @file{gnucash.spool} and run Gnus
8675 with @kbd{M-x gnus @key{RET}}. To view the folder created in the
8676 example above, you would tell Gnus about it the first time only with
8677 @kbd{G m gnucash @key{RET} nnml @key{RET}}. In MH-E, this folder is
8678 known as @samp{+gnucash}.
8680 @node Odds and Ends, History, Procmail, Top
8681 @appendix Odds and Ends
8683 This appendix covers a few topics that don't fit elsewhere. Here I
8684 tell you how to report bugs and how to get on the MH-E mailing lists.
8685 I also point out some additional sources of information.
8687 @menu
8688 * Bug Reports::
8689 * Mailing Lists::
8690 * MH FAQ and Support::
8691 * Getting MH-E::
8692 @end menu
8694 @node Bug Reports, Mailing Lists, Odds and Ends, Odds and Ends
8695 @appendixsec Bug Reports
8697 @cindex bugs
8698 @cindex SourceForge
8699 @findex mh-version
8701 Bug reports should be filed at
8702 @uref{https://sourceforge.net/p/mh-e/bugs/, SourceForge}. You need to
8703 be a SourceForge user to submit bug reports, but this is easy enough
8704 to do that it shouldn't be a restriction for you. Please include the
8705 output of @kbd{M-x mh-version} (@pxref{Miscellaneous}) in any bug
8706 report you send unless you're 110% positive we won't ask for it.
8708 @node Mailing Lists, MH FAQ and Support, Bug Reports, Odds and Ends
8709 @appendixsec MH-E Mailing Lists
8711 @cindex SourceForge
8712 @cindex mailing lists
8714 There are several mailing lists for MH-E@. They are @i{mh-e-users at
8715 lists.sourceforge.net}, @i{mh-e-announce at lists.sourceforge.net},
8716 and @i{mh-e-devel at lists.sourceforge.net}. You can subscribe or view
8717 the archives at @uref{https://sourceforge.net/p/mh-e/mailman/,
8718 SourceForge}. Do not report bugs on these lists; please submit them
8719 via SourceForge (@pxref{Bug Reports}).
8721 @node MH FAQ and Support, Getting MH-E, Mailing Lists, Odds and Ends
8722 @appendixsec MH FAQ and Support
8724 @cindex FAQ
8725 @cindex MH FAQ
8727 The article @uref{http://www.newt.com/faq/mh.html, @cite{MH Frequently
8728 Asked Questions (FAQ) with Answers}} appears monthly in the newsgroup
8729 @samp{comp.mail.mh}. While very little is there that deals with MH-E
8730 specifically, there is an incredible wealth of material about MH
8731 itself which you will find useful.
8733 @cindex support
8735 You can find FAQs on MH-E by searching for @i{labels:support} on the
8736 @uref{https://sourceforge.net/p/mh-e/bugs/search/?q=labels%3Asupport,
8737 Tickets} page on SourceForge. If you don't find the answer to your
8738 question, file a ticket and your question will become a new FAQ!
8740 @node Getting MH-E,  , MH FAQ and Support, Odds and Ends
8741 @appendixsec Getting MH-E
8743 @cindex MH-E, obtaining
8744 @cindex getting MH-E
8745 @cindex obtaining MH-E
8747 Because MH-E is undergoing a phase of sustained growth, the version of
8748 MH-E in your Emacs is likely to be out of date although it is most
8749 likely to be more up to date than the copy that comes with the MH
8750 distribution in @file{miscellany/mh-e}.
8752 @cindex change log
8753 @cindex release notes
8755 New MH-E releases are always available for downloading at
8756 @uref{https://sourceforge.net/projects/mh-e/files/, SourceForge}
8757 before they appear in an Emacs release. You can read the release notes
8758 on that page to determine if the given release of MH-E is already
8759 installed in your version of Emacs. You can also read the change log
8760 to see if you are interested in what the given release of MH-E has to
8761 offer (although we have no doubt that you will be extremely interested
8762 in all new releases).
8764 @cindex Debian
8766 If you use Debian, you can install the Debian
8767 @uref{http://packages.debian.org/unstable/mail/mh-e, mh-e package}
8768 instead.
8770 @cindex files, @samp{MH-E-NEWS}
8771 @cindex files, @samp{README}
8772 @cindex news
8773 @cindex @samp{MH-E-NEWS}
8774 @cindex @samp{README}
8775 @findex mh-version
8777 After you download and extract the MH-E tarball, read the
8778 @file{README} file and @file{MH-E-NEWS}. These correspond to the
8779 release notes and change log mentioned above. The file @file{README}
8780 contains instructions on installing MH-E@. If you're already running
8781 Emacs, please quit that session and start again to load in the new
8782 MH-E@. Check that you're running the new version with the command
8783 @kbd{M-x mh-version}.
8785 @cindex contributed software
8786 @cindex manual
8787 @cindex documentation
8789 In addition to the mh-e package, the
8790 @uref{https://sourceforge.net/projects/mh-e/files/, SourceForge} site
8791 also contains doc and contrib packages. The former is the latest
8792 release of this manual, and the latter contains a few contributed
8793 packages you might find useful.
8795 @node History, GFDL, Odds and Ends, Top
8796 @appendix History of MH-E
8798 @cindex Bill Wohler
8799 @cindex Brian Reid
8800 @cindex Gildea, Stephen
8801 @cindex Jim Larus
8802 @cindex Larus, Jim
8803 @cindex MH-E, versions
8804 @cindex Reid, Brian
8805 @cindex SourceForge
8806 @cindex Stephen Gildea
8807 @cindex Wohler, Bill
8808 @cindex history of MH-E
8809 @cindex versions of MH-E
8811 MH-E was originally written by Brian Reid in 1983 and has changed
8812 hands several times since then. Jim Larus wanted to do something
8813 similar for GNU Emacs, and ended up completely rewriting it that same
8814 year. In 1989, Stephen Gildea picked it up and added many
8815 improvements. Bill Wohler then took over in 2000 and moved its
8816 development to @uref{http://sourceforge.net/, SourceForge} where it
8817 lives today.
8819 @menu
8820 * From Brian Reid::
8821 * From Jim Larus::
8822 * From Stephen Gildea::
8823 * From Bill Wohler::
8824 @end menu
8826 @node From Brian Reid, From Jim Larus, History, History
8827 @appendixsec From Brian Reid
8829 @cindex Brian Reid
8830 @cindex Reid, Brian
8832 One day in 1983 I got the flu and had to stay home from work for three
8833 days with nothing to do. I used that time to write MHE@. The
8834 fundamental idea behind MHE was that it was a ``puppeteer'' driving
8835 the MH programs underneath it. MH had a model that the editor was
8836 supposed to run as a sub-process of the mailer, which seemed to me at
8837 the time to be the tail wagging the dog. So I turned it around and
8838 made the editor drive the MH programs. I made sure that the UCI people
8839 (who were maintaining MH at the time) took in my changes and made them
8840 stick.
8842 Today, I still use my own version of MHE because I don't at all like
8843 the way that GNU MH-E works and I've never gotten to be good enough at
8844 hacking Emacs Lisp to make GNU MH-E do what I want. The Gosling-emacs
8845 version of MHE and the GNU Emacs version of MH-E have almost nothing
8846 in common except similar names. They work differently, have different
8847 conceptual models, and have different key bindings@footnote{After
8848 reading this article, I questioned Brian about his version of MHE, and
8849 received some great ideas for improving MH-E such as a dired-like
8850 method of selecting folders; and removing the prompting when sending
8851 mail, filling in the blanks in the draft buffer instead. I passed them
8852 on to Stephen Gildea, the current maintainer, and he was excited about
8853 the ideas as well. Perhaps one day, MH-E will again resemble MHE
8854 (draft form editing was introduced in version 7.4).}.
8856 Brian Reid, June 1994
8858 @node From Jim Larus, From Stephen Gildea, From Brian Reid, History
8859 @appendixsec From Jim Larus
8861 @cindex Jim Larus
8862 @cindex Larus, Jim
8864 Brian Reid, while at CMU or shortly after going to Stanford wrote a
8865 mail reading program called MHE for Gosling Emacs. It had much the
8866 same structure as MH-E (i.e., invoked MH programs), though it was
8867 simpler and the commands were slightly different. Unfortunately, I no
8868 longer have a copy so the differences are lost in the mists of time.
8870 In '82--83, I was working at BBN and wrote a lot of mlisp code in
8871 Gosling Emacs to make it look more like Tennex Emacs. One of the
8872 packages that I picked up and improved was Reid's mail system. In '83,
8873 I went back to Berkeley. About that time, Stallman's first version of
8874 GNU Emacs came out and people started to move to it from Gosling Emacs
8875 (as I recall, the transition took a year or two). I decided to port
8876 Reid's MHE and used the mlisp to Emacs Lisp translator that came with
8877 GNU Emacs. It did a lousy job and the resulting code didn't work, so I
8878 bit the bullet and rewrote the code by hand (it was a lot smaller and
8879 simpler then, so it took only a day or two).
8881 Soon after that, MH-E became part of the standard Emacs distribution
8882 and suggestions kept dribbling in for improvements. MH-E soon reached
8883 sufficient functionality to keep me happy, but I kept on improving it
8884 because I was a graduate student with plenty of time on my hands and
8885 it was more fun than my dissertation. In retrospect, the one thing
8886 that I regret is not writing any documentation, which seriously
8887 limited the use and appeal of the package.
8889 @cindex @command{xmh}, in MH-E history
8891 In '89, I came to Wisconsin as a professor and decided not to work on
8892 MH-E@. It was stable, except for minor bugs, and had enough
8893 functionality, so I let it be for a few years. Stephen Gildea of BBN
8894 began to pester me about the bugs, but I ignored them. In 1990, he
8895 went off to the X Consortium, said good bye, and said that he would
8896 now be using @command{xmh}. A few months later, he came back and said
8897 that he couldn't stand @command{xmh} and could I put a few more bug fixes
8898 into MH-E@. At that point, I had no interest in fixing MH-E, so I gave
8899 the responsibility of maintenance to him and he has done a fine job
8900 since then.
8902 Jim Larus, June 1994
8904 @node From Stephen Gildea, From Bill Wohler, From Jim Larus, History
8905 @appendixsec From Stephen Gildea
8907 @cindex Gildea, Stephen
8908 @cindex Stephen Gildea
8910 In 1987 I went to work for Bolt Beranek and Newman, as Jim had before
8911 me. In my previous job, I had been using RMAIL, but as my folders tend
8912 to run large, I was frustrated with the speed of RMAIL@. However, I
8913 stuck with it because I wanted the GNU Emacs interface. I am very
8914 familiar and comfortable with the Emacs interface (with just a few
8915 modifications of my own) and dislike having to use applications with
8916 embedded editors; they never live up to Emacs.
8918 MH is the mail reader of choice at BBN, so I converted to it. Since I
8919 didn't want to give up using an Emacs interface, I started using MH-E@.
8920 As is my wont, I started hacking on it almost immediately. I first
8921 used version 3.4m. One of the first features I added was to treat the
8922 folder buffer as a file-visiting buffer: you could lock it, save it,
8923 and be warned of unsaved changes when killing it. I also worked to
8924 bring its functionality a little closer to RMAIL@. Jim Larus was very
8925 cooperative about merging in my changes, and my efforts first appeared
8926 in version 3.6, distributed with Emacs 18.52 in 1988. Next I decided
8927 MH-E was too slow and optimized it a lot. Version, 3.7, distributed
8928 with Emacs 18.56 in 1990, was noticeably faster.
8930 When I moved to the X Consortium I became the first person there to
8931 not use xmh. (There is now one other engineer there using MH-E@.) About
8932 this point I took over maintenance of MH-E from Jim and was finally
8933 able to add some features Jim hadn't accepted, such as the backward
8934 searching undo. My first release was 3.8 (Emacs 18.58) in 1992.
8936 Now, in 1994, we see a flurry of releases, with both 4.0 and 5.0.
8937 Version 4.0 added many new features, including background folder
8938 collection and support for composing @sc{mime} messages. (Reading
8939 @sc{mime} messages remains to be done, alas.) While writing this book,
8940 Bill Wohler gave MH-E its closest examination ever, uncovering bugs
8941 and inconsistencies that required a new major version to fix, and so
8942 version 5 was released.
8944 Stephen Gildea, June 1994
8946 @node From Bill Wohler,  , From Stephen Gildea, History
8947 @appendixsec From Bill Wohler
8949 @cindex Wohler, Bill
8950 @cindex Bill Wohler
8952 The preface originally included the following text which I use to
8953 begin my story:
8955 @quotation
8956 But it's important to note a brief history of MH-E.
8958 @w{Version 3} was prevalent through the @w{Emacs 18} and early
8959 @w{Emacs 19} years. Then @w{Version 4} came out (@w{Emacs 19.23}),
8960 which introduced several new and changed commands. Next, @w{Version
8961 5.0} was released, which fixed some bugs and incompatibilities, and
8962 was incorporated into @w{Emacs 19.29}.
8963 @end quotation
8965 After a long break, Stephen handed the reins over to me in 2000. I
8966 moved the project to a new site called SourceForge and organized a
8967 great team of developers. Our first release in late 2001 was version
8968 6. It appeared around the time of Emacs 21.2 and had menus and tool
8969 bar buttons.
8971 Then, indexed searches, improved MIME handling, a speedbar, multiple
8972 identities, alias completion, an index view of unseen messages, spam
8973 software support, Face and X-Image-URL header field support, Fcc
8974 completion, arbitrary range handling, and draft form editing were
8975 introduced in the version 7 series around the time of Emacs 21.4
8976 (2004). Still, Emacs itself contained version 5 of MH-E released back
8977 in 1994.
8979 Version 8 development was mostly driven by the rewrite of the manual.
8980 It also brought GNU mailutils MH support, S/MIME support, picon
8981 support, and an improved interface for hiding header fields. The CVS
8982 repository was migrated from SourceForge to Savannah (only for those
8983 files that were already part of Emacs) and the software was completely
8984 reorganized to push back two decades of entropy. Version 8 appeared in
8985 Emacs 22.1 in 2006.
8987 Development was then quiet for a couple of years. Emacs 23.1, which is
8988 due out in 2009, will contain version 8.1. This version includes a few
8989 new features and several bug fixes.
8991 Bill Wohler, August 2008
8993 @node GFDL, GPL, History, Top
8994 @appendix GNU Free Documentation License
8995 @include doclicense.texi
8997 @node GPL, Key Index, GFDL, Top
8998 @appendix GNU General Public License
8999 @include gpl.texi
9001 @node Key Index, Command Index, GPL, Top
9002 @unnumbered Key (Character) Index
9003 @printindex ky
9005 @node Command Index, Option Index, Key Index, Top
9006 @unnumbered Command Index
9007 @printindex fn
9009 @node Option Index, Concept Index, Command Index, Top
9010 @unnumbered Option (Variable) Index
9011 @printindex vr
9013 @node Concept Index,  , Option Index, Top
9014 @unnumbered Concept Index
9015 @printindex cp
9017 @bye
9019 @c Ispell Helpers
9021 @c The following are words that ispell should ignore that would not
9022 @c normally be in a dictionary (global or personal). Be careful not to
9023 @c include words here that could potentially be typos of other words
9024 @c (such as url, elisp, or MHE).
9026 @c LocalWords: CTRL ESC SPC f's
9027 @c LocalWords: addr Aliasfile alist
9028 @c LocalWords: Baushke Bcc BBN Beranek bogofilter bogofilter's
9029 @c LocalWords: cmd CMU contrib cron
9030 @c LocalWords: DesBrisay Dcc devel dir dired docstring filll forw
9031 @c LocalWords: GECOS Gildea Gildea's Ginnean GnuCash goto gnuserv htm
9032 @c LocalWords: ImageMagick inbox ispell keychain
9033 @c LocalWords: Larus licensor LocalWords lookup lpr
9034 @c LocalWords: makeinfo mairix mbox mh mhbuild mhl mhpath mlisp
9035 @c LocalWords: MML msg multipart
9036 @c LocalWords: Namazu NIS nenscript nnml num
9037 @c LocalWords: packmbox passphrase pathname prev procmail prog repl
9038 @c LocalWords: slocal sortm SpamAssassin spammers SpamProbe SpamProbe's
9039 @c LocalWords: sublicense supercite speedbar
9040 @c LocalWords: Tennex texi texinfo Thelen thelenm
9041 @c LocalWords: UCI undeleted whatnow wohler xmh ypcat
9043 @c See http://www.oreilly.com/oreilly/author/stylesheet.html.
9044 @c See http://en.wikipedia.org/.
9046 @c Note the lowercase mh which is needed to avoid hits in the
9047 @c functions and variables. Occasionally, check for accidental
9048 @c inclusion of mh in text by uncommenting the following and executing
9049 @c it with C-x C-e. You want to see "Search failed"
9050 @c   (let ((case-fold-search nil))
9051 @c        (goto-char (point-min))
9052 @c        (search-forward-regexp "^mh\\( \\|$\\)"))
9054 @c An extremely useful setting for texinfo-mode-hook is:
9055 @c   (add-to-list
9056 @c    'ispell-skip-region-alist
9057 @c    (list
9058 @c     (concat "\\(@\\(small\\)?\\(example\\|lisp\\)"
9059 @c             "\\(@\\([irw]\\|code\\|var\\){[^}]+}\\|"
9060 @c             "@[@{}.]\\|"
9061 @c             "[^@]\\|"
9062 @c             "@\\(end \\)?group\\|"
9063 @c             "@\\(end \\)?cartouche\\)+"
9064 @c             "@end \\(small\\)?\\(example\\|lisp\\)\\|"
9065 @c             "@\\(code\\|command\\|file\\|kbd\\|sc\\){[^}]+}\\|"
9066 @c             "^@end [a-z]+$\\|"
9067 @c             "^@\\([fv]\\|print\\)index .*$\\|"
9068 @c             "@uref{[^,]+,\\|"
9069 @c             "@[a-z]+\\|"
9070 @c             "/[a-z.]+[/}]\\)")))))
9072 @c Cross References
9074 @c See existing cross-references to the Emacs manual and the Emacs
9075 @c Lisp manual (search for ``GNU Emacs Manual'' and ``GNU
9076 @c Emacs Lisp Reference Manual'' respectively).
9078 @c @ftable Sorting
9080 @c As per index (sort of): Punctuation, keyboard characters (such as
9081 @c RET and BS) upper and lowercase mixed (lower comes before
9082 @c uppercase), control characters go with uppercase C, meta characters
9083 @c go with uppercase M.
9084 @c In some cases, the sort isn't strictly ASCII.
9085 @c For example, SPC (mh-page-msg) reads better before BS
9086 @c (mh-previous-page) and . (mh-show) is better before ,
9087 @c (mh-header-display).
9089 @c @vtable Sorting
9091 @c Alphabetical, pull hooks into their own table.
9093 @c Local Variables:
9094 @c sentence-end-double-space: nil
9095 @c End: