Merge from emacs-24; up to 2012-12-25T17:37:29Z!eliz@gnu.org
[bpt/emacs.git] / doc / misc / mh-e.texi
1 \input texinfo @c -*- mode: texinfo; coding: utf-8; -*-
2 @c
3 @c Note: This document requires makeinfo version 4.6 or greater to build.
4 @c
5 @c %**start of header
6 @setfilename ../../info/mh-e
7 @settitle The MH-E Manual
8 @c %**end of header
9
10 @c Version of the software and manual.
11 @set VERSION 8.5
12 @c Edition of the manual. It is either empty for the first edition or
13 @c has the form ", nth Edition" (without the quotes).
14 @set EDITION
15 @set UPDATED 2013-03-02
16 @set UPDATE-MONTH March, 2013
17
18 @c Other variables.
19 @set MH-BOOK-HOME http://rand-mh.sourceforge.net/book/mh
20 @set MH-E-HOME http://mh-e.sourceforge.net/
21
22 @c Copyright
23 @copying
24 This is version @value{VERSION}@value{EDITION} of @cite{The MH-E
25 Manual}, last updated @value{UPDATED}.
26
27 Copyright @copyright{} 1995, 2001--2003, 2005--2013 Free Software
28 Foundation, Inc.
29
30 @c This dual license has been agreed upon by the FSF.
31
32 @quotation
33 Permission is granted to copy, distribute and/or modify this document
34 under the terms of either:
35
36 @enumerate a
37 @item
38 the GNU Free Documentation License, Version 1.3 or any later version
39 published by the Free Software Foundation; with no Invariant Sections,
40 with the Front-Cover texts being ``A GNU Manual,'' and with the
41 Back-Cover Texts as in (a) below. A copy of the license is included in
42 the section entitled ``GNU Free Documentation License.''
43
44 (a) The FSF's Back-Cover Text is: ``You have the freedom to copy and
45 modify this GNU manual.''
46
47 @item
48 the GNU General Public License as published by the Free Software
49 Foundation; either version 3, or (at your option) any later version. A
50 copy of the license is included in the section entitled ``GNU General
51 Public License.''
52 @end enumerate
53
54 @end quotation
55 @end copying
56
57 @c Info Directory Entry
58 @dircategory Emacs network features
59 @direntry
60 * MH-E: (mh-e). Emacs interface to the MH mail system.
61 @end direntry
62
63 @c Title Page
64 @titlepage
65 @title The MH-E Manual
66 @subtitle Version @value{VERSION}@value{EDITION}
67 @subtitle @value{UPDATE-MONTH}
68 @author Bill Wohler
69
70 @c Copyright Page
71 @page
72 @vskip 0pt plus 1filll
73 @insertcopying
74 @end titlepage
75
76 @ifnottex
77 @html
78 <!--
79 @end html
80 @node Top, Preface, (dir), (dir)
81 @top The MH-E Manual
82 @html
83 -->
84 @end html
85 @insertcopying
86 @end ifnottex
87
88 @c Table of Contents
89 @contents
90
91 @html
92 <!--
93 @end html
94
95 @menu
96 * Preface:: Preface
97 * Conventions:: GNU Emacs Terms and Conventions
98 * Getting Started:: Getting Started
99 * Tour Through MH-E:: Tour Through MH-E
100 * Using This Manual:: Using This Manual
101 * Incorporating Mail:: Incorporating Mail
102 * Reading Mail:: Reading Mail
103 * Folders:: Organizing Your Mail with Folders
104 * Sending Mail:: Sending Mail
105 * Editing Drafts:: Editing a Draft
106 * Aliases:: Aliases
107 * Identities:: Identities
108 * Speedbar:: The Speedbar
109 * Menu Bar:: The Menu Bar
110 * Tool Bar:: The Tool Bar
111 * Searching:: Searching Through Messages
112 * Threading:: Viewing Message Threads
113 * Limits:: Limiting Display
114 * Sequences:: Using Sequences
115 * Junk:: Dealing With Junk Mail
116 * Miscellaneous:: Miscellaneous Commands, Variables, and Buffers
117 * Scan Line Formats:: Scan Line Formats
118 * Procmail:: Reading Mailing Lists Effectively
119 * Odds and Ends:: Odds and Ends
120 * History:: History of MH-E
121 * GFDL:: GNU Free Documentation License
122 * GPL:: GNU General Public License
123 * Key Index:: Key (Character) Index
124 * Command Index:: Command Index
125 * Option Index:: Option (Variable) Index
126 * Concept Index:: Concept Index
127
128 @detailmenu
129 --- The Detailed Node Listing ---
130
131 Tour Through MH-E
132
133 * Sending Mail Tour::
134 * Reading Mail Tour::
135 * Processing Mail Tour::
136 * Leaving MH-E::
137 * More About MH-E::
138
139 Using This Manual
140
141 * Options::
142 * Ranges::
143 * Folder Selection::
144
145 Reading Your Mail
146
147 * Viewing::
148 * Viewing Attachments::
149 * HTML::
150 * Digests::
151 * Reading PGP::
152 * Printing::
153 * Files and Pipes::
154 * Navigating::
155 * Miscellaneous Commands and Options::
156
157 Sending Mail
158
159 * Composing::
160 * Replying::
161 * Forwarding::
162 * Redistributing::
163 * Editing Again::
164
165 Editing a Draft
166
167 * Editing Message::
168 * Inserting Letter::
169 * Inserting Messages::
170 * Signature::
171 * Picture::
172 * Adding Attachments::
173 * Sending PGP::
174 * Checking Recipients::
175 * Sending Message::
176 * Killing Draft::
177
178 Odds and Ends
179
180 * Bug Reports::
181 * Mailing Lists::
182 * MH FAQ and Support::
183 * Getting MH-E::
184
185 History of MH-E
186
187 * From Brian Reid::
188 * From Jim Larus::
189 * From Stephen Gildea::
190 * From Bill Wohler::
191
192 @end detailmenu
193 @end menu
194
195 @html
196 -->
197 @end html
198
199 @node Preface, Conventions, Top, Top
200 @unnumbered Preface
201
202 @cindex Emacs
203 @cindex Unix commands, Emacs
204 @cindex preface
205
206 This manual introduces another interface to the MH mail system that is
207 accessible through the GNU Emacs editor, namely, @emph{MH-E}. MH-E is
208 easy to use. I don't assume that you know GNU Emacs or even MH at this
209 point, since I didn't know either of them when I discovered MH-E@.
210 However, MH-E was the tip of the iceberg, and I discovered more and
211 more niceties about GNU Emacs and MH@. Now I'm fully hooked on both of
212 them.
213
214 The MH-E package is distributed with Emacs@footnote{Version
215 @value{VERSION} of MH-E appeared in Emacs 24.4. It is supported in GNU
216 Emacs 23 and higher, as well as XEmacs 21.4.22 and 21.5.31. MH-E is
217 known not to work with GNU Emacs versions 20 and below, and XEmacs
218 version 21.5.9--21.5.16. It is compatible with MH versions 6.8.4 and
219 higher, all versions of nmh, and GNU mailutils 1.0 and higher}, so you
220 shouldn't have to do anything special to use it. Gnus is also
221 required; version 5.10 or higher is recommended. This manual covers
222 MH-E version @value{VERSION}. To help you decide which version you
223 have, see @ref{Getting Started}.
224
225 @findex help-with-tutorial
226 @kindex C-h t
227
228 If you don't already use GNU Emacs but want to learn more, you can
229 read an online tutorial by starting GNU Emacs and typing @kbd{C-h t}
230 (@code{help-with-tutorial}). (To learn about this notation, see
231 @ref{Conventions}.) If you want to take the plunge, consult the
232 @iftex
233 @cite{GNU Emacs Manual},
234 @end iftex
235 @ifinfo
236 @ref{top, , GNU Emacs Manual, emacs, GNU Emacs Manual},
237 @end ifinfo
238 @ifhtml
239 @uref{http://www.gnu.org/software/emacs/manual/html_node/emacs/,
240 @cite{GNU Emacs Manual}},
241 @end ifhtml
242 from the Free Software Foundation.
243
244 If more information is needed, you can go to the Unix manual pages of
245 the individual MH commands. When the name is not obvious, I'll guide
246 you to a relevant MH manual page that describes the action more fully.
247
248 @cindex @cite{MH & nmh: Email for Users & Programmers}
249 @cindex MH book
250 @cindex info
251 @kindex C-h i
252
253 This manual is available in both Info and online formats. The Info
254 version is distributed with Emacs and can be accessed with the
255 @command{info} command (@samp{info mh-e}) or within Emacs (@kbd{C-h i
256 m mh-e @key{RET}}). The online version is available at
257 @uref{http://mh-e.sourceforge.net/manual/, SourceForge}. Another great
258 online resource is the book
259 @uref{http://rand-mh.sourceforge.net/book/, @cite{MH & nmh: Email for
260 Users & Programmers}} (also known as @dfn{the MH book}).
261
262 I hope you enjoy this manual! If you have any comments, or suggestions
263 for this document, please let me know.
264
265 @cindex Bill Wohler
266 @cindex Wohler, Bill
267
268 @noindent
269 Bill Wohler <@i{wohler at newt.com}>@*
270 8 February 1995@*
271 24 February 2006
272
273 @node Conventions, Getting Started, Preface, Top
274 @chapter GNU Emacs Terms and Conventions
275
276 @cindex Emacs
277 @cindex Emacs, conventions
278 @cindex Emacs, terms
279 @cindex Unix commands, Emacs
280 @cindex conventions, Emacs
281 @cindex terms, Emacs
282
283 If you're an experienced Emacs user, you can skip the following
284 conventions and definition of terms and go directly to the next
285 section (@pxref{Getting Started}).
286
287 @cindex Emacs commands
288 @cindex MH commands
289 @cindex Unix commands
290 @cindex commands
291 @cindex commands, MH
292 @cindex commands, Unix
293 @cindex commands, shell
294 @cindex functions
295 @cindex shell commands
296
297 In general, @dfn{functions} in this text refer to Emacs Lisp functions
298 that one would call from within Emacs Lisp programs (for example,
299 @code{(mh-inc-folder)}). On the other hand, @dfn{commands} are those
300 things that are run by the user, such as @kbd{i} or @kbd{M-x
301 mh-inc-folder}. Programs outside of Emacs are specifically called MH
302 commands, shell commands, or Unix commands.
303
304 @cindex conventions, key names
305 @cindex key names
306
307 The conventions for key names are as follows:
308
309 @table @kbd
310 @item C-x
311 Hold down the @key{CTRL} (Control) key and press the @kbd{x} key.
312 @c -------------------------
313 @item M-x
314 Hold down the @key{META} or @key{ALT} key and press the @kbd{x} key.
315
316 Since some keyboards don't have a @key{META} key, you can generate
317 @kbd{M-x}, for example, by pressing @key{ESC} (Escape),
318 @emph{releasing it}, and then pressing the @kbd{x} key.
319 @c -------------------------
320 @item @key{RET}
321 Press the @key{RETURN} or @key{ENTER} key. This is normally used to
322 complete a command.
323 @c -------------------------
324 @item @key{SPC}
325 Press the space bar.
326 @c -------------------------
327 @item @key{TAB}
328 Press the @key{TAB} key.
329 @c -------------------------
330 @item @key{DEL}
331 Press the @key{DELETE} key.
332 @c -------------------------
333 @item @key{BS}
334 Press the @key{BACKSPACE} key@footnote{If you are using Version 20 or
335 earlier of Emacs, you will need to use the @key{DEL} key.}.
336 @end table
337
338 @cindex Emacs, prefix argument
339 @cindex prefix argument
340 @kindex C-u
341
342 A @dfn{prefix argument} allows you to pass an argument to any Emacs
343 function. To pass an argument, type @kbd{C-u} before the Emacs command
344 or keystroke. Numeric arguments can be passed as well. For example, to
345 insert five f's, use @kbd{C-u 5 f}. There is a default of four when
346 using @kbd{C-u}, and you can use multiple prefix arguments to provide
347 arguments of powers of four. To continue our example, you could insert
348 four f's with @kbd{C-u f}, 16 f's with @kbd{C-u C-u f}, 64 f's with
349 @kbd{C-u C-u C-u f}, and so on. Numeric and valueless negative
350 arguments can also be inserted with the @key{META} key. Examples
351 include @kbd{M-5} to specify an argument of 5, or @kbd{M--} which
352 specifies a negative argument with no particular value.
353
354 @sp 1
355 @center @strong{NOTE}
356
357 @quotation
358 The prefix @kbd{C-u} or @kbd{M-} is not necessary in MH-E's MH-Folder
359 mode (@pxref{Reading Mail Tour}). In this mode, simply enter the
360 numerical argument before entering the command.
361 @end quotation
362 @sp 1
363
364 @cindex @file{.emacs}
365 @cindex Emacs, variables
366 @cindex files, @file{.emacs}
367 @cindex variables
368 @findex setq
369
370 Emacs uses @dfn{variables} to hold values. These can be changed via
371 calls to the function @code{setq} in @file{~/.emacs}.
372
373 @cindex Emacs, options
374 @cindex options
375 @findex customize-group
376 @findex customize-option
377
378 Variables in MH-E that are normally modified by the user are called
379 @dfn{options} and are modified through the customize functions (such
380 as @kbd{M-x customize-option} or @kbd{M-x customize-group}).
381 @ifnothtml
382 @xref{Easy Customization,,,emacs,The GNU Emacs Manual}, in @cite{The
383 GNU Emacs Manual}.
384 @end ifnothtml
385 @ifhtml
386 See section
387 @uref{http://www.gnu.org/software/emacs/manual/html_node/emacs/Easy-Customization.html,
388 Easy Customization} in @cite{The GNU Emacs Manual}.
389 @end ifhtml
390 @xref{Options}.
391
392 @cindex Emacs, faces
393 @cindex faces
394 @cindex highlighting
395 @findex customize-face
396
397 You can specify various styles for displaying text using @dfn{faces}.
398 MH-E provides a set of faces that you can use to personalize the look
399 of your MH-E buffers. Use the command @kbd{M-x customize-face} to do
400 this.
401 @ifnothtml
402 @xref{Face Customization,,,emacs,The GNU Emacs Manual}, in @cite{The
403 GNU Emacs Manual}.
404 @end ifnothtml
405 @ifhtml
406 See section
407 @uref{http://www.gnu.org/software/emacs/manual/html_node/emacs/Face-Customization.html,
408 Face Customization} in @cite{The GNU Emacs Manual}.
409 @end ifhtml
410
411 @cindex abnormal hooks
412 @cindex hooks
413 @cindex normal hooks
414 @findex add-hook
415 @findex customize-option
416
417 Commands often offer @dfn{hooks} which enable you to extend or modify
418 the way a command works.
419 @ifnothtml
420 @ref{Hooks, , Hooks, emacs, The GNU Emacs Manual}, in @cite{The GNU
421 Emacs Manual}
422 @end ifnothtml
423 @ifhtml
424 See section
425 @uref{http://www.gnu.org/software/emacs/manual/html_node/emacs/Hooks.html,
426 Hooks} in @cite{The GNU Emacs Manual}
427 @end ifhtml
428 for a description about @dfn{normal hooks} and @dfn{abnormal hooks}.
429 MH-E uses normal hooks in nearly all cases, so you can assume that we
430 are talking about normal hooks unless we explicitly mention that a
431 hook is abnormal. We also follow the conventions described in that
432 section: the name of the abnormal hooks end in @code{-functions} and all
433 the rest of the MH-E hooks end in @code{-hook}. You can add hooks with
434 either @code{customize-option} or @code{add-hook}.
435
436 @cindex Emacs, mark
437 @cindex Emacs, point
438 @cindex Emacs, region
439 @cindex mark
440 @cindex point
441 @cindex region
442 @kindex C-@@
443 @kindex C-@key{SPC}
444
445 There are several other terms that are used in Emacs that you should
446 know. The @dfn{point} is where the cursor currently is. You can save
447 your current place in the file by setting a @dfn{mark}. This operation
448 is useful in several ways. The mark can be later used when defining a
449 @dfn{region}, which is the text between the point and mark. Many
450 commands operate on regions, such as those for deleting text or
451 filling paragraphs. A mark can be set with @kbd{C-@@} (or
452 @kbd{C-@key{SPC}}).
453
454 @cindex completion
455 @cindex Emacs, completion
456 @cindex Emacs, file completion
457 @cindex Emacs, folder completion
458 @cindex Emacs, minibuffer
459 @cindex file completion
460 @cindex folder completion
461 @cindex minibuffer
462 @kindex SPC
463 @kindex TAB
464
465 The @dfn{minibuffer} is the bottom line of the Emacs window, where all
466 prompting and multiple-character input is directed. You can use
467 @dfn{completion} to enter values such as folders. Completion means
468 that Emacs fills in text for you when you type @key{SPC} or @key{TAB}.
469 A second @key{SPC} or @key{TAB} will list all possibilities at that
470 point.
471 @ifnothtml
472 @xref{Completion, , Completion, emacs, The GNU Emacs Manual}.
473 @end ifnothtml
474 @ifhtml
475 See the section
476 @uref{http://www.gnu.org/software/emacs/manual/html_node/emacs/Completion.html,
477 Completion} in @cite{The GNU Emacs Manual}.
478 @end ifhtml
479 Note that @key{SPC} cannot be used for completing filenames and
480 folders.
481
482 @findex help-with-tutorial
483 @kindex C-h t
484 @kindex M-x
485
486 The minibuffer is also where you enter Emacs function names after
487 typing @kbd{M-x}. For example, in the preface, I mentioned that you
488 could obtain help with @kbd{C-h t} (@code{help-with-tutorial}). What
489 this means is that you can get a tutorial by typing either @kbd{C-h t}
490 or @kbd{M-x help-with-tutorial}. In the latter case, you are prompted
491 for @samp{help-with-tutorial} in the minibuffer after typing
492 @kbd{M-x}.
493
494 @cindex ~
495
496 The @samp{~} notation in filenames represents your home directory.
497 This notation is used by many shells including @command{bash},
498 @code{tcsh}, and @command{csh}. It is analogous to the environment
499 variable @samp{$HOME}. For example, @file{~/.emacs} can be written
500 @file{$HOME/.emacs} or using the absolute path as in
501 @file{/home/wohler/.emacs} instead.
502
503 @cindex Emacs, interrupting
504 @cindex Emacs, quitting
505 @cindex interrupting
506 @cindex quitting
507
508 @i{In case of trouble:} Emacs can be interrupted at any time with
509 @kbd{C-g}. For example, if you've started a command that requests that
510 you enter something in the minibuffer, but then you change your mind,
511 type @kbd{C-g} and you'll be back where you started. If you want to
512 exit Emacs entirely, use @kbd{C-x C-c}.
513
514 @node Getting Started, Tour Through MH-E, Conventions, Top
515 @chapter Getting Started
516
517 @cindex MH-E, versions
518 @cindex history
519 @cindex versions of MH-E
520
521 Because there are many old versions of MH-E out there, it is important
522 to know which version you have. I'll be talking about @w{Version 8}
523 which is pretty close to @w{Version 6} and @w{Version 7}. It differs
524 from @w{Version 4} and @w{Version 5} and is vastly different from
525 @w{Version 3}. @xref{History}.
526
527 @findex mh-version
528
529 To determine which version of MH-E that you have, enter @kbd{M-x
530 mh-version @key{RET}}. Hopefully it says that you're running
531 @w{Version @value{VERSION}} which is the latest version as of this
532 printing.
533
534 If your version is much older than this, please consider upgrading.
535 You can have your system administrator upgrade the system-wide
536 version, or you can install your own personal version. It's really
537 quite easy. @xref{Getting MH-E}, for instructions for getting and
538 installing MH-E.
539
540 If the @code{mh-version} command displays @samp{No MH variant
541 detected}@footnote{In very old versions of MH-E, you may get the error
542 message, @samp{Cannot find the commands `inc' and `mhl' and the file
543 `components'} if MH-E can't find MH@. In this case, you need to update
544 MH-E, and you may need to install MH too. However, newer versions of
545 MH-E are better at finding MH if it is on your system.}, then you need
546 to install MH or tell MH-E where to find MH.
547
548 @cindex Debian
549 @cindex nmh
550 @cindex GNU mailutils MH
551
552 If you don't have MH on your system already, you must install a
553 variant of MH@. The Debian mh-e package does this for you
554 automatically (@pxref{Getting MH-E}). Most people use
555 @uref{http://www.nongnu.org/nmh/, nmh}, but you may be interested in
556 trying out @uref{http://mailutils.org/, GNU mailutils MH}, which
557 supports IMAP@. Your GNU/Linux distribution probably has packages for
558 both of these.
559
560 @cindex @command{install-mh}
561 @cindex MH commands, @command{install-mh}
562 @cindex MH book
563
564 If you've never run MH before, you need to run @command{install-mh}
565 from the shell before you continue. This sets up your personal MH
566 environment@footnote{See the section
567 @uref{@value{MH-BOOK-HOME}/../overall/setup.html, Setting Up MH} in the
568 MH book.}. If you don't, you'll be greeted with the error message:
569 @samp{Install MH and run install-mh before running MH-E}. This is all
570 you need to know about MH to use MH-E, but the more you know about MH,
571 the more you can leverage its power. See the
572 @uref{@value{MH-BOOK-HOME}/../, MH book} to learn more about MH.
573
574 @cindex @samp{Path:} MH profile component
575 @cindex MH profile
576 @cindex MH profile component
577 @cindex MH profile component, @samp{Path:}
578
579 Your MH environment includes your @dfn{MH profile} which is found in
580 the file @file{~/.mh_profile}, or the file named in the environment
581 variable @samp{$MH}. This file contains a number of @dfn{MH
582 profile components}. For example, the @samp{Path:} MH profile
583 component contains the path to your mail directory, which is
584 @file{~/Mail} by default.
585
586 @cindex @command{mhparam}
587 @cindex MH commands, @command{mhparam}
588 @vindex exec-path
589 @vindex mh-path
590 @vindex mh-sys-path
591 @vindex mh-variant
592 @vindex mh-variant-in-use
593
594 There are several options MH-E uses to interact with your MH
595 installation. The option @code{mh-variant} specifies the variant used
596 by MH-E (@pxref{Options}). The default setting of this option is
597 @samp{Auto-detect} which means that MH-E will automatically choose the
598 first of nmh, MH, or GNU mailutils MH that it finds in the directories
599 listed in @code{mh-path} (which you can customize),
600 @code{mh-sys-path}, and @code{exec-path}. If MH-E can't find MH at
601 all, you may have to customize @code{mh-path} and add the directory in
602 which the command @command{mhparam} is located. If, on the other hand,
603 you have both nmh and GNU mailutils MH installed (for example) and
604 @code{mh-variant-in-use} was initialized to nmh but you want to use
605 GNU mailutils MH, then you can set @code{mh-variant} to
606 @samp{gnu-mh}.
607
608 @vindex mh-flists-present-flag
609 @vindex mh-lib
610 @vindex mh-lib-progs
611 @vindex mh-progs
612
613 When @code{mh-variant} is changed, MH-E resets @code{mh-progs},
614 @code{mh-lib}, @code{mh-lib-progs}, @code{mh-flists-present-flag}, and
615 @code{mh-variant-in-use} accordingly.
616
617 @cindex @file{.emacs}
618 @cindex files, @file{.emacs}
619
620 @sp 1
621 @center @strong{NOTE}
622
623 @quotation
624 Prior to version 8, it was often necessary to set some of these
625 variables in @file{~/.emacs}; now it is no longer necessary and can
626 actually cause problems.
627 @end quotation
628 @sp 1
629
630 @cindex MH profile component, @samp{Draft-Folder:}
631 @cindex MH profile component, @samp{Path:}
632 @cindex MH profile component, @samp{Previous-Sequence:}
633 @cindex MH profile component, @samp{Unseen-Sequence:}
634 @cindex @samp{Draft-Folder:} MH profile component
635 @cindex @samp{Path:} MH profile component
636 @cindex @samp{Previous-Sequence:} MH profile component
637 @cindex @samp{Unseen-Sequence:} MH profile component
638 @findex mh-find-path
639 @vindex mh-draft-folder
640 @vindex mh-find-path-hook
641 @vindex mh-inbox
642 @vindex mh-previous-seq
643 @vindex mh-unseen-seq
644 @vindex mh-user-path
645
646 In addition to setting variables that point to MH itself, MH-E also
647 sets a handful of variables that point to where you keep your mail.
648 During initialization, the function @code{mh-find-path} sets
649 @code{mh-user-path} from your @samp{Path:} MH profile component (but
650 defaults to @samp{Mail} if one isn't present), @code{mh-draft-folder}
651 from @samp{Draft-Folder:}, @code{mh-unseen-seq} from
652 @samp{Unseen-Sequence:}, @code{mh-previous-seq} from
653 @samp{Previous-Sequence:}, and @code{mh-inbox} from @samp{Inbox:}
654 (defaults to @samp{+inbox}). The hook @code{mh-find-path-hook} is run
655 after these variables have been set. This hook can be used the change
656 the value of these variables if you need to run with different values
657 between MH and MH-E.
658
659 @node Tour Through MH-E, Using This Manual, Getting Started, Top
660 @chapter Tour Through MH-E
661
662 @cindex introduction
663 @cindex tour
664 @cindex tutorial
665
666 This chapter introduces some of the terms you'll need to know and then
667 takes you on a tour of MH-E@footnote{The keys mentioned in these
668 chapters refer to the default key bindings. If you've changed the
669 bindings, refer to the command summaries at the beginning of each
670 chapter for a mapping between default key bindings and function
671 names.}. When you're done, you'll be able to send, read, and file
672 mail, which is all that a lot of people ever do. But if you're the
673 curious or adventurous type, read the rest of the manual to be able to
674 use all the features of MH-E@. I suggest you read this chapter first to
675 get the big picture, and then you can read the manual as you wish.
676
677 @menu
678 * Sending Mail Tour::
679 * Reading Mail Tour::
680 * Processing Mail Tour::
681 * Leaving MH-E::
682 * More About MH-E::
683 @end menu
684
685 @node Sending Mail Tour, Reading Mail Tour, Tour Through MH-E, Tour Through MH-E
686 @section Sending Mail
687
688 @cindex MH-Letter mode
689 @cindex mode
690 @cindex modes, MH-Letter
691 @cindex sending mail
692 @findex mh-smail
693 @kindex M-x mh-smail
694
695 Let's start our tour by sending ourselves a message which we can later
696 read and process. Enter @kbd{M-x mh-smail} to invoke the MH-E program
697 to send messages. Your message appears in an Emacs buffer whose
698 mode@footnote{A @dfn{mode} changes Emacs to make it easier to edit a
699 particular type of text.} is MH-Letter.
700
701 Enter your login name in the @samp{To:} header field. Press the
702 @key{TAB} twice to move the cursor past the @samp{Cc:} field, since no
703 carbon copies are to be sent, and on to the @samp{Subject:} field.
704 Enter @kbd{Test} or anything else that comes to mind.
705
706 Press @key{TAB} again to move the cursor to the body of the message.
707 Enter some text, using normal Emacs commands. You should now have
708 something like this@footnote{If you're running Emacs under the X
709 Window System, then you would also see a menu bar and a tool bar. I've
710 left out the menu bar and tool bar in all of the example screens.}:
711
712 @cartouche
713 @smallexample
714
715
716
717
718
719
720 --:-- *scratch* All L1 (Lisp Interaction)-------------------------
721 To: wohler
722 cc:
723 Subject: Test
724 X-Mailer: MH-E 8.1; nmh 1.1; GNU Emacs 23.1
725 --------
726 This is a test message to get the wheels churning...#
727
728
729 --:** @{draft@} All L5 (MH-Letter)----------------------------------
730 Type C-c C-c to send message, C-C ? for help
731 @end smallexample
732 @end cartouche
733 @i{MH-E message composition window}
734
735 Note the line of dashes that separates the header and the body of the
736 message. It is essential that these dashes (or a blank line) are
737 present or the body of your message will be considered to be part of
738 the header.
739
740 @cindex help
741 @findex describe-mode
742 @kindex C-c ?
743 @kindex C-c C-c
744 @kindex C-h m
745
746 There are several commands specific to MH-Letter mode@footnote{You can
747 get quick help for the commands used most often with @kbd{C-c ?} or
748 more complete help with the @kbd{C-h m} (@code{describe-mode})
749 command.}, but at this time we'll only use @kbd{C-c C-c} to send your
750 message. Type @kbd{C-c C-c} now. That's all there is to it!
751
752 @node Reading Mail Tour, Processing Mail Tour, Sending Mail Tour, Tour Through MH-E
753 @section Receiving Mail
754
755 @cindex @command{inc}
756 @cindex @command{scan}
757 @cindex MH commands, @command{inc}
758 @cindex MH commands, @command{scan}
759 @cindex MH-Folder mode
760 @cindex modes, MH-Folder
761 @cindex reading mail
762 @findex mh-rmail
763 @kindex M-x mh-rmail
764
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.
775
776 @findex mh-rmail
777 @kindex F r
778 @kindex M-x mh-rmail
779
780 @sp 1
781 @center @strong{NOTE}
782
783 @quotation
784
785 The @kbd{M-x mh-rmail} command will show you only new mail, not mail
786 you have already read. If you were to run this tour again, you would
787 use @kbd{F r} to pull all your messages into MH-E.
788 @end quotation
789 @sp 1
790
791 @kindex @key{RET}
792 @kindex n
793 @kindex p
794
795 You should see the scan line for your message, and perhaps others. Use
796 @kbd{n} or @kbd{p} to move the cursor to your test message and type
797 @key{RET} to read your message. You should see something like:
798
799 @cartouche
800 @smallexample
801 3 t08/24 root received fax files on Wed Aug 24 11:00:13 PDT 1
802 # 4+t08/24 To:wohler Test<<This is a test message to get the wheels
803
804 -:%% @{+inbox/select@} 4 msgs (1-4) Bot L4 (MH-Folder Show)---------
805 To: wohler
806 Subject: Test
807 X-Mailer: MH-E 8.1; nmh 1.1; GNU Emacs 23.1
808 Date: Fri, 17 Mar 2006 10:49:11 -0800
809 From: Bill Wohler <wohler@@stop.mail-abuse.org>
810
811 This is a test message to get the wheels churning...
812
813
814
815 --:-- @{show-+inbox@} 4 All L1 (MH-Show)----------------------------
816
817 @end smallexample
818 @end cartouche
819 @i{After incorporating new messages}
820
821 @kindex @key{DEL}
822 @kindex @key{SPC}
823
824 If you typed a long message, you can view subsequent pages with
825 @key{SPC} and previous pages with @key{DEL}.
826
827 @node Processing Mail Tour, Leaving MH-E, Reading Mail Tour, Tour Through MH-E
828 @section Processing Mail
829
830 @cindex processing mail
831 @kindex @key{RET}
832 @kindex r
833
834 The first thing we want to do is reply to the message that we sent
835 ourselves. Ensure that the cursor is still on the same line as your
836 test message and type @kbd{r}. You are prompted in the minibuffer with
837 @samp{Reply to whom:}. Here MH-E is asking whether you'd like to reply
838 to the original sender only, to the sender and primary recipients, or
839 to the sender and all recipients. You can press @key{TAB} to see these
840 choices. If you simply press @key{RET}, you'll reply only to the
841 sender. Press @key{RET} now.
842
843 You'll find yourself in an Emacs buffer similar to that when you were
844 sending the original message, like this:
845
846 @cartouche
847 @smallexample
848 To:
849 cc:
850 Subject: Re: Test
851 In-reply-to: <31054.1142621351@@stop.mail-abuse.org>
852 References: <31054.1142621351@@stop.mail-abuse.org>
853 Comments: In-reply-to Bill Wohler <wohler@@stop.mail-abuse.org>
854 message dated "Fri, 17 Mar 2006 10:49:11 -0800."
855 X-Mailer: MH-E 8.1; nmh 1.1; GNU Emacs 23.1
856 --------
857 #
858
859 --:-- @{draft@} All L10 (MH-Letter)----------------------------------
860 To: wohler
861 Subject: Test
862 X-Mailer: MH-E 8.1; nmh 1.1; GNU Emacs 23.1
863 Date: Fri, 17 Mar 2006 10:49:11 -0800
864 From: Bill Wohler <wohler@@stop.mail-abuse.org>
865
866 This is a test message to get the wheels churning...
867
868 --:-- @{show-+inbox@} 4 All L1 (MH-Show)----------------------------
869 Type C-c C-c to send message, C-c ? for help
870 @end smallexample
871 @end cartouche
872 @i{Composition window during reply}
873
874 @findex backward-char
875 @findex forward-char
876 @findex next-line
877 @findex previous-line
878 @kindex C-b
879 @kindex C-c C-c
880 @kindex C-c C-f C-t
881 @kindex C-f
882 @kindex C-n
883 @kindex C-p
884 @kindex @key{BS}
885
886 By default, MH will not add you to the address list of your replies,
887 so if you find that the @samp{To:} header field is missing, don't
888 worry. In this case, type @kbd{C-c C-f C-t} to create and go to the
889 @samp{To:} field, where you can type your login name again. You can
890 move around with the arrow keys or with @kbd{C-p}
891 (@code{previous-line}), @kbd{C-n} (@code{next-line}), @kbd{C-b}
892 (@code{backward-char}), and @kbd{C-f} (@code{forward-char}) and can
893 delete the previous character with @key{BS}. When you're finished
894 editing your message, send it with @kbd{C-c C-c} as before.
895
896 @cindex @command{refile}
897 @cindex MH commands, @command{refile}
898 @cindex folders
899 @kindex @key{SPC}
900 @kindex o
901
902 You'll often want to save messages that were sent to you in an
903 organized fashion. This is done with @dfn{folders}. You can use
904 folders to keep messages from your friends, or messages related to a
905 particular topic. With your cursor in the MH-Folder buffer and
906 positioned on the message you sent to yourself, type @kbd{o} to output
907 (@command{refile} in MH parlance) that message to a folder. Enter
908 @kbd{test} at the @samp{Destination folder:} prompt and type @kbd{y}
909 (or @key{SPC}) when MH-E asks to create the folder @samp{+test}. Note
910 that a @samp{^} (caret) appears next to the message number, which
911 means that the message has been marked for refiling but has not yet
912 been refiled. We'll talk about how the refile is actually carried out
913 in a moment.
914
915 @cindex MH-Folder mode
916 @cindex modes, MH-Folder
917 @kindex d
918 @kindex i
919 @kindex @key{RET}
920 @kindex n
921 @kindex p
922 @kindex x
923
924 Your previous reply is now waiting in the system mailbox. You
925 incorporate this mail into your MH-Folder buffer named @samp{+inbox}
926 with the @kbd{i} command. Do this now. After the mail is incorporated,
927 use @kbd{n} or @kbd{p} to move the cursor to the new message, and read
928 it with @key{RET}. Let's delete this message by typing @kbd{d}. Note
929 that a @samp{D} appears next to the message number. This means that
930 the message is marked for deletion but is not yet deleted. To perform
931 the deletion (and the refile we did previously), use the @kbd{x}
932 command.
933
934 @findex mh-smail
935 @kindex m
936 @kindex M-x mh-smail
937
938 If you want to send another message you can use @kbd{m} instead of
939 @kbd{M-x mh-smail}. So go ahead, send some mail to your friends!
940
941 @cindex help
942 @cindex prefix characters
943 @findex describe-mode
944 @kindex ?
945 @kindex C-h m
946 @kindex F ?
947
948 You can get a quick reminder about these commands by typing @kbd{?}.
949 This lists several @dfn{prefix characters}. To list the commands
950 available via the prefix characters, type the prefix character
951 followed by a @kbd{?}, for example, @kbd{F ?}. More complete help is
952 available with the @kbd{C-h m} (@code{describe-mode}) command.
953
954 @node Leaving MH-E, More About MH-E, Processing Mail Tour, Tour Through MH-E
955 @section Leaving MH-E
956
957 @cindex Emacs, quitting
958 @cindex quitting
959 @kindex C-x C-c
960 @kindex x
961
962 You may now wish to exit @command{emacs} entirely. Use @kbd{C-x C-c}
963 to exit @command{emacs}. If you exited without running @kbd{x} in the
964 @samp{+inbox} buffer, Emacs will offer to save it for you. Type
965 @kbd{y} or @key{SPC} to save @samp{+inbox} changes, which means to
966 perform any refiles and deletes that you did there.
967
968 @findex mh-rmail
969 @kindex C-x b
970 @kindex C-x k
971 @kindex M-x mh-rmail
972 @kindex q
973
974 If you don't want to leave Emacs, you can type @kbd{q} to bury (hide)
975 the MH-E folder or delete it entirely with @kbd{C-x k}. You can then
976 later recall it with @kbd{C-x b} or @kbd{M-x mh-rmail}.
977
978 @cindex @command{packf}
979 @cindex MH commands, @command{packf}
980 @cindex exporting folders
981 @cindex folders, exporting
982 @cindex mbox-style folder
983
984 On the other hand, if you no longer want to use MH and MH-E, you can
985 take your mail with you. You can copy all of your mail into a single
986 file, mbox-style, by using the MH command @command{packf}. For
987 example, to create a file called @file{msgbox} with the messages in
988 your @samp{+inbox} folder, use @samp{packf +inbox}. The
989 @command{packf} command will append the messages to the file if it
990 already exists, so you can use @samp{folders -recurse -fast} in a
991 script to copy all of your messages into a single file, or using the
992 @samp{-file} argument, a file for each folder.
993
994 @node More About MH-E, , Leaving MH-E, Tour Through MH-E
995 @section More About MH-E
996
997 These are the basic commands to get you going, but there are plenty
998 more. If you think that MH-E is for you, read the rest of the manual
999 to find out how you can:
1000
1001 @itemize @bullet
1002 @item
1003 Print your messages (@pxref{Printing}).
1004 @c -------------------------
1005 @item
1006 Edit messages and include your signature (@pxref{Editing Drafts}).
1007 @c -------------------------
1008 @item
1009 Forward messages (@pxref{Forwarding}).
1010 @c -------------------------
1011 @item
1012 Read digests (@pxref{Digests}).
1013 @c -------------------------
1014 @item
1015 Edit bounced messages (@pxref{Editing Again}).
1016 @c -------------------------
1017 @item
1018 Send multimedia messages (@pxref{Adding Attachments}).
1019 @c -------------------------
1020 @item
1021 Read HTML messages (@pxref{HTML}).
1022 @c -------------------------
1023 @item
1024 Use aliases and identities (see @ref{Aliases}, @pxref{Identities}).
1025 @c -------------------------
1026 @item
1027 Create different views of your mail (see @ref{Threading}, @pxref{Limits}).
1028 @c -------------------------
1029 @item
1030 Deal with junk mail (@pxref{Junk}).
1031 @c -------------------------
1032 @item
1033 Handle signed and encrypted messages (see @ref{Reading PGP},
1034 @pxref{Sending PGP}).
1035 @c -------------------------
1036 @item
1037 Process mail that was sent with @command{shar} or @command{uuencode}
1038 (@pxref{Files and Pipes}).
1039 @c -------------------------
1040 @item
1041 Use sequences conveniently (@pxref{Sequences}).
1042 @c -------------------------
1043 @item
1044 Use the speedbar, tool bar, and menu bar (see @ref{Speedbar}, see @ref{Tool
1045 Bar}, @pxref{Menu Bar}).
1046 @c -------------------------
1047 @item
1048 Show header fields in different fonts (@pxref{Reading Mail}).
1049 @c -------------------------
1050 @item
1051 Find previously refiled messages (@pxref{Searching}).
1052 @c -------------------------
1053 @item
1054 Place messages in a file (@pxref{Files and Pipes}).
1055 @end itemize
1056
1057 Remember that you can also use MH commands when you're not running
1058 MH-E (and when you are!).
1059
1060 @node Using This Manual, Incorporating Mail, Tour Through MH-E, Top
1061 @chapter Using This Manual
1062
1063 This chapter begins the meat of the manual which goes into more detail
1064 about every MH-E command and option.
1065
1066 @cindex Emacs, info
1067 @cindex Emacs, online help
1068 @cindex info
1069 @cindex online help
1070 @findex describe-mode
1071 @findex mh-help
1072 @kindex ?
1073 @kindex C-c ?
1074 @kindex C-h C-h
1075 @kindex C-h C-k i
1076 @kindex C-h i
1077 @kindex C-h m
1078
1079 There are many commands, but don't get intimidated. There are command
1080 summaries at the beginning of each chapter. In case you have or would
1081 like to rebind the keys, the command summaries also list the
1082 associated Emacs Lisp function. Furthermore, even if you're stranded
1083 on a desert island with a laptop and are without your manuals, you can
1084 get a summary of all these commands with GNU Emacs online help: use
1085 @kbd{C-h m} (@code{describe-mode}) for a brief summary of commands,
1086 @kbd{?} (@code{mh-help}) for an even briefer summary@footnote{This
1087 help appears in a buffer called @samp{*MH-E Help*}
1088 (@pxref{Miscellaneous}).} (@kbd{C-c ?} in MH-Letter mode), or @kbd{C-h
1089 i} to read this manual via Info. The online help is quite good; try
1090 running @kbd{C-h C-h}. This brings up a list of available help topics,
1091 one of which displays the documentation for a given key (like @kbd{C-h
1092 k C-n}). Another useful help feature is to view the manual section
1093 that describes a given key (such as @kbd{C-h K i}). In addition,
1094 review @ref{Conventions}, if any of the GNU Emacs conventions are
1095 strange to you.
1096
1097 In addition to all of the commands, it is also possible to reconfigure
1098 MH-E to fit the needs of even the most demanding user. The following
1099 chapters also describe all of the options, show the defaults, and make
1100 recommendations for customization.
1101
1102 However, when customizing your mail environment, first try to change
1103 what you want in MH, and only change MH-E if changing MH is not
1104 possible. That way you will get the same behavior inside and outside
1105 GNU Emacs. Note that MH-E does not provide hooks for customizations
1106 that can be done in MH; this omission is intentional.
1107
1108 @cindex Emacs Lisp Manual
1109 @cindex Emacs, Emacs Lisp Manual
1110 @cindex Emacs, info
1111 @cindex Emacs, online help
1112 @cindex info
1113 @cindex online help
1114
1115 I hope I've included enough examples here to get you well on your way.
1116 If you want to explore Emacs Lisp further, a programming manual does
1117 exist,
1118 @c Yes, some of the stuff in the following sections is redundant, but
1119 @c TeX barfs if the @ifs are inside the @footnote.
1120 @iftex
1121 @footnote{The @cite{GNU Emacs Lisp Reference Manual} may be available
1122 online in the Info system by typing @kbd{C-h i m Emacs Lisp
1123 @key{RET}}. It is also available online at @*
1124 @uref{http://www.gnu.org/savannah-checkouts/gnu/emacs/manual/html_node/elisp/}.
1125 You can also order a printed manual, which has the desirable
1126 side-effect of helping to support the Free Software Foundation which
1127 made all this great software available. You can find an order form by
1128 running @kbd{C-h C-d}, or you can request an order form from @i{gnu at
1129 gnu.org}.}
1130 @end iftex
1131 @ifinfo
1132 @footnote{@xref{Top, The GNU Emacs Lisp Reference Manual, , elisp, GNU
1133 Emacs Lisp Reference Manual}, which may be available online in the
1134 Info system. It is also available online at
1135 @uref{http://www.gnu.org/savannah-checkouts/gnu/emacs/manual/html_node/elisp/}.
1136 You can also order a printed manual, which has the desirable
1137 side-effect of helping to support the Free Software Foundation which
1138 made all this great software available. You can find an order form by
1139 running @kbd{C-h C-d}, or you can request an order form from @i{gnu at
1140 gnu.org}.}
1141 @end ifinfo
1142 @ifhtml
1143 @footnote{The
1144 @uref{http://www.gnu.org/savannah-checkouts/gnu/emacs/manual/html_node/elisp/,
1145 The GNU Emacs Lisp Reference Manual} may also be available online in
1146 the Info system by typing @kbd{C-h i m Emacs Lisp @key{RET}}. You can
1147 also order a printed manual, which has the desirable side-effect of
1148 helping to support the Free Software Foundation which made all this
1149 great software available. You can find an order form by running
1150 @kbd{C-h C-d}, or you can request an order form from @i{gnu at
1151 gnu.org}.}
1152 @end ifhtml
1153 and you can look at the code itself for examples. Look in the Emacs
1154 Lisp directory on your system (such as
1155 @file{/usr/local/lib/emacs/lisp/mh-e}) and find all the @file{mh-*.el}
1156 files there. When calling MH-E and other Emacs Lisp functions directly
1157 from Emacs Lisp code, you'll need to know the correct arguments. Use
1158 the online help for this. For example, try @kbd{C-h f
1159 mh-execute-commands @key{RET}}. If you write your own functions,
1160 please do not prefix your symbols (variables and functions) with
1161 @samp{mh-}. This prefix is reserved for the MH-E package. To avoid
1162 conflicts with existing MH-E symbols, use a prefix like @samp{my-} or
1163 your initials. (Unless, of course, your initials happen to be @emph{mh}!)
1164
1165 @menu
1166 * Options::
1167 * Ranges::
1168 * Folder Selection::
1169 @end menu
1170
1171 @node Options, Ranges, Using This Manual, Using This Manual
1172 @section Options
1173
1174 @cindex Emacs, customizing
1175 @cindex Emacs, setting options
1176 @cindex customizing MH-E
1177 @cindex setting options
1178 @findex customize-option
1179 @vindex mh-lpr-command-format, example
1180
1181 Many string or integer options are easy to modify using @kbd{M-x
1182 customize-option}. For example, to modify the option that controls
1183 printing, you would run @kbd{M-x customize-option @key{RET}
1184 mh-lpr-command-format @key{RET}}. In the buffer that appears, modify
1185 the string to the right of the variable. For example, you may change
1186 the @command{lpr} command with @samp{nenscript -G -r -2 -i'%s'}. Then
1187 use the @samp{State} combo box and select @samp{Save for Future
1188 Sessions}. To read more about @code{mh-lpr-command-format}, see
1189 @ref{Printing}.
1190
1191 @cindex nil
1192 @cindex off, option
1193 @cindex on, option
1194 @cindex option, turning on and off
1195 @cindex t
1196 @findex customize-option
1197 @vindex mh-bury-show-buffer-flag, example
1198
1199 Options can also hold boolean values. In Emacs Lisp, the boolean
1200 values are @code{nil}, which means false, and @code{t}, which means
1201 true. The @code{customize-option} function makes it easy to change
1202 boolean values; simply click on the toggle button in the customize
1203 buffer to switch between @samp{on} (@code{t}) and @samp{off}
1204 (@code{nil}). For example, try setting @code{mh-bury-show-buffer-flag}
1205 to @samp{off} to keep the MH-Show buffer at the top of the buffer
1206 stack. Use the @samp{State} combo box and choose @samp{Set for Current
1207 Session} to see how the option affects the show buffer. Then choose
1208 the @samp{Erase Customization} menu item to reset the option to the
1209 default, which places the MH-Show buffer at the bottom of the buffer
1210 stack.
1211
1212 @vindex mh-mhl-format-file, example
1213
1214 The text usually says to turn on an option by setting it to a
1215 @emph{non-@code{nil}} value, because sometimes values other than
1216 @samp{on} are meaningful. An example of this is the variable
1217 @code{mh-mhl-format-file} (@pxref{Viewing}). Other options, such as
1218 hooks, involve a little more Emacs Lisp programming expertise.
1219
1220 @cindex customization group, @samp{mh}
1221 @cindex @samp{mh} customization group
1222 @findex customize-group
1223 @findex mh-customize
1224
1225 You can browse all of the MH-E options with the @code{customize-group}
1226 function. Try entering @kbd{M-x customize-group @key{RET} mh
1227 @key{RET}} to view the top-level options as well as buttons for all of
1228 the MH-E customization groups. Another way to view the MH-E
1229 customization group is to use @kbd{M-x mh-customize @key{RET}}.
1230
1231 @node Ranges, Folder Selection, Options, Using This Manual
1232 @section Ranges
1233
1234 @c Sync with mh-folder-mode docstring.
1235
1236 @cindex message abbreviations
1237 @cindex message ranges
1238 @cindex ranges
1239
1240 Many commands that operate on individual messages, such as
1241 @code{mh-forward} or @code{mh-refile-msg} take a @code{RANGE}
1242 argument. This argument can be used in several ways.
1243
1244 @kindex C-u, with ranges
1245
1246 If you provide the prefix argument @kbd{C-u} to these commands, then
1247 you will be prompted for the message range. This can be any valid MH
1248 range which can include messages, sequences (@pxref{Sequences}), and
1249 the abbreviations (described in the @command{mh}(1) man page):
1250
1251 @table @samp
1252 @item <num1>-<num2>
1253 Indicates all messages in the range <num1> to <num2>, inclusive. The
1254 range must be nonempty.
1255 @c -------------------------
1256 @item <num>:N
1257 @itemx <num>:+N
1258 @itemx <num>:-N
1259 Up to N messages beginning with (or ending with) message num. Num may
1260 be any of the predefined symbols: first, prev, cur, next or last.
1261 @c -------------------------
1262 @item first:N
1263 @itemx prev:N
1264 @itemx next:N
1265 @itemx last:N
1266 The first, previous, next or last messages, if they exist.
1267 @c -------------------------
1268 @item all
1269 All of the messages.
1270 @end table
1271
1272 For example, a range that shows all of these things is @samp{1 2 3
1273 5-10 last:5 unseen}.
1274
1275 @vindex transient-mark-mode
1276
1277 If the option @code{transient-mark-mode} is turned on and you set a
1278 region in the MH-Folder buffer, then the MH-E command will perform the
1279 operation on all messages in that region.
1280
1281 @cindex @samp{mh-range} customization group
1282 @cindex customization group, @samp{mh-range}
1283
1284 The @samp{mh-range} customization group contains a single option which
1285 affects how ranges are interpreted.
1286
1287 @vtable @code
1288 @item mh-interpret-number-as-range-flag
1289 On means interpret a number as a range (default: @samp{on}).
1290 @end vtable
1291
1292 @vindex mh-interpret-number-as-range-flag
1293
1294 Since one of the most frequent ranges used is @samp{last:N}, MH-E will
1295 interpret input such as @samp{200} as @samp{last:200} if the
1296 @code{mh-interpret-number-as-range-flag} option is on (which is the
1297 default). If you need to scan just the message 200, then use the range
1298 @samp{200:1} or @samp{200-200}.
1299
1300 @node Folder Selection, , Ranges, Using This Manual
1301 @section Folder Selection
1302
1303 @cindex completion, folders
1304 @cindex folders, completion
1305 @cindex folders, selecting
1306
1307 When you choose a folder in MH-E via a command such as @kbd{o}
1308 (@code{mh-refile-msg}), completion is used to enter the folder
1309 @ifnothtml
1310 (@pxref{Completion, , , emacs, The GNU Emacs Manual}).
1311 @end ifnothtml
1312 @ifhtml
1313 (see the section
1314 @uref{http://www.gnu.org/software/emacs/manual/html_node/emacs/Completion.html,
1315 Completion} in @cite{The GNU Emacs Manual}).
1316 @end ifhtml
1317 In addition, MH-E has several ways of choosing a suitable default so
1318 that the folder can often be selected with a single @key{RET} key.
1319
1320 @cindex customization group, @samp{mh-folder-selection}
1321 @cindex @samp{mh-folder-selection} customization group
1322
1323 The @samp{mh-folder-selection} customization group contains some
1324 options which are used to help with this.
1325
1326 @vtable @code
1327 @item mh-default-folder-for-message-function
1328 Function to select a default folder for refiling or @samp{Fcc:}
1329 (default: @code{nil}).
1330 @c -------------------------
1331 @item mh-default-folder-list
1332 List of addresses and folders (default: @code{nil}).
1333 @c -------------------------
1334 @item mh-default-folder-must-exist-flag
1335 On means guessed folder name must exist to be used (default:
1336 @samp{on}).
1337 @c -------------------------
1338 @item mh-default-folder-prefix
1339 Prefix used for folder names generated from aliases (default: @code{""}).
1340 @end vtable
1341
1342 @vindex mh-default-folder-for-message-function
1343
1344 You can set the option @code{mh-default-folder-for-message-function}
1345 to a function that provides a default folder for the message to be
1346 refiled. When this function is called, the current buffer contains the
1347 message being refiled and point is at the start of the message. This
1348 function should return the default folder as a string with a leading
1349 @samp{+} sign. It can also return @code{nil} so that the last folder
1350 name is used as the default, or an empty string to suppress the
1351 default entirely.
1352
1353 Otherwise, the name of the destination folder is derived from the
1354 sender as follows:
1355
1356 @enumerate
1357 @vindex mh-default-folder-list
1358 @item
1359 The folder name associated with the first address found in the list
1360 @code{mh-default-folder-list} is used. Each element in this list
1361 contains a @samp{Check Recipient} item. If this item is turned on,
1362 then the address is checked against the recipient instead of the
1363 sender. This is useful for mailing lists.
1364 @c -------------------------
1365 @vindex mh-default-folder-prefix
1366 @item
1367 An alias prefixed by @code{mh-default-folder-prefix} corresponding to
1368 the address is used. The prefix is used to prevent clutter in your
1369 mail directory. @xref{Aliases}.
1370 @end enumerate
1371
1372 @vindex mh-default-folder-must-exist-flag
1373
1374 If the derived folder does not exist, and
1375 @code{mh-default-folder-must-exist-flag} is @code{t}, then the last
1376 folder name used is suggested. This is useful if you get mail from
1377 various people for whom you have an alias, but file them all in the
1378 same project folder.
1379
1380 @node Incorporating Mail, Reading Mail, Using This Manual, Top
1381 @chapter Incorporating Your Mail
1382
1383 @cindex @samp{Folder} menu
1384 @cindex incorporating
1385 @cindex menu, @samp{Folder}
1386
1387 This chapter talks about getting mail from your system mailbox into
1388 your MH @samp{+inbox} folder. The following command accomplishes that
1389 and is found in the @samp{Folder} menu.
1390
1391 @table @kbd
1392 @cindex @samp{Folder > Incorporate New Mail} menu item
1393 @cindex menu item, @samp{Folder > Incorporate New Mail}
1394 @findex mh-inc-folder
1395 @kindex i
1396 @item i
1397 Incorporate new mail into a folder (@code{mh-inc-folder}).
1398 @end table
1399
1400 @cindex @samp{mh-inc} customization group
1401 @cindex customization group, @samp{mh-inc}
1402
1403 The following options in the @samp{mh-inc} customization group are
1404 used.
1405
1406 @vtable @code
1407 @item mh-inc-prog
1408 Program to incorporate mail (default: @code{"inc"}).
1409 @c -------------------------
1410 @item mh-inc-spool-list
1411 Alternate spool files (default: @code{nil}).
1412 @end vtable
1413
1414 The following hook is available.
1415
1416 @vtable @code
1417 @findex mh-inc-folder
1418 @item mh-inc-folder-hook
1419 Hook run by @code{mh-inc-folder} after incorporating mail into a
1420 folder (default: @code{nil}).
1421 @end vtable
1422
1423 @cindex @samp{+inbox}
1424 @findex mh-inc-folder
1425 @kindex i
1426
1427 If at any time you receive new mail, incorporate the new mail into
1428 your @samp{+inbox} buffer with @kbd{i} (@code{mh-inc-folder}). Note
1429 that @kbd{i} will display the @samp{+inbox} buffer, even if there
1430 isn't any new mail. You can incorporate mail from any file into the
1431 current folder by specifying a prefix argument; you'll be prompted for
1432 the name of the file to use as well as the destination folder (for
1433 example, @kbd{C-u i ~/mbox @key{RET} +tmp @key{RET}}).
1434
1435 @cindex @file{.emacs}
1436 @cindex Emacs, notification of new mail
1437 @cindex files, @file{.emacs}
1438 @cindex new mail
1439 @cindex notification of new mail
1440
1441 Emacs can notify you when you have new mail by displaying @samp{Mail}
1442 in the mode line. To enable this behavior, and to have a clock in the
1443 mode line as well, add the following to @file{~/.emacs}:
1444
1445 @findex display-time
1446
1447 @smalllisp
1448 (display-time)
1449 @end smalllisp
1450
1451 @cindex @command{inc}
1452 @cindex incorporating
1453 @cindex MH commands, @command{inc}
1454 @vindex mh-inc-prog
1455 @vindex mh-progs
1456
1457 The name of the program that incorporates new mail is stored in
1458 @code{mh-inc-prog}; it is @code{"inc"} by default. This program
1459 generates a one-line summary for each of the new messages. Unless it
1460 is an absolute pathname, the file is assumed to be in the
1461 @code{mh-progs} directory (@pxref{Getting Started}). You may also link
1462 a file to @command{inc} that uses a different format (see
1463 @samp{mh-profile}(5), and sections
1464 @uref{@value{MH-BOOK-HOME}/reapre.html, Reading Mail: inc show next
1465 prev} and @uref{@value{MH-BOOK-HOME}/mhstr.html, MH Format Strings} in
1466 the MH book). You'll then need to modify several variables
1467 appropriately (@pxref{Scan Line Formats}).
1468
1469 @vindex mh-inc-spool-list
1470
1471 You can use the @code{mh-inc-spool-list} variable to direct MH-E to
1472 retrieve mail from arbitrary spool files other than your system
1473 mailbox, file it in folders other than your @samp{+inbox}, and assign
1474 key bindings to incorporate this mail.
1475
1476 @cindex @command{procmail}
1477 @cindex @file{.procmailrc}
1478 @cindex Unix commands, @command{procmail}
1479 @cindex files, @file{.procmailrc}
1480
1481 Suppose you are subscribed to the @i{mh-e-devel} mailing list and you
1482 use @command{procmail} to filter this mail into @file{~/mail/mh-e}
1483 with the following recipe in @file{.procmailrc}:
1484
1485 @smallexample
1486 PATH=$PATH:/usr/bin/mh
1487 MAILDIR=$HOME/`mhparam Path`
1488 :0:
1489 * ^From mh-e-devel-admin@@stop.mail-abuse.org
1490 mh-e
1491 @end smallexample
1492
1493 @findex mh-inc-spool-*
1494 @kindex I *
1495
1496 In order to incorporate @file{~/mail/mh-e} into @samp{+mh-e} with an
1497 @kbd{I m} (@code{mh-inc-spool-mh-e}) command, customize this option,
1498 and click on the @samp{INS} button. Enter a @samp{Spool File} of
1499 @samp{~/mail/mh-e}, a @samp{Folder} of @samp{mh-e}, and a @samp{Key
1500 Binding} of @samp{m}.
1501
1502 @cindex @command{emacsclient}
1503 @cindex @command{gnuclient}
1504 @cindex @command{xbuffy}
1505 @cindex @samp{gnuserv}
1506 @cindex Unix commands, @command{emacsclient}
1507 @cindex Unix commands, @command{gnuclient}
1508 @cindex Unix commands, @command{xbuffy}
1509
1510 You can use @command{xbuffy} to automate the incorporation of this
1511 mail using the Emacs 23 command @command{emacsclient} as follows:
1512
1513 @smallexample
1514 box ~/mail/mh-e
1515 title mh-e
1516 origMode
1517 polltime 10
1518 headertime 0
1519 command emacsclient --eval '(mh-inc-spool-mh-e)'
1520 @end smallexample
1521
1522 In XEmacs, the command @command{gnuclient} is used in a similar
1523 fashion.
1524
1525 @findex mh-inc-folder
1526 @kindex i
1527 @vindex mh-inc-folder-hook
1528
1529 You can set the hook @code{mh-inc-folder-hook}, which is called after
1530 new mail is incorporated by the @kbd{i} (@code{mh-inc-folder})
1531 command. A good use of this hook is to rescan the whole folder either
1532 after running @kbd{M-x mh-rmail} the first time or when you've changed
1533 the message numbers from outside of MH-E.
1534
1535 @findex mh-execute-commands
1536 @findex mh-rescan-folder, example
1537 @findex mh-show, example
1538 @vindex mh-inc-folder-hook, example
1539
1540 @smalllisp
1541 @group
1542 (defun my-mh-inc-folder-hook ()
1543 "Hook to rescan folder after incorporating mail."
1544 (if (buffer-modified-p) ; @r{if outstanding refiles and deletes,}
1545 (mh-execute-commands)) ; @r{carry them out}
1546 (mh-rescan-folder) ; @r{synchronize with +inbox}
1547 (mh-show)) ; @r{show the current message}
1548
1549 (add-hook 'mh-inc-folder-hook 'my-mh-inc-folder-hook)
1550
1551 @i{Rescan folder after incorporating new mail via mh-inc-folder-hook}
1552
1553 @end group
1554 @end smalllisp
1555
1556 @node Reading Mail, Folders, Incorporating Mail, Top
1557 @chapter Reading Your Mail
1558
1559 @cindex @samp{+inbox}
1560 @cindex MH-Folder mode
1561 @cindex MH-Show mode
1562 @cindex modes, MH-Folder
1563 @cindex modes, MH-Show
1564 @cindex reading mail
1565 @findex mh-rmail
1566 @kindex F r
1567 @kindex F v
1568 @kindex M-x mh-rmail
1569
1570 The MH-E entry point for reading mail is @kbd{M-x mh-rmail}. This
1571 command incorporates your mail and creates a buffer called
1572 @samp{+inbox} in MH-Folder mode. The command @kbd{M-x mh-rmail} shows
1573 you only new mail, not mail you have already read@footnote{If you want
1574 to see your old mail as well, use @kbd{F r} to pull all your messages
1575 into MH-E@. Or, give a prefix argument to @code{mh-rmail} so it will
1576 prompt you for folder to visit like @kbd{F v} (for example, @kbd{C-u
1577 M-x mh-rmail @key{RET} bob @key{RET}}). @xref{Folders}.}.
1578
1579 @findex display-time
1580 @vindex read-mail-command
1581
1582 There are some commands that need to read mail, such as @kbd{Mouse-2}
1583 over the @samp{Mail} button that @code{display-time} adds to the mode
1584 line. You can configure Emacs to have these commands use MH-E by
1585 setting the option @code{read-mail-command} to @samp{mh-rmail}.
1586
1587 @cindex @command{scan}
1588 @cindex @samp{Message} menu
1589 @cindex MH commands, @command{scan}
1590 @cindex menu, @samp{Message}
1591 @cindex scan lines
1592
1593 The @samp{+inbox} buffer contains @dfn{scan lines}, which are one-line
1594 summaries of each incorporated message. You can perform most MH
1595 commands on these messages via one- or two-letter commands in either
1596 the MH-Folder or MH-Show buffers or by using the @samp{Message} menu.
1597 See @command{scan}(1) for a description of the contents of the scan
1598 lines, and see the Figure in @ref{Reading Mail Tour}, for an example.
1599
1600 @table @kbd
1601 @kindex ?
1602 @findex mh-help
1603 @item ?
1604 Display cheat sheet for the MH-E commands (@code{mh-help}).
1605 @c -------------------------
1606 @cindex @samp{Message > Show Message} menu item
1607 @cindex menu item, @samp{Message > Show Message}
1608 @kindex @key{RET}
1609 @findex mh-show
1610 @item @key{RET}
1611 Display message (@code{mh-show}).
1612 @c -------------------------
1613 @cindex @samp{Message > Show Message with Header} menu item
1614 @cindex menu item, @samp{Message > Show Message with Header}
1615 @kindex , (comma)
1616 @findex mh-header-display
1617 @item , (comma)
1618 Display message with all header fields (@code{mh-header-display}).
1619 @c -------------------------
1620 @cindex @samp{Message > Show Message with Preferred Alternative} menu item
1621 @cindex menu item, @samp{Message > Show Message with Preferred Alternative}
1622 @kindex : (colon)
1623 @findex mh-show-preferred-alternative
1624 @item : (colon)
1625 Display message with the default preferred alternative
1626 (@code{mh-show-preferred-alternative}).
1627 @c -------------------------
1628 @kindex ; (semicolon)
1629 @findex mh-toggle-mh-decode-mime-flag
1630 @item ; (semicolon)
1631 Toggle the value of @code{mh-decode-mime-flag}
1632 (@code{mh-toggle-mh-decode-mime-flag}).
1633 @c -------------------------
1634 @kindex @key{SPC}
1635 @findex mh-page-msg
1636 @item @key{SPC}
1637 Display next page in message (@code{mh-page-msg}).
1638 @c -------------------------
1639 @kindex @key{BS}
1640 @findex mh-previous-page
1641 @item @key{BS}
1642 Display previous page in message (@code{mh-previous-page}).
1643 @c -------------------------
1644 @cindex @samp{Message > Write Message to File...} menu item
1645 @cindex menu item, @samp{Message > Write Message to File...}
1646 @kindex >
1647 @findex mh-write-msg-to-file
1648 @item >
1649 Append message to end of file (@code{mh-write-msg-to-file}).
1650 @c -------------------------
1651 @cindex @samp{Message > Pipe Message to Command...} menu item
1652 @cindex menu item, @samp{Message > Pipe Message to Command...}
1653 @kindex |
1654 @findex mh-pipe-msg
1655 @item |
1656 Pipe message through shell command (@code{mh-pipe-msg}).
1657 @c -------------------------
1658 @kindex C-d
1659 @findex mh-delete-msg-no-motion
1660 @item C-d
1661 Delete range, don't move to next message
1662 (@code{mh-delete-msg-no-motion}).
1663 @c -------------------------
1664 @cindex @samp{Message > Delete Message} menu item
1665 @cindex menu item, @samp{Message > Delete Message}
1666 @kindex d
1667 @findex mh-delete-msg
1668 @item d
1669 Delete range (@code{mh-delete-msg}).
1670 @c -------------------------
1671 @kindex D ?
1672 @findex mh-prefix-help
1673 @item D ?
1674 Display cheat sheet for the commands of the current prefix in
1675 minibuffer (@code{mh-prefix-help}).
1676 @c -------------------------
1677 @kindex D @key{SPC}
1678 @findex mh-page-digest
1679 @item D @key{SPC}
1680 Display next message in digest (@code{mh-page-digest}).
1681 @c -------------------------
1682 @kindex D @key{BS}
1683 @findex mh-page-digest-backwards
1684 @item D @key{BS}
1685 Display previous message in digest (@code{mh-page-digest-backwards}).
1686 @c -------------------------
1687 @cindex @samp{Message > Burst Digest Message} menu item
1688 @cindex menu item, @samp{Message > Burst Digest Message}
1689 @kindex D b
1690 @findex mh-burst-digest
1691 @item D b
1692 Break up digest into separate messages (@code{mh-burst-digest}).
1693 @c -------------------------
1694 @cindex @samp{Message > Go to Message by Number...} menu item
1695 @cindex menu item, @samp{Message > Go to Message by Number...}
1696 @kindex g
1697 @findex mh-goto-msg
1698 @item g
1699 Go to a message (@code{mh-goto-msg}).
1700 @c -------------------------
1701 @kindex k
1702 @findex mh-delete-subject-or-thread
1703 @item k
1704 Delete messages with same subject or thread
1705 (@code{mh-delete-subject-or-thread}).
1706 @c -------------------------
1707 @kindex K ?
1708 @findex mh-prefix-help
1709 @item K ?
1710 Display cheat sheet for the commands of the current prefix in
1711 minibuffer (@code{mh-prefix-help}).
1712 @c -------------------------
1713 @kindex K @key{TAB}
1714 @findex mh-next-button
1715 @item K @key{TAB}
1716 Go to the next button (@code{mh-next-button}).
1717 @c -------------------------
1718 @kindex K S-@key{TAB}
1719 @findex mh-prev-button
1720 @item K S-@key{TAB}
1721 Go to the previous button (@code{mh-prev-button}).
1722 @c -------------------------
1723 @kindex K a
1724 @findex mh-mime-save-parts
1725 @item K a
1726 Save attachments (@code{mh-mime-save-parts}).
1727 @c -------------------------
1728 @kindex K e
1729 @findex mh-display-with-external-viewer
1730 @item K e
1731 View attachment externally (@code{mh-display-with-external-viewer}).
1732 @c -------------------------
1733 @kindex K i
1734 @findex mh-folder-inline-mime-part
1735 @item K i
1736 Show attachment verbatim (@code{mh-folder-inline-mime-part}).
1737 @c -------------------------
1738 @kindex K o
1739 @findex mh-folder-save-mime-part
1740 @item K o
1741 Save (output) attachment (@code{mh-folder-save-mime-part}).
1742 @c -------------------------
1743 @kindex K t
1744 @findex mh-toggle-mime-buttons
1745 @item K t
1746 Toggle option @code{mh-display-buttons-for-inline-parts-flag}
1747 (@code{mh-toggle-mime-buttons}).
1748 @c -------------------------
1749 @kindex K v
1750 @findex mh-folder-toggle-mime-part
1751 @item K v
1752 View attachment (@code{mh-folder-toggle-mime-part}).
1753 @c -------------------------
1754 @cindex @samp{Message > Modify Message} menu item
1755 @cindex menu item, @samp{Message > Modify Message}
1756 @kindex M
1757 @findex mh-modify
1758 @item M
1759 Edit message (@code{mh-modify}).
1760 @c -------------------------
1761 @cindex @samp{Message > Go to First Message} menu item
1762 @cindex menu item, @samp{Message > Go to First Message}
1763 @kindex M-<
1764 @findex mh-first-msg
1765 @item M-<
1766 Display first message (@code{mh-first-msg}).
1767 @c -------------------------
1768 @cindex @samp{Message > Go to Last Message} menu item
1769 @cindex menu item, @samp{Message > Go to Last Message}
1770 @kindex M->
1771 @findex mh-last-msg
1772 @item M->
1773 Display last message (@code{mh-last-msg}).
1774 @c -------------------------
1775 @kindex M-n
1776 @findex mh-next-unread-msg
1777 @item M-n
1778 Display next unread message (@code{mh-next-unread-msg}).
1779 @c -------------------------
1780 @kindex M-p
1781 @findex mh-previous-unread-msg
1782 @item M-p
1783 Display previous unread message (@code{mh-previous-unread-msg}).
1784 @c -------------------------
1785 @cindex @samp{Message > Next Message} menu item
1786 @cindex menu item, @samp{Message > Next Message}
1787 @kindex n
1788 @findex mh-next-undeleted-msg
1789 @item n
1790 Display next message (@code{mh-next-undeleted-msg}).
1791 @c -------------------------
1792 @cindex @samp{Message > Previous Message} menu item
1793 @cindex menu item, @samp{Message > Previous Message}
1794 @kindex p
1795 @findex mh-previous-undeleted-msg
1796 @item p
1797 Display previous message (@code{mh-previous-undeleted-msg}).
1798 @c -------------------------
1799 @kindex P ?
1800 @findex mh-prefix-help
1801 @item P ?
1802 Display cheat sheet for the commands of the current prefix in
1803 minibuffer (@code{mh-prefix-help}).
1804 @c -------------------------
1805 @kindex P C
1806 @findex mh-ps-print-toggle-color
1807 @item P C
1808 Toggle whether color is used in printing messages
1809 (@code{mh-ps-print-toggle-color}).
1810 @c -------------------------
1811 @kindex P F
1812 @findex mh-ps-print-toggle-faces
1813 @item P F
1814 Toggle whether printing is done with faces or not
1815 (@code{mh-ps-print-toggle-faces}).
1816 @c -------------------------
1817 @kindex P f
1818 @findex mh-ps-print-msg-file
1819 @item P f
1820 Print range to file (@code{mh-ps-print-msg-file}).
1821 @c -------------------------
1822 @cindex @samp{Message > Print Message} menu item
1823 @cindex menu item, @samp{Message > Print Message}
1824 @kindex P l
1825 @findex mh-print-msg
1826 @item P l
1827 Print range the old fashioned way
1828 (@code{mh-print-msg}).
1829 @c -------------------------
1830 @kindex P p
1831 @findex mh-ps-print-msg
1832 @item P p
1833 Print range (@code{mh-ps-print-msg}).
1834 @c -------------------------
1835 @kindex X ?
1836 @findex mh-prefix-help
1837 @item X ?
1838 Display cheat sheet for the commands of the current prefix in
1839 minibuffer (@code{mh-prefix-help}).
1840 @c -------------------------
1841 @cindex @samp{Message > Unpack Uuencoded Message...} menu item
1842 @cindex menu item, @samp{Message > Unpack Uuencoded Message...}
1843 @kindex X s
1844 @kindex X u
1845 @findex mh-store-msg
1846 @item X s
1847 @itemx X u
1848 Unpack message created with @command{uudecode} or @command{shar}
1849 (@code{mh-store-msg}).
1850 @c -------------------------
1851 @kindex Mouse-2
1852 @findex mh-show-mouse
1853 @item Mouse-2
1854 Move point to mouse event and show message (@code{mh-show-mouse}).
1855 @end table
1856
1857 Within the MH-Show buffer, the following command is defined.
1858
1859 @table @kbd
1860 @kindex @key{RET}
1861 @kindex Mouse-1
1862 @kindex Mouse-2
1863 @findex mh-press-button
1864 @item @key{RET}
1865 @itemx Mouse-1
1866 @itemx Mouse-2
1867 View contents of button (@code{mh-press-button}).
1868 @end table
1869
1870 @cindex @samp{mh-show} customization group
1871 @cindex customization group, @samp{mh-show}
1872
1873 The following table lists options in the @samp{mh-show} customization
1874 group that are used while reading mail.
1875
1876 @vtable @code
1877 @item mh-bury-show-buffer-flag
1878 On means show buffer is buried (default: @samp{on}).
1879 @c -------------------------
1880 @item mh-clean-message-header-flag
1881 On means remove extraneous header fields (default: @samp{on}).
1882 @c -------------------------
1883 @item mh-decode-mime-flag
1884 On means attachments are handled (default: @samp{on} if the Gnus
1885 @samp{mm-decode} package is present).
1886 @c -------------------------
1887 @item mh-display-buttons-for-alternatives-flag
1888 On means display buttons for all alternative attachments (default:
1889 @samp{off}).
1890 @c -------------------------
1891 @item mh-display-buttons-for-inline-parts-flag
1892 On means display buttons for all inline attachments (default:
1893 @samp{off}).
1894 @c -------------------------
1895 @item mh-do-not-confirm-flag
1896 On means non-reversible commands do not prompt for confirmation
1897 (default: @samp{off}).
1898 @c -------------------------
1899 @item mh-fetch-x-image-url
1900 Control fetching of @samp{X-Image-URL:} header field image (default:
1901 @samp{Never Fetch}).
1902 @c -------------------------
1903 @item mh-graphical-smileys-flag
1904 On means graphical smileys are displayed (default: @samp{on}).
1905 @c -------------------------
1906 @item mh-graphical-emphasis-flag
1907 On means graphical emphasis is displayed (default: @samp{on}).
1908 @c -------------------------
1909 @item mh-highlight-citation-style
1910 Style for highlighting citations (default: @samp{Multicolor}).
1911 @c -------------------------
1912 @item mh-invisible-header-fields-default
1913 List of hidden header fields (default: a checklist too long to list
1914 here).
1915 @c -------------------------
1916 @item mh-invisible-header-fields
1917 Additional header fields to hide (default: @code{nil}).
1918 @c -------------------------
1919 @item mh-lpr-command-format
1920 Command used to print (default: @code{"lpr -J '%s'"}).
1921 @c -------------------------
1922 @item mh-max-inline-image-height
1923 Maximum inline image height if @samp{Content-Disposition:} is not
1924 present (default: 0).
1925 @c -------------------------
1926 @item mh-max-inline-image-width
1927 Maximum inline image width if @samp{Content-Disposition:} is not
1928 present(default: 0).
1929 @c -------------------------
1930 @item mh-mhl-format-file
1931 Specifies the format file to pass to the @command{mhl} program
1932 (default: @samp{Use Default mhl Format (Printing Only)}).
1933 @c -------------------------
1934 @item mh-mime-save-parts-default-directory
1935 Default directory to use for @kbd{K a}.
1936 @c -------------------------
1937 @item mh-print-background-flag
1938 On means messages should be printed in the background (default:
1939 @samp{off}).
1940 @c -------------------------
1941 @item mh-show-buffer-mode-line-buffer-id
1942 Format string to produce @code{mode-line-buffer-identification} for
1943 show buffers (default: @code{" @{show-%s@} %d"}).
1944 @c -------------------------
1945 @item mh-show-maximum-size
1946 Maximum size of message (in bytes) to display automatically (default:
1947 0).
1948 @c -------------------------
1949 @item mh-show-use-xface-flag
1950 On means display face images in MH-Show buffers (default: @samp{on}).
1951 @c -------------------------
1952 @item mh-store-default-directory
1953 Default directory for @kbd{X s} (default: @samp{Current}).
1954 @c -------------------------
1955 @item mh-summary-height
1956 Number of lines in MH-Folder buffer (including the mode line)
1957 (default: depends on size of frame).
1958 @end vtable
1959
1960 The following hooks are available.
1961
1962 @vtable @code
1963 @item mh-delete-msg-hook
1964 Hook run after marking each message for deletion (default: @code{nil}).
1965 @c -------------------------
1966 @item mh-show-hook
1967 Hook run after @key{RET} shows a message (default: @code{nil}).
1968 @c -------------------------
1969 @item mh-show-mode-hook
1970 Hook run upon entry to @code{mh-show-mode} (default: @code{nil}).
1971 @end vtable
1972
1973 The following faces are available.
1974
1975 @vtable @code
1976 @item mh-show-cc
1977 Face used to highlight @samp{cc:} header fields.
1978 @c -------------------------
1979 @item mh-show-date
1980 Face used to highlight @samp{Date:} header fields.
1981 @c -------------------------
1982 @item mh-show-from
1983 Face used to highlight @samp{From:} header fields.
1984 @c -------------------------
1985 @item mh-show-header
1986 Face used to deemphasize less interesting header fields.
1987 @c -------------------------
1988 @item mh-show-pgg-bad
1989 Bad PGG signature face.
1990 @c -------------------------
1991 @item mh-show-pgg-good
1992 Good PGG signature face.
1993 @c -------------------------
1994 @item mh-show-pgg-unknown
1995 Unknown or untrusted PGG signature face.
1996 @c -------------------------
1997 @item mh-show-signature
1998 Signature face.
1999 @c -------------------------
2000 @item mh-show-subject
2001 Face used to highlight @samp{Subject:} header fields.
2002 @c -------------------------
2003 @item mh-show-to
2004 Face used to highlight @samp{To:} header fields.
2005 @c -------------------------
2006 @item mh-show-xface
2007 X-Face image face.
2008 @end vtable
2009
2010 The functions and variables introduced here are explained in more
2011 detail in the following sections.
2012
2013 @menu
2014 * Viewing::
2015 * Viewing Attachments::
2016 * HTML::
2017 * Digests::
2018 * Reading PGP::
2019 * Printing::
2020 * Files and Pipes::
2021 * Navigating::
2022 * Miscellaneous Commands and Options::
2023 @end menu
2024
2025 @node Viewing, Viewing Attachments, Reading Mail, Reading Mail
2026 @section Viewing Your Mail
2027
2028 @findex mh-header-display
2029 @findex mh-page-msg
2030 @findex mh-previous-page
2031 @findex mh-show
2032 @findex mh-show-mouse
2033 @kindex , (comma)
2034 @kindex . (period)
2035 @kindex @key{BS}
2036 @kindex @key{RET}
2037 @kindex @key{SPC}
2038 @kindex Mouse-2
2039
2040 The command @key{RET} (@code{mh-show}) displays the message that the
2041 cursor is on while @kbd{Mouse-2} (@code{mh-show-mouse}) displays the
2042 message that the mouse cursor is on. If the message is already
2043 displayed, it scrolls to the beginning of the message. Use @key{SPC}
2044 (@code{mh-page-msg}) and @key{BS} (@code{mh-previous-page}) to move
2045 forwards and backwards one page at a time through the message. You can
2046 give either of these commands a prefix argument that specifies the
2047 number of lines to scroll (such as @kbd{10 @key{SPC}}). The @key{SPC}
2048 command will also show the next undeleted message if it is used at the
2049 bottom of a message. MH-E normally hides a lot of the superfluous
2050 header fields that mailers add to a message, but if you wish to see
2051 all of them, use the command @kbd{,} (comma;
2052 @code{mh-header-display}).
2053
2054 @vindex mh-show-maximum-size
2055
2056 The option @code{mh-show-maximum-size} provides an opportunity to skip
2057 over large messages which may be slow to load. The default value of 0
2058 means that all message are shown regardless of size.
2059
2060 A litany of options control what displayed messages look like.
2061
2062 @vindex mh-show-cc
2063 @vindex mh-show-date
2064 @vindex mh-show-from
2065 @vindex mh-show-header
2066 @vindex mh-show-subject
2067 @vindex mh-show-to
2068
2069 First, the appearance of the header fields can be modified by
2070 customizing the associated face: @code{mh-show-to}, @code{mh-show-cc},
2071 @code{mh-show-from}, @code{mh-show-date}, and @code{mh-show-subject}.
2072 The face @code{mh-show-header} is used to deemphasize the other, less
2073 interesting, header fields.
2074
2075 @cindex regular expressions, @code{mh-invisible-header-fields}
2076 @vindex mh-clean-message-header-flag
2077 @vindex mh-invisible-header-fields
2078 @vindex mh-invisible-header-fields-default
2079
2080 Normally messages are delivered with a handful of uninteresting header
2081 fields. These are hidden by turning on the option
2082 @code{mh-clean-message-header-flag} (which it is by default). The
2083 header fields listed in the option
2084 @code{mh-invisible-header-fields-default} are hidden, although you can
2085 check off any field that you would like to see. Header fields that you
2086 would like to hide that aren't listed can be added to the option
2087 @code{mh-invisible-header-fields} with a couple of caveats. Regular
2088 expressions are not allowed. Unique fields should have a @samp{:}
2089 suffix; otherwise, the element can be used to render invisible an
2090 entire class of fields that start with the same prefix. If you think a
2091 header field should be generally ignored, please update
2092 @uref{https://sourceforge.net/p/mh-e/bugs/245/, SF #245}.
2093
2094 @cindex header field, @samp{Face:}
2095 @cindex header field, @samp{X-Face:}
2096 @cindex header field, @samp{X-Image-URL:}
2097 @cindex @samp{Face:} header field
2098 @cindex @samp{X-Face:} header field
2099 @cindex @samp{X-Image-URL:} header field
2100 @vindex mh-show-use-xface-flag
2101
2102 MH-E can display the content of @samp{Face:}, @samp{X-Face:}, and
2103 @samp{X-Image-URL:} header fields. If any of these fields occur in the
2104 header of your message, the sender's face will appear in the
2105 @samp{From:} header field. If more than one of these fields appear,
2106 then the first field found in the order @samp{Face:}, @samp{X-Face:},
2107 and @samp{X-Image-URL:} will be used. The option
2108 @code{mh-show-use-xface-flag} is used to turn this feature on and off.
2109 This feature will be turned on by default if your system supports it.
2110
2111 The first header field used, if present, is the Gnus-specific
2112 @samp{Face:} field@footnote{The @samp{Face:} field appeared in GNU
2113 Emacs 21 and XEmacs. For more information, see
2114 @uref{http://quimby.gnus.org/circus/face/}.}.
2115
2116 @cindex @command{uncompface}
2117 @cindex Emacs, packages, x-face
2118 @cindex Unix commands, @command{uncompface}
2119 @cindex x-face package
2120 @vindex mh-show-xface
2121
2122 Next is the traditional @samp{X-Face:} header field@footnote{The
2123 display of this field requires the
2124 @uref{ftp://ftp.cs.indiana.edu/pub/faces/compface/compface.tar.Z,
2125 @command{uncompface} program}. Recent versions of XEmacs have internal
2126 support for @samp{X-Face:} images. If your version of XEmacs does not,
2127 then you'll need both @command{uncompface} and the
2128 @uref{ftp://ftp.jpl.org/pub/elisp/, @samp{x-face} package}.}. MH-E
2129 renders the foreground and background of the image using the
2130 associated attributes of the face @code{mh-show-xface}.
2131
2132 @cindex @command{convert}
2133 @cindex @command{wget}
2134 @cindex ImageMagick
2135 @cindex Unix commands, @command{convert}
2136 @cindex Unix commands, @command{wget}
2137 @vindex mh-fetch-x-image-url
2138
2139 Finally, MH-E will display images referenced by the
2140 @samp{X-Image-URL:} header field if neither the @samp{Face:} nor the
2141 @samp{X-Face:} fields are present@footnote{The display of the images
2142 requires the @uref{http://www.gnu.org/software/wget/wget.html,
2143 @command{wget} program} to fetch the image and the @command{convert}
2144 program from the @uref{http://www.imagemagick.org/script/index.php,
2145 ImageMagick suite}.}. Of the three header fields this is the most
2146 efficient in terms of network usage since the image doesn't need to be
2147 transmitted with every single mail. The option
2148 @code{mh-fetch-x-image-url} controls the fetching of the
2149 @samp{X-Image-URL:} header field image with the following values:
2150
2151 @table @samp
2152 @item Ask Before Fetching
2153 You are prompted before the image is fetched. MH-E will remember your
2154 reply and will either use the already fetched image the next time the
2155 same URL is encountered or silently skip it if you didn't fetch it the
2156 first time. This is a good setting.
2157 @c -------------------------
2158 @item Never Fetch
2159 Images are never fetched and only displayed if they are already
2160 present in the cache. This is the default.
2161 @end table
2162
2163 There isn't a value of @samp{Always Fetch} for privacy and DOS (denial
2164 of service) reasons. For example, fetching a URL can tip off a spammer
2165 that you've read his email (which is why you shouldn't blindly answer
2166 yes if you've set this option to @samp{Ask Before Fetching}). Someone
2167 may also flood your network and fill your disk drive by sending a
2168 torrent of messages, each specifying a unique URL to a very large
2169 file.
2170
2171 @cindex @file{.mhe-x-image-cache}
2172 @cindex files, @file{.mhe-x-image-cache}
2173
2174 The cache of images is found in the directory
2175 @file{.mhe-x-image-cache} within your MH directory. You can add your
2176 own face to the @samp{From:} field too. @xref{Picture}.
2177
2178 @cindex @command{mhl}
2179 @cindex MH commands, @command{mhl}
2180 @vindex mh-mhl-format-file
2181
2182 Normally MH-E takes care of displaying messages itself (rather than
2183 calling an MH program to do the work). If you'd rather have
2184 @command{mhl} display the message (within MH-E), change the option
2185 @code{mh-mhl-format-file} from its default value of @samp{Use Default
2186 mhl Format (Printing Only)}. You can set this option to @samp{Use
2187 Default mhl Format} to get the same output as you would get if you ran
2188 @command{mhl} from the shell. If you have a format file that you want
2189 MH-E to use, you can set this option to @samp{Specify an mhl Format
2190 File} and enter the name of your format file (@command{mhl}(1) or
2191 section @uref{@value{MH-BOOK-HOME}/shomes.html#Usisho, Using mhl} in
2192 the MH book tells you how to write one). Your format file should
2193 specify a non-zero value for @samp{overflowoffset} to allow MH-E to
2194 parse the header. Note that @command{mhl} is always used for printing
2195 and forwarding; in this case, the value of @code{mh-mhl-format-file}
2196 is consulted if you have specified a format file.
2197
2198 @cindex citations, highlighting
2199 @cindex highlighting citations
2200 @vindex mh-highlight-citation-style
2201
2202 If the sender of the message has cited other messages in his message,
2203 then MH-E will highlight these citations to emphasize the sender's
2204 actual response. The option @code{mh-highlight-citation-style} can be
2205 customized to change the highlighting style. The @samp{Multicolor}
2206 method uses a different color for each indentation while the
2207 @samp{Monotone} method highlights all citations in red. To disable
2208 highlighting of citations entirely, choose @samp{None}.
2209
2210 @cindex URLs, highlighting
2211 @cindex email addresses, highlighting
2212 @cindex highlighting URLs
2213 @cindex highlighting email addresses
2214 @cindex links, following
2215 @findex goto-address-at-point
2216 @kindex C-c @key{RET}
2217 @kindex Mouse-2
2218 @vindex goto-address-highlight-p
2219
2220 Email addresses and URLs in the message are highlighted if the option
2221 @code{goto-address-highlight-p} is on, which it is by default. To view
2222 the web page for a highlighted URL or to send a message using a
2223 highlighted email address, use @kbd{Mouse-2} or @kbd{C-c @key{RET}}
2224 (@code{goto-address-at-point}). @xref{Sending Mail}, to see how to
2225 configure Emacs to send the message using MH-E.
2226
2227 @cindex boldface, showing
2228 @cindex emphasis
2229 @cindex italics, showing
2230 @cindex smileys
2231 @cindex typesetting
2232 @cindex underline, showing
2233 @vindex gnus-emphasis-alist
2234 @vindex mh-decode-mime-flag
2235 @vindex mh-graphical-emphasis-flag
2236 @vindex mh-graphical-smileys-flag
2237
2238 It is a long standing custom to inject body language using a
2239 cornucopia of punctuation, also known as the @dfn{smileys}. MH-E can
2240 render these as graphical widgets if the option
2241 @code{mh-graphical-smileys-flag} is turned on, which it is by default.
2242 Smileys include patterns such as :-) and ;-). Similarly, a few
2243 typesetting features are indicated in ASCII text with certain
2244 characters. If your terminal supports it, MH-E can render these
2245 typesetting directives naturally if the option
2246 @code{mh-graphical-emphasis-flag} is turned on, which it is by
2247 default. For example, _underline_ will be
2248 @ifhtml
2249 @html
2250 <u>underlined</u>,
2251 @end html
2252 @end ifhtml
2253 @ifnothtml
2254 underlined,
2255 @end ifnothtml
2256 *bold* will appear in @b{bold}, /italics/ will appear in @i{italics},
2257 and so on. See the option @code{gnus-emphasis-alist} for the whole
2258 list. Both of these options are disabled if the option
2259 @code{mh-decode-mime-flag} is turned off. @xref{Viewing Attachments}.
2260
2261 @cindex signature separator
2262 @cindex vCard
2263 @vindex mh-show-signature
2264
2265 MH-E normally renders signatures and vCards in italics so that the
2266 body of the message stands out more. MH-E depends on the presence of
2267 the @dfn{signature separator} (@code{"-- "}) to do this. You can also
2268 customize the face @code{mh-show-signature} so the appearance of the
2269 signature block is more to your liking.
2270
2271 @vindex mh-show-hook
2272 @vindex mh-show-mode-hook
2273
2274 Two hooks can be used to control how messages are displayed. The first
2275 hook, @code{mh-show-mode-hook}, is called early on in the process of
2276 the message display. It is usually used to perform some action on the
2277 message's content. The second hook, @code{mh-show-hook}, is the last
2278 thing called after messages are displayed. It's used to affect the
2279 behavior of MH-E in general or when @code{mh-show-mode-hook} is too
2280 early.
2281
2282 @cindex MH-Show mode
2283 @cindex modes, MH-Show
2284 @vindex mh-show-buffer-mode-line-buffer-id
2285
2286 For those who like to modify their mode lines, use
2287 @code{mh-show-buffer-mode-line-buffer-id} to modify the mode line in
2288 the MH-Show buffers. Place the two escape strings @samp{%s} and
2289 @samp{%d}, which will display the folder name and the message number,
2290 respectively, somewhere in the string in that order. The default value
2291 of @code{"@{show-%s@} %d"} yields a mode line of
2292
2293 @smallexample
2294 -----@{show-+inbox@} 4 (MH-Show)--Bot--------------------------------
2295 @end smallexample
2296
2297 @node Viewing Attachments, HTML, Viewing, Reading Mail
2298 @section Viewing Attachments
2299
2300 @cindex attachments
2301 @cindex body parts
2302 @cindex @command{mhshow}
2303 @cindex @command{show}
2304 @cindex MH commands, @command{mhshow}
2305 @cindex MH commands, @command{show}
2306 @cindex MIME
2307 @cindex multimedia mail
2308
2309 MH has the ability to display @dfn{@sc{mime}} (Multipurpose Internet
2310 Mail Extensions) messages which are simply messages with additional
2311 @dfn{body parts} or @dfn{attachments}. You can use the MH commands
2312 @command{show}@footnote{See the section
2313 @uref{@value{MH-BOOK-HOME}/reapre.html, Reading Mail: inc show next
2314 prev} in the MH book.} or @command{mhshow}@footnote{See the section
2315 @uref{@value{MH-BOOK-HOME}/usimim.html#ReMIMa, Reading MIME Mail} in
2316 the MH book.} from the shell to read @sc{mime} messages@footnote{You
2317 can call them directly from Emacs if you're running the X Window
2318 System: type @kbd{M-! xterm -e mhshow @var{message-number}}. You can
2319 leave out the @samp{xterm -e} if you use @command{mhlist} or
2320 @command{mhstore}.}.
2321
2322 @cindex Emacs, packages, mm-decode
2323 @cindex mm-decode package
2324 @findex mh-toggle-mh-decode-mime-flag
2325 @kindex ; (semicolon)
2326 @vindex mh-decode-mime-flag
2327
2328 MH-E can handle attachments as well if the Gnus @samp{mm-decode}
2329 package is present. If so, the option @code{mh-decode-mime-flag} will
2330 be on. Otherwise, you'll see the @sc{mime} body parts rather than text
2331 or attachments. There isn't much point in turning off the option
2332 @code{mh-decode-mime-flag}; however, you can inspect it if it appears
2333 that the body parts are not being interpreted correctly or toggle it
2334 with the command @kbd{;} (semicolon;
2335 @code{mh-toggle-mh-decode-mime-flag}) to view the raw message. This
2336 option also controls the display of quoted-printable messages and
2337 other graphical widgets. @xref{Viewing}.
2338
2339 @cindex buttons
2340
2341 Attachments in MH-E are indicated by @dfn{buttons} like this:
2342
2343 @smallexample
2344 [1. image/jpeg; foo.jpg]...
2345 @end smallexample
2346
2347 @findex mh-next-button
2348 @findex mh-press-button
2349 @findex mh-prev-button
2350 @kindex @key{RET}
2351 @kindex K @key{TAB}
2352 @kindex K S-@key{TAB}
2353 @kindex Mouse-1
2354 @kindex Mouse-2
2355
2356 To view the contents of the button, use either @kbd{Mouse-1} or
2357 @kbd{Mouse-2} on the button or @key{RET} (@code{mh-press-button}) when
2358 the cursor is over the button. This command is a toggle so if you use
2359 it again on the same attachment, it is hidden. If Emacs does not know
2360 how to display the attachment, then Emacs offers to save the
2361 attachment in a file. To move the cursor to the next button, use the
2362 command @kbd{K @key{TAB}} (@code{mh-next-button}). If the end of the
2363 buffer is reached then the search wraps over to the start of the
2364 buffer. To move the cursor to the previous button, use the command
2365 @kbd{K S-@key{TAB}} (@code{mh-prev-button}). If the beginning of the
2366 buffer is reached then the search wraps over to the end of the buffer.
2367
2368 @cindex attachments, viewing
2369 @cindex viewing attachments
2370 @findex mh-folder-toggle-mime-part
2371 @kindex K v
2372
2373 Another way to view the contents of a button is to use the command
2374 @kbd{K v} (@code{mh-folder-toggle-mime-part}). This command displays
2375 (or hides) the attachment associated with the button under the cursor.
2376 If the cursor is not located over a button, then the cursor first
2377 moves to the next button, wrapping to the beginning of the message if
2378 necessary. This command has the advantage over the previous commands
2379 of working from the MH-Folder buffer. You can also provide a numeric
2380 prefix argument (as in @kbd{4 K v}) to view the attachment labeled
2381 with that number. If Emacs does not know how to display the
2382 attachment, then Emacs offers to save the attachment in a file.
2383
2384 @cindex @file{/etc/mailcap}
2385 @cindex files, @file{/etc/mailcap}
2386 @findex mailcap-mime-info
2387 @findex mh-display-with-external-viewer
2388 @kindex K e
2389
2390 If Emacs does not know how to view an attachment, you could save it
2391 into a file and then run some program to open it. It is easier,
2392 however, to launch the program directly from MH-E with the command
2393 @kbd{K e} (@code{mh-display-with-external-viewer}). While you'll most
2394 likely use this to view spreadsheets and documents, it is also useful
2395 to use your browser to view HTML attachments with higher fidelity than
2396 what Emacs can provide. This command displays the attachment
2397 associated with the button under the cursor. If the cursor is not
2398 located over a button, then the cursor first moves to the next button,
2399 wrapping to the beginning of the message if necessary. You can provide
2400 a numeric prefix argument (as in @kbd{4 K e}) to view the attachment
2401 labeled with that number. This command tries to provide a reasonable
2402 default for the viewer by calling the Emacs function
2403 @code{mailcap-mime-info}. This function usually reads the file
2404 @file{/etc/mailcap}.
2405
2406 @cindex attachments, saving
2407 @cindex saving attachments
2408 @findex mh-folder-save-mime-part
2409 @kindex K o
2410
2411 Use the command @kbd{K o} (@code{mh-folder-save-mime-part}) to save
2412 attachments (the mnemonic is ``output''). This command saves the
2413 attachment associated with the button under the cursor. If the cursor
2414 is not located over a button, then the cursor first moves to the next
2415 button, wrapping to the beginning of the message if necessary. You can
2416 also provide a numeric prefix argument (as in @kbd{3 K o}) to save the
2417 attachment labeled with that number. This command prompts you for a
2418 filename and suggests a specific name if it is available.
2419
2420 @cindex @command{mhn}
2421 @cindex @command{mhstore}
2422 @cindex MH commands, @command{mhn}
2423 @cindex MH commands, @command{mhstore}
2424 @findex mh-mime-save-parts
2425 @kindex K a
2426 @vindex mh-mime-save-parts-default-directory
2427
2428 You can save all of the attachments at once with the command @kbd{K a}
2429 (@code{mh-mime-save-parts}). The attachments are saved in the
2430 directory specified by the option
2431 @code{mh-mime-save-parts-default-directory} unless you use a prefix
2432 argument (as in @kbd{C-u K a}) in which case you are prompted for the
2433 directory. These directories may be superseded by MH profile
2434 components, since this function calls on @command{mhstore}
2435 (@command{mhn}) to do the work.
2436
2437 @vindex mh-mime-save-parts-default-directory
2438
2439 The default value for the option
2440 @code{mh-mime-save-parts-default-directory} is @samp{Prompt Always} so
2441 that you are always prompted for the directory in which to save the
2442 attachments. However, if you usually use the same directory within a
2443 session, then you can set this option to @samp{Prompt the First Time}
2444 to avoid the prompt each time. you can make this directory permanent
2445 by choosing @samp{Directory} and entering the directory's name.
2446
2447 @cindex attachments, inline
2448 @cindex inline attachments
2449 @findex mh-toggle-mime-buttons
2450 @kindex K t
2451 @vindex mh-display-buttons-for-inline-parts-flag
2452
2453 The sender can request that attachments should be viewed inline so
2454 that they do not really appear like an attachment at all to the
2455 reader. Most of the time, this is desirable, so by default MH-E
2456 suppresses the buttons for inline attachments. On the other hand, you
2457 may receive code or HTML which the sender has added to his message as
2458 inline attachments so that you can read them in MH-E@. In this case, it
2459 is useful to see the buttons so that you know you don't have to cut
2460 and paste the code into a file; you can simply save the attachment. If
2461 you want to make the buttons visible for inline attachments, you can
2462 use the command @kbd{K t} (@code{mh-toggle-mime-buttons}) to toggle
2463 the visibility of these buttons. You can turn on these buttons
2464 permanently by turning on the option
2465 @code{mh-display-buttons-for-inline-parts-flag}.
2466
2467 MH-E cannot display all attachments inline however. It can display
2468 text (including @sc{html}) and images.
2469
2470 @cindex header field, @samp{Content-Disposition:}
2471 @cindex inline images
2472 @cindex @samp{Content-Disposition:} header field
2473 @vindex mh-max-inline-image-height
2474 @vindex mh-max-inline-image-width
2475
2476 Some older mail programs do not insert the needed
2477 plumbing@footnote{This plumbing is the @samp{Content-Disposition:}
2478 header field.} to tell MH-E whether to display the attachments inline
2479 or not. If this is the case, MH-E will display these images inline if
2480 they are smaller than the window. However, you might want to allow
2481 larger images to be displayed inline. To do this, you can change the
2482 options @code{mh-max-inline-image-width} and
2483 @code{mh-max-inline-image-height} from their default value of zero to
2484 a large number. The size of your screen is a good choice for these
2485 numbers.
2486
2487 @cindex alternatives
2488 @cindex attachments, alternatives
2489 @vindex mh-display-buttons-for-alternatives-flag
2490
2491 Sometimes, a mail program will produce multiple alternatives of an
2492 attachment in increasing degree of faithfulness to the original
2493 content. By default, only the preferred alternative is displayed. If
2494 the option @code{mh-display-buttons-for-alternatives-flag} is on, then
2495 the preferred part is shown inline and buttons are shown for each of
2496 the other alternatives.
2497
2498 @vindex mm-discouraged-alternatives
2499
2500 Many people prefer to see the @samp{text/plain} alternative rather
2501 than the @samp{text/html} alternative. To do this in MH-E, customize
2502 the option @code{mm-discouraged-alternatives}, and add
2503 @samp{text/html}. The next best alternative, if any, will be shown.
2504
2505 @findex mh-show-preferred-alternative
2506 @kindex : (colon)
2507
2508 Occasionally, though, you might want to see the preferred alternative.
2509 The command @kbd{:} (@code{mh-show-preferred-alternative}) displays
2510 the message with the default preferred alternative. This is as if
2511 @code{mm-discouraged-alternatives} is set to @samp{nil}. Use the
2512 command @key{RET} (@code{mh-show}) to show the message normally again.
2513
2514 @kindex K i
2515 @findex mh-folder-inline-mime-part
2516
2517 You can view the raw contents of an attachment with the command @kbd{K
2518 i} (@code{mh-folder-inline-mime-part}). This command displays (or
2519 hides) the contents of the attachment associated with the button under
2520 the cursor verbatim. If the cursor is not located over a button, then
2521 the cursor first moves to the next button, wrapping to the beginning
2522 of the message if necessary. You can also provide a numeric prefix
2523 argument (as in @kbd{4 K i}) to view the attachment labeled with that
2524 number.
2525
2526 For additional information on buttons, see
2527 @ifinfo
2528 @ref{Article Buttons,,,gnus}, and @ref{MIME Commands,,,gnus}.
2529 @end ifinfo
2530 @ifnotinfo
2531 the chapters @uref{http://www.gnus.org/manual/gnus_101.html#SEC101,
2532 Article Buttons} and
2533 @uref{http://www.gnus.org/manual/gnus_108.html#SEC108, MIME Commands}
2534 in the @cite{The Gnus Manual}.
2535 @end ifnotinfo
2536
2537 @node HTML, Digests, Viewing Attachments, Reading Mail
2538 @section HTML
2539
2540 @cindex HTML
2541 @cindex Gnus
2542
2543 MH-E can display messages that have been sent in HTML@footnote{This
2544 feature depends on a version of Gnus that is at least 5.10.}. The
2545 content of the message will appear in the MH-Show buffer as you would
2546 expect if the entire message is HTML, or there is an inline HTML body
2547 part. However, if there is an HTML body part that is an attachment,
2548 then you'll see a button like this:
2549
2550 @smallexample
2551 [1. text/html; foo.html]...
2552 @end smallexample
2553
2554 To see how to read the contents of this body part, see @ref{Viewing
2555 Attachments}.
2556
2557 @vindex mm-text-html-renderer
2558
2559 The browser that MH-E uses is determined by the option
2560 @code{mm-text-html-renderer}. The default setting is set automatically
2561 based upon the presence of a known browser on your system. If you wish
2562 to use a different browser, then set this option accordingly. See the
2563 documentation for the browser you use for additional information on
2564 how to use it. In particular, find and disable the option to render
2565 images as this can tip off spammers that the email address they have
2566 used is valid.
2567
2568 @vindex mm-text-html-renderer
2569
2570 If you're confused about which @code{mm-text-html-renderer} to use,
2571 here's a brief description of each, sorted by popularity, that
2572 includes the results of a quick poll of MH-E users from 2005-12-23.
2573
2574 @table @asis
2575 @cindex browser, @samp{w3m}
2576 @cindex @samp{w3m}
2577 @kindex Mouse-2
2578 @item @samp{w3m} 7
2579 The @samp{w3m} browser requires an external program. It's quick,
2580 produces pretty nice output, and best of all, it's the only browser
2581 that highlights links. These can be clicked with @kbd{Mouse-2} to view
2582 the content of the link in @samp{w3m}. The @samp{w3m} browser handles
2583 tables well and actually respects the table's width parameter (which
2584 can cause text to wrap if the author didn't anticipate that the page
2585 would be viewed in Emacs).
2586 @c -------------------------
2587 @cindex browser, @samp{w3m-standalone}
2588 @cindex @samp{w3m-standalone}
2589 @item @samp{w3m-standalone} 3
2590 This browser, along with @samp{nil} for the external browser, are the
2591 only choices that work without having to download a separate lisp
2592 package or external program. This browser is quick, but does not show
2593 links. It handles simple tables but some tables get rendered much
2594 wider than the Emacs frame. This browser was the only one not to
2595 handle the escape @samp{&ndash;} (it printed a @samp{?}), but it did
2596 render @samp{&reg;}.
2597 @c -------------------------
2598 @cindex browser, @samp{links}
2599 @cindex @samp{links}
2600 @item @samp{links} 1
2601 The @samp{links} browser requires an external program. It's quick, and
2602 produces nicer output than @samp{lynx} on single column mails in
2603 tables. However, it doesn't show links and it doesn't do as nice a job
2604 on multi-column tables as some lines wrap. At least it fits in 80
2605 columns and thus seems better than @samp{w3} and
2606 @samp{w3m-standalone}. Converts escapes such as @samp{&reg;} to (R).
2607 @c -------------------------
2608 @cindex browser, @samp{lynx}
2609 @cindex @samp{lynx}
2610 @item @samp{lynx} 1
2611 The @samp{lynx} browser requires an external program. It's quick and
2612 produces pretty decent output but it doesn't show links. It doesn't
2613 seem to do multi-column tables which makes output much cleaner. It
2614 centers the output and wraps long lines more than most. Handles
2615 @samp{&reg;}.
2616 @c -------------------------
2617 @item @samp{nil} 1
2618 This choice obviously requires an external browser. Like
2619 @samp{w3m-standalone}, it works out of the box. With this setting,
2620 HTML messages have a button for the body part which you can view with
2621 @kbd{K v} (@code{mh-folder-toggle-mime-part}).
2622 @c -------------------------
2623 @cindex browser, @samp{w3}
2624 @cindex @samp{w3}
2625 @item @samp{w3} 0
2626 This choice does not require an external program as all of the
2627 rendering is done in lisp. You do need to get the package separately.
2628 This browser is @strong{slow}, and doesn't appear to have been updated
2629 since 2001 and the author hasn't responded to my emails. It displays
2630 unknown tags instead of hiding them, so you get to see all the
2631 Microsoft crap in certain messages. Tends to make multi-column tables
2632 wider than even a full-screen Emacs can handle. Like @samp{w3m}, you
2633 can follow links, but you have to find them first as they are not
2634 highlighted. Performs well on single-column tables and handles escapes
2635 such as @samp{&reg;}.
2636 @c -------------------------
2637 @cindex browser, @samp{html2text}
2638 @cindex @samp{html2text}
2639 @item @samp{html2text} 0
2640 The @samp{html2text} browser requires an external program. I noticed
2641 that it can do some nasty things with simple HTML mails (like filling
2642 the entire message as if it were one paragraph, including signature).
2643 On another message, it displayed half of the HTML tags for some
2644 reason.
2645 @end table
2646
2647 @vindex mm-text-html-renderer
2648
2649 For a couple more sources of information about
2650 @code{mm-text-html-renderer},
2651 @ifinfo
2652 @xref{Display Customization,,,emacs-mime}, and the documentation for
2653 the Gnus command @kbd{W h} (@pxref{Article Washing,,,gnus},).
2654 @end ifinfo
2655 @ifnotinfo
2656 see section @uref{http://www.gnus.org/manual/emacs-mime_6.html,
2657 Display Customization} in the @cite{The Emacs MIME Manual} and the
2658 documentation for the Gnus command @kbd{W h} (see section
2659 @uref{http://www.gnus.org/manual/gnus_99.html, Article Washing} in the
2660 @cite{The Gnus Manual}).
2661 @end ifnotinfo
2662
2663 @cindex @file{.emacs}
2664 @cindex files, @file{.emacs}
2665 @findex browse-url-at-mouse
2666 @kindex S-Mouse-2
2667
2668 A useful key binding that you can add to @file{~/.emacs} is the
2669 following which displays an HTML link or textual URL in an external
2670 browser when clicked with @kbd{S-mouse-2}. This binding works in any
2671 buffer, including HTML buffers.
2672
2673 @smalllisp
2674 (global-set-key [S-mouse-2] 'browse-url-at-mouse)
2675 @end smalllisp
2676
2677 @node Digests, Reading PGP, HTML, Reading Mail
2678 @section Digests
2679
2680 @cindex digests
2681 @findex mh-page-digest
2682 @findex mh-page-digest-backwards
2683 @kindex D @key{BS}
2684 @kindex D @key{SPC}
2685 @kindex @key{BS}
2686 @kindex @key{SPC}
2687
2688 A digest is a message that contains other messages. Special MH-E
2689 commands let you read digests conveniently. You can use @key{SPC} and
2690 @key{BS} to page through the digest as if it were a normal message,
2691 but if you wish to skip to the next message in the digest, use
2692 @kbd{D @key{SPC}} (@code{mh-page-digest}). To return to a previous message,
2693 use @kbd{D @key{BS}} (@code{mh-page-digest-backwards}).
2694
2695 @cindex @command{burst}
2696 @cindex MH commands, @command{burst}
2697 @cindex MH-Folder Show mode
2698 @cindex modes, MH-Folder Show
2699 @findex mh-burst-digest
2700 @kindex d
2701 @kindex D b
2702 @kindex t
2703
2704 Another handy command is @kbd{D b} (@code{mh-burst-digest}). This
2705 command uses the MH command @command{burst}@footnote{See the section
2706 @uref{@value{MH-BOOK-HOME}/burdig.html, Bursting Messages} in the MH
2707 book.} to break out each message in the digest into its own message.
2708 Using this command, you can quickly delete unwanted messages, like
2709 this: Once the digest is split up, toggle out of MH-Folder Show mode
2710 with @kbd{t} (@pxref{Folders}) so that the scan lines fill the screen
2711 and messages aren't displayed. Then use @kbd{d} (@pxref{Reading Mail})
2712 to quickly delete messages that you don't want to read (based on the
2713 @samp{Subject:} header field). You can also burst the digest to reply
2714 directly to the people who posted the messages in the digest. One
2715 problem you may encounter is that the @samp{From:} header fields are
2716 preceded with a @samp{>} so that your reply can't create the
2717 @samp{To:} field correctly. In this case, you must correct the
2718 @samp{To:} field yourself. This is described later (@pxref{Editing
2719 Drafts}).
2720
2721 @node Reading PGP, Printing, Digests, Reading Mail
2722 @section Signed and Encrypted Messages
2723
2724 @cindex GPG
2725 @cindex GnuPG
2726 @cindex Gnus
2727 @cindex OpenPGP
2728 @cindex PGP
2729 @cindex RFC 3156
2730 @cindex encrypted messages
2731 @cindex security
2732 @cindex signed messages
2733
2734 You can read encrypted or signed PGP or GPG messages with
2735 MH-E@footnote{This feature depends on post-5.10 versions of Gnus.
2736 @cite{MIME Security with OpenPGP} is documented in
2737 @uref{http://www.rfc-editor.org/rfc/rfc3156.txt, RFC 3156}. However,
2738 MH-E can also decrypt old-style PGP messages that are not in MIME
2739 format.}. This section assumes that you already have a good
2740 understanding of GPG and have set up your keys appropriately.
2741
2742 If someone sends you a signed message, here is what you'll see:
2743
2744 @smallexample
2745 @group
2746 [[PGP Signed Part:Bill Wohler <wohler@@stop.mail-abuse.org>]]
2747 This is a signed message.
2748
2749 [[End of PGP Signed Part]]
2750 @end group
2751 @end smallexample
2752
2753 @cindex keychain
2754 @cindex key server
2755 @cindex signed messages
2756
2757 If the key for the given signature is not in your keychain, you'll be
2758 given the opportunity to fetch the key from a key server and verify
2759 the key. If the message is really large, the verification process can
2760 take a long time. You can press @kbd{C-g} at any time to
2761 cancel@footnote{Unfortunately in the current version, the validation
2762 process doesn't display a message so it appears that MH-E has hung. We
2763 hope that this will be fixed in the future.}.
2764
2765 If the signature doesn't check out, you might see something like this:
2766
2767 @smallexample
2768 @group
2769 [[PGP Signed Part:Failed]]
2770 This is a signed message.
2771 This is garbage added after the signature was made.
2772
2773 [[End of PGP Signed Part]]
2774 @end group
2775 @end smallexample
2776
2777 @cindex decrypting messages
2778
2779 If someone sends you an encrypted message, MH-E will ask for your
2780 passphrase to decrypt the message. You should see something like this:
2781
2782 @smallexample
2783 @group
2784 [[PGP Encrypted Part:OK]]
2785
2786 [[PGP Signed Part:Bill Wohler <wohler@@stop.mail-abuse.org>]]
2787 This is the secret message.
2788
2789 [[End of PGP Signed Part]]
2790
2791 [[End of PGP Encrypted Part]]
2792 @end group
2793 @end smallexample
2794
2795 If there is a problem decrypting the message, the button will say:
2796
2797 @smallexample
2798 [[PGP Encrypted Part:Failed]]
2799 @end smallexample
2800
2801 You can read the contents of this button using the methods described in
2802 @ref{Viewing Attachments}. If the message were corrupted, you'd see
2803 this:
2804
2805 @smallexample
2806 [[PGP Encrypted Part:Failed]
2807 Invalid base64 data]
2808 @end smallexample
2809
2810 If your passphrase were incorrect, you'd see something like this:
2811
2812 @smallexample
2813 [GNUPG:] ENC_TO CD9C88BB610BD9AD 1 0
2814 [GNUPG:] USERID_HINT CD9C88BB610BD9AD Bill Wohler <wohler@@stop.mail-abuse.org>
2815 [GNUPG:] NEED_PASSPHRASE CD9C88BB610BD9AD CD9C88BB610BD9AD 1 0
2816 [GNUPG:] BAD_PASSPHRASE CD9C88BB610BD9AD
2817 gpg: encrypted with 1024-bit RSA key, ID 610BD9AD, created 1997-09-09
2818 "Bill Wohler <wohler@@stop.mail-abuse.org>"
2819 gpg: public key decryption failed: bad passphrase
2820 [GNUPG:] BEGIN_DECRYPTION
2821 [GNUPG:] DECRYPTION_FAILED
2822 gpg: decryption failed: secret key not available
2823 [GNUPG:] END_DECRYPTION
2824
2825 gpg exited abnormally: '2'
2826 @end smallexample
2827
2828 @vindex mh-show-pgg-bad
2829 @vindex mh-show-pgg-good
2830 @vindex mh-show-pgg-unknown
2831
2832 The appearance of the buttons is controlled by the faces
2833 @code{mh-show-pgg-good}, @code{mh-show-pgg-bad}, and
2834 @code{mh-show-pgg-unknown} depending on the validity of the signature.
2835 The latter is used whether the signature is unknown or untrusted.
2836
2837 @cindex @samp{pgg} customization group
2838 @cindex PGG
2839 @cindex customization group, @samp{pgg}
2840
2841 The @samp{pgg} customization group may have some settings which may
2842 interest you.
2843 @iftex
2844 See @cite{The PGG Manual}.
2845 @end iftex
2846 @ifinfo
2847 @xref{Top, , The PGG Manual, pgg, The PGG Manual}.
2848 @end ifinfo
2849 @ifhtml
2850 See
2851 @uref{http://www.dk.xemacs.org/Documentation/packages/html/pgg.html,
2852 @cite{The PGG Manual}}.
2853 @end ifhtml
2854
2855 @node Printing, Files and Pipes, Reading PGP, Reading Mail
2856 @section Printing Your Mail
2857
2858 @cindex printing
2859 @findex mh-ps-print-msg
2860 @findex mh-ps-print-msg-file
2861 @kindex P f
2862 @kindex P p
2863 @vindex mh-lpr-command-format
2864 @vindex mh-print-background-flag
2865
2866 To print messages in MH-E, use the command @kbd{P p}
2867 (@code{mh-ps-print-msg}). You can print all the messages in a range
2868 (as in @kbd{C-u P p 1 3 5-7 last:5 frombob @key{RET}},
2869 @pxref{Ranges}). You can also send the output to a file with @kbd{P f}
2870 (@code{mh-ps-print-msg-file}). This command will print inline text
2871 attachments but will not decrypt messages. However, when a message is
2872 displayed in an MH-Show buffer, then that buffer is used verbatim for
2873 printing with the caveat that only text attachments, if opened inline,
2874 are printed. Therefore, encrypted messages can be printed by showing
2875 and decrypting them first. The commands @kbd{P p} and @kbd{P f} do not
2876 use the options @code{mh-lpr-command-format} or
2877 @code{mh-print-background-flag}, described below.
2878
2879 @findex mh-ps-print-toggle-color
2880 @kindex P C
2881 @vindex ps-print-color-p
2882
2883 Colors are emulated on black-and-white printers with shades of gray.
2884 This might produce illegible output, even if your screen colors only
2885 use shades of gray. If this is the case, try using the command @kbd{P
2886 C} (@code{mh-ps-print-toggle-color}) to toggle between color, no
2887 color, and a black and white representation of the colors and see
2888 which works best. You change this setting permanently by customizing
2889 the option @code{ps-print-color-p}.
2890
2891 @findex mh-ps-print-toggle-faces
2892 @kindex P F
2893
2894 Another related function is the command @kbd{P F}
2895 (@code{mh-ps-print-toggle-faces}). This command toggles between using
2896 faces and not. When faces are enabled, the printed message will look
2897 very similar to the message in the MH-Show buffer.
2898
2899 @cindex ps-print package
2900 @cindex Emacs, packages, ps-print
2901
2902 MH-E uses the @samp{ps-print} package to do the printing, so you can
2903 customize the printing further by going to the @samp{ps-print}
2904 customization group.
2905
2906 @cindex @command{lpr}
2907 @cindex @command{mhl}
2908 @cindex MH commands, @command{mhl}
2909 @cindex Unix commands, @command{lpr}
2910 @findex mh-print-msg
2911 @kindex P l
2912
2913 An alternative to using the @samp{ps-print} package is the command
2914 @kbd{P l} (@code{mh-print-msg}) (the @i{l} is for @i{l}ine printer or
2915 @i{l}pr). You can print all the messages in a range. The message is
2916 formatted with @command{mhl}@footnote{See the section
2917 @uref{@value{MH-BOOK-HOME}/shomes.html#Usisho, Using mhl} in the MH
2918 book.} and printed with the @command{lpr} command.
2919
2920 @kindex P f
2921 @kindex P l
2922 @kindex P p
2923 @vindex mh-lpr-command-format
2924 @vindex mh-print-background-flag
2925
2926 The command @kbd{P l} uses two options. The option
2927 @code{mh-lpr-command-format} contains the Unix command line which
2928 performs the actual printing. The string can contain one escape,
2929 @samp{%s}, which is replaced by the name of the folder and the message
2930 number and is useful for print job names. The default setting is
2931 @code{"lpr -J '%s'"}. I use @code{"mpage -h'%s' -b Letter -H1of -mlrtb
2932 -P"} which produces a nice header and adds a bit of margin so the text
2933 fits within my printer's margins. Normally messages are printed in the
2934 foreground. If this is slow on your system, you may elect to turn on
2935 the option @code{mh-print-background-flag} to print in the background.
2936 If you do this, do not delete the message until it is printed or else
2937 the output may be truncated. These options are not used by the
2938 commands @kbd{P p} or @kbd{P f}.
2939
2940 @node Files and Pipes, Navigating, Printing, Reading Mail
2941 @section Files and Pipes
2942
2943 @cindex files
2944 @cindex pipes
2945 @findex mh-refile-or-write-again
2946 @findex mh-write-msg-to-file
2947 @kindex >
2948 @kindex !
2949
2950 MH-E does offer a couple of commands that are not a part of MH@. The
2951 first one, @kbd{>} (@code{mh-write-msg-to-file}), writes a message to
2952 a file. You are prompted for the filename. If the file already exists,
2953 the message is appended to it. You can also write the message to the
2954 file without the header by specifying a prefix argument (such as
2955 @kbd{C-u > /tmp/foobar @key{RET}}). Subsequent writes to the same file
2956 can be made with the command @kbd{!}
2957 (@code{mh-refile-or-write-again}).
2958
2959 @findex mh-pipe-msg
2960 @kindex |
2961 @kindex l
2962
2963 You can also pipe the message through a Unix shell command with the
2964 command @kbd{|} (@code{mh-pipe-msg}). You are prompted for the Unix
2965 command through which you wish to run your message. If you give a
2966 prefix argument to this command, the message header is included in the
2967 text passed to the command (the contrived example @kbd{C-u | lpr}
2968 would be done with the @kbd{l} command instead).
2969
2970 @cindex @command{shar}
2971 @cindex @command{uuencode}
2972 @cindex Unix commands, @command{shar}
2973 @cindex Unix commands, @command{uuencode}
2974 @findex mh-store-msg
2975 @kindex X s
2976 @vindex mh-store-default-directory
2977
2978 If the message is a shell archive @command{shar} or has been run
2979 through @command{uuencode} use @kbd{X s} (@code{mh-store-msg}) to
2980 extract the body of the message. The default directory for extraction
2981 is the current directory; however, you have a chance to specify a
2982 different extraction directory. The next time you use this command,
2983 the default directory is the last directory you used. If you would
2984 like to change the initial default directory, customize the option
2985 @code{mh-store-default-directory}, change the value from
2986 @samp{Current} to @samp{Directory}, and then enter the name of the
2987 directory for storing the content of these messages.
2988
2989 @findex mh-store-buffer
2990 @kindex @key{RET}
2991 @kindex X s
2992
2993 By the way, @kbd{X s} calls the Emacs Lisp function
2994 @code{mh-store-buffer}. I mention this because you can use it directly
2995 if you're editing a buffer that contains a file that has been run
2996 through @command{uuencode} or @command{shar}. For example, you can
2997 extract the contents of the current buffer in your home directory by
2998 typing @kbd{M-x mh-store-buffer @key{RET} ~ @key{RET}}.
2999
3000 @node Navigating, Miscellaneous Commands and Options, Files and Pipes, Reading Mail
3001 @section Navigating
3002
3003 @cindex moving between messages
3004 @cindex navigation
3005 @findex mh-first-msg
3006 @findex mh-goto-msg
3007 @findex mh-last-msg
3008 @findex mh-next-undeleted-msg
3009 @findex mh-next-unread-msg
3010 @findex mh-previous-undeleted-msg
3011 @findex mh-previous-unread-msg
3012 @kindex g
3013 @kindex M-<
3014 @kindex M->
3015 @kindex M-n
3016 @kindex M-p
3017 @kindex n
3018 @kindex p
3019
3020 To move on to the next message, use the command @kbd{n}
3021 (@code{mh-next-undeleted-msg}); use @kbd{p}
3022 (@code{mh-previous-undeleted-msg}) to read the previous message. To
3023 move to the next unread message, use @kbd{M-n}
3024 (@code{mh-next-unread-msg}); use @kbd{M-p}
3025 (@code{mh-previous-unread-msg}) to move to the previous unread
3026 message. These commands can be given a prefix argument to specify how
3027 many messages to skip (for example, @kbd{5 n}). You can also move to a
3028 specific message with @kbd{g} (@code{mh-goto-msg}). You can enter the
3029 message number either before or after typing @kbd{g}. In the latter
3030 case, Emacs prompts you. Finally, you can go to the first or last
3031 message with @kbd{M-<} (@code{mh-first-msg}) and @kbd{M->}
3032 (@code{mh-last-msg}) respectively.
3033
3034 @cindex MH-Folder mode
3035 @cindex modes, MH-Folder
3036 @findex next-line
3037 @findex previous-line
3038 @kindex C-n
3039 @kindex C-p
3040 @kindex @key{RET}
3041
3042 You can also use the Emacs commands @kbd{C-p} (@code{previous-line})
3043 and @kbd{C-n} (@code{next-line}) to move up and down the scan lines in
3044 the MH-Folder window. These commands can be used in conjunction with
3045 @key{RET} to look at deleted or refiled messages.
3046
3047 @cindex deleting messages
3048 @findex mh-delete-msg
3049 @kindex d
3050 @kindex n
3051 @kindex p
3052
3053 To mark a message for deletion, use the command @kbd{d}
3054 (@code{mh-delete-msg}). A @samp{D} is placed by the message in the
3055 scan window, and the next undeleted message is displayed. If the
3056 previous command had been @kbd{p}, then the next message displayed is
3057 the first undeleted message previous to the message just deleted. Use
3058 @kbd{n} to force subsequent @kbd{d} commands to move forward to the
3059 next undeleted message after deleting the message under the cursor.
3060 You may also specify a range (for example, @kbd{C-u d 1 3 5-7 last:5
3061 frombob @key{RET}}, @pxref{Ranges}).
3062
3063 @findex mh-delete-msg-no-motion
3064 @kindex C-d
3065
3066 The command @kbd{C-d} (@code{mh-delete-msg-no-motion}) marks the
3067 message (or messages in range) for deletion but leaves the cursor at
3068 the current message in case you wish to perform other operations on
3069 the message.
3070
3071 @findex mh-delete-subject
3072 @findex mh-delete-subject-or-thread
3073 @findex mh-thread-delete
3074 @findex mh-undo
3075 @kindex k
3076 @kindex T d
3077 @kindex u
3078
3079 And to delete more messages faster, you can use @kbd{k}
3080 (@code{mh-delete-subject-or-thread}) to delete all the messages with
3081 the same subject as the current message. This command puts these
3082 messages in a sequence named @samp{subject}. You can undo this action
3083 by using @kbd{u} (@code{mh-undo}) with a prefix argument and then
3084 specifying the @samp{subject} sequence. However, if the buffer is
3085 displaying a threaded view of the folder then @kbd{k} behaves like
3086 @kbd{T d} (@code{mh-thread-delete}). @xref{Threading}.
3087
3088 @findex mh-execute-commands
3089 @kindex x
3090
3091 However you mark a message for deletion, the command @kbd{x}
3092 (@code{mh-execute-commands}) actually carries out the deletion
3093 (@pxref{Folders}).
3094
3095 @vindex mh-delete-msg-hook
3096
3097 The hook @code{mh-delete-msg-hook} is called after you mark a message
3098 for deletion. For example, a past maintainer of MH-E used this once
3099 when he kept statistics on his mail usage.
3100
3101 @node Miscellaneous Commands and Options, , Navigating, Reading Mail
3102 @section Miscellaneous Commands and Options
3103
3104 This section contains a few more miscellaneous commands and options.
3105
3106 @cindex editing message
3107 @findex mh-modify
3108 @kindex M
3109
3110 There are times when you need to edit a message. For example, you may
3111 need to fix a broken Content-Type header field. You can do this with
3112 the command @kbd{M} (@code{mh-modify}). It displays the raw message in
3113 an editable buffer. When you are done editing, save and kill the
3114 buffer as you would any other.
3115
3116 @findex mh-kill-folder
3117 @findex mh-pack-folder
3118 @vindex mh-do-not-confirm-flag
3119
3120 Commands such as @code{mh-pack-folder} prompt to confirm whether to
3121 process outstanding moves and deletes or not before continuing.
3122 Turning on the option @code{mh-do-not-confirm-flag} means that these
3123 actions will be performed---which is usually desired but cannot be
3124 retracted---without question@footnote{In previous versions of MH-E,
3125 this option suppressed the confirmation in @code{mh-kill-folder}.
3126 Since this kept most users from setting this option,
3127 @code{mh-kill-folder} was modified in version 6.0 to always ask for
3128 confirmation subject to @code{mh-kill-folder-suppress-prompt-hook}.
3129 @xref{Folders}.}.
3130
3131 @cindex MH-Folder mode
3132 @cindex modes, MH-Folder
3133 @vindex mh-summary-height
3134
3135 The option @code{mh-summary-height} controls the number of scan lines
3136 displayed in the MH-Folder window, including the mode line. The
3137 default value of this option is @samp{Automatic} which means that the
3138 MH-Folder buffer will maintain the same proportional size if the frame
3139 is resized. If you'd prefer a fixed height, then choose the
3140 @samp{Fixed Size} option and enter the number of lines you'd like to
3141 see.
3142
3143 @vindex mh-bury-show-buffer-flag
3144
3145 Normally the buffer for displaying messages is buried at the bottom at
3146 the buffer stack. You may wish to disable this feature by turning off
3147 the option @code{mh-bury-show-buffer-flag}. One advantage of not
3148 burying the show buffer is that one can delete the show buffer more
3149 easily in an electric buffer list because of its proximity to its
3150 associated MH-Folder buffer. Try running @kbd{M-x
3151 electric-buffer-list} to see what I mean.
3152
3153 @cindex @file{.emacs}
3154 @cindex files, @file{.emacs}
3155 @cindex reading mail
3156
3157 Before we leave this section, I'll include a function that I use as a
3158 front end to MH-E@footnote{Stephen Gildea's favorite binding is
3159 @kbd{(global-set-key "\C-cr" 'mh-rmail)}.}. It toggles between your
3160 working window configuration, which may be quite involved---windows
3161 filled with source, compilation output, man pages, and other
3162 documentation---and your MH-E window configuration. Like the rest of
3163 the customization described in this section, simply add the following
3164 code to @file{~/.emacs}.
3165
3166 @iftex
3167 @filbreak
3168 @end iftex
3169
3170 @findex mh-rmail, example
3171
3172 @smalllisp
3173 @group
3174 (defvar my-mh-screen-saved nil
3175 "Set to non-@code{nil} when MH-E window configuration shown.")
3176 (defvar my-normal-screen nil "Normal window configuration.")
3177 (defvar my-mh-screen nil "MH-E window configuration.")
3178
3179 (defun my-mh-rmail (&optional arg)
3180 "Toggle between MH-E and normal screen configurations.
3181 With non-@code{nil} or prefix argument, @i{inc} mailbox as well
3182 when going into mail."
3183 (interactive "P") ; @r{user callable function, P=prefix arg}
3184 (setq my-mh-screen-saved ; @r{save state}
3185 (cond
3186 ;; @r{Bring up MH-E screen if arg or normal window configuration.}
3187 ;; @r{If arg or +inbox buffer doesn't exist, run mh-rmail.}
3188 ((or arg (null my-mh-screen-saved))
3189 (setq my-normal-screen (current-window-configuration))
3190 (if (or arg (null (get-buffer "+inbox")))
3191 (mh-rmail)
3192 (set-window-configuration my-mh-screen))
3193 t) ; @r{set my-mh-screen-saved to @code{t}}
3194 ;; @r{Otherwise, save MH-E screen and restore normal screen.}
3195 (t
3196 (setq my-mh-screen (current-window-configuration))
3197 (set-window-configuration my-normal-screen)
3198 nil)))) ; @r{set my-mh-screen-saved to nil}
3199
3200 (global-set-key "\C-x\r" 'my-mh-rmail) ;@r{ call with C-x @key{RET}}
3201
3202 @i{Starting MH-E}
3203
3204 @end group
3205 @end smalllisp
3206
3207 If you type an argument (@kbd{C-u}) or if @code{my-mh-screen-saved} is
3208 @code{nil} (meaning a non-MH-E window configuration), the current
3209 window configuration is saved, either the @samp{+inbox} buffer is
3210 displayed or @code{mh-rmail} is run, and the MH-E window configuration
3211 is shown. Otherwise, the MH-E window configuration is saved and the
3212 original configuration is displayed.
3213
3214 @node Folders, Sending Mail, Reading Mail, Top
3215 @chapter Organizing Your Mail with Folders
3216
3217 @cindex @samp{Folder} menu
3218 @cindex @samp{Message} menu
3219 @cindex folders
3220 @cindex menu, @samp{Folder}
3221 @cindex menu, @samp{Message}
3222 @cindex using folders
3223
3224 This chapter discusses the things you can do with folders within MH-E@.
3225 The commands in this chapter are also found in the @samp{Folder} and
3226 @samp{Message} menus.
3227
3228 @table @kbd
3229 @kindex ?
3230 @findex mh-help
3231 @item ?
3232 Display cheat sheet for the MH-E commands (@code{mh-help}).
3233 @c -------------------------
3234 @kindex !
3235 @findex mh-refile-or-write-again
3236 @item !
3237 Repeat last output command (@code{mh-refile-or-write-again}).
3238 @c -------------------------
3239 @cindex @samp{Message > Copy Message to Folder...} menu item
3240 @cindex menu item, @samp{Message > Copy Message to Folder...}
3241 @kindex c
3242 @findex mh-copy-msg
3243 @item c
3244 Copy range to folder (@code{mh-copy-msg}).
3245 @c -------------------------
3246 @kindex F ?
3247 @findex mh-prefix-help
3248 @item F ?
3249 Display cheat sheet for the commands of the current prefix in
3250 minibuffer (@code{mh-prefix-help}).
3251 @c -------------------------
3252 @kindex F '
3253 @findex mh-index-ticked-messages
3254 @item F '
3255 Display ticked messages (@code{mh-index-ticked-messages}).
3256 @c -------------------------
3257 @kindex F c
3258 @findex mh-catchup
3259 @item F c
3260 Delete range from the @samp{unseen} sequence (@code{mh-catchup}).
3261 @c -------------------------
3262 @kindex F k
3263 @findex mh-kill-folder
3264 @item F k
3265 Remove folder (@code{mh-kill-folder}).
3266 @c -------------------------
3267 @cindex @samp{Folder > List Folders} menu item
3268 @cindex menu item, @samp{Folder > List Folders}
3269 @kindex F l
3270 @findex mh-list-folders
3271 @item F l
3272 List all folders (@code{mh-list-folders}).
3273 @c -------------------------
3274 @cindex @samp{Folder > View New Messages} menu item
3275 @cindex menu item, @samp{Folder > View New Messages}
3276 @kindex F n
3277 @findex mh-index-new-messages
3278 @item F n
3279 Display unseen messages (@code{mh-index-new-messages}).
3280 @c -------------------------
3281 @cindex @samp{Folder > Pack Folder} menu item
3282 @cindex menu item, @samp{Folder > Pack Folder}
3283 @kindex F p
3284 @findex mh-pack-folder
3285 @item F p
3286 Pack folder (@code{mh-pack-folder}).
3287 @c -------------------------
3288 @kindex F q
3289 @findex mh-index-sequenced-messages
3290 @item F q
3291 Display messages in any sequence (@code{mh-index-sequenced-messages}).
3292 @c -------------------------
3293 @cindex @samp{Folder > Rescan Folder} menu item
3294 @cindex menu item, @samp{Folder > Rescan Folder}
3295 @kindex F r
3296 @findex mh-rescan-folder
3297 @item F r
3298 Rescan folder (@code{mh-rescan-folder}).
3299 @c -------------------------
3300 @cindex @samp{Folder > Search...} menu item
3301 @cindex menu item, @samp{Folder > Search...}
3302 @kindex F s
3303 @findex mh-search
3304 @item F s
3305 Search your MH mail (@code{mh-search}).
3306 @c -------------------------
3307 @cindex @samp{Folder > Sort Folder} menu item
3308 @cindex menu item, @samp{Folder > Sort Folder}
3309 @kindex F S
3310 @findex mh-sort-folder
3311 @item F S
3312 Sort folder (@code{mh-sort-folder}).
3313 @c -------------------------
3314 @kindex F u
3315 @findex mh-undo-folder
3316 @item F u
3317 Undo all refiles and deletes in the current folder (@code{mh-undo-folder}).
3318 @c -------------------------
3319 @cindex @samp{Folder > Visit a Folder...} menu item
3320 @cindex menu item, @samp{Folder > Visit a Folder...}
3321 @kindex F v
3322 @findex mh-visit-folder
3323 @item F v
3324 Visit folder (@code{mh-visit-folder}).
3325 @c -------------------------
3326 @cindex @samp{Message > Refile Message} menu item
3327 @cindex menu item, @samp{Message > Refile Message}
3328 @kindex o
3329 @findex mh-refile-msg
3330 @item o
3331 Refile (output) range into folder (@code{mh-refile-msg}).
3332 @c -------------------------
3333 @cindex @samp{Folder > Quit MH-E} menu item
3334 @cindex menu item, @samp{Folder > Quit MH-E}
3335 @kindex q
3336 @findex mh-quit
3337 @item q
3338 Quit the current MH-E folder (@code{mh-quit}).
3339 @c -------------------------
3340 @cindex @samp{Folder > Toggle Show/Folder} menu item
3341 @cindex menu item, @samp{Folder > Toggle Show/Folder}
3342 @kindex t
3343 @findex mh-toggle-showing
3344 @item t
3345 Toggle between MH-Folder and MH-Folder Show modes
3346 (@code{mh-toggle-showing}).
3347 @c -------------------------
3348 @cindex @samp{Message > Undo Delete/Refile} menu item
3349 @cindex menu item, @samp{Message > Undo Delete/Refile}
3350 @kindex u
3351 @findex mh-undo
3352 @item u
3353 Undo pending deletes or refiles in range (@code{mh-undo}).
3354 @c -------------------------
3355 @cindex @samp{Message > Execute Delete/Refile} menu item
3356 @cindex menu item, @samp{Message > Execute Delete/Refile}
3357 @kindex x
3358 @findex mh-execute-commands
3359 @item x
3360 Process outstanding delete and refile requests
3361 (@code{mh-execute-commands}).
3362 @end table
3363
3364 @cindex @samp{mh-folder} customization group
3365 @cindex customization group, @samp{mh-folder}
3366
3367 The @samp{mh-folder} customization group is used to tune these
3368 commands.
3369
3370 @vtable @code
3371 @item mh-new-messages-folders
3372 Folders searched for the @samp{unseen} sequence (default:
3373 @code{Inbox}).
3374 @c -------------------------
3375 @item mh-ticked-messages-folders
3376 Folders searched for @code{mh-tick-seq} (default: @code{t}).
3377 @c -------------------------
3378 @item mh-large-folder
3379 The number of messages that indicates a large folder (default: 200).
3380 @c -------------------------
3381 @item mh-recenter-summary-flag
3382 On means to recenter the summary window (default: @samp{off}).
3383 @c -------------------------
3384 @item mh-recursive-folders-flag
3385 On means that commands which operate on folders do so recursively
3386 (default: @samp{off}).
3387 @c -------------------------
3388 @item mh-sortm-args
3389 Additional arguments for @command{sortm} (default: @code{nil}).
3390 @end vtable
3391
3392 The following hooks are available.
3393
3394 @vtable @code
3395 @item mh-after-commands-processed-hook
3396 Hook run by @kbd{x} after performing outstanding refile and delete
3397 requests (default: @code{nil}).
3398 @c -------------------------
3399 @item mh-before-commands-processed-hook
3400 Hook run by @kbd{x} before performing outstanding refile and delete
3401 requests (default: @code{nil}).
3402 @c -------------------------
3403 @item mh-before-quit-hook
3404 Hook run by q before quitting MH-E (default: @code{nil}).
3405 @c -------------------------
3406 @item mh-folder-mode-hook
3407 Hook run by @code{mh-folder-mode} when visiting a new folder (default:
3408 @code{nil}).
3409 @c -------------------------
3410 @item mh-kill-folder-suppress-prompt-hook
3411 Abnormal hook run at the beginning of @code{mh-kill-folder} (default:
3412 @code{'mh-search-p}).
3413 @c -------------------------
3414 @item mh-pack-folder-hook
3415 Hook run by @code{mh-pack-folder} after renumbering the messages
3416 (default: @code{nil}).
3417 @c -------------------------
3418 @item mh-quit-hook
3419 Hook run by q after quitting MH-E (default: @code{nil}).
3420 @c -------------------------
3421 @item mh-refile-msg-hook
3422 Hook run by o after marking each message for refiling (default:
3423 @code{nil}).
3424 @end vtable
3425
3426 The following faces are available for customizing the appearance of
3427 the MH-Folder buffer. @xref{Scan Line Formats}.
3428
3429 @vtable @code
3430 @item mh-folder-address
3431 Recipient face.
3432 @c -------------------------
3433 @item mh-folder-body
3434 Body text face.
3435 @c -------------------------
3436 @item mh-folder-cur-msg-number
3437 Current message number face.
3438 @c -------------------------
3439 @item mh-folder-date
3440 Date face.
3441 @c -------------------------
3442 @item mh-folder-deleted
3443 Deleted message face.
3444 @c -------------------------
3445 @item mh-folder-followup
3446 @samp{Re:} face.
3447 @c -------------------------
3448 @item mh-folder-msg-number
3449 Message number face.
3450 @c -------------------------
3451 @item mh-folder-refiled
3452 Refiled message face.
3453 @c -------------------------
3454 @vindex mh-scan-format-nmh
3455 @vindex mh-scan-sent-to-me-sender-regexp
3456 @item mh-folder-sent-to-me-hint
3457 Fontification hint face in messages sent directly to us. The detection
3458 of messages sent to us is governed by the scan format
3459 @code{mh-scan-format-nmh} and regular expression
3460 @code{mh-scan-sent-to-me-sender-regexp}.
3461 @c -------------------------
3462 @vindex mh-scan-format-nmh
3463 @vindex mh-scan-sent-to-me-sender-regexp
3464 @item mh-folder-scan-format
3465 Sender face in messages sent directly to us. The detection of messages
3466 sent to us is governed by the scan format @code{mh-scan-format-nmh}
3467 and regular expression @code{mh-scan-sent-to-me-sender-regexp}.
3468 @c -------------------------
3469 @item mh-folder-subject
3470 Subject face.
3471 @c -------------------------
3472 @item mh-folder-tick
3473 Ticked message face.
3474 @c -------------------------
3475 @item mh-folder-to
3476 @samp{To:} face.
3477 @end vtable
3478
3479 @vindex mh-folder-mode-hook
3480
3481 The hook @code{mh-folder-mode-hook} is called when visiting a new
3482 folder in MH-Folder mode. This could be used to set your own key
3483 bindings, for example:
3484
3485 @vindex mh-folder-mode-hook, example
3486
3487 @smalllisp
3488 @group
3489 (defvar my-mh-init-done nil
3490 "Non-@code{nil} when one-time MH-E settings made.")
3491
3492 (defun my-mh-folder-mode-hook ()
3493 "Hook to set key bindings in MH-Folder mode."
3494 (if (not my-mh-init-done) ; @r{only need to bind the keys once }
3495 (progn
3496 (local-set-key "//" 'my-search-msg)
3497 (local-set-key "b" 'mh-burst-digest) ; @r{better use of @kbd{b}}
3498 (setq my-mh-init-done t))))
3499
3500 (add-hook 'mh-folder-mode-hook 'my-mh-folder-mode-hook)
3501
3502 (defun my-search-msg ()
3503 "Search for a regexp in the current message."
3504 (interactive) ; @r{user function}
3505 (save-window-excursion
3506 (other-window 1) ; @r{go to next window}
3507 (isearch-forward-regexp))) ; @r{string search; hit return}
3508 ; @r{ when done}
3509
3510 @i{Create additional key bindings via mh-folder-mode-hook}
3511
3512 @end group
3513 @end smalllisp
3514
3515 @cindex @command{folder}
3516 @cindex @command{refile}
3517 @cindex MH commands, @command{folder}
3518 @cindex MH commands, @command{refile}
3519 @findex mh-refile-msg
3520 @kindex o
3521 @vindex mh-refile-msg-hook
3522
3523 MH-E has analogies for each of the MH @command{folder} and
3524 @command{refile} commands@footnote{See the sections
3525 @uref{@value{MH-BOOK-HOME}/fol.html#Youfol, Your Current Folder:
3526 folder} and @uref{@value{MH-BOOK-HOME}/fol.html#Movref, Moving and
3527 Linking Messages: refile} in the MH book.}. To refile a message in
3528 another folder, use the command @kbd{o} (@code{mh-refile-msg})
3529 (mnemonic: ``output''). You are prompted for the folder name
3530 (@pxref{Folder Selection}). Note that this command can also be used to
3531 create folders. If you specify a folder that does not exist, you will
3532 be prompted to create it. The hook @code{mh-refile-msg-hook} is called
3533 after a message is marked to be refiled.
3534
3535 @findex mh-write-msg-to-file
3536 @kindex !
3537
3538 If you are refiling several messages into the same folder, you can use
3539 the command @kbd{!} (@code{mh-refile-or-write-again}) to repeat the
3540 last refile or write (for the description of @kbd{>}
3541 (@code{mh-write-msg-to-file}), @pxref{Files and Pipes}). You can use a
3542 range in either case (for example, @kbd{C-u o 1 3 5-7 last:5 frombob
3543 @key{RET}}, @pxref{Ranges}).
3544
3545 @cindex expunging refiles and deletes
3546 @cindex undoing refiles and deletes
3547 @findex mh-undo
3548 @kindex u
3549
3550 If you've deleted a message or refiled it, but changed your mind, you
3551 can cancel the action before you've executed it. Use @kbd{u}
3552 (@code{mh-undo}) to undo a refile on or deletion of a single message.
3553 You can also undo refiles and deletes for messages that are found in a
3554 given range (@pxref{Ranges}).
3555
3556 @findex mh-undo-folder
3557 @kindex F u
3558
3559 Alternatively, you can use @kbd{F u} (@code{mh-undo-folder}) to undo
3560 all refiles and deletes in the current folder.
3561
3562 @findex mh-execute-commands
3563 @kindex x
3564
3565 If you've marked messages to be deleted or refiled and you want to go
3566 ahead and delete or refile the messages, use @kbd{x}
3567 (@code{mh-execute-commands}). Many MH-E commands that may affect the
3568 numbering of the messages (such as @kbd{F r} or @kbd{F p}) will ask if
3569 you want to process refiles or deletes first and then either run
3570 @kbd{x} for you or undo the pending refiles and deletes.
3571
3572 @kindex x
3573 @vindex mh-after-commands-processed-hook
3574 @vindex mh-before-commands-processed-hook
3575 @vindex mh-current-folder
3576
3577 The command @kbd{x} runs @code{mh-before-commands-processed-hook}
3578 before the commands are processed and
3579 @code{mh-after-commands-processed-hook} after the commands are
3580 processed. Variables that are useful with the former hook include
3581 @code{mh-delete-list} and @code{mh-refile-list} which can be used to
3582 see which changes will be made to the current folder,
3583 @code{mh-current-folder}. Variables that are useful with the latter
3584 hook include @code{mh-folders-changed}, which lists which folders were
3585 affected by deletes and refiles. This list will always include the
3586 current folder @code{mh-current-folder}.
3587
3588 @findex mh-copy-msg
3589 @kindex c
3590 @kindex o
3591
3592 If you wish to copy a message to another folder, you can use the
3593 command @kbd{c} (@code{mh-copy-msg}) (see the @option{-link} argument
3594 to @command{refile}(1)). Like the command @kbd{o}, this command
3595 prompts you for the name of the target folder and you can specify a
3596 range (@pxref{Ranges}). Note that unlike the command @kbd{o}, the copy
3597 takes place immediately. The original copy remains in the current
3598 folder.
3599
3600 @cindex junk mail
3601 @cindex MH-Folder mode
3602 @cindex MH-Folder Show mode
3603 @cindex modes, MH-Folder
3604 @cindex modes, MH-Folder Show
3605 @cindex spam
3606 @findex mh-toggle-showing
3607 @kindex t
3608
3609 The command @kbd{t} (@code{mh-toggle-showing}) switches between
3610 MH-Folder mode and MH-Folder Show mode@footnote{For you Emacs wizards,
3611 this is implemented as an Emacs minor mode.}. MH-Folder mode turns off
3612 the associated show buffer so that you can perform operations on the
3613 messages quickly without reading them. This is an excellent way to
3614 prune out your junk mail or to refile a group of messages to another
3615 folder for later examination.
3616
3617 @cindex MH-Folder mode
3618 @cindex MH-Show mode
3619 @cindex modes, MH-Folder
3620 @cindex modes, MH-Show
3621 @cindex moving between messages
3622 @kindex t
3623 @vindex mh-recenter-summary-flag
3624
3625 When you use @kbd{t} to toggle from MH-Folder Show mode to MH-Folder
3626 mode, the MH-Show buffer is hidden and the MH-Folder buffer is left
3627 alone. Setting @code{mh-recenter-summary-flag} to a non-@code{nil}
3628 value causes the toggle to display as many scan lines as possible,
3629 with the cursor at the middle. The effect of
3630 @code{mh-recenter-summary-flag} is rather useful, but it can be
3631 annoying on a slow network connection.
3632
3633 @findex mh-visit-folder
3634 @kindex F v
3635 @vindex mh-large-folder
3636
3637 When you want to read the messages that you have refiled into folders,
3638 use the command @kbd{F v} (@code{mh-visit-folder}) to visit the
3639 folder. You are prompted for the folder name. The folder buffer will
3640 show just unseen messages if there are any; otherwise, it will show
3641 all the messages in the buffer as long there are fewer than
3642 @code{mh-large-folder} messages. If there are more, then you are
3643 prompted for a range of messages to scan. You can provide a prefix
3644 argument in order to specify a range of messages to show when you
3645 visit the folder (@pxref{Ranges}). In this case, regions are not used
3646 to specify the range and @code{mh-large-folder} is ignored. Note that
3647 this command can also be used to create folders. If you specify a
3648 folder that does not exist, you will be prompted to create it.
3649
3650 @findex mh-search
3651 @kindex F s
3652
3653 If you forget where you've refiled your messages, you can find them
3654 using @kbd{F s} (@code{mh-search}). @xref{Searching}.
3655
3656 @cindex @command{procmail}
3657 @cindex @samp{unseen} sequence
3658 @cindex sequence, @samp{unseen}
3659 @cindex Unix commands, @command{procmail}
3660 @cindex unseen messages, viewing
3661 @findex mh-index-new-messages
3662 @kindex F n
3663 @vindex mh-new-messages-folders
3664
3665 If you use a program such as @command{procmail} to file your incoming
3666 mail automatically, you can display new, unseen, messages using the
3667 command @kbd{F n} (@code{mh-index-new-messages}). All messages in the
3668 @samp{unseen} sequence from the folders in
3669 @code{mh-new-messages-folders} are listed. However, this list of
3670 folders can be overridden with a prefix argument: with a prefix
3671 argument, enter a space-separated list of folders, or nothing to
3672 search all folders.
3673
3674 @cindex @samp{tick} sequence
3675 @cindex sequence, @samp{tick}
3676 @cindex ticked messages, viewing
3677 @findex mh-index-ticked-messages
3678 @kindex F '
3679 @vindex mh-ticked-messages-folders
3680
3681 If you have ticked messages (@pxref{Sequences}), you can display them
3682 using the command @kbd{F '} (@code{mh-index-ticked-messages}). All
3683 messages in the @samp{tick} sequence from the folders in
3684 @code{mh-ticked-messages-folders} are listed. With a prefix argument,
3685 enter a space-separated list of folders, or nothing to search all
3686 folders.
3687
3688 @findex mh-index-sequenced-messages
3689 @kindex F q
3690 @vindex mh-new-messages-folders
3691
3692 You can display messages in any sequence with the command @kbd{F q}
3693 (@code{mh-index-sequenced-messages}). All messages from the folders in
3694 @code{mh-new-messages-folders} in the sequence you provide are listed.
3695 With a prefix argument, enter a space-separated list of folders at the
3696 prompt, or nothing to search all folders.
3697
3698 @vindex mh-new-messages-folders
3699 @vindex mh-recursive-folders-flag
3700 @vindex mh-ticked-messages-folders
3701
3702 Set the options @code{mh-new-messages-folders} and
3703 @code{mh-ticked-messages-folders} to @samp{Inbox} to search the
3704 @samp{+inbox} folder or @samp{All} to search all of the top level
3705 folders. Otherwise, list the folders that should be searched with the
3706 @samp{Choose Folders} menu item. See @code{mh-recursive-folders-flag}.
3707
3708 @cindex buffers, @samp{*MH-E Folders*}
3709 @cindex @samp{*MH-E Folders*}
3710 @findex mh-kill-folder
3711 @findex mh-list-folders
3712 @findex mh-pack-folder
3713 @findex mh-rescan-folder
3714 @findex mh-sort-folder
3715 @kindex F k
3716 @kindex F l
3717 @kindex F p
3718 @kindex F r
3719 @kindex F S
3720
3721 Other commands you can perform on folders include: @kbd{F l}
3722 (@code{mh-list-folders}), to place a listing of all the folders in
3723 your mail directory in a buffer called @samp{*MH-E Folders*}
3724 (@pxref{Miscellaneous}); @kbd{F k} (@code{mh-kill-folder}), to remove
3725 a folder; @kbd{F S} (@code{mh-sort-folder}), to sort the messages by
3726 date (see @command{sortm}(1) to see how to sort by other criteria);
3727 @kbd{F p} (@code{mh-pack-folder}), to pack a folder, removing gaps
3728 from the numbering sequence; and @kbd{F r} (@code{mh-rescan-folder}),
3729 to rescan the folder, which is useful to grab all messages in your
3730 @samp{+inbox} after processing your new mail for the first time. If
3731 you don't want to rescan the entire folder, the commands @kbd{F r} or
3732 @kbd{F p} will accept a range (@pxref{Ranges}).
3733
3734 @kindex F p
3735 @vindex mh-pack-folder-hook
3736
3737 The command @kbd{F p} runs @code{mh-pack-folder-hook} after
3738 renumbering the messages. A variable that is useful with this hook
3739 is @code{mh-current-folder}.
3740
3741 @kindex @key{TAB}
3742 @vindex mh-recursive-folders-flag
3743
3744 By default, operations on folders work only one level at a time. Set
3745 @code{mh-recursive-folders-flag} to non-@code{nil} to operate on all
3746 folders. This mostly means that you'll be able to see all your folders
3747 when you press @key{TAB} when prompted for a folder name.
3748
3749 @findex mh-search-p
3750 @kindex k
3751 @vindex mh-kill-folder-suppress-prompt-functions
3752
3753 The hook @code{mh-kill-folder-suppress-prompt-functions} is an abnormal
3754 hook run at the beginning of the command @kbd{k}. The hook functions
3755 are called with no arguments and should return a non-nil value to
3756 suppress the normal prompt when you remove a folder. This is useful
3757 for folders that are easily regenerated. The default value of
3758 @code{mh-search-p} suppresses the prompt on folders generated by
3759 searching.
3760
3761 @sp 1
3762 @center @strong{NOTE}
3763
3764 @quotation
3765 Use this hook with care. If there is a bug in your hook which returns
3766 @code{t} on @samp{+inbox} and you press @kbd{k} by accident in the
3767 @code{+inbox} folder, you will not be happy.
3768 @end quotation
3769 @sp 1
3770
3771 @cindex @command{sortm}
3772 @cindex @file{.mh_profile}
3773 @cindex files, @file{.mh_profile}
3774 @cindex MH commands, @command{sortm}
3775 @cindex MH profile component, @samp{sortm:}
3776 @cindex @samp{sortm:} MH profile component
3777 @kindex F S
3778 @vindex mh-sortm-args
3779
3780 The option @code{mh-sortm-args} holds extra arguments to pass on to
3781 the command @command{sortm}@footnote{See the section
3782 @uref{@value{MH-BOOK-HOME}/sorsor.html, Sorting Messages: sortm} in the
3783 MH book.} when a prefix argument is used with @kbd{F S}. Normally
3784 default arguments to @command{sortm} are specified in the MH profile.
3785 This option may be used to provide an alternate view. For example,
3786 @samp{'(\"-nolimit\" \"-textfield\" \"subject\")} is a useful setting.
3787
3788 @cindex exiting
3789 @cindex quitting
3790 @findex mh-quit
3791 @kindex q
3792
3793 When you want to quit using MH-E and go back to editing, you can use
3794 the @kbd{q} (@code{mh-quit}) command. This buries the buffers of the
3795 current MH-E folder and restores the buffers that were present when
3796 you first ran @kbd{M-x mh-rmail}. It also removes any MH-E working
3797 buffers whose name begins with @samp{ *mh-} or @samp{*MH-E }
3798 (@pxref{Miscellaneous}). You can later restore your MH-E session by
3799 selecting the @samp{+inbox} buffer or by running @kbd{M-x mh-rmail}
3800 again.
3801
3802 @findex mh-execute-commands
3803 @kindex q
3804 @vindex mh-before-quit-hook
3805 @vindex mh-before-quit-hook, example
3806 @vindex mh-quit-hook
3807 @vindex mh-quit-hook, example
3808
3809 The two hooks @code{mh-before-quit-hook} and @code{mh-quit-hook} are
3810 called by @kbd{q}. The former one is called before the quit occurs, so
3811 you might use it to perform any MH-E operations; you could perform
3812 some query and abort the quit or call @code{mh-execute-commands}, for
3813 example. The latter is not run in an MH-E context, so you might use it
3814 to modify the window setup. If you find that @kbd{q} buries a lot of
3815 buffers that you would rather remove, you can use both
3816 @code{mh-before-quit-hook} and @code{mh-quit-hook} to accomplish that.
3817
3818 @smalllisp
3819 @group
3820 (defvar my-mh-folder-buffer-to-delete nil
3821 "Folder buffer that is being quit.")
3822
3823 (defun my-mh-before-quit-hook ()
3824 "Save folder buffer that is to be deleted."
3825 (setq my-mh-folder-buffer-to-delete (current-buffer)))
3826
3827 (defun my-mh-quit-hook ()
3828 "Kill folder buffer rather than just bury it."
3829 (set-buffer my-mh-folder-buffer-to-delete)
3830 (if (get-buffer mh-show-buffer)
3831 (kill-buffer mh-show-buffer))
3832 (kill-buffer (current-buffer)))
3833
3834 @i{Kill MH-Folder buffer instead of burying it}
3835 @end group
3836 @end smalllisp
3837
3838 @cindex folders, renaming
3839 @cindex renaming folders
3840 @findex dired
3841 @findex dired-do-rename
3842
3843 You can use dired to manipulate the folders themselves. For example, I
3844 renamed my @samp{+out} folder to the more common @samp{+outbox} by
3845 running dired on my mail directory (@kbd{M-x dired RET ~/Mail RET}),
3846 moving my cursor to @samp{out} and using the command @kbd{R}
3847 (@code{dired-do-rename}).
3848
3849 @node Sending Mail, Editing Drafts, Folders, Top
3850 @chapter Sending Mail
3851
3852 @cindex sending mail
3853 @findex mh-smail
3854 @kindex M-x mh-smail
3855
3856 You can send a mail message in several ways. You can call @kbd{M-x
3857 mh-smail} directly, or from the command line like this:
3858
3859 @cindex starting from command line
3860
3861 @smallexample
3862 $ @kbd{emacs -f mh-smail}
3863 @end smallexample
3864
3865 @findex goto-address-at-point
3866 @vindex mail-user-agent
3867
3868 There are some commands that need to send a mail message, such as
3869 @code{goto-address-at-point}. You can configure Emacs to have these
3870 commands use MH-E by setting the option @code{mail-user-agent} to
3871 @samp{Emacs interface to MH}.
3872
3873 @cindex @samp{Message} menu
3874 @cindex menu, @samp{Message}
3875
3876 From within MH-E's MH-Folder mode, other methods of sending mail are
3877 available as well. These can also be found in the @samp{Message} menu.
3878
3879 @table @kbd
3880 @cindex @samp{Message > Edit Message Again} menu item
3881 @cindex menu item, @samp{Message > Edit Message Again}
3882 @kindex e
3883 @findex mh-edit-again
3884 @item e
3885 Edit a message to send it again (@code{mh-edit-again}).
3886 @c -------------------------
3887 @cindex @samp{Message > Re-edit a Bounced Message} menu item
3888 @cindex menu item, @samp{Message > Re-edit a Bounced Message}
3889 @kindex E
3890 @findex mh-extract-rejected-mail
3891 @item E
3892 Edit a message that was returned by the mail system
3893 (@code{mh-extract-rejected-mail}).
3894 @c -------------------------
3895 @cindex @samp{Message > Forward Message...} menu item
3896 @cindex menu item, @samp{Message > Forward Message...}
3897 @kindex f
3898 @findex mh-forward
3899 @item f
3900 Forward message (@code{mh-forward}).
3901 @c -------------------------
3902 @cindex @samp{Message > Reply to Message...} menu item
3903 @cindex menu item, @samp{Message > Reply to Message...}
3904 @kindex r
3905 @findex mh-reply
3906 @item r
3907 Reply to a message (@code{mh-reply}).
3908 @c -------------------------
3909 @cindex @samp{Message > Compose a New Message} menu item
3910 @cindex menu item, @samp{Message > Compose a New Message}
3911 @kindex s
3912 @findex mh-send
3913 @item s
3914 Compose a message (@code{mh-send}).
3915 @c -------------------------
3916 @cindex @samp{Message > Redistribute Message...} menu item
3917 @cindex menu item, @samp{Message > Redistribute Message...}
3918 @kindex M-d
3919 @findex mh-redistribute
3920 @item M-d
3921 Redistribute a message (@code{mh-redistribute}).
3922 @c -------------------------
3923 @findex mh-smail
3924 @item M-x mh-smail
3925 Compose a message with the MH mail system.
3926 @c -------------------------
3927 @findex mh-smail-other-window
3928 @item M-x mh-smail-other-window
3929 Compose a message with the MH mail system in other window.
3930 @end table
3931
3932 @cindex @samp{mh-sending-mail} customization group
3933 @cindex customization group, @samp{mh-sending-mail}
3934
3935 In addition, several options from the @samp{mh-sending-mail}
3936 customization group are useful when sending mail or replying to mail.
3937 They are summarized in the following table.
3938
3939 @vtable @code
3940 @item mh-compose-forward-as-mime-flag
3941 On means that messages are forwarded as attachments (default:
3942 @samp{on}).
3943 @c -------------------------
3944 @item mh-compose-letter-function
3945 Hook run when starting a new draft (default: @code{nil}).
3946 @c -------------------------
3947 @item mh-compose-prompt-flag
3948 On means prompt for header fields when composing a new draft (default:
3949 @samp{off}).
3950 @c -------------------------
3951 @item mh-forward-subject-format
3952 Format string for forwarded message subject (default: @code{"%s:
3953 %s"}).
3954 @c -------------------------
3955 @item mh-insert-x-mailer-flag
3956 On means append an @samp{X-Mailer:} header field to the header
3957 (default: @samp{on}).
3958 @c -------------------------
3959 @item mh-redist-full-contents-flag
3960 On means the @command{dist} command needs entire letter for
3961 redistribution (default: @samp{off}).
3962 @c -------------------------
3963 @item mh-reply-default-reply-to
3964 Sets the person or persons to whom a reply will be sent (default:
3965 @samp{Prompt}).
3966 @c -------------------------
3967 @item mh-reply-show-message-flag
3968 On means the MH-Show buffer is displayed using @kbd{r}
3969 (@code{mh-reply}) (default: @samp{on}).
3970 @end vtable
3971
3972 The following hooks are available.
3973
3974 @vtable @code
3975 @item mh-annotate-msg-hook
3976 Hook run by @code{mh-annotate-msg} after annotation (default:
3977 @code{nil}).
3978 @c -------------------------
3979 @item mh-forward-hook
3980 Hook run by @code{mh-forward} on a forwarded letter (default:
3981 @code{nil}).
3982 @c -------------------------
3983 @item mh-letter-mode-hook
3984 Hook run by @code{mh-letter-mode} on a new letter (default:
3985 @code{nil}).
3986 @end vtable
3987
3988 @findex mh-annotate-msg
3989 @vindex mh-annotate-list
3990 @vindex mh-annotate-msg-hook
3991 @vindex mh-current-folder
3992
3993 A hook that is called whenever a message is sent and after the scan
3994 lines and message are annotated is @code{mh-annotate-msg-hook}. Hook
3995 functions can access the current folder name with
3996 @code{mh-current-folder} and obtain the message numbers of the
3997 annotated messages with @code{mh-annotate-list}.
3998
3999 The rest of the functions and options introduced here are explained in
4000 more detail in the following sections.
4001
4002 @menu
4003 * Composing::
4004 * Replying::
4005 * Forwarding::
4006 * Redistributing::
4007 * Editing Again::
4008 @end menu
4009
4010 @node Composing, Replying, Sending Mail, Sending Mail
4011 @section Composing
4012
4013 @cindex @file{.emacs}
4014 @cindex MH-Folder mode
4015 @cindex composing mail
4016 @cindex draft
4017 @cindex files, @file{.emacs}
4018 @cindex modes, MH-Folder
4019 @cindex sending mail
4020 @findex mh-smail
4021 @findex mh-smail-other-window
4022 @kindex M-x mh-smail
4023 @kindex M-x mh-smail-other-window
4024
4025 Outside of an MH-Folder buffer, you must call either @kbd{M-x
4026 mh-smail} or @kbd{M-x mh-smail-other-window} to compose a new message.
4027 The former command always creates a two-window layout with the current
4028 buffer on top and the draft on the bottom. Use the latter command if
4029 you would rather preserve the window layout. You may find adding the
4030 following key bindings to @file{~/.emacs} useful:
4031
4032 @smalllisp
4033 (global-set-key "\C-xm" 'mh-smail)
4034 (global-set-key "\C-x4m" 'mh-smail-other-window)
4035 @end smalllisp
4036
4037 @cindex draft folder
4038 @cindex MH-Letter mode
4039 @cindex modes, MH-Letter
4040 @findex mh-send
4041 @kindex m
4042
4043 From within a MH-Folder buffer, you can simply use the command @kbd{m}
4044 (@code{mh-send}). However you invoke @code{mh-send}, your letter
4045 appears in an Emacs buffer whose mode is MH-Letter (to see what the
4046 buffer looks like, @pxref{Sending Mail Tour}). MH-Letter mode allows
4047 you to edit your message, to check the validity of the recipients, to
4048 insert attachments and other messages into your message, and to send
4049 the message. We'll go more into depth about editing a
4050 @dfn{draft}@footnote{I highly recommend that you use a @dfn{draft
4051 folder} so that you can edit several drafts in parallel. To do so,
4052 create a folder named @samp{+drafts} for example, and add the profile
4053 component @samp{Draft-Folder: drafts} (see @code{mh-profile}(5)).} (a
4054 message you're composing) in just a moment (@pxref{Editing Drafts}).
4055
4056 @vindex mh-compose-prompt-flag
4057
4058 If you prefer to be prompted for the recipient and subject fields
4059 before the MH-Letter buffer appears, turn on the option
4060 @code{mh-compose-prompt-flag}.
4061
4062 @cindex header field, @samp{X-Mailer:}
4063 @cindex @samp{X-Mailer:} header field
4064 @vindex mh-insert-x-mailer-flag
4065
4066 MH-E adds an @samp{X-Mailer:} header field to the header that includes
4067 the version of MH-E and Emacs that you are using. If you don't want to
4068 participate in our marketing, you can turn off the option
4069 @code{mh-insert-x-mailer-flag}.
4070
4071 @cindex @command{repl}
4072 @cindex @file{components}
4073 @cindex MH commands, @command{repl}
4074 @cindex MH-Letter mode
4075 @cindex Mail mode
4076 @cindex files, @file{components}
4077 @cindex modes, MH-Letter
4078 @cindex modes, Mail
4079 @vindex mail-mode-hook
4080 @vindex mh-letter-mode-hook
4081 @vindex text-mode-hook
4082
4083 Two hooks are provided to run commands on your freshly created draft.
4084 The first hook, @code{mh-letter-mode-hook}, allows you to do some
4085 processing before editing a letter@footnote{Actually, because
4086 MH-Letter mode inherits from Mail mode, the hooks
4087 @code{text-mode-hook} and @code{mail-mode-hook} are run (in that
4088 order) before @code{mh-letter-mode-hook}.}. For example, you may wish
4089 to modify the header after @command{repl} has done its work, or you
4090 may have a complicated @file{components} file and need to tell MH-E
4091 where the cursor should go. Here's an example of how you would use
4092 this hook.
4093
4094 @findex mh-insert-signature, example
4095
4096 @smalllisp
4097 @group
4098 (defvar letter-mode-init-done-flag nil
4099 "Non-nil means one-time MH-E settings have been made.")
4100
4101 (defun my-mh-letter-mode-hook ()
4102 "Prepare letter for editing."
4103 (when (not letter-mode-init-done) ; @r{only need to bind the keys once}
4104 (local-set-key "\C-ctb" 'add-enriched-text)
4105 (local-set-key "\C-cti" 'add-enriched-text)
4106 (local-set-key "\C-ctf" 'add-enriched-text)
4107 (local-set-key "\C-cts" 'add-enriched-text)
4108 (local-set-key "\C-ctB" 'add-enriched-text)
4109 (local-set-key "\C-ctu" 'add-enriched-text)
4110 (local-set-key "\C-ctc" 'add-enriched-text)
4111 (setq letter-mode-init-done t))
4112 (save-excursion
4113 (goto-char (point-max)) ; @r{go to end of message to}
4114 (mh-insert-signature))) ; @r{insert signature}
4115
4116 @i{Prepare draft for editing via mh-letter-mode-hook}
4117
4118 @end group
4119 @end smalllisp
4120
4121 The function, @code{add-enriched-text} is defined in the example in
4122 @ref{Adding Attachments}.
4123
4124 @vindex mh-compose-letter-function
4125 @vindex mh-letter-mode-hook
4126
4127 The second hook, a function really, is
4128 @code{mh-compose-letter-function}. Like @code{mh-letter-mode-hook}, it
4129 is called just before editing a new message; however, it is the last
4130 function called before you edit your message. The consequence of this
4131 is that you can write a function to write and send the message for
4132 you. This function is passed three arguments: the contents of the
4133 @samp{To:}, @samp{Subject:}, and @samp{Cc:} header fields.
4134
4135 @node Replying, Forwarding, Composing, Sending Mail
4136 @section Replying to Mail
4137
4138 @cindex @command{mhl}
4139 @cindex @file{mhl.reply}
4140 @cindex MH commands, @command{mhl}
4141 @cindex files, @file{mhl.reply}
4142 @cindex replying
4143 @findex mh-reply
4144 @kindex r
4145
4146 To compose a reply to a message, use the @kbd{r} (@code{mh-reply})
4147 command.
4148
4149 When you reply to a message, you are first prompted with @samp{Reply
4150 to whom?}. You have several choices here.
4151
4152 @quotation
4153 @multitable @columnfractions .20 .80
4154 @c @headitem Response @tab Reply Goes To
4155 @c XXX @headitem not yet supported by SourceForge's texi2pdf.
4156 @item @b{Response} @tab @b{Reply Goes To}
4157 @c -------------------------
4158 @item @kbd{from}
4159 @tab
4160 The person who sent the message. This is the default, so @key{RET} is
4161 sufficient.
4162 @c -------------------------
4163 @item @kbd{to}
4164 @tab
4165 Replies to the sender, plus all recipients in the @samp{To:} header field.
4166 @c -------------------------
4167 @item @kbd{cc}@*@kbd{all}
4168 @tab
4169 Forms a reply to the addresses in the @samp{Mail-Followup-To:} header
4170 field if one exists; otherwise forms a reply to the sender, plus all
4171 recipients.
4172 @end multitable
4173 @end quotation
4174
4175 @cindex @command{repl}
4176 @cindex MH commands, @command{repl}
4177 @vindex mh-reply-default-reply-to
4178
4179 Depending on your answer, @command{repl}@footnote{See the section
4180 @uref{@value{MH-BOOK-HOME}/reprep.html, Replying to Messages: repl} in
4181 the MH book.} is given a different argument to form your reply.
4182 Specifically, a choice of @kbd{from} or none at all runs @samp{repl
4183 -nocc all}, and a choice of @kbd{to} runs @samp{repl -cc to}. Finally,
4184 either @kbd{cc} or @kbd{all} runs @samp{repl -cc all -nocc me}. If you
4185 find that most of the time you specify one of these choices when you
4186 reply to a message, you can change the option
4187 @code{mh-reply-default-reply-to} from its default value of
4188 @samp{Prompt} to one of the choices listed above. You can always edit
4189 the recipients in the draft.
4190
4191 @cindex @samp{repl:} MH profile component
4192 @cindex MH profile component, @samp{repl:}
4193 @cindex MH-Letter mode
4194 @cindex MH-Show mode
4195 @cindex draft
4196 @cindex modes, MH-Letter
4197 @cindex modes, MH-Show
4198
4199 Two windows are then created. One window contains the message to which
4200 you are replying in an MH-Show buffer. Your draft, in MH-Letter mode
4201 (@pxref{Editing Drafts}), is in the other window. If the reply draft
4202 was not one that you expected, check the things that affect the
4203 behavior of @command{repl} which include the @samp{repl:} profile
4204 component and the @file{replcomps} and @file{replgroupcomps} files.
4205
4206 If you supply a prefix argument (as in @kbd{C-u r}), the message you
4207 are replying to is inserted in your reply after having first been run
4208 through @command{mhl} with the format file @file{mhl.reply}. See
4209 @command{mhl}(1) or the section
4210 @uref{@value{MH-BOOK-HOME}/shomes.html#Usisho, Using mhl} in the MH
4211 book to see how you can modify the default @file{mhl.reply} file.
4212
4213 @vindex mh-yank-behavior
4214
4215 Alternatively, you can customize the option @code{mh-yank-behavior}
4216 and choose one of its @samp{Automatically} variants to do the same
4217 thing. @xref{Inserting Letter}. If you do so, the prefix argument has
4218 no effect.
4219
4220 Another way to include the message automatically in your draft is to
4221 use @samp{repl: -filter repl.filter} in your MH profile.
4222
4223 @vindex mh-reply-show-message-flag
4224
4225 If you include the message automatically, you can hide the MH-Show
4226 buffer by turning off the option @code{mh-reply-show-message-flag}.
4227
4228 If you wish to customize the header or other parts of the reply draft,
4229 please see @command{repl}(1) and @code{mh-format}(5).
4230
4231 @node Forwarding, Redistributing, Replying, Sending Mail
4232 @section Forwarding Mail
4233
4234 @cindex @command{forw}
4235 @cindex draft
4236 @cindex forwarding
4237 @cindex MH commands, @command{forw}
4238 @findex mh-forward
4239 @kindex f
4240 @vindex mh-forward-hook
4241
4242 To forward a message, use the @kbd{f} (@code{mh-forward}) command. You
4243 are prompted for the @samp{To:} and @samp{cc:} recipients. You are
4244 given a draft to edit that looks like it would if you had run the MH
4245 command @command{forw}@footnote{See the section
4246 @uref{@value{MH-BOOK-HOME}/forfor.html, Forwarding Messages: forw} in
4247 the MH book.}. You can then add some text (@pxref{Editing Drafts}).
4248 You can forward several messages by using a range (@pxref{Ranges}).
4249 All of the messages in the range are inserted into your draft. The
4250 hook @code{mh-forward-hook} is called on the draft.
4251
4252 @cindex @file{.mh_profile}
4253 @cindex files, @file{.mh_profile}
4254 @cindex MH profile component, @samp{forw:}
4255 @cindex @samp{forw:} MH profile component
4256 @vindex mh-compose-forward-as-mime-flag
4257
4258 By default, the option @code{mh-compose-forward-as-mime-flag} is on
4259 which means that the forwarded messages are included as attachments.
4260 These are inline attachments so the forwarded message should appear in
4261 the body of your recipient's mail program. If you would prefer to
4262 forward your messages verbatim (as text, inline), then turn off this
4263 option. Forwarding messages verbatim works well for short, textual
4264 messages, but your recipient won't be able to view any non-textual
4265 attachments that were in the forwarded message. Be aware that if you
4266 have @samp{forw: -mime} in your MH profile, then forwarded messages
4267 will always be included as attachments regardless of the settings of
4268 @code{mh-compose-forward-as-mime-flag}.
4269
4270 @vindex mh-forward-subject-format
4271
4272 The format of the @samp{Subject:} header field for forwarded messages
4273 is controlled by the option @code{mh-forward-subject-format}. This
4274 option is a string which includes two escapes (@samp{%s}). The first
4275 @samp{%s} is replaced with the sender of the original message, and the
4276 second one is replaced with the original @samp{Subject:}. The default
4277 value of @code{"%s: %s"} takes a message with the header:
4278
4279 @smallexample
4280 @group
4281 To: Bill Wohler <wohler@@stop.mail-abuse.org>
4282 Subject: Re: 49er football
4283 From: Greg DesBrisay <gd@@stop.mail-abuse.org>
4284 @end group
4285 @end smallexample
4286
4287 and creates a subject header field of:
4288
4289 @smallexample
4290 Subject: Greg DesBrisay: Re: 49er football
4291 @end smallexample
4292
4293 @node Redistributing, Editing Again, Forwarding, Sending Mail
4294 @section Redistributing Your Mail
4295
4296 @cindex @command{dist}
4297 @cindex MH commands, @command{dist}
4298 @cindex redistributing
4299 @findex mh-redistribute
4300 @kindex M-d
4301
4302 The command @kbd{M-d} (@code{mh-redistribute}) is similar in function
4303 to forwarding mail, but it does not allow you to edit the message, nor
4304 does it add your name to the @samp{From:} header field. It appears to
4305 the recipient as if the message had come from the original sender.
4306 When you run this command, you are prompted for the recipients.
4307
4308 @findex mh-edit-again
4309 @kindex e
4310
4311 For more information on redistributing messages, see
4312 @command{dist}(1). Also investigate the command @kbd{e}
4313 (@code{mh-edit-again}) for another way to redistribute messages
4314 (@pxref{Editing Again}).
4315
4316 @cindex @command{send}
4317 @cindex MH commands, @command{send}
4318 @vindex mh-redist-full-contents-flag
4319
4320 The option @code{mh-redist-full-contents-flag} must be turned on if
4321 @command{dist}@footnote{See the section
4322 @uref{@value{MH-BOOK-HOME}/disdis.html, Distributing Messages with
4323 dist} in the MH book.} requires the whole letter for redistribution,
4324 which is the case if @command{send}@footnote{See the section
4325 @uref{@value{MH-BOOK-HOME}/sensen.html, Sending Some Mail: comp send}
4326 in the MH book.} is compiled with the @sc{berk} option (which many
4327 people abhor). If you find that MH will not allow you to redistribute
4328 a message that has been redistributed before, turn off this option.
4329
4330 The hook @code{mh-annotate-msg-hook} is run after annotating the
4331 message and scan line (@pxref{Sending Mail}).
4332
4333 @node Editing Again, , Redistributing, Sending Mail
4334 @section Editing Old Drafts and Bounced Messages
4335
4336 @cindex @file{draft}
4337 @cindex files, @file{draft}
4338 @cindex re-editing drafts
4339 @findex mh-edit-again
4340 @kindex F v drafts
4341 @kindex e
4342 @kindex n
4343
4344 If you don't complete a draft for one reason or another, and if the
4345 draft buffer is no longer available, you can pick your draft up again
4346 with @kbd{e} (@code{mh-edit-again}). If you don't use a draft
4347 folder, your last @file{draft} file will be used. If you use draft
4348 folders, you'll need to visit the draft folder with @kbd{F v drafts
4349 @key{RET}}, use @kbd{n} to move to the appropriate message, and then
4350 use @kbd{e} to prepare the message for editing.
4351
4352 @kindex e
4353
4354 The @kbd{e} command can also be used to take messages that were sent
4355 to you and to send them to more people.
4356
4357 @cindex Mailer-Daemon
4358 @findex mh-extract-rejected-mail
4359 @kindex C-c C-c
4360 @kindex E
4361
4362 Don't use @kbd{e} to re-edit a message from a @i{Mailer-Daemon} who
4363 complained that your mail wasn't posted for some reason or another. In
4364 this case, use @kbd{E} (@code{mh-extract-rejected-mail}) to prepare
4365 the message for editing by removing the @i{Mailer-Daemon} envelope and
4366 unneeded header fields. Fix whatever addressing problem you had, and
4367 send the message again with @kbd{C-c C-c}.
4368
4369 @node Editing Drafts, Aliases, Sending Mail, Top
4370 @chapter Editing a Draft
4371
4372 @cindex @samp{Letter} menu
4373 @cindex MH-Letter mode
4374 @cindex draft
4375 @cindex editing draft
4376 @cindex menu, @samp{Letter}
4377 @cindex modes, MH-Letter
4378
4379 When you edit a message that you want to send (called a @dfn{draft} in
4380 this case), the mode used is MH-Letter. This mode provides several
4381 commands in addition to the normal Emacs editing commands to help you
4382 edit your draft. These can also be found in the @samp{Letter} menu.
4383
4384 @table @kbd
4385 @kindex @key{SPC}
4386 @findex mh-letter-complete-or-space
4387 @item @key{SPC}
4388 Perform completion or insert space (@code{mh-letter-complete-or-space}).
4389 @c -------------------------
4390 @kindex M-@key{TAB}
4391 @findex mh-letter-complete
4392 @item M-@key{TAB}
4393 Perform completion on header field or word preceding point
4394 (@code{mh-letter-complete}).
4395 @c -------------------------
4396 @kindex , (comma)
4397 @findex mh-letter-confirm-address
4398 @item , (comma)
4399 Flash alias expansion (@code{mh-letter-confirm-address}).
4400 @c -------------------------
4401 @kindex @key{TAB}
4402 @findex mh-letter-next-header-field-or-indent
4403 @item @key{TAB}
4404 Cycle to next field (@code{mh-letter-next-header-field-or-indent}).
4405 @c -------------------------
4406 @kindex S-@key{TAB}
4407 @findex mh-letter-previous-header-field
4408 @item S-@key{TAB}
4409 Cycle to the previous header field
4410 (@code{mh-letter-previous-header-field}).
4411 @c -------------------------
4412 @kindex C-c ?
4413 @findex mh-help
4414 @item C-c ?
4415 Display cheat sheet for the MH-E commands (@code{mh-help}).
4416 @c -------------------------
4417 @cindex @samp{Letter > Send This Draft} menu item
4418 @cindex menu item, @samp{Letter > Send This Draft}
4419 @kindex C-c C-c
4420 @findex mh-send-letter
4421 @item C-c C-c
4422 Save draft and send message (@code{mh-send-letter}).
4423 @c -------------------------
4424 @kindex C-c C-d
4425 @findex mh-insert-identity
4426 @item C-c C-d
4427 Insert fields specified by the given identity
4428 (@code{mh-insert-identity}). @xref{Identities}.
4429 @c -------------------------
4430 @cindex @samp{Letter > Pull in All Compositions (MH)} menu item
4431 @cindex menu item, @samp{Letter > Pull in All Compositions (MH)}
4432 @kindex C-c C-e
4433 @findex mh-mh-to-mime
4434 @item C-c C-e
4435 Compose @sc{mime} message from MH-style directives
4436 (@code{mh-mh-to-mime}).
4437 @c -------------------------
4438 @kindex C-c C-f C-a
4439 @kindex C-c C-f a
4440 @findex mh-to-field
4441 @item C-c C-f C-a
4442 @itemx C-c C-f a
4443 Move to @samp{Mail-Reply-To:} header field (@code{mh-to-field}).
4444 @c -------------------------
4445 @kindex C-c C-f C-b
4446 @kindex C-c C-f b
4447 @item C-c C-f C-b
4448 @itemx C-c C-f b
4449 Move to @samp{Bcc:} header field (@code{mh-to-field}).
4450 @c -------------------------
4451 @kindex C-c C-f C-c
4452 @kindex C-c C-f c
4453 @item C-c C-f C-c
4454 @itemx C-c C-f c
4455 Move to @samp{Cc:} header field (@code{mh-to-field}).
4456 @c -------------------------
4457 @kindex C-c C-f C-d
4458 @kindex C-c C-f d
4459 @item C-c C-f C-d
4460 @itemx C-c C-f d
4461 Move to @samp{Dcc:} header field (@code{mh-to-field}).
4462 @c -------------------------
4463 @kindex C-c C-f C-f
4464 @kindex C-c C-f f
4465 @findex mh-to-fcc
4466 @item C-c C-f C-f
4467 @itemx C-c C-f f
4468 Move to @samp{Fcc:} header field (@code{mh-to-fcc}).
4469 @c -------------------------
4470 @kindex C-c C-f C-l
4471 @kindex C-c C-f l
4472 @item C-c C-f C-l
4473 @itemx C-c C-f l
4474 Move to @samp{Mail-Followup-To:} header field (@code{mh-to-field}).
4475 @c -------------------------
4476 @kindex C-c C-f C-m
4477 @kindex C-c C-f m
4478 @item C-c C-f C-m
4479 @itemx C-c C-f m
4480 Move to @samp{From:} header field (@code{mh-to-field}).
4481 @c -------------------------
4482 @kindex C-c C-f C-r
4483 @kindex C-c C-f r
4484 @item C-c C-f C-r
4485 @itemx C-c C-f r
4486 Move to @samp{Reply-To:} header field (@code{mh-to-field}).
4487 @c -------------------------
4488 @kindex C-c C-f C-s
4489 @kindex C-c C-f s
4490 @item C-c C-f C-s
4491 @itemx C-c C-f s
4492 Move to @samp{Subject:} header field (@code{mh-to-field}).
4493 @c -------------------------
4494 @kindex C-c C-f C-t
4495 @kindex C-c C-f t
4496 @item C-c C-f C-t
4497 @itemx C-c C-f t
4498 Move to @samp{To:} header field (@code{mh-to-field}).
4499 @c -------------------------
4500 @cindex @samp{Letter > Insert a Message...} menu item
4501 @cindex menu item, @samp{Letter > Insert a Message...}
4502 @kindex C-c C-i
4503 @findex mh-insert-letter
4504 @item C-c C-i
4505 Insert a message (@code{mh-insert-letter}).
4506 @c -------------------------
4507 @kindex C-c C-m C-e
4508 @findex mh-mml-secure-message-encrypt
4509 @item C-c C-m C-e
4510 Add tag to encrypt the message (@code{mh-mml-secure-message-encrypt}).
4511 @c -------------------------
4512 @cindex @samp{Letter > Compose Forward...} menu item
4513 @cindex menu item, @samp{Letter > Compose Forward...}
4514 @kindex C-c C-m C-f
4515 @kindex C-c C-m f
4516 @findex mh-compose-forward
4517 @item C-c C-m C-f
4518 @itemx C-c C-m f
4519 Add tag to forward a message (@code{mh-compose-forward}).
4520 @c -------------------------
4521 @cindex @samp{Letter > Compose Get File (MH)...} menu item
4522 @cindex menu item, @samp{Letter > Compose Get File (MH)...}
4523 @kindex C-c C-m C-g
4524 @kindex C-c C-m g
4525 @findex mh-mh-compose-anon-ftp
4526 @item C-c C-m C-g
4527 @itemx C-c C-m g
4528 Add tag to include anonymous ftp reference to a file
4529 (@code{mh-mh-compose-anon-ftp}).
4530 @c -------------------------
4531 @cindex @samp{Letter > Compose Insertion...} menu item
4532 @cindex menu item, @samp{Letter > Compose Insertion...}
4533 @kindex C-c C-m C-i
4534 @kindex C-c C-m i
4535 @findex mh-compose-insertion
4536 @item C-c C-m C-i
4537 @itemx C-c C-m i
4538 Add tag to include a file such as an image or sound
4539 (@code{mh-compose-insertion}).
4540 @c -------------------------
4541 @cindex @samp{Letter > Pull in All Compositions (MML)} menu item
4542 @cindex menu item, @samp{Letter > Pull in All Compositions (MML)}
4543 @kindex C-c C-m C-m
4544 @kindex C-c C-m m
4545 @findex mh-mml-to-mime
4546 @item C-c C-m C-m
4547 @itemx C-c C-m m
4548 Compose @sc{mime} message from MML tags (@code{mh-mml-to-mime}).
4549 @c -------------------------
4550 @kindex C-c C-m C-n
4551 @kindex C-c C-m n
4552 @findex mh-mml-unsecure-message
4553 @item C-c C-m C-n
4554 @itemx C-c C-m n
4555 Remove any secure message tags (@code{mh-mml-unsecure-message}).
4556 @c -------------------------
4557 @kindex C-c C-m C-s
4558 @findex mh-mml-secure-message-sign
4559 @item C-c C-m C-s
4560 Add tag to sign the message (@code{mh-mml-secure-message-sign}).
4561 @c -------------------------
4562 @cindex @samp{Letter > Compose Compressed tar (MH)...} menu item
4563 @cindex menu item, @samp{Letter > Compose Compressed tar (MH)...}
4564 @kindex C-c C-m C-t
4565 @kindex C-c C-m t
4566 @findex mh-mh-compose-external-compressed-tar
4567 @item C-c C-m C-t
4568 @itemx C-c C-m t
4569 Add tag to include anonymous ftp reference to a compressed tar file
4570 (@code{mh-mh-compose-external-compressed-tar}).
4571 @c -------------------------
4572 @cindex @samp{Letter > Revert to Non-MIME Edit (MH)} menu item
4573 @cindex menu item, @samp{Letter > Revert to Non-MIME Edit (MH)}
4574 @kindex C-c C-m C-u
4575 @kindex C-c C-m u
4576 @findex mh-mh-to-mime-undo
4577 @item C-c C-m C-u
4578 @itemx C-c C-m u
4579 Undo effects of @kbd{C-c C-e} (@code{mh-mh-to-mime-undo}).
4580 @c -------------------------
4581 @kindex C-c C-m C-x
4582 @kindex C-c C-m x
4583 @findex mh-mh-compose-external-type
4584 @item C-c C-m C-x
4585 @itemx C-c C-m x
4586 Add tag to refer to a remote file
4587 (@code{mh-mh-compose-external-type}).
4588 @c -------------------------
4589 @kindex C-c C-m e e
4590 @findex mh-mml-secure-message-encrypt
4591 @item C-c C-m e e
4592 Add tag to encrypt the message (@code{mh-mml-secure-message-encrypt}).
4593 @c -------------------------
4594 @kindex C-c C-m e s
4595 @findex mh-mml-secure-message-signencrypt
4596 @item C-c C-m e s
4597 Add tag to encrypt and sign the message@*
4598 (@code{mh-mml-secure-message-signencrypt}).
4599 @c -------------------------
4600 @kindex C-c C-m s e
4601 @findex mh-mml-secure-message-signencrypt
4602 @item C-c C-m s e
4603 Add tag to encrypt and sign the message@*
4604 (@code{mh-mml-secure-message-signencrypt}).
4605 @c -------------------------
4606 @kindex C-c C-m s s
4607 @findex mh-mml-secure-message-sign
4608 @item C-c C-m s s
4609 Add tag to sign the message (@code{mh-mml-secure-message-sign}).
4610 @c -------------------------
4611 @cindex @samp{Letter > Split Current Line} menu item
4612 @cindex menu item, @samp{Letter > Split Current Line}
4613 @kindex C-c C-o
4614 @findex mh-open-line
4615 @item C-c C-o
4616 Insert a newline and leave point before it (@code{mh-open-line}).
4617 @c -------------------------
4618 @cindex @samp{Letter > Kill This Draft} menu item
4619 @cindex menu item, @samp{Letter > Kill This Draft}
4620 @kindex C-c C-q
4621 @findex mh-fully-kill-draft
4622 @item C-c C-q
4623 Quit editing and delete draft message (@code{mh-fully-kill-draft}).
4624 @c -------------------------
4625 @cindex @samp{Letter > Insert Signature} menu item
4626 @cindex menu item, @samp{Letter > Insert Signature}
4627 @kindex C-c C-s
4628 @findex mh-insert-signature
4629 @item C-c C-s
4630 Insert signature in message (@code{mh-insert-signature}).
4631 @c -------------------------
4632 @kindex C-c C-t
4633 @findex mh-letter-toggle-header-field-display
4634 @item C-c C-t
4635 Toggle display of header field at point
4636 (@code{mh-letter-toggle-header-field-display}).
4637 @c -------------------------
4638 @cindex @samp{Letter > Check Recipient} menu item
4639 @cindex menu item, @samp{Letter > Check Recipient}
4640 @kindex C-c C-w
4641 @findex mh-check-whom
4642 @item C-c C-w
4643 Verify recipients, showing expansion of any aliases
4644 (@code{mh-check-whom}).
4645 @c -------------------------
4646 @cindex @samp{Letter > Yank Current Message} menu item
4647 @cindex menu item, @samp{Letter > Yank Current Message}
4648 @kindex C-c C-y
4649 @findex mh-yank-cur-msg
4650 @item C-c C-y
4651 Insert the current message into the draft buffer
4652 (@code{mh-yank-cur-msg}).
4653 @c -------------------------
4654 @kindex C-c M-d
4655 @findex mh-insert-auto-fields
4656 @item C-c M-d
4657 Insert custom fields if recipient is found in
4658 @code{mh-auto-fields-list} (@code{mh-insert-auto-fields}).
4659 @xref{Identities}.
4660 @end table
4661
4662 @cindex @samp{mh-letter} customization group
4663 @cindex customization group, @samp{mh-letter}
4664
4665 Several options from the @samp{mh-letter} customization group are used
4666 while editing a draft.
4667
4668 @vtable @code
4669 @item mh-compose-insertion
4670 Type of @sc{mime} message tags in messages (default: @samp{MML} if
4671 available; otherwise @samp{MH}).
4672 @c -------------------------
4673 @item mh-compose-skipped-header-fields
4674 List of header fields to skip over when navigating in draft (default:
4675 @code{'("From"} @code{"Organization"} @code{"References"}
4676 @code{"In-Reply-To"} @code{"X-Face"} @code{"Face"}
4677 @code{"X-Image-URL"} @code{"X-Mailer")}.
4678 @c -------------------------
4679 @item mh-compose-space-does-completion-flag
4680 On means @key{SPC} does completion in message header (default:
4681 @samp{off}).
4682 @c -------------------------
4683 @item mh-delete-yanked-msg-window-flag
4684 On means delete any window displaying the message (default: @samp{off}).
4685 @c -------------------------
4686 @item mh-extract-from-attribution-verb
4687 Verb to use for attribution when a message is yanked by @kbd{C-c C-y}
4688 (default: @code{"wrote:"}).
4689 @c -------------------------
4690 @item mh-ins-buf-prefix
4691 String to put before each line of a yanked or inserted message
4692 (default: @code{"> "}).
4693 @c -------------------------
4694 @item mh-letter-complete-function
4695 Function to call when completing outside of address or folder fields
4696 (default: @code{ispell-complete-word}).
4697 @c -------------------------
4698 @item mh-letter-fill-column
4699 Fill column to use in MH-Letter mode (default: 72).
4700 @c -------------------------
4701 @item mh-mml-method-default
4702 Default method to use in security tags (default: @samp{PGP (MIME)} if
4703 support for it is available; otherwise @samp{None}).
4704 @c -------------------------
4705 @item mh-signature-file-name
4706 Source of user's signature (default: @code{"~/.signature"}).
4707 @c -------------------------
4708 @item mh-signature-separator-flag
4709 On means a signature separator should be inserted (default:
4710 @samp{on}).
4711 @c -------------------------
4712 @item mh-x-face-file
4713 File containing X-Face or Face header field to insert in outgoing mail.
4714 (default: @code{"~/.face"}).
4715 @c -------------------------
4716 @item mh-yank-behavior
4717 Controls which part of a message is yanked by @kbd{C-c C-y} (default:
4718 @samp{Body With Attribution}).
4719 @end vtable
4720
4721 The following hooks are available.
4722
4723 @vtable @code
4724 @item mail-citation-hook
4725 Hook for modifying a citation just inserted in the mail buffer
4726 (default: @code{nil}).
4727 @c -------------------------
4728 @item mh-before-send-letter-hook
4729 Hook run at the beginning of the @kbd{C-c C-c} command (default:
4730 @samp{nil}).
4731 @c -------------------------
4732 @item mh-mh-to-mime-hook
4733 Hook run on the formatted letter by @kbd{C-c C-e} (default:
4734 @samp{nil}).
4735 @c -------------------------
4736 @item mh-insert-signature-hook
4737 Hook run by @kbd{C-c C-s} after signature has been inserted (default:
4738 @code{nil}).
4739 @end vtable
4740
4741 The following face is available.
4742
4743 @vtable @code
4744 @item mh-letter-header-field
4745 Editable header field value face in draft buffers.
4746 @end vtable
4747
4748 The commands and options introduced here are explained in more
4749 detail in the following sections.
4750
4751 @menu
4752 * Editing Message::
4753 * Inserting Letter::
4754 * Inserting Messages::
4755 * Signature::
4756 * Picture::
4757 * Adding Attachments::
4758 * Sending PGP::
4759 * Checking Recipients::
4760 * Sending Message::
4761 * Killing Draft::
4762 @end menu
4763
4764 @node Editing Message, Inserting Letter, Editing Drafts, Editing Drafts
4765 @section Editing the Message
4766
4767 @cindex @samp{Bcc:} header field
4768 @cindex @samp{Cc:} header field
4769 @cindex @samp{Dcc:} header field
4770 @cindex @samp{From:} header field
4771 @cindex @samp{Mail-Followup-To:} header field
4772 @cindex @samp{Mail-Reply-To:} header field
4773 @cindex @samp{Reply-To:} header field
4774 @cindex @samp{Subject:} header field
4775 @cindex @samp{To:} header field
4776 @cindex editing header
4777 @cindex header field, @samp{Bcc:}
4778 @cindex header field, @samp{Cc:}
4779 @cindex header field, @samp{Dcc:}
4780 @cindex header field, @samp{From:}
4781 @cindex header field, @samp{Mail-Followup-To:}
4782 @cindex header field, @samp{Mail-Reply-To:}
4783 @cindex header field, @samp{Reply-To:}
4784 @cindex header field, @samp{Subject:}
4785 @cindex header field, @samp{To:}
4786 @findex mh-to-field
4787 @kindex C-c C-f C-t
4788 @kindex C-c C-f t
4789
4790 Because the header is part of the message, you can edit the header
4791 fields as you wish. However, several convenience commands exist to
4792 help you create and edit them. For example, the command @kbd{C-c C-f
4793 C-t} (@code{mh-to-field}; alternatively, @kbd{C-c C-f t}) moves the
4794 cursor to the @samp{To:} header field, creating it if necessary. The
4795 commands for moving to the @samp{Cc:}, @samp{Subject:}, @samp{From:},
4796 @samp{Reply-To:}, @samp{Mail-Reply-To:}, @samp{Mail-Followup-To},
4797 @samp{Bcc:}, and @samp{Dcc:} header fields are similar.
4798
4799 @findex mh-to-fcc
4800 @kindex C-c C-f C-f
4801 @kindex C-c C-f f
4802
4803 One command behaves differently from the others, namely, @kbd{C-c C-f
4804 C-f} (@code{mh-to-fcc}; alternatively, @kbd{C-c C-f f}). This command
4805 will prompt you for the folder name in which to file a copy of the
4806 draft. @xref{Folder Selection}.
4807
4808 @findex indent-relative
4809 @findex mh-letter-next-header-field-or-indent
4810 @findex mh-letter-previous-header-field
4811 @kindex @key{TAB}
4812 @kindex S-@key{TAB}
4813 @vindex mh-compose-skipped-header-fields
4814 @vindex mh-letter-header-field
4815
4816 Within the header of the message, the command@* @key{TAB}
4817 (@code{mh-letter-next-header-field-or-indent}) moves between fields
4818 that are highlighted with the face @code{mh-letter-header-field},
4819 skipping those fields listed in
4820 @code{mh-compose-skipped-header-fields}. After the last field, this
4821 command then moves point to the message body before cycling back to
4822 the first field. If point is already past the first line of the
4823 message body, then this command indents by calling
4824 @code{indent-relative} with the given prefix argument. The command
4825 @kbd{S-@key{TAB}} (@code{mh-letter-previous-header-field}) moves
4826 backwards between the fields and cycles to the body of the message
4827 after the first field. Unlike the command @key{TAB}, it will always
4828 take point to the last field from anywhere in the body.
4829
4830 @cindex alias completion
4831 @cindex completion
4832 @cindex spell check
4833 @findex ispell-complete-word
4834 @findex mh-letter-complete
4835 @findex mh-letter-complete-or-space
4836 @findex mh-letter-confirm-address
4837 @kindex , (comma)
4838 @kindex @key{SPC}
4839 @kindex M-@key{TAB}
4840 @vindex mh-alias-flash-on-comma
4841 @vindex mh-compose-space-does-completion-flag
4842 @vindex mh-letter-complete-function
4843
4844 If the field contains addresses (for example, @samp{To:} or
4845 @samp{Cc:}) or folders (for example, @samp{Fcc:}) then the command
4846 @kbd{M-@key{TAB}} (@code{mh-letter-complete}) will provide alias
4847 completion (@pxref{Aliases}). In the body of the message,
4848 @kbd{M-@key{TAB}} runs @code{mh-letter-complete-function} instead,
4849 which is set to @samp{'ispell-complete-word} by default. The command
4850 @kbd{M-@key{TAB}} (@code{mh-letter-complete}) takes a prefix argument
4851 that is passed to the @code{mh-letter-complete-function}. In addition,
4852 turn on the option @code{mh-compose-space-does-completion-flag} to use
4853 the command @key{SPC} (@code{mh-letter-complete-or-space}) to perform
4854 completion in the header as well; use a prefix argument to specify
4855 more than one space. Addresses are separated by a comma; when you
4856 press the comma, the command @code{mh-letter-confirm-address} flashes
4857 the alias expansion in the minibuffer if
4858 @code{mh-alias-flash-on-comma} is turned on.
4859
4860 @c XXX Document the replacement for the inaccessible 'long argument.
4861
4862 @findex mh-letter-toggle-header-field-display
4863 @kindex C-c C-t
4864
4865 Use the command @kbd{C-c C-t}
4866 @code{mh-letter-toggle-header-field-display} to display truncated
4867 header fields. This command is a toggle so entering it again will hide
4868 the field. This command takes a prefix argument: if negative then the
4869 field is hidden, if positive then the field is displayed (for example,
4870 @kbd{C-u C-c C-t}).
4871
4872 Be sure to leave a row of dashes or a blank line between the header
4873 and the body of the message.
4874
4875 @vindex mh-letter-fill-column
4876
4877 The body of the message is edited as you would edit any Emacs buffer
4878 although there are a few commands and options to assist you. You can
4879 change the fill column in MH-Letter mode with the option
4880 @code{mh-letter-fill-column}. By default, this option is 72 to allow
4881 others to quote your message without line wrapping.
4882
4883 @cindex filling paragraphs
4884 @cindex paragraphs, filling
4885 @findex fill-paragraph
4886 @kindex M-q
4887 @vindex mh-ins-buf-prefix
4888
4889 You'll often include messages that were sent from user agents that
4890 haven't yet realized that paragraphs consist of more than a single
4891 line. This makes for long lines that wrap in an ugly fashion. You'll
4892 find that @kbd{M-q} (@code{fill-paragraph}) works well even on these
4893 quoted messages, even if they are nested, just as long as all of the
4894 quotes match the value of @code{mh-ins-buf-prefix} (@pxref{Inserting
4895 Letter}). For example, let's assume you have the following in your
4896 draft:
4897
4898 @smallexample
4899 @group
4900 > Hopefully this gives you an idea of what I'm currently doing. I'm \
4901 not sure yet whether I'm completely satisfied with my setup, but \
4902 it's worked okay for me so far.
4903 @end group
4904 @end smallexample
4905
4906 Running @kbd{M-q} on this paragraph produces:
4907
4908 @smallexample
4909 @group
4910 > Hopefully this gives you an idea of what I'm currently doing. I'm not
4911 > sure yet whether I'm completely satisfied with my setup, but it's
4912 > worked okay for me so far.
4913 @end group
4914 @end smallexample
4915
4916 @findex mh-open-line
4917 @findex open-line
4918 @kindex C-c C-o
4919 @kindex C-o
4920
4921 The command @kbd{C-c C-o} (@code{mh-open-line}) is similar to the
4922 command @kbd{C-o} (@code{open-line}) in that it inserts a newline
4923 after point. It differs in that it also inserts the right number of
4924 quoting characters and spaces so that the next line begins in the same
4925 column as it was. This is useful when breaking up paragraphs in
4926 replies. For example, if this command was used when point was after
4927 the first period in the paragraph above, the result would be this:
4928
4929 @smallexample
4930 @group
4931 > Hopefully this gives you an idea of what I'm currently doing.
4932
4933 > I'm not
4934 > sure yet whether I'm completely satisfied with my setup, but it's
4935 > worked okay for me so far.
4936 @end group
4937 @end smallexample
4938
4939 @node Inserting Letter, Inserting Messages, Editing Message, Editing Drafts
4940 @section Inserting Letter to Which You're Replying
4941
4942 @cindex inserting messages
4943 @cindex replying to messages
4944 @cindex yanking messages
4945 @findex mh-yank-cur-msg
4946 @kindex C-c C-y
4947 @vindex mh-ins-buf-prefix
4948
4949 It is often useful to insert a snippet of text from a letter that
4950 someone mailed to provide some context for your reply. The command
4951 @kbd{C-c C-y} (@code{mh-yank-cur-msg}) does this by adding an
4952 attribution, yanking a portion of text from the message to which
4953 you're replying, and inserting @code{mh-ins-buf-prefix} (@samp{> })
4954 before each line.
4955
4956 @smallexample
4957 @group
4958 Michael W Thelen <thelenm@@stop.mail-abuse.org> wrote:
4959
4960 > Hopefully this gives you an idea of what I'm currently doing. I'm not
4961 > sure yet whether I'm completely satisfied with my setup, but it's
4962 > worked okay for me so far.
4963 @end group
4964 @end smallexample
4965
4966 @vindex mh-extract-from-attribution-verb
4967
4968 The attribution consists of the sender's name and email address
4969 followed by the content of the option
4970 @code{mh-extract-from-attribution-verb}. This option can be set to
4971 @samp{wrote:}, @samp{a écrit:}, and @samp{schrieb:}. You can also use
4972 the @samp{Custom String} menu item to enter your own verb.
4973
4974 @vindex mail-citation-hook
4975 @vindex mh-ins-buf-prefix
4976 @vindex mh-yank-behavior
4977
4978 The prefix @code{"> "} is the default setting for the option
4979 @code{mh-ins-buf-prefix}. I suggest that you not modify this option
4980 since it is used by many mailers and news readers: messages are far
4981 easier to read if several included messages have all been indented by
4982 the same string. This prefix is not inserted if you use one of the
4983 supercite flavors of @code{mh-yank-behavior} or you have added a
4984 @code{mail-citation-hook} as described below.
4985
4986 @vindex mh-delete-yanked-msg-window-flag
4987
4988 You can also turn on the @code{mh-delete-yanked-msg-window-flag}
4989 option to delete the window containing the original message after
4990 yanking it to make more room on your screen for your reply.
4991
4992 @cindex Emacs, packages, supercite
4993 @cindex supercite package
4994 @kindex r
4995 @vindex mail-citation-hook
4996 @vindex mh-yank-behavior
4997
4998 You can control how the message to which you are replying is yanked
4999 into your reply using @code{mh-yank-behavior}. To include the entire
5000 message, including the entire header, use @samp{Body and
5001 Header}@footnote{If you'd rather have the header cleaned up, use
5002 @kbd{C-u r} instead of @kbd{r} when replying
5003 (@pxref{Replying}).}@footnote{In the past you would use this setting
5004 and set @code{mail-citation-hook} to @samp{supercite}, but this usage
5005 is now deprecated in favor of the @samp{Invoke supercite} setting.}.
5006 Use @samp{Body} to yank just the body without the header. To yank only
5007 the portion of the message following the point, set this option to
5008 @samp{Below Point}.
5009
5010 Choose @samp{Invoke supercite}@footnote{@emph{Supercite} is a
5011 full-bodied, full-featured, citation package that comes standard with
5012 Emacs.} to pass the entire message and header through supercite.
5013
5014 @vindex mh-extract-from-attribution-verb
5015
5016 If the @samp{Body With Attribution} setting is used, then the message
5017 minus the header is yanked and a simple attribution line is added at
5018 the top using the value of the option
5019 @code{mh-extract-from-attribution-verb}. This is the default.
5020
5021 @kindex C-c C-y
5022 @vindex mh-delete-yanked-msg-window-flag
5023
5024 If the @samp{Invoke supercite} or @samp{Body With Attribution}
5025 settings are used, the @samp{-noformat} argument is passed to the
5026 @command{repl} program to override a @samp{-filter} or @samp{-format}
5027 argument. These settings also have @samp{Automatically} variants that
5028 perform the action automatically when you reply so that you don't need
5029 to use @kbd{C-c C-y} at all. Note that this automatic action is only
5030 performed if the show buffer matches the message being replied to.
5031 People who use the automatic variants tend to turn on the option
5032 @code{mh-delete-yanked-msg-window-flag} as well so that the show
5033 window is never displayed.
5034
5035 @vindex mh-yank-behavior
5036
5037 If the show buffer has a region, the option @code{mh-yank-behavior} is
5038 ignored unless its value is one of @samp{Attribution} variants in
5039 which case the attribution is added to the yanked region.
5040
5041 @findex trivial-cite
5042 @vindex mail-citation-hook
5043 @vindex mh-ins-buf-prefix
5044 @vindex mh-yank-behavior
5045
5046 If this isn't enough, you can gain full control over the appearance of
5047 the included text by setting @code{mail-citation-hook} to a function
5048 that modifies it. This hook is ignored if the option
5049 @code{mh-yank-behavior} is set to one of the supercite flavors.
5050 Otherwise, this option controls how much of the message is passed to
5051 the hook. The function can find the citation between point and mark
5052 and it should leave point and mark around the modified citation text
5053 for the next hook function. The standard prefix
5054 @code{mh-ins-buf-prefix} is not added if this hook is set.
5055
5056 @cindex Emacs, packages, trivial-cite
5057 @cindex trivial-cite package
5058 @vindex mh-yank-behavior
5059
5060 For example, if you use the hook function
5061 @uref{http://shasta.cs.uiuc.edu/~lrclause/tc.html,
5062 @code{trivial-cite}} (which is NOT part of Emacs), set
5063 @code{mh-yank-behavior} to @samp{Body and Header}.
5064
5065 @node Inserting Messages, Signature, Inserting Letter, Editing Drafts
5066 @section Inserting Messages
5067
5068 @cindex inserting messages
5069 @findex mh-insert-letter
5070 @findex mh-yank-behavior
5071 @kindex C-c C-i
5072 @vindex mh-ins-buf-prefix
5073 @vindex mh-invisible-header-fields-compiled
5074 @vindex mh-yank-behavior
5075
5076 Messages can be inserted with @kbd{C-c C-i} (@code{mh-insert-letter}).
5077 This command prompts you for the folder and message number, which
5078 defaults to the current message in that folder. It then inserts the
5079 messages, indented by @code{mh-ins-buf-prefix} (@samp{> }) unless
5080 @code{mh-yank-behavior} is set to one of the supercite flavors in
5081 which case supercite is used to format the message. Certain
5082 undesirable header fields (see
5083 @code{mh-invisible-header-fields-compiled}) are removed before
5084 insertion.
5085
5086 If given a prefix argument (like @kbd{C-u C-c C-i}), the header is
5087 left intact, the message is not indented, and @samp{> } is not
5088 inserted before each line. This command leaves the mark before the
5089 letter and point after it.
5090
5091 @node Signature, Picture, Inserting Messages, Editing Drafts
5092 @section Inserting Your Signature
5093
5094 @cindex signature
5095 @findex mh-insert-signature
5096 @kindex C-c C-s
5097
5098 You can insert your signature at the current cursor location with the
5099 command @kbd{C-c C-s} (@code{mh-insert-signature}).
5100
5101 @cindex files, @file{.signature}
5102 @cindex @file{.signature}
5103 @cindex vCard
5104 @vindex mh-signature-file-name
5105
5106 By default, the text of your signature is taken from the file
5107 @file{~/.signature}. You can read from other sources by changing the
5108 option @code{mh-signature-file-name}. This file may contain a
5109 @dfn{vCard} in which case an attachment is added with the vCard.
5110
5111 @findex mh-signature-separator-p
5112 @vindex mh-signature-file-name
5113 @vindex mh-signature-separator
5114 @vindex mh-signature-separator-regexp
5115
5116 The option @code{mh-signature-file-name} may also be a symbol, in
5117 which case that function is called. You may not want a signature
5118 separator to be added for you; instead you may want to insert one
5119 yourself. Options that you may find useful to do this include
5120 @code{mh-signature-separator} (when inserting a signature separator)
5121 and @code{mh-signature-separator-regexp} (for finding said separator).
5122 The function @code{mh-signature-separator-p}, which reports @code{t}
5123 if the buffer contains a separator, may be useful as well.
5124
5125 @cindex signature separator
5126 @vindex mh-signature-separator-flag
5127
5128 A signature separator (@code{"-- "}) will be added if the signature
5129 block does not contain one and @code{mh-signature-separator-flag} is
5130 on. It is not recommended that you change this option since various
5131 mail user agents, including MH-E, use the separator to present the
5132 signature differently, and to suppress the signature when replying or
5133 yanking a letter into a draft.
5134
5135 @vindex mh-insert-signature-hook
5136 @vindex mh-signature-file-name
5137
5138 The hook @code{mh-insert-signature-hook} is run after the signature is
5139 inserted. Hook functions may access the actual name of the file or the
5140 function used to insert the signature with
5141 @code{mh-signature-file-name}.
5142
5143 The signature can also be inserted using Identities.
5144 @xref{Identities}.
5145
5146 @node Picture, Adding Attachments, Signature, Editing Drafts
5147 @section Inserting Your Picture
5148
5149 @cindex @file{.face}
5150 @cindex files, @file{.face}
5151 @vindex mh-x-face-file
5152
5153 You can insert your picture in the header of your mail message so that
5154 recipients see your face in the @samp{From:} header field if their
5155 mail user agent is sophisticated enough. In MH-E, this is done by
5156 placing your image in the file named by the option
5157 @code{mh-x-face-file} which is @file{~/.face} by default.
5158
5159 @cindex @samp{Face:} header field
5160 @cindex @samp{X-Face:} header field
5161 @cindex @samp{X-Image-URL:} header field
5162 @cindex header field, @samp{Face:}
5163 @cindex header field, @samp{X-Face:}
5164 @cindex header field, @samp{X-Image-URL:}
5165
5166 If the file starts with either of the strings @samp{X-Face:},
5167 @samp{Face:} or @samp{X-Image-URL:} then the contents are added to the
5168 message header verbatim. Otherwise it is assumed that the file
5169 contains the value of the @samp{X-Face:} header field.
5170
5171 @cindex @command{compface}
5172 @cindex Unix commands, @command{compface}
5173
5174 The @samp{X-Face:} header field, which is a low-resolution, black and
5175 white image, can be generated using the
5176 @uref{ftp://ftp.cs.indiana.edu/pub/faces/compface/compface.tar.Z,
5177 @command{compface}} command. The @uref{http://www.dairiki.org/xface/,
5178 @cite{Online X-Face Converter}} is a useful resource for quick
5179 conversion of images into @samp{X-Face:} header fields.
5180
5181 Use the @uref{http://quimby.gnus.org/circus/face/make-face,
5182 @command{make-face}} script to convert a JPEG image to the higher
5183 resolution, color, @samp{Face:} header field.
5184
5185 The URL of any image can be used for the @samp{X-Image-URL:} field and
5186 no processing of the image is required.
5187
5188 @vindex mh-x-face-file
5189
5190 To prevent the setting of any of these header fields, either set
5191 @code{mh-x-face-file} to @code{nil}, or simply ensure that the file
5192 defined by this option doesn't exist.
5193
5194 @xref{Viewing}, to see how these header fields are displayed in MH-E.
5195
5196 @node Adding Attachments, Sending PGP, Picture, Editing Drafts
5197 @section Adding Attachments
5198
5199 @cindex @command{mhbuild}
5200 @cindex @command{mhn}
5201 @cindex MH commands, @command{mhbuild}
5202 @cindex MH commands, @command{mhn}
5203 @cindex MIME
5204 @cindex multimedia mail
5205
5206 MH-E has the capability to create multimedia messages. It uses the
5207 @sc{mime} (Multipurpose Internet Mail Extensions)
5208 protocol@footnote{@sc{mime} is defined in
5209 @uref{http://www.rfc-editor.org/rfc/rfc2045.txt, RFC 2045}.} The
5210 @sc{mime} protocol allows you to incorporate images, sound, video,
5211 binary files, and even commands that fetch a file with @samp{ftp} when
5212 your recipient reads the message!
5213
5214 @kindex C-c C-m
5215
5216 If you were to create a multimedia message with plain MH commands, you
5217 would insert @command{mhbuild} or @command{mhn} directives (henceforth
5218 called @dfn{MH-style directives} into your draft and use the
5219 @command{mhbuild} command in nmh or @command{mhn} command in MH and
5220 GNU mailutils to expand them. MH-E works in much the same way,
5221 although it provides a handful of commands prefixed with @kbd{C-c C-m}
5222 to insert the directives so you don't need to remember the syntax of
5223 them. Remember: you can always add MH-style directives by
5224 hand@footnote{See the section
5225 @uref{@value{MH-BOOK-HOME}/usimim.html#SeMIMa, Sending MIME Mail} in
5226 the MH book.}.
5227
5228 @cindex MIME Meta Language (MML)
5229 @cindex MML
5230 @vindex mh-compose-insertion
5231
5232 In addition to MH-style directives, MH-E also supports MML (@sc{mime}
5233 Meta Language) tags@footnote{
5234 @ifinfo
5235 @c Although the third argument should default to the
5236 @c first, makeinfo goes to the wrong Info file without it being
5237 @c different--it seems to be getting our own Composing node.
5238 @xref{Composing,,Composing with MML,emacs-mime}.
5239 @end ifinfo
5240 @ifnotinfo
5241 See the section Composing in
5242 @uref{http://www.gnus.org/manual/emacs-mime.html, @cite{The Emacs MIME
5243 Manual}}.
5244 @end ifnotinfo
5245 }. The option @code{mh-compose-insertion} can be used to choose
5246 between them. By default, this option is set to @samp{MML} if it is
5247 supported since it provides a lot more functionality. This option can
5248 also be set to @samp{MH} if MH-style directives are preferred.
5249
5250 @cindex media types
5251 @cindex MIME, media types
5252
5253 The MH-E @sc{mime} commands require a @dfn{media type} for each body
5254 part or attachment. For example, a PDF document is of type
5255 @samp{application/pdf} and an HTML document is of type
5256 @samp{text/html}. Some commands fill in the media type for you,
5257 whereas others require you to enter one.
5258
5259 @cindex @command{file}
5260 @cindex @file{/etc/mime.types}
5261 @cindex files, @file{/etc/mime.types}
5262 @cindex Unix commands, @command{file}
5263 @findex mailcap-mime-types
5264
5265 In the cases where MH-E can do so, it will determine the media type
5266 automatically. It uses the @command{file} command to do this. Failing
5267 that, the Emacs function @code{mailcap-mime-types} is used to provide
5268 a list from which to choose. This function usually reads the file
5269 @file{/etc/mime.types}.
5270
5271 Whether the media type is chosen automatically, or you choose it from
5272 a list, use the type that seems to match best the file that you are
5273 including. In the case of binaries, the media type
5274 @samp{application/x-executable} can be useful. If you can't find an
5275 appropriate media type, use @samp{text/plain} for text messages and
5276 @samp{application/octet-stream} for everything else.
5277
5278 @cindex content description
5279 @cindex MIME, content description
5280
5281 You are also sometimes asked for a @dfn{content description}. This is
5282 simply an optional brief phrase, in your own words, that describes the
5283 object. If you don't care to enter a content description, just press
5284 return and none will be included; however, a reader may skip over
5285 multimedia fields unless the content description is compelling.
5286
5287 You can also create your own @sc{mime} body parts. In the following
5288 example, I describe how you can create and edit a @samp{text/enriched}
5289 body part to liven up your plain text messages with boldface,
5290 underlining, and italics. I include an Emacs function which inserts
5291 enriched text tags.
5292
5293 @smalllisp
5294 @group
5295 (defvar enriched-text-types '(("b" . "bold") ("i" . "italic")
5296 ("u" . "underline")
5297 ("s" . "smaller") ("B" . "bigger")
5298 ("f" . "fixed")
5299 ("c" . "center"))
5300 "Alist of (final-character . tag) choices for add-enriched-text.
5301 Additional types can be found in RFC 1563.")
5302
5303 (defun add-enriched-text (begin end)
5304 "Add enriched text tags around region.
5305 The tag used comes from the list enriched-text-types and is
5306 specified by the last keystroke of the command. When called from Lisp,
5307 arguments are BEGIN and END@."
5308 (interactive "r")
5309 ;; @r{Set type to the tag indicated by the last keystroke.}
5310 (let ((type (cdr (assoc (char-to-string (logior last-input-char ?@w{`}))
5311 enriched-text-types))))
5312 (save-restriction ; @r{restores state from narrow-to-region}
5313 (narrow-to-region begin end) ; @r{narrow view to region}
5314 (goto-char (point-min)) ; @r{move to beginning of text}
5315 (insert "<" type ">") ; @r{insert beginning tag}
5316 (goto-char (point-max)) ; @r{move to end of text}
5317 (insert "</" type ">")))) ; @r{insert terminating tag}
5318 @i{Emacs function for entering enriched text}
5319
5320 @end group
5321 @end smalllisp
5322
5323 To use the function @code{add-enriched-text}, first add it to
5324 @file{~/.emacs} and create key bindings for it (@pxref{Composing}).
5325
5326 Then, in your plain text message, set the mark with @kbd{C-@@} or
5327 @kbd{C-@key{SPC}}, type in the text to be highlighted, and type @kbd{C-c t
5328 b}. This adds @samp{<bold>} where you set the mark and adds
5329 @samp{</bold>} at the location of your cursor, giving you something
5330 like: @samp{You should be <bold>very</bold>}.
5331
5332 Before sending this message, use @kbd{C-c C-m C-m}
5333 (@code{mh-mml-to-mime})@footnote{Use @kbd{C-c C-e}
5334 (@code{mh-mh-to-mime}) if you're using MH-style directives.} to add
5335 MIME header fields. Then replace @samp{text/plain} with
5336 @samp{text/enriched} in the @samp{Content-Type:} header field.
5337
5338 You may also be interested in investigating @code{sgml-mode}.
5339
5340 @subheading Including Files
5341
5342 @cindex attachments, inserting
5343 @cindex images
5344 @cindex MIME, images
5345 @cindex MIME, sound
5346 @cindex MIME, video
5347 @cindex sound
5348 @cindex video
5349 @findex mh-compose-insertion
5350 @kindex C-c C-m C-i
5351 @kindex C-c C-m i
5352 @vindex mh-compose-insertion
5353
5354 Binaries, images, sound, and video can be inserted in your message
5355 with the command @kbd{C-c C-m C-i} (@code{mh-compose-insertion}). You
5356 are prompted for the filename containing the object, the media type if
5357 it cannot be determined automatically, and a content description. If
5358 you're using MH-style directives, you will also be prompted for
5359 additional attributes.
5360
5361 @subheading Forwarding Multimedia Messages
5362
5363 @findex mh-compose-forward
5364 @kindex C-c C-m C-f
5365 @kindex C-c C-m f
5366
5367 Mail may be forwarded with @sc{mime} using the command @kbd{C-c C-m
5368 C-f} (@code{mh-compose-forward}). You are prompted for a content
5369 description, the name of the folder in which the messages to forward
5370 are located, and a range of messages, which defaults to the current
5371 message in that folder. @xref{Ranges}.
5372
5373 @subheading Including an FTP Reference
5374
5375 @cindex @command{ftp}
5376 @cindex MIME, @command{ftp}
5377 @cindex Unix commands, @command{ftp}
5378 @findex mh-mh-compose-anon-ftp
5379 @kindex C-c C-m C-g
5380 @kindex C-c C-m g
5381
5382 You can have your message initiate an @command{ftp} transfer when the
5383 recipient reads the message. To do this, use the command @kbd{C-c C-m
5384 C-g} (@code{mh-mh-compose-anon-ftp}). You are prompted for the remote
5385 host and filename, the media type, and the content description.
5386
5387 @subheading Including tar Files
5388
5389 @cindex @command{ftp}
5390 @cindex @command{tar}
5391 @cindex MIME, @command{ftp}
5392 @cindex MIME, @command{tar}
5393 @cindex Unix commands, @command{ftp}
5394 @cindex Unix commands, @command{tar}
5395 @findex mh-mh-compose-anon-ftp
5396 @findex mh-mh-compose-external-compressed-tar
5397 @kindex C-c C-m C-g
5398 @kindex C-c C-m C-t
5399 @kindex C-c C-m t
5400
5401 If the remote file is a compressed tar file, you can use @kbd{C-c C-m
5402 C-t} (@code{mh-mh-compose-external-compressed-tar}). Then, in addition
5403 to retrieving the file via anonymous @emph{ftp} as per the command
5404 @kbd{C-c C-m C-g} (@code{mh-mh-compose-anon-ftp}), the file will also
5405 be uncompressed and untarred. You are prompted for the remote host and
5406 filename and the content description.
5407
5408 @subheading Including Other External Files
5409
5410 @findex mh-mh-compose-external-type
5411 @kindex C-c C-m C-x
5412 @kindex C-c C-m x
5413
5414 The command @kbd{C-c C-m C-x} (@code{mh-mh-compose-external-type}) is
5415 a general utility for referencing external files. In fact, all of the
5416 other commands that insert tags to access external files call this
5417 command. You are prompted for the access type, remote host and
5418 filename, and content type. If you provide a prefix argument, you are
5419 also prompted for a content description, attributes, parameters, and a
5420 comment.
5421
5422 @subheading Previewing Multimedia Messages
5423
5424 When you are finished editing a @sc{mime} message, it might look like this:
5425
5426 @cartouche
5427 @smallexample
5428 3 t08/24 root received fax files on Wed Aug 24 11:00:
5429 4+t08/24 To:wohler Test<<This is a test message to get the
5430
5431
5432
5433
5434
5435 --:%% @{+inbox@} 4 msgs (1-4) Bot L4 (MH-Folder Show)---------------
5436 To: wohler
5437 cc:
5438 Subject: Test of MIME
5439 --------
5440 Here is the SETI@@Home logo:
5441
5442 <#part type="image/x-xpm" filename="~/lib/images/setiathome.xpm"
5443 disposition=inline description="SETI@@home logo">
5444 <#/part>
5445 --:** @{draft@} All L8 (MH-Letter)----------------------------------
5446
5447 @end smallexample
5448 @end cartouche
5449 @i{MH-E @sc{mime} draft}
5450
5451 @findex mh-mml-to-mime
5452 @kindex C-c C-m C-m
5453 @kindex C-c C-m m
5454
5455 Typically, you send a message with attachments just like any other
5456 message (@pxref{Sending Message}).
5457
5458 @findex mh-mml-to-mime
5459 @kindex C-c C-m C-m
5460
5461 However, you may take a sneak preview of the @sc{mime} encoding if you
5462 wish by running the command @kbd{C-c C-m C-m} (@code{mh-mml-to-mime}).
5463 The following screen shows the @sc{mime} encoding specified by the
5464 tags. You can see why mail user agents are usually built to hide these
5465 details from the user.
5466
5467 @cartouche
5468 @smallexample
5469 To: wohler
5470 cc:
5471 Subject: Test of MIME
5472 X-Mailer: MH-E 8.1; nmh 1.1; GNU Emacs 23.1
5473 MIME-Version: 1.0
5474 Content-Type: multipart/mixed; boundary="=-=-="
5475 --------
5476 --=-=-=
5477
5478 Here is the SETI@@Home logo:
5479
5480
5481 --=-=-=
5482 Content-Type: image/x-xpm
5483 Content-Disposition: inline; filename=setiathome.xpm
5484 Content-Transfer-Encoding: base64
5485 Content-Description: SETI@@home logo
5486
5487 LyogWFBNICovCnN0YXRpYyBjaGFyICogc2V0aWF0aG9tZV94cG1bXSA9IHsKIjQ1IDQ1IDc2N
5488 --:-- @{draft@} Top L1 (MH-Letter)----------------------------------
5489
5490 @end smallexample
5491 @end cartouche
5492 @i{MH-E @sc{mime} draft ready to send}
5493
5494 @cindex undo effects of mh-mml-to-mime
5495
5496 This action can be undone by running @kbd{C-_} (@code{undo}).
5497
5498 @cindex @command{mhbuild}
5499 @cindex @command{mhn}
5500 @cindex MH commands, @command{mhbuild}
5501 @cindex MH commands, @command{mhn}
5502 @cindex undo effects of mh-mh-to-mime
5503 @findex mh-mh-to-mime
5504 @findex mh-mh-to-mime-undo
5505 @kindex C-c C-e
5506 @kindex C-c C-m C-m
5507 @kindex C-c C-m C-u
5508 @kindex C-c C-m u
5509
5510 If you're using MH-style directives, use @kbd{C-c C-e}
5511 (@code{mh-mh-to-mime}) instead of @kbd{C-c C-m C-m}. This runs the
5512 command @command{mhbuild} (@command{mhn}) on the message which expands
5513 the tags@footnote{See the section
5514 @uref{@value{MH-BOOK-HOME}/usimim.html#SeMIMa, Sending MIME Mail} in
5515 the MH book.}. This action can be undone by running @kbd{C-c C-m C-u}
5516 (@code{mh-mh-to-mime-undo}), which works by reverting to a backup
5517 file. You are prompted to confirm this action, but you can avoid the
5518 confirmation by adding an argument (for example, @kbd{C-u C-c C-m
5519 C-u}).
5520
5521 @kindex C-c C-e
5522 @vindex mh-mh-to-mime-args
5523
5524 If you wish to pass additional arguments to @command{mhbuild}
5525 (@command{mhn}) to affect how it builds your message, use the option
5526 @code{mh-mh-to-mime-args}. For example, you can build a consistency
5527 check into the message by setting @code{mh-mh-to-mime-args} to
5528 @samp{-check}. The recipient of your message can then run
5529 @samp{mhbuild -check} on the message---@command{mhbuild}
5530 (@command{mhn}) will complain if the message has been corrupted on the
5531 way. The command @kbd{C-c C-e} only consults this option when given a
5532 prefix argument (as in @kbd{C-u C-c C-e}).
5533
5534 @kindex C-c C-e
5535 @vindex mh-mh-to-mime-hook
5536
5537 The hook @code{mh-mh-to-mime-hook} is called after the message has
5538 been formatted by @kbd{C-c C-e}.
5539
5540 @node Sending PGP, Checking Recipients, Adding Attachments, Editing Drafts
5541 @section Signing and Encrypting Messages
5542
5543 @cindex signing messages
5544 @cindex encrypting messages
5545 @cindex RFC 3156
5546
5547 MH-E can sign and encrypt messages as defined in
5548 @uref{http://www.rfc-editor.org/rfc/rfc3156.txt, RFC 3156}. If you
5549 should choose to sign or encrypt your message, use one of the
5550 following commands to do so any time before sending your message.
5551
5552 @findex mh-mml-secure-message-encrypt
5553 @findex mh-mml-secure-message-sign
5554 @findex mh-mml-secure-message-signencrypt
5555 @kindex C-c C-m C-e
5556 @kindex C-c C-m C-s
5557 @kindex C-c C-m e e
5558 @kindex C-c C-m e s
5559 @kindex C-c C-m s e
5560 @kindex C-c C-m s s
5561
5562 The command @kbd{C-c C-m C-s} (@code{mh-mml-secure-message-sign})
5563 inserts the following tag:
5564
5565 @smallexample
5566 <#secure method=pgpmime mode=sign>
5567 @end smallexample
5568
5569 This is used to sign your message digitally. Likewise, the command
5570 @kbd{C-c C-m C-e} (@code{mh-mml-secure-message-encrypt}) inserts the
5571 following tag:
5572
5573 @smallexample
5574 <#secure method=pgpmime mode=encrypt>
5575 @end smallexample
5576
5577 This is used to encrypt your message. Finally, the command @kbd{C-c
5578 C-m s e} (@code{mh-mml-secure-message-signencrypt}) inserts the
5579 following tag:
5580
5581 @smallexample
5582 <#secure method=pgpmime mode=signencrypt>
5583 @end smallexample
5584
5585 @findex mh-mml-unsecure-message
5586 @kindex C-c C-m C-n
5587 @kindex C-c C-m n
5588 @vindex mh-mml-method-default
5589
5590 This is used to sign and encrypt your message. In each of these cases,
5591 a proper multipart message is created for you when you send the
5592 message. Use the command @kbd{C-c C-m C-n}
5593 (@code{mh-mml-unsecure-message}) to remove these tags. Use a prefix
5594 argument (as in @kbd{C-u C-c C-m s e}) to be prompted for one of the
5595 possible security methods (see @code{mh-mml-method-default}).
5596
5597 @vindex mh-mml-method-default
5598
5599 The option @code{mh-mml-method-default} is used to select between a
5600 variety of mail security mechanisms. The default is @samp{PGP (MIME)}
5601 if it is supported; otherwise, the default is @samp{None}. Other
5602 mechanisms include vanilla @samp{PGP} and @samp{S/MIME}.
5603
5604 @cindex @samp{pgg} customization group
5605 @cindex PGG
5606 @cindex customization group, @samp{pgg}
5607
5608 The @samp{pgg} customization group may have some settings which may
5609 interest you.
5610 @iftex
5611 See @cite{The PGG Manual}.
5612 @end iftex
5613 @ifinfo
5614 @xref{Top, , The PGG Manual, pgg, The PGG Manual}.
5615 @end ifinfo
5616 @ifhtml
5617 See
5618 @uref{http://www.dk.xemacs.org/Documentation/packages/html/pgg.html,
5619 @cite{The PGG Manual}}.
5620 @end ifhtml
5621
5622 @cindex header field, @samp{Fcc:}
5623 @cindex @samp{Fcc:} header field
5624 @vindex pgg-encrypt-for-me
5625
5626 In particular, I turn on the option @code{pgg-encrypt-for-me} so that
5627 all messages I encrypt are encrypted with my public key as well. If
5628 you keep a copy of all of your outgoing mail with a @samp{Fcc:} header
5629 field, this setting is vital so that you can read the mail you write!
5630
5631 @node Checking Recipients, Sending Message, Sending PGP, Editing Drafts
5632 @section Checking Recipients
5633
5634 @cindex @samp{*MH-E Recipients*}
5635 @cindex @command{whom}
5636 @cindex MH commands, @command{whom}
5637 @cindex buffers, @samp{*MH-E Recipients*}
5638 @cindex checking recipients
5639 @cindex recipients, checking
5640 @findex mh-check-whom
5641 @kindex C-c C-w
5642
5643 The command @kbd{C-c C-w} (@code{mh-check-whom}) expands aliases so
5644 you can check the actual address(es) in the alias. A new buffer named
5645 @samp{*MH-E Recipients*} is created with the output of @command{whom}
5646 (@pxref{Miscellaneous})@footnote{See the section
5647 @uref{@value{MH-BOOK-HOME}/senove.html#WhaPro, What now?---and the
5648 whatnow Program} in the MH book.}.
5649
5650 @node Sending Message, Killing Draft, Checking Recipients, Editing Drafts
5651 @section Sending a Message
5652
5653 @cindex buffers, @samp{*MH-E Mail Delivery*}
5654 @cindex @samp{*MH-E Mail Delivery*}
5655 @cindex sending mail
5656 @findex mh-send-letter
5657 @kindex C-c C-c
5658
5659 When you are all through editing a message, you send it with the
5660 command @kbd{C-c C-c} (@code{mh-send-letter}). You can give a prefix
5661 argument (as in @kbd{C-u C-c C-c}) to monitor the first stage of the
5662 delivery; this output can be found in a buffer called @samp{*MH-E Mail
5663 Delivery*} (@pxref{Miscellaneous}).
5664
5665 @cindex sending mail
5666 @cindex spell check
5667 @findex ispell-message
5668 @kindex C-c C-c
5669 @vindex mh-before-send-letter-hook
5670
5671 The hook @code{mh-before-send-letter-hook} is run at the beginning of
5672 the command @kbd{C-c C-c}. For example, if you want to check your
5673 spelling in your message before sending, add the function
5674 @code{ispell-message}.
5675
5676 @cindex @command{send}
5677 @cindex MH commands, @command{send}
5678 @vindex mh-send-prog
5679
5680 In case the MH @command{send} program@footnote{See the section
5681 @uref{@value{MH-BOOK-HOME}/sensen.html, Sending Some Mail: comp send}
5682 in the MH book.} is installed under a different name, use
5683 @code{mh-send-prog} to tell MH-E the name.
5684
5685 The hook @code{mh-annotate-msg-hook} is run after annotating the
5686 message and scan line (@pxref{Sending Mail}).
5687
5688 @node Killing Draft, , Sending Message, Editing Drafts
5689 @section Killing the Draft
5690
5691 @cindex killing draft
5692 @findex kill-buffer
5693 @findex mh-fully-kill-draft
5694 @kindex C-c C-q
5695 @kindex C-x k
5696
5697 If for some reason you are not happy with the draft, you can use the
5698 command @kbd{C-c C-q} (@code{mh-fully-kill-draft}) to kill the draft
5699 buffer and delete the draft message. Use the command @kbd{C-x k}
5700 (@code{kill-buffer}) if you don't want to delete the draft message.
5701
5702 @node Aliases, Identities, Editing Drafts, Top
5703 @chapter Aliases
5704
5705 @cindex aliases
5706
5707 MH aliases are used in the same way in MH-E as they are in MH@. Any
5708 alias listed as a recipient will be expanded when the message is sent.
5709 This chapter discusses other things you can do with aliases in MH-E.
5710
5711 @cindex MH-Letter mode
5712 @cindex modes, MH-Letter
5713
5714 The following commands are available in MH-Letter mode with the
5715 exception of @code{mh-alias-reload} which can be called from anywhere.
5716
5717 @table @kbd
5718 @kindex @key{SPC}
5719 @findex mh-letter-complete-or-space
5720 @item @key{SPC}
5721 Perform completion or insert space (@code{mh-letter-complete-or-space}).
5722 @c -------------------------
5723 @kindex M-@key{TAB}
5724 @findex mh-letter-complete
5725 @item M-@key{TAB}
5726 Perform completion on header field or word preceding point
5727 (@code{mh-letter-complete}).
5728 @c -------------------------
5729 @findex mh-alias-apropos
5730 @item mh-alias-apropos
5731 Show all aliases or addresses that match a regular expression.
5732 @c -------------------------
5733 @findex mh-alias-grab-from-field
5734 @item mh-alias-grab-from-field
5735 Add alias for the sender of the current message
5736 @c -------------------------
5737 @findex mh-alias-reload
5738 @item mh-alias-reload
5739 Reload MH aliases.
5740 @end table
5741
5742 @cindex @samp{mh-alias} customization group
5743 @cindex customization group, @samp{mh-alias}
5744
5745 The @samp{mh-alias} customization group contains options associated
5746 with aliases.
5747
5748 @vtable @code
5749 @item mh-alias-completion-ignore-case-flag
5750 On means don't consider case significant in MH alias completion
5751 (default: @samp{on}).
5752 @c -------------------------
5753 @item mh-alias-expand-aliases-flag
5754 On means to expand aliases entered in the minibuffer (default:
5755 @samp{off}).
5756 @c -------------------------
5757 @item mh-alias-flash-on-comma
5758 Specify whether to flash address or warn on translation (default: @samp{Flash
5759 but Don't Warn If No Alias}).
5760 @c -------------------------
5761 @item mh-alias-insert-file
5762 Filename used to store a new MH-E alias (default: @samp{Use Aliasfile
5763 Profile Component}).
5764 @c -------------------------
5765 @item mh-alias-insertion-location
5766 Specifies where new aliases are entered in alias files (default:
5767 @samp{Alphabetical}).
5768 @c -------------------------
5769 @item mh-alias-local-users
5770 If @samp{on}, local users are added to alias completion (default:
5771 @samp{on}).
5772 @c -------------------------
5773 @item mh-alias-local-users-prefix
5774 String prefixed to the real names of users from the password file
5775 (default: @code{"local."}.
5776 @c -------------------------
5777 @item mh-alias-passwd-gecos-comma-separator-flag
5778 On means the GECOS field in the password file uses a comma separator
5779 (default: @samp{on}).
5780 @end vtable
5781
5782 The following hook is available.
5783
5784 @vtable @code
5785 @item mh-alias-reloaded-hook
5786 Hook run by @code{mh-alias-reload} after loading aliases (default:
5787 @code{nil}).
5788 @end vtable
5789
5790 @subheading Adding Addresses to Draft
5791
5792 You can use aliases when you are adding recipients to a message.
5793
5794 @findex minibuffer-complete
5795 @kindex @key{TAB}
5796 @vindex mh-alias-expand-aliases-flag
5797 @vindex mh-compose-prompt-flag
5798
5799 In order to use minibuffer prompting for recipients and the subject
5800 line in the minibuffer, turn on the option
5801 @code{mh-compose-prompt-flag} (@pxref{Composing}), and use the
5802 @key{TAB} (@code{minibuffer-complete}) command to complete aliases
5803 (and optionally local logins) when prompted for the recipients. Turn
5804 on the option @code{mh-alias-expand-aliases-flag} if you want these
5805 aliases to be expanded to their respective addresses in the draft.
5806
5807 @findex mh-letter-complete
5808 @findex mh-letter-complete-or-space
5809 @kindex @key{SPC}
5810 @kindex M-@key{TAB}
5811
5812 Otherwise, you can complete aliases in the header of the draft with
5813 @kbd{M-@key{TAB}} (@code{mh-letter-complete}) or @key{SPC}
5814 (@code{mh-letter-complete-or-space}).
5815
5816 @vindex mh-alias-completion-ignore-case-flag
5817
5818 As MH ignores case in the aliases, so too does MH-E@. However, you may
5819 turn off the option @code{mh-alias-completion-ignore-case-flag} to
5820 make case significant which can be used to segregate completion of
5821 your aliases. You might use uppercase for mailing lists and lowercase
5822 for people. For example, you might have:
5823
5824 @smallexample
5825 mark.baushke: Mark Baushke <mdb@@stop.mail-abuse.org>
5826 MH-E: MH-E Mailing List <mh-e-devel@@stop.mail-abuse.org>
5827 @end smallexample
5828
5829 When this option is turned off, if you were to type @kbd{M} in the
5830 @samp{To:} field and then @kbd{M-@key{TAB}}, then you'd get the list;
5831 if you started with @kbd{m} and then entered @kbd{M-@key{TAB}}, then
5832 you'd get Mark's address. Note that this option affects completion
5833 only. If you were to enter @kbd{Mark.Baushke}, it would still be
5834 identified with your @samp{mark.baushke} alias.
5835
5836 @findex mh-alias-minibuffer-confirm-address
5837 @findex mh-letter-confirm-address
5838 @vindex mh-alias-flash-on-comma
5839 @vindex mh-compose-prompt-flag
5840
5841 To verify that the alias you've entered is valid, the alias will be
5842 displayed in the minibuffer when you type a comma
5843 (@code{mh-letter-confirm-address} or
5844 @code{mh-alias-minibuffer-confirm-address} if the option
5845 @code{mh-compose-prompt-flag} is turned on). @xref{Composing}. This
5846 behavior can be controlled with the option
5847 @code{mh-alias-flash-on-comma} which provides three choices:
5848 @samp{Flash but Don't Warn If No Alias}, @samp{Flash and Warn If No
5849 Alias}, and @samp{Don't Flash Nor Warn If No Alias}.
5850
5851 For another way to verify the alias expansion, see @ref{Checking
5852 Recipients}.
5853
5854 @subheading Loading Aliases
5855
5856 @cindex @command{ali}
5857 @cindex @file{/etc/nmh/MailAliases}
5858 @cindex @samp{Aliasfile:} MH profile component
5859 @cindex MH commands, @command{ali}
5860 @cindex MH profile component, @samp{Aliasfile:}
5861 @cindex files, @file{/etc/nmh/MailAliases}
5862
5863 MH-E loads aliases for completion and folder name hints from various
5864 places. It uses the MH command @command{ali}@footnote{See the section
5865 @uref{@value{MH-BOOK-HOME}/mh.html, MH Aliases} in the MH book.} to
5866 read aliases from the files listed in the profile component
5867 @samp{Aliasfile:} as well as system-wide aliases (for example,
5868 @file{/etc/nmh/MailAliases}).
5869
5870 @cindex @file{/etc/passwd}
5871 @cindex files, @file{/etc/passwd}
5872
5873 In addition, aliases are created from @file{/etc/passwd} entries with
5874 a user ID larger than a magical number, typically 200. This can be a
5875 handy tool on a machine where you and co-workers exchange messages.
5876 These aliases have the form @samp{local.@var{first.last}} if a real
5877 name is present in the password file. Otherwise, the alias will have
5878 the form @samp{local.@var{login}}.
5879
5880 @vindex mh-alias-local-users-prefix
5881
5882 The prefix @samp{local.} can be modified via the option
5883 @code{mh-alias-local-users-prefix}. This option can also be set to
5884 @samp{Use Login}.
5885
5886 For example, consider the following password file entry:
5887
5888 @smallexample
5889 psg:x:1000:1000:Peter S Galbraith,,,:/home/psg:/bin/tcsh
5890 @end smallexample
5891
5892 @vindex mh-alias-local-users-prefix
5893
5894 The following settings of option @code{mh-alias-local-users-prefix}
5895 will produce the associated aliases:
5896
5897 @table @code
5898 @item "local."
5899 local.peter.galbraith
5900 @c -------------------------
5901 @item ""
5902 peter.galbraith
5903 @c -------------------------
5904 @item Use Login
5905 psg
5906 @end table
5907
5908 @vindex mh-alias-passwd-gecos-comma-separator-flag
5909
5910 In the example above, commas are used to separate different values
5911 within the so-called GECOS field. This is a fairly common usage.
5912 However, in the rare case that the GECOS field in your password file
5913 is not separated by commas and whose contents may contain commas, you
5914 can turn the option @code{mh-alias-passwd-gecos-comma-separator-flag}
5915 off.
5916
5917 @cindex NIS, obtaining local aliases from
5918 @cindex @samp{ypcat passwd}
5919 @vindex mh-alias-local-users
5920
5921 If you're on a system with thousands of users you don't know, and the
5922 loading of local aliases slows MH-E down noticeably, then the local
5923 alias feature can be disabled by turning off the option
5924 @code{mh-alias-local-users}. This option also takes a string which is
5925 executed to generate the password file. For example, use @samp{ypcat
5926 passwd} to obtain the NIS password file.
5927
5928 @findex mh-alias-reload
5929 @kindex M-x mh-alias-reload
5930 @vindex mh-alias-reloaded-hook
5931
5932 Since aliases are updated frequently, MH-E reloads aliases
5933 automatically whenever an alias lookup occurs if an alias source has
5934 changed. However, you can reload your aliases manually by calling the
5935 command @kbd{M-x mh-alias-reload} directly. This command runs
5936 @code{mh-alias-reloaded-hook} after the aliases have been loaded.
5937
5938 @subheading Adding Aliases
5939
5940 In the past, you have manually added aliases to your alias file(s)
5941 listed in your @samp{Aliasfile:} profile component. MH-E provides
5942 other methods for maintaining your alias file(s).
5943
5944 @findex mh-alias-add-alias
5945 @kindex M-x mh-alias-add-alias
5946
5947 You can use the @kbd{M-x mh-alias-add-alias} command which will prompt
5948 you for the alias and address that you would like to add. If the alias
5949 exists already, you will have the choice of inserting the new alias
5950 before or after the old alias. In the former case, this alias will be
5951 used when sending mail to this alias. In the latter case, the alias
5952 serves as an additional folder name hint when filing messages
5953 (@pxref{Folder Selection}).
5954
5955 Earlier, the alias prefix @samp{local} was presented. You can use
5956 other prefixes to organize your aliases or disambiguate entries. You
5957 might use prefixes for locales, jobs, or activities. For example, I
5958 have:
5959
5960 @smallexample
5961 @group
5962 ; Work
5963 attensity.don.mitchell: Don Mitchell <dmitchell@@stop.mail-abuse.com>
5964 isharp.don.mitchell: Don Mitchell <donaldsmitchell@@stop.mail-abuse.com>
5965 ...
5966 ; Sport
5967 diving.ken.mayer: Ken Mayer <kmayer@@stop.mail-abuse.com>
5968 sailing.mike.maloney: Mike Maloney <mmaloney@@stop.mail-abuse.com>
5969 ...
5970 ; Personal
5971 ariane.kolkmann: Ariane Kolkmann <ArianeKolkmann@@stop.mail-abuse.com>
5972 ...
5973 @end group
5974 @end smallexample
5975
5976 Using prefixes instead of postfixes helps you explore aliases during
5977 completion. If you forget the name of an old dive buddy, you can enter
5978 @samp{div} and then @key{SPC} to get a listing of all your dive buddies.
5979
5980 @kindex M-x mh-alias-add-address-under-point
5981 @kindex M-x mh-alias-grab-from-field
5982
5983 An alias for the sender of the current message is added automatically
5984 by clicking on the @samp{Grab From alias} tool bar button or by running
5985 the @kbd{M-x mh-alias-grab-from-field} command. Aliases for other
5986 recipients of the current message are added by placing your cursor
5987 over the desired recipient and giving the @kbd{M-x
5988 mh-alias-add-address-under-point} command.
5989
5990 @vindex mh-alias-insert-file
5991 @vindex mh-alias-insertion-location
5992
5993 The options @code{mh-alias-insert-file} and
5994 @code{mh-alias-insertion-location} controls how and where these aliases
5995 are inserted.
5996
5997 @vindex mh-alias-insert-file
5998
5999 The default setting of option @code{mh-alias-insert-file} is @samp{Use
6000 Aliasfile Profile Component}. This option can also hold the name of a
6001 file or a list a file names. If this option is set to a list of file
6002 names, or the @samp{Aliasfile:} profile component contains more than
6003 one file name, MH-E will prompt for one of them.
6004
6005 @vindex mh-alias-insertion-location
6006
6007 The option @code{mh-alias-insertion-location} is set to
6008 @samp{Alphabetical} by default. If you organize your alias file in
6009 other ways, then the settings @samp{Top} and @samp{Bottom} might be
6010 more appropriate.
6011
6012 @subheading Querying Aliases
6013
6014 @cindex regular expressions, @code{mh-alias-apropos}
6015 @findex mh-alias-apropos
6016 @kindex M-x mh-alias-apropos
6017
6018 If you can't quite remember an alias, you can use @kbd{M-x
6019 mh-alias-apropos} to show all aliases or addresses that match a
6020 regular expression
6021 @ifnothtml
6022 (@pxref{Regexps, , Syntax of Regular Expressions, emacs, The
6023 GNU Emacs Manual}).
6024 @end ifnothtml
6025 @ifhtml
6026 (see the section
6027 @uref{http://www.gnu.org/software/emacs/manual/html_node/emacs/Regexps.html,
6028 Syntax of Regular Expressions} in
6029 @cite{The GNU Emacs Manual}).
6030 @end ifhtml
6031
6032 @node Identities, Speedbar, Aliases, Top
6033 @chapter Identities
6034
6035 @cindex identities
6036 @cindex multiple personalities
6037
6038 MH-E supports the concept of multiple personalities or identities.
6039 This means that you can easily have a different header and signature
6040 at home and at work.
6041
6042 @cindex @samp{Identity} menu
6043 @cindex menu, @samp{Identity}
6044
6045 A couple of commands are used to insert identities in MH-Letter mode
6046 which are also found in the @samp{Identity} menu.
6047
6048 @table @kbd
6049 @kindex C-c C-d
6050 @findex mh-insert-identity
6051 @item C-c C-d
6052 Insert fields specified by given identity (@code{mh-insert-identity}).
6053 @c -------------------------
6054 @cindex @samp{Identity > Insert Auto Fields} menu item
6055 @cindex menu item, @samp{Identity > Insert Auto Fields}
6056 @kindex C-c M-d
6057 @findex mh-insert-auto-fields
6058 @item C-c M-d
6059 Insert custom fields if recipient found in @code{mh-auto-fields-list}
6060 (@code{mh-insert-auto-fields}).
6061 @end table
6062
6063 @cindex @samp{mh-identity} customization group
6064 @cindex customization group, @samp{mh-identity}
6065
6066 The @samp{mh-identity} customization group contains the following
6067 options.
6068
6069 @vtable @code
6070 @item mh-auto-fields-list
6071 List of recipients for which header lines are automatically inserted
6072 (default: @code{nil}).
6073 @c -------------------------
6074 @item mh-auto-fields-prompt-flag
6075 On means to prompt before sending if fields inserted (default:
6076 @samp{on})
6077 @c -------------------------
6078 @item mh-identity-default
6079 Default identity to use when @code{mh-letter-mode} is called (default:
6080 @samp{None}).
6081 @c -------------------------
6082 @item mh-identity-handlers
6083 Handler functions for fields in @code{mh-identity-list}.
6084 @c -------------------------
6085 @item mh-identity-list
6086 List of identities (default: @code{nil}).
6087 @end vtable
6088
6089 Some of the common header fields that people change depending on the
6090 context are the @samp{From:} and @samp{Organization:} fields, as well
6091 as the signature.
6092
6093 @vindex mh-identity-list
6094
6095 This is done by customizing the option @code{mh-identity-list}. In the
6096 customization buffer for this option, click on the @samp{INS} button
6097 and enter a label such as @samp{Home} or @samp{Work}. Then click on
6098 the @samp{INS} button with the label @samp{Add at least one item
6099 below}. The @samp{Value Menu} has the following menu items:
6100
6101 @table @samp
6102 @cindex header field, @samp{From:}
6103 @cindex @samp{From:} header field
6104 @item From Field
6105 Specify an alternate @samp{From:} header field. You must include a
6106 valid email address. A standard format is @samp{First Last
6107 <login@@host.domain>}. If you use an initial with a period, then you
6108 must quote your name as in @samp{"First I. Last"
6109 <login@@host.domain>}.
6110 @c -------------------------
6111 @cindex header field, @samp{Organization:}
6112 @cindex @samp{Organization:} header field
6113 @item Organization Field
6114 People usually list the name of the company where they work here.
6115 @c -------------------------
6116 @item Other Field
6117 Set any arbitrary header field and value here. Unless the header field
6118 is a standard one, precede the name of your field's label with
6119 @samp{X-}, as in @samp{X-Fruit-of-the-Day:}.
6120 @c -------------------------
6121 @item Attribution Verb
6122 This value overrides the setting of
6123 @code{mh-extract-from-attribution-verb}. @xref{Inserting Letter}.
6124 @c -------------------------
6125 @cindex signature
6126 @vindex mh-signature-file-name
6127 @item Signature
6128 Set your signature with this item. You can specify the contents of
6129 @code{mh-signature-file-name}, a file, or a function.
6130 @xref{Signature}.
6131 @c -------------------------
6132 @item GPG Key ID
6133 Specify a different key to sign or encrypt messages.
6134 @end table
6135
6136 @cindex Identity menu
6137 @cindex menu, Identity
6138 @findex mh-insert-identity
6139 @kindex C-c C-d
6140
6141 You can select the identities you have added via the menu called
6142 @samp{Identity} in the MH-Letter buffer. You can also use @kbd{C-c
6143 C-d} (@code{mh-insert-identity}). To clear the fields and signature
6144 added by the identity, select the @samp{None} identity.
6145
6146 @cindex menu item, @samp{Identity > Customize Identities}
6147 @cindex menu item, @samp{Identity > Save as Default}
6148 @cindex menu item, @samp{Identity > Set Default for Session}
6149 @cindex @samp{Identity > Customize Identities} menu item
6150 @cindex @samp{Identity > Save as Default} menu item
6151 @cindex @samp{Identity > Set Default for Session} menu item
6152 @vindex mh-identity-default
6153
6154 The @samp{Identity} menu contains two other items to save you from
6155 having to set the identity on every message. The menu item @samp{Set
6156 Default for Session} can be used to set the default identity to the
6157 current identity until you exit Emacs. The menu item @samp{Save as
6158 Default} sets the option @code{mh-identity-default} to the current
6159 identity setting. You can also customize the option
6160 @code{mh-identity-default} in the usual fashion. If you find that you
6161 need to add another identity, the menu item @samp{Customize
6162 Identities} is available for your convenience.
6163
6164 @cindex regular expressions, @code{mh-auto-fields-list}
6165 @vindex mh-auto-fields-list
6166
6167 The option @code{mh-auto-fields-list} can also be used to set the
6168 identity depending on the recipient to provide even more control. To
6169 customize @code{mh-auto-fields-list}, click on the @samp{INS} button
6170 and enter a regular expression for the recipient's address
6171 @ifnothtml
6172 (@pxref{Regexps, , Syntax of Regular Expressions, emacs, The
6173 GNU Emacs Manual}).
6174 @end ifnothtml
6175 @ifhtml
6176 (see the section
6177 @uref{http://www.gnu.org/software/emacs/manual/html_node/emacs/Regexps.html,
6178 Syntax of Regular Expressions} in
6179 @cite{The GNU Emacs Manual}).
6180 @end ifhtml
6181 Click on the @samp{INS} button with the @samp{Add at least one item
6182 below} label. The @samp{Value Menu} contains the following menu items:
6183
6184 @table @samp
6185 @item Identity
6186 Select an identity from those configured in @code{mh-identity-list}.
6187 All of the information for that identity will be added if the
6188 recipient matches.
6189 @c -------------------------
6190 @cindex @samp{Fcc:} header field
6191 @cindex header field, @samp{Fcc:}
6192 @item Fcc Field
6193 Insert an @samp{Fcc:} header field with the folder you provide. When
6194 you send the message, MH will put a copy of your message in this
6195 folder.
6196 @c -------------------------
6197 @cindex @samp{Mail-Followup-To:} header field
6198 @cindex header field, @samp{Mail-Followup-To:}
6199 @item Mail-Followup-To Field
6200 Insert an @samp{Mail-Followup-To:} header field with the recipients
6201 you provide. If the recipient's mail user agent supports this header
6202 field@footnote{@samp{Mail-Followup-To:} is supported by nmh.}, then
6203 their replies will go to the addresses listed. This is useful if their
6204 replies go both to the list and to you and you don't have a mechanism
6205 to suppress duplicates. If you reply to someone not on the list, you
6206 must either remove the @samp{Mail-Followup-To:} field, or ensure the
6207 recipient is also listed there so that he receives replies to your
6208 reply.
6209 @c -------------------------
6210 @item Other Field
6211 Other header fields may be added using this menu item.
6212 @end table
6213
6214 @findex mh-insert-auto-fields
6215 @kindex C-c M-d
6216 @vindex mh-auto-fields-prompt-flag
6217
6218 These fields can only be added after the recipient is known. Because
6219 you can continue to add recipients as you edit the draft, MH-E waits
6220 until the message is sent to perform the auto-insertions. This seems
6221 strange at first, but you'll get used to it. There are two ways to
6222 help you feel that the desired fields are added. The first is the
6223 action when the message is sent: if any fields are added
6224 automatically, you are given a chance to see and to confirm these
6225 fields before the message is actually sent. You can do away with this
6226 confirmation by turning off the option
6227 @code{mh-auto-fields-prompt-flag}. The second method is manual: once
6228 the header contains one or more recipients, you may run the command
6229 @kbd{C-c M-d} (@code{mh-insert-auto-fields}) or choose the
6230 @samp{Identity -> Insert Auto Fields} menu item to insert these fields
6231 manually. However, if you use this command, the automatic insertion
6232 when the message is sent is disabled.
6233
6234 @vindex mh-auto-fields-list
6235 @vindex mh-identity-list
6236
6237 You should avoid using the same header field in
6238 @code{mh-auto-fields-list} and @code{mh-identity-list} definitions
6239 that may apply to the same message as the result is undefined.
6240
6241 @vindex mh-identity-handlers
6242 @vindex mh-identity-list
6243
6244 The option @code{mh-identity-handlers} is used to change the way that
6245 fields, signatures, and attributions in @code{mh-identity-list} are
6246 added. To customize @code{mh-identity-handlers}, replace the name of
6247 an existing handler function associated with the field you want to
6248 change with the name of a function you have written. You can also
6249 click on an @samp{INS} button and insert a field of your choice and
6250 the name of the function you have written to handle it.
6251
6252 @vindex mh-identity-list
6253
6254 The @samp{Field} field can be any field that you've used in your
6255 @code{mh-identity-list}. The special fields @samp{:attribution-verb},
6256 @samp{:signature}, or @samp{:pgg-default-user-id} are used for the
6257 @code{mh-identity-list} choices @samp{Attribution Verb},
6258 @samp{Signature}, and @samp{GPG Key ID} respectively.
6259
6260 The handler associated with the @samp{:default} field is used when no
6261 other field matches.
6262
6263 The handler functions are passed two or three arguments: the field
6264 itself (for example, @samp{From}), or one of the special fields (for
6265 example, @samp{:signature}), and the action @samp{'remove} or
6266 @samp{'add}. If the action is @samp{'add}, an additional argument
6267 containing the value for the field is given.
6268
6269 @node Speedbar, Menu Bar, Identities, Top
6270 @chapter The Speedbar
6271
6272 @cindex folder navigation
6273 @cindex speedbar
6274 @findex mh-visit-folder
6275 @kindex F v
6276 @kindex M-x speedbar
6277 @kindex Mouse-2
6278
6279 You can also use the speedbar
6280 @ifnothtml
6281 (@pxref{Speedbar, , Speedbar Frames, emacs, The GNU Emacs Manual},)
6282 @end ifnothtml
6283 @ifhtml
6284 (see the section
6285 @uref{http://www.gnu.org/software/emacs/manual/html_node/emacs/Speedbar.html,
6286 Speedbar Frames} in @cite{The GNU Emacs Manual})
6287 @end ifhtml
6288 to view your folders. To bring up the speedbar, run @kbd{M-x speedbar
6289 @key{RET}}. You will see a new frame appear with all of your MH
6290 folders. Folders with unseen messages appear in boldface. Click on a
6291 folder name with @kbd{Mouse-2} to visit that folder in a similar
6292 fashion to the command @kbd{F v} (@code{mh-visit-folder})
6293 (@pxref{Folders}). Click on the @samp{+} icon to expand and view the
6294 sub-folders of that folder.
6295
6296 The speedbar can be manipulated with the keyboard as well. Use the
6297 Emacs navigational keys (like the arrow keys, or @kbd{C-n}) to move
6298 the cursor over the desired folder and then use the shortcuts for the
6299 menu items listed in the table below.
6300
6301 @table @samp
6302 @findex mh-speed-view
6303 @item Visit Folder (@key{RET})
6304 Visits the selected folder just as if you had used @kbd{F v}
6305 (@code{mh-speed-view}).
6306 @c -------------------------
6307 @findex mh-speed-expand-folder
6308 @item Expand Nested Folders (@kbd{+})
6309 Expands the selected folder in the speedbar, exposing the children
6310 folders inside it (@code{mh-speed-expand-folder}).
6311 @c -------------------------
6312 @findex mh-speed-contract-folder
6313 @item Contract Nested Folders (@kbd{-})
6314 Contracts or collapses the selected folder in the speedbar, hiding the
6315 children folders inside it (@code{mh-speed-contract-folder}).
6316 @c -------------------------
6317 @findex mh-speed-refresh
6318 @item Refresh Speedbar (@kbd{r})
6319 Regenerates the list of folders in the speedbar. Run this command if
6320 you've added or deleted a folder, or want to update the unseen message
6321 count before the next automatic update (@code{mh-speed-refresh}).
6322 @end table
6323
6324 @findex delete-frame
6325 @kindex C-x 5 0
6326 @kindex Mouse-3
6327
6328 You can click on @kbd{Mouse-3} to bring up a context menu that
6329 contains these items. Dismiss the speedbar with @kbd{C-x 5 0}
6330 (@code{delete-frame}).
6331
6332 @cindex @command{flists}
6333 @cindex MH commands, @command{flists}
6334 @cindex @samp{mh-speedbar} customization group
6335 @cindex customization group, @samp{mh-speedbar}
6336
6337 The MH-E speedbar uses the MH command @command{flists}@footnote{See
6338 the section @uref{@value{MH-BOOK-HOME}/morseq.html#flist, Searching for
6339 Sequences with flist} in the MH book.} to generate the list of
6340 folders. The @samp{mh-speedbar} customization group contains the
6341 following option which controls how often the speedbar calls
6342 @command{flists}.
6343
6344 @vtable @code
6345 @item mh-speed-update-interval
6346 Time between speedbar updates in seconds (default: 60). Set to 0 to
6347 disable automatic update.
6348 @end vtable
6349
6350 You can modify the appearance of the folders in the speedbar by
6351 customizing the following faces.
6352
6353 @vtable @code
6354 @item mh-speedbar-folder
6355 Basic folder face.
6356 @c -------------------------
6357 @item mh-speedbar-folder-with-unseen-messages
6358 Folder face when folder contains unread messages.
6359 @c -------------------------
6360 @item mh-speedbar-selected-folder
6361 Selected folder face.
6362 @c -------------------------
6363 @item mh-speedbar-selected-folder-with-unseen-messages
6364 Selected folder face when folder contains unread messages.
6365 @end vtable
6366
6367 @node Menu Bar, Tool Bar, Speedbar, Top
6368 @chapter The Menu Bar
6369
6370 @cindex @samp{Folder} menu
6371 @cindex @samp{Identity} menu
6372 @cindex @samp{Letter} menu
6373 @cindex @samp{Message} menu
6374 @cindex @samp{Search} menu
6375 @cindex @samp{Sequence} menu
6376 @cindex Folder menu
6377 @cindex Identity menu
6378 @cindex Letter menu
6379 @cindex MH-Folder mode
6380 @cindex MH-Letter mode
6381 @cindex MH-Search mode
6382 @cindex Message menu
6383 @cindex Search menu
6384 @cindex Sequence menu
6385 @cindex menu bar
6386 @cindex menu, Folder
6387 @cindex menu, Identity
6388 @cindex menu, Letter
6389 @cindex menu, Message
6390 @cindex menu, Search
6391 @cindex menu, Sequence
6392 @cindex menu, @samp{Folder}
6393 @cindex menu, @samp{Identity}
6394 @cindex menu, @samp{Letter}
6395 @cindex menu, @samp{Message}
6396 @cindex menu, @samp{Search}
6397 @cindex menu, @samp{Sequence}
6398 @cindex modes, MH-Folder
6399 @cindex modes, MH-Letter
6400 @cindex modes, MH-Search
6401
6402 For those of you who prefer to mouse and menu instead of using the
6403 meta-coke-bottle-bucky keys, MH-E provides menu items for most of its
6404 functions. The MH-Folder buffer adds the @samp{Folder},
6405 @samp{Message}, and @samp{Sequence} menus. The MH-Letter buffer adds
6406 the @samp{Identity} and @samp{Letter} menus. The MH-Search buffer adds
6407 the @samp{Search} menu. There's no need to list the actual items here,
6408 as you can more easily see them for yourself, and the functions are
6409 already described elsewhere in this manual.
6410
6411 For a description of the menu bar, please
6412 @ifnothtml
6413 @xref{Menu Bar, , The Menu Bar, emacs, The GNU Emacs Manual}.
6414 @end ifnothtml
6415 @ifhtml
6416 see the section
6417 @uref{http://www.gnu.org/software/emacs/manual/html_node/emacs/Menu-Bar.html,
6418 The Menu Bar} in @cite{The GNU Emacs Manual}.
6419 @end ifhtml
6420
6421 The Emacs manual describes how to get online help for a particular
6422 menu item. You can also look up a menu item in the index of this
6423 manual in two ways: all of the menu items are listed alphabetically,
6424 and you can also browse all of the items under the index entry
6425 @samp{menu item}.
6426
6427 @node Tool Bar, Searching, Menu Bar, Top
6428 @chapter The Tool Bar
6429
6430 @cindex tool bar
6431
6432 Emacs also provides a graphical tool bar. For a description of the
6433 tool bar, please
6434 @ifnothtml
6435 @xref{Tool Bars, , Tool Bars, emacs, The GNU Emacs Manual}.
6436 @end ifnothtml
6437 @ifhtml
6438 see the section
6439 @uref{http://www.gnu.org/software/emacs/manual/html_node/emacs/Tool-Bars.html,
6440 Tool Bars} in @cite{The GNU Emacs Manual}.
6441 @end ifhtml
6442
6443 @cindex @samp{mh-tool-bar} customization group
6444 @cindex customization group, @samp{mh-tool-bar}
6445
6446 MH-E adds several icons to this tool bar; you can modify the MH-E
6447 aspects of the tool bar via the @samp{mh-tool-bar} customization group.
6448
6449 @vtable @code
6450 @item mh-tool-bar-folder-buttons
6451 List of buttons to include in MH-Folder tool bar (default: a checklist
6452 too long to list here).
6453 @c -------------------------
6454 @item mh-tool-bar-letter-buttons
6455 List of buttons to include in MH-Letter tool bar (default: a checklist
6456 too long to list here).
6457 @c -------------------------
6458 @item mh-tool-bar-search-function
6459 Function called by the tool bar search button (default:
6460 @code{mh-search}).
6461 @c -------------------------
6462 @item mh-xemacs-tool-bar-position
6463 Tool bar location (default: @samp{Same As Default Tool Bar}).
6464 @c -------------------------
6465 @item mh-xemacs-use-tool-bar-flag
6466 If @samp{on}, use tool bar (default: @samp{on}, if supported).
6467 @end vtable
6468
6469 In GNU Emacs, icons for some of MH-E's functions are added to the tool
6470 bar. In XEmacs, you have the opportunity to create a separate tool bar for
6471 the MH-E icons.
6472
6473 @vindex mh-tool-bar-folder-buttons
6474 @vindex mh-tool-bar-letter-buttons
6475
6476 In either case, you can select which of these functions you'd like to
6477 see by customizing the options @code{mh-tool-bar-folder-buttons} and
6478 @code{mh-tool-bar-letter-buttons}. As you probably guessed, the former
6479 customizes the tool bar in MH-Folder mode and the latter in MH-Letter
6480 mode. Both of these options present you with a list of functions;
6481 check the functions whose icons you want to see and clear the check
6482 boxes for those you don't.
6483
6484 @findex mh-search
6485 @vindex mh-tool-bar-search-function
6486
6487 The function associated with the searching icon can be set via the
6488 option @code{mh-tool-bar-search-function}. By default, this is set to
6489 @code{mh-search}. @xref{Searching}. You can also choose @samp{Other
6490 Function} from the @samp{Value Menu} and enter a function of your own
6491 choosing.
6492
6493 @vindex mh-xemacs-use-tool-bar-flag
6494
6495 XEmacs provides a couple of extra options. The first,
6496 @code{mh-xemacs-use-tool-bar-flag}, controls whether to show the MH-E
6497 icons at all. By default, this option is turned on if the window
6498 system supports tool bars. If your system doesn't support tool bars,
6499 then you won't be able to turn on this option.
6500
6501 @vindex mh-xemacs-tool-bar-position
6502
6503 The second extra option is @code{mh-xemacs-tool-bar-position} which
6504 controls the placement of the tool bar along the four edges of the
6505 frame. You can choose from one of @samp{Same As Default Tool Bar},
6506 @samp{Top}, @samp{Bottom}, @samp{Left}, or @samp{Right}. If this
6507 variable is set to anything other than @samp{Same As Default Tool Bar}
6508 and the default tool bar is in a different location, then two tool
6509 bars will be displayed: the MH-E tool bar and the default tool bar.
6510
6511 @node Searching, Threading, Tool Bar, Top
6512 @chapter Searching Through Messages
6513
6514 @cindex @samp{Search} menu
6515 @cindex menu, @samp{Search}
6516 @cindex searching
6517 @findex mh-search
6518 @kindex F s
6519
6520 Earlier, the command @kbd{F s} (@code{mh-search}) was introduced which
6521 helps you find messages that lie buried in your folders
6522 (@pxref{Folders}). This chapter covers this command in more detail.
6523 Several commands are used to compose the search criteria and to start
6524 searching. A couple of them can be found in the @samp{Search} menu.
6525
6526 @table @kbd
6527 @kindex C-c ?
6528 @findex mh-help
6529 @item C-c ?
6530 Display cheat sheet for the MH-E commands (@code{mh-help}).
6531 @c -------------------------
6532 @cindex @samp{Search > Perform Search} menu item
6533 @cindex menu item, @samp{Search > Perform Search}
6534 @kindex C-c C-c
6535 @findex mh-index-do-search
6536 @item C-c C-c
6537 Find messages using @code{mh-search-program}
6538 (@code{mh-index-do-search}).
6539 @c -------------------------
6540 @cindex @samp{Search > Search with pick} menu item
6541 @cindex menu item, @samp{Search > Search with pick}
6542 @kindex C-c C-p
6543 @findex mh-pick-do-search
6544 @item C-c C-p
6545 Find messages using @command{pick} (@code{mh-pick-do-search}).
6546 @c -------------------------
6547 @kindex C-c ?
6548 @findex mh-help
6549 @item C-c ?
6550 Display cheat sheet for the MH-E commands (@code{mh-help}).
6551 @c -------------------------
6552 @kindex C-c C-f C-a
6553 @kindex C-c C-f a
6554 @findex mh-to-field
6555 @item C-c C-f a
6556 @itemx C-c C-f C-a
6557 Move to @samp{Mail-Reply-To:} header field (@code{mh-to-field}).
6558 @c -------------------------
6559 @kindex C-c C-f C-b
6560 @kindex C-c C-f b
6561 @item C-c C-f b
6562 @itemx C-c C-f C-b
6563 Move to @samp{Bcc:} header field (@code{mh-to-field}).
6564 @c -------------------------
6565 @kindex C-c C-f C-c
6566 @kindex C-c C-f c
6567 @item C-c C-f c
6568 @itemx C-c C-f C-c
6569 Move to @samp{Cc:} header field (@code{mh-to-field}).
6570 @c -------------------------
6571 @kindex C-c C-f C-d
6572 @kindex C-c C-f d
6573 @item C-c C-f d
6574 @itemx C-c C-f C-d
6575 Move to @samp{Dcc:} header field (@code{mh-to-field}).
6576 @c -------------------------
6577 @kindex C-c C-f C-f
6578 @kindex C-c C-f f
6579 @item C-c C-f f
6580 @itemx C-c C-f C-f
6581 Move to @samp{Fcc:} header field (@code{mh-to-field}).
6582 @c -------------------------
6583 @kindex C-c C-f C-l
6584 @kindex C-c C-f l
6585 @item C-c C-f l
6586 @itemx C-c C-f C-l
6587 Move to @samp{Mail-Followup-To:} header field (@code{mh-to-field}).
6588 @c -------------------------
6589 @kindex C-c C-f C-m
6590 @kindex C-c C-f m
6591 @item C-c C-f m
6592 @itemx C-c C-f C-m
6593 Move to @samp{From:} header field (@code{mh-to-field}).
6594 @c -------------------------
6595 @kindex C-c C-f C-r
6596 @kindex C-c C-f r
6597 @item C-c C-f r
6598 @itemx C-c C-f C-r
6599 Move to @samp{Reply-To:} header field (@code{mh-to-field}).
6600 @c -------------------------
6601 @kindex C-c C-f C-s
6602 @kindex C-c C-f s
6603 @item C-c C-f s
6604 @itemx C-c C-f C-s
6605 Move to @samp{Subject:} header field (@code{mh-to-field}).
6606 @c -------------------------
6607 @kindex C-c C-f C-t
6608 @kindex C-c C-f t
6609 @item C-c C-f t
6610 @itemx C-c C-f C-t
6611 Move to @samp{To:} header field (@code{mh-to-field}).
6612 @end table
6613
6614 Another few commands are available in the MH-Folder buffer resulting
6615 from a search.
6616
6617 @table @kbd
6618 @kindex @key{TAB}
6619 @findex mh-index-next-folder
6620 @item @key{TAB}
6621 Jump to the next folder marker (@code{mh-index-next-folder}).
6622 @c -------------------------
6623 @kindex S-@key{TAB}
6624 @findex mh-index-previous-folder
6625 @item S-@key{TAB}
6626 Jump to the previous folder marker (@code{mh-index-previous-folder}).
6627 @c -------------------------
6628 @kindex v
6629 @findex mh-index-visit-folder
6630 @item v
6631 Visit original folder from where the message at point was found
6632 (@code{mh-index-visit-folder}).
6633 @end table
6634
6635 @cindex @samp{mh-search} customization group
6636 @cindex customization group, @samp{mh-search}
6637
6638 There is one option from the @samp{mh-search} customization group used
6639 in searching.
6640
6641 @vtable @code
6642 @item mh-search-program
6643 Search program that MH-E shall use (default: @samp{Auto-detect}).
6644 @end vtable
6645
6646 The following hook is available.
6647
6648 @vtable @code
6649 @item mh-search-mode-hook
6650 Hook run upon entry to @code{mh-search-mode} (default: @code{nil}).
6651 @end vtable
6652
6653 The following face is available.
6654
6655 @vtable @code
6656 @item mh-search-folder
6657 Folder heading face in MH-Folder buffers created by searches.
6658 @end vtable
6659
6660 @findex mh-search-folder
6661 @kindex F s
6662
6663 The command @kbd{F s} (@code{mh-search-folder}) helps you find
6664 messages in your entire corpus of mail. You can search for messages to
6665 or from a particular person or about a particular subject. In fact,
6666 you can also search for messages containing selected strings in any
6667 arbitrary header field or any string found within the messages.
6668
6669 @cindex @command{pick}
6670 @cindex MH commands, @command{pick}
6671
6672 Out of the box, MH-E uses @command{pick} to find messages. With a
6673 little extra effort, you can set an indexing program which rewards you
6674 with extremely quick results. The drawback is that sometimes the index
6675 does not contain the words you're looking for. You can still use
6676 @command{pick} in these situations.
6677
6678 You are prompted for the folder to search. This can be @samp{all} to
6679 search all folders. Note that the search works recursively on the
6680 listed folder.
6681
6682 @cindex MH-Search mode
6683 @cindex modes, MH-Search
6684
6685 Next, an MH-Search buffer appears where you can enter search criteria.
6686
6687 @cartouche
6688 @smallexample
6689 From:
6690 To:
6691 Cc:
6692 Date:
6693 Subject:
6694 --------
6695 #
6696
6697
6698
6699
6700
6701
6702
6703
6704 --:** search-pattern All L7 (MH-Search)---------------------------
6705 Type C-c C-c to search messages, C-c C-p to use pick, C-c ? for help
6706 @end smallexample
6707 @end cartouche
6708 @i{Search window}
6709
6710 @cindex @command{pick}
6711 @cindex MH commands, @command{pick}
6712
6713 Edit this template by entering your search criteria in an appropriate
6714 header field that is already there, or create a new field yourself. If
6715 the string you're looking for could be anywhere in a message, then
6716 place the string underneath the row of dashes.
6717
6718 As an example, let's say that we want to find messages from Ginnean
6719 about horseback riding in the Kosciusko National Park (Australia)
6720 during January, 1994. Normally we would start with a broad search and
6721 narrow it down if necessary to produce a manageable amount of data,
6722 but we'll cut to the chase and create a fairly restrictive set of
6723 criteria as follows:
6724
6725 @smallexample
6726 @group
6727 From: ginnean
6728 To:
6729 Cc:
6730 Date: Jan 1994
6731 Subject:
6732 --------
6733 horse
6734 kosciusko
6735 @end group
6736 @end smallexample
6737
6738 @findex mh-to-field
6739 @kindex C-c C-f C-t
6740
6741 As with MH-Letter mode, MH-Search provides commands like @kbd{C-c C-f
6742 C-t} (@code{mh-to-field}) to help you fill in the blanks.
6743 @xref{Editing Message}.
6744
6745 @kindex F s
6746 @vindex mh-search-mode-hook
6747
6748 If you find that you do the same thing over and over when editing the
6749 search template, you may wish to bind some shortcuts to keys. This can
6750 be done with the variable @code{mh-search-mode-hook}, which is called
6751 when @kbd{F s} is run on a new pattern.
6752
6753 @findex mh-index-do-search
6754 @findex mh-pick-do-search
6755 @kindex C-c C-c
6756 @kindex C-c C-p
6757
6758 To perform the search, type @kbd{C-c C-c} (@code{mh-index-do-search}).
6759 Sometimes you're searching for text that is either not indexed, or
6760 hasn't been indexed yet. In this case you can override the default
6761 method with the pick method by running the command @kbd{C-c C-p}
6762 (@code{mh-pick-do-search}).
6763
6764 @cindex folders, @samp{+mhe-index}
6765 @cindex @samp{+mhe-index}
6766 @findex mh-index-next-folder
6767 @findex mh-index-previous-folder
6768 @kindex @key{TAB}
6769 @kindex S-@key{TAB}
6770 @vindex mh-search-folder
6771
6772 The messages that are found are put in a temporary sub-folder of
6773 @samp{+mhe-index} and are displayed in an MH-Folder buffer. This
6774 buffer is special because it displays messages from multiple folders;
6775 each set of messages from a given folder has a heading with the folder
6776 name. The appearance of the heading can be modified by customizing the
6777 face @code{mh-search-folder}. You can jump back and forth between the
6778 headings using the commands @kbd{@key{TAB}}
6779 (@code{mh-index-next-folder}) and @kbd{S-@key{TAB}}
6780 (@code{mh-index-previous-folder}).
6781
6782 @findex mh-index-visit-folder
6783 @findex mh-rescan-folder
6784 @kindex F r
6785 @kindex v
6786
6787 In addition, the command @kbd{v} (@code{mh-index-visit-folder}) can be
6788 used to visit the folder of the message at point. Initially, only the
6789 messages that matched the search criteria are displayed in the folder.
6790 While the temporary buffer has its own set of message numbers, the
6791 actual messages numbers are shown in the visited folder. Thus, the
6792 command @kbd{v} is useful to find the actual message number of an
6793 interesting message, or to view surrounding messages with the command
6794 @kbd{F r} @code{mh-rescan-folder}. @xref{Folders}.
6795
6796 @findex mh-kill-folder
6797 @kindex F k
6798
6799 Because this folder is temporary, you'll probably get in the habit of
6800 killing it when you're done with @kbd{F k} (@code{mh-kill-folder}).
6801 @xref{Folders}.
6802
6803 @kindex F s
6804
6805 You can regenerate the results by running @kbd{F s} with a prefix
6806 argument.
6807
6808 @cindex @command{procmail}
6809 @cindex Unix commands, @command{procmail}
6810 @cindex @samp{X-MHE-Checksum:} header field
6811 @cindex header field, @samp{X-MHE-Checksum:}
6812
6813 Note: This command uses an @samp{X-MHE-Checksum:} header field to
6814 cache the MD5 checksum of a message. This means that if an incoming
6815 message already contains an @samp{X-MHE-Checksum:} field, that message
6816 might not be found by this command. The following @command{procmail}
6817 recipe avoids this problem by renaming the existing header field:
6818
6819 @smallexample
6820 @group
6821 :0 wf
6822 | formail -R "X-MHE-Checksum" "X-Old-MHE-Checksum"
6823 @end group
6824 @end smallexample
6825
6826 @xref{Limits}, for an alternative interface to searching.
6827
6828 @section Configuring Indexed Searches
6829
6830 @cindex @command{grep}
6831 @cindex @command{mairix}
6832 @cindex @command{namazu}
6833 @cindex @command{pick}
6834 @cindex @command{swish++}
6835 @cindex @command{swish-e}
6836 @cindex Unix commands, @command{grep}
6837 @cindex Unix commands, @command{mairix}
6838 @cindex Unix commands, @command{namazu}
6839 @cindex Unix commands, @command{pick}
6840 @cindex Unix commands, @command{swish++}
6841 @cindex Unix commands, @command{swish-e}
6842 @findex mh-search
6843 @kindex F s
6844 @vindex mh-search-program
6845
6846 The command @kbd{F s} (@code{mh-search}) runs the command defined by
6847 the option @code{mh-search-program}. The default value is
6848 @samp{Auto-detect} which means that MH-E will automatically choose one
6849 of @command{swish++}, @command{swish-e}, @command{mairix},
6850 @command{namazu}, @command{pick} and @command{grep} in that order. If,
6851 for example, you have both @command{swish++} and @command{mairix}
6852 installed and you want to use @command{mairix}, then you can set this
6853 option to @samp{mairix}.
6854
6855 The following sub-sections describe how to set up the various indexing
6856 programs to use with MH-E.
6857
6858 @subsection swish++
6859
6860 @cindex @command{swish++}
6861 @cindex Unix commands, @command{swish++}
6862
6863 In the examples below, replace @file{/home/user/Mail} with the path to
6864 your MH directory.
6865
6866 First create the directory @file{/home/user/Mail/.swish++}. Then
6867 create the file @file{/home/user/Mail/.swish++/swish++.conf} with the
6868 following contents:
6869
6870 @smallexample
6871 @group
6872 IncludeMeta Bcc Cc Comments Content-Description From Keywords
6873 IncludeMeta Newsgroups Resent-To Subject To
6874 IncludeMeta Message-Id References In-Reply-To
6875 IncludeFile Mail *
6876 IndexFile /home/user/Mail/.swish++/swish++.index
6877 @end group
6878 @end smallexample
6879
6880 Use the following command line to generate the swish index. Run this
6881 daily from cron:
6882
6883 @smallexample
6884 @group
6885 find /home/user/Mail -path /home/user/Mail/mhe-index -prune \
6886 -o -path /home/user/Mail/.swish++ -prune \
6887 -o -name "[0-9]*" -print \
6888 | index -c /home/user/Mail/.swish++/swish++.conf -
6889 @end group
6890 @end smallexample
6891
6892 This command does not index the folders that hold the results of your
6893 searches in @samp{+mhe-index} since they tend to be ephemeral and the
6894 original messages are indexed anyway.
6895
6896 @cindex @command{index}
6897 @cindex Unix commands, @command{index}
6898 @cindex @command{index++}
6899 @cindex Unix commands, @command{index++}
6900
6901 On some systems (Debian GNU/Linux, for example), use @command{index++}
6902 instead of @command{index}.
6903
6904 @subsection swish
6905
6906 @cindex @command{swish-e}
6907 @cindex Unix commands, @command{swish-e}
6908
6909 In the examples below, replace @file{/home/user/Mail} with the path to
6910 your MH directory.
6911
6912 First create the directory @file{/home/user/Mail/.swish}. Then create
6913 the file @file{/home/user/Mail/.swish/config} with the following
6914 contents:
6915
6916 @smallexample
6917 @group
6918 DefaultContents TXT*
6919 IndexDir /home/user/Mail
6920 IndexFile /home/user/Mail/.swish/index
6921 IndexName "Mail Index"
6922 IndexDescription "Mail Index"
6923 IndexPointer "http://nowhere"
6924 IndexAdmin "nobody"
6925 #MetaNames automatic
6926 IndexReport 3
6927 FollowSymLinks no
6928 UseStemming no
6929 IgnoreTotalWordCountWhenRanking yes
6930 WordCharacters abcdefghijklmnopqrstuvwxyz0123456789-
6931 BeginCharacters abcdefghijklmnopqrstuvwxyz
6932 EndCharacters abcdefghijklmnopqrstuvwxyz0123456789
6933 IgnoreLimit 50 1000
6934 IndexComments 0
6935 FileRules filename contains \D
6936 FileRules pathname contains /home/user/Mail/.swish
6937 FileRules pathname contains /home/user/Mail/mhe-index
6938 FileRules filename is index
6939 @end group
6940 @end smallexample
6941
6942 This configuration does not index the folders that hold the results of
6943 your searches in @samp{+mhe-index} since they tend to be ephemeral and
6944 the original messages are indexed anyway.
6945
6946 If there are any directories you would like to ignore, append lines
6947 like the following to @file{config}:
6948
6949 @smallexample
6950 FileRules pathname contains /home/user/Mail/scripts
6951 @end smallexample
6952
6953 @cindex @command{swish-e}
6954 @cindex Unix commands, @command{swish-e}
6955
6956 Use the following command line to generate the swish index. Run this
6957 daily from cron:
6958
6959 @smallexample
6960 swish-e -c /home/user/Mail/.swish/config
6961 @end smallexample
6962
6963 @subsection mairix
6964
6965 @cindex @command{mairix}
6966 @cindex Unix commands, @command{mairix}
6967
6968 In the examples below, replace @file{~/Mail} with the path to your MH
6969 directory.
6970
6971 First create the directory @file{~/Mail/.mairix}. Then create the file
6972 @file{~/Mail/.mairix/config} with the following contents:
6973
6974 @smallexample
6975 @group
6976 base=~/Mail
6977
6978 # List of folders that should be indexed. 3 dots at the end means there
6979 # are subfolders within the folder
6980 mh=archive...:inbox:drafts:news:sent:trash
6981
6982 mformat=mh
6983 database=~/Mail/.mairix/database
6984 @end group
6985 @end smallexample
6986
6987 Use the following command line to generate the mairix index. Run this daily
6988 from cron:
6989
6990 @smallexample
6991 mairix -f ~/Mail/.mairix/config
6992 @end smallexample
6993
6994 @subsection namazu
6995
6996 @cindex @command{namazu}
6997 @cindex Unix commands, @command{namazu}
6998
6999 In the examples below, replace @file{/home/user/Mail} with the path to
7000 your MH directory.
7001
7002 First create the directory @file{/home/user/Mail/.namazu}. Then create
7003 the file @file{/home/user/Mail/.namazu/mknmzrc} with the following
7004 contents:
7005
7006 @smallexample
7007 @group
7008 package conf; # Don't remove this line!
7009 $ADDRESS = 'user@@localhost';
7010 $ALLOW_FILE = "[0-9]*";
7011 $EXCLUDE_PATH = "^/home/user/Mail/(mhe-index|spam)";
7012 @end group
7013 @end smallexample
7014
7015 This configuration does not index the folders that hold the results of
7016 your searches in @samp{+mhe-index} since they tend to be ephemeral and
7017 the original messages are indexed anyway.
7018
7019 Use the following command line to generate the namazu index. Run this
7020 daily from cron:
7021
7022 @smallexample
7023 mknmz -f /home/user/Mail/.namazu/mknmzrc -O /home/user/Mail/.namazu \
7024 -q /home/user/Mail
7025 @end smallexample
7026
7027 @subsection pick
7028
7029 @cindex @command{pick}
7030 @cindex MH commands, @command{pick}
7031
7032 This search method does not require any setup.
7033
7034 Read @command{pick}(1) or the section
7035 @uref{@value{MH-BOOK-HOME}/finpic.html, Finding Messages with pick} in
7036 the MH book to find out more about how to enter the criteria.
7037
7038 @subsection grep
7039
7040 @cindex @command{grep}
7041 @cindex Unix commands, @command{grep}
7042
7043 This search method does not require any setup.
7044
7045 Unlike the other search methods, this method does not use the
7046 MH-Search buffer. Instead, you simply enter a regular expression in
7047 the minibuffer. For help in constructing regular expressions, see your
7048 man page for @command{grep}.
7049
7050 @node Threading, Limits, Searching, Top
7051 @chapter Viewing Message Threads
7052
7053 @cindex threading
7054
7055 MH-E groups messages by @dfn{threads} which are messages that are part
7056 of the same discussion and usually all have the same @samp{Subject:}
7057 header field. Other ways to organize messages in a folder include
7058 limiting (@pxref{Limits}) or using full-text indexed searches
7059 (@pxref{Searching}).
7060
7061 @cindex root, in threads
7062 @cindex siblings, in threads
7063 @cindex ancestor, in threads
7064
7065 A thread begins with a single message called a @dfn{root}. All replies
7066 to the same message are @dfn{siblings} of each other. Any message that
7067 has replies to it is an @dfn{ancestor} of those replies.
7068
7069 There are several commands that you can use to navigate and operate on
7070 threads.
7071
7072 @table @kbd
7073 @kindex T ?
7074 @findex mh-prefix-help
7075 @item T ?
7076 Display cheat sheet for the commands of the current prefix in
7077 minibuffer (@code{mh-prefix-help}).
7078 @c -------------------------
7079 @kindex T o
7080 @findex mh-thread-refile
7081 @item T o
7082 Refile (output) thread into folder (@code{mh-thread-refile}).
7083 @c -------------------------
7084 @kindex T d
7085 @findex mh-thread-delete
7086 @item T d
7087 Delete thread (@code{mh-thread-delete}).
7088 @c -------------------------
7089 @kindex T t
7090 @findex mh-toggle-threads
7091 @item T t
7092 Toggle threaded view of folder (@code{mh-toggle-threads}).
7093 @c -------------------------
7094 @kindex T n
7095 @findex mh-thread-next-sibling
7096 @item T n
7097 Display next sibling (@code{mh-thread-next-sibling}).
7098 @c -------------------------
7099 @kindex T p
7100 @findex mh-thread-previous-sibling
7101 @item T p
7102 Display previous sibling (@code{mh-thread-previous-sibling}).
7103 @c -------------------------
7104 @kindex T u
7105 @findex mh-thread-ancestor
7106 @item T u
7107 Display ancestor of current message (@code{mh-thread-ancestor}).
7108 @end table
7109
7110 @cindex @samp{mh-thread} customization group
7111 @cindex customization group, @samp{mh-thread}
7112
7113 The @samp{mh-thread} customization group contains one option.
7114
7115 @vtable @code
7116 @item mh-show-threads-flag
7117 On means new folders start in threaded mode (default: @samp{off}).
7118 @end vtable
7119
7120 @findex mh-toggle-threads
7121 @kindex T t
7122 @vindex mh-large-folder
7123 @vindex mh-show-threads-flag
7124
7125 Threading large number of messages can be time consuming so the option
7126 @code{mh-show-threads-flag} is turned off by default. If you turn on
7127 this option, then threading will be done only if the number of
7128 messages being threaded is less than @code{mh-large-folder}. In any
7129 event, threading can be turned on (and off) with the command @kbd{T t}
7130 (@code{mh-toggle-threads}).
7131
7132 @findex mh-thread-ancestor
7133 @findex mh-thread-next-sibling
7134 @findex mh-thread-previous-sibling
7135 @kindex T n
7136 @kindex T p
7137 @kindex T u
7138
7139 There are a few commands to help you navigate threads. If you do not
7140 care for the way a particular thread has turned, you can move up the
7141 chain of messages with the command @kbd{T u}
7142 (@code{mh-thread-ancestor}. At any point you can use @kbd{T n}
7143 (@code{mh-thread-next-sibling} or @kbd{T p}
7144 (@code{mh-thread-previous-sibling}) to jump to the next or previous
7145 sibling, skipping the sub-threads. The command @kbd{T u} can also take
7146 a prefix argument to jump to the message that started everything.
7147
7148 @findex mh-delete-subject-or-thread
7149 @findex mh-thread-delete
7150 @findex mh-thread-refile
7151 @kindex k
7152 @kindex T d
7153 @kindex T o
7154
7155 There are threaded equivalents for the commands that delete and refile
7156 messages. For example, @kbd{T o} (@code{mh-thread-refile}) refiles the
7157 current message and all its children. Similarly, the command @kbd{T d}
7158 (@code{mh-thread-delete}) deletes the current message and all its
7159 children. These commands do not refile or delete sibling messages.
7160 @xref{Navigating}, for a description of the similar command @kbd{k}
7161 (@code{mh-delete-subject-or-thread}).
7162
7163 @vindex mh-large-folder
7164
7165 If you find that threading is too slow, it may be that you have
7166 @code{mh-large-folder} set too high. Also, threading is one of the few
7167 features of MH-E that really benefits from compiling. If you haven't
7168 compiled MH-E, I encourage you to do so@footnote{If you're not sure if
7169 MH-E has been byte-compiled, you could try running @samp{locate
7170 mh-thread.elc} or otherwise find MH-E on your system and ensure that
7171 @file{mh-thread.elc} exists. If you have multiple versions and you
7172 find that one is compiled but the other is not, then go into your
7173 @samp{*scratch*} buffer in Emacs, enter @kbd{load-path C-j}, and
7174 ensure that the byte-compiled version appears first in the
7175 @code{load-path}. If you find that MH-E is not compiled and you
7176 installed MH-E yourself, please refer to the installation directions
7177 in the file @file{README} in the distribution.}.
7178
7179 @node Limits, Sequences, Threading, Top
7180 @chapter Limiting Display
7181
7182 @cindex limits
7183 @cindex filters
7184
7185 Another way to organize messages in a folder besides threading
7186 (@pxref{Threading}) or using full-text indexed searches
7187 (@pxref{Searching}) is by limiting the folder display to messages that
7188 are similar to the current message.
7189
7190 @table @kbd
7191 @kindex / ?
7192 @findex mh-prefix-help
7193 @item / ?
7194 Display cheat sheet for the commands of the current prefix in
7195 minibuffer (@code{mh-prefix-help}).
7196 @c -------------------------
7197 @cindex @samp{Sequence > Narrow to Tick Sequence} menu item
7198 @cindex menu item, @samp{Sequence > Narrow to Tick Sequence}
7199 @kindex / '
7200 @findex mh-narrow-to-tick
7201 @item / '
7202 Limit to messages in the @samp{tick} sequence
7203 (@code{mh-narrow-to-tick}).
7204 @c -------------------------
7205 @kindex / c
7206 @findex mh-narrow-to-cc
7207 @item / c
7208 Limit to messages with the same @samp{Cc:} field
7209 (@code{mh-narrow-to-cc}).
7210 @c -------------------------
7211 @kindex / m
7212 @findex mh-narrow-to-from
7213 @item / m
7214 Limit to messages with the same @samp{From:} field
7215 (@code{mh-narrow-to-from}).
7216 @c -------------------------
7217 @kindex / g
7218 @findex mh-narrow-to-range
7219 @item / g
7220 Limit to range (@code{mh-narrow-to-range}).
7221 @c -------------------------
7222 @cindex @samp{Sequence > Narrow to Subject Sequence} menu item
7223 @cindex menu item, @samp{Sequence > Narrow to Subject Sequence}
7224 @kindex / s
7225 @findex mh-narrow-to-subject
7226 @item / s
7227 Limit to messages with the same @samp{Subject:} field
7228 (@code{mh-narrow-to-subject}).
7229 @c -------------------------
7230 @kindex / t
7231 @findex mh-narrow-to-to
7232 @item / t
7233 Limit to messages with the same @samp{To:} field
7234 (@code{mh-narrow-to-to}).
7235 @c -------------------------
7236 @cindex @samp{Sequence > Widen from Sequence} menu item
7237 @cindex menu item, @samp{Sequence > Widen from Sequence}
7238 @kindex / w
7239 @findex mh-widen
7240 @item / w
7241 Remove last restriction (@code{mh-widen}).
7242 @end table
7243
7244 All of the limiting commands above refine the display in some way.
7245
7246 @cindex @command{pick}
7247 @cindex MH commands, @command{pick}
7248 @findex mh-narrow-to-cc
7249 @findex mh-narrow-to-from
7250 @findex mh-narrow-to-subject
7251 @findex mh-narrow-to-to
7252 @kindex / c
7253 @kindex / m
7254 @kindex / s
7255 @kindex / t
7256
7257 The commands @kbd{/ c} (@code{mh-narrow-to-cc}), @kbd{/ m}
7258 (@code{mh-narrow-to-from}), @kbd{/ s} (@code{mh-narrow-to-subject}),
7259 and @kbd{/ t} (@code{mh-narrow-to-to}) restrict the display to
7260 messages matching the content of the respective field in the current
7261 message. However, you can give any of these a prefix argument to edit
7262 the @command{pick} expression used to narrow the view@footnote{See
7263 @command{pick}(1) or the section
7264 @uref{@value{MH-BOOK-HOME}/finpic.html, Finding Messages with pick} in
7265 the MH book.}.
7266
7267 @cindex @samp{tick} sequence
7268 @cindex sequence, @samp{tick}
7269 @cindex ticked messages, viewing
7270 @findex mh-narrow-to-range
7271 @findex mh-narrow-to-tick
7272 @kindex / '
7273 @kindex / g
7274
7275 You can also limit the display to messages in the @samp{tick} sequence
7276 with the command @kbd{/ '} (@code{mh-narrow-to-tick}).
7277 @xref{Sequences}, for information on putting message into the
7278 @samp{tick} sequence. Use the @kbd{/ g} (@code{mh-narrow-to-range})
7279 command to limit the display to messages in a range (@pxref{Ranges}).
7280
7281 @findex mh-widen
7282 @kindex / w
7283
7284 Each limit can be undone in turn with the @kbd{/ w} (@code{mh-widen})
7285 command. Give this command a prefix argument to remove all limits.
7286
7287 @node Sequences, Junk, Limits, Top
7288 @chapter Using Sequences
7289
7290 @cindex @samp{Sequence} menu
7291 @cindex menu, @samp{Sequence}
7292 @cindex sequences
7293
7294 For the whole scoop on MH sequences, refer to
7295 @samp{mh-sequence}(5)@footnote{See the section
7296 @uref{@value{MH-BOOK-HOME}/morseq.html, More About Sequences} in the MH
7297 book.}. As you've read, several of the MH-E commands can operate on a
7298 sequence, which is a shorthand for a range or group of messages. For
7299 example, you might want to forward several messages to a friend or
7300 colleague. Here's how to manipulate sequences. These commands are also
7301 available in the @samp{Sequence} menu.
7302
7303 @table @kbd
7304 @cindex @samp{Sequence > Toggle Tick Mark} menu item
7305 @cindex menu item, @samp{Sequence > Toggle Tick Mark}
7306 @kindex '
7307 @findex mh-toggle-tick
7308 @item '
7309 Toggle tick mark of range (@code{mh-toggle-tick}).
7310 @c -------------------------
7311 @kindex S ?
7312 @findex mh-prefix-help
7313 @item S ?
7314 Display cheat sheet for the commands of the current prefix in
7315 minibuffer (@code{mh-prefix-help}).
7316 @c -------------------------
7317 @cindex @samp{Sequence > Narrow to Tick Sequence} menu item
7318 @cindex menu item, @samp{Sequence > Narrow to Tick Sequence}
7319 @kindex S '
7320 @findex mh-narrow-to-tick
7321 @item S '
7322 Limit to ticked messages (@code{mh-narrow-to-tick}).
7323 @c -------------------------
7324 @cindex @samp{Sequence > Delete Message from Sequence...} menu item
7325 @cindex menu item, @samp{Sequence > Delete Message from Sequence...}
7326 @kindex S d
7327 @findex mh-delete-msg-from-seq
7328 @item S d
7329 Delete range from sequence (@code{mh-delete-msg-from-seq}).
7330 @c -------------------------
7331 @cindex @samp{Sequence > Delete Sequence...} menu item
7332 @cindex menu item, @samp{Sequence > Delete Sequence...}
7333 @kindex S k
7334 @findex mh-delete-seq
7335 @item S k
7336 Delete sequence (@code{mh-delete-seq}).
7337 @c -------------------------
7338 @cindex @samp{Sequence > List Sequences in Folder...} menu item
7339 @cindex menu item, @samp{Sequence > List Sequences in Folder...}
7340 @kindex S l
7341 @findex mh-list-sequences
7342 @item S l
7343 List all sequences in folder (@code{mh-list-sequences}).
7344 @c -------------------------
7345 @cindex @samp{Sequence > Narrow to Sequence...} menu item
7346 @cindex menu item, @samp{Sequence > Narrow to Sequence...}
7347 @kindex S n
7348 @findex mh-narrow-to-seq
7349 @item S n
7350 Restrict display to messages in sequence (@code{mh-narrow-to-seq}).
7351 @c -------------------------
7352 @cindex @samp{Sequence > Add Message to Sequence...} menu item
7353 @cindex menu item, @samp{Sequence > Add Message to Sequence...}
7354 @kindex S p
7355 @findex mh-put-msg-in-seq
7356 @item S p
7357 Add range to sequence (@code{mh-put-msg-in-seq}).
7358 @c -------------------------
7359 @cindex @samp{Sequence > List Sequences for Message} menu item
7360 @cindex menu item, @samp{Sequence > List Sequences for Message}
7361 @kindex S s
7362 @findex mh-msg-is-in-seq
7363 @item S s
7364 Display the sequences in which the current message appears
7365 (@code{mh-msg-is-in-seq}).
7366 @c -------------------------
7367 @cindex @samp{Sequence > Widen from Sequence} menu item
7368 @cindex menu item, @samp{Sequence > Widen from Sequence}
7369 @kindex S w
7370 @findex mh-widen
7371 @item S w
7372 Remove last restriction (@code{mh-widen}).
7373 @c -------------------------
7374 @findex mh-update-sequences
7375 @item M-x mh-update-sequences
7376 Flush MH-E's state out to MH@.
7377 @end table
7378
7379 @cindex @samp{mh-sequences} customization group
7380 @cindex customization group, @samp{mh-sequences}
7381
7382 The @samp{mh-sequences} customization group contains the options
7383 associated with sequences.
7384
7385 @vtable @code
7386 @item mh-refile-preserves-sequences-flag
7387 On means that sequences are preserved when messages are refiled
7388 (default: @samp{on}).
7389 @c -------------------------
7390 @item mh-tick-seq
7391 The name of the MH sequence for ticked messages (default: @samp{'tick}).
7392 @c -------------------------
7393 @item mh-update-sequences-after-mh-show-flag
7394 On means flush MH sequences to disk after message is shown (default:
7395 @samp{on}).
7396 @item mh-whitelist-preserves-sequences-flag
7397 On means that sequences are preserved when messages are whitelisted
7398 (default: @samp{on}).
7399 @end vtable
7400
7401 The following hook is available.
7402
7403 @vtable @code
7404 @item mh-unseen-updated-hook
7405 Hook run after the unseen sequence has been updated (default: @code{nil}).
7406 @end vtable
7407
7408 @cindex @command{pick}
7409 @cindex MH commands, @command{pick}
7410 @findex mh-put-msg-in-seq
7411 @kindex S p
7412
7413 To place a message in a sequence, use @kbd{S p}
7414 (@code{mh-put-msg-in-seq}). Give @kbd{S p} a range and you can add all
7415 the messages in a sequence to another sequence (for example, @kbd{C-u
7416 S p SourceSequence @key{RET} DestSequence @key{RET}}, @pxref{Ranges}).
7417
7418 @cindex @samp{tick} sequence
7419 @cindex sequence, @samp{tick}
7420 @cindex ticking messages
7421 @findex mh-index-ticked-messages
7422 @findex mh-toggle-tick
7423 @kindex '
7424 @kindex F '
7425 @kindex S p
7426
7427 One specific use of the @kbd{S p} command is @kbd{'}
7428 (@code{mh-toggle-tick}) which adds messages to the @samp{tick}
7429 sequence. This sequence can be viewed later with the @kbd{F '}
7430 (@code{mh-index-ticked-messages}) command (@pxref{Folders}).
7431
7432 @vindex mh-tick-seq
7433
7434 You can customize the option @code{mh-tick-seq} if you already use the
7435 @samp{tick} sequence for your own use. You can also disable all of the
7436 ticking functions by choosing the @samp{Disable Ticking} item but
7437 there isn't much advantage to that.
7438
7439 @cindex MH-Folder mode
7440 @cindex modes, MH-Folder
7441 @findex mh-narrow-to-seq
7442 @findex mh-narrow-to-tick
7443 @findex mh-widen
7444 @kindex S '
7445 @kindex S n
7446 @kindex S w
7447
7448 Once you've placed some messages in a sequence, you may wish to narrow
7449 the field of view to just those messages in the sequence you've
7450 created. To do this, use @kbd{S n} (@code{mh-narrow-to-seq}). You are
7451 prompted for the name of the sequence. What this does is show only
7452 those messages that are in the selected sequence in the MH-Folder
7453 buffer. In addition, it limits further MH-E searches to just those
7454 messages. To narrow the view to the messages in the @samp{tick}
7455 sequence, use @kbd{S '} (@code{mh-narrow-to-tick}). When you want to
7456 widen the view to all your messages again, use @kbd{S w}
7457 (@code{mh-widen}).
7458
7459 @cindex buffers, @samp{*MH-E Sequences*}
7460 @cindex @samp{*MH-E Sequences*}
7461 @findex mh-list-sequences
7462 @findex mh-msg-is-in-seq
7463 @kindex S l
7464 @kindex S s
7465
7466 You can see which sequences in which a message appears with the
7467 command @kbd{S s} (@code{mh-msg-is-in-seq}). Use a prefix argument to
7468 display the sequences in which another message appears (as in @kbd{C-u
7469 42 S s @key{RET}}). Or, you can list all sequences in a selected
7470 folder (default is current folder) with @kbd{S l}
7471 (@code{mh-list-sequences}). The list appears in a buffer named
7472 @samp{*MH-E Sequences*} (@pxref{Miscellaneous}).
7473
7474 @cindex MH profile component, @samp{Previous-Sequence:}
7475 @cindex @samp{cur} sequence
7476 @cindex @samp{Previous-Sequence:} MH profile component
7477 @cindex sequence, @samp{cur}
7478 @cindex sequence, @samp{Previous-Sequence}
7479 @vindex mh-refile-preserves-sequences-flag
7480
7481 If a message is in any sequence (except
7482 @samp{Previous-Sequence:}@footnote{See @samp{mh-profile}(5)).} and
7483 @samp{cur}) when it is refiled, then it will still be in those
7484 sequences in the destination folder. If this behavior is not desired,
7485 then turn off the option @code{mh-refile-preserves-sequences-flag}.
7486
7487 @findex mh-delete-msg-from-seq
7488 @findex mh-delete-seq
7489 @kindex d
7490 @kindex S d
7491 @kindex S k
7492
7493 If you want to remove a message (or range, @pxref{Ranges}) from a
7494 sequence, use @kbd{S d} (@code{mh-delete-msg-from-seq}). If you want
7495 to delete an entire sequence, use @kbd{S k} (@code{mh-delete-seq}). In
7496 the latter case you are prompted for the sequence to delete. Note that
7497 this deletes only the sequence, not the messages in the sequence. If
7498 you want to delete the messages, use @kbd{C-u d} (@pxref{Reading
7499 Mail}).
7500
7501 @cindex @samp{Unseen-Sequence:} MH profile component
7502 @cindex @samp{cur} sequence
7503 @cindex @samp{tick} sequence
7504 @cindex MH profile component, @samp{Unseen-Sequence:}
7505 @cindex sequence, @samp{Unseen-Sequence}
7506 @cindex sequence, @samp{cur}
7507 @cindex sequence, @samp{tick}
7508 @findex mh-update-sequences
7509 @kindex M-x mh-update-sequences
7510 @kindex q
7511 @kindex x
7512 @vindex mh-tick-seq
7513 @vindex mh-update-sequences-after-mh-show-flag
7514
7515 Three sequences are maintained internally by MH-E and pushed out to MH
7516 when a message is shown. They include the sequence specified by your
7517 @samp{Unseen-Sequence:} profile component, @samp{cur}, and the
7518 sequence listed by the option @code{mh-tick-seq} which is @samp{tick}
7519 by default. If you do not like this behavior, turn off the option
7520 @code{mh-update-sequences-after-mh-show-flag}. You can then update the
7521 state manually with the @kbd{x}, @kbd{q}, or @kbd{M-x
7522 mh-update-sequences} commands.
7523
7524 @vindex mh-seen-list
7525 @vindex mh-unseen-updated-hook
7526
7527 The hook @code{mh-unseen-updated-hook} is run after the unseen
7528 sequence has been updated. The variable @code{mh-seen-list} can be
7529 used by this hook to obtain the list of messages which were removed
7530 from the unseen sequence.
7531
7532 @cindex @command{mark}
7533 @cindex MH commands, @command{mark}
7534 @kindex S n
7535 @kindex S w
7536
7537 With the exceptions of @kbd{S n} and @kbd{S w}, the underlying MH
7538 command dealing with sequences is @command{mark}@footnote{See the
7539 section @uref{@value{MH-BOOK-HOME}/mmbwm.html, Make Message Bookmarks
7540 with mark} in the MH book.}.
7541
7542 @node Junk, Miscellaneous, Sequences, Top
7543 @chapter Dealing With Junk Mail
7544
7545 @cindex Marshall Rose
7546 @cindex junk mail
7547 @cindex spam
7548
7549 Marshall Rose once wrote a paper on MH entitled, @cite{How to process
7550 200 messages a day and still get some real work done}. This chapter
7551 could be entitled, @cite{How to process 1000 spams a day and still get
7552 some real work done}.
7553
7554 @cindex blacklisting
7555 @cindex ham
7556 @cindex viruses
7557 @cindex whitelisting
7558 @cindex worms
7559
7560 We use the terms @dfn{junk mail} and @dfn{spam} interchangeably for
7561 any unwanted message which includes spam, @dfn{viruses}, and
7562 @dfn{worms}. The opposite of spam is @dfn{ham}. The act of classifying
7563 a sender as one who sends junk mail is called @dfn{blacklisting}; the
7564 opposite is called @dfn{whitelisting}.
7565
7566 @table @kbd
7567 @kindex J ?
7568 @findex mh-prefix-help
7569 @item J ?
7570 Display cheat sheet for the commands of the current prefix in
7571 minibuffer (@code{mh-prefix-help}).
7572 @c -------------------------
7573 @kindex J b
7574 @findex mh-junk-blacklist
7575 @item J b
7576 Blacklist range as spam (@code{mh-junk-blacklist}).
7577 @c -------------------------
7578 @kindex J w
7579 @findex mh-junk-whitelist
7580 @item J w
7581 Whitelist range as ham (@code{mh-junk-whitelist}).
7582 @c -------------------------
7583 @item @code{mh-spamassassin-identify-spammers}
7584 Identify spammers who are repeat offenders.
7585 @end table
7586
7587 @cindex @samp{mh-junk} customization group
7588 @cindex customization group, @samp{mh-junk}
7589
7590 The following table lists the options from the @samp{mh-junk}
7591 customization group.
7592
7593 @vtable @code
7594 @item mh-junk-background
7595 If on, spam programs are run in background (default: @samp{off}).
7596 @c -------------------------
7597 @item mh-junk-disposition
7598 Disposition of junk mail (default: @samp{Delete Spam}).
7599 @c -------------------------
7600 @item mh-junk-program
7601 Spam program that MH-E should use (default: @samp{Auto-detect}).
7602 @end vtable
7603
7604 @cindex @samp{mh-sequences} customization group
7605 @cindex customization group, @samp{mh-sequences}
7606
7607 The following option in the @samp{mh-sequences} customization group is
7608 also available.
7609
7610 @vtable @code
7611 @item mh-whitelist-preserves-sequences-flag
7612 On means that sequences are preserved when messages are whitelisted
7613 (default: @samp{on}).
7614 @end vtable
7615
7616 The following hooks are available.
7617
7618 @vtable @code
7619 @item mh-blacklist-msg-hook
7620 Hook run by @kbd{J b} (@code{mh-junk-blacklist}) after marking each
7621 message for blacklisting (default: @code{nil}).
7622 @c -------------------------
7623 @item mh-whitelist-msg-hook
7624 Hook run by @kbd{J w} (@code{mh-junk-whitelist}) after marking each
7625 message for whitelisting (default @samp{nil}).
7626 @end vtable
7627
7628 The following faces are available.
7629
7630 @vtable @code
7631 @item mh-folder-blacklisted
7632 Blacklisted message face.
7633 @c -------------------------
7634 @item mh-folder-whitelisted
7635 Whitelisted message face
7636 @end vtable
7637
7638 @cindex SpamProbe
7639 @cindex Spamassassin
7640 @cindex bogofilter
7641 @cindex spam filters, SpamProbe
7642 @cindex spam filters, Spamassassin
7643 @cindex spam filters, bogofilter
7644
7645 MH-E depends on @uref{http://spamassassin.apache.org/, SpamAssassin},
7646 @uref{http://bogofilter.sourceforge.net/, bogofilter}, or
7647 @uref{http://spamprobe.sourceforge.net/, SpamProbe} to throw the dreck
7648 away. This chapter describes briefly how to configure these programs
7649 to work well with MH-E and how to use MH-E's interface that provides
7650 continuing education for these programs.
7651
7652 @vindex mh-junk-program
7653
7654 The default setting of the option @code{mh-junk-program} is
7655 @samp{Auto-detect} which means that MH-E will automatically choose one
7656 of SpamAssassin, bogofilter, or SpamProbe in that order. If, for
7657 example, you have both SpamAssassin and bogofilter installed and you
7658 want to use bogofilter, then you can set this option to
7659 @samp{Bogofilter}.
7660
7661 @findex mh-junk-blacklist
7662 @kindex J b
7663 @vindex mh-junk-disposition
7664
7665 The command @kbd{J b} (@code{mh-junk-blacklist}) trains the spam
7666 program in use with the content of the range (@pxref{Ranges}) and then
7667 handles the message(s) as specified by the option
7668 @code{mh-junk-disposition}. By default, this option is set to
7669 @samp{Delete Spam} but you can also specify the name of the folder
7670 which is useful for building a corpus of spam for training purposes.
7671
7672 @findex mh-junk-whitelist
7673 @kindex J w
7674
7675 In contrast, the command @kbd{J w} (@code{mh-junk-whitelist})
7676 reclassifies a range of messages (@pxref{Ranges}) as ham if it were
7677 incorrectly classified as spam. It then refiles the message into the
7678 @file{+inbox} folder.
7679
7680 @cindex MH profile component, @samp{Previous-Sequence:}
7681 @cindex @samp{cur} sequence
7682 @cindex @samp{Previous-Sequence:} MH profile component
7683 @cindex sequence, @samp{cur}
7684 @cindex sequence, @samp{Previous-Sequence}
7685 @vindex mh-whitelist-preserves-sequences-flag
7686
7687 If a message is in any sequence (except @samp{Previous-Sequence:} and
7688 @samp{cur}) when it is whitelisted, then it will still be in those
7689 sequences in the destination folder. If this behavior is not desired,
7690 then turn off the option @code{mh-whitelist-preserves-sequences-flag}.
7691
7692 @cindex @samp{*MH-E Log*}
7693 @cindex buffers, @samp{*MH-E Log*}
7694 @findex call-process
7695 @vindex mh-junk-background
7696
7697 By default, the programs are run in the foreground, but this can be
7698 slow when junking large numbers of messages. If you have enough memory
7699 or don't junk that many messages at the same time, you might try
7700 turning on the option @code{mh-junk-background}. @footnote{Note that
7701 the option @code{mh-junk-background} is used as the @code{display}
7702 argument in the call to @code{call-process}. Therefore, turning on
7703 this option means setting its value to @samp{0}. You can also set its
7704 value to @samp{t} to direct the programs' output to the @samp{*MH-E
7705 Log*} buffer; this may be useful for debugging.}
7706
7707 The following sections discuss the various counter-spam measures that
7708 MH-E can work with.
7709
7710 @cindex @file{.procmailrc}
7711 @cindex files, @file{.procmailrc}
7712
7713 @subheading SpamAssassin
7714
7715 @cindex Spamassassin
7716 @cindex spam filters, Spamassassin
7717
7718 SpamAssassin is one of the more popular spam filtering programs. Get
7719 it from your local distribution or from the
7720 @uref{http://spamassassin.apache.org/, SpamAssassin web site}.
7721
7722 To use SpamAssassin, add the following recipes to @file{~/.procmailrc}:
7723
7724 @cindex @command{spamc}
7725 @cindex @samp{X-Spam-Level:} header field
7726 @cindex @samp{X-Spam-Status:} header field
7727 @cindex header field, @samp{X-Spam-Level:}
7728 @cindex header field, @samp{X-Spam-Status:}
7729
7730 @smallexample
7731 PATH=$PATH:/usr/bin/mh
7732 MAILDIR=$HOME/`mhparam Path`
7733
7734 # Fight spam with SpamAssassin.
7735 :0fw
7736 | spamc
7737
7738 # Anything with a spam level of 10 or more is junked immediately.
7739 :0:
7740 * ^X-Spam-Level: ..........
7741 /dev/null
7742
7743 :0:
7744 * ^X-Spam-Status: Yes
7745 spam/.
7746 @end smallexample
7747
7748 If you don't use @command{spamc}, use @samp{spamassassin -P -a}.
7749
7750 Note that one of the recipes above throws away messages with a score
7751 greater than or equal to 10. Here's how you can determine a value that
7752 works best for you.
7753
7754 First, run @samp{spamassassin -t} on every mail message in your
7755 archive and use @command{gnumeric} to verify that the average plus the
7756 standard deviation of good mail is under 5, the SpamAssassin default
7757 for ``spam''.
7758
7759 Using @command{gnumeric}, sort the messages by score and view the
7760 messages with the highest score. Determine the score which encompasses
7761 all of your interesting messages and add a couple of points to be
7762 conservative. Add that many dots to the @samp{X-Spam-Level:} header
7763 field above to send messages with that score down the drain.
7764
7765 In the example above, messages with a score of 5--9 are set aside in
7766 the @samp{+spam} folder for later review. The major weakness of
7767 rules-based filters is a plethora of false positives so it is
7768 worthwhile to check.
7769
7770 @findex mh-junk-blacklist
7771 @findex mh-junk-whitelist
7772 @kindex J b
7773 @kindex J w
7774
7775 If SpamAssassin classifies a message incorrectly, or is unsure, you can
7776 use the MH-E commands @kbd{J b} (@code{mh-junk-blacklist}) and
7777 @kbd{J w} (@code{mh-junk-whitelist}).
7778
7779 @cindex @command{sa-learn}
7780 @cindex @file{.spamassassin/user_prefs}
7781 @cindex files, @file{.spamassassin/user_prefs}
7782
7783 The command @kbd{J b} (@code{mh-junk-blacklist}) adds a
7784 @samp{blacklist_from} entry to @file{~/spamassassin/user_prefs},
7785 deletes the message, and sends the message to the Razor, so that
7786 others might not see this spam. If the @command{sa-learn} command is
7787 available, the message is also recategorized as spam.
7788
7789 The command@kbd{J w} (@code{mh-junk-whitelist}) adds a
7790 @samp{whitelist_from} rule to @samp{~/.spamassassin/user_prefs}. If
7791 the @command{sa-learn} command is available, the message is also
7792 recategorized as ham.
7793
7794 Over time, you'll observe that the same host or domain occurs
7795 repeatedly in the @samp{blacklist_from} entries, so you might think
7796 that you could avoid future spam by blacklisting all mail from a
7797 particular domain. The utility function
7798 @code{mh-spamassassin-identify-spammers} helps you do precisely that.
7799 This function displays a frequency count of the hosts and domains in
7800 the @samp{blacklist_from} entries from the last blank line in
7801 @file{~/.spamassassin/user_prefs} to the end of the file. This
7802 information can be used so that you can replace multiple
7803 @samp{blacklist_from} entries with a single wildcard entry such as:
7804
7805 @smallexample
7806 blacklist_from *@@*amazingoffersdirect2u.com
7807 @end smallexample
7808
7809 In versions of SpamAssassin (2.50 and on) that support a Bayesian
7810 classifier, @kbd{J b} @code{(mh-junk-blacklist}) uses the program
7811 @command{sa-learn} to recategorize the message as spam. Neither MH-E,
7812 nor SpamAssassin, rebuilds the database after adding words, so you
7813 will need to run @samp{sa-learn --rebuild} periodically. This can be
7814 done by adding the following to your @file{crontab}:
7815
7816 @smallexample
7817 0 * * * * sa-learn --rebuild > /dev/null 2>&1
7818 @end smallexample
7819
7820 @subheading Bogofilter
7821
7822 @cindex bogofilter
7823 @cindex spam filters, bogofilter
7824
7825 Bogofilter is a Bayesian spam filtering program. Get it from your
7826 local distribution or from the
7827 @uref{http://bogofilter.sourceforge.net/, bogofilter web site}.
7828
7829 Bogofilter is taught by running:
7830
7831 @smallexample
7832 bogofilter -n < good-message
7833 @end smallexample
7834
7835 on every good message, and
7836
7837 @smallexample
7838 bogofilter -s < spam-message
7839 @end smallexample
7840
7841 @cindex full training
7842
7843 on every spam message. This is called a @dfn{full training}; three
7844 other training methods are described in the FAQ that is distributed
7845 with bogofilter. Note that most Bayesian filters need 1000 to 5000 of
7846 each type of message to start doing a good job.
7847
7848 To use bogofilter, add the following recipes to @file{~/.procmailrc}:
7849
7850 @cindex @samp{X-Bogosity:} header field
7851 @cindex header field, @samp{X-Bogosity:}
7852
7853 @smallexample
7854 PATH=$PATH:/usr/bin/mh
7855 MAILDIR=$HOME/`mhparam Path`
7856
7857 # Fight spam with Bogofilter.
7858 :0fw
7859 | bogofilter -3 -e -p
7860
7861 :0:
7862 * ^X-Bogosity: Yes, tests=bogofilter
7863 spam/.
7864
7865 :0:
7866 * ^X-Bogosity: Unsure, tests=bogofilter
7867 spam/unsure/.
7868 @end smallexample
7869
7870 @findex mh-junk-blacklist
7871 @findex mh-junk-whitelist
7872 @kindex J b
7873 @kindex J w
7874
7875 If bogofilter classifies a message incorrectly, or is unsure, you can
7876 use the MH-E commands @kbd{J b} (@code{mh-junk-blacklist}) and @kbd{J
7877 w} (@code{mh-junk-whitelist}) to update bogofilter's training.
7878
7879 The @cite{Bogofilter FAQ} suggests that you run the following
7880 occasionally to shrink the database:
7881
7882 @smallexample
7883 bogoutil -d wordlist.db | bogoutil -l wordlist.db.new
7884 mv wordlist.db wordlist.db.prv
7885 mv wordlist.db.new wordlist.db
7886 @end smallexample
7887
7888 The @cite{Bogofilter tuning HOWTO} describes how you can fine-tune
7889 bogofilter.
7890
7891 @subheading SpamProbe
7892
7893 @cindex SpamProbe
7894 @cindex spam filters, SpamProbe
7895
7896 SpamProbe is a Bayesian spam filtering program. Get it from your local
7897 distribution or from the @uref{http://spamprobe.sourceforge.net,
7898 SpamProbe web site}.
7899
7900 To use SpamProbe, add the following recipes to @file{~/.procmailrc}:
7901
7902 @cindex @command{formail}
7903 @cindex @samp{X-SpamProbe:} header field
7904 @cindex header field, @samp{X-SpamProbe:}
7905
7906 @smallexample
7907 PATH=$PATH:/usr/bin/mh
7908 MAILDIR=$HOME/`mhparam Path`
7909
7910 # Fight spam with SpamProbe.
7911 :0
7912 SCORE=| spamprobe receive
7913
7914 :0 wf
7915 | formail -I "X-SpamProbe: $SCORE"
7916
7917 :0:
7918 *^X-SpamProbe: SPAM
7919 spam/.
7920 @end smallexample
7921
7922 @findex mh-junk-blacklist
7923 @findex mh-junk-whitelist
7924 @kindex J b
7925 @kindex J w
7926
7927 If SpamProbe classifies a message incorrectly, you can use the MH-E
7928 commands @kbd{J b} (@code{mh-junk-blacklist}) and @kbd{J w}
7929 (@code{mh-junk-whitelist}) to update SpamProbe's training.
7930
7931 @subheading Other Things You Can Do
7932
7933 There are a couple of things that you can add to @file{~/.procmailrc}
7934 in order to filter out a lot of spam and viruses. The first is to
7935 eliminate any message with a Windows executable (which is most likely
7936 a virus). The second is to eliminate mail in character sets that you
7937 can't read.
7938
7939 @cindex @samp{Content-Transfer-Encoding:} header field
7940 @cindex @samp{Content-Type:} header field
7941 @cindex @samp{Subject:} header field
7942 @cindex header field, @samp{Content-Transfer-Encoding:}
7943 @cindex header field, @samp{Content-Type:}
7944 @cindex header field, @samp{Subject:}
7945
7946 @smallexample
7947 PATH=$PATH:/usr/bin/mh
7948 MAILDIR=$HOME/`mhparam Path`
7949
7950 #
7951 # Filter messages with w32 executables/virii.
7952 #
7953 # These attachments are base64 and have a TVqQAAMAAAAEAAAA//8AALg
7954 # pattern. The string "this program cannot be run in MS-DOS mode"
7955 # encoded in base64 is 4fug4AtAnNIbg and helps to avoid false
7956 # positives (Roland Smith via Pete from the bogofilter mailing list).
7957 #
7958 :0 B:
7959 * ^Content-Transfer-Encoding:.*base64
7960 * ^TVqQAAMAAAAEAAAA//8AALg
7961 * 4fug4AtAnNIbg
7962 spam/exe/.
7963
7964 #
7965 # Filter mail in unreadable character sets (from the Bogofilter FAQ).
7966 #
7967 UNREADABLE='[^?"]*big5|iso-2022-jp|ISO-2022-KR|euc-kr|gb2312|ks_c_5601-1987'
7968
7969 :0:
7970 * 1^0 $ ^Subject:.*=\?($UNREADABLE)
7971 * 1^0 $ ^Content-Type:.*charset="?($UNREADABLE)
7972 spam/unreadable/.
7973
7974 :0:
7975 * ^Content-Type:.*multipart
7976 * B ?? $ ^Content-Type:.*^?.*charset="?($UNREADABLE)
7977 spam/unreadable/.
7978 @end smallexample
7979
7980 @node Miscellaneous, Scan Line Formats, Junk, Top
7981 @chapter Miscellaneous Commands, Variables, and Buffers
7982
7983 This chapter covers the following command and the various MH-E
7984 buffers,
7985
7986 @ftable @code
7987 @item mh-version
7988 Display version information about MH-E and the MH mail handling
7989 system.
7990 @end ftable
7991
7992 @cindex buffers, @samp{*MH-E Info*}
7993 @cindex MH-E version
7994 @cindex @samp{*MH-E Info*}
7995 @cindex version
7996 @kindex M-x mh-version
7997
7998 One command worth noting is @kbd{M-x mh-version}. You can compare the
7999 version this command prints to the latest release (@pxref{Getting
8000 MH-E}). The output of @kbd{M-x mh-version}, found in a buffer named
8001 @samp{*MH-E Info*}, should usually be included with any bug report you
8002 submit (@pxref{Bug Reports}).
8003
8004 @subheading MH-E Buffers
8005
8006 Besides the MH-Folder, MH-Show, and MH-Letter buffers, MH-E creates
8007 several other buffers. They are:
8008
8009 @table @samp
8010 @cindex @samp{*MH-E Folders*}
8011 @cindex buffers, @samp{*MH-E Folders*}
8012 @findex mh-list-folders
8013 @item *MH-E Folders*
8014 @kindex F l
8015 This buffer contains the output of @kbd{F l} (@code{mh-list-folders}).
8016 @xref{Folders}.
8017 @c -------------------------
8018 @cindex @samp{*MH-E Help*}
8019 @cindex buffers, @samp{*MH-E Help*}
8020 @findex mh-help
8021 @item *MH-E Help*
8022 @kindex ?
8023 @kindex C-c ?
8024 This buffer contains the output of @kbd{?} (@code{mh-help}) and
8025 @kbd{C-c ?} in MH-Letter mode. @xref{Using This Manual}.
8026 @c -------------------------
8027 @cindex @samp{*MH-E Info*}
8028 @cindex buffers, @samp{*MH-E Info*}
8029 @item *MH-E Info*
8030 This buffer contains the output of @kbd{M-x mh-version @key{RET}}.
8031 @c -------------------------
8032 @cindex @samp{*MH-E Log*}
8033 @cindex buffers, @samp{*MH-E Log*}
8034 @item *MH-E Log*
8035 This buffer contains the last 100 lines of the output of the various
8036 MH commands.
8037 @c -------------------------
8038 @cindex @samp{*MH-E Mail Delivery*}
8039 @cindex buffers, @samp{*MH-E Mail Delivery*}
8040 @item *MH-E Mail Delivery*
8041 This buffer contains the transcript of a mail delivery. @xref{Sending
8042 Message}.
8043 @c -------------------------
8044 @cindex @samp{*MH-E Recipients*}
8045 @cindex buffers, @samp{*MH-E Recipients*}
8046 @findex mh-check-whom
8047 @item *MH-E Recipients*
8048 @kindex C-c C-w
8049 This buffer contains the output of @kbd{C-c C-w}
8050 (@code{mh-check-whom}) and is killed when draft is sent.
8051 @xref{Checking Recipients}.
8052 @c -------------------------
8053 @cindex @samp{*MH-E Sequences*}
8054 @cindex buffers, @samp{*MH-E Sequences*}
8055 @item *MH-E Sequences*
8056 This buffer contains the output of @kbd{S l}
8057 (@code{mh-list-sequences}). @xref{Sequences}.
8058 @c -------------------------
8059 @cindex @samp{*mh-temp*}
8060 @cindex buffers, @samp{*mh-temp*}
8061 @item *mh-temp*
8062 This is a scratch, ephemeral, buffer used by MH-E functions. Note that
8063 it is hidden because the first character in the name is a space.
8064 You'll generally not have any need for this buffer.
8065 @end table
8066
8067 @node Scan Line Formats, Procmail, Miscellaneous, Top
8068 @appendix Scan Line Formats
8069
8070 @cindex scan line formats
8071
8072 This appendix discusses how MH-E creates, parses, and manipulates scan
8073 lines. If you have your own MH scan or inc format files, you
8074 @strong{can} teach MH-E how to handle them, but it isn't easy as
8075 you'll see.
8076
8077 @cindex @samp{mh-scan-line-formats} customization group
8078 @cindex customization group, @samp{mh-scan-line-formats}
8079
8080 This table lists the options in the @samp{mh-scan-line-formats}
8081 customization group.
8082
8083 @vtable @code
8084 @item mh-adaptive-cmd-note-flag
8085 On means that the message number width is determined dynamically
8086 (default: @samp{on}).
8087 @c -------------------------
8088 @item mh-scan-format-file
8089 Specifies the format file to pass to the scan program (default:
8090 @samp{Use MH-E scan Format}).
8091 @c -------------------------
8092 @item mh-scan-prog
8093 Program used to scan messages (default: @code{"scan"}).
8094 @end vtable
8095
8096 @vindex mh-adaptive-cmd-note-flag
8097
8098 There are a couple of caveats when creating your own scan format file.
8099 First, MH-E will not work if your scan lines do not include message
8100 numbers. It will work poorly if you don't dedicate a column for
8101 showing the current message and notations. It is also best to keep the
8102 first column empty to make room for the cursor and so that text isn't
8103 obscured by the current message's overlay arrow when running in a
8104 terminal. You won't be able to use the option
8105 @code{mh-adaptive-cmd-note-flag} or the threading features
8106 (@pxref{Threading}).
8107
8108 @cindex message numbers
8109 @findex mh-set-cmd-note
8110 @vindex mh-adaptive-cmd-note-flag
8111 @vindex mh-scan-format-file
8112
8113 If you've created your own format to handle long message numbers,
8114 you'll be pleased to know you no longer need it since MH-E adapts its
8115 internal format based upon the largest message number if
8116 @code{mh-adaptive-cmd-note-flag} is on (the default). If you prefer
8117 fixed-width message numbers, turn off @code{mh-adaptive-cmd-note-flag}
8118 and call @code{mh-set-cmd-note} with the width specified by your
8119 format file (see @code{mh-scan-format-file}). For example, the default
8120 width is 4, so you would use @samp{(mh-set-cmd-note 4)}.
8121
8122 @vindex mh-adaptive-cmd-note-flag
8123 @vindex mh-scan-format-file
8124 @vindex mh-scan-format-mh
8125 @vindex mh-scan-format-nmh
8126
8127 The default setting for @code{mh-scan-format-file} is @samp{Use MH-E
8128 scan Format}. This means that the format string will be taken from the
8129 either @code{mh-scan-format-mh} or @code{mh-scan-format-nmh} depending
8130 on whether MH or nmh (or GNU mailutils MH) is in use. This setting
8131 also enables you to turn on the option
8132 @code{mh-adaptive-cmd-note-flag}. You can also set this option to
8133 @samp{Use Default scan Format} to get the same output as you would get
8134 if you ran @command{scan} from the shell. If you have a format file
8135 that you want MH-E to use but not MH, you can set this option to
8136 @samp{Specify a scan Format File} and enter the name of your format
8137 file.
8138
8139 @vindex mh-scan-format-file
8140 @vindex mh-scan-format-mh
8141 @vindex mh-scan-format-nmh
8142
8143 The scan format that MH-E uses when @code{mh-scan-format-file} is set
8144 to its default of @samp{Use MH-E scan Format} is held in the variables
8145 @code{mh-scan-format-nmh} and @code{mh-scan-format-mh} depending on
8146 whether you are using nmh (or GNU mailutils MH) or not. Typically, you
8147 create your own format files rather than modifying these variables.
8148 The value of @code{mh-scan-format-nmh} is:
8149
8150 @smallexample
8151 (concat
8152 "%4(msg)"
8153 "%<(cur)+%| %>"
8154 "%<@{replied@}-"
8155 "%?(nonnull(comp@{to@}))%<(mymbox@{to@})t%>"
8156 "%?(nonnull(comp@{cc@}))%<(mymbox@{cc@})c%>"
8157 "%?(nonnull(comp@{bcc@}))%<(mymbox@{bcc@})b%>"
8158 "%?(nonnull(comp@{newsgroups@}))n%>"
8159 "%<(zero) %>"
8160 "%02(mon@{date@})/%02(mday@{date@})%<@{date@} %|*%>"
8161 "%<(mymbox@{from@})%<@{to@}To:%14(decode(friendly@{to@}))%>%>"
8162 "%<(zero)%17(decode(friendly@{from@}))%> "
8163 "%(decode@{subject@})%<@{body@}<<%@{body@}%>")
8164 @end smallexample
8165
8166 @cindex decoding RFC 2047
8167 @cindex RFC 2047, decoding
8168 @vindex mh-scan-format-mh
8169
8170 The setting for @code{mh-scan-format-mh} is similar, except that MH
8171 doesn't have the function @code{decode} (which is used to decode RFC
8172 2047 encodings).
8173
8174 @cindex notations, scan line
8175 @cindex scan line notations
8176
8177 These strings are passed to the @command{scan} program via the
8178 @option{-format} argument. The formats are identical to the defaults
8179 except that additional hints for fontification have been added to the
8180 existing notations in the fifth column (remember that in Emacs, the
8181 columns start at 0). The values of the fifth column, in priority
8182 order, are: @samp{-} if the message has been replied to, @samp{t} if
8183 an address in the @samp{To:} field matches one of the mailboxes of the
8184 current user, @samp{c} if the @samp{Cc:} field matches, @samp{b} if
8185 the @samp{Bcc:} field matches, and @samp{n} if a non-empty
8186 @samp{Newsgroups:} field is present.
8187
8188 @cindex @command{scan}
8189 @cindex MH commands, @command{scan}
8190 @vindex mh-progs
8191 @vindex mh-scan-prog
8192
8193 The name of the program that generates a listing of one line per
8194 message is held in @code{mh-scan-prog} (default: @code{"scan"}).
8195 Unless this variable contains an absolute pathname, it is assumed to
8196 be in the @code{mh-progs} directory (@pxref{Getting Started}). You may
8197 link another program to @command{scan} (see @samp{mh-profile}(5)) to
8198 produce a different type of listing@footnote{See the section
8199 @uref{@value{MH-BOOK-HOME}/faswsprs.html, Find and Specify with scan
8200 pick Ranges Sequences} in the MH book.}.
8201
8202 @cindex regular expressions, scan line formats
8203 @findex mh-set-cmd-note
8204 @findex setq
8205
8206 If you change the format of the scan lines you'll need to tell MH-E
8207 how to parse the new format. As you will see, quite a lot of variables
8208 are involved to do that. Use @kbd{M-x apropos @key{RET}
8209 mh-scan.*regexp @key{RET}} to obtain a list of these variables. You
8210 will also have to call @code{mh-set-cmd-note} if your notations are
8211 not in column 4 (columns in Emacs start with 0). Note that unlike most
8212 of the user options described in this manual, these are variables and
8213 must be set with @code{setq} instead of in a customization buffer. For
8214 help with regular expressions, see
8215 @ifnothtml
8216 @ref{Regexps, , Syntax of Regular Expressions, emacs, The
8217 GNU Emacs Manual}.
8218 @end ifnothtml
8219 @ifhtml
8220 section
8221 @uref{http://www.gnu.org/software/emacs/manual/html_node/emacs/Regexps.html,
8222 Syntax of Regular Expressions} in @cite{The GNU Emacs Manual}.
8223 @end ifhtml
8224
8225 The first variable has to do with pruning out garbage.
8226
8227 @vtable @code
8228 @cindex @command{inc}
8229 @cindex MH commands, @command{inc}
8230 @cindex @command{scan}
8231 @cindex MH commands, @command{scan}
8232 @item mh-scan-valid-regexp
8233 This regular expression describes a valid scan line. This is used to
8234 eliminate error messages that are occasionally produced by
8235 @command{inc}@footnote{See the section
8236 @uref{@value{MH-BOOK-HOME}/reapre.html, Reading Mail: inc show next
8237 prev} in the MH book.} or @command{scan} (default: @code{"^ *[0-9]"}).
8238 @end vtable
8239
8240 Next, many variables control how the scan lines are parsed.
8241
8242 @vtable @code
8243 @vindex mh-folder-body
8244 @vindex mh-folder-font-lock-keywords
8245 @item mh-scan-body-regexp
8246 This regular expression matches the message body fragment. Note that
8247 the default setting of @code{mh-folder-font-lock-keywords} expects
8248 this expression to contain at least one parenthesized expression which
8249 matches the body text as in the default of
8250 @code{"\\(<<\\([^\n]+\\)?\\)"}. If this regular expression is not
8251 correct, the body fragment will not be highlighted with the face
8252 @code{mh-folder-body}.
8253 @c -------------------------
8254 @vindex mh-folder-cur-msg-number
8255 @vindex mh-folder-font-lock-keywords
8256 @vindex mh-note-cur
8257 @item mh-scan-cur-msg-number-regexp
8258 This regular expression matches the current message. It must match
8259 from the beginning of the line. Note that the default setting of
8260 @code{mh-folder-font-lock-keywords} expects this expression to contain
8261 at least one parenthesized expression which matches the message number
8262 as in the default of @w{@code{"^\\( *[0-9]+\\+\\).*"}}. This
8263 expression includes the leading space and current message marker
8264 @samp{+} within the parenthesis since it looks better to highlight
8265 these items as well. The highlighting is done with the face
8266 @code{mh-folder-cur-msg-number}. This regular expression should be
8267 correct as it is needed by non-fontification functions. See also
8268 @code{mh-note-cur}.
8269 @c -------------------------
8270 @vindex mh-folder-date
8271 @vindex mh-folder-font-lock-keywords
8272 @vindex mh-scan-sent-to-me-sender-regexp
8273 @item mh-scan-date-regexp
8274 This regular expression matches a valid date. It must @strong{not} be
8275 anchored to the beginning or the end of the line. Note that the
8276 default setting of @code{mh-folder-font-lock-keywords} expects this
8277 expression to contain only one parenthesized expression which matches
8278 the date field as in the default of
8279 @code{"\\([0-9][0-9]/[0-9][0-9]\\)"}. If this regular expression is
8280 not correct, the date will not be highlighted with the face
8281 @code{mh-folder-date}.
8282 @c -------------------------
8283 @vindex mh-folder-deleted
8284 @vindex mh-folder-font-lock-keywords
8285 @vindex mh-note-deleted
8286 @item mh-scan-deleted-msg-regexp
8287 This regular expression matches deleted messages. It must match from
8288 the beginning of the line. Note that the default setting of
8289 @code{mh-folder-font-lock-keywords} expects this expression to contain
8290 at least one parenthesized expression which matches the message number
8291 as in the default of @code{"^\\( *[0-9]+\\)D"}. This expression
8292 includes the leading space within the parenthesis since it looks
8293 better to highlight it as well. The highlighting is done with the face
8294 @code{mh-folder-deleted}. This regular expression should be correct as
8295 it is needed by non-fontification functions. See also
8296 @code{mh-note-deleted}.
8297 @c -------------------------
8298 @vindex mh-folder-font-lock-keywords
8299 @vindex mh-folder-msg-number
8300 @item mh-scan-good-msg-regexp
8301 This regular expression matches ``good'' messages. It must match from
8302 the beginning of the line. Note that the default setting of
8303 @code{mh-folder-font-lock-keywords} expects this expression to contain
8304 at least one parenthesized expression which matches the message number
8305 as in the default of @w{@code{"^\\( *[0-9]+\\)[^D^0-9]"}}. This
8306 expression includes the leading space within the parenthesis since it
8307 looks better to highlight it as well. The highlighting is done with
8308 the face @code{mh-folder-msg-number}. This regular expression should
8309 be correct as it is needed by non-fontification functions.
8310 @c -------------------------
8311 @vindex mh-scan-format-file
8312 @item mh-scan-msg-format-regexp
8313 This regular expression finds the message number width in a scan
8314 format. Note that the message number must be placed in a parenthesized
8315 expression as in the default of @code{"%\\([0-9]*\\)(msg)"}. This
8316 variable is only consulted if @code{mh-scan-format-file} is set to
8317 @samp{Use MH-E scan Format}.
8318 @c -------------------------
8319 @vindex mh-scan-format-file
8320 @item mh-scan-msg-format-string
8321 This is a format string for the width of the message number in a scan
8322 format. Use @samp{0%d} for zero-filled message numbers. This variable
8323 is only consulted if @code{mh-scan-format-file} is set to @samp{Use
8324 MH-E scan Format} (default: @code{"%d"}).
8325 @c -------------------------
8326 @item mh-scan-msg-number-regexp
8327 This regular expression extracts the message number. It must match
8328 from the beginning of the line. Note that the message number must be
8329 placed in a parenthesized expression as in the default of @w{@code{"^
8330 *\\([0-9]+\\)"}}.
8331 @c -------------------------
8332 @item mh-scan-msg-overflow-regexp
8333 This regular expression matches overflowed message numbers (default:
8334 @code{"^[?0-9][0-9]"}).
8335 @c -------------------------
8336 @item mh-scan-msg-search-regexp
8337 This regular expression matches a particular message. It is a format
8338 string; use @samp{%d} to represent the location of the message number
8339 within the expression as in the default of @code{"^[^0-9]*%d[^0-9]"}.
8340 @c -------------------------
8341 @vindex mh-folder-address
8342 @vindex mh-folder-font-lock-keywords
8343 @vindex mh-folder-to
8344 @item mh-scan-rcpt-regexp
8345 This regular expression specifies the recipient in messages you sent.
8346 Note that the default setting of @code{mh-folder-font-lock-keywords}
8347 expects this expression to contain two parenthesized expressions. The
8348 first is expected to match the @samp{To:} that the default scan format
8349 file generates. The second is expected to match the recipient's name
8350 as in the default of @code{"\\(To:\\)\\(..............\\)"}. If this
8351 regular expression is not correct, the @samp{To:} string will not be
8352 highlighted with the face @code{mh-folder-to} and the recipient will not be
8353 highlighted with the face @code{mh-folder-address}.
8354 @c -------------------------
8355 @vindex mh-folder-font-lock-keywords
8356 @vindex mh-folder-refiled
8357 @vindex mh-note-refiled
8358 @item mh-scan-refiled-msg-regexp
8359 This regular expression matches refiled messages. It must match from
8360 the beginning of the line. Note that the default setting of
8361 @code{mh-folder-font-lock-keywords} expects this expression to contain
8362 at least one parenthesized expression which matches the message number
8363 as in the default of @w{@code{"^\\( *[0-9]+\\)\\^"}}. This expression
8364 includes the leading space within the parenthesis since it looks
8365 better to highlight it as well. The highlighting is done with the face
8366 @code{mh-folder-refiled}. This regular expression should be correct as
8367 it is needed by non-fontification functions. See also
8368 @code{mh-note-refiled}.
8369 @c -------------------------
8370 @vindex mh-folder-font-lock-keywords
8371 @vindex mh-folder-sent-to-me-sender
8372 @vindex mh-mh-folder-sent-to-me-hint
8373 @vindex mh-scan-format-nmh
8374 @item mh-scan-sent-to-me-sender-regexp
8375 This regular expression matches messages sent to us. Note that the
8376 default setting of @code{mh-folder-font-lock-keywords} expects this
8377 expression to contain at least two parenthesized expressions. The
8378 first should match the fontification hint (see
8379 @code{mh-scan-format-nmh}) and the second should match the user name
8380 as in the default of
8381 @w{@code{"^ *[0-9]+.\\([bct]\\).....[ ]*\\(..................\\)"}}.
8382 If this regular expression is not correct, the notation hints will not
8383 be highlighted with the face @code{mh-mh-folder-sent-to-me-hint} and
8384 the sender will not be highlighted with the face
8385 @code{mh-folder-sent-to-me-sender}.
8386 @c -------------------------
8387 @vindex mh-folder-followup
8388 @vindex mh-folder-font-lock-keywords
8389 @vindex mh-folder-subject
8390 @item mh-scan-subject-regexp
8391 This regular expression matches the subject. It must match from the
8392 beginning of the line. Note that the default setting of
8393 @samp{mh-folder-font-lock-keywords} expects this expression to contain
8394 at least three parenthesized expressions. The first is expected to
8395 match the @samp{Re:} string, if any, and is highlighted with the face
8396 @code{mh-folder-followup}. The second matches an optional bracketed
8397 number after @samp{Re:}, such as in @samp{Re[2]:} (and is thus a
8398 sub-expression of the first expression). The third is expected to
8399 match the subject line itself which is highlighted with the face
8400 @code{mh-folder-subject}. For example, the default is
8401 @w{@code{"^ *[0-9]+........[ ]*...................}}@*
8402 @w{@code{\\([Rr][Ee]\\(\\[[0-9]+\\]\\)?:\\s-*\\)*\\([^<\n]*\\)"}}.
8403 This regular expression should be correct as it is needed by
8404 non-fontification functions. Note that this example is broken up on
8405 two lines for readability, but is actually a single string.
8406 @end vtable
8407
8408 Finally, there are a slew of variables that control how MH-E annotates
8409 the scan lines.
8410
8411 @vtable @code
8412 @findex mh-set-cmd-note
8413 @vindex mh-adaptive-cmd-note-flag
8414 @item mh-cmd-note
8415 Column for notations (default: 4). This variable should be set with
8416 the function @code{mh-set-cmd-note}. This variable may be updated
8417 dynamically if @code{mh-adaptive-cmd-note-flag} is on. The following
8418 variables contain the notational characters. Note that columns in
8419 Emacs start with 0.
8420 @c -------------------------
8421 @item mh-note-copied
8422 Messages that have been copied are marked by this character (default:
8423 @code{?C}).
8424 @c -------------------------
8425 @vindex mh-scan-cur-msg-number-regexp
8426 @item mh-note-cur
8427 The current message (in MH, not in MH-E) is marked by this character
8428 (default: @code{?+}). See also @code{mh-scan-cur-msg-number-regexp}.
8429 @c -------------------------
8430 @vindex mh-scan-deleted-msg-regexp
8431 @item mh-note-deleted
8432 Messages that have been deleted are marked by this character (default:
8433 @code{?D}). See also @code{mh-scan-deleted-msg-regexp}.
8434 @c -------------------------
8435 @item mh-note-dist
8436 Messages that have been redistributed are marked by this character
8437 (default: @code{?R}).
8438 @c -------------------------
8439 @item mh-note-forw
8440 Messages that have been forwarded are marked by this character
8441 (default: @code{?F}).
8442 @c -------------------------
8443 @item mh-note-printed
8444 Messages that have been printed are marked by this character (default:
8445 @code{?P}).
8446 @c -------------------------
8447 @vindex mh-scan-refiled-msg-regexp
8448 @item mh-note-refiled
8449 Messages that have been refiled are marked by this character (default:
8450 @code{?^}). See also @code{mh-scan-refiled-msg-regexp}.
8451 @c -------------------------
8452 @item mh-note-repl
8453 Messages that have been replied to are marked by this character
8454 (default: @code{?-}).
8455 @c -------------------------
8456 @item mh-note-seq
8457 Messages in a user-defined sequence are marked by this character
8458 (default: @code{?%}). Messages in the @samp{search} sequence are
8459 marked by this character as well.
8460 @end vtable
8461
8462 For example, let's say I have the following in @file{scan.format}
8463 which displays the sender, the subject, and the message number. This
8464 format places a @samp{+} after the message number for the current
8465 message according to MH; it also uses that column for notations.
8466
8467 @smallexample
8468 %20(decode(friendly@{from@})) %50(decode@{subject@}) %4(msg)%<(cur)+%| %>
8469 @end smallexample
8470
8471 @vindex mh-adaptive-cmd-note-flag
8472 @vindex mh-scan-format-file
8473 @vindex mh-scan-format-file, example
8474
8475 The first thing you have to do is tell MH-E to use this file.
8476 Customize @code{mh-scan-format-file} and set its value to @samp{Use
8477 Default scan Format}. If you didn't get already turn off
8478 @code{mh-adaptive-cmd-note-flag}, you'll need to do that first.
8479
8480 Next, tell MH-E what a valid scan line looks like so that you can at
8481 least display the output of scan in your MH-Folder buffer.
8482
8483 @vindex mh-scan-valid-regexp, example
8484
8485 @smalllisp
8486 (setq mh-scan-valid-regexp "[0-9]+[+D^ ]$")
8487 @end smalllisp
8488
8489 Now, in order to get rid of the @samp{Cursor not pointing to message}
8490 message, you need to tell MH-E how to access the message number. You
8491 should also see why MH-E requires that you include a message number in
8492 the first place.
8493
8494 @vindex mh-scan-msg-number-regexp, example
8495 @vindex mh-scan-msg-search-regexp, example
8496
8497 @smalllisp
8498 (setq mh-scan-msg-number-regexp "^.* \\([0-9]+\\)[+D^ ]$")
8499 (setq mh-scan-msg-search-regexp " %d[+D^ ]$")
8500 @end smalllisp
8501
8502 In order to get the next and previous commands working, add this.
8503
8504 @vindex mh-scan-good-msg-regexp, example
8505
8506 @smalllisp
8507 (setq mh-scan-good-msg-regexp "^.* \\([0-9]+\\)[+D^ ]$")
8508 @end smalllisp
8509
8510 Note that the current message isn't marked with a @samp{+} when moving
8511 between the next and previous messages. Here is the code required to
8512 get this working.
8513
8514 @vindex set-mh-cmd-note, example
8515 @vindex mh-scan-cur-msg-number-regexp, example
8516
8517 @smalllisp
8518 (set-mh-cmd-note 76)
8519 (setq mh-scan-cur-msg-number-regexp "^.* \\([0-9]+\\)\\+$")
8520 @end smalllisp
8521
8522 Finally, add the following to delete and refile messages.
8523
8524 @vindex mh-scan-deleted-msg-regexp, example
8525 @vindex mh-scan-refiled-msg-regexp, example
8526
8527 @smalllisp
8528 (setq mh-scan-deleted-msg-regexp "^.* \\([0-9]+\\)D$")
8529 (setq mh-scan-refiled-msg-regexp "^.* \\([0-9]+\\)\\^$")
8530 @end smalllisp
8531
8532 This is just a bare minimum; it's best to adjust all of the regular
8533 expressions to ensure that MH-E and highlighting perform well.
8534
8535 @node Procmail, Odds and Ends, Scan Line Formats, Top
8536 @appendix Reading Mailing Lists Effectively
8537
8538 @cindex @command{procmail}
8539 @cindex @command{slocal}
8540 @cindex Gnus
8541 @cindex MH commands, @command{slocal}
8542 @cindex Unix commands, @command{procmail}
8543 @cindex mailing lists, reading
8544
8545 This appendix explains how to use @uref{http://www.procmail.org/,
8546 procmail} to file mail from mailing lists into folders which can then
8547 be read easily with MH-E@footnote{The MH equivalent, @command{slocal},
8548 can be used as well, but procmail is more flexible and more packages
8549 exist for procmail than for slocal.}. Some mailing lists have such
8550 high traffic that Gnus must be used and I discuss how to use Gnus
8551 side-by-side with MH-E.
8552
8553 @cindex @file{.procmailrc}
8554 @cindex files, @file{.procmailrc}
8555
8556 First, I'll describe how to put mail from your mailing lists directly
8557 into an MH folder using @command{procmail}. First, add the following
8558 to @file{~/.procmailrc}. While the logging variables aren't strictly
8559 necessary, they are extremely useful.
8560
8561 @smallexample
8562 [1] # Update PATH so procmail can find myrcvstore, rcvstore and mhparam.
8563 [2] PATH=$PATH:/usr/lib/mh:/usr/bin/mh:$HOME/bin
8564 [3]
8565 [4] # Point LOGFILE at the actual log file.
8566 [5] LOGFILE=$HOME/.procmail.log
8567 [6]
8568 [7] # This setting provides just the right amount of information.
8569 [8] LOGABSTRACT=all
8570 [9]
8571 [10] # Uncomment the following line to see how your patterns match.
8572 [11] #VERBOSE=yes
8573 [12]
8574 [13] # Place mail sent to any MH-E mailing list in +mh-e.
8575 [14] :0 w: mh-e$LOCKEXT
8576 [15] * ^TO.*mh-e-.*@@.*sourceforge.net
8577 [16] | myrcvstore -create +mh-e
8578 @end smallexample
8579
8580 @cindex @command{rcvstore}
8581 @cindex MH commands, @command{rcvstore}
8582
8583 Line 14 creates a lock file in your mail directory based upon the name
8584 of the folder. This is done because @command{rcvstore} does not
8585 perform locking. While this lock file will prevent @command{procmail}
8586 from writing to a folder concurrently, there is a slight chance that
8587 you might lose a message if you're performing operations on a folder
8588 at the same time @command{rcvstore} is placing a message there. You
8589 have been warned. Now that that disclaimer is out of the way, note
8590 that I've been using this set-up for over a decade and haven't lost
8591 anything to my knowledge@footnote{See
8592 @uref{https://savannah.nongnu.org/bugs/?func=detailbug&bug_id=4361&group_id=2166,
8593 Savannah issue #4361} to see if @command{rcvstore} locking is still an
8594 issue.}.
8595
8596 @cindex @samp{Unseen-Sequence:} MH profile component
8597 @cindex MH profile component, @samp{Unseen-Sequence:}
8598
8599 Line 16 uses the following script, @code{myrcvstore}, to massage the
8600 message as described in the comment and file the message in the given
8601 folder@footnote{The @samp{-create} argument wasn't always the default
8602 to @command{rcvstore}.}.
8603
8604 @smallexample
8605 #! /bin/sh
8606
8607 # Accepts a message on standard input and passes it through rcvstore
8608 # after first passing it through any filters. All arguments are passed
8609 # on to rcvstore.
8610
8611 # Force the "From user date" to become part of header. One reason this
8612 # is done is because the presence of the From field confuses dist so
8613 # that dist adds a new header, rather than using the existing header.
8614 # Note that this should not be done for any message that goes into a
8615 # Gnus incoming file (Gnus will thrown an error) nor should it be
8616 # applied to any message that goes to the system mailbox because the
8617 # entire mailbox will be incorporated as a single message.
8618 formail -c -z -R 'From ' X-Envelope-From: |
8619 rcvstore $@@
8620 @end smallexample
8621
8622 If your version of @command{rcvstore} doesn't add messages to the
8623 @samp{unseen} sequence by default, add the following line to your MH
8624 profile:
8625
8626 @smallexample
8627 Unseen-Sequence: unseen
8628 @end smallexample
8629
8630 Now view your new messages with the speedbar (@pxref{Speedbar}) or with
8631 @kbd{F n} (@code{mh-index-new-messages}). @xref{Folders}.
8632
8633 If you're on a mailing list that is so voluminous that it is
8634 impossible to read every message, it usually better to read the
8635 mailing list like a newsgroup in a news reader. Emacs has a built-in
8636 newsreader called Gnus. The remainder of this appendix talks about how
8637 to use Gnus with an MH message store. The version of Gnus that was
8638 used to prepare this manual was 5.10. Versions 5.8 through 5.10 should
8639 work but versions prior to 5.8 use different options.
8640
8641 This table contains a list of Gnus options that you will have to
8642 modify. Note that for them to become accessible, you'll have to load
8643 @file{nnml.el} first. This can be done with @kbd{M-x load-library
8644 @key{RET} nnml @key{RET}}.
8645
8646 @vtable @code
8647 @item gnus-secondary-select-methods
8648 Select the @samp{nnml} value. This select method uses directories for
8649 folders and individual files for messages, just like MH@. You do not
8650 have to set an address.
8651 @c -------------------------
8652 @item mail-sources
8653 Select the @samp{Several files in a directory} value, check the
8654 @samp{Path} box and enter @file{~/Mail} to tell Gnus where to find
8655 your mail.
8656 @c -------------------------
8657 @vindex mail-user-agent
8658 @item message-mail-user-agent
8659 In order to send mail within Gnus using MH-E, set this option to
8660 @samp{mail-user-agent} and set the @code{mail-user-agent} option to
8661 @samp{Emacs interface to MH}.
8662 @c -------------------------
8663 @item nnmail-keep-last-article
8664 Since Gnus keeps track of which messages you have read, it would be
8665 bad if Gnus expired the last message, for example, message 100, and
8666 @command{rcvstore} gave the next new message number 1. Gnus would then
8667 ignore it since it thinks that you've read messages 1--100. Turning on
8668 this option ensures that the last message is never removed thereby
8669 eliminating this problem.
8670 @end vtable
8671
8672 Next add the following to @file{~/.procmailrc}. If you don't subscribe
8673 to the GnuCash mailing list, substitute one to which you are
8674 subscribed.
8675
8676 @smallexample
8677 PATH=$PATH:/usr/bin/mh
8678 MAILDIR=$HOME/`mhparam Path`
8679 # Place mail sent to the GnuCash mailing list in gnucash.spool, where
8680 # Gnus will pick it up.
8681 :0:
8682 * ^TO.*gnucash.*@@.*gnucash.org
8683 gnucash.spool
8684 @end smallexample
8685
8686 Wait for some messages to appear in @file{gnucash.spool} and run Gnus
8687 with @kbd{M-x gnus @key{RET}}. To view the folder created in the
8688 example above, you would tell Gnus about it the first time only with
8689 @kbd{G m gnucash @key{RET} nnml @key{RET}}. In MH-E, this folder is
8690 known as @samp{+gnucash}.
8691
8692 @node Odds and Ends, History, Procmail, Top
8693 @appendix Odds and Ends
8694
8695 This appendix covers a few topics that don't fit elsewhere. Here I
8696 tell you how to report bugs and how to get on the MH-E mailing lists.
8697 I also point out some additional sources of information.
8698
8699 @menu
8700 * Bug Reports::
8701 * Mailing Lists::
8702 * MH FAQ and Support::
8703 * Getting MH-E::
8704 @end menu
8705
8706 @node Bug Reports, Mailing Lists, Odds and Ends, Odds and Ends
8707 @appendixsec Bug Reports
8708
8709 @cindex bugs
8710 @cindex SourceForge
8711 @kindex M-x mh-version
8712
8713 Bug reports should be filed at
8714 @uref{https://sourceforge.net/p/mh-e/bugs/, SourceForge}. You need to
8715 be a SourceForge user to submit bug reports, but this is easy enough
8716 to do that it shouldn't be a restriction for you. Please include the
8717 output of @kbd{M-x mh-version} (@pxref{Miscellaneous}) in any bug
8718 report you send unless you're 110% positive we won't ask for it.
8719
8720 @node Mailing Lists, MH FAQ and Support, Bug Reports, Odds and Ends
8721 @appendixsec MH-E Mailing Lists
8722
8723 @cindex SourceForge
8724 @cindex mailing lists
8725
8726 There are several mailing lists for MH-E@. They are @i{mh-e-users at
8727 lists.sourceforge.net}, @i{mh-e-announce at lists.sourceforge.net},
8728 and @i{mh-e-devel at lists.sourceforge.net}. You can subscribe or view
8729 the archives at @uref{https://sourceforge.net/p/mh-e/mailman/,
8730 SourceForge}. Do not report bugs on these lists; please submit them
8731 via SourceForge (@pxref{Bug Reports}).
8732
8733 @node MH FAQ and Support, Getting MH-E, Mailing Lists, Odds and Ends
8734 @appendixsec MH FAQ and Support
8735
8736 @cindex FAQ
8737 @cindex MH FAQ
8738
8739 The article @uref{http://www.newt.com/faq/mh.html, @cite{MH Frequently
8740 Asked Questions (FAQ) with Answers}} appears monthly in the newsgroup
8741 @samp{comp.mail.mh}. While very little is there that deals with MH-E
8742 specifically, there is an incredible wealth of material about MH
8743 itself which you will find useful.
8744
8745 @cindex support
8746
8747 You can find FAQs on MH-E by searching for @i{labels:support} on the
8748 @uref{https://sourceforge.net/p/mh-e/bugs/search/?q=labels%3Asupport,
8749 Tickets} page on SourceForge. If you don't find the answer to your
8750 question, file a ticket and your question will become a new FAQ!
8751
8752 @node Getting MH-E, , MH FAQ and Support, Odds and Ends
8753 @appendixsec Getting MH-E
8754
8755 @cindex MH-E, obtaining
8756 @cindex getting MH-E
8757 @cindex obtaining MH-E
8758
8759 Because MH-E is undergoing a phase of sustained growth, the version of
8760 MH-E in your Emacs is likely to be out of date although it is most
8761 likely to be more up to date than the copy that comes with the MH
8762 distribution in @file{miscellany/mh-e}.
8763
8764 @cindex change log
8765 @cindex release notes
8766
8767 New MH-E releases are always available for downloading at
8768 @uref{https://sourceforge.net/projects/mh-e/files/, SourceForge}
8769 before they appear in an Emacs release. You can read the release notes
8770 on that page to determine if the given release of MH-E is already
8771 installed in your version of Emacs. You can also read the change log
8772 to see if you are interested in what the given release of MH-E has to
8773 offer (although we have no doubt that you will be extremely interested
8774 in all new releases).
8775
8776 @cindex Debian
8777
8778 If you use Debian, you can install the Debian
8779 @uref{http://packages.debian.org/unstable/mail/mh-e, mh-e package}
8780 instead.
8781
8782 @cindex files, @samp{MH-E-NEWS}
8783 @cindex files, @samp{README}
8784 @cindex news
8785 @cindex @samp{MH-E-NEWS}
8786 @cindex @samp{README}
8787 @kindex M-x mh-version
8788
8789 After you download and extract the MH-E tarball, read the
8790 @file{README} file and @file{MH-E-NEWS}. These correspond to the
8791 release notes and change log mentioned above. The file @file{README}
8792 contains instructions on installing MH-E@. If you're already running
8793 Emacs, please quit that session and start again to load in the new
8794 MH-E@. Check that you're running the new version with the command
8795 @kbd{M-x mh-version}.
8796
8797 @cindex contributed software
8798 @cindex manual
8799 @cindex documentation
8800
8801 In addition to the mh-e package, the
8802 @uref{https://sourceforge.net/projects/mh-e/files/, SourceForge} site
8803 also contains doc and contrib packages. The former is the latest
8804 release of this manual, and the latter contains a few contributed
8805 packages you might find useful.
8806
8807 @node History, GFDL, Odds and Ends, Top
8808 @appendix History of MH-E
8809
8810 @cindex Bill Wohler
8811 @cindex Brian Reid
8812 @cindex Gildea, Stephen
8813 @cindex Jim Larus
8814 @cindex Larus, Jim
8815 @cindex MH-E, versions
8816 @cindex Reid, Brian
8817 @cindex SourceForge
8818 @cindex Stephen Gildea
8819 @cindex Wohler, Bill
8820 @cindex history of MH-E
8821 @cindex versions of MH-E
8822
8823 MH-E was originally written by Brian Reid in 1983 and has changed
8824 hands several times since then. Jim Larus wanted to do something
8825 similar for GNU Emacs, and ended up completely rewriting it that same
8826 year. In 1989, Stephen Gildea picked it up and added many
8827 improvements. Bill Wohler then took over in 2000 and moved its
8828 development to @uref{http://sourceforge.net/, SourceForge} where it
8829 lives today.
8830
8831 @menu
8832 * From Brian Reid::
8833 * From Jim Larus::
8834 * From Stephen Gildea::
8835 * From Bill Wohler::
8836 @end menu
8837
8838 @node From Brian Reid, From Jim Larus, History, History
8839 @appendixsec From Brian Reid
8840
8841 @cindex Brian Reid
8842 @cindex Reid, Brian
8843
8844 One day in 1983 I got the flu and had to stay home from work for three
8845 days with nothing to do. I used that time to write MHE@. The
8846 fundamental idea behind MHE was that it was a ``puppeteer'' driving
8847 the MH programs underneath it. MH had a model that the editor was
8848 supposed to run as a sub-process of the mailer, which seemed to me at
8849 the time to be the tail wagging the dog. So I turned it around and
8850 made the editor drive the MH programs. I made sure that the UCI people
8851 (who were maintaining MH at the time) took in my changes and made them
8852 stick.
8853
8854 Today, I still use my own version of MHE because I don't at all like
8855 the way that GNU MH-E works and I've never gotten to be good enough at
8856 hacking Emacs Lisp to make GNU MH-E do what I want. The Gosling-emacs
8857 version of MHE and the GNU Emacs version of MH-E have almost nothing
8858 in common except similar names. They work differently, have different
8859 conceptual models, and have different key bindings@footnote{After
8860 reading this article, I questioned Brian about his version of MHE, and
8861 received some great ideas for improving MH-E such as a dired-like
8862 method of selecting folders; and removing the prompting when sending
8863 mail, filling in the blanks in the draft buffer instead. I passed them
8864 on to Stephen Gildea, the current maintainer, and he was excited about
8865 the ideas as well. Perhaps one day, MH-E will again resemble MHE
8866 (draft form editing was introduced in version 7.4).}.
8867
8868 Brian Reid, June 1994
8869
8870 @node From Jim Larus, From Stephen Gildea, From Brian Reid, History
8871 @appendixsec From Jim Larus
8872
8873 @cindex Jim Larus
8874 @cindex Larus, Jim
8875
8876 Brian Reid, while at CMU or shortly after going to Stanford wrote a
8877 mail reading program called MHE for Gosling Emacs. It had much the
8878 same structure as MH-E (i.e., invoked MH programs), though it was
8879 simpler and the commands were slightly different. Unfortunately, I no
8880 longer have a copy so the differences are lost in the mists of time.
8881
8882 In '82--83, I was working at BBN and wrote a lot of mlisp code in
8883 Gosling Emacs to make it look more like Tennex Emacs. One of the
8884 packages that I picked up and improved was Reid's mail system. In '83,
8885 I went back to Berkeley. About that time, Stallman's first version of
8886 GNU Emacs came out and people started to move to it from Gosling Emacs
8887 (as I recall, the transition took a year or two). I decided to port
8888 Reid's MHE and used the mlisp to Emacs Lisp translator that came with
8889 GNU Emacs. It did a lousy job and the resulting code didn't work, so I
8890 bit the bullet and rewrote the code by hand (it was a lot smaller and
8891 simpler then, so it took only a day or two).
8892
8893 Soon after that, MH-E became part of the standard Emacs distribution
8894 and suggestions kept dribbling in for improvements. MH-E soon reached
8895 sufficient functionality to keep me happy, but I kept on improving it
8896 because I was a graduate student with plenty of time on my hands and
8897 it was more fun than my dissertation. In retrospect, the one thing
8898 that I regret is not writing any documentation, which seriously
8899 limited the use and appeal of the package.
8900
8901 @cindex @command{xmh}, in MH-E history
8902
8903 In '89, I came to Wisconsin as a professor and decided not to work on
8904 MH-E@. It was stable, except for minor bugs, and had enough
8905 functionality, so I let it be for a few years. Stephen Gildea of BBN
8906 began to pester me about the bugs, but I ignored them. In 1990, he
8907 went off to the X Consortium, said good bye, and said that he would
8908 now be using @command{xmh}. A few months later, he came back and said
8909 that he couldn't stand @command{xmh} and could I put a few more bug fixes
8910 into MH-E@. At that point, I had no interest in fixing MH-E, so I gave
8911 the responsibility of maintenance to him and he has done a fine job
8912 since then.
8913
8914 Jim Larus, June 1994
8915
8916 @node From Stephen Gildea, From Bill Wohler, From Jim Larus, History
8917 @appendixsec From Stephen Gildea
8918
8919 @cindex Gildea, Stephen
8920 @cindex Stephen Gildea
8921
8922 In 1987 I went to work for Bolt Beranek and Newman, as Jim had before
8923 me. In my previous job, I had been using RMAIL, but as my folders tend
8924 to run large, I was frustrated with the speed of RMAIL@. However, I
8925 stuck with it because I wanted the GNU Emacs interface. I am very
8926 familiar and comfortable with the Emacs interface (with just a few
8927 modifications of my own) and dislike having to use applications with
8928 embedded editors; they never live up to Emacs.
8929
8930 MH is the mail reader of choice at BBN, so I converted to it. Since I
8931 didn't want to give up using an Emacs interface, I started using MH-E@.
8932 As is my wont, I started hacking on it almost immediately. I first
8933 used version 3.4m. One of the first features I added was to treat the
8934 folder buffer as a file-visiting buffer: you could lock it, save it,
8935 and be warned of unsaved changes when killing it. I also worked to
8936 bring its functionality a little closer to RMAIL@. Jim Larus was very
8937 cooperative about merging in my changes, and my efforts first appeared
8938 in version 3.6, distributed with Emacs 18.52 in 1988. Next I decided
8939 MH-E was too slow and optimized it a lot. Version, 3.7, distributed
8940 with Emacs 18.56 in 1990, was noticeably faster.
8941
8942 When I moved to the X Consortium I became the first person there to
8943 not use xmh. (There is now one other engineer there using MH-E@.) About
8944 this point I took over maintenance of MH-E from Jim and was finally
8945 able to add some features Jim hadn't accepted, such as the backward
8946 searching undo. My first release was 3.8 (Emacs 18.58) in 1992.
8947
8948 Now, in 1994, we see a flurry of releases, with both 4.0 and 5.0.
8949 Version 4.0 added many new features, including background folder
8950 collection and support for composing @sc{mime} messages. (Reading
8951 @sc{mime} messages remains to be done, alas.) While writing this book,
8952 Bill Wohler gave MH-E its closest examination ever, uncovering bugs
8953 and inconsistencies that required a new major version to fix, and so
8954 version 5 was released.
8955
8956 Stephen Gildea, June 1994
8957
8958 @node From Bill Wohler, , From Stephen Gildea, History
8959 @appendixsec From Bill Wohler
8960
8961 @cindex Wohler, Bill
8962 @cindex Bill Wohler
8963
8964 The preface originally included the following text which I use to
8965 begin my story:
8966
8967 @quotation
8968 But it's important to note a brief history of MH-E.
8969
8970 @w{Version 3} was prevalent through the @w{Emacs 18} and early
8971 @w{Emacs 19} years. Then @w{Version 4} came out (@w{Emacs 19.23}),
8972 which introduced several new and changed commands. Next, @w{Version
8973 5.0} was released, which fixed some bugs and incompatibilities, and
8974 was incorporated into @w{Emacs 19.29}.
8975 @end quotation
8976
8977 After a long break, Stephen handed the reins over to me in 2000. I
8978 moved the project to a new site called SourceForge and organized a
8979 great team of developers. Our first release in late 2001 was version
8980 6. It appeared around the time of Emacs 21.2 and had menus and tool
8981 bar buttons.
8982
8983 Then, indexed searches, improved MIME handling, a speedbar, multiple
8984 identities, alias completion, an index view of unseen messages, spam
8985 software support, Face and X-Image-URL header field support, Fcc
8986 completion, arbitrary range handling, and draft form editing were
8987 introduced in the version 7 series around the time of Emacs 21.4
8988 (2004). Still, Emacs itself contained version 5 of MH-E released back
8989 in 1994.
8990
8991 Version 8 development was mostly driven by the rewrite of the manual.
8992 It also brought GNU mailutils MH support, S/MIME support, picon
8993 support, and an improved interface for hiding header fields. The CVS
8994 repository was migrated from SourceForge to Savannah (only for those
8995 files that were already part of Emacs) and the software was completely
8996 reorganized to push back two decades of entropy. Version 8 appeared in
8997 Emacs 22.1 in 2006.
8998
8999 Development was then quiet for a couple of years. Emacs 23.1, which is
9000 due out in 2009, will contain version 8.1. This version includes a few
9001 new features and several bug fixes.
9002
9003 Bill Wohler, August 2008
9004
9005 @node GFDL, GPL, History, Top
9006 @appendix GNU Free Documentation License
9007 @include doclicense.texi
9008
9009 @node GPL, Key Index, GFDL, Top
9010 @appendix GNU General Public License
9011 @include gpl.texi
9012
9013 @node Key Index, Command Index, GPL, Top
9014 @unnumbered Key (Character) Index
9015 @printindex ky
9016
9017 @node Command Index, Option Index, Key Index, Top
9018 @unnumbered Command Index
9019 @printindex fn
9020
9021 @node Option Index, Concept Index, Command Index, Top
9022 @unnumbered Option (Variable) Index
9023 @printindex vr
9024
9025 @node Concept Index, , Option Index, Top
9026 @unnumbered Concept Index
9027 @printindex cp
9028
9029 @bye
9030
9031 @c Ispell Helpers
9032 @c
9033 @c The following are words that ispell should ignore that would not
9034 @c normally be in a dictionary (global or personal). Be careful not to
9035 @c include words here that could potentially be typos of other words
9036 @c (such as url, elisp, or MHE).
9037 @c
9038 @c LocalWords: CTRL ESC SPC f's
9039 @c LocalWords: addr Aliasfile alist
9040 @c LocalWords: Baushke Bcc BBN Beranek bogofilter bogofilter's
9041 @c LocalWords: cmd CMU contrib cron
9042 @c LocalWords: DesBrisay Dcc devel dir dired docstring filll forw
9043 @c LocalWords: GECOS Gildea Gildea's Ginnean GnuCash goto gnuserv htm
9044 @c LocalWords: ImageMagick inbox ispell keychain
9045 @c LocalWords: Larus licensor LocalWords lookup lpr
9046 @c LocalWords: makeinfo mairix mbox mh mhbuild mhl mhpath mlisp
9047 @c LocalWords: MML msg multipart
9048 @c LocalWords: Namazu NIS nenscript nnml num
9049 @c LocalWords: packmbox passphrase pathname prev procmail prog repl
9050 @c LocalWords: slocal sortm SpamAssassin spammers SpamProbe SpamProbe's
9051 @c LocalWords: sublicense supercite speedbar
9052 @c LocalWords: Tennex texi texinfo Thelen thelenm
9053 @c LocalWords: UCI undeleted whatnow wohler xmh ypcat
9054 @c
9055 @c See http://www.oreilly.com/oreilly/author/stylesheet.html.
9056 @c See http://en.wikipedia.org/.
9057 @c
9058 @c Note the lowercase mh which is needed to avoid hits in the
9059 @c functions and variables. Occasionally, check for accidental
9060 @c inclusion of mh in text by uncommenting the following and executing
9061 @c it with C-x C-e. You want to see "Search failed"
9062 @c (let ((case-fold-search nil))
9063 @c (goto-char (point-min))
9064 @c (search-forward-regexp "^mh\\( \\|$\\)"))
9065 @c
9066 @c An extremely useful setting for texinfo-mode-hook is:
9067 @c (add-to-list
9068 @c 'ispell-skip-region-alist
9069 @c (list
9070 @c (concat "\\(@\\(small\\)?\\(example\\|lisp\\)"
9071 @c "\\(@\\([irw]\\|code\\|var\\){[^}]+}\\|"
9072 @c "@[@{}.]\\|"
9073 @c "[^@]\\|"
9074 @c "@\\(end \\)?group\\|"
9075 @c "@\\(end \\)?cartouche\\)+"
9076 @c "@end \\(small\\)?\\(example\\|lisp\\)\\|"
9077 @c "@\\(code\\|command\\|file\\|kbd\\|sc\\){[^}]+}\\|"
9078 @c "^@end [a-z]+$\\|"
9079 @c "^@\\([fv]\\|print\\)index .*$\\|"
9080 @c "@uref{[^,]+,\\|"
9081 @c "@[a-z]+\\|"
9082 @c "/[a-z.]+[/}]\\)")))))
9083 @c
9084 @c Cross References
9085 @c
9086 @c See existing cross-references to the Emacs manual and the Emacs
9087 @c Lisp manual (search for ``GNU Emacs Manual'' and ``GNU
9088 @c Emacs Lisp Reference Manual'' respectively).
9089
9090 @c @ftable Sorting
9091 @c
9092 @c As per index (sort of): Punctuation, keyboard characters (such as
9093 @c RET and BS) upper and lowercase mixed (lower comes before
9094 @c uppercase), control characters go with uppercase C, meta characters
9095 @c go with uppercase M.
9096 @c In some cases, the sort isn't strictly ASCII.
9097 @c For example, SPC (mh-page-msg) reads better before BS
9098 @c (mh-previous-page) and . (mh-show) is better before ,
9099 @c (mh-header-display).
9100
9101 @c @vtable Sorting
9102 @c
9103 @c Alphabetical, pull hooks into their own table.
9104
9105 @c Local Variables:
9106 @c sentence-end-double-space: nil
9107 @c End: