]> code.delx.au - gnu-emacs/blob - doc/misc/mh-e.texi
Fix shr.el/image build problem
[gnu-emacs] / 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.info
7 @settitle The MH-E Manual
8 @include docstyle.texi
9 @c %**end of header
10
11 @c Version of the software and manual.
12 @set VERSION 8.6
13 @c Edition of the manual. It is either empty for the first edition or
14 @c has the form ", nth Edition" (without the quotes).
15 @set EDITION
16 @set UPDATED 2016-04-29
17 @set UPDATE-MONTH April, 2016
18
19 @c Other variables.
20 @set MH-BOOK-HOME http://rand-mh.sourceforge.net/book/mh
21 @set MH-E-HOME http://mh-e.sourceforge.net/
22
23 @c Copyright
24 @copying
25 This is version @value{VERSION}@value{EDITION} of @cite{The MH-E
26 Manual}, last updated @value{UPDATED}.
27
28 Copyright @copyright{} 1995, 2001--2003, 2005--2016 Free Software
29 Foundation, Inc.
30
31 @c This dual license has been agreed upon by the FSF.
32
33 @quotation
34 Permission is granted to copy, distribute and/or modify this document
35 under the terms of either:
36
37 @enumerate a
38 @item
39 the GNU Free Documentation License, Version 1.3 or any later version
40 published by the Free Software Foundation; with no Invariant Sections,
41 with the Front-Cover Texts being ``A GNU Manual,'' and with the
42 Back-Cover Texts as in (a) below. A copy of the license is included in
43 the section entitled ``GNU Free Documentation License.''
44
45 (a) The FSF's Back-Cover Text is: ``You have the freedom to copy and
46 modify this GNU manual.''
47
48 @item
49 the GNU General Public License as published by the Free Software
50 Foundation; either version 3, or (at your option) any later version. A
51 copy of the license is included in the section entitled ``GNU General
52 Public License.''
53 @end enumerate
54
55 @end quotation
56 @end copying
57
58 @c Info Directory Entry
59 @dircategory Emacs network features
60 @direntry
61 * MH-E: (mh-e). Emacs interface to the MH mail system.
62 @end direntry
63
64 @c Title Page
65 @titlepage
66 @title The MH-E Manual
67 @subtitle Version @value{VERSION}@value{EDITION}
68 @subtitle @value{UPDATE-MONTH}
69 @author Bill Wohler
70
71 @c Copyright Page
72 @page
73 @vskip 0pt plus 1filll
74 @insertcopying
75 @end titlepage
76
77 @ifnottex
78 @html
79 <!--
80 @end html
81 @node Top, Preface, (dir), (dir)
82 @top The MH-E Manual
83 @html
84 -->
85 @end html
86 @insertcopying
87 @end ifnottex
88
89 @c Table of Contents
90 @contents
91
92 @html
93 <!--
94 @end html
95
96 @menu
97 * Preface:: Preface
98 * Conventions:: GNU Emacs Terms and Conventions
99 * Getting Started:: Getting Started
100 * Tour Through MH-E:: Tour Through MH-E
101 * Using This Manual:: Using This Manual
102 * Incorporating Mail:: Incorporating Mail
103 * Reading Mail:: Reading Mail
104 * Folders:: Organizing Your Mail with Folders
105 * Sending Mail:: Sending Mail
106 * Editing Drafts:: Editing a Draft
107 * Aliases:: Aliases
108 * Identities:: Identities
109 * Speedbar:: The Speedbar
110 * Menu Bar:: The Menu Bar
111 * Tool Bar:: The Tool Bar
112 * Searching:: Searching Through Messages
113 * Threading:: Viewing Message Threads
114 * Limits:: Limiting Display
115 * Sequences:: Using Sequences
116 * Junk:: Dealing With Junk Mail
117 * Miscellaneous:: Miscellaneous Commands, Variables, and Buffers
118 * Scan Line Formats:: Scan Line Formats
119 * Procmail:: Reading Mailing Lists Effectively
120 * Odds and Ends:: Odds and Ends
121 * History:: History of MH-E
122 * GFDL:: GNU Free Documentation License
123 * GPL:: GNU General Public License
124 * Key Index:: Key (Character) Index
125 * Command Index:: Command Index
126 * Option Index:: Option (Variable) Index
127 * Concept Index:: Concept Index
128
129 @detailmenu
130 --- The Detailed Node Listing ---
131
132 Tour Through MH-E
133
134 * Sending Mail Tour::
135 * Reading Mail Tour::
136 * Processing Mail Tour::
137 * Leaving MH-E::
138 * More About MH-E::
139
140 Using This Manual
141
142 * Options::
143 * Ranges::
144 * Folder Selection::
145
146 Reading Your Mail
147
148 * Viewing::
149 * Viewing Attachments::
150 * HTML::
151 * Digests::
152 * Reading PGP::
153 * Printing::
154 * Files and Pipes::
155 * Navigating::
156 * Miscellaneous Commands and Options::
157
158 Sending Mail
159
160 * Composing::
161 * Replying::
162 * Forwarding::
163 * Redistributing::
164 * Editing Again::
165
166 Editing a Draft
167
168 * Editing Message::
169 * Inserting Letter::
170 * Inserting Messages::
171 * Signature::
172 * Picture::
173 * Adding Attachments::
174 * Sending PGP::
175 * Checking Recipients::
176 * Sending Message::
177 * Killing Draft::
178
179 Odds and Ends
180
181 * Bug Reports::
182 * Mailing Lists::
183 * MH FAQ and Support::
184 * Getting MH-E::
185
186 History of MH-E
187
188 * From Brian Reid::
189 * From Jim Larus::
190 * From Stephen Gildea::
191 * From Bill Wohler::
192
193 @end detailmenu
194 @end menu
195
196 @html
197 -->
198 @end html
199
200 @node Preface, Conventions, Top, Top
201 @unnumbered Preface
202
203 @cindex Emacs
204 @cindex Unix commands, Emacs
205 @cindex preface
206
207 This manual introduces another interface to the MH mail system that is
208 accessible through the GNU Emacs editor, namely, @emph{MH-E}. MH-E is
209 easy to use. I don't assume that you know GNU Emacs or even MH at this
210 point, since I didn't know either of them when I discovered MH-E@.
211 However, MH-E was the tip of the iceberg, and I discovered more and
212 more niceties about GNU Emacs and MH@. Now I'm fully hooked on both of
213 them.
214
215 The MH-E package is distributed with Emacs@footnote{Version
216 @value{VERSION} of MH-E appeared in Emacs 24.4. It is supported in GNU
217 Emacs 23 and higher, as well as XEmacs 21.4.22 and 21.5.31. MH-E is
218 known not to work with GNU Emacs versions 20 and below, and XEmacs
219 version 21.5.9--21.5.16. It is compatible with MH versions 6.8.4 and
220 higher, all versions of nmh, and GNU mailutils 1.0 and higher}, so you
221 shouldn't have to do anything special to use it. Gnus is also
222 required; version 5.10 or higher is recommended. This manual covers
223 MH-E version @value{VERSION}. To help you decide which version you
224 have, see @ref{Getting Started}.
225
226 @findex help-with-tutorial
227 @kindex C-h t
228
229 If you don't already use GNU Emacs but want to learn more, you can
230 read a built-in tutorial by starting GNU Emacs and typing @kbd{C-h t}
231 (@code{help-with-tutorial}). (To learn about this notation, see
232 @ref{Conventions}.) If you want to take the plunge, consult the
233 @iftex
234 @cite{GNU Emacs Manual},
235 @end iftex
236 @ifinfo
237 @ref{Top, , GNU Emacs Manual, emacs, GNU Emacs Manual},
238 @end ifinfo
239 @ifhtml
240 @uref{http://www.gnu.org/software/emacs/manual/html_node/emacs/,
241 @cite{GNU Emacs Manual}},
242 @end ifhtml
243 from the Free Software Foundation.
244
245 If more information is needed, you can go to the Unix manual pages of
246 the individual MH commands. When the name is not obvious, I'll guide
247 you to a relevant MH manual page that describes the action more fully.
248
249 @c ":" does not work in index entries in Info.
250 @cindex @cite{MH & nmh - Email for Users & Programmers}
251 @cindex MH book
252 @cindex info
253 @kindex C-h i
254
255 This manual is available in both Info and online formats. The Info
256 version is distributed with Emacs and can be accessed with the
257 @command{info} command (@samp{info mh-e}) or within Emacs (@kbd{C-h i
258 m mh-e @key{RET}}). The online version is available at
259 @uref{http://mh-e.sourceforge.net/manual/, SourceForge}. Another great
260 online resource is the book
261 @uref{http://rand-mh.sourceforge.net/book/, @cite{MH & nmh: Email for
262 Users & Programmers}} (also known as @dfn{the MH book}).
263
264 I hope you enjoy this manual! If you have any comments, or suggestions
265 for this document, please let me know.
266
267 @cindex Bill Wohler
268 @cindex Wohler, Bill
269
270 @noindent
271 Bill Wohler <@i{wohler at newt.com}>@*
272 8 February 1995@*
273 24 February 2006
274
275 @node Conventions, Getting Started, Preface, Top
276 @chapter GNU Emacs Terms and Conventions
277
278 @cindex Emacs
279 @cindex Emacs, conventions
280 @cindex Emacs, terms
281 @cindex Unix commands, Emacs
282 @cindex conventions, Emacs
283 @cindex terms, Emacs
284
285 If you're an experienced Emacs user, you can skip the following
286 conventions and definition of terms and go directly to the next
287 section (@pxref{Getting Started}).
288
289 @cindex Emacs commands
290 @cindex MH commands
291 @cindex Unix commands
292 @cindex commands
293 @cindex commands, MH
294 @cindex commands, Unix
295 @cindex commands, shell
296 @cindex functions
297 @cindex shell commands
298
299 In general, @dfn{functions} in this text refer to Emacs Lisp functions
300 that one would call from within Emacs Lisp programs (for example,
301 @code{(mh-inc-folder)}). On the other hand, @dfn{commands} are those
302 things that are run by the user, such as @kbd{i} or @kbd{M-x
303 mh-inc-folder}. Programs outside of Emacs are specifically called MH
304 commands, shell commands, or Unix commands.
305
306 @cindex conventions, key names
307 @cindex key names
308
309 The conventions for key names are as follows:
310
311 @table @kbd
312 @item C-x
313 Hold down the @key{CTRL} (Control) key and press the @kbd{x} key.
314 @c -------------------------
315 @item M-x
316 Hold down the @key{META} or @key{ALT} key and press the @kbd{x} key.
317
318 Since some keyboards don't have a @key{META} key, you can generate
319 @kbd{M-x}, for example, by pressing @key{ESC} (Escape),
320 @emph{releasing it}, and then pressing the @kbd{x} key.
321 @c -------------------------
322 @item @key{RET}
323 Press the @key{RETURN} or @key{ENTER} key. This is normally used to
324 complete a command.
325 @c -------------------------
326 @item @key{SPC}
327 Press the space bar.
328 @c -------------------------
329 @item @key{TAB}
330 Press the @key{TAB} key.
331 @c -------------------------
332 @item @key{DEL}
333 Press the @key{DELETE} key.
334 @c -------------------------
335 @item @key{BS}
336 Press the @key{BACKSPACE} key@footnote{If you are using Version 20 or
337 earlier of Emacs, you will need to use the @key{DEL} key.}.
338 @end table
339
340 @cindex Emacs, prefix argument
341 @cindex prefix argument
342 @kindex C-u
343
344 A @dfn{prefix argument} allows you to pass an argument to any Emacs
345 function. To pass an argument, type @kbd{C-u} before the Emacs command
346 or keystroke. Numeric arguments can be passed as well. For example, to
347 insert five f's, use @kbd{C-u 5 f}. There is a default of four when
348 using @kbd{C-u}, and you can use multiple prefix arguments to provide
349 arguments of powers of four. To continue our example, you could insert
350 four f's with @kbd{C-u f}, 16 f's with @kbd{C-u C-u f}, 64 f's with
351 @kbd{C-u C-u C-u f}, and so on. Numeric and valueless negative
352 arguments can also be inserted with the @key{META} key. Examples
353 include @kbd{M-5} to specify an argument of 5, or @kbd{M--} which
354 specifies a negative argument with no particular value.
355
356 @sp 1
357 @center @strong{NOTE}
358
359 @quotation
360 The prefix @kbd{C-u} or @kbd{M-} is not necessary in MH-E's MH-Folder
361 mode (@pxref{Reading Mail Tour}). In this mode, simply enter the
362 numerical argument before entering the command.
363 @end quotation
364 @sp 1
365
366 @cindex @file{.emacs}
367 @cindex Emacs, variables
368 @cindex files, @file{.emacs}
369 @cindex variables
370 @findex setq
371
372 Emacs uses @dfn{variables} to hold values. These can be changed via
373 calls to the function @code{setq} in @file{~/.emacs}.
374
375 @cindex Emacs, options
376 @cindex options
377 @findex customize-group
378 @findex customize-option
379
380 Variables in MH-E that are normally modified by the user are called
381 @dfn{options} and are modified through the customize functions (such
382 as @kbd{M-x customize-option} or @kbd{M-x customize-group}).
383 @ifnothtml
384 @xref{Easy Customization,,,emacs,The GNU Emacs Manual}, in @cite{The
385 GNU Emacs Manual}.
386 @end ifnothtml
387 @ifhtml
388 See section
389 @uref{http://www.gnu.org/software/emacs/manual/html_node/emacs/Easy-Customization.html,
390 Easy Customization} in @cite{The GNU Emacs Manual}.
391 @end ifhtml
392 @xref{Options}.
393
394 @cindex Emacs, faces
395 @cindex faces
396 @cindex highlighting
397 @findex customize-face
398
399 You can specify various styles for displaying text using @dfn{faces}.
400 MH-E provides a set of faces that you can use to personalize the look
401 of your MH-E buffers. Use the command @kbd{M-x customize-face} to do
402 this.
403 @ifnothtml
404 @xref{Face Customization,,,emacs,The GNU Emacs Manual}, in @cite{The
405 GNU Emacs Manual}.
406 @end ifnothtml
407 @ifhtml
408 See section
409 @uref{http://www.gnu.org/software/emacs/manual/html_node/emacs/Face-Customization.html,
410 Face Customization} in @cite{The GNU Emacs Manual}.
411 @end ifhtml
412
413 @cindex abnormal hooks
414 @cindex hooks
415 @cindex normal hooks
416 @findex add-hook
417 @findex customize-option
418
419 Commands often offer @dfn{hooks} which enable you to extend or modify
420 the way a command works.
421 @ifnothtml
422 @ref{Hooks, , Hooks, emacs, The GNU Emacs Manual}, in @cite{The GNU
423 Emacs Manual}
424 @end ifnothtml
425 @ifhtml
426 See section
427 @uref{http://www.gnu.org/software/emacs/manual/html_node/emacs/Hooks.html,
428 Hooks} in @cite{The GNU Emacs Manual}
429 @end ifhtml
430 for a description about @dfn{normal hooks} and @dfn{abnormal hooks}.
431 MH-E uses normal hooks in nearly all cases, so you can assume that we
432 are talking about normal hooks unless we explicitly mention that a
433 hook is abnormal. We also follow the conventions described in that
434 section: the name of the abnormal hooks end in @code{-functions} and all
435 the rest of the MH-E hooks end in @code{-hook}. You can add hooks with
436 either @code{customize-option} or @code{add-hook}.
437
438 @cindex Emacs, mark
439 @cindex Emacs, point
440 @cindex Emacs, region
441 @cindex mark
442 @cindex point
443 @cindex region
444 @kindex C-@@
445 @kindex C-@key{SPC}
446
447 There are several other terms that are used in Emacs that you should
448 know. The @dfn{point} is where the cursor currently is. You can save
449 your current place in the file by setting a @dfn{mark}. This operation
450 is useful in several ways. The mark can be later used when defining a
451 @dfn{region}, which is the text between the point and mark. Many
452 commands operate on regions, such as those for deleting text or
453 filling paragraphs. A mark can be set with @kbd{C-@@} (or
454 @kbd{C-@key{SPC}}).
455
456 @cindex completion
457 @cindex Emacs, completion
458 @cindex Emacs, file completion
459 @cindex Emacs, folder completion
460 @cindex Emacs, minibuffer
461 @cindex file completion
462 @cindex folder completion
463 @cindex minibuffer
464 @kindex SPC
465 @kindex TAB
466
467 The @dfn{minibuffer} is the bottom line of the Emacs window, where all
468 prompting and multiple-character input is directed. You can use
469 @dfn{completion} to enter values such as folders. Completion means
470 that Emacs fills in text for you when you type @key{SPC} or @key{TAB}.
471 A second @key{SPC} or @key{TAB} will list all possibilities at that
472 point.
473 @ifnothtml
474 @xref{Completion, , Completion, emacs, The GNU Emacs Manual}.
475 @end ifnothtml
476 @ifhtml
477 See the section
478 @uref{http://www.gnu.org/software/emacs/manual/html_node/emacs/Completion.html,
479 Completion} in @cite{The GNU Emacs Manual}.
480 @end ifhtml
481 Note that @key{SPC} cannot be used for completing filenames and
482 folders.
483
484 @findex help-with-tutorial
485 @kindex C-h t
486 @kindex M-x
487
488 The minibuffer is also where you enter Emacs function names after
489 typing @kbd{M-x}. For example, in the preface, I mentioned that you
490 could obtain help with @kbd{C-h t} (@code{help-with-tutorial}). What
491 this means is that you can get a tutorial by typing either @kbd{C-h t}
492 or @kbd{M-x help-with-tutorial}. In the latter case, you are prompted
493 for @samp{help-with-tutorial} in the minibuffer after typing
494 @kbd{M-x}.
495
496 @cindex ~
497
498 The @samp{~} notation in filenames represents your home directory.
499 This notation is used by many shells including @command{bash},
500 @code{tcsh}, and @command{csh}. It is analogous to the environment
501 variable @samp{$HOME}. For example, @file{~/.emacs} can be written
502 @file{$HOME/.emacs} or using the absolute path as in
503 @file{/home/wohler/.emacs} instead.
504
505 @cindex Emacs, interrupting
506 @cindex Emacs, quitting
507 @cindex interrupting
508 @cindex quitting
509
510 @i{In case of trouble:} Emacs can be interrupted at any time with
511 @kbd{C-g}. For example, if you've started a command that requests that
512 you enter something in the minibuffer, but then you change your mind,
513 type @kbd{C-g} and you'll be back where you started. If you want to
514 exit Emacs entirely, use @kbd{C-x C-c}.
515
516 @node Getting Started, Tour Through MH-E, Conventions, Top
517 @chapter Getting Started
518
519 @cindex MH-E, versions
520 @cindex history
521 @cindex versions of MH-E
522
523 Because there are many old versions of MH-E out there, it is important
524 to know which version you have. I'll be talking about @w{Version 8}
525 which is pretty close to @w{Version 6} and @w{Version 7}. It differs
526 from @w{Version 4} and @w{Version 5} and is vastly different from
527 @w{Version 3}. @xref{History}.
528
529 @findex mh-version
530
531 To determine which version of MH-E that you have, enter @kbd{M-x
532 mh-version @key{RET}}. Hopefully it says that you're running
533 @w{Version @value{VERSION}} which is the latest version as of this
534 printing.
535
536 If your version is much older than this, please consider upgrading.
537 You can have your system administrator upgrade the system-wide
538 version, or you can install your own personal version. It's really
539 quite easy. @xref{Getting MH-E}, for instructions for getting and
540 installing MH-E.
541
542 If the @code{mh-version} command displays @samp{No MH variant
543 detected}@footnote{In very old versions of MH-E, you may get the error
544 message, @samp{Cannot find the commands `inc' and `mhl' and the file
545 `components'} if MH-E can't find MH@. In this case, you need to update
546 MH-E, and you may need to install MH too. However, newer versions of
547 MH-E are better at finding MH if it is on your system.}, then you need
548 to install MH or tell MH-E where to find MH.
549
550 @cindex Debian
551 @cindex nmh
552 @cindex GNU mailutils MH
553
554 If you don't have MH on your system already, you must install a
555 variant of MH@. The Debian mh-e package does this for you
556 automatically (@pxref{Getting MH-E}). Most people use
557 @uref{http://www.nongnu.org/nmh/, nmh}, but you may be interested in
558 trying out @uref{http://mailutils.org/, GNU mailutils MH}, which
559 supports IMAP@. Your GNU/Linux distribution probably has packages for
560 both of these.
561
562 @cindex @command{install-mh}
563 @cindex MH commands, @command{install-mh}
564 @cindex MH book
565
566 If you've never run MH before, you need to run @command{install-mh}
567 from the shell before you continue. This sets up your personal MH
568 environment@footnote{See the section
569 @uref{@value{MH-BOOK-HOME}/../overall/setup.html, Setting Up MH} in the
570 MH book.}. If you don't, you'll be greeted with the error message:
571 @samp{Install MH and run install-mh before running MH-E}. This is all
572 you need to know about MH to use MH-E, but the more you know about MH,
573 the more you can leverage its power. See the
574 @uref{@value{MH-BOOK-HOME}/../, MH book} to learn more about MH.
575
576 @cindex @samp{Path} MH profile component
577 @cindex MH profile
578 @cindex MH profile component
579 @cindex MH profile component, @samp{Path}
580
581 Your MH environment includes your @dfn{MH profile} which is found in
582 the file @file{~/.mh_profile}, or the file named in the environment
583 variable @samp{$MH}. This file contains a number of @dfn{MH
584 profile components}. For example, the @samp{Path:} MH profile
585 component contains the path to your mail directory, which is
586 @file{~/Mail} by default.
587
588 @cindex @command{mhparam}
589 @cindex MH commands, @command{mhparam}
590 @vindex exec-path
591 @vindex mh-path
592 @vindex mh-sys-path
593 @vindex mh-variant
594 @vindex mh-variant-in-use
595
596 There are several options MH-E uses to interact with your MH
597 installation. The option @code{mh-variant} specifies the variant used
598 by MH-E (@pxref{Options}). The default setting of this option is
599 @samp{Auto-detect} which means that MH-E will automatically choose the
600 first of nmh, MH, or GNU mailutils MH that it finds in the directories
601 listed in @code{mh-path} (which you can customize),
602 @code{mh-sys-path}, and @code{exec-path}. If MH-E can't find MH at
603 all, you may have to customize @code{mh-path} and add the directory in
604 which the command @command{mhparam} is located. If, on the other hand,
605 you have both nmh and GNU mailutils MH installed (for example) and
606 @code{mh-variant-in-use} was initialized to nmh but you want to use
607 GNU mailutils MH, then you can set @code{mh-variant} to
608 @samp{gnu-mh}.
609
610 @vindex mh-flists-present-flag
611 @vindex mh-lib
612 @vindex mh-lib-progs
613 @vindex mh-progs
614
615 When @code{mh-variant} is changed, MH-E resets @code{mh-progs},
616 @code{mh-lib}, @code{mh-lib-progs}, @code{mh-flists-present-flag}, and
617 @code{mh-variant-in-use} accordingly.
618
619 @cindex @file{.emacs}
620 @cindex files, @file{.emacs}
621
622 @sp 1
623 @center @strong{NOTE}
624
625 @quotation
626 Prior to version 8, it was often necessary to set some of these
627 variables in @file{~/.emacs}; now it is no longer necessary and can
628 actually cause problems.
629 @end quotation
630 @sp 1
631
632 @cindex MH profile component, @samp{Draft-Folder}
633 @cindex MH profile component, @samp{Path}
634 @cindex MH profile component, @samp{Previous-Sequence}
635 @cindex MH profile component, @samp{Unseen-Sequence}
636 @cindex @samp{Draft-Folder} MH profile component
637 @cindex @samp{Path} MH profile component
638 @cindex @samp{Previous-Sequence} MH profile component
639 @cindex @samp{Unseen-Sequence} MH profile component
640 @findex mh-find-path
641 @vindex mh-draft-folder
642 @vindex mh-find-path-hook
643 @vindex mh-inbox
644 @vindex mh-previous-seq
645 @vindex mh-unseen-seq
646 @vindex mh-user-path
647
648 In addition to setting variables that point to MH itself, MH-E also
649 sets a handful of variables that point to where you keep your mail.
650 During initialization, the function @code{mh-find-path} sets
651 @code{mh-user-path} from your @samp{Path:} MH profile component (but
652 defaults to @samp{Mail} if one isn't present), @code{mh-draft-folder}
653 from @samp{Draft-Folder:}, @code{mh-unseen-seq} from
654 @samp{Unseen-Sequence:}, @code{mh-previous-seq} from
655 @samp{Previous-Sequence:}, and @code{mh-inbox} from @samp{Inbox:}
656 (defaults to @samp{+inbox}). The hook @code{mh-find-path-hook} is run
657 after these variables have been set. This hook can be used the change
658 the value of these variables if you need to run with different values
659 between MH and MH-E.
660
661 @node Tour Through MH-E, Using This Manual, Getting Started, Top
662 @chapter Tour Through MH-E
663
664 @cindex introduction
665 @cindex tour
666 @cindex tutorial
667
668 This chapter introduces some of the terms you'll need to know and then
669 takes you on a tour of MH-E@footnote{The keys mentioned in these
670 chapters refer to the default key bindings. If you've changed the
671 bindings, refer to the command summaries at the beginning of each
672 chapter for a mapping between default key bindings and function
673 names.}. When you're done, you'll be able to send, read, and file
674 mail, which is all that a lot of people ever do. But if you're the
675 curious or adventurous type, read the rest of the manual to be able to
676 use all the features of MH-E@. I suggest you read this chapter first to
677 get the big picture, and then you can read the manual as you wish.
678
679 @menu
680 * Sending Mail Tour::
681 * Reading Mail Tour::
682 * Processing Mail Tour::
683 * Leaving MH-E::
684 * More About MH-E::
685 @end menu
686
687 @node Sending Mail Tour, Reading Mail Tour, Tour Through MH-E, Tour Through MH-E
688 @section Sending Mail
689
690 @cindex MH-Letter mode
691 @cindex mode
692 @cindex modes, MH-Letter
693 @cindex sending mail
694 @findex mh-smail
695 @kindex M-x mh-smail
696
697 Let's start our tour by sending ourselves a message which we can later
698 read and process. Enter @kbd{M-x mh-smail} to invoke the MH-E program
699 to send messages. Your message appears in an Emacs buffer whose
700 mode@footnote{A @dfn{mode} changes Emacs to make it easier to edit a
701 particular type of text.} is MH-Letter.
702
703 Enter your login name in the @samp{To:} header field. Press the
704 @key{TAB} twice to move the cursor past the @samp{Cc:} field, since no
705 carbon copies are to be sent, and on to the @samp{Subject:} field.
706 Enter @kbd{Test} or anything else that comes to mind.
707
708 Press @key{TAB} again to move the cursor to the body of the message.
709 Enter some text, using normal Emacs commands. You should now have
710 something like this@footnote{If you're running Emacs under the X
711 Window System, then you would also see a menu bar and a tool bar. I've
712 left out the menu bar and tool bar in all of the example screens.}:
713
714 @cartouche
715 @smallexample
716
717
718
719
720
721
722 --:-- *scratch* All L1 (Lisp Interaction)-------------------------
723 To: wohler
724 cc:
725 Subject: Test
726 X-Mailer: MH-E 8.1; nmh 1.1; GNU Emacs 23.1
727 --------
728 This is a test message to get the wheels churning...#
729
730
731 --:** @{draft@} All L5 (MH-Letter)----------------------------------
732 Type C-c C-c to send message, C-C ? for help
733 @end smallexample
734 @end cartouche
735 @i{MH-E message composition window}
736
737 Note the line of dashes that separates the header and the body of the
738 message. It is essential that these dashes (or a blank line) are
739 present or the body of your message will be considered to be part of
740 the header.
741
742 @cindex help
743 @findex describe-mode
744 @kindex C-c ?
745 @kindex C-c C-c
746 @kindex C-h m
747
748 There are several commands specific to MH-Letter mode@footnote{You can
749 get quick help for the commands used most often with @kbd{C-c ?} or
750 more complete help with the @kbd{C-h m} (@code{describe-mode})
751 command.}, but at this time we'll only use @kbd{C-c C-c} to send your
752 message. Type @kbd{C-c C-c} now. That's all there is to it!
753
754 @node Reading Mail Tour, Processing Mail Tour, Sending Mail Tour, Tour Through MH-E
755 @section Receiving Mail
756
757 @cindex @command{inc}
758 @cindex @command{scan}
759 @cindex MH commands, @command{inc}
760 @cindex MH commands, @command{scan}
761 @cindex MH-Folder mode
762 @cindex modes, MH-Folder
763 @cindex reading mail
764 @findex mh-rmail
765 @kindex M-x mh-rmail
766
767 To read the mail you've just sent yourself, enter @kbd{M-x mh-rmail}.
768 This incorporates the new mail and puts the output from
769 @command{inc}@footnote{See the section
770 @uref{@value{MH-BOOK-HOME}/reapre.html, Reading Mail: inc show next
771 prev} in the MH book.} (called @dfn{scan lines} after the MH program
772 @command{scan}@footnote{See the section
773 @uref{@value{MH-BOOK-HOME}/faswsprs.html, Find and Specify with scan
774 pick Ranges Sequences} in the MH book.} which prints a one-line
775 summary of each message) into a buffer called @samp{+inbox} whose
776 major mode is MH-Folder.
777
778 @findex mh-rmail
779 @kindex F r
780 @kindex M-x mh-rmail
781
782 @sp 1
783 @center @strong{NOTE}
784
785 @quotation
786
787 The @kbd{M-x mh-rmail} command will show you only new mail, not mail
788 you have already read. If you were to run this tour again, you would
789 use @kbd{F r} to pull all your messages into MH-E.
790 @end quotation
791 @sp 1
792
793 @kindex @key{RET}
794 @kindex n
795 @kindex p
796
797 You should see the scan line for your message, and perhaps others. Use
798 @kbd{n} or @kbd{p} to move the cursor to your test message and type
799 @key{RET} to read your message. You should see something like:
800
801 @cartouche
802 @smallexample
803 3 t08/24 root received fax files on Wed Aug 24 11:00:13 PDT 1
804 # 4+t08/24 To:wohler Test<<This is a test message to get the wheels
805
806 -:%% @{+inbox/select@} 4 msgs (1-4) Bot L4 (MH-Folder Show)---------
807 To: wohler
808 Subject: Test
809 X-Mailer: MH-E 8.1; nmh 1.1; GNU Emacs 23.1
810 Date: Fri, 17 Mar 2006 10:49:11 -0800
811 From: Bill Wohler <wohler@@stop.mail-abuse.org>
812
813 This is a test message to get the wheels churning...
814
815
816
817 --:-- @{show-+inbox@} 4 All L1 (MH-Show)----------------------------
818
819 @end smallexample
820 @end cartouche
821 @i{After incorporating new messages}
822
823 @kindex @key{DEL}
824 @kindex @key{SPC}
825
826 If you typed a long message, you can view subsequent pages with
827 @key{SPC} and previous pages with @key{DEL}.
828
829 @node Processing Mail Tour, Leaving MH-E, Reading Mail Tour, Tour Through MH-E
830 @section Processing Mail
831
832 @cindex processing mail
833 @kindex @key{RET}
834 @kindex r
835
836 The first thing we want to do is reply to the message that we sent
837 ourselves. Ensure that the cursor is still on the same line as your
838 test message and type @kbd{r}. You are prompted in the minibuffer with
839 @samp{Reply to whom:}. Here MH-E is asking whether you'd like to reply
840 to the original sender only, to the sender and primary recipients, or
841 to the sender and all recipients. You can press @key{TAB} to see these
842 choices. If you simply press @key{RET}, you'll reply only to the
843 sender. Press @key{RET} now.
844
845 You'll find yourself in an Emacs buffer similar to that when you were
846 sending the original message, like this:
847
848 @cartouche
849 @smallexample
850 To:
851 cc:
852 Subject: Re: Test
853 In-reply-to: <31054.1142621351@@stop.mail-abuse.org>
854 References: <31054.1142621351@@stop.mail-abuse.org>
855 Comments: In-reply-to Bill Wohler <wohler@@stop.mail-abuse.org>
856 message dated "Fri, 17 Mar 2006 10:49:11 -0800."
857 X-Mailer: MH-E 8.1; nmh 1.1; GNU Emacs 23.1
858 --------
859 #
860
861 --:-- @{draft@} All L10 (MH-Letter)----------------------------------
862 To: wohler
863 Subject: Test
864 X-Mailer: MH-E 8.1; nmh 1.1; GNU Emacs 23.1
865 Date: Fri, 17 Mar 2006 10:49:11 -0800
866 From: Bill Wohler <wohler@@stop.mail-abuse.org>
867
868 This is a test message to get the wheels churning...
869
870 --:-- @{show-+inbox@} 4 All L1 (MH-Show)----------------------------
871 Type C-c C-c to send message, C-c ? for help
872 @end smallexample
873 @end cartouche
874 @i{Composition window during reply}
875
876 @findex backward-char
877 @findex forward-char
878 @findex next-line
879 @findex previous-line
880 @kindex C-b
881 @kindex C-c C-c
882 @kindex C-c C-f C-t
883 @kindex C-f
884 @kindex C-n
885 @kindex C-p
886 @kindex @key{BS}
887
888 By default, MH will not add you to the address list of your replies,
889 so if you find that the @samp{To:} header field is missing, don't
890 worry. In this case, type @kbd{C-c C-f C-t} to create and go to the
891 @samp{To:} field, where you can type your login name again. You can
892 move around with the arrow keys or with @kbd{C-p}
893 (@code{previous-line}), @kbd{C-n} (@code{next-line}), @kbd{C-b}
894 (@code{backward-char}), and @kbd{C-f} (@code{forward-char}) and can
895 delete the previous character with @key{BS}. When you're finished
896 editing your message, send it with @kbd{C-c C-c} as before.
897
898 @cindex @command{refile}
899 @cindex MH commands, @command{refile}
900 @cindex folders
901 @kindex @key{SPC}
902 @kindex o
903
904 You'll often want to save messages that were sent to you in an
905 organized fashion. This is done with @dfn{folders}. You can use
906 folders to keep messages from your friends, or messages related to a
907 particular topic. With your cursor in the MH-Folder buffer and
908 positioned on the message you sent to yourself, type @kbd{o} to output
909 (@command{refile} in MH parlance) that message to a folder. Enter
910 @kbd{test} at the @samp{Destination folder:} prompt and type @kbd{y}
911 (or @key{SPC}) when MH-E asks to create the folder @samp{+test}. Note
912 that a @samp{^} (caret) appears next to the message number, which
913 means that the message has been marked for refiling but has not yet
914 been refiled. We'll talk about how the refile is actually carried out
915 in a moment.
916
917 @cindex MH-Folder mode
918 @cindex modes, MH-Folder
919 @kindex d
920 @kindex i
921 @kindex @key{RET}
922 @kindex n
923 @kindex p
924 @kindex x
925
926 Your previous reply is now waiting in the system mailbox. You
927 incorporate this mail into your MH-Folder buffer named @samp{+inbox}
928 with the @kbd{i} command. Do this now. After the mail is incorporated,
929 use @kbd{n} or @kbd{p} to move the cursor to the new message, and read
930 it with @key{RET}. Let's delete this message by typing @kbd{d}. Note
931 that a @samp{D} appears next to the message number. This means that
932 the message is marked for deletion but is not yet deleted. To perform
933 the deletion (and the refile we did previously), use the @kbd{x}
934 command.
935
936 @findex mh-smail
937 @kindex m
938 @kindex M-x mh-smail
939
940 If you want to send another message you can use @kbd{m} instead of
941 @kbd{M-x mh-smail}. So go ahead, send some mail to your friends!
942
943 @cindex help
944 @cindex prefix characters
945 @findex describe-mode
946 @kindex ?
947 @kindex C-h m
948 @kindex F ?
949
950 You can get a quick reminder about these commands by typing @kbd{?}.
951 This lists several @dfn{prefix characters}. To list the commands
952 available via the prefix characters, type the prefix character
953 followed by a @kbd{?}, for example, @kbd{F ?}. More complete help is
954 available with the @kbd{C-h m} (@code{describe-mode}) command.
955
956 @node Leaving MH-E, More About MH-E, Processing Mail Tour, Tour Through MH-E
957 @section Leaving MH-E
958
959 @cindex Emacs, quitting
960 @cindex quitting
961 @kindex C-x C-c
962 @kindex x
963
964 You may now wish to exit @command{emacs} entirely. Use @kbd{C-x C-c}
965 to exit @command{emacs}. If you exited without running @kbd{x} in the
966 @samp{+inbox} buffer, Emacs will offer to save it for you. Type
967 @kbd{y} or @key{SPC} to save @samp{+inbox} changes, which means to
968 perform any refiles and deletes that you did there.
969
970 @findex mh-rmail
971 @kindex C-x b
972 @kindex C-x k
973 @kindex M-x mh-rmail
974 @kindex q
975
976 If you don't want to leave Emacs, you can type @kbd{q} to bury (hide)
977 the MH-E folder or delete it entirely with @kbd{C-x k}. You can then
978 later recall it with @kbd{C-x b} or @kbd{M-x mh-rmail}.
979
980 @cindex @command{packf}
981 @cindex MH commands, @command{packf}
982 @cindex exporting folders
983 @cindex folders, exporting
984 @cindex mbox-style folder
985
986 On the other hand, if you no longer want to use MH and MH-E, you can
987 take your mail with you. You can copy all of your mail into a single
988 file, mbox-style, by using the MH command @command{packf}. For
989 example, to create a file called @file{msgbox} with the messages in
990 your @samp{+inbox} folder, use @samp{packf +inbox}. The
991 @command{packf} command will append the messages to the file if it
992 already exists, so you can use @samp{folders -recurse -fast} in a
993 script to copy all of your messages into a single file, or using the
994 @samp{-file} argument, a file for each folder.
995
996 @node More About MH-E, , Leaving MH-E, Tour Through MH-E
997 @section More About MH-E
998
999 These are the basic commands to get you going, but there are plenty
1000 more. If you think that MH-E is for you, read the rest of the manual
1001 to find out how you can:
1002
1003 @itemize @bullet
1004 @item
1005 Print your messages (@pxref{Printing}).
1006 @c -------------------------
1007 @item
1008 Edit messages and include your signature (@pxref{Editing Drafts}).
1009 @c -------------------------
1010 @item
1011 Forward messages (@pxref{Forwarding}).
1012 @c -------------------------
1013 @item
1014 Read digests (@pxref{Digests}).
1015 @c -------------------------
1016 @item
1017 Edit bounced messages (@pxref{Editing Again}).
1018 @c -------------------------
1019 @item
1020 Send multimedia messages (@pxref{Adding Attachments}).
1021 @c -------------------------
1022 @item
1023 Read HTML messages (@pxref{HTML}).
1024 @c -------------------------
1025 @item
1026 Use aliases and identities (see @ref{Aliases}, @pxref{Identities}).
1027 @c -------------------------
1028 @item
1029 Create different views of your mail (see @ref{Threading}, @pxref{Limits}).
1030 @c -------------------------
1031 @item
1032 Deal with junk mail (@pxref{Junk}).
1033 @c -------------------------
1034 @item
1035 Handle signed and encrypted messages (see @ref{Reading PGP},
1036 @pxref{Sending PGP}).
1037 @c -------------------------
1038 @item
1039 Process mail that was sent with @command{shar} or @command{uuencode}
1040 (@pxref{Files and Pipes}).
1041 @c -------------------------
1042 @item
1043 Use sequences conveniently (@pxref{Sequences}).
1044 @c -------------------------
1045 @item
1046 Use the speedbar, tool bar, and menu bar (see @ref{Speedbar}, see @ref{Tool
1047 Bar}, @pxref{Menu Bar}).
1048 @c -------------------------
1049 @item
1050 Show header fields in different fonts (@pxref{Reading Mail}).
1051 @c -------------------------
1052 @item
1053 Find previously refiled messages (@pxref{Searching}).
1054 @c -------------------------
1055 @item
1056 Place messages in a file (@pxref{Files and Pipes}).
1057 @end itemize
1058
1059 Remember that you can also use MH commands when you're not running
1060 MH-E (and when you are!).
1061
1062 @node Using This Manual, Incorporating Mail, Tour Through MH-E, Top
1063 @chapter Using This Manual
1064
1065 This chapter begins the meat of the manual which goes into more detail
1066 about every MH-E command and option.
1067
1068 @cindex Emacs, info
1069 @cindex Emacs, built-in help
1070 @cindex info
1071 @cindex built-in help
1072 @findex describe-mode
1073 @findex mh-help
1074 @kindex ?
1075 @kindex C-c ?
1076 @kindex C-h C-h
1077 @kindex C-h C-k i
1078 @kindex C-h i
1079 @kindex C-h m
1080
1081 There are many commands, but don't get intimidated. There are command
1082 summaries at the beginning of each chapter. In case you have or would
1083 like to rebind the keys, the command summaries also list the
1084 associated Emacs Lisp function. Furthermore, even if you're stranded
1085 on a desert island with a laptop and are without your manuals, you can
1086 get a summary of all these commands with GNU Emacs built-in help: use
1087 @kbd{C-h m} (@code{describe-mode}) for a brief summary of commands,
1088 @kbd{?} (@code{mh-help}) for an even briefer summary@footnote{This
1089 help appears in a buffer called @file{*MH-E Help*}
1090 (@pxref{Miscellaneous}).} (@kbd{C-c ?} in MH-Letter mode), or @kbd{C-h
1091 i} to read this manual via Info. The built-in help is quite good; try
1092 running @kbd{C-h C-h}. This brings up a list of available help topics,
1093 one of which displays the documentation for a given key (like @kbd{C-h
1094 k C-n}). Another useful help feature is to view the manual section
1095 that describes a given key (such as @kbd{C-h K i}). In addition,
1096 review @ref{Conventions}, if any of the GNU Emacs conventions are
1097 strange to you.
1098
1099 In addition to all of the commands, it is also possible to reconfigure
1100 MH-E to fit the needs of even the most demanding user. The following
1101 chapters also describe all of the options, show the defaults, and make
1102 recommendations for customization.
1103
1104 However, when customizing your mail environment, first try to change
1105 what you want in MH, and only change MH-E if changing MH is not
1106 possible. That way you will get the same behavior inside and outside
1107 GNU Emacs. Note that MH-E does not provide hooks for customizations
1108 that can be done in MH; this omission is intentional.
1109
1110 @cindex Emacs Lisp Manual
1111 @cindex Emacs, Emacs Lisp Manual
1112 @cindex Emacs, info
1113 @cindex Emacs, online help
1114 @cindex info
1115 @cindex online help
1116
1117 I hope I've included enough examples here to get you well on your way.
1118 If you want to explore Emacs Lisp further, a programming manual does
1119 exist,
1120 @c Yes, some of the stuff in the following sections is redundant, but
1121 @c TeX barfs if the @ifs are inside the @footnote.
1122 @iftex
1123 @footnote{The @cite{GNU Emacs Lisp Reference Manual} should be available
1124 via the Info system by typing @kbd{C-h i m Emacs Lisp
1125 @key{RET}}. It is also available online at @*
1126 @uref{http://www.gnu.org/software/emacs/manual/elisp.html}.}
1127 @end iftex
1128 @ifinfo
1129 @footnote{@xref{Top, The GNU Emacs Lisp Reference Manual, , elisp, GNU
1130 Emacs Lisp Reference Manual}, which should be available via the
1131 Info system. It is also available online at
1132 @uref{http://www.gnu.org/software/emacs/manual/elisp.html}.}
1133 @end ifinfo
1134 @ifhtml
1135 @footnote{The
1136 @uref{http://www.gnu.org/software/emacs/manual/elisp.html,
1137 The GNU Emacs Lisp Reference Manual} should be available via
1138 the Info system by typing @kbd{C-h i m Emacs Lisp @key{RET}}.}
1139 @end ifhtml
1140 and you can look at the code itself for examples. Look in the Emacs
1141 Lisp directory on your system (such as
1142 @file{/usr/local/share/emacs/lisp/mh-e}) and find all the @file{mh-*.el}
1143 files there. When calling MH-E and other Emacs Lisp functions directly
1144 from Emacs Lisp code, you'll need to know the correct arguments. Use
1145 the built-in help for this. For example, try @kbd{C-h f
1146 mh-execute-commands @key{RET}}. If you write your own functions,
1147 please do not prefix your symbols (variables and functions) with
1148 @samp{mh-}. This prefix is reserved for the MH-E package. To avoid
1149 conflicts with existing MH-E symbols, use a prefix like @samp{my-} or
1150 your initials. (Unless, of course, your initials happen to be @emph{mh}!)
1151
1152 @menu
1153 * Options::
1154 * Ranges::
1155 * Folder Selection::
1156 @end menu
1157
1158 @node Options, Ranges, Using This Manual, Using This Manual
1159 @section Options
1160
1161 @cindex Emacs, customizing
1162 @cindex Emacs, setting options
1163 @cindex customizing MH-E
1164 @cindex setting options
1165 @findex customize-option
1166 @vindex mh-lpr-command-format, example
1167
1168 Many string or integer options are easy to modify using @kbd{M-x
1169 customize-option}. For example, to modify the option that controls
1170 printing, you would run @kbd{M-x customize-option @key{RET}
1171 mh-lpr-command-format @key{RET}}. In the buffer that appears, modify
1172 the string to the right of the variable. For example, you may change
1173 the @command{lpr} command with @samp{nenscript -G -r -2 -i'%s'}. Then
1174 use the @samp{State} combo box and select @samp{Save for Future
1175 Sessions}. To read more about @code{mh-lpr-command-format}, see
1176 @ref{Printing}.
1177
1178 @cindex nil
1179 @cindex off, option
1180 @cindex on, option
1181 @cindex option, turning on and off
1182 @cindex t
1183 @findex customize-option
1184 @vindex mh-bury-show-buffer-flag, example
1185
1186 Options can also hold boolean values. In Emacs Lisp, the boolean
1187 values are @code{nil}, which means false, and @code{t}, which means
1188 true. The @code{customize-option} function makes it easy to change
1189 boolean values; simply click on the toggle button in the customize
1190 buffer to switch between @samp{on} (@code{t}) and @samp{off}
1191 (@code{nil}). For example, try setting @code{mh-bury-show-buffer-flag}
1192 to @samp{off} to keep the MH-Show buffer at the top of the buffer
1193 stack. Use the @samp{State} combo box and choose @samp{Set for Current
1194 Session} to see how the option affects the show buffer. Then choose
1195 the @samp{Erase Customization} menu item to reset the option to the
1196 default, which places the MH-Show buffer at the bottom of the buffer
1197 stack.
1198
1199 @vindex mh-mhl-format-file, example
1200
1201 The text usually says to turn on an option by setting it to a
1202 @emph{non-@code{nil}} value, because sometimes values other than
1203 @samp{on} are meaningful. An example of this is the variable
1204 @code{mh-mhl-format-file} (@pxref{Viewing}). Other options, such as
1205 hooks, involve a little more Emacs Lisp programming expertise.
1206
1207 @cindex customization group, @samp{mh}
1208 @cindex @samp{mh} customization group
1209 @findex customize-group
1210 @findex mh-customize
1211
1212 You can browse all of the MH-E options with the @code{customize-group}
1213 function. Try entering @kbd{M-x customize-group @key{RET} mh
1214 @key{RET}} to view the top-level options as well as buttons for all of
1215 the MH-E customization groups. Another way to view the MH-E
1216 customization group is to use @kbd{M-x mh-customize @key{RET}}.
1217
1218 @node Ranges, Folder Selection, Options, Using This Manual
1219 @section Ranges
1220
1221 @c Sync with mh-folder-mode docstring.
1222
1223 @cindex message abbreviations
1224 @cindex message ranges
1225 @cindex ranges
1226
1227 Many commands that operate on individual messages, such as
1228 @code{mh-forward} or @code{mh-refile-msg} take a @code{RANGE}
1229 argument. This argument can be used in several ways.
1230
1231 @kindex C-u, with ranges
1232
1233 If you provide the prefix argument @kbd{C-u} to these commands, then
1234 you will be prompted for the message range. This can be any valid MH
1235 range which can include messages, sequences (@pxref{Sequences}), and
1236 the abbreviations (described in the @command{mh}(1) man page):
1237
1238 @table @samp
1239 @item <num1>-<num2>
1240 Indicates all messages in the range <num1> to <num2>, inclusive. The
1241 range must be nonempty.
1242 @c -------------------------
1243 @item <num>:N
1244 @itemx <num>:+N
1245 @itemx <num>:-N
1246 Up to N messages beginning with (or ending with) message num. Num may
1247 be any of the predefined symbols: first, prev, cur, next or last.
1248 @c -------------------------
1249 @item first:N
1250 @itemx prev:N
1251 @itemx next:N
1252 @itemx last:N
1253 The first, previous, next or last messages, if they exist.
1254 @c -------------------------
1255 @item all
1256 All of the messages.
1257 @end table
1258
1259 For example, a range that shows all of these things is @samp{1 2 3
1260 5-10 last:5 unseen}.
1261
1262 @vindex transient-mark-mode
1263
1264 If the option @code{transient-mark-mode} is turned on and you set a
1265 region in the MH-Folder buffer, then the MH-E command will perform the
1266 operation on all messages in that region.
1267
1268 @cindex @samp{mh-range} customization group
1269 @cindex customization group, @samp{mh-range}
1270
1271 The @samp{mh-range} customization group contains a single option which
1272 affects how ranges are interpreted.
1273
1274 @vtable @code
1275 @item mh-interpret-number-as-range-flag
1276 On means interpret a number as a range (default: @samp{on}).
1277 @end vtable
1278
1279 @vindex mh-interpret-number-as-range-flag
1280
1281 Since one of the most frequent ranges used is @samp{last:N}, MH-E will
1282 interpret input such as @samp{200} as @samp{last:200} if the
1283 @code{mh-interpret-number-as-range-flag} option is on (which is the
1284 default). If you need to scan just the message 200, then use the range
1285 @samp{200:1} or @samp{200-200}.
1286
1287 @node Folder Selection, , Ranges, Using This Manual
1288 @section Folder Selection
1289
1290 @cindex completion, folders
1291 @cindex folders, completion
1292 @cindex folders, selecting
1293
1294 When you choose a folder in MH-E via a command such as @kbd{o}
1295 (@code{mh-refile-msg}), completion is used to enter the folder
1296 @ifnothtml
1297 (@pxref{Completion, , , emacs, The GNU Emacs Manual}).
1298 @end ifnothtml
1299 @ifhtml
1300 (see the section
1301 @uref{http://www.gnu.org/software/emacs/manual/html_node/emacs/Completion.html,
1302 Completion} in @cite{The GNU Emacs Manual}).
1303 @end ifhtml
1304 In addition, MH-E has several ways of choosing a suitable default so
1305 that the folder can often be selected with a single @key{RET} key.
1306
1307 @cindex customization group, @samp{mh-folder-selection}
1308 @cindex @samp{mh-folder-selection} customization group
1309
1310 The @samp{mh-folder-selection} customization group contains some
1311 options which are used to help with this.
1312
1313 @vtable @code
1314 @item mh-default-folder-for-message-function
1315 Function to select a default folder for refiling or @samp{Fcc:}
1316 (default: @code{nil}).
1317 @c -------------------------
1318 @item mh-default-folder-list
1319 List of addresses and folders (default: @code{nil}).
1320 @c -------------------------
1321 @item mh-default-folder-must-exist-flag
1322 On means guessed folder name must exist to be used (default:
1323 @samp{on}).
1324 @c -------------------------
1325 @item mh-default-folder-prefix
1326 Prefix used for folder names generated from aliases (default: @code{""}).
1327 @end vtable
1328
1329 @vindex mh-default-folder-for-message-function
1330
1331 You can set the option @code{mh-default-folder-for-message-function}
1332 to a function that provides a default folder for the message to be
1333 refiled. When this function is called, the current buffer contains the
1334 message being refiled and point is at the start of the message. This
1335 function should return the default folder as a string with a leading
1336 @samp{+} sign. It can also return @code{nil} so that the last folder
1337 name is used as the default, or an empty string to suppress the
1338 default entirely.
1339
1340 Otherwise, the name of the destination folder is derived from the
1341 sender as follows:
1342
1343 @enumerate
1344 @vindex mh-default-folder-list
1345 @item
1346 The folder name associated with the first address found in the list
1347 @code{mh-default-folder-list} is used. Each element in this list
1348 contains a @samp{Check Recipient} item. If this item is turned on,
1349 then the address is checked against the recipient instead of the
1350 sender. This is useful for mailing lists.
1351 @c -------------------------
1352 @vindex mh-default-folder-prefix
1353 @item
1354 An alias prefixed by @code{mh-default-folder-prefix} corresponding to
1355 the address is used. The prefix is used to prevent clutter in your
1356 mail directory. @xref{Aliases}.
1357 @end enumerate
1358
1359 @vindex mh-default-folder-must-exist-flag
1360
1361 If the derived folder does not exist, and
1362 @code{mh-default-folder-must-exist-flag} is @code{t}, then the last
1363 folder name used is suggested. This is useful if you get mail from
1364 various people for whom you have an alias, but file them all in the
1365 same project folder.
1366
1367 @node Incorporating Mail, Reading Mail, Using This Manual, Top
1368 @chapter Incorporating Your Mail
1369
1370 @cindex @samp{Folder} menu
1371 @cindex incorporating
1372 @cindex menu, @samp{Folder}
1373
1374 This chapter talks about getting mail from your system mailbox into
1375 your MH @samp{+inbox} folder. The following command accomplishes that
1376 and is found in the @samp{Folder} menu.
1377
1378 @table @kbd
1379 @cindex @samp{Folder > Incorporate New Mail} menu item
1380 @cindex menu item, @samp{Folder > Incorporate New Mail}
1381 @findex mh-inc-folder
1382 @kindex i
1383 @item i
1384 Incorporate new mail into a folder (@code{mh-inc-folder}).
1385 @end table
1386
1387 @cindex @samp{mh-inc} customization group
1388 @cindex customization group, @samp{mh-inc}
1389
1390 The following options in the @samp{mh-inc} customization group are
1391 used.
1392
1393 @vtable @code
1394 @item mh-inc-prog
1395 Program to incorporate mail (default: @code{"inc"}).
1396 @c -------------------------
1397 @item mh-inc-spool-list
1398 Alternate spool files (default: @code{nil}).
1399 @end vtable
1400
1401 The following hook is available.
1402
1403 @vtable @code
1404 @findex mh-inc-folder
1405 @item mh-inc-folder-hook
1406 Hook run by @code{mh-inc-folder} after incorporating mail into a
1407 folder (default: @code{nil}).
1408 @end vtable
1409
1410 @cindex @samp{+inbox}
1411 @findex mh-inc-folder
1412 @kindex i
1413
1414 If at any time you receive new mail, incorporate the new mail into
1415 your @samp{+inbox} buffer with @kbd{i} (@code{mh-inc-folder}). Note
1416 that @kbd{i} will display the @samp{+inbox} buffer, even if there
1417 isn't any new mail. You can incorporate mail from any file into the
1418 current folder by specifying a prefix argument; you'll be prompted for
1419 the name of the file to use as well as the destination folder (for
1420 example, @kbd{C-u i ~/mbox @key{RET} +tmp @key{RET}}).
1421
1422 @cindex @file{.emacs}
1423 @cindex Emacs, notification of new mail
1424 @cindex files, @file{.emacs}
1425 @cindex new mail
1426 @cindex notification of new mail
1427
1428 Emacs can notify you when you have new mail by displaying @samp{Mail}
1429 in the mode line. To enable this behavior, and to have a clock in the
1430 mode line as well, add the following to @file{~/.emacs}:
1431
1432 @findex display-time
1433
1434 @smalllisp
1435 (display-time)
1436 @end smalllisp
1437
1438 @cindex @command{inc}
1439 @cindex incorporating
1440 @cindex MH commands, @command{inc}
1441 @vindex mh-inc-prog
1442 @vindex mh-progs
1443
1444 The name of the program that incorporates new mail is stored in
1445 @code{mh-inc-prog}; it is @code{"inc"} by default. This program
1446 generates a one-line summary for each of the new messages. Unless it
1447 is an absolute pathname, the file is assumed to be in the
1448 @code{mh-progs} directory (@pxref{Getting Started}). You may also link
1449 a file to @command{inc} that uses a different format (see
1450 @samp{mh-profile}(5), and sections
1451 @uref{@value{MH-BOOK-HOME}/reapre.html, Reading Mail: inc show next
1452 prev} and @uref{@value{MH-BOOK-HOME}/mhstr.html, MH Format Strings} in
1453 the MH book). You'll then need to modify several variables
1454 appropriately (@pxref{Scan Line Formats}).
1455
1456 @vindex mh-inc-spool-list
1457
1458 You can use the @code{mh-inc-spool-list} variable to direct MH-E to
1459 retrieve mail from arbitrary spool files other than your system
1460 mailbox, file it in folders other than your @samp{+inbox}, and assign
1461 key bindings to incorporate this mail.
1462
1463 @cindex @command{procmail}
1464 @cindex @file{.procmailrc}
1465 @cindex Unix commands, @command{procmail}
1466 @cindex files, @file{.procmailrc}
1467
1468 Suppose you are subscribed to the @i{mh-e-devel} mailing list and you
1469 use @command{procmail} to filter this mail into @file{~/mail/mh-e}
1470 with the following recipe in @file{.procmailrc}:
1471
1472 @smallexample
1473 PATH=$PATH:/usr/bin/mh
1474 MAILDIR=$HOME/`mhparam Path`
1475 :0:
1476 * ^From mh-e-devel-admin@@stop.mail-abuse.org
1477 mh-e
1478 @end smallexample
1479
1480 @findex mh-inc-spool-*
1481 @kindex I *
1482
1483 In order to incorporate @file{~/mail/mh-e} into @samp{+mh-e} with an
1484 @kbd{I m} (@code{mh-inc-spool-mh-e}) command, customize this option,
1485 and click on the @samp{INS} button. Enter a @samp{Spool File} of
1486 @samp{~/mail/mh-e}, a @samp{Folder} of @samp{mh-e}, and a @samp{Key
1487 Binding} of @samp{m}.
1488
1489 @cindex @command{emacsclient}
1490 @cindex @command{gnuclient}
1491 @cindex @command{xbuffy}
1492 @cindex @samp{gnuserv}
1493 @cindex Unix commands, @command{emacsclient}
1494 @cindex Unix commands, @command{gnuclient}
1495 @cindex Unix commands, @command{xbuffy}
1496
1497 You can use @command{xbuffy} to automate the incorporation of this
1498 mail using the Emacs 23 command @command{emacsclient} as follows:
1499
1500 @smallexample
1501 box ~/mail/mh-e
1502 title mh-e
1503 origMode
1504 polltime 10
1505 headertime 0
1506 command emacsclient --eval '(mh-inc-spool-mh-e)'
1507 @end smallexample
1508
1509 In XEmacs, the command @command{gnuclient} is used in a similar
1510 fashion.
1511
1512 @findex mh-inc-folder
1513 @kindex i
1514 @vindex mh-inc-folder-hook
1515
1516 You can set the hook @code{mh-inc-folder-hook}, which is called after
1517 new mail is incorporated by the @kbd{i} (@code{mh-inc-folder})
1518 command. A good use of this hook is to rescan the whole folder either
1519 after running @kbd{M-x mh-rmail} the first time or when you've changed
1520 the message numbers from outside of MH-E.
1521
1522 @findex mh-execute-commands
1523 @findex mh-rescan-folder, example
1524 @findex mh-show, example
1525 @vindex mh-inc-folder-hook, example
1526
1527 @smalllisp
1528 @group
1529 (defun my-mh-inc-folder-hook ()
1530 "Hook to rescan folder after incorporating mail."
1531 (if (buffer-modified-p) ; @r{if outstanding refiles and deletes,}
1532 (mh-execute-commands)) ; @r{carry them out}
1533 (mh-rescan-folder) ; @r{synchronize with +inbox}
1534 (mh-show)) ; @r{show the current message}
1535
1536 (add-hook 'mh-inc-folder-hook 'my-mh-inc-folder-hook)
1537
1538 @i{Rescan folder after incorporating new mail via mh-inc-folder-hook}
1539
1540 @end group
1541 @end smalllisp
1542
1543 @node Reading Mail, Folders, Incorporating Mail, Top
1544 @chapter Reading Your Mail
1545
1546 @cindex @samp{+inbox}
1547 @cindex MH-Folder mode
1548 @cindex MH-Show mode
1549 @cindex modes, MH-Folder
1550 @cindex modes, MH-Show
1551 @cindex reading mail
1552 @findex mh-rmail
1553 @kindex F r
1554 @kindex F v
1555 @kindex M-x mh-rmail
1556
1557 The MH-E entry point for reading mail is @kbd{M-x mh-rmail}. This
1558 command incorporates your mail and creates a buffer called
1559 @samp{+inbox} in MH-Folder mode. The command @kbd{M-x mh-rmail} shows
1560 you only new mail, not mail you have already read@footnote{If you want
1561 to see your old mail as well, use @kbd{F r} to pull all your messages
1562 into MH-E@. Or, give a prefix argument to @code{mh-rmail} so it will
1563 prompt you for folder to visit like @kbd{F v} (for example, @kbd{C-u
1564 M-x mh-rmail @key{RET} bob @key{RET}}). @xref{Folders}.}.
1565
1566 @findex display-time
1567 @vindex read-mail-command
1568
1569 There are some commands that need to read mail, such as @kbd{mouse-2}
1570 over the @samp{Mail} button that @code{display-time} adds to the mode
1571 line. You can configure Emacs to have these commands use MH-E by
1572 setting the option @code{read-mail-command} to @samp{mh-rmail}.
1573
1574 @cindex @command{scan}
1575 @cindex @samp{Message} menu
1576 @cindex MH commands, @command{scan}
1577 @cindex menu, @samp{Message}
1578 @cindex scan lines
1579
1580 The @samp{+inbox} buffer contains @dfn{scan lines}, which are one-line
1581 summaries of each incorporated message. You can perform most MH
1582 commands on these messages via one- or two-letter commands in either
1583 the MH-Folder or MH-Show buffers or by using the @samp{Message} menu.
1584 See @command{scan}(1) for a description of the contents of the scan
1585 lines, and see the Figure in @ref{Reading Mail Tour}, for an example.
1586
1587 @table @kbd
1588 @kindex ?
1589 @findex mh-help
1590 @item ?
1591 Display cheat sheet for the MH-E commands (@code{mh-help}).
1592 @c -------------------------
1593 @cindex @samp{Message > Show Message} menu item
1594 @cindex menu item, @samp{Message > Show Message}
1595 @kindex @key{RET}
1596 @findex mh-show
1597 @item @key{RET}
1598 Display message (@code{mh-show}).
1599 @c -------------------------
1600 @cindex @samp{Message > Show Message with Header} menu item
1601 @cindex menu item, @samp{Message > Show Message with Header}
1602 @kindex , (comma)
1603 @findex mh-header-display
1604 @item , (comma)
1605 Display message with all header fields (@code{mh-header-display}).
1606 @c -------------------------
1607 @cindex @samp{Message > Show Message with Preferred Alternative} menu item
1608 @cindex menu item, @samp{Message > Show Message with Preferred Alternative}
1609 @kindex : (colon)
1610 @findex mh-show-preferred-alternative
1611 @item : (colon)
1612 Display message with the default preferred alternative
1613 (@code{mh-show-preferred-alternative}).
1614 @c -------------------------
1615 @kindex ; (semicolon)
1616 @findex mh-toggle-mh-decode-mime-flag
1617 @item ; (semicolon)
1618 Toggle the value of @code{mh-decode-mime-flag}
1619 (@code{mh-toggle-mh-decode-mime-flag}).
1620 @c -------------------------
1621 @kindex @key{SPC}
1622 @findex mh-page-msg
1623 @item @key{SPC}
1624 Display next page in message (@code{mh-page-msg}).
1625 @c -------------------------
1626 @kindex @key{BS}
1627 @findex mh-previous-page
1628 @item @key{BS}
1629 Display previous page in message (@code{mh-previous-page}).
1630 @c -------------------------
1631 @cindex @samp{Message > Write Message to File...} menu item
1632 @cindex menu item, @samp{Message > Write Message to File...}
1633 @kindex >
1634 @findex mh-write-msg-to-file
1635 @item >
1636 Append message to end of file (@code{mh-write-msg-to-file}).
1637 @c -------------------------
1638 @cindex @samp{Message > Pipe Message to Command...} menu item
1639 @cindex menu item, @samp{Message > Pipe Message to Command...}
1640 @kindex |
1641 @findex mh-pipe-msg
1642 @item |
1643 Pipe message through shell command (@code{mh-pipe-msg}).
1644 @c -------------------------
1645 @kindex C-d
1646 @findex mh-delete-msg-no-motion
1647 @item C-d
1648 Delete range, don't move to next message
1649 (@code{mh-delete-msg-no-motion}).
1650 @c -------------------------
1651 @cindex @samp{Message > Delete Message} menu item
1652 @cindex menu item, @samp{Message > Delete Message}
1653 @kindex d
1654 @findex mh-delete-msg
1655 @item d
1656 Delete range (@code{mh-delete-msg}).
1657 @c -------------------------
1658 @kindex D ?
1659 @findex mh-prefix-help
1660 @item D ?
1661 Display cheat sheet for the commands of the current prefix in
1662 minibuffer (@code{mh-prefix-help}).
1663 @c -------------------------
1664 @kindex D @key{SPC}
1665 @findex mh-page-digest
1666 @item D @key{SPC}
1667 Display next message in digest (@code{mh-page-digest}).
1668 @c -------------------------
1669 @kindex D @key{BS}
1670 @findex mh-page-digest-backwards
1671 @item D @key{BS}
1672 Display previous message in digest (@code{mh-page-digest-backwards}).
1673 @c -------------------------
1674 @cindex @samp{Message > Burst Digest Message} menu item
1675 @cindex menu item, @samp{Message > Burst Digest Message}
1676 @kindex D b
1677 @findex mh-burst-digest
1678 @item D b
1679 Break up digest into separate messages (@code{mh-burst-digest}).
1680 @c -------------------------
1681 @cindex @samp{Message > Go to Message by Number...} menu item
1682 @cindex menu item, @samp{Message > Go to Message by Number...}
1683 @kindex g
1684 @findex mh-goto-msg
1685 @item g
1686 Go to a message (@code{mh-goto-msg}).
1687 @c -------------------------
1688 @kindex k
1689 @findex mh-delete-subject-or-thread
1690 @item k
1691 Delete messages with same subject or thread
1692 (@code{mh-delete-subject-or-thread}).
1693 @c -------------------------
1694 @kindex K ?
1695 @findex mh-prefix-help
1696 @item K ?
1697 Display cheat sheet for the commands of the current prefix in
1698 minibuffer (@code{mh-prefix-help}).
1699 @c -------------------------
1700 @kindex K @key{TAB}
1701 @findex mh-next-button
1702 @item K @key{TAB}
1703 Go to the next button (@code{mh-next-button}).
1704 @c -------------------------
1705 @kindex K S-@key{TAB}
1706 @findex mh-prev-button
1707 @item K S-@key{TAB}
1708 Go to the previous button (@code{mh-prev-button}).
1709 @c -------------------------
1710 @kindex K a
1711 @findex mh-mime-save-parts
1712 @item K a
1713 Save attachments (@code{mh-mime-save-parts}).
1714 @c -------------------------
1715 @kindex K e
1716 @findex mh-display-with-external-viewer
1717 @item K e
1718 View attachment externally (@code{mh-display-with-external-viewer}).
1719 @c -------------------------
1720 @kindex K i
1721 @findex mh-folder-inline-mime-part
1722 @item K i
1723 Show attachment verbatim (@code{mh-folder-inline-mime-part}).
1724 @c -------------------------
1725 @kindex K o
1726 @findex mh-folder-save-mime-part
1727 @item K o
1728 Save (output) attachment (@code{mh-folder-save-mime-part}).
1729 @c -------------------------
1730 @kindex K t
1731 @findex mh-toggle-mime-buttons
1732 @item K t
1733 Toggle option @code{mh-display-buttons-for-inline-parts-flag}
1734 (@code{mh-toggle-mime-buttons}).
1735 @c -------------------------
1736 @kindex K v
1737 @findex mh-folder-toggle-mime-part
1738 @item K v
1739 View attachment (@code{mh-folder-toggle-mime-part}).
1740 @c -------------------------
1741 @cindex @samp{Message > Modify Message} menu item
1742 @cindex menu item, @samp{Message > Modify Message}
1743 @kindex M
1744 @findex mh-modify
1745 @item M
1746 Edit message (@code{mh-modify}).
1747 @c -------------------------
1748 @cindex @samp{Message > Go to First Message} menu item
1749 @cindex menu item, @samp{Message > Go to First Message}
1750 @kindex M-<
1751 @findex mh-first-msg
1752 @item M-<
1753 Display first message (@code{mh-first-msg}).
1754 @c -------------------------
1755 @cindex @samp{Message > Go to Last Message} menu item
1756 @cindex menu item, @samp{Message > Go to Last Message}
1757 @kindex M->
1758 @findex mh-last-msg
1759 @item M->
1760 Display last message (@code{mh-last-msg}).
1761 @c -------------------------
1762 @kindex M-n
1763 @findex mh-next-unread-msg
1764 @item M-n
1765 Display next unread message (@code{mh-next-unread-msg}).
1766 @c -------------------------
1767 @kindex M-p
1768 @findex mh-previous-unread-msg
1769 @item M-p
1770 Display previous unread message (@code{mh-previous-unread-msg}).
1771 @c -------------------------
1772 @cindex @samp{Message > Next Message} menu item
1773 @cindex menu item, @samp{Message > Next Message}
1774 @kindex n
1775 @findex mh-next-undeleted-msg
1776 @item n
1777 Display next message (@code{mh-next-undeleted-msg}).
1778 @c -------------------------
1779 @cindex @samp{Message > Previous Message} menu item
1780 @cindex menu item, @samp{Message > Previous Message}
1781 @kindex p
1782 @findex mh-previous-undeleted-msg
1783 @item p
1784 Display previous message (@code{mh-previous-undeleted-msg}).
1785 @c -------------------------
1786 @kindex P ?
1787 @findex mh-prefix-help
1788 @item P ?
1789 Display cheat sheet for the commands of the current prefix in
1790 minibuffer (@code{mh-prefix-help}).
1791 @c -------------------------
1792 @kindex P C
1793 @findex mh-ps-print-toggle-color
1794 @item P C
1795 Toggle whether color is used in printing messages
1796 (@code{mh-ps-print-toggle-color}).
1797 @c -------------------------
1798 @kindex P F
1799 @findex mh-ps-print-toggle-faces
1800 @item P F
1801 Toggle whether printing is done with faces or not
1802 (@code{mh-ps-print-toggle-faces}).
1803 @c -------------------------
1804 @kindex P f
1805 @findex mh-ps-print-msg-file
1806 @item P f
1807 Print range to file (@code{mh-ps-print-msg-file}).
1808 @c -------------------------
1809 @cindex @samp{Message > Print Message} menu item
1810 @cindex menu item, @samp{Message > Print Message}
1811 @kindex P l
1812 @findex mh-print-msg
1813 @item P l
1814 Print range the old fashioned way
1815 (@code{mh-print-msg}).
1816 @c -------------------------
1817 @kindex P p
1818 @findex mh-ps-print-msg
1819 @item P p
1820 Print range (@code{mh-ps-print-msg}).
1821 @c -------------------------
1822 @kindex X ?
1823 @findex mh-prefix-help
1824 @item X ?
1825 Display cheat sheet for the commands of the current prefix in
1826 minibuffer (@code{mh-prefix-help}).
1827 @c -------------------------
1828 @cindex @samp{Message > Unpack Uuencoded Message...} menu item
1829 @cindex menu item, @samp{Message > Unpack Uuencoded Message...}
1830 @kindex X s
1831 @kindex X u
1832 @findex mh-store-msg
1833 @item X s
1834 @itemx X u
1835 Unpack message created with @command{uudecode} or @command{shar}
1836 (@code{mh-store-msg}).
1837 @c -------------------------
1838 @kindex mouse-2
1839 @findex mh-show-mouse
1840 @item mouse-2
1841 Move point to mouse event and show message (@code{mh-show-mouse}).
1842 @end table
1843
1844 Within the MH-Show buffer, the following command is defined.
1845
1846 @table @kbd
1847 @kindex @key{RET}
1848 @kindex mouse-1
1849 @kindex mouse-2
1850 @findex mh-press-button
1851 @item @key{RET}
1852 @itemx mouse-1
1853 @itemx mouse-2
1854 View contents of button (@code{mh-press-button}).
1855 @end table
1856
1857 @cindex @samp{mh-show} customization group
1858 @cindex customization group, @samp{mh-show}
1859
1860 The following table lists options in the @samp{mh-show} customization
1861 group that are used while reading mail.
1862
1863 @vtable @code
1864 @item mh-bury-show-buffer-flag
1865 On means show buffer is buried (default: @samp{on}).
1866 @c -------------------------
1867 @item mh-clean-message-header-flag
1868 On means remove extraneous header fields (default: @samp{on}).
1869 @c -------------------------
1870 @item mh-decode-mime-flag
1871 On means attachments are handled (default: @samp{on} if the Gnus
1872 @samp{mm-decode} package is present).
1873 @c -------------------------
1874 @item mh-display-buttons-for-alternatives-flag
1875 On means display buttons for all alternative attachments (default:
1876 @samp{off}).
1877 @c -------------------------
1878 @item mh-display-buttons-for-inline-parts-flag
1879 On means display buttons for all inline attachments (default:
1880 @samp{off}).
1881 @c -------------------------
1882 @item mh-do-not-confirm-flag
1883 On means non-reversible commands do not prompt for confirmation
1884 (default: @samp{off}).
1885 @c -------------------------
1886 @item mh-fetch-x-image-url
1887 Control fetching of @samp{X-Image-URL:} header field image (default:
1888 @samp{Never Fetch}).
1889 @c -------------------------
1890 @item mh-graphical-smileys-flag
1891 On means graphical smileys are displayed (default: @samp{on}).
1892 @c -------------------------
1893 @item mh-graphical-emphasis-flag
1894 On means graphical emphasis is displayed (default: @samp{on}).
1895 @c -------------------------
1896 @item mh-highlight-citation-style
1897 Style for highlighting citations (default: @samp{Multicolor}).
1898 @c -------------------------
1899 @item mh-invisible-header-fields-default
1900 List of hidden header fields (default: a checklist too long to list
1901 here).
1902 @c -------------------------
1903 @item mh-invisible-header-fields
1904 Additional header fields to hide (default: @code{nil}).
1905 @c -------------------------
1906 @item mh-lpr-command-format
1907 Command used to print (default: @code{"lpr -J '%s'"}).
1908 @c -------------------------
1909 @item mh-max-inline-image-height
1910 Maximum inline image height if @samp{Content-Disposition:} is not
1911 present (default: 0).
1912 @c -------------------------
1913 @item mh-max-inline-image-width
1914 Maximum inline image width if @samp{Content-Disposition:} is not
1915 present(default: 0).
1916 @c -------------------------
1917 @item mh-mhl-format-file
1918 Specifies the format file to pass to the @command{mhl} program
1919 (default: @samp{Use Default mhl Format (Printing Only)}).
1920 @c -------------------------
1921 @item mh-mime-save-parts-default-directory
1922 Default directory to use for @kbd{K a}.
1923 @c -------------------------
1924 @item mh-print-background-flag
1925 On means messages should be printed in the background (default:
1926 @samp{off}).
1927 @c -------------------------
1928 @item mh-show-buffer-mode-line-buffer-id
1929 Format string to produce @code{mode-line-buffer-identification} for
1930 show buffers (default: @code{" @{show-%s@} %d"}).
1931 @c -------------------------
1932 @item mh-show-maximum-size
1933 Maximum size of message (in bytes) to display automatically (default:
1934 0).
1935 @c -------------------------
1936 @item mh-show-use-xface-flag
1937 On means display face images in MH-Show buffers (default: @samp{on}).
1938 @c -------------------------
1939 @item mh-store-default-directory
1940 Default directory for @kbd{X s} (default: @samp{Current}).
1941 @c -------------------------
1942 @item mh-summary-height
1943 Number of lines in MH-Folder buffer (including the mode line)
1944 (default: depends on size of frame).
1945 @end vtable
1946
1947 The following hooks are available.
1948
1949 @vtable @code
1950 @item mh-delete-msg-hook
1951 Hook run after marking each message for deletion (default: @code{nil}).
1952 @c -------------------------
1953 @item mh-show-hook
1954 Hook run after @key{RET} shows a message (default: @code{nil}).
1955 @c -------------------------
1956 @item mh-show-mode-hook
1957 Hook run upon entry to @code{mh-show-mode} (default: @code{nil}).
1958 @end vtable
1959
1960 The following faces are available.
1961
1962 @vtable @code
1963 @item mh-show-cc
1964 Face used to highlight @samp{cc:} header fields.
1965 @c -------------------------
1966 @item mh-show-date
1967 Face used to highlight @samp{Date:} header fields.
1968 @c -------------------------
1969 @item mh-show-from
1970 Face used to highlight @samp{From:} header fields.
1971 @c -------------------------
1972 @item mh-show-header
1973 Face used to deemphasize less interesting header fields.
1974 @c -------------------------
1975 @item mh-show-pgg-bad
1976 Bad PGG signature face.
1977 @c -------------------------
1978 @item mh-show-pgg-good
1979 Good PGG signature face.
1980 @c -------------------------
1981 @item mh-show-pgg-unknown
1982 Unknown or untrusted PGG signature face.
1983 @c -------------------------
1984 @item mh-show-signature
1985 Signature face.
1986 @c -------------------------
1987 @item mh-show-subject
1988 Face used to highlight @samp{Subject:} header fields.
1989 @c -------------------------
1990 @item mh-show-to
1991 Face used to highlight @samp{To:} header fields.
1992 @c -------------------------
1993 @item mh-show-xface
1994 X-Face image face.
1995 @end vtable
1996
1997 The functions and variables introduced here are explained in more
1998 detail in the following sections.
1999
2000 @menu
2001 * Viewing::
2002 * Viewing Attachments::
2003 * HTML::
2004 * Digests::
2005 * Reading PGP::
2006 * Printing::
2007 * Files and Pipes::
2008 * Navigating::
2009 * Miscellaneous Commands and Options::
2010 @end menu
2011
2012 @node Viewing, Viewing Attachments, Reading Mail, Reading Mail
2013 @section Viewing Your Mail
2014
2015 @findex mh-header-display
2016 @findex mh-page-msg
2017 @findex mh-previous-page
2018 @findex mh-show
2019 @findex mh-show-mouse
2020 @kindex , (comma)
2021 @kindex . (period)
2022 @kindex @key{BS}
2023 @kindex @key{RET}
2024 @kindex @key{SPC}
2025 @kindex mouse-2
2026
2027 The command @key{RET} (@code{mh-show}) displays the message that the
2028 cursor is on while @kbd{mouse-2} (@code{mh-show-mouse}) displays the
2029 message that the mouse cursor is on. If the message is already
2030 displayed, it scrolls to the beginning of the message. Use @key{SPC}
2031 (@code{mh-page-msg}) and @key{BS} (@code{mh-previous-page}) to move
2032 forwards and backwards one page at a time through the message. You can
2033 give either of these commands a prefix argument that specifies the
2034 number of lines to scroll (such as @kbd{10 @key{SPC}}). The @key{SPC}
2035 command will also show the next undeleted message if it is used at the
2036 bottom of a message. MH-E normally hides a lot of the superfluous
2037 header fields that mailers add to a message, but if you wish to see
2038 all of them, use the command @kbd{,} (comma;
2039 @code{mh-header-display}).
2040
2041 @vindex mh-show-maximum-size
2042
2043 The option @code{mh-show-maximum-size} provides an opportunity to skip
2044 over large messages which may be slow to load. The default value of 0
2045 means that all message are shown regardless of size.
2046
2047 A litany of options control what displayed messages look like.
2048
2049 @vindex mh-show-cc
2050 @vindex mh-show-date
2051 @vindex mh-show-from
2052 @vindex mh-show-header
2053 @vindex mh-show-subject
2054 @vindex mh-show-to
2055
2056 First, the appearance of the header fields can be modified by
2057 customizing the associated face: @code{mh-show-to}, @code{mh-show-cc},
2058 @code{mh-show-from}, @code{mh-show-date}, and @code{mh-show-subject}.
2059 The face @code{mh-show-header} is used to deemphasize the other, less
2060 interesting, header fields.
2061
2062 @cindex regular expressions, @code{mh-invisible-header-fields}
2063 @vindex mh-clean-message-header-flag
2064 @vindex mh-invisible-header-fields
2065 @vindex mh-invisible-header-fields-default
2066
2067 Normally messages are delivered with a handful of uninteresting header
2068 fields. These are hidden by turning on the option
2069 @code{mh-clean-message-header-flag} (which it is by default). The
2070 header fields listed in the option
2071 @code{mh-invisible-header-fields-default} are hidden, although you can
2072 check off any field that you would like to see. Header fields that you
2073 would like to hide that aren't listed can be added to the option
2074 @code{mh-invisible-header-fields} with a couple of caveats. Regular
2075 expressions are not allowed. Unique fields should have a @samp{:}
2076 suffix; otherwise, the element can be used to render invisible an
2077 entire class of fields that start with the same prefix. If you think a
2078 header field should be generally ignored, please update
2079 @uref{https://sourceforge.net/p/mh-e/bugs/245/, SF #245}.
2080
2081 @cindex header field, @samp{Face}
2082 @cindex header field, @samp{X-Face}
2083 @cindex header field, @samp{X-Image-URL}
2084 @cindex @samp{Face} header field
2085 @cindex @samp{X-Face} header field
2086 @cindex @samp{X-Image-URL} header field
2087 @vindex mh-show-use-xface-flag
2088
2089 MH-E can display the content of @samp{Face:}, @samp{X-Face:}, and
2090 @samp{X-Image-URL:} header fields. If any of these fields occur in the
2091 header of your message, the sender's face will appear in the
2092 @samp{From:} header field. If more than one of these fields appear,
2093 then the first field found in the order @samp{Face:}, @samp{X-Face:},
2094 and @samp{X-Image-URL:} will be used. The option
2095 @code{mh-show-use-xface-flag} is used to turn this feature on and off.
2096 This feature will be turned on by default if your system supports it.
2097
2098 The first header field used, if present, is the Gnus-specific
2099 @samp{Face:} field@footnote{The @samp{Face:} field appeared in GNU
2100 Emacs 21 and XEmacs. For more information, see
2101 @uref{http://quimby.gnus.org/circus/face/}.}.
2102
2103 @cindex @command{uncompface}
2104 @cindex Emacs, packages, x-face
2105 @cindex Unix commands, @command{uncompface}
2106 @cindex x-face package
2107 @vindex mh-show-xface
2108
2109 Next is the traditional @samp{X-Face:} header field@footnote{The
2110 display of this field requires the
2111 @uref{ftp://ftp.cs.indiana.edu/pub/faces/compface/compface.tar.Z,
2112 @command{uncompface} program}. Recent versions of XEmacs have internal
2113 support for @samp{X-Face:} images. If your version of XEmacs does not,
2114 then you'll need both @command{uncompface} and the
2115 @uref{ftp://ftp.jpl.org/pub/elisp/, @samp{x-face} package}.}. MH-E
2116 renders the foreground and background of the image using the
2117 associated attributes of the face @code{mh-show-xface}.
2118
2119 @cindex @command{convert}
2120 @cindex @command{wget}
2121 @cindex ImageMagick
2122 @cindex Unix commands, @command{convert}
2123 @cindex Unix commands, @command{wget}
2124 @vindex mh-fetch-x-image-url
2125
2126 Finally, MH-E will display images referenced by the
2127 @samp{X-Image-URL:} header field if neither the @samp{Face:} nor the
2128 @samp{X-Face:} fields are present@footnote{The display of the images
2129 requires the @uref{http://www.gnu.org/software/wget/wget.html,
2130 @command{wget} program} to fetch the image and the @command{convert}
2131 program from the @uref{http://www.imagemagick.org/script/index.php,
2132 ImageMagick suite}.}. Of the three header fields this is the most
2133 efficient in terms of network usage since the image doesn't need to be
2134 transmitted with every single mail. The option
2135 @code{mh-fetch-x-image-url} controls the fetching of the
2136 @samp{X-Image-URL:} header field image with the following values:
2137
2138 @table @samp
2139 @item Ask Before Fetching
2140 You are prompted before the image is fetched. MH-E will remember your
2141 reply and will either use the already fetched image the next time the
2142 same URL is encountered or silently skip it if you didn't fetch it the
2143 first time. This is a good setting.
2144 @c -------------------------
2145 @item Never Fetch
2146 Images are never fetched and only displayed if they are already
2147 present in the cache. This is the default.
2148 @end table
2149
2150 There isn't a value of @samp{Always Fetch} for privacy and DOS (denial
2151 of service) reasons. For example, fetching a URL can tip off a spammer
2152 that you've read his email (which is why you shouldn't blindly answer
2153 yes if you've set this option to @samp{Ask Before Fetching}). Someone
2154 may also flood your network and fill your disk drive by sending a
2155 torrent of messages, each specifying a unique URL to a very large
2156 file.
2157
2158 @cindex @file{.mhe-x-image-cache}
2159 @cindex files, @file{.mhe-x-image-cache}
2160
2161 The cache of images is found in the directory
2162 @file{.mhe-x-image-cache} within your MH directory. You can add your
2163 own face to the @samp{From:} field too. @xref{Picture}.
2164
2165 @cindex @command{mhl}
2166 @cindex MH commands, @command{mhl}
2167 @vindex mh-mhl-format-file
2168
2169 Normally MH-E takes care of displaying messages itself (rather than
2170 calling an MH program to do the work). If you'd rather have
2171 @command{mhl} display the message (within MH-E), change the option
2172 @code{mh-mhl-format-file} from its default value of @samp{Use Default
2173 mhl Format (Printing Only)}. You can set this option to @samp{Use
2174 Default mhl Format} to get the same output as you would get if you ran
2175 @command{mhl} from the shell. If you have a format file that you want
2176 MH-E to use, you can set this option to @samp{Specify an mhl Format
2177 File} and enter the name of your format file (@command{mhl}(1) or
2178 section @uref{@value{MH-BOOK-HOME}/shomes.html#Usisho, Using mhl} in
2179 the MH book tells you how to write one). Your format file should
2180 specify a non-zero value for @samp{overflowoffset} to allow MH-E to
2181 parse the header. Note that @command{mhl} is always used for printing
2182 and forwarding; in this case, the value of @code{mh-mhl-format-file}
2183 is consulted if you have specified a format file.
2184
2185 @cindex citations, highlighting
2186 @cindex highlighting citations
2187 @vindex mh-highlight-citation-style
2188
2189 If the sender of the message has cited other messages in his message,
2190 then MH-E will highlight these citations to emphasize the sender's
2191 actual response. The option @code{mh-highlight-citation-style} can be
2192 customized to change the highlighting style. The @samp{Multicolor}
2193 method uses a different color for each indentation while the
2194 @samp{Monotone} method highlights all citations in red. To disable
2195 highlighting of citations entirely, choose @samp{None}.
2196
2197 @cindex URLs, highlighting
2198 @cindex email addresses, highlighting
2199 @cindex highlighting URLs
2200 @cindex highlighting email addresses
2201 @cindex links, following
2202 @findex goto-address-at-point
2203 @kindex C-c @key{RET}
2204 @kindex mouse-2
2205 @vindex goto-address-highlight-p
2206
2207 Email addresses and URLs in the message are highlighted if the option
2208 @code{goto-address-highlight-p} is on, which it is by default. To view
2209 the web page for a highlighted URL or to send a message using a
2210 highlighted email address, use @kbd{mouse-2} or @kbd{C-c @key{RET}}
2211 (@code{goto-address-at-point}). @xref{Sending Mail}, to see how to
2212 configure Emacs to send the message using MH-E.
2213
2214 @cindex boldface, showing
2215 @cindex emphasis
2216 @cindex italics, showing
2217 @cindex smileys
2218 @cindex typesetting
2219 @cindex underline, showing
2220 @vindex gnus-emphasis-alist
2221 @vindex mh-decode-mime-flag
2222 @vindex mh-graphical-emphasis-flag
2223 @vindex mh-graphical-smileys-flag
2224
2225 It is a long standing custom to inject body language using a
2226 cornucopia of punctuation, also known as the @dfn{smileys}. MH-E can
2227 render these as graphical widgets if the option
2228 @code{mh-graphical-smileys-flag} is turned on, which it is by default.
2229 Smileys include patterns such as :-) and ;-). Similarly, a few
2230 typesetting features are indicated in ASCII text with certain
2231 characters. If your terminal supports it, MH-E can render these
2232 typesetting directives naturally if the option
2233 @code{mh-graphical-emphasis-flag} is turned on, which it is by
2234 default. For example, _underline_ will be
2235 @ifhtml
2236 @html
2237 <u>underlined</u>,
2238 @end html
2239 @end ifhtml
2240 @ifnothtml
2241 underlined,
2242 @end ifnothtml
2243 *bold* will appear in @b{bold}, /italics/ will appear in @i{italics},
2244 and so on. See the option @code{gnus-emphasis-alist} for the whole
2245 list. Both of these options are disabled if the option
2246 @code{mh-decode-mime-flag} is turned off. @xref{Viewing Attachments}.
2247
2248 @cindex signature separator
2249 @cindex vCard
2250 @vindex mh-show-signature
2251
2252 MH-E normally renders signatures and vCards in italics so that the
2253 body of the message stands out more. MH-E depends on the presence of
2254 the @dfn{signature separator} (@code{"-- "}) to do this. You can also
2255 customize the face @code{mh-show-signature} so the appearance of the
2256 signature block is more to your liking.
2257
2258 @vindex mh-show-hook
2259 @vindex mh-show-mode-hook
2260
2261 Two hooks can be used to control how messages are displayed. The first
2262 hook, @code{mh-show-mode-hook}, is called early on in the process of
2263 the message display. It is usually used to perform some action on the
2264 message's content. The second hook, @code{mh-show-hook}, is the last
2265 thing called after messages are displayed. It's used to affect the
2266 behavior of MH-E in general or when @code{mh-show-mode-hook} is too
2267 early.
2268
2269 @cindex MH-Show mode
2270 @cindex modes, MH-Show
2271 @vindex mh-show-buffer-mode-line-buffer-id
2272
2273 For those who like to modify their mode lines, use
2274 @code{mh-show-buffer-mode-line-buffer-id} to modify the mode line in
2275 the MH-Show buffers. Place the two escape strings @samp{%s} and
2276 @samp{%d}, which will display the folder name and the message number,
2277 respectively, somewhere in the string in that order. The default value
2278 of @code{"@{show-%s@} %d"} yields a mode line of
2279
2280 @smallexample
2281 -----@{show-+inbox@} 4 (MH-Show)--Bot--------------------------------
2282 @end smallexample
2283
2284 @node Viewing Attachments, HTML, Viewing, Reading Mail
2285 @section Viewing Attachments
2286
2287 @cindex attachments
2288 @cindex body parts
2289 @cindex @command{mhshow}
2290 @cindex @command{show}
2291 @cindex MH commands, @command{mhshow}
2292 @cindex MH commands, @command{show}
2293 @cindex MIME
2294 @cindex multimedia mail
2295
2296 MH has the ability to display @dfn{@sc{mime}} (Multipurpose Internet
2297 Mail Extensions) messages which are simply messages with additional
2298 @dfn{body parts} or @dfn{attachments}. You can use the MH commands
2299 @command{show}@footnote{See the section
2300 @uref{@value{MH-BOOK-HOME}/reapre.html, Reading Mail: inc show next
2301 prev} in the MH book.} or @command{mhshow}@footnote{See the section
2302 @uref{@value{MH-BOOK-HOME}/usimim.html#ReMIMa, Reading MIME Mail} in
2303 the MH book.} from the shell to read @sc{mime} messages@footnote{You
2304 can call them directly from Emacs if you're running the X Window
2305 System: type @kbd{M-! xterm -e mhshow @var{message-number}}. You can
2306 leave out the @samp{xterm -e} if you use @command{mhlist} or
2307 @command{mhstore}.}.
2308
2309 @cindex Emacs, packages, mm-decode
2310 @cindex mm-decode package
2311 @findex mh-toggle-mh-decode-mime-flag
2312 @kindex ; (semicolon)
2313 @vindex mh-decode-mime-flag
2314
2315 MH-E can handle attachments as well if the Gnus @samp{mm-decode}
2316 package is present. If so, the option @code{mh-decode-mime-flag} will
2317 be on. Otherwise, you'll see the @sc{mime} body parts rather than text
2318 or attachments. There isn't much point in turning off the option
2319 @code{mh-decode-mime-flag}; however, you can inspect it if it appears
2320 that the body parts are not being interpreted correctly or toggle it
2321 with the command @kbd{;} (semicolon;
2322 @code{mh-toggle-mh-decode-mime-flag}) to view the raw message. This
2323 option also controls the display of quoted-printable messages and
2324 other graphical widgets. @xref{Viewing}.
2325
2326 @cindex buttons
2327
2328 Attachments in MH-E are indicated by @dfn{buttons} like this:
2329
2330 @smallexample
2331 [1. image/jpeg; foo.jpg]...
2332 @end smallexample
2333
2334 @findex mh-next-button
2335 @findex mh-press-button
2336 @findex mh-prev-button
2337 @kindex @key{RET}
2338 @kindex K @key{TAB}
2339 @kindex K S-@key{TAB}
2340 @kindex mouse-1
2341 @kindex mouse-2
2342
2343 To view the contents of the button, use either @kbd{mouse-1} or
2344 @kbd{mouse-2} on the button or @key{RET} (@code{mh-press-button}) when
2345 the cursor is over the button. This command is a toggle so if you use
2346 it again on the same attachment, it is hidden. If Emacs does not know
2347 how to display the attachment, then Emacs offers to save the
2348 attachment in a file. To move the cursor to the next button, use the
2349 command @kbd{K @key{TAB}} (@code{mh-next-button}). If the end of the
2350 buffer is reached then the search wraps over to the start of the
2351 buffer. To move the cursor to the previous button, use the command
2352 @kbd{K S-@key{TAB}} (@code{mh-prev-button}). If the beginning of the
2353 buffer is reached then the search wraps over to the end of the buffer.
2354
2355 @cindex attachments, viewing
2356 @cindex viewing attachments
2357 @findex mh-folder-toggle-mime-part
2358 @kindex K v
2359
2360 Another way to view the contents of a button is to use the command
2361 @kbd{K v} (@code{mh-folder-toggle-mime-part}). This command displays
2362 (or hides) the attachment associated with the button under the cursor.
2363 If the cursor is not located over a button, then the cursor first
2364 moves to the next button, wrapping to the beginning of the message if
2365 necessary. This command has the advantage over the previous commands
2366 of working from the MH-Folder buffer. You can also provide a numeric
2367 prefix argument (as in @kbd{4 K v}) to view the attachment labeled
2368 with that number. If Emacs does not know how to display the
2369 attachment, then Emacs offers to save the attachment in a file.
2370
2371 @cindex @file{/etc/mailcap}
2372 @cindex files, @file{/etc/mailcap}
2373 @findex mailcap-mime-info
2374 @findex mh-display-with-external-viewer
2375 @kindex K e
2376
2377 If Emacs does not know how to view an attachment, you could save it
2378 into a file and then run some program to open it. It is easier,
2379 however, to launch the program directly from MH-E with the command
2380 @kbd{K e} (@code{mh-display-with-external-viewer}). While you'll most
2381 likely use this to view spreadsheets and documents, it is also useful
2382 to use your browser to view HTML attachments with higher fidelity than
2383 what Emacs can provide. This command displays the attachment
2384 associated with the button under the cursor. If the cursor is not
2385 located over a button, then the cursor first moves to the next button,
2386 wrapping to the beginning of the message if necessary. You can provide
2387 a numeric prefix argument (as in @kbd{4 K e}) to view the attachment
2388 labeled with that number. This command tries to provide a reasonable
2389 default for the viewer by calling the Emacs function
2390 @code{mailcap-mime-info}. This function usually reads the file
2391 @file{/etc/mailcap}.
2392
2393 @cindex attachments, saving
2394 @cindex saving attachments
2395 @findex mh-folder-save-mime-part
2396 @kindex K o
2397
2398 Use the command @kbd{K o} (@code{mh-folder-save-mime-part}) to save
2399 attachments (the mnemonic is ``output''). This command saves the
2400 attachment associated with the button under the cursor. If the cursor
2401 is not located over a button, then the cursor first moves to the next
2402 button, wrapping to the beginning of the message if necessary. You can
2403 also provide a numeric prefix argument (as in @kbd{3 K o}) to save the
2404 attachment labeled with that number. This command prompts you for a
2405 filename and suggests a specific name if it is available.
2406
2407 @cindex @command{mhn}
2408 @cindex @command{mhstore}
2409 @cindex MH commands, @command{mhn}
2410 @cindex MH commands, @command{mhstore}
2411 @findex mh-mime-save-parts
2412 @kindex K a
2413 @vindex mh-mime-save-parts-default-directory
2414
2415 You can save all of the attachments at once with the command @kbd{K a}
2416 (@code{mh-mime-save-parts}). The attachments are saved in the
2417 directory specified by the option
2418 @code{mh-mime-save-parts-default-directory} unless you use a prefix
2419 argument (as in @kbd{C-u K a}) in which case you are prompted for the
2420 directory. These directories may be superseded by MH profile
2421 components, since this function calls on @command{mhstore}
2422 (@command{mhn}) to do the work.
2423
2424 @vindex mh-mime-save-parts-default-directory
2425
2426 The default value for the option
2427 @code{mh-mime-save-parts-default-directory} is @samp{Prompt Always} so
2428 that you are always prompted for the directory in which to save the
2429 attachments. However, if you usually use the same directory within a
2430 session, then you can set this option to @samp{Prompt the First Time}
2431 to avoid the prompt each time. you can make this directory permanent
2432 by choosing @samp{Directory} and entering the directory's name.
2433
2434 @cindex attachments, inline
2435 @cindex inline attachments
2436 @findex mh-toggle-mime-buttons
2437 @kindex K t
2438 @vindex mh-display-buttons-for-inline-parts-flag
2439
2440 The sender can request that attachments should be viewed inline so
2441 that they do not really appear like an attachment at all to the
2442 reader. Most of the time, this is desirable, so by default MH-E
2443 suppresses the buttons for inline attachments. On the other hand, you
2444 may receive code or HTML which the sender has added to his message as
2445 inline attachments so that you can read them in MH-E@. In this case, it
2446 is useful to see the buttons so that you know you don't have to cut
2447 and paste the code into a file; you can simply save the attachment. If
2448 you want to make the buttons visible for inline attachments, you can
2449 use the command @kbd{K t} (@code{mh-toggle-mime-buttons}) to toggle
2450 the visibility of these buttons. You can turn on these buttons
2451 permanently by turning on the option
2452 @code{mh-display-buttons-for-inline-parts-flag}.
2453
2454 MH-E cannot display all attachments inline however. It can display
2455 text (including @sc{html}) and images.
2456
2457 @cindex header field, @samp{Content-Disposition}
2458 @cindex inline images
2459 @cindex @samp{Content-Disposition} header field
2460 @vindex mh-max-inline-image-height
2461 @vindex mh-max-inline-image-width
2462
2463 Some older mail programs do not insert the needed
2464 plumbing@footnote{This plumbing is the @samp{Content-Disposition:}
2465 header field.} to tell MH-E whether to display the attachments inline
2466 or not. If this is the case, MH-E will display these images inline if
2467 they are smaller than the window. However, you might want to allow
2468 larger images to be displayed inline. To do this, you can change the
2469 options @code{mh-max-inline-image-width} and
2470 @code{mh-max-inline-image-height} from their default value of zero to
2471 a large number. The size of your screen is a good choice for these
2472 numbers.
2473
2474 @cindex alternatives
2475 @cindex attachments, alternatives
2476 @vindex mh-display-buttons-for-alternatives-flag
2477
2478 Sometimes, a mail program will produce multiple alternatives of an
2479 attachment in increasing degree of faithfulness to the original
2480 content. By default, only the preferred alternative is displayed. If
2481 the option @code{mh-display-buttons-for-alternatives-flag} is on, then
2482 the preferred part is shown inline and buttons are shown for each of
2483 the other alternatives.
2484
2485 @vindex mm-discouraged-alternatives
2486
2487 Many people prefer to see the @samp{text/plain} alternative rather
2488 than the @samp{text/html} alternative. To do this in MH-E, customize
2489 the option @code{mm-discouraged-alternatives}, and add
2490 @samp{text/html}. The next best alternative, if any, will be shown.
2491
2492 @findex mh-show-preferred-alternative
2493 @kindex : (colon)
2494
2495 Occasionally, though, you might want to see the preferred alternative.
2496 The command @kbd{:} (@code{mh-show-preferred-alternative}) displays
2497 the message with the default preferred alternative. This is as if
2498 @code{mm-discouraged-alternatives} is set to @samp{nil}. Use the
2499 command @key{RET} (@code{mh-show}) to show the message normally again.
2500
2501 @kindex K i
2502 @findex mh-folder-inline-mime-part
2503
2504 You can view the raw contents of an attachment with the command @kbd{K
2505 i} (@code{mh-folder-inline-mime-part}). This command displays (or
2506 hides) the contents of the attachment associated with the button under
2507 the cursor verbatim. If the cursor is not located over a button, then
2508 the cursor first moves to the next button, wrapping to the beginning
2509 of the message if necessary. You can also provide a numeric prefix
2510 argument (as in @kbd{4 K i}) to view the attachment labeled with that
2511 number.
2512
2513 For additional information on buttons, see
2514 @ifinfo
2515 @ref{Article Buttons,,,gnus}, and @ref{MIME Commands,,,gnus}.
2516 @end ifinfo
2517 @ifnotinfo
2518 the chapters @uref{http://www.gnus.org/manual/gnus_101.html#SEC101,
2519 Article Buttons} and
2520 @uref{http://www.gnus.org/manual/gnus_108.html#SEC108, MIME Commands}
2521 in the @cite{The Gnus Manual}.
2522 @end ifnotinfo
2523
2524 @node HTML, Digests, Viewing Attachments, Reading Mail
2525 @section HTML
2526
2527 @cindex HTML
2528 @cindex Gnus
2529
2530 MH-E can display messages that have been sent in HTML. The
2531 content of the message will appear in the MH-Show buffer as you would
2532 expect if the entire message is HTML, or there is an inline HTML body
2533 part. However, if there is an HTML body part that is an attachment,
2534 then you'll see a button like this:
2535
2536 @smallexample
2537 [1. text/html; foo.html]...
2538 @end smallexample
2539
2540 To see how to read the contents of this body part, see @ref{Viewing
2541 Attachments}.
2542
2543 @vindex mm-text-html-renderer
2544
2545 The browser that MH-E uses is determined by the option
2546 @code{mm-text-html-renderer}. The default setting is set automatically
2547 based upon the presence of a known browser on your system. If you wish
2548 to use a different browser, then set this option accordingly. See the
2549 documentation for the browser you use for additional information on
2550 how to use it. In particular, find and disable the option to render
2551 images, as displaying remote images can tip off spammers that the
2552 email address they have used is valid.
2553
2554 @vindex mm-text-html-renderer
2555
2556 If you're confused about which @code{mm-text-html-renderer} to use,
2557 here's a brief description of each, sorted by name.
2558
2559 @table @asis
2560 @cindex browser, @samp{gnus-w3m}
2561 @cindex @samp{gnus-w3m}
2562 @cindex browser, @samp{w3m}
2563 @cindex @samp{w3m}
2564 @item @samp{gnus-w3m}
2565 The @samp{gnus-w3m} browser requires an external program. It's quick,
2566 produces pretty nice output, and it highlights links. It renders
2567 @samp{&ndash;} and @samp{&reg;} okay. It sometimes fails to wrap lines
2568 properly. It always downloads remote images.
2569 @c -------------------------
2570 @cindex browser, @samp{html2text}
2571 @cindex @samp{html2text}
2572 @item @samp{html2text}
2573 The @samp{html2text} browser requires an external program. Some users
2574 have reported problems with it, such as filling the entire message as
2575 if it were one paragraph, or displaying chunks of raw HTML.
2576 @c -------------------------
2577 @cindex browser, @samp{links}
2578 @cindex @samp{links}
2579 @item @samp{links}
2580 The @samp{links} browser requires an external program. It's quick, and
2581 produces nicer output than @samp{lynx} on single column mails in
2582 tables. However, it doesn't show links and it doesn't do as nice a job
2583 on multi-column tables as some lines wrap. It does do a good job of
2584 fitting text within 80 columns. It appears to render special
2585 characters using ASCII equivalents. For example, @samp{&reg;} appears
2586 as (R). It does not download images.
2587 @c -------------------------
2588 @cindex browser, @samp{lynx}
2589 @cindex @samp{lynx}
2590 @item @samp{lynx}
2591 The @samp{lynx} browser requires an external program. It's quick and
2592 produces pretty decent output but it doesn't show links. It doesn't
2593 seem to do multi-column tables which makes output much cleaner. It
2594 centers the output and wraps long lines more than most. It does not
2595 always handle special characters like @samp{&reg;} or @samp{&ndash;}.
2596 It does not download images.
2597 @c -------------------------
2598 @item @samp{nil}
2599 This choice obviously requires an external browser. With this setting,
2600 HTML messages have a button for the body part which you can view with
2601 @kbd{K v} (@code{mh-folder-toggle-mime-part}). Rendering of special
2602 characters and handling of remote images depends on your choice of
2603 browser.
2604 @c -------------------------
2605 @item @samp{shr}
2606 @cindex @samp{shr}
2607 This choice does not require an external program, but it does require
2608 that Emacs be configured at build time to use @samp{libxml2}. It is
2609 fairly quick, it highlights links, and it supports HTML color
2610 declarations. It renders @samp{&ndash;} and @samp{&reg;} okay. It
2611 sometimes truncates text, particularly if the message tries to have
2612 fancy text layout. By default it does not download images; this
2613 behavior is controlled by the options @code{mm-html-blocked-images}
2614 and @code{mm-html-inhibit-images}
2615 @ifinfo
2616 (@pxref{Display Customization,,,emacs-mime}).
2617 @end ifinfo
2618 @ifnotinfo
2619 (see section @uref{http://www.gnus.org/manual/emacs-mime_6.html,
2620 Display Customization} in the @cite{The Emacs MIME Manual}).
2621 @end ifnotinfo
2622 @c -------------------------
2623 @cindex browser, @samp{w3m}
2624 @cindex @samp{w3m}
2625 @kindex mouse-2
2626 @item @samp{w3m}
2627 The @samp{w3m} browser requires an external program. It's quick,
2628 produces pretty nice output, and it highlights links. These can be
2629 clicked with @kbd{mouse-2} to view the content of the link in
2630 @samp{w3m}. The @samp{w3m} browser handles tables well and actually
2631 respects the table's width parameter (which can cause text to wrap if
2632 the author didn't anticipate that the page would be viewed in Emacs).
2633 It does not download images by default; this behavior is controlled by
2634 the option @code{mm-w3m-safe-url-regexp}
2635 @ifinfo
2636 (@pxref{Display Customization,,,emacs-mime}).
2637 @end ifinfo
2638 @ifnotinfo
2639 (see section @uref{http://www.gnus.org/manual/emacs-mime_6.html,
2640 Display Customization} in the @cite{The Emacs MIME Manual}).
2641 @end ifnotinfo
2642 @c -------------------------
2643 @cindex browser, @samp{w3m-standalone}
2644 @cindex @samp{w3m-standalone}
2645 @cindex browser, @samp{w3m}
2646 @cindex @samp{w3m}
2647 @item @samp{w3m-standalone}
2648 This browser is quick, but does not show links. It handles simple
2649 tables but some tables get rendered much wider than the Emacs frame.
2650 This browser renders @samp{&ndash;} and @samp{&reg;} okay. It does not
2651 download images.
2652 @end table
2653
2654 @vindex mm-text-html-renderer
2655
2656 For a couple more sources of information about
2657 @code{mm-text-html-renderer},
2658 @ifinfo
2659 @xref{Display Customization,,,emacs-mime}, and the documentation for
2660 the Gnus command @kbd{W h} (@pxref{Article Washing,,,gnus}).
2661 @end ifinfo
2662 @ifnotinfo
2663 see section @uref{http://www.gnus.org/manual/emacs-mime_6.html,
2664 Display Customization} in the @cite{The Emacs MIME Manual} and the
2665 documentation for the Gnus command @kbd{W h} (see section
2666 @uref{http://www.gnus.org/manual/gnus_48.html#Article-Washing, Article
2667 Washing} in the
2668 @cite{The Gnus Manual}).
2669 @end ifnotinfo
2670
2671 @cindex @file{.emacs}
2672 @cindex files, @file{.emacs}
2673 @findex browse-url-at-mouse
2674 @kindex S-mouse-2
2675
2676 A useful key binding that you can add to @file{~/.emacs} is the
2677 following which displays an HTML link or textual URL in an external
2678 browser when clicked with @kbd{S-mouse-2}. This binding works in any
2679 buffer, including HTML buffers.
2680
2681 @smalllisp
2682 (global-set-key [S-mouse-2] 'browse-url-at-mouse)
2683 @end smalllisp
2684
2685 @node Digests, Reading PGP, HTML, Reading Mail
2686 @section Digests
2687
2688 @cindex digests
2689 @findex mh-page-digest
2690 @findex mh-page-digest-backwards
2691 @kindex D @key{BS}
2692 @kindex D @key{SPC}
2693 @kindex @key{BS}
2694 @kindex @key{SPC}
2695
2696 A digest is a message that contains other messages. Special MH-E
2697 commands let you read digests conveniently. You can use @key{SPC} and
2698 @key{BS} to page through the digest as if it were a normal message,
2699 but if you wish to skip to the next message in the digest, use
2700 @kbd{D @key{SPC}} (@code{mh-page-digest}). To return to a previous message,
2701 use @kbd{D @key{BS}} (@code{mh-page-digest-backwards}).
2702
2703 @cindex @command{burst}
2704 @cindex MH commands, @command{burst}
2705 @cindex MH-Folder Show mode
2706 @cindex modes, MH-Folder Show
2707 @findex mh-burst-digest
2708 @kindex d
2709 @kindex D b
2710 @kindex t
2711
2712 Another handy command is @kbd{D b} (@code{mh-burst-digest}). This
2713 command uses the MH command @command{burst}@footnote{See the section
2714 @uref{@value{MH-BOOK-HOME}/burdig.html, Bursting Messages} in the MH
2715 book.} to break out each message in the digest into its own message.
2716 Using this command, you can quickly delete unwanted messages, like
2717 this: Once the digest is split up, toggle out of MH-Folder Show mode
2718 with @kbd{t} (@pxref{Folders}) so that the scan lines fill the screen
2719 and messages aren't displayed. Then use @kbd{d} (@pxref{Reading Mail})
2720 to quickly delete messages that you don't want to read (based on the
2721 @samp{Subject:} header field). You can also burst the digest to reply
2722 directly to the people who posted the messages in the digest. One
2723 problem you may encounter is that the @samp{From:} header fields are
2724 preceded with a @samp{>} so that your reply can't create the
2725 @samp{To:} field correctly. In this case, you must correct the
2726 @samp{To:} field yourself. This is described later (@pxref{Editing
2727 Drafts}).
2728
2729 @node Reading PGP, Printing, Digests, Reading Mail
2730 @section Signed and Encrypted Messages
2731
2732 @cindex GPG
2733 @cindex GnuPG
2734 @cindex Gnus
2735 @cindex OpenPGP
2736 @cindex PGP
2737 @cindex RFC 3156
2738 @cindex encrypted messages
2739 @cindex security
2740 @cindex signed messages
2741
2742 You can read encrypted or signed PGP or GPG messages with
2743 MH-E@footnote{This feature depends on post-5.10 versions of Gnus.
2744 @cite{MIME Security with OpenPGP} is documented in
2745 @uref{http://www.rfc-editor.org/rfc/rfc3156.txt, RFC 3156}. However,
2746 MH-E can also decrypt old-style PGP messages that are not in MIME
2747 format.}. This section assumes that you already have a good
2748 understanding of GPG and have set up your keys appropriately.
2749
2750 If someone sends you a signed message, here is what you'll see:
2751
2752 @smallexample
2753 @group
2754 [[PGP Signed Part:Bill Wohler <wohler@@stop.mail-abuse.org>]]
2755 This is a signed message.
2756
2757 [[End of PGP Signed Part]]
2758 @end group
2759 @end smallexample
2760
2761 @cindex keychain
2762 @cindex key server
2763 @cindex signed messages
2764
2765 If the key for the given signature is not in your keychain, you'll be
2766 given the opportunity to fetch the key from a key server and verify
2767 the key. If the message is really large, the verification process can
2768 take a long time. You can press @kbd{C-g} at any time to
2769 cancel@footnote{Unfortunately in the current version, the validation
2770 process doesn't display a message so it appears that MH-E has hung. We
2771 hope that this will be fixed in the future.}.
2772
2773 If the signature doesn't check out, you might see something like this:
2774
2775 @smallexample
2776 @group
2777 [[PGP Signed Part:Failed]]
2778 This is a signed message.
2779 This is garbage added after the signature was made.
2780
2781 [[End of PGP Signed Part]]
2782 @end group
2783 @end smallexample
2784
2785 @cindex decrypting messages
2786
2787 If someone sends you an encrypted message, MH-E will ask for your
2788 passphrase to decrypt the message. You should see something like this:
2789
2790 @smallexample
2791 @group
2792 [[PGP Encrypted Part:OK]]
2793
2794 [[PGP Signed Part:Bill Wohler <wohler@@stop.mail-abuse.org>]]
2795 This is the secret message.
2796
2797 [[End of PGP Signed Part]]
2798
2799 [[End of PGP Encrypted Part]]
2800 @end group
2801 @end smallexample
2802
2803 If there is a problem decrypting the message, the button will say:
2804
2805 @smallexample
2806 [[PGP Encrypted Part:Failed]]
2807 @end smallexample
2808
2809 You can read the contents of this button using the methods described in
2810 @ref{Viewing Attachments}. If the message were corrupted, you'd see
2811 this:
2812
2813 @smallexample
2814 [[PGP Encrypted Part:Failed]
2815 Invalid base64 data]
2816 @end smallexample
2817
2818 If your passphrase were incorrect, you'd see something like this:
2819
2820 @smallexample
2821 [GNUPG:] ENC_TO CD9C88BB610BD9AD 1 0
2822 [GNUPG:] USERID_HINT CD9C88BB610BD9AD Bill Wohler <wohler@@stop.mail-abuse.org>
2823 [GNUPG:] NEED_PASSPHRASE CD9C88BB610BD9AD CD9C88BB610BD9AD 1 0
2824 [GNUPG:] BAD_PASSPHRASE CD9C88BB610BD9AD
2825 gpg: encrypted with 1024-bit RSA key, ID 610BD9AD, created 1997-09-09
2826 "Bill Wohler <wohler@@stop.mail-abuse.org>"
2827 gpg: public key decryption failed: bad passphrase
2828 [GNUPG:] BEGIN_DECRYPTION
2829 [GNUPG:] DECRYPTION_FAILED
2830 gpg: decryption failed: secret key not available
2831 [GNUPG:] END_DECRYPTION
2832
2833 gpg exited abnormally: '2'
2834 @end smallexample
2835
2836 @vindex mh-show-pgg-bad
2837 @vindex mh-show-pgg-good
2838 @vindex mh-show-pgg-unknown
2839
2840 The appearance of the buttons is controlled by the faces
2841 @code{mh-show-pgg-good}, @code{mh-show-pgg-bad}, and
2842 @code{mh-show-pgg-unknown} depending on the validity of the signature.
2843 The latter is used whether the signature is unknown or untrusted.
2844
2845 @cindex @samp{pgg} customization group
2846 @cindex PGG
2847 @cindex customization group, @samp{pgg}
2848
2849 The @samp{pgg} customization group may have some settings which may
2850 interest you.
2851 @iftex
2852 See @cite{The PGG Manual}.
2853 @end iftex
2854 @ifinfo
2855 @xref{Top, , The PGG Manual, pgg, The PGG Manual}.
2856 @end ifinfo
2857 @ifhtml
2858 See
2859 @uref{http://www.gnu.org/software/emacs/manual/pgg.html,
2860 @cite{The PGG Manual}}.
2861 @end ifhtml
2862
2863 @node Printing, Files and Pipes, Reading PGP, Reading Mail
2864 @section Printing Your Mail
2865
2866 @cindex printing
2867 @findex mh-ps-print-msg
2868 @findex mh-ps-print-msg-file
2869 @kindex P f
2870 @kindex P p
2871 @vindex mh-lpr-command-format
2872 @vindex mh-print-background-flag
2873
2874 To print messages in MH-E, use the command @kbd{P p}
2875 (@code{mh-ps-print-msg}). You can print all the messages in a range
2876 (as in @kbd{C-u P p 1 3 5-7 last:5 frombob @key{RET}},
2877 @pxref{Ranges}). You can also send the output to a file with @kbd{P f}
2878 (@code{mh-ps-print-msg-file}). This command will print inline text
2879 attachments but will not decrypt messages. However, when a message is
2880 displayed in an MH-Show buffer, then that buffer is used verbatim for
2881 printing with the caveat that only text attachments, if opened inline,
2882 are printed. Therefore, encrypted messages can be printed by showing
2883 and decrypting them first. The commands @kbd{P p} and @kbd{P f} do not
2884 use the options @code{mh-lpr-command-format} or
2885 @code{mh-print-background-flag}, described below.
2886
2887 @findex mh-ps-print-toggle-color
2888 @kindex P C
2889 @vindex ps-print-color-p
2890
2891 Colors are emulated on black-and-white printers with shades of gray.
2892 This might produce illegible output, even if your screen colors only
2893 use shades of gray. If this is the case, try using the command @kbd{P
2894 C} (@code{mh-ps-print-toggle-color}) to toggle between color, no
2895 color, and a black and white representation of the colors and see
2896 which works best. You change this setting permanently by customizing
2897 the option @code{ps-print-color-p}.
2898
2899 @findex mh-ps-print-toggle-faces
2900 @kindex P F
2901
2902 Another related function is the command @kbd{P F}
2903 (@code{mh-ps-print-toggle-faces}). This command toggles between using
2904 faces and not. When faces are enabled, the printed message will look
2905 very similar to the message in the MH-Show buffer.
2906
2907 @cindex ps-print package
2908 @cindex Emacs, packages, ps-print
2909
2910 MH-E uses the @samp{ps-print} package to do the printing, so you can
2911 customize the printing further by going to the @samp{ps-print}
2912 customization group.
2913
2914 @cindex @command{lpr}
2915 @cindex @command{mhl}
2916 @cindex MH commands, @command{mhl}
2917 @cindex Unix commands, @command{lpr}
2918 @findex mh-print-msg
2919 @kindex P l
2920
2921 An alternative to using the @samp{ps-print} package is the command
2922 @kbd{P l} (@code{mh-print-msg}) (the @i{l} is for @i{l}ine printer or
2923 @i{l}pr). You can print all the messages in a range. The message is
2924 formatted with @command{mhl}@footnote{See the section
2925 @uref{@value{MH-BOOK-HOME}/shomes.html#Usisho, Using mhl} in the MH
2926 book.} and printed with the @command{lpr} command.
2927
2928 @kindex P f
2929 @kindex P l
2930 @kindex P p
2931 @vindex mh-lpr-command-format
2932 @vindex mh-print-background-flag
2933
2934 The command @kbd{P l} uses two options. The option
2935 @code{mh-lpr-command-format} contains the Unix command line which
2936 performs the actual printing. The string can contain one escape,
2937 @samp{%s}, which is replaced by the name of the folder and the message
2938 number and is useful for print job names. The default setting is
2939 @code{"lpr -J '%s'"}. I use @code{"mpage -h'%s' -b Letter -H1of -mlrtb
2940 -P"} which produces a nice header and adds a bit of margin so the text
2941 fits within my printer's margins. Normally messages are printed in the
2942 foreground. If this is slow on your system, you may elect to turn on
2943 the option @code{mh-print-background-flag} to print in the background.
2944 If you do this, do not delete the message until it is printed or else
2945 the output may be truncated. These options are not used by the
2946 commands @kbd{P p} or @kbd{P f}.
2947
2948 @node Files and Pipes, Navigating, Printing, Reading Mail
2949 @section Files and Pipes
2950
2951 @cindex files
2952 @cindex pipes
2953 @findex mh-refile-or-write-again
2954 @findex mh-write-msg-to-file
2955 @kindex >
2956 @kindex !
2957
2958 MH-E does offer a couple of commands that are not a part of MH@. The
2959 first one, @kbd{>} (@code{mh-write-msg-to-file}), writes a message to
2960 a file. You are prompted for the filename. If the file already exists,
2961 the message is appended to it. You can also write the message to the
2962 file without the header by specifying a prefix argument (such as
2963 @kbd{C-u > /tmp/foobar @key{RET}}). Subsequent writes to the same file
2964 can be made with the command @kbd{!}
2965 (@code{mh-refile-or-write-again}).
2966
2967 @findex mh-pipe-msg
2968 @kindex |
2969 @kindex l
2970
2971 You can also pipe the message through a Unix shell command with the
2972 command @kbd{|} (@code{mh-pipe-msg}). You are prompted for the Unix
2973 command through which you wish to run your message. If you give a
2974 prefix argument to this command, the message header is included in the
2975 text passed to the command (the contrived example @kbd{C-u | lpr}
2976 would be done with the @kbd{l} command instead).
2977
2978 @cindex @command{shar}
2979 @cindex @command{uuencode}
2980 @cindex Unix commands, @command{shar}
2981 @cindex Unix commands, @command{uuencode}
2982 @findex mh-store-msg
2983 @kindex X s
2984 @vindex mh-store-default-directory
2985
2986 If the message is a shell archive @command{shar} or has been run
2987 through @command{uuencode} use @kbd{X s} (@code{mh-store-msg}) to
2988 extract the body of the message. The default directory for extraction
2989 is the current directory; however, you have a chance to specify a
2990 different extraction directory. The next time you use this command,
2991 the default directory is the last directory you used. If you would
2992 like to change the initial default directory, customize the option
2993 @code{mh-store-default-directory}, change the value from
2994 @samp{Current} to @samp{Directory}, and then enter the name of the
2995 directory for storing the content of these messages.
2996
2997 @findex mh-store-buffer
2998 @kindex @key{RET}
2999 @kindex X s
3000
3001 By the way, @kbd{X s} calls the Emacs Lisp function
3002 @code{mh-store-buffer}. I mention this because you can use it directly
3003 if you're editing a buffer that contains a file that has been run
3004 through @command{uuencode} or @command{shar}. For example, you can
3005 extract the contents of the current buffer in your home directory by
3006 typing @kbd{M-x mh-store-buffer @key{RET} ~ @key{RET}}.
3007
3008 @node Navigating, Miscellaneous Commands and Options, Files and Pipes, Reading Mail
3009 @section Navigating
3010
3011 @cindex moving between messages
3012 @cindex navigation
3013 @findex mh-first-msg
3014 @findex mh-goto-msg
3015 @findex mh-last-msg
3016 @findex mh-next-undeleted-msg
3017 @findex mh-next-unread-msg
3018 @findex mh-previous-undeleted-msg
3019 @findex mh-previous-unread-msg
3020 @kindex g
3021 @kindex M-<
3022 @kindex M->
3023 @kindex M-n
3024 @kindex M-p
3025 @kindex n
3026 @kindex p
3027
3028 To move on to the next message, use the command @kbd{n}
3029 (@code{mh-next-undeleted-msg}); use @kbd{p}
3030 (@code{mh-previous-undeleted-msg}) to read the previous message. To
3031 move to the next unread message, use @kbd{M-n}
3032 (@code{mh-next-unread-msg}); use @kbd{M-p}
3033 (@code{mh-previous-unread-msg}) to move to the previous unread
3034 message. These commands can be given a prefix argument to specify how
3035 many messages to skip (for example, @kbd{5 n}). You can also move to a
3036 specific message with @kbd{g} (@code{mh-goto-msg}). You can enter the
3037 message number either before or after typing @kbd{g}. In the latter
3038 case, Emacs prompts you. Finally, you can go to the first or last
3039 message with @kbd{M-<} (@code{mh-first-msg}) and @kbd{M->}
3040 (@code{mh-last-msg}) respectively.
3041
3042 @cindex MH-Folder mode
3043 @cindex modes, MH-Folder
3044 @findex next-line
3045 @findex previous-line
3046 @kindex C-n
3047 @kindex C-p
3048 @kindex @key{RET}
3049
3050 You can also use the Emacs commands @kbd{C-p} (@code{previous-line})
3051 and @kbd{C-n} (@code{next-line}) to move up and down the scan lines in
3052 the MH-Folder window. These commands can be used in conjunction with
3053 @key{RET} to look at deleted or refiled messages.
3054
3055 @cindex deleting messages
3056 @findex mh-delete-msg
3057 @kindex d
3058 @kindex n
3059 @kindex p
3060
3061 To mark a message for deletion, use the command @kbd{d}
3062 (@code{mh-delete-msg}). A @samp{D} is placed by the message in the
3063 scan window, and the next undeleted message is displayed. If the
3064 previous command had been @kbd{p}, then the next message displayed is
3065 the first undeleted message previous to the message just deleted. Use
3066 @kbd{n} to force subsequent @kbd{d} commands to move forward to the
3067 next undeleted message after deleting the message under the cursor.
3068 You may also specify a range (for example, @kbd{C-u d 1 3 5-7 last:5
3069 frombob @key{RET}}, @pxref{Ranges}).
3070
3071 @findex mh-delete-msg-no-motion
3072 @kindex C-d
3073
3074 The command @kbd{C-d} (@code{mh-delete-msg-no-motion}) marks the
3075 message (or messages in range) for deletion but leaves the cursor at
3076 the current message in case you wish to perform other operations on
3077 the message.
3078
3079 @findex mh-delete-subject
3080 @findex mh-delete-subject-or-thread
3081 @findex mh-thread-delete
3082 @findex mh-undo
3083 @kindex k
3084 @kindex T d
3085 @kindex u
3086
3087 And to delete more messages faster, you can use @kbd{k}
3088 (@code{mh-delete-subject-or-thread}) to delete all the messages with
3089 the same subject as the current message. This command puts these
3090 messages in a sequence named @samp{subject}. You can undo this action
3091 by using @kbd{u} (@code{mh-undo}) with a prefix argument and then
3092 specifying the @samp{subject} sequence. However, if the buffer is
3093 displaying a threaded view of the folder then @kbd{k} behaves like
3094 @kbd{T d} (@code{mh-thread-delete}). @xref{Threading}.
3095
3096 @findex mh-execute-commands
3097 @kindex x
3098
3099 However you mark a message for deletion, the command @kbd{x}
3100 (@code{mh-execute-commands}) actually carries out the deletion
3101 (@pxref{Folders}).
3102
3103 @vindex mh-delete-msg-hook
3104
3105 The hook @code{mh-delete-msg-hook} is called after you mark a message
3106 for deletion. For example, a past maintainer of MH-E used this once
3107 when he kept statistics on his mail usage.
3108
3109 @node Miscellaneous Commands and Options, , Navigating, Reading Mail
3110 @section Miscellaneous Commands and Options
3111
3112 This section contains a few more miscellaneous commands and options.
3113
3114 @cindex editing message
3115 @findex mh-modify
3116 @kindex M
3117
3118 There are times when you need to edit a message. For example, you may
3119 need to fix a broken Content-Type header field. You can do this with
3120 the command @kbd{M} (@code{mh-modify}). It displays the raw message in
3121 an editable buffer. When you are done editing, save and kill the
3122 buffer as you would any other.
3123
3124 @findex mh-kill-folder
3125 @findex mh-pack-folder
3126 @vindex mh-do-not-confirm-flag
3127
3128 Commands such as @code{mh-pack-folder} prompt to confirm whether to
3129 process outstanding moves and deletes or not before continuing.
3130 Turning on the option @code{mh-do-not-confirm-flag} means that these
3131 actions will be performed---which is usually desired but cannot be
3132 retracted---without question@footnote{In previous versions of MH-E,
3133 this option suppressed the confirmation in @code{mh-kill-folder}.
3134 Since this kept most users from setting this option,
3135 @code{mh-kill-folder} was modified in version 6.0 to always ask for
3136 confirmation subject to @code{mh-kill-folder-suppress-prompt-hook}.
3137 @xref{Folders}.}.
3138
3139 @cindex MH-Folder mode
3140 @cindex modes, MH-Folder
3141 @vindex mh-summary-height
3142
3143 The option @code{mh-summary-height} controls the number of scan lines
3144 displayed in the MH-Folder window, including the mode line. The
3145 default value of this option is @samp{Automatic} which means that the
3146 MH-Folder buffer will maintain the same proportional size if the frame
3147 is resized. If you'd prefer a fixed height, then choose the
3148 @samp{Fixed Size} option and enter the number of lines you'd like to
3149 see.
3150
3151 @vindex mh-bury-show-buffer-flag
3152
3153 Normally the buffer for displaying messages is buried at the bottom at
3154 the buffer stack. You may wish to disable this feature by turning off
3155 the option @code{mh-bury-show-buffer-flag}. One advantage of not
3156 burying the show buffer is that one can delete the show buffer more
3157 easily in an electric buffer list because of its proximity to its
3158 associated MH-Folder buffer. Try running @kbd{M-x
3159 electric-buffer-list} to see what I mean.
3160
3161 @cindex @file{.emacs}
3162 @cindex files, @file{.emacs}
3163 @cindex reading mail
3164
3165 Before we leave this section, I'll include a function that I use as a
3166 front end to MH-E@footnote{Stephen Gildea's favorite binding is
3167 @kbd{(global-set-key "\C-cr" 'mh-rmail)}.}. It toggles between your
3168 working window configuration, which may be quite involved---windows
3169 filled with source, compilation output, man pages, and other
3170 documentation---and your MH-E window configuration. Like the rest of
3171 the customization described in this section, simply add the following
3172 code to @file{~/.emacs}.
3173
3174 @iftex
3175 @filbreak
3176 @end iftex
3177
3178 @findex mh-rmail, example
3179
3180 @smalllisp
3181 @group
3182 (defvar my-mh-screen-saved nil
3183 "Set to non-nil when MH-E window configuration shown.")
3184 (defvar my-normal-screen nil "Normal window configuration.")
3185 (defvar my-mh-screen nil "MH-E window configuration.")
3186
3187 (defun my-mh-rmail (&optional arg)
3188 "Toggle between MH-E and normal screen configurations.
3189 With non-nil or prefix argument, include mailbox as well
3190 when going into mail."
3191 (interactive "P") ; @r{user callable function, P=prefix arg}
3192 (setq my-mh-screen-saved ; @r{save state}
3193 (cond
3194 ;; @r{Bring up MH-E screen if arg or normal window configuration.}
3195 ;; @r{If arg or +inbox buffer doesn't exist, run mh-rmail.}
3196 ((or arg (null my-mh-screen-saved))
3197 (setq my-normal-screen (current-window-configuration))
3198 (if (or arg (null (get-buffer "+inbox")))
3199 (mh-rmail)
3200 (set-window-configuration my-mh-screen))
3201 t) ; @r{set my-mh-screen-saved to @code{t}}
3202 ;; @r{Otherwise, save MH-E screen and restore normal screen.}
3203 (t
3204 (setq my-mh-screen (current-window-configuration))
3205 (set-window-configuration my-normal-screen)
3206 nil)))) ; @r{set my-mh-screen-saved to nil}
3207
3208 (global-set-key "\C-x\r" 'my-mh-rmail) ;@r{ call with C-x @key{RET}}
3209
3210 @i{Starting MH-E}
3211
3212 @end group
3213 @end smalllisp
3214
3215 If you type an argument (@kbd{C-u}) or if @code{my-mh-screen-saved} is
3216 @code{nil} (meaning a non-MH-E window configuration), the current
3217 window configuration is saved, either the @samp{+inbox} buffer is
3218 displayed or @code{mh-rmail} is run, and the MH-E window configuration
3219 is shown. Otherwise, the MH-E window configuration is saved and the
3220 original configuration is displayed.
3221
3222 @node Folders, Sending Mail, Reading Mail, Top
3223 @chapter Organizing Your Mail with Folders
3224
3225 @cindex @samp{Folder} menu
3226 @cindex @samp{Message} menu
3227 @cindex folders
3228 @cindex menu, @samp{Folder}
3229 @cindex menu, @samp{Message}
3230 @cindex using folders
3231
3232 This chapter discusses the things you can do with folders within MH-E@.
3233 The commands in this chapter are also found in the @samp{Folder} and
3234 @samp{Message} menus.
3235
3236 @table @kbd
3237 @kindex ?
3238 @findex mh-help
3239 @item ?
3240 Display cheat sheet for the MH-E commands (@code{mh-help}).
3241 @c -------------------------
3242 @kindex !
3243 @findex mh-refile-or-write-again
3244 @item !
3245 Repeat last output command (@code{mh-refile-or-write-again}).
3246 @c -------------------------
3247 @cindex @samp{Message > Copy Message to Folder...} menu item
3248 @cindex menu item, @samp{Message > Copy Message to Folder...}
3249 @kindex c
3250 @findex mh-copy-msg
3251 @item c
3252 Copy range to folder (@code{mh-copy-msg}).
3253 @c -------------------------
3254 @kindex F ?
3255 @findex mh-prefix-help
3256 @item F ?
3257 Display cheat sheet for the commands of the current prefix in
3258 minibuffer (@code{mh-prefix-help}).
3259 @c -------------------------
3260 @kindex F '
3261 @findex mh-index-ticked-messages
3262 @item F '
3263 Display ticked messages (@code{mh-index-ticked-messages}).
3264 @c -------------------------
3265 @kindex F c
3266 @findex mh-catchup
3267 @item F c
3268 Delete range from the @samp{unseen} sequence (@code{mh-catchup}).
3269 @c -------------------------
3270 @kindex F k
3271 @findex mh-kill-folder
3272 @item F k
3273 Remove folder (@code{mh-kill-folder}).
3274 @c -------------------------
3275 @cindex @samp{Folder > List Folders} menu item
3276 @cindex menu item, @samp{Folder > List Folders}
3277 @kindex F l
3278 @findex mh-list-folders
3279 @item F l
3280 List all folders (@code{mh-list-folders}).
3281 @c -------------------------
3282 @cindex @samp{Folder > View New Messages} menu item
3283 @cindex menu item, @samp{Folder > View New Messages}
3284 @kindex F n
3285 @findex mh-index-new-messages
3286 @item F n
3287 Display unseen messages (@code{mh-index-new-messages}).
3288 @c -------------------------
3289 @cindex @samp{Folder > Pack Folder} menu item
3290 @cindex menu item, @samp{Folder > Pack Folder}
3291 @kindex F p
3292 @findex mh-pack-folder
3293 @item F p
3294 Pack folder (@code{mh-pack-folder}).
3295 @c -------------------------
3296 @kindex F q
3297 @findex mh-index-sequenced-messages
3298 @item F q
3299 Display messages in any sequence (@code{mh-index-sequenced-messages}).
3300 @c -------------------------
3301 @cindex @samp{Folder > Rescan Folder} menu item
3302 @cindex menu item, @samp{Folder > Rescan Folder}
3303 @kindex F r
3304 @findex mh-rescan-folder
3305 @item F r
3306 Rescan folder (@code{mh-rescan-folder}).
3307 @c -------------------------
3308 @cindex @samp{Folder > Search...} menu item
3309 @cindex menu item, @samp{Folder > Search...}
3310 @kindex F s
3311 @findex mh-search
3312 @item F s
3313 Search your MH mail (@code{mh-search}).
3314 @c -------------------------
3315 @cindex @samp{Folder > Sort Folder} menu item
3316 @cindex menu item, @samp{Folder > Sort Folder}
3317 @kindex F S
3318 @findex mh-sort-folder
3319 @item F S
3320 Sort folder (@code{mh-sort-folder}).
3321 @c -------------------------
3322 @kindex F u
3323 @findex mh-undo-folder
3324 @item F u
3325 Undo all refiles and deletes in the current folder (@code{mh-undo-folder}).
3326 @c -------------------------
3327 @cindex @samp{Folder > Visit a Folder...} menu item
3328 @cindex menu item, @samp{Folder > Visit a Folder...}
3329 @kindex F v
3330 @findex mh-visit-folder
3331 @item F v
3332 Visit folder (@code{mh-visit-folder}).
3333 @c -------------------------
3334 @cindex @samp{Message > Refile Message} menu item
3335 @cindex menu item, @samp{Message > Refile Message}
3336 @kindex o
3337 @findex mh-refile-msg
3338 @item o
3339 Refile (output) range into folder (@code{mh-refile-msg}).
3340 @c -------------------------
3341 @cindex @samp{Folder > Quit MH-E} menu item
3342 @cindex menu item, @samp{Folder > Quit MH-E}
3343 @kindex q
3344 @findex mh-quit
3345 @item q
3346 Quit the current MH-E folder (@code{mh-quit}).
3347 @c -------------------------
3348 @cindex @samp{Folder > Toggle Show/Folder} menu item
3349 @cindex menu item, @samp{Folder > Toggle Show/Folder}
3350 @kindex t
3351 @findex mh-toggle-showing
3352 @item t
3353 Toggle between MH-Folder and MH-Folder Show modes
3354 (@code{mh-toggle-showing}).
3355 @c -------------------------
3356 @cindex @samp{Message > Undo Delete/Refile} menu item
3357 @cindex menu item, @samp{Message > Undo Delete/Refile}
3358 @kindex u
3359 @findex mh-undo
3360 @item u
3361 Undo pending deletes or refiles in range (@code{mh-undo}).
3362 @c -------------------------
3363 @cindex @samp{Message > Execute Delete/Refile} menu item
3364 @cindex menu item, @samp{Message > Execute Delete/Refile}
3365 @kindex x
3366 @findex mh-execute-commands
3367 @item x
3368 Process outstanding delete and refile requests
3369 (@code{mh-execute-commands}).
3370 @end table
3371
3372 @cindex @samp{mh-folder} customization group
3373 @cindex customization group, @samp{mh-folder}
3374
3375 The @samp{mh-folder} customization group is used to tune these
3376 commands.
3377
3378 @vtable @code
3379 @item mh-new-messages-folders
3380 Folders searched for the @samp{unseen} sequence (default:
3381 @code{Inbox}).
3382 @c -------------------------
3383 @item mh-ticked-messages-folders
3384 Folders searched for @code{mh-tick-seq} (default: @code{t}).
3385 @c -------------------------
3386 @item mh-large-folder
3387 The number of messages that indicates a large folder (default: 200).
3388 @c -------------------------
3389 @item mh-recenter-summary-flag
3390 On means to recenter the summary window (default: @samp{off}).
3391 @c -------------------------
3392 @item mh-recursive-folders-flag
3393 On means that commands which operate on folders do so recursively
3394 (default: @samp{off}).
3395 @c -------------------------
3396 @item mh-sortm-args
3397 Additional arguments for @command{sortm} (default: @code{nil}).
3398 @end vtable
3399
3400 The following hooks are available.
3401
3402 @vtable @code
3403 @item mh-after-commands-processed-hook
3404 Hook run by @kbd{x} after performing outstanding refile and delete
3405 requests (default: @code{nil}).
3406 @c -------------------------
3407 @item mh-before-commands-processed-hook
3408 Hook run by @kbd{x} before performing outstanding refile and delete
3409 requests (default: @code{nil}).
3410 @c -------------------------
3411 @item mh-before-quit-hook
3412 Hook run by q before quitting MH-E (default: @code{nil}).
3413 @c -------------------------
3414 @item mh-folder-mode-hook
3415 Hook run by @code{mh-folder-mode} when visiting a new folder (default:
3416 @code{nil}).
3417 @c -------------------------
3418 @item mh-kill-folder-suppress-prompt-hook
3419 Abnormal hook run at the beginning of @code{mh-kill-folder} (default:
3420 @code{'mh-search-p}).
3421 @c -------------------------
3422 @item mh-pack-folder-hook
3423 Hook run by @code{mh-pack-folder} after renumbering the messages
3424 (default: @code{nil}).
3425 @c -------------------------
3426 @item mh-quit-hook
3427 Hook run by q after quitting MH-E (default: @code{nil}).
3428 @c -------------------------
3429 @item mh-refile-msg-hook
3430 Hook run by o after marking each message for refiling (default:
3431 @code{nil}).
3432 @end vtable
3433
3434 The following faces are available for customizing the appearance of
3435 the MH-Folder buffer. @xref{Scan Line Formats}.
3436
3437 @vtable @code
3438 @item mh-folder-address
3439 Recipient face.
3440 @c -------------------------
3441 @item mh-folder-body
3442 Body text face.
3443 @c -------------------------
3444 @item mh-folder-cur-msg-number
3445 Current message number face.
3446 @c -------------------------
3447 @item mh-folder-date
3448 Date face.
3449 @c -------------------------
3450 @item mh-folder-deleted
3451 Deleted message face.
3452 @c -------------------------
3453 @item mh-folder-followup
3454 @samp{Re:} face.
3455 @c -------------------------
3456 @item mh-folder-msg-number
3457 Message number face.
3458 @c -------------------------
3459 @item mh-folder-refiled
3460 Refiled message face.
3461 @c -------------------------
3462 @vindex mh-scan-format-nmh
3463 @vindex mh-scan-sent-to-me-sender-regexp
3464 @item mh-folder-sent-to-me-hint
3465 Fontification hint face in messages sent directly to us. The detection
3466 of messages sent to us is governed by the scan format
3467 @code{mh-scan-format-nmh} and regular expression
3468 @code{mh-scan-sent-to-me-sender-regexp}.
3469 @c -------------------------
3470 @vindex mh-scan-format-nmh
3471 @vindex mh-scan-sent-to-me-sender-regexp
3472 @item mh-folder-scan-format
3473 Sender face in messages sent directly to us. The detection of messages
3474 sent to us is governed by the scan format @code{mh-scan-format-nmh}
3475 and regular expression @code{mh-scan-sent-to-me-sender-regexp}.
3476 @c -------------------------
3477 @item mh-folder-subject
3478 Subject face.
3479 @c -------------------------
3480 @item mh-folder-tick
3481 Ticked message face.
3482 @c -------------------------
3483 @item mh-folder-to
3484 @samp{To:} face.
3485 @end vtable
3486
3487 @vindex mh-folder-mode-hook
3488
3489 The hook @code{mh-folder-mode-hook} is called when visiting a new
3490 folder in MH-Folder mode. This could be used to set your own key
3491 bindings, for example:
3492
3493 @vindex mh-folder-mode-hook, example
3494
3495 @smalllisp
3496 @group
3497 (defvar my-mh-init-done nil
3498 "Non-nil when one-time MH-E settings made.")
3499
3500 (defun my-mh-folder-mode-hook ()
3501 "Hook to set key bindings in MH-Folder mode."
3502 (if (not my-mh-init-done) ; @r{only need to bind the keys once }
3503 (progn
3504 (local-set-key "//" 'my-search-msg)
3505 (local-set-key "b" 'mh-burst-digest) ; @r{better use of @kbd{b}}
3506 (setq my-mh-init-done t))))
3507
3508 (add-hook 'mh-folder-mode-hook 'my-mh-folder-mode-hook)
3509
3510 (defun my-search-msg ()
3511 "Search for a regexp in the current message."
3512 (interactive) ; @r{user function}
3513 (save-window-excursion
3514 (other-window 1) ; @r{go to next window}
3515 (isearch-forward-regexp))) ; @r{string search; hit return}
3516 ; @r{ when done}
3517
3518 @i{Create additional key bindings via mh-folder-mode-hook}
3519
3520 @end group
3521 @end smalllisp
3522
3523 @cindex @command{folder}
3524 @cindex @command{refile}
3525 @cindex MH commands, @command{folder}
3526 @cindex MH commands, @command{refile}
3527 @findex mh-refile-msg
3528 @kindex o
3529 @vindex mh-refile-msg-hook
3530
3531 MH-E has analogies for each of the MH @command{folder} and
3532 @command{refile} commands@footnote{See the sections
3533 @uref{@value{MH-BOOK-HOME}/fol.html#Youfol, Your Current Folder:
3534 folder} and @uref{@value{MH-BOOK-HOME}/fol.html#Movref, Moving and
3535 Linking Messages: refile} in the MH book.}. To refile a message in
3536 another folder, use the command @kbd{o} (@code{mh-refile-msg})
3537 (mnemonic: ``output''). You are prompted for the folder name
3538 (@pxref{Folder Selection}). Note that this command can also be used to
3539 create folders. If you specify a folder that does not exist, you will
3540 be prompted to create it. The hook @code{mh-refile-msg-hook} is called
3541 after a message is marked to be refiled.
3542
3543 @findex mh-write-msg-to-file
3544 @kindex !
3545
3546 If you are refiling several messages into the same folder, you can use
3547 the command @kbd{!} (@code{mh-refile-or-write-again}) to repeat the
3548 last refile or write (for the description of @kbd{>}
3549 (@code{mh-write-msg-to-file}), @pxref{Files and Pipes}). You can use a
3550 range in either case (for example, @kbd{C-u o 1 3 5-7 last:5 frombob
3551 @key{RET}}, @pxref{Ranges}).
3552
3553 @cindex expunging refiles and deletes
3554 @cindex undoing refiles and deletes
3555 @findex mh-undo
3556 @kindex u
3557
3558 If you've deleted a message or refiled it, but changed your mind, you
3559 can cancel the action before you've executed it. Use @kbd{u}
3560 (@code{mh-undo}) to undo a refile on or deletion of a single message.
3561 You can also undo refiles and deletes for messages that are found in a
3562 given range (@pxref{Ranges}).
3563
3564 @findex mh-undo-folder
3565 @kindex F u
3566
3567 Alternatively, you can use @kbd{F u} (@code{mh-undo-folder}) to undo
3568 all refiles and deletes in the current folder.
3569
3570 @findex mh-execute-commands
3571 @kindex x
3572
3573 If you've marked messages to be deleted or refiled and you want to go
3574 ahead and delete or refile the messages, use @kbd{x}
3575 (@code{mh-execute-commands}). Many MH-E commands that may affect the
3576 numbering of the messages (such as @kbd{F r} or @kbd{F p}) will ask if
3577 you want to process refiles or deletes first and then either run
3578 @kbd{x} for you or undo the pending refiles and deletes.
3579
3580 @kindex x
3581 @vindex mh-after-commands-processed-hook
3582 @vindex mh-before-commands-processed-hook
3583 @vindex mh-current-folder
3584
3585 The command @kbd{x} runs @code{mh-before-commands-processed-hook}
3586 before the commands are processed and
3587 @code{mh-after-commands-processed-hook} after the commands are
3588 processed. Variables that are useful with the former hook include
3589 @code{mh-delete-list} and @code{mh-refile-list} which can be used to
3590 see which changes will be made to the current folder,
3591 @code{mh-current-folder}. Variables that are useful with the latter
3592 hook include @code{mh-folders-changed}, which lists which folders were
3593 affected by deletes and refiles. This list will always include the
3594 current folder @code{mh-current-folder}.
3595
3596 @findex mh-copy-msg
3597 @kindex c
3598 @kindex o
3599
3600 If you wish to copy a message to another folder, you can use the
3601 command @kbd{c} (@code{mh-copy-msg}) (see the @option{-link} argument
3602 to @command{refile}(1)). Like the command @kbd{o}, this command
3603 prompts you for the name of the target folder and you can specify a
3604 range (@pxref{Ranges}). Note that unlike the command @kbd{o}, the copy
3605 takes place immediately. The original copy remains in the current
3606 folder.
3607
3608 @cindex junk mail
3609 @cindex MH-Folder mode
3610 @cindex MH-Folder Show mode
3611 @cindex modes, MH-Folder
3612 @cindex modes, MH-Folder Show
3613 @cindex spam
3614 @findex mh-toggle-showing
3615 @kindex t
3616
3617 The command @kbd{t} (@code{mh-toggle-showing}) switches between
3618 MH-Folder mode and MH-Folder Show mode@footnote{For you Emacs wizards,
3619 this is implemented as an Emacs minor mode.}. MH-Folder mode turns off
3620 the associated show buffer so that you can perform operations on the
3621 messages quickly without reading them. This is an excellent way to
3622 prune out your junk mail or to refile a group of messages to another
3623 folder for later examination.
3624
3625 @cindex MH-Folder mode
3626 @cindex MH-Show mode
3627 @cindex modes, MH-Folder
3628 @cindex modes, MH-Show
3629 @cindex moving between messages
3630 @kindex t
3631 @vindex mh-recenter-summary-flag
3632
3633 When you use @kbd{t} to toggle from MH-Folder Show mode to MH-Folder
3634 mode, the MH-Show buffer is hidden and the MH-Folder buffer is left
3635 alone. Setting @code{mh-recenter-summary-flag} to a non-@code{nil}
3636 value causes the toggle to display as many scan lines as possible,
3637 with the cursor at the middle. The effect of
3638 @code{mh-recenter-summary-flag} is rather useful, but it can be
3639 annoying on a slow network connection.
3640
3641 @findex mh-visit-folder
3642 @kindex F v
3643 @vindex mh-large-folder
3644
3645 When you want to read the messages that you have refiled into folders,
3646 use the command @kbd{F v} (@code{mh-visit-folder}) to visit the
3647 folder. You are prompted for the folder name. The folder buffer will
3648 show just unseen messages if there are any; otherwise, it will show
3649 all the messages in the buffer as long there are fewer than
3650 @code{mh-large-folder} messages. If there are more, then you are
3651 prompted for a range of messages to scan. You can provide a prefix
3652 argument in order to specify a range of messages to show when you
3653 visit the folder (@pxref{Ranges}). In this case, regions are not used
3654 to specify the range and @code{mh-large-folder} is ignored. Note that
3655 this command can also be used to create folders. If you specify a
3656 folder that does not exist, you will be prompted to create it.
3657
3658 @findex mh-search
3659 @kindex F s
3660
3661 If you forget where you've refiled your messages, you can find them
3662 using @kbd{F s} (@code{mh-search}). @xref{Searching}.
3663
3664 @cindex @command{procmail}
3665 @cindex @samp{unseen} sequence
3666 @cindex sequence, @samp{unseen}
3667 @cindex Unix commands, @command{procmail}
3668 @cindex unseen messages, viewing
3669 @findex mh-index-new-messages
3670 @kindex F n
3671 @vindex mh-new-messages-folders
3672
3673 If you use a program such as @command{procmail} to file your incoming
3674 mail automatically, you can display new, unseen, messages using the
3675 command @kbd{F n} (@code{mh-index-new-messages}). All messages in the
3676 @samp{unseen} sequence from the folders in
3677 @code{mh-new-messages-folders} are listed. However, this list of
3678 folders can be overridden with a prefix argument: with a prefix
3679 argument, enter a space-separated list of folders, or nothing to
3680 search all folders.
3681
3682 @cindex @samp{tick} sequence
3683 @cindex sequence, @samp{tick}
3684 @cindex ticked messages, viewing
3685 @findex mh-index-ticked-messages
3686 @kindex F '
3687 @vindex mh-ticked-messages-folders
3688
3689 If you have ticked messages (@pxref{Sequences}), you can display them
3690 using the command @kbd{F '} (@code{mh-index-ticked-messages}). All
3691 messages in the @samp{tick} sequence from the folders in
3692 @code{mh-ticked-messages-folders} are listed. With a prefix argument,
3693 enter a space-separated list of folders, or nothing to search all
3694 folders.
3695
3696 @findex mh-index-sequenced-messages
3697 @kindex F q
3698 @vindex mh-new-messages-folders
3699
3700 You can display messages in any sequence with the command @kbd{F q}
3701 (@code{mh-index-sequenced-messages}). All messages from the folders in
3702 @code{mh-new-messages-folders} in the sequence you provide are listed.
3703 With a prefix argument, enter a space-separated list of folders at the
3704 prompt, or nothing to search all folders.
3705
3706 @vindex mh-new-messages-folders
3707 @vindex mh-recursive-folders-flag
3708 @vindex mh-ticked-messages-folders
3709
3710 Set the options @code{mh-new-messages-folders} and
3711 @code{mh-ticked-messages-folders} to @samp{Inbox} to search the
3712 @samp{+inbox} folder or @samp{All} to search all of the top level
3713 folders. Otherwise, list the folders that should be searched with the
3714 @samp{Choose Folders} menu item. See @code{mh-recursive-folders-flag}.
3715
3716 @cindex buffers, @file{*MH-E Folders*}
3717 @cindex @file{*MH-E Folders*}
3718 @findex mh-kill-folder
3719 @findex mh-list-folders
3720 @findex mh-pack-folder
3721 @findex mh-rescan-folder
3722 @findex mh-sort-folder
3723 @kindex F k
3724 @kindex F l
3725 @kindex F p
3726 @kindex F r
3727 @kindex F S
3728
3729 Other commands you can perform on folders include: @kbd{F l}
3730 (@code{mh-list-folders}), to place a listing of all the folders in
3731 your mail directory in a buffer called @file{*MH-E Folders*}
3732 (@pxref{Miscellaneous}); @kbd{F k} (@code{mh-kill-folder}), to remove
3733 a folder; @kbd{F S} (@code{mh-sort-folder}), to sort the messages by
3734 date (see @command{sortm}(1) to see how to sort by other criteria);
3735 @kbd{F p} (@code{mh-pack-folder}), to pack a folder, removing gaps
3736 from the numbering sequence; and @kbd{F r} (@code{mh-rescan-folder}),
3737 to rescan the folder, which is useful to grab all messages in your
3738 @samp{+inbox} after processing your new mail for the first time. If
3739 you don't want to rescan the entire folder, the commands @kbd{F r} or
3740 @kbd{F p} will accept a range (@pxref{Ranges}).
3741
3742 @kindex F p
3743 @vindex mh-pack-folder-hook
3744
3745 The command @kbd{F p} runs @code{mh-pack-folder-hook} after
3746 renumbering the messages. A variable that is useful with this hook
3747 is @code{mh-current-folder}.
3748
3749 @kindex @key{TAB}
3750 @vindex mh-recursive-folders-flag
3751
3752 By default, operations on folders work only one level at a time. Set
3753 @code{mh-recursive-folders-flag} to non-@code{nil} to operate on all
3754 folders. This mostly means that you'll be able to see all your folders
3755 when you press @key{TAB} when prompted for a folder name.
3756
3757 @findex mh-search-p
3758 @kindex k
3759 @vindex mh-kill-folder-suppress-prompt-functions
3760
3761 The hook @code{mh-kill-folder-suppress-prompt-functions} is an abnormal
3762 hook run at the beginning of the command @kbd{k}. The hook functions
3763 are called with no arguments and should return a non-@code{nil} value to
3764 suppress the normal prompt when you remove a folder. This is useful
3765 for folders that are easily regenerated. The default value of
3766 @code{mh-search-p} suppresses the prompt on folders generated by
3767 searching.
3768
3769 @sp 1
3770 @center @strong{NOTE}
3771
3772 @quotation
3773 Use this hook with care. If there is a bug in your hook which returns
3774 @code{t} on @samp{+inbox} and you press @kbd{k} by accident in the
3775 @code{+inbox} folder, you will not be happy.
3776 @end quotation
3777 @sp 1
3778
3779 @cindex @command{sortm}
3780 @cindex @file{.mh_profile}
3781 @cindex files, @file{.mh_profile}
3782 @cindex MH commands, @command{sortm}
3783 @cindex MH profile component, @samp{sortm}
3784 @cindex @samp{sortm} MH profile component
3785 @kindex F S
3786 @vindex mh-sortm-args
3787
3788 The option @code{mh-sortm-args} holds extra arguments to pass on to
3789 the command @command{sortm}@footnote{See the section
3790 @uref{@value{MH-BOOK-HOME}/sorsor.html, Sorting Messages: sortm} in the
3791 MH book.} when a prefix argument is used with @kbd{F S}. Normally
3792 default arguments to @command{sortm} are specified in the MH profile.
3793 This option may be used to provide an alternate view. For example,
3794 @samp{'(\"-nolimit\" \"-textfield\" \"subject\")} is a useful setting.
3795
3796 @cindex exiting
3797 @cindex quitting
3798 @findex mh-quit
3799 @kindex q
3800
3801 When you want to quit using MH-E and go back to editing, you can use
3802 the @kbd{q} (@code{mh-quit}) command. This buries the buffers of the
3803 current MH-E folder and restores the buffers that were present when
3804 you first ran @kbd{M-x mh-rmail}. It also removes any MH-E working
3805 buffers whose name begins with @samp{ *mh-} or @file{*MH-E }
3806 (@pxref{Miscellaneous}). You can later restore your MH-E session by
3807 selecting the @samp{+inbox} buffer or by running @kbd{M-x mh-rmail}
3808 again.
3809
3810 @findex mh-execute-commands
3811 @kindex q
3812 @vindex mh-before-quit-hook
3813 @vindex mh-before-quit-hook, example
3814 @vindex mh-quit-hook
3815 @vindex mh-quit-hook, example
3816
3817 The two hooks @code{mh-before-quit-hook} and @code{mh-quit-hook} are
3818 called by @kbd{q}. The former one is called before the quit occurs, so
3819 you might use it to perform any MH-E operations; you could perform
3820 some query and abort the quit or call @code{mh-execute-commands}, for
3821 example. The latter is not run in an MH-E context, so you might use it
3822 to modify the window setup. If you find that @kbd{q} buries a lot of
3823 buffers that you would rather remove, you can use both
3824 @code{mh-before-quit-hook} and @code{mh-quit-hook} to accomplish that.
3825
3826 @smalllisp
3827 @group
3828 (defvar my-mh-folder-buffer-to-delete nil
3829 "Folder buffer that is being quit.")
3830
3831 (defun my-mh-before-quit-hook ()
3832 "Save folder buffer that is to be deleted."
3833 (setq my-mh-folder-buffer-to-delete (current-buffer)))
3834
3835 (defun my-mh-quit-hook ()
3836 "Kill folder buffer rather than just bury it."
3837 (set-buffer my-mh-folder-buffer-to-delete)
3838 (if (get-buffer mh-show-buffer)
3839 (kill-buffer mh-show-buffer))
3840 (kill-buffer (current-buffer)))
3841
3842 @i{Kill MH-Folder buffer instead of burying it}
3843 @end group
3844 @end smalllisp
3845
3846 @cindex folders, renaming
3847 @cindex renaming folders
3848 @findex dired
3849 @findex dired-do-rename
3850
3851 You can use dired to manipulate the folders themselves. For example, I
3852 renamed my @samp{+out} folder to the more common @samp{+outbox} by
3853 running dired on my mail directory (@kbd{M-x dired RET ~/Mail RET}),
3854 moving my cursor to @samp{out} and using the command @kbd{R}
3855 (@code{dired-do-rename}).
3856
3857 @node Sending Mail, Editing Drafts, Folders, Top
3858 @chapter Sending Mail
3859
3860 @cindex sending mail
3861 @findex mh-smail
3862 @kindex M-x mh-smail
3863
3864 You can send a mail message in several ways. You can call @kbd{M-x
3865 mh-smail} directly, or from the command line like this:
3866
3867 @cindex starting from command line
3868
3869 @smallexample
3870 $ @kbd{emacs -f mh-smail}
3871 @end smallexample
3872
3873 @findex goto-address-at-point
3874 @vindex mail-user-agent
3875
3876 There are some commands that need to send a mail message, such as
3877 @code{goto-address-at-point}. You can configure Emacs to have these
3878 commands use MH-E by setting the option @code{mail-user-agent} to
3879 @samp{Emacs interface to MH}.
3880
3881 @cindex @samp{Message} menu
3882 @cindex menu, @samp{Message}
3883
3884 From within MH-E's MH-Folder mode, other methods of sending mail are
3885 available as well. These can also be found in the @samp{Message} menu.
3886
3887 @table @kbd
3888 @cindex @samp{Message > Edit Message Again} menu item
3889 @cindex menu item, @samp{Message > Edit Message Again}
3890 @kindex e
3891 @findex mh-edit-again
3892 @item e
3893 Edit a message to send it again (@code{mh-edit-again}).
3894 @c -------------------------
3895 @cindex @samp{Message > Re-edit a Bounced Message} menu item
3896 @cindex menu item, @samp{Message > Re-edit a Bounced Message}
3897 @kindex E
3898 @findex mh-extract-rejected-mail
3899 @item E
3900 Edit a message that was returned by the mail system
3901 (@code{mh-extract-rejected-mail}).
3902 @c -------------------------
3903 @cindex @samp{Message > Forward Message...} menu item
3904 @cindex menu item, @samp{Message > Forward Message...}
3905 @kindex f
3906 @findex mh-forward
3907 @item f
3908 Forward message (@code{mh-forward}).
3909 @c -------------------------
3910 @cindex @samp{Message > Reply to Message...} menu item
3911 @cindex menu item, @samp{Message > Reply to Message...}
3912 @kindex r
3913 @findex mh-reply
3914 @item r
3915 Reply to a message (@code{mh-reply}).
3916 @c -------------------------
3917 @cindex @samp{Message > Compose a New Message} menu item
3918 @cindex menu item, @samp{Message > Compose a New Message}
3919 @kindex s
3920 @findex mh-send
3921 @item s
3922 Compose a message (@code{mh-send}).
3923 @c -------------------------
3924 @cindex @samp{Message > Redistribute Message...} menu item
3925 @cindex menu item, @samp{Message > Redistribute Message...}
3926 @kindex M-d
3927 @findex mh-redistribute
3928 @item M-d
3929 Redistribute a message (@code{mh-redistribute}).
3930 @c -------------------------
3931 @findex mh-smail
3932 @item M-x mh-smail
3933 Compose a message with the MH mail system.
3934 @c -------------------------
3935 @findex mh-smail-other-window
3936 @item M-x mh-smail-other-window
3937 Compose a message with the MH mail system in other window.
3938 @end table
3939
3940 @cindex @samp{mh-sending-mail} customization group
3941 @cindex customization group, @samp{mh-sending-mail}
3942
3943 In addition, several options from the @samp{mh-sending-mail}
3944 customization group are useful when sending mail or replying to mail.
3945 They are summarized in the following table.
3946
3947 @vtable @code
3948 @item mh-compose-forward-as-mime-flag
3949 On means that messages are forwarded as attachments (default:
3950 @samp{on}).
3951 @c -------------------------
3952 @item mh-compose-letter-function
3953 Hook run when starting a new draft (default: @code{nil}).
3954 @c -------------------------
3955 @item mh-compose-prompt-flag
3956 On means prompt for header fields when composing a new draft (default:
3957 @samp{off}).
3958 @c -------------------------
3959 @item mh-forward-subject-format
3960 Format string for forwarded message subject (default: @code{"%s:
3961 %s"}).
3962 @c -------------------------
3963 @item mh-insert-x-mailer-flag
3964 On means append an @samp{X-Mailer:} header field to the header
3965 (default: @samp{on}).
3966 @c -------------------------
3967 @item mh-redist-full-contents-flag
3968 On means the @command{dist} command needs entire letter for
3969 redistribution (default: @samp{off}).
3970 @c -------------------------
3971 @item mh-reply-default-reply-to
3972 Sets the person or persons to whom a reply will be sent (default:
3973 @samp{Prompt}).
3974 @c -------------------------
3975 @item mh-reply-show-message-flag
3976 On means the MH-Show buffer is displayed using @kbd{r}
3977 (@code{mh-reply}) (default: @samp{on}).
3978 @end vtable
3979
3980 The following hooks are available.
3981
3982 @vtable @code
3983 @item mh-annotate-msg-hook
3984 Hook run by @code{mh-annotate-msg} after annotation (default:
3985 @code{nil}).
3986 @c -------------------------
3987 @item mh-forward-hook
3988 Hook run by @code{mh-forward} on a forwarded letter (default:
3989 @code{nil}).
3990 @c -------------------------
3991 @item mh-letter-mode-hook
3992 Hook run by @code{mh-letter-mode} on a new letter (default:
3993 @code{nil}).
3994 @end vtable
3995
3996 @findex mh-annotate-msg
3997 @vindex mh-annotate-list
3998 @vindex mh-annotate-msg-hook
3999 @vindex mh-current-folder
4000
4001 A hook that is called whenever a message is sent and after the scan
4002 lines and message are annotated is @code{mh-annotate-msg-hook}. Hook
4003 functions can access the current folder name with
4004 @code{mh-current-folder} and obtain the message numbers of the
4005 annotated messages with @code{mh-annotate-list}.
4006
4007 The rest of the functions and options introduced here are explained in
4008 more detail in the following sections.
4009
4010 @menu
4011 * Composing::
4012 * Replying::
4013 * Forwarding::
4014 * Redistributing::
4015 * Editing Again::
4016 @end menu
4017
4018 @node Composing, Replying, Sending Mail, Sending Mail
4019 @section Composing
4020
4021 @cindex @file{.emacs}
4022 @cindex MH-Folder mode
4023 @cindex composing mail
4024 @cindex draft
4025 @cindex files, @file{.emacs}
4026 @cindex modes, MH-Folder
4027 @cindex sending mail
4028 @findex mh-smail
4029 @findex mh-smail-other-window
4030 @kindex M-x mh-smail
4031 @kindex M-x mh-smail-other-window
4032
4033 Outside of an MH-Folder buffer, you must call either @kbd{M-x
4034 mh-smail} or @kbd{M-x mh-smail-other-window} to compose a new message.
4035 The former command always creates a two-window layout with the current
4036 buffer on top and the draft on the bottom. Use the latter command if
4037 you would rather preserve the window layout. You may find adding the
4038 following key bindings to @file{~/.emacs} useful:
4039
4040 @smalllisp
4041 (global-set-key "\C-xm" 'mh-smail)
4042 (global-set-key "\C-x4m" 'mh-smail-other-window)
4043 @end smalllisp
4044
4045 @cindex draft folder
4046 @cindex MH-Letter mode
4047 @cindex modes, MH-Letter
4048 @findex mh-send
4049 @kindex m
4050
4051 From within a MH-Folder buffer, you can simply use the command @kbd{m}
4052 (@code{mh-send}). However you invoke @code{mh-send}, your letter
4053 appears in an Emacs buffer whose mode is MH-Letter (to see what the
4054 buffer looks like, @pxref{Sending Mail Tour}). MH-Letter mode allows
4055 you to edit your message, to check the validity of the recipients, to
4056 insert attachments and other messages into your message, and to send
4057 the message. We'll go more into depth about editing a
4058 @dfn{draft}@footnote{I highly recommend that you use a @dfn{draft
4059 folder} so that you can edit several drafts in parallel. To do so,
4060 create a folder named @samp{+drafts} for example, and add the profile
4061 component @samp{Draft-Folder: drafts} (see @code{mh-profile}(5)).} (a
4062 message you're composing) in just a moment (@pxref{Editing Drafts}).
4063
4064 @vindex mh-compose-prompt-flag
4065
4066 If you prefer to be prompted for the recipient and subject fields
4067 before the MH-Letter buffer appears, turn on the option
4068 @code{mh-compose-prompt-flag}.
4069
4070 @cindex header field, @samp{X-Mailer}
4071 @cindex @samp{X-Mailer} header field
4072 @vindex mh-insert-x-mailer-flag
4073
4074 MH-E adds an @samp{X-Mailer:} header field to the header that includes
4075 the version of MH-E and Emacs that you are using. If you don't want to
4076 participate in our marketing, you can turn off the option
4077 @code{mh-insert-x-mailer-flag}.
4078
4079 @cindex @command{repl}
4080 @cindex @file{components}
4081 @cindex MH commands, @command{repl}
4082 @cindex MH-Letter mode
4083 @cindex Mail mode
4084 @cindex files, @file{components}
4085 @cindex modes, MH-Letter
4086 @cindex modes, Mail
4087 @vindex mail-mode-hook
4088 @vindex mh-letter-mode-hook
4089 @vindex text-mode-hook
4090
4091 Two hooks are provided to run commands on your freshly created draft.
4092 The first hook, @code{mh-letter-mode-hook}, allows you to do some
4093 processing before editing a letter@footnote{Actually, because
4094 MH-Letter mode inherits from Mail mode, the hooks
4095 @code{text-mode-hook} and @code{mail-mode-hook} are run (in that
4096 order) before @code{mh-letter-mode-hook}.}. For example, you may wish
4097 to modify the header after @command{repl} has done its work, or you
4098 may have a complicated @file{components} file and need to tell MH-E
4099 where the cursor should go. Here's an example of how you would use
4100 this hook.
4101
4102 @findex mh-insert-signature, example
4103
4104 @smalllisp
4105 @group
4106 (defvar letter-mode-init-done-flag nil
4107 "Non-nil means one-time MH-E settings have been made.")
4108
4109 (defun my-mh-letter-mode-hook ()
4110 "Prepare letter for editing."
4111 (when (not letter-mode-init-done) ; @r{only need to bind the keys once}
4112 (local-set-key "\C-ctb" 'add-enriched-text)
4113 (local-set-key "\C-cti" 'add-enriched-text)
4114 (local-set-key "\C-ctf" 'add-enriched-text)
4115 (local-set-key "\C-cts" 'add-enriched-text)
4116 (local-set-key "\C-ctB" 'add-enriched-text)
4117 (local-set-key "\C-ctu" 'add-enriched-text)
4118 (local-set-key "\C-ctc" 'add-enriched-text)
4119 (setq letter-mode-init-done t))
4120 (save-excursion
4121 (goto-char (point-max)) ; @r{go to end of message to}
4122 (mh-insert-signature))) ; @r{insert signature}
4123
4124 @i{Prepare draft for editing via mh-letter-mode-hook}
4125
4126 @end group
4127 @end smalllisp
4128
4129 The function, @code{add-enriched-text} is defined in the example in
4130 @ref{Adding Attachments}.
4131
4132 @vindex mh-compose-letter-function
4133 @vindex mh-letter-mode-hook
4134
4135 The second hook, a function really, is
4136 @code{mh-compose-letter-function}. Like @code{mh-letter-mode-hook}, it
4137 is called just before editing a new message; however, it is the last
4138 function called before you edit your message. The consequence of this
4139 is that you can write a function to write and send the message for
4140 you. This function is passed three arguments: the contents of the
4141 @samp{To:}, @samp{Subject:}, and @samp{Cc:} header fields.
4142
4143 @node Replying, Forwarding, Composing, Sending Mail
4144 @section Replying to Mail
4145
4146 @cindex @command{mhl}
4147 @cindex @file{mhl.reply}
4148 @cindex MH commands, @command{mhl}
4149 @cindex files, @file{mhl.reply}
4150 @cindex replying
4151 @findex mh-reply
4152 @kindex r
4153
4154 To compose a reply to a message, use the @kbd{r} (@code{mh-reply})
4155 command.
4156
4157 When you reply to a message, you are first prompted with @samp{Reply
4158 to whom?}. You have several choices here.
4159
4160 @quotation
4161 @multitable @columnfractions .20 .80
4162 @c @headitem Response @tab Reply Goes To
4163 @c XXX @headitem not yet supported by SourceForge's texi2pdf.
4164 @item @b{Response} @tab @b{Reply Goes To}
4165 @c -------------------------
4166 @item @kbd{from}
4167 @tab
4168 The person who sent the message. This is the default, so @key{RET} is
4169 sufficient.
4170 @c -------------------------
4171 @item @kbd{to}
4172 @tab
4173 Replies to the sender, plus all recipients in the @samp{To:} header field.
4174 @c -------------------------
4175 @item @kbd{cc}@*@kbd{all}
4176 @tab
4177 Forms a reply to the addresses in the @samp{Mail-Followup-To:} header
4178 field if one exists; otherwise forms a reply to the sender, plus all
4179 recipients.
4180 @end multitable
4181 @end quotation
4182
4183 @cindex @command{repl}
4184 @cindex MH commands, @command{repl}
4185 @vindex mh-reply-default-reply-to
4186
4187 Depending on your answer, @command{repl}@footnote{See the section
4188 @uref{@value{MH-BOOK-HOME}/reprep.html, Replying to Messages: repl} in
4189 the MH book.} is given a different argument to form your reply.
4190 Specifically, a choice of @kbd{from} or none at all runs @samp{repl
4191 -nocc all}, and a choice of @kbd{to} runs @samp{repl -cc to}. Finally,
4192 either @kbd{cc} or @kbd{all} runs @samp{repl -cc all -nocc me}. If you
4193 find that most of the time you specify one of these choices when you
4194 reply to a message, you can change the option
4195 @code{mh-reply-default-reply-to} from its default value of
4196 @samp{Prompt} to one of the choices listed above. You can always edit
4197 the recipients in the draft.
4198
4199 @cindex @samp{repl} MH profile component
4200 @cindex MH profile component, @samp{repl}
4201 @cindex MH-Letter mode
4202 @cindex MH-Show mode
4203 @cindex draft
4204 @cindex modes, MH-Letter
4205 @cindex modes, MH-Show
4206
4207 Two windows are then created. One window contains the message to which
4208 you are replying in an MH-Show buffer. Your draft, in MH-Letter mode
4209 (@pxref{Editing Drafts}), is in the other window. If the reply draft
4210 was not one that you expected, check the things that affect the
4211 behavior of @command{repl} which include the @samp{repl:} profile
4212 component and the @file{replcomps} and @file{replgroupcomps} files.
4213
4214 If you supply a prefix argument (as in @kbd{C-u r}), the message you
4215 are replying to is inserted in your reply after having first been run
4216 through @command{mhl} with the format file @file{mhl.reply}. See
4217 @command{mhl}(1) or the section
4218 @uref{@value{MH-BOOK-HOME}/shomes.html#Usisho, Using mhl} in the MH
4219 book to see how you can modify the default @file{mhl.reply} file.
4220
4221 @vindex mh-yank-behavior
4222
4223 Alternatively, you can customize the option @code{mh-yank-behavior}
4224 and choose one of its @samp{Automatically} variants to do the same
4225 thing. @xref{Inserting Letter}. If you do so, the prefix argument has
4226 no effect.
4227
4228 Another way to include the message automatically in your draft is to
4229 use @samp{repl: -filter repl.filter} in your MH profile.
4230
4231 @vindex mh-reply-show-message-flag
4232
4233 If you include the message automatically, you can hide the MH-Show
4234 buffer by turning off the option @code{mh-reply-show-message-flag}.
4235
4236 If you wish to customize the header or other parts of the reply draft,
4237 please see @command{repl}(1) and @code{mh-format}(5).
4238
4239 @node Forwarding, Redistributing, Replying, Sending Mail
4240 @section Forwarding Mail
4241
4242 @cindex @command{forw}
4243 @cindex draft
4244 @cindex forwarding
4245 @cindex MH commands, @command{forw}
4246 @findex mh-forward
4247 @kindex f
4248 @vindex mh-forward-hook
4249
4250 To forward a message, use the @kbd{f} (@code{mh-forward}) command. You
4251 are prompted for the @samp{To:} and @samp{cc:} recipients. You are
4252 given a draft to edit that looks like it would if you had run the MH
4253 command @command{forw}@footnote{See the section
4254 @uref{@value{MH-BOOK-HOME}/forfor.html, Forwarding Messages: forw} in
4255 the MH book.}. You can then add some text (@pxref{Editing Drafts}).
4256 You can forward several messages by using a range (@pxref{Ranges}).
4257 All of the messages in the range are inserted into your draft. The
4258 hook @code{mh-forward-hook} is called on the draft.
4259
4260 @cindex @file{.mh_profile}
4261 @cindex files, @file{.mh_profile}
4262 @cindex MH profile component, @samp{forw}
4263 @cindex @samp{forw} MH profile component
4264 @vindex mh-compose-forward-as-mime-flag
4265
4266 By default, the option @code{mh-compose-forward-as-mime-flag} is on
4267 which means that the forwarded messages are included as attachments.
4268 These are inline attachments so the forwarded message should appear in
4269 the body of your recipient's mail program. If you would prefer to
4270 forward your messages verbatim (as text, inline), then turn off this
4271 option. Forwarding messages verbatim works well for short, textual
4272 messages, but your recipient won't be able to view any non-textual
4273 attachments that were in the forwarded message. Be aware that if you
4274 have @samp{forw: -mime} in your MH profile, then forwarded messages
4275 will always be included as attachments regardless of the settings of
4276 @code{mh-compose-forward-as-mime-flag}.
4277
4278 @vindex mh-forward-subject-format
4279
4280 The format of the @samp{Subject:} header field for forwarded messages
4281 is controlled by the option @code{mh-forward-subject-format}. This
4282 option is a string which includes two escapes (@samp{%s}). The first
4283 @samp{%s} is replaced with the sender of the original message, and the
4284 second one is replaced with the original @samp{Subject:}. The default
4285 value of @code{"%s: %s"} takes a message with the header:
4286
4287 @smallexample
4288 @group
4289 To: Bill Wohler <wohler@@stop.mail-abuse.org>
4290 Subject: Re: 49er football
4291 From: Greg DesBrisay <gd@@stop.mail-abuse.org>
4292 @end group
4293 @end smallexample
4294
4295 and creates a subject header field of:
4296
4297 @smallexample
4298 Subject: Greg DesBrisay: Re: 49er football
4299 @end smallexample
4300
4301 @node Redistributing, Editing Again, Forwarding, Sending Mail
4302 @section Redistributing Your Mail
4303
4304 @cindex @command{dist}
4305 @cindex MH commands, @command{dist}
4306 @cindex redistributing
4307 @findex mh-redistribute
4308 @kindex M-d
4309
4310 The command @kbd{M-d} (@code{mh-redistribute}) is similar in function
4311 to forwarding mail, but it does not allow you to edit the message, nor
4312 does it add your name to the @samp{From:} header field. It appears to
4313 the recipient as if the message had come from the original sender.
4314 When you run this command, you are prompted for the recipients.
4315
4316 @findex mh-edit-again
4317 @kindex e
4318
4319 For more information on redistributing messages, see
4320 @command{dist}(1). Also investigate the command @kbd{e}
4321 (@code{mh-edit-again}) for another way to redistribute messages
4322 (@pxref{Editing Again}).
4323
4324 @cindex @command{send}
4325 @cindex MH commands, @command{send}
4326 @vindex mh-redist-full-contents-flag
4327
4328 The option @code{mh-redist-full-contents-flag} must be turned on if
4329 @command{dist}@footnote{See the section
4330 @uref{@value{MH-BOOK-HOME}/disdis.html, Distributing Messages with
4331 dist} in the MH book.} requires the whole letter for redistribution,
4332 which is the case if @command{send}@footnote{See the section
4333 @uref{@value{MH-BOOK-HOME}/sensen.html, Sending Some Mail: comp send}
4334 in the MH book.} is compiled with the @sc{berk} option (which many
4335 people abhor). If you find that MH will not allow you to redistribute
4336 a message that has been redistributed before, turn off this option.
4337
4338 The hook @code{mh-annotate-msg-hook} is run after annotating the
4339 message and scan line (@pxref{Sending Mail}).
4340
4341 @node Editing Again, , Redistributing, Sending Mail
4342 @section Editing Old Drafts and Bounced Messages
4343
4344 @cindex @file{draft}
4345 @cindex files, @file{draft}
4346 @cindex re-editing drafts
4347 @findex mh-edit-again
4348 @kindex F v drafts
4349 @kindex e
4350 @kindex n
4351
4352 If you don't complete a draft for one reason or another, and if the
4353 draft buffer is no longer available, you can pick your draft up again
4354 with @kbd{e} (@code{mh-edit-again}). If you don't use a draft
4355 folder, your last @file{draft} file will be used. If you use draft
4356 folders, you'll need to visit the draft folder with @kbd{F v drafts
4357 @key{RET}}, use @kbd{n} to move to the appropriate message, and then
4358 use @kbd{e} to prepare the message for editing.
4359
4360 @kindex e
4361
4362 The @kbd{e} command can also be used to take messages that were sent
4363 to you and to send them to more people.
4364
4365 @cindex Mailer-Daemon
4366 @findex mh-extract-rejected-mail
4367 @kindex C-c C-c
4368 @kindex E
4369
4370 Don't use @kbd{e} to re-edit a message from a @i{Mailer-Daemon} who
4371 complained that your mail wasn't posted for some reason or another. In
4372 this case, use @kbd{E} (@code{mh-extract-rejected-mail}) to prepare
4373 the message for editing by removing the @i{Mailer-Daemon} envelope and
4374 unneeded header fields. Fix whatever addressing problem you had, and
4375 send the message again with @kbd{C-c C-c}.
4376
4377 @node Editing Drafts, Aliases, Sending Mail, Top
4378 @chapter Editing a Draft
4379
4380 @cindex @samp{Letter} menu
4381 @cindex MH-Letter mode
4382 @cindex draft
4383 @cindex editing draft
4384 @cindex menu, @samp{Letter}
4385 @cindex modes, MH-Letter
4386
4387 When you edit a message that you want to send (called a @dfn{draft} in
4388 this case), the mode used is MH-Letter. This mode provides several
4389 commands in addition to the normal Emacs editing commands to help you
4390 edit your draft. These can also be found in the @samp{Letter} menu.
4391
4392 @table @kbd
4393 @kindex @key{SPC}
4394 @findex mh-letter-complete-or-space
4395 @item @key{SPC}
4396 Perform completion or insert space (@code{mh-letter-complete-or-space}).
4397 @c -------------------------
4398 @kindex M-@key{TAB}
4399 @findex mh-letter-complete
4400 @item M-@key{TAB}
4401 Perform completion on header field or word preceding point
4402 (@code{mh-letter-complete}).
4403 @c -------------------------
4404 @kindex , (comma)
4405 @findex mh-letter-confirm-address
4406 @item , (comma)
4407 Flash alias expansion (@code{mh-letter-confirm-address}).
4408 @c -------------------------
4409 @kindex @key{TAB}
4410 @findex mh-letter-next-header-field-or-indent
4411 @item @key{TAB}
4412 Cycle to next field (@code{mh-letter-next-header-field-or-indent}).
4413 @c -------------------------
4414 @kindex S-@key{TAB}
4415 @findex mh-letter-previous-header-field
4416 @item S-@key{TAB}
4417 Cycle to the previous header field
4418 (@code{mh-letter-previous-header-field}).
4419 @c -------------------------
4420 @kindex C-c ?
4421 @findex mh-help
4422 @item C-c ?
4423 Display cheat sheet for the MH-E commands (@code{mh-help}).
4424 @c -------------------------
4425 @cindex @samp{Letter > Send This Draft} menu item
4426 @cindex menu item, @samp{Letter > Send This Draft}
4427 @kindex C-c C-c
4428 @findex mh-send-letter
4429 @item C-c C-c
4430 Save draft and send message (@code{mh-send-letter}).
4431 @c -------------------------
4432 @kindex C-c C-d
4433 @findex mh-insert-identity
4434 @item C-c C-d
4435 Insert fields specified by the given identity
4436 (@code{mh-insert-identity}). @xref{Identities}.
4437 @c -------------------------
4438 @cindex @samp{Letter > Pull in All Compositions (MH)} menu item
4439 @cindex menu item, @samp{Letter > Pull in All Compositions (MH)}
4440 @kindex C-c C-e
4441 @findex mh-mh-to-mime
4442 @item C-c C-e
4443 Compose @sc{mime} message from MH-style directives
4444 (@code{mh-mh-to-mime}).
4445 @c -------------------------
4446 @kindex C-c C-f C-a
4447 @kindex C-c C-f a
4448 @findex mh-to-field
4449 @item C-c C-f C-a
4450 @itemx C-c C-f a
4451 Move to @samp{Mail-Reply-To:} header field (@code{mh-to-field}).
4452 @c -------------------------
4453 @kindex C-c C-f C-b
4454 @kindex C-c C-f b
4455 @item C-c C-f C-b
4456 @itemx C-c C-f b
4457 Move to @samp{Bcc:} header field (@code{mh-to-field}).
4458 @c -------------------------
4459 @kindex C-c C-f C-c
4460 @kindex C-c C-f c
4461 @item C-c C-f C-c
4462 @itemx C-c C-f c
4463 Move to @samp{Cc:} header field (@code{mh-to-field}).
4464 @c -------------------------
4465 @kindex C-c C-f C-d
4466 @kindex C-c C-f d
4467 @item C-c C-f C-d
4468 @itemx C-c C-f d
4469 Move to @samp{Dcc:} header field (@code{mh-to-field}).
4470 @c -------------------------
4471 @kindex C-c C-f C-f
4472 @kindex C-c C-f f
4473 @findex mh-to-fcc
4474 @item C-c C-f C-f
4475 @itemx C-c C-f f
4476 Move to @samp{Fcc:} header field (@code{mh-to-fcc}).
4477 @c -------------------------
4478 @kindex C-c C-f C-l
4479 @kindex C-c C-f l
4480 @item C-c C-f C-l
4481 @itemx C-c C-f l
4482 Move to @samp{Mail-Followup-To:} header field (@code{mh-to-field}).
4483 @c -------------------------
4484 @kindex C-c C-f C-m
4485 @kindex C-c C-f m
4486 @item C-c C-f C-m
4487 @itemx C-c C-f m
4488 Move to @samp{From:} header field (@code{mh-to-field}).
4489 @c -------------------------
4490 @kindex C-c C-f C-r
4491 @kindex C-c C-f r
4492 @item C-c C-f C-r
4493 @itemx C-c C-f r
4494 Move to @samp{Reply-To:} header field (@code{mh-to-field}).
4495 @c -------------------------
4496 @kindex C-c C-f C-s
4497 @kindex C-c C-f s
4498 @item C-c C-f C-s
4499 @itemx C-c C-f s
4500 Move to @samp{Subject:} header field (@code{mh-to-field}).
4501 @c -------------------------
4502 @kindex C-c C-f C-t
4503 @kindex C-c C-f t
4504 @item C-c C-f C-t
4505 @itemx C-c C-f t
4506 Move to @samp{To:} header field (@code{mh-to-field}).
4507 @c -------------------------
4508 @cindex @samp{Letter > Insert a Message...} menu item
4509 @cindex menu item, @samp{Letter > Insert a Message...}
4510 @kindex C-c C-i
4511 @findex mh-insert-letter
4512 @item C-c C-i
4513 Insert a message (@code{mh-insert-letter}).
4514 @c -------------------------
4515 @kindex C-c C-m C-e
4516 @findex mh-mml-secure-message-encrypt
4517 @item C-c C-m C-e
4518 Add tag to encrypt the message (@code{mh-mml-secure-message-encrypt}).
4519 @c -------------------------
4520 @cindex @samp{Letter > Compose Forward...} menu item
4521 @cindex menu item, @samp{Letter > Compose Forward...}
4522 @kindex C-c C-m C-f
4523 @kindex C-c C-m f
4524 @findex mh-compose-forward
4525 @item C-c C-m C-f
4526 @itemx C-c C-m f
4527 Add tag to forward a message (@code{mh-compose-forward}).
4528 @c -------------------------
4529 @cindex @samp{Letter > Compose Get File (MH)...} menu item
4530 @cindex menu item, @samp{Letter > Compose Get File (MH)...}
4531 @kindex C-c C-m C-g
4532 @kindex C-c C-m g
4533 @findex mh-mh-compose-anon-ftp
4534 @item C-c C-m C-g
4535 @itemx C-c C-m g
4536 Add tag to include anonymous ftp reference to a file
4537 (@code{mh-mh-compose-anon-ftp}).
4538 @c -------------------------
4539 @cindex @samp{Letter > Compose Insertion...} menu item
4540 @cindex menu item, @samp{Letter > Compose Insertion...}
4541 @kindex C-c C-m C-i
4542 @kindex C-c C-m i
4543 @findex mh-compose-insertion
4544 @item C-c C-m C-i
4545 @itemx C-c C-m i
4546 Add tag to include a file such as an image or sound
4547 (@code{mh-compose-insertion}).
4548 @c -------------------------
4549 @cindex @samp{Letter > Pull in All Compositions (MML)} menu item
4550 @cindex menu item, @samp{Letter > Pull in All Compositions (MML)}
4551 @kindex C-c C-m C-m
4552 @kindex C-c C-m m
4553 @findex mh-mml-to-mime
4554 @item C-c C-m C-m
4555 @itemx C-c C-m m
4556 Compose @sc{mime} message from MML tags (@code{mh-mml-to-mime}).
4557 @c -------------------------
4558 @kindex C-c C-m C-n
4559 @kindex C-c C-m n
4560 @findex mh-mml-unsecure-message
4561 @item C-c C-m C-n
4562 @itemx C-c C-m n
4563 Remove any secure message tags (@code{mh-mml-unsecure-message}).
4564 @c -------------------------
4565 @kindex C-c C-m C-s
4566 @findex mh-mml-secure-message-sign
4567 @item C-c C-m C-s
4568 Add tag to sign the message (@code{mh-mml-secure-message-sign}).
4569 @c -------------------------
4570 @cindex @samp{Letter > Compose Compressed tar (MH)...} menu item
4571 @cindex menu item, @samp{Letter > Compose Compressed tar (MH)...}
4572 @kindex C-c C-m C-t
4573 @kindex C-c C-m t
4574 @findex mh-mh-compose-external-compressed-tar
4575 @item C-c C-m C-t
4576 @itemx C-c C-m t
4577 Add tag to include anonymous ftp reference to a compressed tar file
4578 (@code{mh-mh-compose-external-compressed-tar}).
4579 @c -------------------------
4580 @cindex @samp{Letter > Revert to Non-MIME Edit (MH)} menu item
4581 @cindex menu item, @samp{Letter > Revert to Non-MIME Edit (MH)}
4582 @kindex C-c C-m C-u
4583 @kindex C-c C-m u
4584 @findex mh-mh-to-mime-undo
4585 @item C-c C-m C-u
4586 @itemx C-c C-m u
4587 Undo effects of @kbd{C-c C-e} (@code{mh-mh-to-mime-undo}).
4588 @c -------------------------
4589 @kindex C-c C-m C-x
4590 @kindex C-c C-m x
4591 @findex mh-mh-compose-external-type
4592 @item C-c C-m C-x
4593 @itemx C-c C-m x
4594 Add tag to refer to a remote file
4595 (@code{mh-mh-compose-external-type}).
4596 @c -------------------------
4597 @kindex C-c C-m e e
4598 @findex mh-mml-secure-message-encrypt
4599 @item C-c C-m e e
4600 Add tag to encrypt the message (@code{mh-mml-secure-message-encrypt}).
4601 @c -------------------------
4602 @kindex C-c C-m e s
4603 @findex mh-mml-secure-message-signencrypt
4604 @item C-c C-m e s
4605 Add tag to encrypt and sign the message@*
4606 (@code{mh-mml-secure-message-signencrypt}).
4607 @c -------------------------
4608 @kindex C-c C-m s e
4609 @findex mh-mml-secure-message-signencrypt
4610 @item C-c C-m s e
4611 Add tag to encrypt and sign the message@*
4612 (@code{mh-mml-secure-message-signencrypt}).
4613 @c -------------------------
4614 @kindex C-c C-m s s
4615 @findex mh-mml-secure-message-sign
4616 @item C-c C-m s s
4617 Add tag to sign the message (@code{mh-mml-secure-message-sign}).
4618 @c -------------------------
4619 @cindex @samp{Letter > Split Current Line} menu item
4620 @cindex menu item, @samp{Letter > Split Current Line}
4621 @kindex C-c C-o
4622 @findex mh-open-line
4623 @item C-c C-o
4624 Insert a newline and leave point before it (@code{mh-open-line}).
4625 @c -------------------------
4626 @cindex @samp{Letter > Kill This Draft} menu item
4627 @cindex menu item, @samp{Letter > Kill This Draft}
4628 @kindex C-c C-q
4629 @findex mh-fully-kill-draft
4630 @item C-c C-q
4631 Quit editing and delete draft message (@code{mh-fully-kill-draft}).
4632 @c -------------------------
4633 @cindex @samp{Letter > Insert Signature} menu item
4634 @cindex menu item, @samp{Letter > Insert Signature}
4635 @kindex C-c C-s
4636 @findex mh-insert-signature
4637 @item C-c C-s
4638 Insert signature in message (@code{mh-insert-signature}).
4639 @c -------------------------
4640 @kindex C-c C-t
4641 @findex mh-letter-toggle-header-field-display
4642 @item C-c C-t
4643 Toggle display of header field at point
4644 (@code{mh-letter-toggle-header-field-display}).
4645 @c -------------------------
4646 @cindex @samp{Letter > Check Recipient} menu item
4647 @cindex menu item, @samp{Letter > Check Recipient}
4648 @kindex C-c C-w
4649 @findex mh-check-whom
4650 @item C-c C-w
4651 Verify recipients, showing expansion of any aliases
4652 (@code{mh-check-whom}).
4653 @c -------------------------
4654 @cindex @samp{Letter > Yank Current Message} menu item
4655 @cindex menu item, @samp{Letter > Yank Current Message}
4656 @kindex C-c C-y
4657 @findex mh-yank-cur-msg
4658 @item C-c C-y
4659 Insert the current message into the draft buffer
4660 (@code{mh-yank-cur-msg}).
4661 @c -------------------------
4662 @kindex C-c M-d
4663 @findex mh-insert-auto-fields
4664 @item C-c M-d
4665 Insert custom fields if recipient is found in
4666 @code{mh-auto-fields-list} (@code{mh-insert-auto-fields}).
4667 @xref{Identities}.
4668 @end table
4669
4670 @cindex @samp{mh-letter} customization group
4671 @cindex customization group, @samp{mh-letter}
4672
4673 Several options from the @samp{mh-letter} customization group are used
4674 while editing a draft.
4675
4676 @vtable @code
4677 @item mh-compose-insertion
4678 Type of @sc{mime} message tags in messages (default: @samp{MML} if
4679 available; otherwise @samp{MH}).
4680 @c -------------------------
4681 @item mh-compose-skipped-header-fields
4682 List of header fields to skip over when navigating in draft (default:
4683 @code{'("From"} @code{"Organization"} @code{"References"}
4684 @code{"In-Reply-To"} @code{"X-Face"} @code{"Face"}
4685 @code{"X-Image-URL"} @code{"X-Mailer")}.
4686 @c -------------------------
4687 @item mh-compose-space-does-completion-flag
4688 On means @key{SPC} does completion in message header (default:
4689 @samp{off}).
4690 @c -------------------------
4691 @item mh-delete-yanked-msg-window-flag
4692 On means delete any window displaying the message (default: @samp{off}).
4693 @c -------------------------
4694 @item mh-extract-from-attribution-verb
4695 Verb to use for attribution when a message is yanked by @kbd{C-c C-y}
4696 (default: @code{"wrote:"}).
4697 @c -------------------------
4698 @item mh-ins-buf-prefix
4699 String to put before each line of a yanked or inserted message
4700 (default: @code{"> "}).
4701 @c -------------------------
4702 @item mh-letter-complete-function
4703 Function to call when completing outside of address or folder fields
4704 (default: @code{ispell-complete-word}).
4705 @c -------------------------
4706 @item mh-letter-fill-column
4707 Fill column to use in MH-Letter mode (default: 72).
4708 @c -------------------------
4709 @item mh-mml-method-default
4710 Default method to use in security tags (default: @samp{PGP (MIME)} if
4711 support for it is available; otherwise @samp{None}).
4712 @c -------------------------
4713 @item mh-signature-file-name
4714 Source of user's signature (default: @code{"~/.signature"}).
4715 @c -------------------------
4716 @item mh-signature-separator-flag
4717 On means a signature separator should be inserted (default:
4718 @samp{on}).
4719 @c -------------------------
4720 @item mh-x-face-file
4721 File containing X-Face or Face header field to insert in outgoing mail.
4722 (default: @code{"~/.face"}).
4723 @c -------------------------
4724 @item mh-yank-behavior
4725 Controls which part of a message is yanked by @kbd{C-c C-y} (default:
4726 @samp{Body With Attribution}).
4727 @end vtable
4728
4729 The following hooks are available.
4730
4731 @vtable @code
4732 @item mail-citation-hook
4733 Hook for modifying a citation just inserted in the mail buffer
4734 (default: @code{nil}).
4735 @c -------------------------
4736 @item mh-before-send-letter-hook
4737 Hook run at the beginning of the @kbd{C-c C-c} command (default:
4738 @samp{nil}).
4739 @c -------------------------
4740 @item mh-mh-to-mime-hook
4741 Hook run on the formatted letter by @kbd{C-c C-e} (default:
4742 @samp{nil}).
4743 @c -------------------------
4744 @item mh-insert-signature-hook
4745 Hook run by @kbd{C-c C-s} after signature has been inserted (default:
4746 @code{nil}).
4747 @end vtable
4748
4749 The following face is available.
4750
4751 @vtable @code
4752 @item mh-letter-header-field
4753 Editable header field value face in draft buffers.
4754 @end vtable
4755
4756 The commands and options introduced here are explained in more
4757 detail in the following sections.
4758
4759 @menu
4760 * Editing Message::
4761 * Inserting Letter::
4762 * Inserting Messages::
4763 * Signature::
4764 * Picture::
4765 * Adding Attachments::
4766 * Sending PGP::
4767 * Checking Recipients::
4768 * Sending Message::
4769 * Killing Draft::
4770 @end menu
4771
4772 @node Editing Message, Inserting Letter, Editing Drafts, Editing Drafts
4773 @section Editing the Message
4774
4775 @cindex @samp{Bcc} header field
4776 @cindex @samp{Cc} header field
4777 @cindex @samp{Dcc} header field
4778 @cindex @samp{From} header field
4779 @cindex @samp{Mail-Followup-To} header field
4780 @cindex @samp{Mail-Reply-To} header field
4781 @cindex @samp{Reply-To} header field
4782 @cindex @samp{Subject} header field
4783 @cindex @samp{To} header field
4784 @cindex editing header
4785 @cindex header field, @samp{Bcc}
4786 @cindex header field, @samp{Cc}
4787 @cindex header field, @samp{Dcc}
4788 @cindex header field, @samp{From}
4789 @cindex header field, @samp{Mail-Followup-To}
4790 @cindex header field, @samp{Mail-Reply-To}
4791 @cindex header field, @samp{Reply-To}
4792 @cindex header field, @samp{Subject}
4793 @cindex header field, @samp{To}
4794 @findex mh-to-field
4795 @kindex C-c C-f C-t
4796 @kindex C-c C-f t
4797
4798 Because the header is part of the message, you can edit the header
4799 fields as you wish. However, several convenience commands exist to
4800 help you create and edit them. For example, the command @kbd{C-c C-f
4801 C-t} (@code{mh-to-field}; alternatively, @kbd{C-c C-f t}) moves the
4802 cursor to the @samp{To:} header field, creating it if necessary. The
4803 commands for moving to the @samp{Cc:}, @samp{Subject:}, @samp{From:},
4804 @samp{Reply-To:}, @samp{Mail-Reply-To:}, @samp{Mail-Followup-To},
4805 @samp{Bcc:}, and @samp{Dcc:} header fields are similar.
4806
4807 @findex mh-to-fcc
4808 @kindex C-c C-f C-f
4809 @kindex C-c C-f f
4810
4811 One command behaves differently from the others, namely, @kbd{C-c C-f
4812 C-f} (@code{mh-to-fcc}; alternatively, @kbd{C-c C-f f}). This command
4813 will prompt you for the folder name in which to file a copy of the
4814 draft. @xref{Folder Selection}.
4815
4816 @findex indent-relative
4817 @findex mh-letter-next-header-field-or-indent
4818 @findex mh-letter-previous-header-field
4819 @kindex @key{TAB}
4820 @kindex S-@key{TAB}
4821 @vindex mh-compose-skipped-header-fields
4822 @vindex mh-letter-header-field
4823
4824 Within the header of the message, the command@* @key{TAB}
4825 (@code{mh-letter-next-header-field-or-indent}) moves between fields
4826 that are highlighted with the face @code{mh-letter-header-field},
4827 skipping those fields listed in
4828 @code{mh-compose-skipped-header-fields}. After the last field, this
4829 command then moves point to the message body before cycling back to
4830 the first field. If point is already past the first line of the
4831 message body, then this command indents by calling
4832 @code{indent-relative} with the given prefix argument. The command
4833 @kbd{S-@key{TAB}} (@code{mh-letter-previous-header-field}) moves
4834 backwards between the fields and cycles to the body of the message
4835 after the first field. Unlike the command @key{TAB}, it will always
4836 take point to the last field from anywhere in the body.
4837
4838 @cindex alias completion
4839 @cindex completion
4840 @cindex spell check
4841 @findex ispell-complete-word
4842 @findex mh-letter-complete
4843 @findex mh-letter-complete-or-space
4844 @findex mh-letter-confirm-address
4845 @kindex , (comma)
4846 @kindex @key{SPC}
4847 @kindex M-@key{TAB}
4848 @vindex mh-alias-flash-on-comma
4849 @vindex mh-compose-space-does-completion-flag
4850 @vindex mh-letter-complete-function
4851
4852 If the field contains addresses (for example, @samp{To:} or
4853 @samp{Cc:}) or folders (for example, @samp{Fcc:}) then the command
4854 @kbd{M-@key{TAB}} (@code{mh-letter-complete}) will provide alias
4855 completion (@pxref{Aliases}). In the body of the message,
4856 @kbd{M-@key{TAB}} runs @code{mh-letter-complete-function} instead,
4857 which is set to @samp{'ispell-complete-word} by default. The command
4858 @kbd{M-@key{TAB}} (@code{mh-letter-complete}) takes a prefix argument
4859 that is passed to the @code{mh-letter-complete-function}. In addition,
4860 turn on the option @code{mh-compose-space-does-completion-flag} to use
4861 the command @key{SPC} (@code{mh-letter-complete-or-space}) to perform
4862 completion in the header as well; use a prefix argument to specify
4863 more than one space. Addresses are separated by a comma; when you
4864 press the comma, the command @code{mh-letter-confirm-address} flashes
4865 the alias expansion in the minibuffer if
4866 @code{mh-alias-flash-on-comma} is turned on.
4867
4868 @c XXX Document the replacement for the inaccessible 'long argument.
4869
4870 @findex mh-letter-toggle-header-field-display
4871 @kindex C-c C-t
4872
4873 Use the command @kbd{C-c C-t}
4874 @code{mh-letter-toggle-header-field-display} to display truncated
4875 header fields. This command is a toggle so entering it again will hide
4876 the field. This command takes a prefix argument: if negative then the
4877 field is hidden, if positive then the field is displayed (for example,
4878 @kbd{C-u C-c C-t}).
4879
4880 Be sure to leave a row of dashes or a blank line between the header
4881 and the body of the message.
4882
4883 @vindex mh-letter-fill-column
4884
4885 The body of the message is edited as you would edit any Emacs buffer
4886 although there are a few commands and options to assist you. You can
4887 change the fill column in MH-Letter mode with the option
4888 @code{mh-letter-fill-column}. By default, this option is 72 to allow
4889 others to quote your message without line wrapping.
4890
4891 @cindex filling paragraphs
4892 @cindex paragraphs, filling
4893 @findex fill-paragraph
4894 @kindex M-q
4895 @vindex mh-ins-buf-prefix
4896
4897 You'll often include messages that were sent from user agents that
4898 haven't yet realized that paragraphs consist of more than a single
4899 line. This makes for long lines that wrap in an ugly fashion. You'll
4900 find that @kbd{M-q} (@code{fill-paragraph}) works well even on these
4901 quoted messages, even if they are nested, just as long as all of the
4902 quotes match the value of @code{mh-ins-buf-prefix} (@pxref{Inserting
4903 Letter}). For example, let's assume you have the following in your
4904 draft:
4905
4906 @smallexample
4907 @group
4908 > Hopefully this gives you an idea of what I'm currently doing. I'm \
4909 not sure yet whether I'm completely satisfied with my setup, but \
4910 it's worked okay for me so far.
4911 @end group
4912 @end smallexample
4913
4914 Running @kbd{M-q} on this paragraph produces:
4915
4916 @smallexample
4917 @group
4918 > Hopefully this gives you an idea of what I'm currently doing. I'm not
4919 > sure yet whether I'm completely satisfied with my setup, but it's
4920 > worked okay for me so far.
4921 @end group
4922 @end smallexample
4923
4924 @findex mh-open-line
4925 @findex open-line
4926 @kindex C-c C-o
4927 @kindex C-o
4928
4929 The command @kbd{C-c C-o} (@code{mh-open-line}) is similar to the
4930 command @kbd{C-o} (@code{open-line}) in that it inserts a newline
4931 after point. It differs in that it also inserts the right number of
4932 quoting characters and spaces so that the next line begins in the same
4933 column as it was. This is useful when breaking up paragraphs in
4934 replies. For example, if this command was used when point was after
4935 the first period in the paragraph above, the result would be this:
4936
4937 @smallexample
4938 @group
4939 > Hopefully this gives you an idea of what I'm currently doing.
4940
4941 > I'm not
4942 > sure yet whether I'm completely satisfied with my setup, but it's
4943 > worked okay for me so far.
4944 @end group
4945 @end smallexample
4946
4947 @node Inserting Letter, Inserting Messages, Editing Message, Editing Drafts
4948 @section Inserting Letter to Which You're Replying
4949
4950 @cindex inserting messages
4951 @cindex replying to messages
4952 @cindex yanking messages
4953 @findex mh-yank-cur-msg
4954 @kindex C-c C-y
4955 @vindex mh-ins-buf-prefix
4956
4957 It is often useful to insert a snippet of text from a letter that
4958 someone mailed to provide some context for your reply. The command
4959 @kbd{C-c C-y} (@code{mh-yank-cur-msg}) does this by adding an
4960 attribution, yanking a portion of text from the message to which
4961 you're replying, and inserting @code{mh-ins-buf-prefix} (@samp{> })
4962 before each line.
4963
4964 @smallexample
4965 @group
4966 Michael W Thelen <thelenm@@stop.mail-abuse.org> wrote:
4967
4968 > Hopefully this gives you an idea of what I'm currently doing. I'm not
4969 > sure yet whether I'm completely satisfied with my setup, but it's
4970 > worked okay for me so far.
4971 @end group
4972 @end smallexample
4973
4974 @vindex mh-extract-from-attribution-verb
4975
4976 The attribution consists of the sender's name and email address
4977 followed by the content of the option
4978 @code{mh-extract-from-attribution-verb}. This option can be set to
4979 @samp{wrote:}, @samp{a écrit:}, and @samp{schrieb:}. You can also use
4980 the @samp{Custom String} menu item to enter your own verb.
4981
4982 @vindex mail-citation-hook
4983 @vindex mh-ins-buf-prefix
4984 @vindex mh-yank-behavior
4985
4986 The prefix @code{"> "} is the default setting for the option
4987 @code{mh-ins-buf-prefix}. I suggest that you not modify this option
4988 since it is used by many mailers and news readers: messages are far
4989 easier to read if several included messages have all been indented by
4990 the same string. This prefix is not inserted if you use one of the
4991 supercite flavors of @code{mh-yank-behavior} or you have added a
4992 @code{mail-citation-hook} as described below.
4993
4994 @vindex mh-delete-yanked-msg-window-flag
4995
4996 You can also turn on the @code{mh-delete-yanked-msg-window-flag}
4997 option to delete the window containing the original message after
4998 yanking it to make more room on your screen for your reply.
4999
5000 @cindex Emacs, packages, supercite
5001 @cindex supercite package
5002 @kindex r
5003 @vindex mail-citation-hook
5004 @vindex mh-yank-behavior
5005
5006 You can control how the message to which you are replying is yanked
5007 into your reply using @code{mh-yank-behavior}. To include the entire
5008 message, including the entire header, use @samp{Body and
5009 Header}@footnote{If you'd rather have the header cleaned up, use
5010 @kbd{C-u r} instead of @kbd{r} when replying
5011 (@pxref{Replying}).}@footnote{In the past you would use this setting
5012 and set @code{mail-citation-hook} to @samp{supercite}, but this usage
5013 is now deprecated in favor of the @samp{Invoke supercite} setting.}.
5014 Use @samp{Body} to yank just the body without the header. To yank only
5015 the portion of the message following the point, set this option to
5016 @samp{Below Point}.
5017
5018 Choose @samp{Invoke supercite}@footnote{@emph{Supercite} is a
5019 full-bodied, full-featured, citation package that comes standard with
5020 Emacs.} to pass the entire message and header through supercite.
5021
5022 @vindex mh-extract-from-attribution-verb
5023
5024 If the @samp{Body With Attribution} setting is used, then the message
5025 minus the header is yanked and a simple attribution line is added at
5026 the top using the value of the option
5027 @code{mh-extract-from-attribution-verb}. This is the default.
5028
5029 @kindex C-c C-y
5030 @vindex mh-delete-yanked-msg-window-flag
5031
5032 If the @samp{Invoke supercite} or @samp{Body With Attribution}
5033 settings are used, the @samp{-noformat} argument is passed to the
5034 @command{repl} program to override a @samp{-filter} or @samp{-format}
5035 argument. These settings also have @samp{Automatically} variants that
5036 perform the action automatically when you reply so that you don't need
5037 to use @kbd{C-c C-y} at all. Note that this automatic action is only
5038 performed if the show buffer matches the message being replied to.
5039 People who use the automatic variants tend to turn on the option
5040 @code{mh-delete-yanked-msg-window-flag} as well so that the show
5041 window is never displayed.
5042
5043 @vindex mh-yank-behavior
5044
5045 If the show buffer has a region, the option @code{mh-yank-behavior} is
5046 ignored unless its value is one of @samp{Attribution} variants in
5047 which case the attribution is added to the yanked region.
5048
5049 @findex trivial-cite
5050 @vindex mail-citation-hook
5051 @vindex mh-ins-buf-prefix
5052 @vindex mh-yank-behavior
5053
5054 If this isn't enough, you can gain full control over the appearance of
5055 the included text by setting @code{mail-citation-hook} to a function
5056 that modifies it. This hook is ignored if the option
5057 @code{mh-yank-behavior} is set to one of the supercite flavors.
5058 Otherwise, this option controls how much of the message is passed to
5059 the hook. The function can find the citation between point and mark
5060 and it should leave point and mark around the modified citation text
5061 for the next hook function. The standard prefix
5062 @code{mh-ins-buf-prefix} is not added if this hook is set.
5063
5064 @cindex Emacs, packages, trivial-cite
5065 @cindex trivial-cite package
5066 @vindex mh-yank-behavior
5067
5068 For example, if you use the hook function
5069 @uref{http://www.emacswiki.org/emacs/TrivialCite,
5070 @code{trivial-cite}} (which is NOT part of Emacs), set
5071 @code{mh-yank-behavior} to @samp{Body and Header}.
5072
5073 @node Inserting Messages, Signature, Inserting Letter, Editing Drafts
5074 @section Inserting Messages
5075
5076 @cindex inserting messages
5077 @findex mh-insert-letter
5078 @findex mh-yank-behavior
5079 @kindex C-c C-i
5080 @vindex mh-ins-buf-prefix
5081 @vindex mh-invisible-header-fields-compiled
5082 @vindex mh-yank-behavior
5083
5084 Messages can be inserted with @kbd{C-c C-i} (@code{mh-insert-letter}).
5085 This command prompts you for the folder and message number, which
5086 defaults to the current message in that folder. It then inserts the
5087 messages, indented by @code{mh-ins-buf-prefix} (@samp{> }) unless
5088 @code{mh-yank-behavior} is set to one of the supercite flavors in
5089 which case supercite is used to format the message. Certain
5090 undesirable header fields (see
5091 @code{mh-invisible-header-fields-compiled}) are removed before
5092 insertion.
5093
5094 If given a prefix argument (like @kbd{C-u C-c C-i}), the header is
5095 left intact, the message is not indented, and @samp{> } is not
5096 inserted before each line. This command leaves the mark before the
5097 letter and point after it.
5098
5099 @node Signature, Picture, Inserting Messages, Editing Drafts
5100 @section Inserting Your Signature
5101
5102 @cindex signature
5103 @findex mh-insert-signature
5104 @kindex C-c C-s
5105
5106 You can insert your signature at the current cursor location with the
5107 command @kbd{C-c C-s} (@code{mh-insert-signature}).
5108
5109 @cindex files, @file{.signature}
5110 @cindex @file{.signature}
5111 @cindex vCard
5112 @vindex mh-signature-file-name
5113
5114 By default, the text of your signature is taken from the file
5115 @file{~/.signature}. You can read from other sources by changing the
5116 option @code{mh-signature-file-name}. This file may contain a
5117 @dfn{vCard} in which case an attachment is added with the vCard.
5118
5119 @findex mh-signature-separator-p
5120 @vindex mh-signature-file-name
5121 @vindex mh-signature-separator
5122 @vindex mh-signature-separator-regexp
5123
5124 The option @code{mh-signature-file-name} may also be a symbol, in
5125 which case that function is called. You may not want a signature
5126 separator to be added for you; instead you may want to insert one
5127 yourself. Options that you may find useful to do this include
5128 @code{mh-signature-separator} (when inserting a signature separator)
5129 and @code{mh-signature-separator-regexp} (for finding said separator).
5130 The function @code{mh-signature-separator-p}, which reports @code{t}
5131 if the buffer contains a separator, may be useful as well.
5132
5133 @cindex signature separator
5134 @vindex mh-signature-separator-flag
5135
5136 A signature separator (@code{"-- "}) will be added if the signature
5137 block does not contain one and @code{mh-signature-separator-flag} is
5138 on. It is not recommended that you change this option since various
5139 mail user agents, including MH-E, use the separator to present the
5140 signature differently, and to suppress the signature when replying or
5141 yanking a letter into a draft.
5142
5143 @vindex mh-insert-signature-hook
5144 @vindex mh-signature-file-name
5145
5146 The hook @code{mh-insert-signature-hook} is run after the signature is
5147 inserted. Hook functions may access the actual name of the file or the
5148 function used to insert the signature with
5149 @code{mh-signature-file-name}.
5150
5151 The signature can also be inserted using Identities.
5152 @xref{Identities}.
5153
5154 @node Picture, Adding Attachments, Signature, Editing Drafts
5155 @section Inserting Your Picture
5156
5157 @cindex @file{.face}
5158 @cindex files, @file{.face}
5159 @vindex mh-x-face-file
5160
5161 You can insert your picture in the header of your mail message so that
5162 recipients see your face in the @samp{From:} header field if their
5163 mail user agent is sophisticated enough. In MH-E, this is done by
5164 placing your image in the file named by the option
5165 @code{mh-x-face-file} which is @file{~/.face} by default.
5166
5167 @cindex @samp{Face} header field
5168 @cindex @samp{X-Face} header field
5169 @cindex @samp{X-Image-URL} header field
5170 @cindex header field, @samp{Face}
5171 @cindex header field, @samp{X-Face}
5172 @cindex header field, @samp{X-Image-URL}
5173
5174 If the file starts with either of the strings @samp{X-Face:},
5175 @samp{Face:} or @samp{X-Image-URL:} then the contents are added to the
5176 message header verbatim. Otherwise it is assumed that the file
5177 contains the value of the @samp{X-Face:} header field.
5178
5179 @cindex @command{compface}
5180 @cindex Unix commands, @command{compface}
5181
5182 The @samp{X-Face:} header field, which is a low-resolution, black and
5183 white image, can be generated using the
5184 @uref{ftp://ftp.cs.indiana.edu/pub/faces/compface/compface.tar.Z,
5185 @command{compface}} command. The @uref{http://www.dairiki.org/xface/,
5186 @cite{Online X-Face Converter}} is a useful resource for quick
5187 conversion of images into @samp{X-Face:} header fields.
5188
5189 Use the @uref{http://quimby.gnus.org/circus/face/make-face,
5190 @command{make-face}} script to convert a JPEG image to the higher
5191 resolution, color, @samp{Face:} header field.
5192
5193 The URL of any image can be used for the @samp{X-Image-URL:} field and
5194 no processing of the image is required.
5195
5196 @vindex mh-x-face-file
5197
5198 To prevent the setting of any of these header fields, either set
5199 @code{mh-x-face-file} to @code{nil}, or simply ensure that the file
5200 defined by this option doesn't exist.
5201
5202 @xref{Viewing}, to see how these header fields are displayed in MH-E.
5203
5204 @node Adding Attachments, Sending PGP, Picture, Editing Drafts
5205 @section Adding Attachments
5206
5207 @cindex @command{mhbuild}
5208 @cindex @command{mhn}
5209 @cindex MH commands, @command{mhbuild}
5210 @cindex MH commands, @command{mhn}
5211 @cindex MIME
5212 @cindex multimedia mail
5213
5214 MH-E has the capability to create multimedia messages. It uses the
5215 @sc{mime} (Multipurpose Internet Mail Extensions)
5216 protocol@footnote{@sc{mime} is defined in
5217 @uref{http://www.rfc-editor.org/rfc/rfc2045.txt, RFC 2045}.} The
5218 @sc{mime} protocol allows you to incorporate images, sound, video,
5219 binary files, and even commands that fetch a file with @samp{ftp} when
5220 your recipient reads the message!
5221
5222 @kindex C-c C-m
5223
5224 If you were to create a multimedia message with plain MH commands, you
5225 would insert @command{mhbuild} or @command{mhn} directives (henceforth
5226 called @dfn{MH-style directives} into your draft and use the
5227 @command{mhbuild} command in nmh or @command{mhn} command in MH and
5228 GNU mailutils to expand them. MH-E works in much the same way,
5229 although it provides a handful of commands prefixed with @kbd{C-c C-m}
5230 to insert the directives so you don't need to remember the syntax of
5231 them. Remember: you can always add MH-style directives by
5232 hand@footnote{See the section
5233 @uref{@value{MH-BOOK-HOME}/usimim.html#SeMIMa, Sending MIME Mail} in
5234 the MH book.}.
5235
5236 @cindex MIME Meta Language (MML)
5237 @cindex MML
5238 @vindex mh-compose-insertion
5239
5240 In addition to MH-style directives, MH-E also supports MML (@sc{mime}
5241 Meta Language) tags@footnote{
5242 @ifinfo
5243 @c Although the third argument should default to the
5244 @c first, makeinfo goes to the wrong Info file without it being
5245 @c different--it seems to be getting our own Composing node.
5246 @xref{Composing,,Composing with MML,emacs-mime}.
5247 @end ifinfo
5248 @ifnotinfo
5249 See the section Composing in
5250 @uref{http://www.gnus.org/manual/emacs-mime.html, @cite{The Emacs MIME
5251 Manual}}.
5252 @end ifnotinfo
5253 }. The option @code{mh-compose-insertion} can be used to choose
5254 between them. By default, this option is set to @samp{MML} if it is
5255 supported since it provides a lot more functionality. This option can
5256 also be set to @samp{MH} if MH-style directives are preferred.
5257
5258 @cindex media types
5259 @cindex MIME, media types
5260
5261 The MH-E @sc{mime} commands require a @dfn{media type} for each body
5262 part or attachment. For example, a PDF document is of type
5263 @samp{application/pdf} and an HTML document is of type
5264 @samp{text/html}. Some commands fill in the media type for you,
5265 whereas others require you to enter one.
5266
5267 @cindex @command{file}
5268 @cindex @file{/etc/mime.types}
5269 @cindex files, @file{/etc/mime.types}
5270 @cindex Unix commands, @command{file}
5271 @findex mailcap-mime-types
5272
5273 In the cases where MH-E can do so, it will determine the media type
5274 automatically. It uses the @command{file} command to do this. Failing
5275 that, the Emacs function @code{mailcap-mime-types} is used to provide
5276 a list from which to choose. This function usually reads the file
5277 @file{/etc/mime.types}.
5278
5279 Whether the media type is chosen automatically, or you choose it from
5280 a list, use the type that seems to match best the file that you are
5281 including. In the case of binaries, the media type
5282 @samp{application/x-executable} can be useful. If you can't find an
5283 appropriate media type, use @samp{text/plain} for text messages and
5284 @samp{application/octet-stream} for everything else.
5285
5286 @cindex content description
5287 @cindex MIME, content description
5288
5289 You are also sometimes asked for a @dfn{content description}. This is
5290 simply an optional brief phrase, in your own words, that describes the
5291 object. If you don't care to enter a content description, just press
5292 return and none will be included; however, a reader may skip over
5293 multimedia fields unless the content description is compelling.
5294
5295 You can also create your own @sc{mime} body parts. In the following
5296 example, I describe how you can create and edit a @samp{text/enriched}
5297 body part to liven up your plain text messages with boldface,
5298 underlining, and italics. I include an Emacs function which inserts
5299 enriched text tags.
5300
5301 @smalllisp
5302 @group
5303 (defvar enriched-text-types '(("b" . "bold") ("i" . "italic")
5304 ("u" . "underline")
5305 ("s" . "smaller") ("B" . "bigger")
5306 ("f" . "fixed")
5307 ("c" . "center"))
5308 "Alist of (final-character . tag) choices for add-enriched-text.
5309 Additional types can be found in RFC 1563.")
5310
5311 (defun add-enriched-text (begin end)
5312 "Add enriched text tags around region.
5313 The tag used comes from the list enriched-text-types and is
5314 specified by the last keystroke of the command. When called from Lisp,
5315 arguments are BEGIN and END@."
5316 (interactive "r")
5317 ;; @r{Set type to the tag indicated by the last keystroke.}
5318 (let ((type (cdr (assoc (char-to-string (logior last-input-char ?@w{`}))
5319 enriched-text-types))))
5320 (save-restriction ; @r{restores state from narrow-to-region}
5321 (narrow-to-region begin end) ; @r{narrow view to region}
5322 (goto-char (point-min)) ; @r{move to beginning of text}
5323 (insert "<" type ">") ; @r{insert beginning tag}
5324 (goto-char (point-max)) ; @r{move to end of text}
5325 (insert "</" type ">")))) ; @r{insert terminating tag}
5326 @i{Emacs function for entering enriched text}
5327
5328 @end group
5329 @end smalllisp
5330
5331 To use the function @code{add-enriched-text}, first add it to
5332 @file{~/.emacs} and create key bindings for it (@pxref{Composing}).
5333
5334 Then, in your plain text message, set the mark with @kbd{C-@@} or
5335 @kbd{C-@key{SPC}}, type in the text to be highlighted, and type @kbd{C-c t
5336 b}. This adds @samp{<bold>} where you set the mark and adds
5337 @samp{</bold>} at the location of your cursor, giving you something
5338 like: @samp{You should be <bold>very</bold>}.
5339
5340 Before sending this message, use @kbd{C-c C-m C-m}
5341 (@code{mh-mml-to-mime})@footnote{Use @kbd{C-c C-e}
5342 (@code{mh-mh-to-mime}) if you're using MH-style directives.} to add
5343 MIME header fields. Then replace @samp{text/plain} with
5344 @samp{text/enriched} in the @samp{Content-Type:} header field.
5345
5346 You may also be interested in investigating @code{sgml-mode}.
5347
5348 @subheading Including Files
5349
5350 @cindex attachments, inserting
5351 @cindex images
5352 @cindex MIME, images
5353 @cindex MIME, sound
5354 @cindex MIME, video
5355 @cindex sound
5356 @cindex video
5357 @findex mh-compose-insertion
5358 @kindex C-c C-m C-i
5359 @kindex C-c C-m i
5360 @vindex mh-compose-insertion
5361
5362 Binaries, images, sound, and video can be inserted in your message
5363 with the command @kbd{C-c C-m C-i} (@code{mh-compose-insertion}). You
5364 are prompted for the filename containing the object, the media type if
5365 it cannot be determined automatically, and a content description. If
5366 you're using MH-style directives, you will also be prompted for
5367 additional attributes.
5368
5369 @subheading Forwarding Multimedia Messages
5370
5371 @findex mh-compose-forward
5372 @kindex C-c C-m C-f
5373 @kindex C-c C-m f
5374
5375 Mail may be forwarded with @sc{mime} using the command @kbd{C-c C-m
5376 C-f} (@code{mh-compose-forward}). You are prompted for a content
5377 description, the name of the folder in which the messages to forward
5378 are located, and a range of messages, which defaults to the current
5379 message in that folder. @xref{Ranges}.
5380
5381 @subheading Including an FTP Reference
5382
5383 @cindex @command{ftp}
5384 @cindex MIME, @command{ftp}
5385 @cindex Unix commands, @command{ftp}
5386 @findex mh-mh-compose-anon-ftp
5387 @kindex C-c C-m C-g
5388 @kindex C-c C-m g
5389
5390 You can have your message initiate an @command{ftp} transfer when the
5391 recipient reads the message. To do this, use the command @kbd{C-c C-m
5392 C-g} (@code{mh-mh-compose-anon-ftp}). You are prompted for the remote
5393 host and filename, the media type, and the content description.
5394
5395 @subheading Including tar Files
5396
5397 @cindex @command{ftp}
5398 @cindex @command{tar}
5399 @cindex MIME, @command{ftp}
5400 @cindex MIME, @command{tar}
5401 @cindex Unix commands, @command{ftp}
5402 @cindex Unix commands, @command{tar}
5403 @findex mh-mh-compose-anon-ftp
5404 @findex mh-mh-compose-external-compressed-tar
5405 @kindex C-c C-m C-g
5406 @kindex C-c C-m C-t
5407 @kindex C-c C-m t
5408
5409 If the remote file is a compressed tar file, you can use @kbd{C-c C-m
5410 C-t} (@code{mh-mh-compose-external-compressed-tar}). Then, in addition
5411 to retrieving the file via anonymous @emph{ftp} as per the command
5412 @kbd{C-c C-m C-g} (@code{mh-mh-compose-anon-ftp}), the file will also
5413 be uncompressed and untarred. You are prompted for the remote host and
5414 filename and the content description.
5415
5416 @subheading Including Other External Files
5417
5418 @findex mh-mh-compose-external-type
5419 @kindex C-c C-m C-x
5420 @kindex C-c C-m x
5421
5422 The command @kbd{C-c C-m C-x} (@code{mh-mh-compose-external-type}) is
5423 a general utility for referencing external files. In fact, all of the
5424 other commands that insert tags to access external files call this
5425 command. You are prompted for the access type, remote host and
5426 filename, and content type. If you provide a prefix argument, you are
5427 also prompted for a content description, attributes, parameters, and a
5428 comment.
5429
5430 @subheading Previewing Multimedia Messages
5431
5432 When you are finished editing a @sc{mime} message, it might look like this:
5433
5434 @cartouche
5435 @smallexample
5436 3 t08/24 root received fax files on Wed Aug 24 11:00:
5437 4+t08/24 To:wohler Test<<This is a test message to get the
5438
5439
5440
5441
5442
5443 --:%% @{+inbox@} 4 msgs (1-4) Bot L4 (MH-Folder Show)---------------
5444 To: wohler
5445 cc:
5446 Subject: Test of MIME
5447 --------
5448 Here is the SETI@@Home logo:
5449
5450 <#part type="image/x-xpm" filename="~/lib/images/setiathome.xpm"
5451 disposition=inline description="SETI@@home logo">
5452 <#/part>
5453 --:** @{draft@} All L8 (MH-Letter)----------------------------------
5454
5455 @end smallexample
5456 @end cartouche
5457 @i{MH-E @sc{mime} draft}
5458
5459 @findex mh-mml-to-mime
5460 @kindex C-c C-m C-m
5461 @kindex C-c C-m m
5462
5463 Typically, you send a message with attachments just like any other
5464 message (@pxref{Sending Message}).
5465
5466 @findex mh-mml-to-mime
5467 @kindex C-c C-m C-m
5468
5469 However, you may take a sneak preview of the @sc{mime} encoding if you
5470 wish by running the command @kbd{C-c C-m C-m} (@code{mh-mml-to-mime}).
5471 The following screen shows the @sc{mime} encoding specified by the
5472 tags. You can see why mail user agents are usually built to hide these
5473 details from the user.
5474
5475 @cartouche
5476 @smallexample
5477 To: wohler
5478 cc:
5479 Subject: Test of MIME
5480 X-Mailer: MH-E 8.1; nmh 1.1; GNU Emacs 23.1
5481 MIME-Version: 1.0
5482 Content-Type: multipart/mixed; boundary="=-=-="
5483 --------
5484 --=-=-=
5485
5486 Here is the SETI@@Home logo:
5487
5488
5489 --=-=-=
5490 Content-Type: image/x-xpm
5491 Content-Disposition: inline; filename=setiathome.xpm
5492 Content-Transfer-Encoding: base64
5493 Content-Description: SETI@@home logo
5494
5495 LyogWFBNICovCnN0YXRpYyBjaGFyICogc2V0aWF0aG9tZV94cG1bXSA9IHsKIjQ1IDQ1IDc2N
5496 --:-- @{draft@} Top L1 (MH-Letter)----------------------------------
5497
5498 @end smallexample
5499 @end cartouche
5500 @i{MH-E @sc{mime} draft ready to send}
5501
5502 @cindex undo effects of mh-mml-to-mime
5503
5504 This action can be undone by running @kbd{C-_} (@code{undo}).
5505
5506 @cindex @command{mhbuild}
5507 @cindex @command{mhn}
5508 @cindex MH commands, @command{mhbuild}
5509 @cindex MH commands, @command{mhn}
5510 @cindex undo effects of mh-mh-to-mime
5511 @findex mh-mh-to-mime
5512 @findex mh-mh-to-mime-undo
5513 @kindex C-c C-e
5514 @kindex C-c C-m C-m
5515 @kindex C-c C-m C-u
5516 @kindex C-c C-m u
5517
5518 If you're using MH-style directives, use @kbd{C-c C-e}
5519 (@code{mh-mh-to-mime}) instead of @kbd{C-c C-m C-m}. This runs the
5520 command @command{mhbuild} (@command{mhn}) on the message which expands
5521 the tags@footnote{See the section
5522 @uref{@value{MH-BOOK-HOME}/usimim.html#SeMIMa, Sending MIME Mail} in
5523 the MH book.}. This action can be undone by running @kbd{C-c C-m C-u}
5524 (@code{mh-mh-to-mime-undo}), which works by reverting to a backup
5525 file. You are prompted to confirm this action, but you can avoid the
5526 confirmation by adding an argument (for example, @kbd{C-u C-c C-m
5527 C-u}).
5528
5529 @kindex C-c C-e
5530 @vindex mh-mh-to-mime-args
5531
5532 If you wish to pass additional arguments to @command{mhbuild}
5533 (@command{mhn}) to affect how it builds your message, use the option
5534 @code{mh-mh-to-mime-args}. For example, you can build a consistency
5535 check into the message by setting @code{mh-mh-to-mime-args} to
5536 @samp{-check}. The recipient of your message can then run
5537 @samp{mhbuild -check} on the message---@command{mhbuild}
5538 (@command{mhn}) will complain if the message has been corrupted on the
5539 way. The command @kbd{C-c C-e} only consults this option when given a
5540 prefix argument (as in @kbd{C-u C-c C-e}).
5541
5542 @kindex C-c C-e
5543 @vindex mh-mh-to-mime-hook
5544
5545 The hook @code{mh-mh-to-mime-hook} is called after the message has
5546 been formatted by @kbd{C-c C-e}.
5547
5548 @node Sending PGP, Checking Recipients, Adding Attachments, Editing Drafts
5549 @section Signing and Encrypting Messages
5550
5551 @cindex signing messages
5552 @cindex encrypting messages
5553 @cindex RFC 3156
5554
5555 MH-E can sign and encrypt messages as defined in
5556 @uref{http://www.rfc-editor.org/rfc/rfc3156.txt, RFC 3156}. If you
5557 should choose to sign or encrypt your message, use one of the
5558 following commands to do so any time before sending your message.
5559
5560 @findex mh-mml-secure-message-encrypt
5561 @findex mh-mml-secure-message-sign
5562 @findex mh-mml-secure-message-signencrypt
5563 @kindex C-c C-m C-e
5564 @kindex C-c C-m C-s
5565 @kindex C-c C-m e e
5566 @kindex C-c C-m e s
5567 @kindex C-c C-m s e
5568 @kindex C-c C-m s s
5569
5570 The command @kbd{C-c C-m C-s} (@code{mh-mml-secure-message-sign})
5571 inserts the following tag:
5572
5573 @smallexample
5574 <#secure method=pgpmime mode=sign>
5575 @end smallexample
5576
5577 This is used to sign your message digitally. Likewise, the command
5578 @kbd{C-c C-m C-e} (@code{mh-mml-secure-message-encrypt}) inserts the
5579 following tag:
5580
5581 @smallexample
5582 <#secure method=pgpmime mode=encrypt>
5583 @end smallexample
5584
5585 This is used to encrypt your message. Finally, the command @kbd{C-c
5586 C-m s e} (@code{mh-mml-secure-message-signencrypt}) inserts the
5587 following tag:
5588
5589 @smallexample
5590 <#secure method=pgpmime mode=signencrypt>
5591 @end smallexample
5592
5593 @findex mh-mml-unsecure-message
5594 @kindex C-c C-m C-n
5595 @kindex C-c C-m n
5596 @vindex mh-mml-method-default
5597
5598 This is used to sign and encrypt your message. In each of these cases,
5599 a proper multipart message is created for you when you send the
5600 message. Use the command @kbd{C-c C-m C-n}
5601 (@code{mh-mml-unsecure-message}) to remove these tags. Use a prefix
5602 argument (as in @kbd{C-u C-c C-m s e}) to be prompted for one of the
5603 possible security methods (see @code{mh-mml-method-default}).
5604
5605 @vindex mh-mml-method-default
5606
5607 The option @code{mh-mml-method-default} is used to select between a
5608 variety of mail security mechanisms. The default is @samp{PGP (MIME)}
5609 if it is supported; otherwise, the default is @samp{None}. Other
5610 mechanisms include vanilla @samp{PGP} and @samp{S/MIME}.
5611
5612 @cindex @samp{pgg} customization group
5613 @cindex PGG
5614 @cindex customization group, @samp{pgg}
5615
5616 The @samp{pgg} customization group may have some settings which may
5617 interest you.
5618 @iftex
5619 See @cite{The PGG Manual}.
5620 @end iftex
5621 @ifinfo
5622 @xref{Top, , The PGG Manual, pgg, The PGG Manual}.
5623 @end ifinfo
5624 @ifhtml
5625 See
5626 @uref{http://www.gnu.org/software/emacs/manual/pgg.html,
5627 @cite{The PGG Manual}}.
5628 @end ifhtml
5629
5630 @cindex header field, @samp{Fcc}
5631 @cindex @samp{Fcc} header field
5632 @vindex pgg-encrypt-for-me
5633
5634 In particular, I turn on the option @code{pgg-encrypt-for-me} so that
5635 all messages I encrypt are encrypted with my public key as well. If
5636 you keep a copy of all of your outgoing mail with a @samp{Fcc:} header
5637 field, this setting is vital so that you can read the mail you write!
5638
5639 @node Checking Recipients, Sending Message, Sending PGP, Editing Drafts
5640 @section Checking Recipients
5641
5642 @cindex @file{*MH-E Recipients*}
5643 @cindex @command{whom}
5644 @cindex MH commands, @command{whom}
5645 @cindex buffers, @file{*MH-E Recipients*}
5646 @cindex checking recipients
5647 @cindex recipients, checking
5648 @findex mh-check-whom
5649 @kindex C-c C-w
5650
5651 The command @kbd{C-c C-w} (@code{mh-check-whom}) expands aliases so
5652 you can check the actual address(es) in the alias. A new buffer named
5653 @file{*MH-E Recipients*} is created with the output of @command{whom}
5654 (@pxref{Miscellaneous})@footnote{See the section
5655 @uref{@value{MH-BOOK-HOME}/senove.html#WhaPro, What now?---and the
5656 whatnow Program} in the MH book.}.
5657
5658 @node Sending Message, Killing Draft, Checking Recipients, Editing Drafts
5659 @section Sending a Message
5660
5661 @cindex buffers, @file{*MH-E Mail Delivery*}
5662 @cindex @file{*MH-E Mail Delivery*}
5663 @cindex sending mail
5664 @findex mh-send-letter
5665 @kindex C-c C-c
5666
5667 When you are all through editing a message, you send it with the
5668 command @kbd{C-c C-c} (@code{mh-send-letter}). You can give a prefix
5669 argument (as in @kbd{C-u C-c C-c}) to monitor the first stage of the
5670 delivery; this output can be found in a buffer called @file{*MH-E Mail
5671 Delivery*} (@pxref{Miscellaneous}).
5672
5673 @cindex sending mail
5674 @cindex spell check
5675 @findex ispell-message
5676 @kindex C-c C-c
5677 @vindex mh-before-send-letter-hook
5678
5679 The hook @code{mh-before-send-letter-hook} is run at the beginning of
5680 the command @kbd{C-c C-c}. For example, if you want to check your
5681 spelling in your message before sending, add the function
5682 @code{ispell-message}.
5683
5684 @cindex @command{send}
5685 @cindex MH commands, @command{send}
5686 @vindex mh-send-prog
5687
5688 In case the MH @command{send} program@footnote{See the section
5689 @uref{@value{MH-BOOK-HOME}/sensen.html, Sending Some Mail: comp send}
5690 in the MH book.} is installed under a different name, use
5691 @code{mh-send-prog} to tell MH-E the name.
5692
5693 The hook @code{mh-annotate-msg-hook} is run after annotating the
5694 message and scan line (@pxref{Sending Mail}).
5695
5696 @node Killing Draft, , Sending Message, Editing Drafts
5697 @section Killing the Draft
5698
5699 @cindex killing draft
5700 @findex kill-buffer
5701 @findex mh-fully-kill-draft
5702 @kindex C-c C-q
5703 @kindex C-x k
5704
5705 If for some reason you are not happy with the draft, you can use the
5706 command @kbd{C-c C-q} (@code{mh-fully-kill-draft}) to kill the draft
5707 buffer and delete the draft message. Use the command @kbd{C-x k}
5708 (@code{kill-buffer}) if you don't want to delete the draft message.
5709
5710 @node Aliases, Identities, Editing Drafts, Top
5711 @chapter Aliases
5712
5713 @cindex aliases
5714
5715 MH aliases are used in the same way in MH-E as they are in MH@. Any
5716 alias listed as a recipient will be expanded when the message is sent.
5717 This chapter discusses other things you can do with aliases in MH-E.
5718
5719 @cindex MH-Letter mode
5720 @cindex modes, MH-Letter
5721
5722 The following commands are available in MH-Letter mode with the
5723 exception of @code{mh-alias-reload} which can be called from anywhere.
5724
5725 @table @kbd
5726 @kindex @key{SPC}
5727 @findex mh-letter-complete-or-space
5728 @item @key{SPC}
5729 Perform completion or insert space (@code{mh-letter-complete-or-space}).
5730 @c -------------------------
5731 @kindex M-@key{TAB}
5732 @findex mh-letter-complete
5733 @item M-@key{TAB}
5734 Perform completion on header field or word preceding point
5735 (@code{mh-letter-complete}).
5736 @c -------------------------
5737 @findex mh-alias-apropos
5738 @item mh-alias-apropos
5739 Show all aliases or addresses that match a regular expression.
5740 @c -------------------------
5741 @findex mh-alias-grab-from-field
5742 @item mh-alias-grab-from-field
5743 Add alias for the sender of the current message
5744 @c -------------------------
5745 @findex mh-alias-reload
5746 @item mh-alias-reload
5747 Reload MH aliases.
5748 @end table
5749
5750 @cindex @samp{mh-alias} customization group
5751 @cindex customization group, @samp{mh-alias}
5752
5753 The @samp{mh-alias} customization group contains options associated
5754 with aliases.
5755
5756 @vtable @code
5757 @item mh-alias-completion-ignore-case-flag
5758 On means don't consider case significant in MH alias completion
5759 (default: @samp{on}).
5760 @c -------------------------
5761 @item mh-alias-expand-aliases-flag
5762 On means to expand aliases entered in the minibuffer (default:
5763 @samp{off}).
5764 @c -------------------------
5765 @item mh-alias-flash-on-comma
5766 Specify whether to flash address or warn on translation (default: @samp{Flash
5767 but Don't Warn If No Alias}).
5768 @c -------------------------
5769 @item mh-alias-insert-file
5770 Filename used to store a new MH-E alias (default: @samp{Use Aliasfile
5771 Profile Component}).
5772 @c -------------------------
5773 @item mh-alias-insertion-location
5774 Specifies where new aliases are entered in alias files (default:
5775 @samp{Alphabetical}).
5776 @c -------------------------
5777 @item mh-alias-local-users
5778 If @samp{on}, local users are added to alias completion (default:
5779 @samp{on}).
5780 @c -------------------------
5781 @item mh-alias-local-users-prefix
5782 String prefixed to the real names of users from the password file
5783 (default: @code{"local."}.
5784 @c -------------------------
5785 @item mh-alias-passwd-gecos-comma-separator-flag
5786 On means the GECOS field in the password file uses a comma separator
5787 (default: @samp{on}).
5788 @end vtable
5789
5790 The following hook is available.
5791
5792 @vtable @code
5793 @item mh-alias-reloaded-hook
5794 Hook run by @code{mh-alias-reload} after loading aliases (default:
5795 @code{nil}).
5796 @end vtable
5797
5798 @subheading Adding Addresses to Draft
5799
5800 You can use aliases when you are adding recipients to a message.
5801
5802 @findex minibuffer-complete
5803 @kindex @key{TAB}
5804 @vindex mh-alias-expand-aliases-flag
5805 @vindex mh-compose-prompt-flag
5806
5807 In order to use minibuffer prompting for recipients and the subject
5808 line in the minibuffer, turn on the option
5809 @code{mh-compose-prompt-flag} (@pxref{Composing}), and use the
5810 @key{TAB} (@code{minibuffer-complete}) command to complete aliases
5811 (and optionally local logins) when prompted for the recipients. Turn
5812 on the option @code{mh-alias-expand-aliases-flag} if you want these
5813 aliases to be expanded to their respective addresses in the draft.
5814
5815 @findex mh-letter-complete
5816 @findex mh-letter-complete-or-space
5817 @kindex @key{SPC}
5818 @kindex M-@key{TAB}
5819
5820 Otherwise, you can complete aliases in the header of the draft with
5821 @kbd{M-@key{TAB}} (@code{mh-letter-complete}) or @key{SPC}
5822 (@code{mh-letter-complete-or-space}).
5823
5824 @vindex mh-alias-completion-ignore-case-flag
5825
5826 As MH ignores case in the aliases, so too does MH-E@. However, you may
5827 turn off the option @code{mh-alias-completion-ignore-case-flag} to
5828 make case significant which can be used to segregate completion of
5829 your aliases. You might use uppercase for mailing lists and lowercase
5830 for people. For example, you might have:
5831
5832 @smallexample
5833 mark.baushke: Mark Baushke <mdb@@stop.mail-abuse.org>
5834 MH-E: MH-E Mailing List <mh-e-devel@@stop.mail-abuse.org>
5835 @end smallexample
5836
5837 When this option is turned off, if you were to type @kbd{M} in the
5838 @samp{To:} field and then @kbd{M-@key{TAB}}, then you'd get the list;
5839 if you started with @kbd{m} and then entered @kbd{M-@key{TAB}}, then
5840 you'd get Mark's address. Note that this option affects completion
5841 only. If you were to enter @kbd{Mark.Baushke}, it would still be
5842 identified with your @samp{mark.baushke} alias.
5843
5844 @findex mh-alias-minibuffer-confirm-address
5845 @findex mh-letter-confirm-address
5846 @vindex mh-alias-flash-on-comma
5847 @vindex mh-compose-prompt-flag
5848
5849 To verify that the alias you've entered is valid, the alias will be
5850 displayed in the minibuffer when you type a comma
5851 (@code{mh-letter-confirm-address} or
5852 @code{mh-alias-minibuffer-confirm-address} if the option
5853 @code{mh-compose-prompt-flag} is turned on). @xref{Composing}. This
5854 behavior can be controlled with the option
5855 @code{mh-alias-flash-on-comma} which provides three choices:
5856 @samp{Flash but Don't Warn If No Alias}, @samp{Flash and Warn If No
5857 Alias}, and @samp{Don't Flash Nor Warn If No Alias}.
5858
5859 For another way to verify the alias expansion, see @ref{Checking
5860 Recipients}.
5861
5862 @subheading Loading Aliases
5863
5864 @cindex @command{ali}
5865 @cindex @file{/etc/nmh/MailAliases}
5866 @cindex @samp{Aliasfile} MH profile component
5867 @cindex MH commands, @command{ali}
5868 @cindex MH profile component, @samp{Aliasfile}
5869 @cindex files, @file{/etc/nmh/MailAliases}
5870
5871 MH-E loads aliases for completion and folder name hints from various
5872 places. It uses the MH command @command{ali}@footnote{See the section
5873 @uref{@value{MH-BOOK-HOME}/mh.html, MH Aliases} in the MH book.} to
5874 read aliases from the files listed in the profile component
5875 @samp{Aliasfile:} as well as system-wide aliases (for example,
5876 @file{/etc/nmh/MailAliases}).
5877
5878 @cindex @file{/etc/passwd}
5879 @cindex files, @file{/etc/passwd}
5880
5881 In addition, aliases are created from @file{/etc/passwd} entries with
5882 a user ID larger than a magical number, typically 200. This can be a
5883 handy tool on a machine where you and co-workers exchange messages.
5884 These aliases have the form @samp{local.@var{first.last}} if a real
5885 name is present in the password file. Otherwise, the alias will have
5886 the form @samp{local.@var{login}}.
5887
5888 @vindex mh-alias-local-users-prefix
5889
5890 The prefix @samp{local.} can be modified via the option
5891 @code{mh-alias-local-users-prefix}. This option can also be set to
5892 @samp{Use Login}.
5893
5894 For example, consider the following password file entry:
5895
5896 @smallexample
5897 psg:x:1000:1000:Peter S Galbraith,,,:/home/psg:/bin/tcsh
5898 @end smallexample
5899
5900 @vindex mh-alias-local-users-prefix
5901
5902 The following settings of option @code{mh-alias-local-users-prefix}
5903 will produce the associated aliases:
5904
5905 @table @code
5906 @item "local."
5907 local.peter.galbraith
5908 @c -------------------------
5909 @item ""
5910 peter.galbraith
5911 @c -------------------------
5912 @item Use Login
5913 psg
5914 @end table
5915
5916 @vindex mh-alias-passwd-gecos-comma-separator-flag
5917
5918 In the example above, commas are used to separate different values
5919 within the so-called GECOS field. This is a fairly common usage.
5920 However, in the rare case that the GECOS field in your password file
5921 is not separated by commas and whose contents may contain commas, you
5922 can turn the option @code{mh-alias-passwd-gecos-comma-separator-flag}
5923 off.
5924
5925 @cindex NIS, obtaining local aliases from
5926 @cindex @samp{ypcat passwd}
5927 @vindex mh-alias-local-users
5928
5929 If you're on a system with thousands of users you don't know, and the
5930 loading of local aliases slows MH-E down noticeably, then the local
5931 alias feature can be disabled by turning off the option
5932 @code{mh-alias-local-users}. This option also takes a string which is
5933 executed to generate the password file. For example, use @samp{ypcat
5934 passwd} to obtain the NIS password file.
5935
5936 @findex mh-alias-reload
5937 @kindex M-x mh-alias-reload
5938 @vindex mh-alias-reloaded-hook
5939
5940 Since aliases are updated frequently, MH-E reloads aliases
5941 automatically whenever an alias lookup occurs if an alias source has
5942 changed. However, you can reload your aliases manually by calling the
5943 command @kbd{M-x mh-alias-reload} directly. This command runs
5944 @code{mh-alias-reloaded-hook} after the aliases have been loaded.
5945
5946 @subheading Adding Aliases
5947
5948 In the past, you have manually added aliases to your alias file(s)
5949 listed in your @samp{Aliasfile:} profile component. MH-E provides
5950 other methods for maintaining your alias file(s).
5951
5952 @findex mh-alias-add-alias
5953 @kindex M-x mh-alias-add-alias
5954
5955 You can use the @kbd{M-x mh-alias-add-alias} command which will prompt
5956 you for the alias and address that you would like to add. If the alias
5957 exists already, you will have the choice of inserting the new alias
5958 before or after the old alias. In the former case, this alias will be
5959 used when sending mail to this alias. In the latter case, the alias
5960 serves as an additional folder name hint when filing messages
5961 (@pxref{Folder Selection}).
5962
5963 Earlier, the alias prefix @samp{local} was presented. You can use
5964 other prefixes to organize your aliases or disambiguate entries. You
5965 might use prefixes for locales, jobs, or activities. For example, I
5966 have:
5967
5968 @smallexample
5969 @group
5970 ; Work
5971 attensity.don.mitchell: Don Mitchell <dmitchell@@stop.mail-abuse.com>
5972 isharp.don.mitchell: Don Mitchell <donaldsmitchell@@stop.mail-abuse.com>
5973 ...
5974 ; Sport
5975 diving.ken.mayer: Ken Mayer <kmayer@@stop.mail-abuse.com>
5976 sailing.mike.maloney: Mike Maloney <mmaloney@@stop.mail-abuse.com>
5977 ...
5978 ; Personal
5979 ariane.kolkmann: Ariane Kolkmann <ArianeKolkmann@@stop.mail-abuse.com>
5980 ...
5981 @end group
5982 @end smallexample
5983
5984 Using prefixes instead of postfixes helps you explore aliases during
5985 completion. If you forget the name of an old dive buddy, you can enter
5986 @samp{div} and then @key{SPC} to get a listing of all your dive buddies.
5987
5988 @kindex M-x mh-alias-add-address-under-point
5989 @kindex M-x mh-alias-grab-from-field
5990
5991 An alias for the sender of the current message is added automatically
5992 by clicking on the @samp{Grab From alias} tool bar button or by running
5993 the @kbd{M-x mh-alias-grab-from-field} command. Aliases for other
5994 recipients of the current message are added by placing your cursor
5995 over the desired recipient and giving the @kbd{M-x
5996 mh-alias-add-address-under-point} command.
5997
5998 @vindex mh-alias-insert-file
5999 @vindex mh-alias-insertion-location
6000
6001 The options @code{mh-alias-insert-file} and
6002 @code{mh-alias-insertion-location} controls how and where these aliases
6003 are inserted.
6004
6005 @vindex mh-alias-insert-file
6006
6007 The default setting of option @code{mh-alias-insert-file} is @samp{Use
6008 Aliasfile Profile Component}. This option can also hold the name of a
6009 file or a list a file names. If this option is set to a list of file
6010 names, or the @samp{Aliasfile:} profile component contains more than
6011 one file name, MH-E will prompt for one of them.
6012
6013 @vindex mh-alias-insertion-location
6014
6015 The option @code{mh-alias-insertion-location} is set to
6016 @samp{Alphabetical} by default. If you organize your alias file in
6017 other ways, then the settings @samp{Top} and @samp{Bottom} might be
6018 more appropriate.
6019
6020 @subheading Querying Aliases
6021
6022 @cindex regular expressions, @code{mh-alias-apropos}
6023 @findex mh-alias-apropos
6024 @kindex M-x mh-alias-apropos
6025
6026 If you can't quite remember an alias, you can use @kbd{M-x
6027 mh-alias-apropos} to show all aliases or addresses that match a
6028 regular expression
6029 @ifnothtml
6030 (@pxref{Regexps, , Syntax of Regular Expressions, emacs, The
6031 GNU Emacs Manual}).
6032 @end ifnothtml
6033 @ifhtml
6034 (see the section
6035 @uref{http://www.gnu.org/software/emacs/manual/html_node/emacs/Regexps.html,
6036 Syntax of Regular Expressions} in
6037 @cite{The GNU Emacs Manual}).
6038 @end ifhtml
6039
6040 @node Identities, Speedbar, Aliases, Top
6041 @chapter Identities
6042
6043 @cindex identities
6044 @cindex multiple personalities
6045
6046 MH-E supports the concept of multiple personalities or identities.
6047 This means that you can easily have a different header and signature
6048 at home and at work.
6049
6050 @cindex @samp{Identity} menu
6051 @cindex menu, @samp{Identity}
6052
6053 A couple of commands are used to insert identities in MH-Letter mode
6054 which are also found in the @samp{Identity} menu.
6055
6056 @table @kbd
6057 @kindex C-c C-d
6058 @findex mh-insert-identity
6059 @item C-c C-d
6060 Insert fields specified by given identity (@code{mh-insert-identity}).
6061 @c -------------------------
6062 @cindex @samp{Identity > Insert Auto Fields} menu item
6063 @cindex menu item, @samp{Identity > Insert Auto Fields}
6064 @kindex C-c M-d
6065 @findex mh-insert-auto-fields
6066 @item C-c M-d
6067 Insert custom fields if recipient found in @code{mh-auto-fields-list}
6068 (@code{mh-insert-auto-fields}).
6069 @end table
6070
6071 @cindex @samp{mh-identity} customization group
6072 @cindex customization group, @samp{mh-identity}
6073
6074 The @samp{mh-identity} customization group contains the following
6075 options.
6076
6077 @vtable @code
6078 @item mh-auto-fields-list
6079 List of recipients for which header lines are automatically inserted
6080 (default: @code{nil}).
6081 @c -------------------------
6082 @item mh-auto-fields-prompt-flag
6083 On means to prompt before sending if fields inserted (default:
6084 @samp{on})
6085 @c -------------------------
6086 @item mh-identity-default
6087 Default identity to use when @code{mh-letter-mode} is called (default:
6088 @samp{None}).
6089 @c -------------------------
6090 @item mh-identity-handlers
6091 Handler functions for fields in @code{mh-identity-list}.
6092 @c -------------------------
6093 @item mh-identity-list
6094 List of identities (default: @code{nil}).
6095 @end vtable
6096
6097 Some of the common header fields that people change depending on the
6098 context are the @samp{From:} and @samp{Organization:} fields, as well
6099 as the signature.
6100
6101 @vindex mh-identity-list
6102
6103 This is done by customizing the option @code{mh-identity-list}. In the
6104 customization buffer for this option, click on the @samp{INS} button
6105 and enter a label such as @samp{Home} or @samp{Work}. Then click on
6106 the @samp{INS} button with the label @samp{Add at least one item
6107 below}. The @samp{Value Menu} has the following menu items:
6108
6109 @table @samp
6110 @cindex header field, @samp{From}
6111 @cindex @samp{From} header field
6112 @item From Field
6113 Specify an alternate @samp{From:} header field. You must include a
6114 valid email address. A standard format is @samp{First Last
6115 <login@@host.domain>}. If you use an initial with a period, then you
6116 must quote your name as in @samp{"First I. Last"
6117 <login@@host.domain>}.
6118 @c -------------------------
6119 @cindex header field, @samp{Organization}
6120 @cindex @samp{Organization} header field
6121 @item Organization Field
6122 People usually list the name of the company where they work here.
6123 @c -------------------------
6124 @item Other Field
6125 Set any arbitrary header field and value here. Unless the header field
6126 is a standard one, precede the name of your field's label with
6127 @samp{X-}, as in @samp{X-Fruit-of-the-Day:}.
6128 @c -------------------------
6129 @item Attribution Verb
6130 This value overrides the setting of
6131 @code{mh-extract-from-attribution-verb}. @xref{Inserting Letter}.
6132 @c -------------------------
6133 @cindex signature
6134 @vindex mh-signature-file-name
6135 @item Signature
6136 Set your signature with this item. You can specify the contents of
6137 @code{mh-signature-file-name}, a file, or a function.
6138 @xref{Signature}.
6139 @c -------------------------
6140 @item GPG Key ID
6141 Specify a different key to sign or encrypt messages.
6142 @end table
6143
6144 @cindex Identity menu
6145 @cindex menu, Identity
6146 @findex mh-insert-identity
6147 @kindex C-c C-d
6148
6149 You can select the identities you have added via the menu called
6150 @samp{Identity} in the MH-Letter buffer. You can also use @kbd{C-c
6151 C-d} (@code{mh-insert-identity}). To clear the fields and signature
6152 added by the identity, select the @samp{None} identity.
6153
6154 @cindex menu item, @samp{Identity > Customize Identities}
6155 @cindex menu item, @samp{Identity > Save as Default}
6156 @cindex menu item, @samp{Identity > Set Default for Session}
6157 @cindex @samp{Identity > Customize Identities} menu item
6158 @cindex @samp{Identity > Save as Default} menu item
6159 @cindex @samp{Identity > Set Default for Session} menu item
6160 @vindex mh-identity-default
6161
6162 The @samp{Identity} menu contains two other items to save you from
6163 having to set the identity on every message. The menu item @samp{Set
6164 Default for Session} can be used to set the default identity to the
6165 current identity until you exit Emacs. The menu item @samp{Save as
6166 Default} sets the option @code{mh-identity-default} to the current
6167 identity setting. You can also customize the option
6168 @code{mh-identity-default} in the usual fashion. If you find that you
6169 need to add another identity, the menu item @samp{Customize
6170 Identities} is available for your convenience.
6171
6172 @cindex regular expressions, @code{mh-auto-fields-list}
6173 @vindex mh-auto-fields-list
6174
6175 The option @code{mh-auto-fields-list} can also be used to set the
6176 identity depending on the recipient to provide even more control. To
6177 customize @code{mh-auto-fields-list}, click on the @samp{INS} button
6178 and enter a regular expression for the recipient's address
6179 @ifnothtml
6180 (@pxref{Regexps, , Syntax of Regular Expressions, emacs, The
6181 GNU Emacs Manual}).
6182 @end ifnothtml
6183 @ifhtml
6184 (see the section
6185 @uref{http://www.gnu.org/software/emacs/manual/html_node/emacs/Regexps.html,
6186 Syntax of Regular Expressions} in
6187 @cite{The GNU Emacs Manual}).
6188 @end ifhtml
6189 Click on the @samp{INS} button with the @samp{Add at least one item
6190 below} label. The @samp{Value Menu} contains the following menu items:
6191
6192 @table @samp
6193 @item Identity
6194 Select an identity from those configured in @code{mh-identity-list}.
6195 All of the information for that identity will be added if the
6196 recipient matches.
6197 @c -------------------------
6198 @cindex @samp{Fcc} header field
6199 @cindex header field, @samp{Fcc}
6200 @item Fcc Field
6201 Insert an @samp{Fcc:} header field with the folder you provide. When
6202 you send the message, MH will put a copy of your message in this
6203 folder.
6204 @c -------------------------
6205 @cindex @samp{Mail-Followup-To} header field
6206 @cindex header field, @samp{Mail-Followup-To}
6207 @item Mail-Followup-To Field
6208 Insert an @samp{Mail-Followup-To:} header field with the recipients
6209 you provide. If the recipient's mail user agent supports this header
6210 field@footnote{@samp{Mail-Followup-To:} is supported by nmh.}, then
6211 their replies will go to the addresses listed. This is useful if their
6212 replies go both to the list and to you and you don't have a mechanism
6213 to suppress duplicates. If you reply to someone not on the list, you
6214 must either remove the @samp{Mail-Followup-To:} field, or ensure the
6215 recipient is also listed there so that he receives replies to your
6216 reply.
6217 @c -------------------------
6218 @item Other Field
6219 Other header fields may be added using this menu item.
6220 @end table
6221
6222 @findex mh-insert-auto-fields
6223 @kindex C-c M-d
6224 @vindex mh-auto-fields-prompt-flag
6225
6226 These fields can only be added after the recipient is known. Because
6227 you can continue to add recipients as you edit the draft, MH-E waits
6228 until the message is sent to perform the auto-insertions. This seems
6229 strange at first, but you'll get used to it. There are two ways to
6230 help you feel that the desired fields are added. The first is the
6231 action when the message is sent: if any fields are added
6232 automatically, you are given a chance to see and to confirm these
6233 fields before the message is actually sent. You can do away with this
6234 confirmation by turning off the option
6235 @code{mh-auto-fields-prompt-flag}. The second method is manual: once
6236 the header contains one or more recipients, you may run the command
6237 @kbd{C-c M-d} (@code{mh-insert-auto-fields}) or choose the
6238 @samp{Identity -> Insert Auto Fields} menu item to insert these fields
6239 manually. However, if you use this command, the automatic insertion
6240 when the message is sent is disabled.
6241
6242 @vindex mh-auto-fields-list
6243 @vindex mh-identity-list
6244
6245 You should avoid using the same header field in
6246 @code{mh-auto-fields-list} and @code{mh-identity-list} definitions
6247 that may apply to the same message as the result is undefined.
6248
6249 @vindex mh-identity-handlers
6250 @vindex mh-identity-list
6251
6252 The option @code{mh-identity-handlers} is used to change the way that
6253 fields, signatures, and attributions in @code{mh-identity-list} are
6254 added. To customize @code{mh-identity-handlers}, replace the name of
6255 an existing handler function associated with the field you want to
6256 change with the name of a function you have written. You can also
6257 click on an @samp{INS} button and insert a field of your choice and
6258 the name of the function you have written to handle it.
6259
6260 @vindex mh-identity-list
6261
6262 The @samp{Field} field can be any field that you've used in your
6263 @code{mh-identity-list}. The special fields @samp{:attribution-verb},
6264 @samp{:signature}, or @samp{:pgg-default-user-id} are used for the
6265 @code{mh-identity-list} choices @samp{Attribution Verb},
6266 @samp{Signature}, and @samp{GPG Key ID} respectively.
6267
6268 The handler associated with the @samp{:default} field is used when no
6269 other field matches.
6270
6271 The handler functions are passed two or three arguments: the field
6272 itself (for example, @samp{From}), or one of the special fields (for
6273 example, @samp{:signature}), and the action @samp{'remove} or
6274 @samp{'add}. If the action is @samp{'add}, an additional argument
6275 containing the value for the field is given.
6276
6277 @node Speedbar, Menu Bar, Identities, Top
6278 @chapter The Speedbar
6279
6280 @cindex folder navigation
6281 @cindex speedbar
6282 @findex mh-visit-folder
6283 @kindex F v
6284 @kindex M-x speedbar
6285 @kindex mouse-2
6286
6287 You can also use the speedbar
6288 @ifnothtml
6289 (@pxref{Speedbar, , Speedbar Frames, emacs, The GNU Emacs Manual},)
6290 @end ifnothtml
6291 @ifhtml
6292 (see the section
6293 @uref{http://www.gnu.org/software/emacs/manual/html_node/emacs/Speedbar.html,
6294 Speedbar Frames} in @cite{The GNU Emacs Manual})
6295 @end ifhtml
6296 to view your folders. To bring up the speedbar, run @kbd{M-x speedbar
6297 @key{RET}}. You will see a new frame appear with all of your MH
6298 folders. Folders with unseen messages appear in boldface. Click on a
6299 folder name with @kbd{mouse-2} to visit that folder in a similar
6300 fashion to the command @kbd{F v} (@code{mh-visit-folder})
6301 (@pxref{Folders}). Click on the @samp{+} icon to expand and view the
6302 sub-folders of that folder.
6303
6304 The speedbar can be manipulated with the keyboard as well. Use the
6305 Emacs navigational keys (like the arrow keys, or @kbd{C-n}) to move
6306 the cursor over the desired folder and then use the shortcuts for the
6307 menu items listed in the table below.
6308
6309 @table @samp
6310 @findex mh-speed-view
6311 @item Visit Folder (@key{RET})
6312 Visits the selected folder just as if you had used @kbd{F v}
6313 (@code{mh-speed-view}).
6314 @c -------------------------
6315 @findex mh-speed-expand-folder
6316 @item Expand Nested Folders (@kbd{+})
6317 Expands the selected folder in the speedbar, exposing the children
6318 folders inside it (@code{mh-speed-expand-folder}).
6319 @c -------------------------
6320 @findex mh-speed-contract-folder
6321 @item Contract Nested Folders (@kbd{-})
6322 Contracts or collapses the selected folder in the speedbar, hiding the
6323 children folders inside it (@code{mh-speed-contract-folder}).
6324 @c -------------------------
6325 @findex mh-speed-refresh
6326 @item Refresh Speedbar (@kbd{r})
6327 Regenerates the list of folders in the speedbar. Run this command if
6328 you've added or deleted a folder, or want to update the unseen message
6329 count before the next automatic update (@code{mh-speed-refresh}).
6330 @end table
6331
6332 @findex delete-frame
6333 @kindex C-x 5 0
6334 @kindex mouse-3
6335
6336 You can click on @kbd{mouse-3} to bring up a context menu that
6337 contains these items. Dismiss the speedbar with @kbd{C-x 5 0}
6338 (@code{delete-frame}).
6339
6340 @cindex @command{flists}
6341 @cindex MH commands, @command{flists}
6342 @cindex @samp{mh-speedbar} customization group
6343 @cindex customization group, @samp{mh-speedbar}
6344
6345 The MH-E speedbar uses the MH command @command{flists}@footnote{See
6346 the section @uref{@value{MH-BOOK-HOME}/morseq.html#flist, Searching for
6347 Sequences with flist} in the MH book.} to generate the list of
6348 folders. The @samp{mh-speedbar} customization group contains the
6349 following option which controls how often the speedbar calls
6350 @command{flists}.
6351
6352 @vtable @code
6353 @item mh-speed-update-interval
6354 Time between speedbar updates in seconds (default: 60). Set to 0 to
6355 disable automatic update.
6356 @end vtable
6357
6358 You can modify the appearance of the folders in the speedbar by
6359 customizing the following faces.
6360
6361 @vtable @code
6362 @item mh-speedbar-folder
6363 Basic folder face.
6364 @c -------------------------
6365 @item mh-speedbar-folder-with-unseen-messages
6366 Folder face when folder contains unread messages.
6367 @c -------------------------
6368 @item mh-speedbar-selected-folder
6369 Selected folder face.
6370 @c -------------------------
6371 @item mh-speedbar-selected-folder-with-unseen-messages
6372 Selected folder face when folder contains unread messages.
6373 @end vtable
6374
6375 @node Menu Bar, Tool Bar, Speedbar, Top
6376 @chapter The Menu Bar
6377
6378 @cindex @samp{Folder} menu
6379 @cindex @samp{Identity} menu
6380 @cindex @samp{Letter} menu
6381 @cindex @samp{Message} menu
6382 @cindex @samp{Search} menu
6383 @cindex @samp{Sequence} menu
6384 @cindex Folder menu
6385 @cindex Identity menu
6386 @cindex Letter menu
6387 @cindex MH-Folder mode
6388 @cindex MH-Letter mode
6389 @cindex MH-Search mode
6390 @cindex Message menu
6391 @cindex Search menu
6392 @cindex Sequence menu
6393 @cindex menu bar
6394 @cindex menu, Folder
6395 @cindex menu, Identity
6396 @cindex menu, Letter
6397 @cindex menu, Message
6398 @cindex menu, Search
6399 @cindex menu, Sequence
6400 @cindex menu, @samp{Folder}
6401 @cindex menu, @samp{Identity}
6402 @cindex menu, @samp{Letter}
6403 @cindex menu, @samp{Message}
6404 @cindex menu, @samp{Search}
6405 @cindex menu, @samp{Sequence}
6406 @cindex modes, MH-Folder
6407 @cindex modes, MH-Letter
6408 @cindex modes, MH-Search
6409
6410 For those of you who prefer to mouse and menu instead of using the
6411 meta-coke-bottle-bucky keys, MH-E provides menu items for most of its
6412 functions. The MH-Folder buffer adds the @samp{Folder},
6413 @samp{Message}, and @samp{Sequence} menus. The MH-Letter buffer adds
6414 the @samp{Identity} and @samp{Letter} menus. The MH-Search buffer adds
6415 the @samp{Search} menu. There's no need to list the actual items here,
6416 as you can more easily see them for yourself, and the functions are
6417 already described elsewhere in this manual.
6418
6419 For a description of the menu bar, please
6420 @ifnothtml
6421 @xref{Menu Bar, , The Menu Bar, emacs, The GNU Emacs Manual}.
6422 @end ifnothtml
6423 @ifhtml
6424 see the section
6425 @uref{http://www.gnu.org/software/emacs/manual/html_node/emacs/Menu-Bar.html,
6426 The Menu Bar} in @cite{The GNU Emacs Manual}.
6427 @end ifhtml
6428
6429 The Emacs manual describes how to get help for a particular
6430 menu item. You can also look up a menu item in the index of this
6431 manual in two ways: all of the menu items are listed alphabetically,
6432 and you can also browse all of the items under the index entry
6433 @samp{menu item}.
6434
6435 @node Tool Bar, Searching, Menu Bar, Top
6436 @chapter The Tool Bar
6437
6438 @cindex tool bar
6439
6440 Emacs also provides a graphical tool bar. For a description of the
6441 tool bar, please
6442 @ifnothtml
6443 @xref{Tool Bars, , Tool Bars, emacs, The GNU Emacs Manual}.
6444 @end ifnothtml
6445 @ifhtml
6446 see the section
6447 @uref{http://www.gnu.org/software/emacs/manual/html_node/emacs/Tool-Bars.html,
6448 Tool Bars} in @cite{The GNU Emacs Manual}.
6449 @end ifhtml
6450
6451 @cindex @samp{mh-tool-bar} customization group
6452 @cindex customization group, @samp{mh-tool-bar}
6453
6454 MH-E adds several icons to this tool bar; you can modify the MH-E
6455 aspects of the tool bar via the @samp{mh-tool-bar} customization group.
6456
6457 @vtable @code
6458 @item mh-tool-bar-folder-buttons
6459 List of buttons to include in MH-Folder tool bar (default: a checklist
6460 too long to list here).
6461 @c -------------------------
6462 @item mh-tool-bar-letter-buttons
6463 List of buttons to include in MH-Letter tool bar (default: a checklist
6464 too long to list here).
6465 @c -------------------------
6466 @item mh-tool-bar-search-function
6467 Function called by the tool bar search button (default:
6468 @code{mh-search}).
6469 @c -------------------------
6470 @item mh-xemacs-tool-bar-position
6471 Tool bar location (default: @samp{Same As Default Tool Bar}).
6472 @c -------------------------
6473 @item mh-xemacs-use-tool-bar-flag
6474 If @samp{on}, use tool bar (default: @samp{on}, if supported).
6475 @end vtable
6476
6477 In GNU Emacs, icons for some of MH-E's functions are added to the tool
6478 bar. In XEmacs, you have the opportunity to create a separate tool bar for
6479 the MH-E icons.
6480
6481 @vindex mh-tool-bar-folder-buttons
6482 @vindex mh-tool-bar-letter-buttons
6483
6484 In either case, you can select which of these functions you'd like to
6485 see by customizing the options @code{mh-tool-bar-folder-buttons} and
6486 @code{mh-tool-bar-letter-buttons}. As you probably guessed, the former
6487 customizes the tool bar in MH-Folder mode and the latter in MH-Letter
6488 mode. Both of these options present you with a list of functions;
6489 check the functions whose icons you want to see and clear the check
6490 boxes for those you don't.
6491
6492 @findex mh-search
6493 @vindex mh-tool-bar-search-function
6494
6495 The function associated with the searching icon can be set via the
6496 option @code{mh-tool-bar-search-function}. By default, this is set to
6497 @code{mh-search}. @xref{Searching}. You can also choose @samp{Other
6498 Function} from the @samp{Value Menu} and enter a function of your own
6499 choosing.
6500
6501 @vindex mh-xemacs-use-tool-bar-flag
6502
6503 XEmacs provides a couple of extra options. The first,
6504 @code{mh-xemacs-use-tool-bar-flag}, controls whether to show the MH-E
6505 icons at all. By default, this option is turned on if the window
6506 system supports tool bars. If your system doesn't support tool bars,
6507 then you won't be able to turn on this option.
6508
6509 @vindex mh-xemacs-tool-bar-position
6510
6511 The second extra option is @code{mh-xemacs-tool-bar-position} which
6512 controls the placement of the tool bar along the four edges of the
6513 frame. You can choose from one of @samp{Same As Default Tool Bar},
6514 @samp{Top}, @samp{Bottom}, @samp{Left}, or @samp{Right}. If this
6515 variable is set to anything other than @samp{Same As Default Tool Bar}
6516 and the default tool bar is in a different location, then two tool
6517 bars will be displayed: the MH-E tool bar and the default tool bar.
6518
6519 @node Searching, Threading, Tool Bar, Top
6520 @chapter Searching Through Messages
6521
6522 @cindex @samp{Search} menu
6523 @cindex menu, @samp{Search}
6524 @cindex searching
6525 @findex mh-search
6526 @kindex F s
6527
6528 Earlier, the command @kbd{F s} (@code{mh-search}) was introduced which
6529 helps you find messages that lie buried in your folders
6530 (@pxref{Folders}). This chapter covers this command in more detail.
6531 Several commands are used to compose the search criteria and to start
6532 searching. A couple of them can be found in the @samp{Search} menu.
6533
6534 @table @kbd
6535 @kindex C-c ?
6536 @findex mh-help
6537 @item C-c ?
6538 Display cheat sheet for the MH-E commands (@code{mh-help}).
6539 @c -------------------------
6540 @cindex @samp{Search > Perform Search} menu item
6541 @cindex menu item, @samp{Search > Perform Search}
6542 @kindex C-c C-c
6543 @findex mh-index-do-search
6544 @item C-c C-c
6545 Find messages using @code{mh-search-program}
6546 (@code{mh-index-do-search}).
6547 @c -------------------------
6548 @cindex @samp{Search > Search with pick} menu item
6549 @cindex menu item, @samp{Search > Search with pick}
6550 @kindex C-c C-p
6551 @findex mh-pick-do-search
6552 @item C-c C-p
6553 Find messages using @command{pick} (@code{mh-pick-do-search}).
6554 @c -------------------------
6555 @kindex C-c ?
6556 @findex mh-help
6557 @item C-c ?
6558 Display cheat sheet for the MH-E commands (@code{mh-help}).
6559 @c -------------------------
6560 @kindex C-c C-f C-a
6561 @kindex C-c C-f a
6562 @findex mh-to-field
6563 @item C-c C-f a
6564 @itemx C-c C-f C-a
6565 Move to @samp{Mail-Reply-To:} header field (@code{mh-to-field}).
6566 @c -------------------------
6567 @kindex C-c C-f C-b
6568 @kindex C-c C-f b
6569 @item C-c C-f b
6570 @itemx C-c C-f C-b
6571 Move to @samp{Bcc:} header field (@code{mh-to-field}).
6572 @c -------------------------
6573 @kindex C-c C-f C-c
6574 @kindex C-c C-f c
6575 @item C-c C-f c
6576 @itemx C-c C-f C-c
6577 Move to @samp{Cc:} header field (@code{mh-to-field}).
6578 @c -------------------------
6579 @kindex C-c C-f C-d
6580 @kindex C-c C-f d
6581 @item C-c C-f d
6582 @itemx C-c C-f C-d
6583 Move to @samp{Dcc:} header field (@code{mh-to-field}).
6584 @c -------------------------
6585 @kindex C-c C-f C-f
6586 @kindex C-c C-f f
6587 @item C-c C-f f
6588 @itemx C-c C-f C-f
6589 Move to @samp{Fcc:} header field (@code{mh-to-field}).
6590 @c -------------------------
6591 @kindex C-c C-f C-l
6592 @kindex C-c C-f l
6593 @item C-c C-f l
6594 @itemx C-c C-f C-l
6595 Move to @samp{Mail-Followup-To:} header field (@code{mh-to-field}).
6596 @c -------------------------
6597 @kindex C-c C-f C-m
6598 @kindex C-c C-f m
6599 @item C-c C-f m
6600 @itemx C-c C-f C-m
6601 Move to @samp{From:} header field (@code{mh-to-field}).
6602 @c -------------------------
6603 @kindex C-c C-f C-r
6604 @kindex C-c C-f r
6605 @item C-c C-f r
6606 @itemx C-c C-f C-r
6607 Move to @samp{Reply-To:} header field (@code{mh-to-field}).
6608 @c -------------------------
6609 @kindex C-c C-f C-s
6610 @kindex C-c C-f s
6611 @item C-c C-f s
6612 @itemx C-c C-f C-s
6613 Move to @samp{Subject:} header field (@code{mh-to-field}).
6614 @c -------------------------
6615 @kindex C-c C-f C-t
6616 @kindex C-c C-f t
6617 @item C-c C-f t
6618 @itemx C-c C-f C-t
6619 Move to @samp{To:} header field (@code{mh-to-field}).
6620 @end table
6621
6622 Another few commands are available in the MH-Folder buffer resulting
6623 from a search.
6624
6625 @table @kbd
6626 @kindex @key{TAB}
6627 @findex mh-index-next-folder
6628 @item @key{TAB}
6629 Jump to the next folder marker (@code{mh-index-next-folder}).
6630 @c -------------------------
6631 @kindex S-@key{TAB}
6632 @findex mh-index-previous-folder
6633 @item S-@key{TAB}
6634 Jump to the previous folder marker (@code{mh-index-previous-folder}).
6635 @c -------------------------
6636 @kindex v
6637 @findex mh-index-visit-folder
6638 @item v
6639 Visit original folder from where the message at point was found
6640 (@code{mh-index-visit-folder}).
6641 @end table
6642
6643 @cindex @samp{mh-search} customization group
6644 @cindex customization group, @samp{mh-search}
6645
6646 There is one option from the @samp{mh-search} customization group used
6647 in searching.
6648
6649 @vtable @code
6650 @item mh-search-program
6651 Search program that MH-E shall use (default: @samp{Auto-detect}).
6652 @end vtable
6653
6654 The following hook is available.
6655
6656 @vtable @code
6657 @item mh-search-mode-hook
6658 Hook run upon entry to @code{mh-search-mode} (default: @code{nil}).
6659 @end vtable
6660
6661 The following face is available.
6662
6663 @vtable @code
6664 @item mh-search-folder
6665 Folder heading face in MH-Folder buffers created by searches.
6666 @end vtable
6667
6668 @findex mh-search-folder
6669 @kindex F s
6670
6671 The command @kbd{F s} (@code{mh-search-folder}) helps you find
6672 messages in your entire corpus of mail. You can search for messages to
6673 or from a particular person or about a particular subject. In fact,
6674 you can also search for messages containing selected strings in any
6675 arbitrary header field or any string found within the messages.
6676
6677 @cindex @command{pick}
6678 @cindex MH commands, @command{pick}
6679
6680 Out of the box, MH-E uses @command{pick} to find messages. With a
6681 little extra effort, you can set an indexing program which rewards you
6682 with extremely quick results. The drawback is that sometimes the index
6683 does not contain the words you're looking for. You can still use
6684 @command{pick} in these situations.
6685
6686 You are prompted for the folder to search. This can be @samp{all} to
6687 search all folders. Note that the search works recursively on the
6688 listed folder.
6689
6690 @cindex MH-Search mode
6691 @cindex modes, MH-Search
6692
6693 Next, an MH-Search buffer appears where you can enter search criteria.
6694
6695 @cartouche
6696 @smallexample
6697 From:
6698 To:
6699 Cc:
6700 Date:
6701 Subject:
6702 --------
6703 #
6704
6705
6706
6707
6708
6709
6710
6711
6712 --:** search-pattern All L7 (MH-Search)---------------------------
6713 Type C-c C-c to search messages, C-c C-p to use pick, C-c ? for help
6714 @end smallexample
6715 @end cartouche
6716 @i{Search window}
6717
6718 @cindex @command{pick}
6719 @cindex MH commands, @command{pick}
6720
6721 Edit this template by entering your search criteria in an appropriate
6722 header field that is already there, or create a new field yourself. If
6723 the string you're looking for could be anywhere in a message, then
6724 place the string underneath the row of dashes.
6725
6726 As an example, let's say that we want to find messages from Ginnean
6727 about horseback riding in the Kosciusko National Park (Australia)
6728 during January, 1994. Normally we would start with a broad search and
6729 narrow it down if necessary to produce a manageable amount of data,
6730 but we'll cut to the chase and create a fairly restrictive set of
6731 criteria as follows:
6732
6733 @smallexample
6734 @group
6735 From: ginnean
6736 To:
6737 Cc:
6738 Date: Jan 1994
6739 Subject:
6740 --------
6741 horse
6742 kosciusko
6743 @end group
6744 @end smallexample
6745
6746 @findex mh-to-field
6747 @kindex C-c C-f C-t
6748
6749 As with MH-Letter mode, MH-Search provides commands like @kbd{C-c C-f
6750 C-t} (@code{mh-to-field}) to help you fill in the blanks.
6751 @xref{Editing Message}.
6752
6753 @kindex F s
6754 @vindex mh-search-mode-hook
6755
6756 If you find that you do the same thing over and over when editing the
6757 search template, you may wish to bind some shortcuts to keys. This can
6758 be done with the variable @code{mh-search-mode-hook}, which is called
6759 when @kbd{F s} is run on a new pattern.
6760
6761 @findex mh-index-do-search
6762 @findex mh-pick-do-search
6763 @kindex C-c C-c
6764 @kindex C-c C-p
6765
6766 To perform the search, type @kbd{C-c C-c} (@code{mh-index-do-search}).
6767 Sometimes you're searching for text that is either not indexed, or
6768 hasn't been indexed yet. In this case you can override the default
6769 method with the pick method by running the command @kbd{C-c C-p}
6770 (@code{mh-pick-do-search}).
6771
6772 @cindex folders, @samp{+mhe-index}
6773 @cindex @samp{+mhe-index}
6774 @findex mh-index-next-folder
6775 @findex mh-index-previous-folder
6776 @kindex @key{TAB}
6777 @kindex S-@key{TAB}
6778 @vindex mh-search-folder
6779
6780 The messages that are found are put in a temporary sub-folder of
6781 @samp{+mhe-index} and are displayed in an MH-Folder buffer. This
6782 buffer is special because it displays messages from multiple folders;
6783 each set of messages from a given folder has a heading with the folder
6784 name. The appearance of the heading can be modified by customizing the
6785 face @code{mh-search-folder}. You can jump back and forth between the
6786 headings using the commands @kbd{@key{TAB}}
6787 (@code{mh-index-next-folder}) and @kbd{S-@key{TAB}}
6788 (@code{mh-index-previous-folder}).
6789
6790 @findex mh-index-visit-folder
6791 @findex mh-rescan-folder
6792 @kindex F r
6793 @kindex v
6794
6795 In addition, the command @kbd{v} (@code{mh-index-visit-folder}) can be
6796 used to visit the folder of the message at point. Initially, only the
6797 messages that matched the search criteria are displayed in the folder.
6798 While the temporary buffer has its own set of message numbers, the
6799 actual messages numbers are shown in the visited folder. Thus, the
6800 command @kbd{v} is useful to find the actual message number of an
6801 interesting message, or to view surrounding messages with the command
6802 @kbd{F r} @code{mh-rescan-folder}. @xref{Folders}.
6803
6804 @findex mh-kill-folder
6805 @kindex F k
6806
6807 Because this folder is temporary, you'll probably get in the habit of
6808 killing it when you're done with @kbd{F k} (@code{mh-kill-folder}).
6809 @xref{Folders}.
6810
6811 @kindex F s
6812
6813 You can regenerate the results by running @kbd{F s} with a prefix
6814 argument.
6815
6816 @cindex @command{procmail}
6817 @cindex Unix commands, @command{procmail}
6818 @cindex @samp{X-MHE-Checksum} header field
6819 @cindex header field, @samp{X-MHE-Checksum}
6820
6821 Note: This command uses an @samp{X-MHE-Checksum:} header field to
6822 cache the MD5 checksum of a message. This means that if an incoming
6823 message already contains an @samp{X-MHE-Checksum:} field, that message
6824 might not be found by this command. The following @command{procmail}
6825 recipe avoids this problem by renaming the existing header field:
6826
6827 @smallexample
6828 @group
6829 :0 wf
6830 | formail -R "X-MHE-Checksum" "X-Old-MHE-Checksum"
6831 @end group
6832 @end smallexample
6833
6834 @xref{Limits}, for an alternative interface to searching.
6835
6836 @section Configuring Indexed Searches
6837
6838 @cindex @command{grep}
6839 @cindex @command{mairix}
6840 @cindex @command{namazu}
6841 @cindex @command{pick}
6842 @cindex @command{swish++}
6843 @cindex @command{swish-e}
6844 @cindex Unix commands, @command{grep}
6845 @cindex Unix commands, @command{mairix}
6846 @cindex Unix commands, @command{namazu}
6847 @cindex Unix commands, @command{pick}
6848 @cindex Unix commands, @command{swish++}
6849 @cindex Unix commands, @command{swish-e}
6850 @findex mh-search
6851 @kindex F s
6852 @vindex mh-search-program
6853
6854 The command @kbd{F s} (@code{mh-search}) runs the command defined by
6855 the option @code{mh-search-program}. The default value is
6856 @samp{Auto-detect} which means that MH-E will automatically choose one
6857 of @command{swish++}, @command{swish-e}, @command{mairix},
6858 @command{namazu}, @command{pick} and @command{grep} in that order. If,
6859 for example, you have both @command{swish++} and @command{mairix}
6860 installed and you want to use @command{mairix}, then you can set this
6861 option to @samp{mairix}.
6862
6863 The following sub-sections describe how to set up the various indexing
6864 programs to use with MH-E.
6865
6866 @subsection swish++
6867
6868 @cindex @command{swish++}
6869 @cindex Unix commands, @command{swish++}
6870
6871 In the examples below, replace @file{/home/user/Mail} with the path to
6872 your MH directory.
6873
6874 First create the directory @file{/home/user/Mail/.swish++}. Then
6875 create the file @file{/home/user/Mail/.swish++/swish++.conf} with the
6876 following contents:
6877
6878 @smallexample
6879 @group
6880 IncludeMeta Bcc Cc Comments Content-Description From Keywords
6881 IncludeMeta Newsgroups Resent-To Subject To
6882 IncludeMeta Message-Id References In-Reply-To
6883 IncludeFile Mail *
6884 IndexFile /home/user/Mail/.swish++/swish++.index
6885 @end group
6886 @end smallexample
6887
6888 Use the following command line to generate the swish index. Run this
6889 daily from cron:
6890
6891 @smallexample
6892 @group
6893 find /home/user/Mail -path /home/user/Mail/mhe-index -prune \
6894 -o -path /home/user/Mail/.swish++ -prune \
6895 -o -name "[0-9]*" -print \
6896 | index -c /home/user/Mail/.swish++/swish++.conf -
6897 @end group
6898 @end smallexample
6899
6900 This command does not index the folders that hold the results of your
6901 searches in @samp{+mhe-index} since they tend to be ephemeral and the
6902 original messages are indexed anyway.
6903
6904 @cindex @command{index}
6905 @cindex Unix commands, @command{index}
6906 @cindex @command{index++}
6907 @cindex Unix commands, @command{index++}
6908
6909 On some systems (Debian GNU/Linux, for example), use @command{index++}
6910 instead of @command{index}.
6911
6912 @subsection swish
6913
6914 @cindex @command{swish-e}
6915 @cindex Unix commands, @command{swish-e}
6916
6917 In the examples below, replace @file{/home/user/Mail} with the path to
6918 your MH directory.
6919
6920 First create the directory @file{/home/user/Mail/.swish}. Then create
6921 the file @file{/home/user/Mail/.swish/config} with the following
6922 contents:
6923
6924 @smallexample
6925 @group
6926 DefaultContents TXT*
6927 IndexDir /home/user/Mail
6928 IndexFile /home/user/Mail/.swish/index
6929 IndexName "Mail Index"
6930 IndexDescription "Mail Index"
6931 IndexPointer "http://nowhere"
6932 IndexAdmin "nobody"
6933 #MetaNames automatic
6934 IndexReport 3
6935 FollowSymLinks no
6936 UseStemming no
6937 IgnoreTotalWordCountWhenRanking yes
6938 WordCharacters abcdefghijklmnopqrstuvwxyz0123456789-
6939 BeginCharacters abcdefghijklmnopqrstuvwxyz
6940 EndCharacters abcdefghijklmnopqrstuvwxyz0123456789
6941 IgnoreLimit 50 1000
6942 IndexComments 0
6943 FileRules filename contains \D
6944 FileRules pathname contains /home/user/Mail/.swish
6945 FileRules pathname contains /home/user/Mail/mhe-index
6946 FileRules filename is index
6947 @end group
6948 @end smallexample
6949
6950 This configuration does not index the folders that hold the results of
6951 your searches in @samp{+mhe-index} since they tend to be ephemeral and
6952 the original messages are indexed anyway.
6953
6954 If there are any directories you would like to ignore, append lines
6955 like the following to @file{config}:
6956
6957 @smallexample
6958 FileRules pathname contains /home/user/Mail/scripts
6959 @end smallexample
6960
6961 @cindex @command{swish-e}
6962 @cindex Unix commands, @command{swish-e}
6963
6964 Use the following command line to generate the swish index. Run this
6965 daily from cron:
6966
6967 @smallexample
6968 swish-e -c /home/user/Mail/.swish/config
6969 @end smallexample
6970
6971 @subsection mairix
6972
6973 @cindex @command{mairix}
6974 @cindex Unix commands, @command{mairix}
6975
6976 In the examples below, replace @file{~/Mail} with the path to your MH
6977 directory.
6978
6979 First create the directory @file{~/Mail/.mairix}. Then create the file
6980 @file{~/Mail/.mairix/config} with the following contents:
6981
6982 @smallexample
6983 @group
6984 base=~/Mail
6985
6986 # List of folders that should be indexed. 3 dots at the end means there
6987 # are subfolders within the folder
6988 mh=archive...:inbox:drafts:news:sent:trash
6989
6990 mformat=mh
6991 database=~/Mail/.mairix/database
6992 @end group
6993 @end smallexample
6994
6995 Use the following command line to generate the mairix index. Run this daily
6996 from cron:
6997
6998 @smallexample
6999 mairix -f ~/Mail/.mairix/config
7000 @end smallexample
7001
7002 @subsection namazu
7003
7004 @cindex @command{namazu}
7005 @cindex Unix commands, @command{namazu}
7006
7007 In the examples below, replace @file{/home/user/Mail} with the path to
7008 your MH directory.
7009
7010 First create the directory @file{/home/user/Mail/.namazu}. Then create
7011 the file @file{/home/user/Mail/.namazu/mknmzrc} with the following
7012 contents:
7013
7014 @smallexample
7015 @group
7016 package conf; # Don't remove this line!
7017 $ADDRESS = 'user@@localhost';
7018 $ALLOW_FILE = "[0-9]*";
7019 $EXCLUDE_PATH = "^/home/user/Mail/(mhe-index|spam)";
7020 @end group
7021 @end smallexample
7022
7023 This configuration does not index the folders that hold the results of
7024 your searches in @samp{+mhe-index} since they tend to be ephemeral and
7025 the original messages are indexed anyway.
7026
7027 Use the following command line to generate the namazu index. Run this
7028 daily from cron:
7029
7030 @smallexample
7031 mknmz -f /home/user/Mail/.namazu/mknmzrc -O /home/user/Mail/.namazu \
7032 -q /home/user/Mail
7033 @end smallexample
7034
7035 @subsection pick
7036
7037 @cindex @command{pick}
7038 @cindex MH commands, @command{pick}
7039
7040 This search method does not require any setup.
7041
7042 Read @command{pick}(1) or the section
7043 @uref{@value{MH-BOOK-HOME}/finpic.html, Finding Messages with pick} in
7044 the MH book to find out more about how to enter the criteria.
7045
7046 @subsection grep
7047
7048 @cindex @command{grep}
7049 @cindex Unix commands, @command{grep}
7050
7051 This search method does not require any setup.
7052
7053 Unlike the other search methods, this method does not use the
7054 MH-Search buffer. Instead, you simply enter a regular expression in
7055 the minibuffer. For help in constructing regular expressions, see your
7056 man page for @command{grep}.
7057
7058 @node Threading, Limits, Searching, Top
7059 @chapter Viewing Message Threads
7060
7061 @cindex threading
7062
7063 MH-E groups messages by @dfn{threads} which are messages that are part
7064 of the same discussion and usually all have the same @samp{Subject:}
7065 header field. Other ways to organize messages in a folder include
7066 limiting (@pxref{Limits}) or using full-text indexed searches
7067 (@pxref{Searching}).
7068
7069 @cindex root, in threads
7070 @cindex siblings, in threads
7071 @cindex ancestor, in threads
7072
7073 A thread begins with a single message called a @dfn{root}. All replies
7074 to the same message are @dfn{siblings} of each other. Any message that
7075 has replies to it is an @dfn{ancestor} of those replies.
7076
7077 There are several commands that you can use to navigate and operate on
7078 threads.
7079
7080 @table @kbd
7081 @kindex T ?
7082 @findex mh-prefix-help
7083 @item T ?
7084 Display cheat sheet for the commands of the current prefix in
7085 minibuffer (@code{mh-prefix-help}).
7086 @c -------------------------
7087 @kindex T o
7088 @findex mh-thread-refile
7089 @item T o
7090 Refile (output) thread into folder (@code{mh-thread-refile}).
7091 @c -------------------------
7092 @kindex T d
7093 @findex mh-thread-delete
7094 @item T d
7095 Delete thread (@code{mh-thread-delete}).
7096 @c -------------------------
7097 @kindex T t
7098 @findex mh-toggle-threads
7099 @item T t
7100 Toggle threaded view of folder (@code{mh-toggle-threads}).
7101 @c -------------------------
7102 @kindex T n
7103 @findex mh-thread-next-sibling
7104 @item T n
7105 Display next sibling (@code{mh-thread-next-sibling}).
7106 @c -------------------------
7107 @kindex T p
7108 @findex mh-thread-previous-sibling
7109 @item T p
7110 Display previous sibling (@code{mh-thread-previous-sibling}).
7111 @c -------------------------
7112 @kindex T u
7113 @findex mh-thread-ancestor
7114 @item T u
7115 Display ancestor of current message (@code{mh-thread-ancestor}).
7116 @end table
7117
7118 @cindex @samp{mh-thread} customization group
7119 @cindex customization group, @samp{mh-thread}
7120
7121 The @samp{mh-thread} customization group contains one option.
7122
7123 @vtable @code
7124 @item mh-show-threads-flag
7125 On means new folders start in threaded mode (default: @samp{off}).
7126 @end vtable
7127
7128 @findex mh-toggle-threads
7129 @kindex T t
7130 @vindex mh-large-folder
7131 @vindex mh-show-threads-flag
7132
7133 Threading large number of messages can be time consuming so the option
7134 @code{mh-show-threads-flag} is turned off by default. If you turn on
7135 this option, then threading will be done only if the number of
7136 messages being threaded is less than @code{mh-large-folder}. In any
7137 event, threading can be turned on (and off) with the command @kbd{T t}
7138 (@code{mh-toggle-threads}).
7139
7140 @findex mh-thread-ancestor
7141 @findex mh-thread-next-sibling
7142 @findex mh-thread-previous-sibling
7143 @kindex T n
7144 @kindex T p
7145 @kindex T u
7146
7147 There are a few commands to help you navigate threads. If you do not
7148 care for the way a particular thread has turned, you can move up the
7149 chain of messages with the command @kbd{T u}
7150 (@code{mh-thread-ancestor}. At any point you can use @kbd{T n}
7151 (@code{mh-thread-next-sibling} or @kbd{T p}
7152 (@code{mh-thread-previous-sibling}) to jump to the next or previous
7153 sibling, skipping the sub-threads. The command @kbd{T u} can also take
7154 a prefix argument to jump to the message that started everything.
7155
7156 @findex mh-delete-subject-or-thread
7157 @findex mh-thread-delete
7158 @findex mh-thread-refile
7159 @kindex k
7160 @kindex T d
7161 @kindex T o
7162
7163 There are threaded equivalents for the commands that delete and refile
7164 messages. For example, @kbd{T o} (@code{mh-thread-refile}) refiles the
7165 current message and all its children. Similarly, the command @kbd{T d}
7166 (@code{mh-thread-delete}) deletes the current message and all its
7167 children. These commands do not refile or delete sibling messages.
7168 @xref{Navigating}, for a description of the similar command @kbd{k}
7169 (@code{mh-delete-subject-or-thread}).
7170
7171 @vindex mh-large-folder
7172
7173 If you find that threading is too slow, it may be that you have
7174 @code{mh-large-folder} set too high. Also, threading is one of the few
7175 features of MH-E that really benefits from compiling. If you haven't
7176 compiled MH-E, I encourage you to do so@footnote{If you're not sure if
7177 MH-E has been byte-compiled, you could try running @samp{locate
7178 mh-thread.elc} or otherwise find MH-E on your system and ensure that
7179 @file{mh-thread.elc} exists. If you have multiple versions and you
7180 find that one is compiled but the other is not, then go into your
7181 @file{*scratch*} buffer in Emacs, enter @kbd{load-path C-j}, and
7182 ensure that the byte-compiled version appears first in the
7183 @code{load-path}. If you find that MH-E is not compiled and you
7184 installed MH-E yourself, please refer to the installation directions
7185 in the file @file{README} in the distribution.}.
7186
7187 @node Limits, Sequences, Threading, Top
7188 @chapter Limiting Display
7189
7190 @cindex limits
7191 @cindex filters
7192
7193 Another way to organize messages in a folder besides threading
7194 (@pxref{Threading}) or using full-text indexed searches
7195 (@pxref{Searching}) is by limiting the folder display to messages that
7196 are similar to the current message.
7197
7198 @table @kbd
7199 @kindex / ?
7200 @findex mh-prefix-help
7201 @item / ?
7202 Display cheat sheet for the commands of the current prefix in
7203 minibuffer (@code{mh-prefix-help}).
7204 @c -------------------------
7205 @cindex @samp{Sequence > Narrow to Tick Sequence} menu item
7206 @cindex menu item, @samp{Sequence > Narrow to Tick Sequence}
7207 @kindex / '
7208 @findex mh-narrow-to-tick
7209 @item / '
7210 Limit to messages in the @samp{tick} sequence
7211 (@code{mh-narrow-to-tick}).
7212 @c -------------------------
7213 @kindex / c
7214 @findex mh-narrow-to-cc
7215 @item / c
7216 Limit to messages with the same @samp{Cc:} field
7217 (@code{mh-narrow-to-cc}).
7218 @c -------------------------
7219 @kindex / m
7220 @findex mh-narrow-to-from
7221 @item / m
7222 Limit to messages with the same @samp{From:} field
7223 (@code{mh-narrow-to-from}).
7224 @c -------------------------
7225 @kindex / g
7226 @findex mh-narrow-to-range
7227 @item / g
7228 Limit to range (@code{mh-narrow-to-range}).
7229 @c -------------------------
7230 @cindex @samp{Sequence > Narrow to Subject Sequence} menu item
7231 @cindex menu item, @samp{Sequence > Narrow to Subject Sequence}
7232 @kindex / s
7233 @findex mh-narrow-to-subject
7234 @item / s
7235 Limit to messages with the same @samp{Subject:} field
7236 (@code{mh-narrow-to-subject}).
7237 @c -------------------------
7238 @kindex / t
7239 @findex mh-narrow-to-to
7240 @item / t
7241 Limit to messages with the same @samp{To:} field
7242 (@code{mh-narrow-to-to}).
7243 @c -------------------------
7244 @cindex @samp{Sequence > Widen from Sequence} menu item
7245 @cindex menu item, @samp{Sequence > Widen from Sequence}
7246 @kindex / w
7247 @findex mh-widen
7248 @item / w
7249 Remove last restriction (@code{mh-widen}).
7250 @end table
7251
7252 All of the limiting commands above refine the display in some way.
7253
7254 @cindex @command{pick}
7255 @cindex MH commands, @command{pick}
7256 @findex mh-narrow-to-cc
7257 @findex mh-narrow-to-from
7258 @findex mh-narrow-to-subject
7259 @findex mh-narrow-to-to
7260 @kindex / c
7261 @kindex / m
7262 @kindex / s
7263 @kindex / t
7264
7265 The commands @kbd{/ c} (@code{mh-narrow-to-cc}), @kbd{/ m}
7266 (@code{mh-narrow-to-from}), @kbd{/ s} (@code{mh-narrow-to-subject}),
7267 and @kbd{/ t} (@code{mh-narrow-to-to}) restrict the display to
7268 messages matching the content of the respective field in the current
7269 message. However, you can give any of these a prefix argument to edit
7270 the @command{pick} expression used to narrow the view@footnote{See
7271 @command{pick}(1) or the section
7272 @uref{@value{MH-BOOK-HOME}/finpic.html, Finding Messages with pick} in
7273 the MH book.}.
7274
7275 @cindex @samp{tick} sequence
7276 @cindex sequence, @samp{tick}
7277 @cindex ticked messages, viewing
7278 @findex mh-narrow-to-range
7279 @findex mh-narrow-to-tick
7280 @kindex / '
7281 @kindex / g
7282
7283 You can also limit the display to messages in the @samp{tick} sequence
7284 with the command @kbd{/ '} (@code{mh-narrow-to-tick}).
7285 @xref{Sequences}, for information on putting message into the
7286 @samp{tick} sequence. Use the @kbd{/ g} (@code{mh-narrow-to-range})
7287 command to limit the display to messages in a range (@pxref{Ranges}).
7288
7289 @findex mh-widen
7290 @kindex / w
7291
7292 Each limit can be undone in turn with the @kbd{/ w} (@code{mh-widen})
7293 command. Give this command a prefix argument to remove all limits.
7294
7295 @node Sequences, Junk, Limits, Top
7296 @chapter Using Sequences
7297
7298 @cindex @samp{Sequence} menu
7299 @cindex menu, @samp{Sequence}
7300 @cindex sequences
7301
7302 For the whole scoop on MH sequences, refer to
7303 @samp{mh-sequence}(5)@footnote{See the section
7304 @uref{@value{MH-BOOK-HOME}/morseq.html, More About Sequences} in the MH
7305 book.}. As you've read, several of the MH-E commands can operate on a
7306 sequence, which is a shorthand for a range or group of messages. For
7307 example, you might want to forward several messages to a friend or
7308 colleague. Here's how to manipulate sequences. These commands are also
7309 available in the @samp{Sequence} menu.
7310
7311 @table @kbd
7312 @cindex @samp{Sequence > Toggle Tick Mark} menu item
7313 @cindex menu item, @samp{Sequence > Toggle Tick Mark}
7314 @kindex '
7315 @findex mh-toggle-tick
7316 @item '
7317 Toggle tick mark of range (@code{mh-toggle-tick}).
7318 @c -------------------------
7319 @kindex S ?
7320 @findex mh-prefix-help
7321 @item S ?
7322 Display cheat sheet for the commands of the current prefix in
7323 minibuffer (@code{mh-prefix-help}).
7324 @c -------------------------
7325 @cindex @samp{Sequence > Narrow to Tick Sequence} menu item
7326 @cindex menu item, @samp{Sequence > Narrow to Tick Sequence}
7327 @kindex S '
7328 @findex mh-narrow-to-tick
7329 @item S '
7330 Limit to ticked messages (@code{mh-narrow-to-tick}).
7331 @c -------------------------
7332 @cindex @samp{Sequence > Delete Message from Sequence...} menu item
7333 @cindex menu item, @samp{Sequence > Delete Message from Sequence...}
7334 @kindex S d
7335 @findex mh-delete-msg-from-seq
7336 @item S d
7337 Delete range from sequence (@code{mh-delete-msg-from-seq}).
7338 @c -------------------------
7339 @cindex @samp{Sequence > Delete Sequence...} menu item
7340 @cindex menu item, @samp{Sequence > Delete Sequence...}
7341 @kindex S k
7342 @findex mh-delete-seq
7343 @item S k
7344 Delete sequence (@code{mh-delete-seq}).
7345 @c -------------------------
7346 @cindex @samp{Sequence > List Sequences in Folder...} menu item
7347 @cindex menu item, @samp{Sequence > List Sequences in Folder...}
7348 @kindex S l
7349 @findex mh-list-sequences
7350 @item S l
7351 List all sequences in folder (@code{mh-list-sequences}).
7352 @c -------------------------
7353 @cindex @samp{Sequence > Narrow to Sequence...} menu item
7354 @cindex menu item, @samp{Sequence > Narrow to Sequence...}
7355 @kindex S n
7356 @findex mh-narrow-to-seq
7357 @item S n
7358 Restrict display to messages in sequence (@code{mh-narrow-to-seq}).
7359 @c -------------------------
7360 @cindex @samp{Sequence > Add Message to Sequence...} menu item
7361 @cindex menu item, @samp{Sequence > Add Message to Sequence...}
7362 @kindex S p
7363 @findex mh-put-msg-in-seq
7364 @item S p
7365 Add range to sequence (@code{mh-put-msg-in-seq}).
7366 @c -------------------------
7367 @cindex @samp{Sequence > List Sequences for Message} menu item
7368 @cindex menu item, @samp{Sequence > List Sequences for Message}
7369 @kindex S s
7370 @findex mh-msg-is-in-seq
7371 @item S s
7372 Display the sequences in which the current message appears
7373 (@code{mh-msg-is-in-seq}).
7374 @c -------------------------
7375 @cindex @samp{Sequence > Widen from Sequence} menu item
7376 @cindex menu item, @samp{Sequence > Widen from Sequence}
7377 @kindex S w
7378 @findex mh-widen
7379 @item S w
7380 Remove last restriction (@code{mh-widen}).
7381 @c -------------------------
7382 @findex mh-update-sequences
7383 @item M-x mh-update-sequences
7384 Flush MH-E's state out to MH@.
7385 @end table
7386
7387 @cindex @samp{mh-sequences} customization group
7388 @cindex customization group, @samp{mh-sequences}
7389
7390 The @samp{mh-sequences} customization group contains the options
7391 associated with sequences.
7392
7393 @vtable @code
7394 @item mh-refile-preserves-sequences-flag
7395 On means that sequences are preserved when messages are refiled
7396 (default: @samp{on}).
7397 @c -------------------------
7398 @item mh-tick-seq
7399 The name of the MH sequence for ticked messages (default: @samp{'tick}).
7400 @c -------------------------
7401 @item mh-update-sequences-after-mh-show-flag
7402 On means flush MH sequences to disk after message is shown (default:
7403 @samp{on}).
7404 @item mh-whitelist-preserves-sequences-flag
7405 On means that sequences are preserved when messages are whitelisted
7406 (default: @samp{on}).
7407 @end vtable
7408
7409 The following hook is available.
7410
7411 @vtable @code
7412 @item mh-unseen-updated-hook
7413 Hook run after the unseen sequence has been updated (default: @code{nil}).
7414 @end vtable
7415
7416 @cindex @command{pick}
7417 @cindex MH commands, @command{pick}
7418 @findex mh-put-msg-in-seq
7419 @kindex S p
7420
7421 To place a message in a sequence, use @kbd{S p}
7422 (@code{mh-put-msg-in-seq}). Give @kbd{S p} a range and you can add all
7423 the messages in a sequence to another sequence (for example, @kbd{C-u
7424 S p SourceSequence @key{RET} DestSequence @key{RET}}, @pxref{Ranges}).
7425
7426 @cindex @samp{tick} sequence
7427 @cindex sequence, @samp{tick}
7428 @cindex ticking messages
7429 @findex mh-index-ticked-messages
7430 @findex mh-toggle-tick
7431 @kindex '
7432 @kindex F '
7433 @kindex S p
7434
7435 One specific use of the @kbd{S p} command is @kbd{'}
7436 (@code{mh-toggle-tick}) which adds messages to the @samp{tick}
7437 sequence. This sequence can be viewed later with the @kbd{F '}
7438 (@code{mh-index-ticked-messages}) command (@pxref{Folders}).
7439
7440 @vindex mh-tick-seq
7441
7442 You can customize the option @code{mh-tick-seq} if you already use the
7443 @samp{tick} sequence for your own use. You can also disable all of the
7444 ticking functions by choosing the @samp{Disable Ticking} item but
7445 there isn't much advantage to that.
7446
7447 @cindex MH-Folder mode
7448 @cindex modes, MH-Folder
7449 @findex mh-narrow-to-seq
7450 @findex mh-narrow-to-tick
7451 @findex mh-widen
7452 @kindex S '
7453 @kindex S n
7454 @kindex S w
7455
7456 Once you've placed some messages in a sequence, you may wish to narrow
7457 the field of view to just those messages in the sequence you've
7458 created. To do this, use @kbd{S n} (@code{mh-narrow-to-seq}). You are
7459 prompted for the name of the sequence. What this does is show only
7460 those messages that are in the selected sequence in the MH-Folder
7461 buffer. In addition, it limits further MH-E searches to just those
7462 messages. To narrow the view to the messages in the @samp{tick}
7463 sequence, use @kbd{S '} (@code{mh-narrow-to-tick}). When you want to
7464 widen the view to all your messages again, use @kbd{S w}
7465 (@code{mh-widen}).
7466
7467 @cindex buffers, @file{*MH-E Sequences*}
7468 @cindex @file{*MH-E Sequences*}
7469 @findex mh-list-sequences
7470 @findex mh-msg-is-in-seq
7471 @kindex S l
7472 @kindex S s
7473
7474 You can see which sequences in which a message appears with the
7475 command @kbd{S s} (@code{mh-msg-is-in-seq}). Use a prefix argument to
7476 display the sequences in which another message appears (as in @kbd{C-u
7477 42 S s @key{RET}}). Or, you can list all sequences in a selected
7478 folder (default is current folder) with @kbd{S l}
7479 (@code{mh-list-sequences}). The list appears in a buffer named
7480 @file{*MH-E Sequences*} (@pxref{Miscellaneous}).
7481
7482 @cindex MH profile component, @samp{Previous-Sequence}
7483 @cindex @samp{cur} sequence
7484 @cindex @samp{Previous-Sequence} MH profile component
7485 @cindex sequence, @samp{cur}
7486 @cindex sequence, @samp{Previous-Sequence}
7487 @vindex mh-refile-preserves-sequences-flag
7488
7489 If a message is in any sequence (except
7490 @samp{Previous-Sequence:}@footnote{See @samp{mh-profile}(5)).} and
7491 @samp{cur}) when it is refiled, then it will still be in those
7492 sequences in the destination folder. If this behavior is not desired,
7493 then turn off the option @code{mh-refile-preserves-sequences-flag}.
7494
7495 @findex mh-delete-msg-from-seq
7496 @findex mh-delete-seq
7497 @kindex d
7498 @kindex S d
7499 @kindex S k
7500
7501 If you want to remove a message (or range, @pxref{Ranges}) from a
7502 sequence, use @kbd{S d} (@code{mh-delete-msg-from-seq}). If you want
7503 to delete an entire sequence, use @kbd{S k} (@code{mh-delete-seq}). In
7504 the latter case you are prompted for the sequence to delete. Note that
7505 this deletes only the sequence, not the messages in the sequence. If
7506 you want to delete the messages, use @kbd{C-u d} (@pxref{Reading
7507 Mail}).
7508
7509 @cindex @samp{Unseen-Sequence} MH profile component
7510 @cindex @samp{cur} sequence
7511 @cindex @samp{tick} sequence
7512 @cindex MH profile component, @samp{Unseen-Sequence}
7513 @cindex sequence, @samp{Unseen-Sequence}
7514 @cindex sequence, @samp{cur}
7515 @cindex sequence, @samp{tick}
7516 @findex mh-update-sequences
7517 @kindex M-x mh-update-sequences
7518 @kindex q
7519 @kindex x
7520 @vindex mh-tick-seq
7521 @vindex mh-update-sequences-after-mh-show-flag
7522
7523 Three sequences are maintained internally by MH-E and pushed out to MH
7524 when a message is shown. They include the sequence specified by your
7525 @samp{Unseen-Sequence:} profile component, @samp{cur}, and the
7526 sequence listed by the option @code{mh-tick-seq} which is @samp{tick}
7527 by default. If you do not like this behavior, turn off the option
7528 @code{mh-update-sequences-after-mh-show-flag}. You can then update the
7529 state manually with the @kbd{x}, @kbd{q}, or @kbd{M-x
7530 mh-update-sequences} commands.
7531
7532 @vindex mh-seen-list
7533 @vindex mh-unseen-updated-hook
7534
7535 The hook @code{mh-unseen-updated-hook} is run after the unseen
7536 sequence has been updated. The variable @code{mh-seen-list} can be
7537 used by this hook to obtain the list of messages which were removed
7538 from the unseen sequence.
7539
7540 @cindex @command{mark}
7541 @cindex MH commands, @command{mark}
7542 @kindex S n
7543 @kindex S w
7544
7545 With the exceptions of @kbd{S n} and @kbd{S w}, the underlying MH
7546 command dealing with sequences is @command{mark}@footnote{See the
7547 section @uref{@value{MH-BOOK-HOME}/mmbwm.html, Make Message Bookmarks
7548 with mark} in the MH book.}.
7549
7550 @node Junk, Miscellaneous, Sequences, Top
7551 @chapter Dealing With Junk Mail
7552
7553 @cindex Marshall Rose
7554 @cindex junk mail
7555 @cindex spam
7556
7557 Marshall Rose once wrote a paper on MH entitled, @cite{How to process
7558 200 messages a day and still get some real work done}. This chapter
7559 could be entitled, @cite{How to process 1000 spams a day and still get
7560 some real work done}.
7561
7562 @cindex blacklisting
7563 @cindex ham
7564 @cindex viruses
7565 @cindex whitelisting
7566 @cindex worms
7567
7568 We use the terms @dfn{junk mail} and @dfn{spam} interchangeably for
7569 any unwanted message which includes spam, @dfn{viruses}, and
7570 @dfn{worms}. The opposite of spam is @dfn{ham}. The act of classifying
7571 a sender as one who sends junk mail is called @dfn{blacklisting}; the
7572 opposite is called @dfn{whitelisting}.
7573
7574 @table @kbd
7575 @kindex J ?
7576 @findex mh-prefix-help
7577 @item J ?
7578 Display cheat sheet for the commands of the current prefix in
7579 minibuffer (@code{mh-prefix-help}).
7580 @c -------------------------
7581 @kindex J b
7582 @findex mh-junk-blacklist
7583 @item J b
7584 Blacklist range as spam (@code{mh-junk-blacklist}).
7585 @c -------------------------
7586 @kindex J w
7587 @findex mh-junk-whitelist
7588 @item J w
7589 Whitelist range as ham (@code{mh-junk-whitelist}).
7590 @c -------------------------
7591 @item @code{mh-spamassassin-identify-spammers}
7592 Identify spammers who are repeat offenders.
7593 @end table
7594
7595 @cindex @samp{mh-junk} customization group
7596 @cindex customization group, @samp{mh-junk}
7597
7598 The following table lists the options from the @samp{mh-junk}
7599 customization group.
7600
7601 @vtable @code
7602 @item mh-junk-background
7603 If on, spam programs are run in background (default: @samp{off}).
7604 @c -------------------------
7605 @item mh-junk-disposition
7606 Disposition of junk mail (default: @samp{Delete Spam}).
7607 @c -------------------------
7608 @item mh-junk-program
7609 Spam program that MH-E should use (default: @samp{Auto-detect}).
7610 @end vtable
7611
7612 @cindex @samp{mh-sequences} customization group
7613 @cindex customization group, @samp{mh-sequences}
7614
7615 The following option in the @samp{mh-sequences} customization group is
7616 also available.
7617
7618 @vtable @code
7619 @item mh-whitelist-preserves-sequences-flag
7620 On means that sequences are preserved when messages are whitelisted
7621 (default: @samp{on}).
7622 @end vtable
7623
7624 The following hooks are available.
7625
7626 @vtable @code
7627 @item mh-blacklist-msg-hook
7628 Hook run by @kbd{J b} (@code{mh-junk-blacklist}) after marking each
7629 message for blacklisting (default: @code{nil}).
7630 @c -------------------------
7631 @item mh-whitelist-msg-hook
7632 Hook run by @kbd{J w} (@code{mh-junk-whitelist}) after marking each
7633 message for whitelisting (default @samp{nil}).
7634 @end vtable
7635
7636 The following faces are available.
7637
7638 @vtable @code
7639 @item mh-folder-blacklisted
7640 Blacklisted message face.
7641 @c -------------------------
7642 @item mh-folder-whitelisted
7643 Whitelisted message face
7644 @end vtable
7645
7646 @cindex SpamProbe
7647 @cindex Spamassassin
7648 @cindex bogofilter
7649 @cindex spam filters, SpamProbe
7650 @cindex spam filters, Spamassassin
7651 @cindex spam filters, bogofilter
7652
7653 MH-E depends on @uref{http://spamassassin.apache.org/, SpamAssassin},
7654 @uref{http://bogofilter.sourceforge.net/, bogofilter}, or
7655 @uref{http://spamprobe.sourceforge.net/, SpamProbe} to throw the dreck
7656 away. This chapter describes briefly how to configure these programs
7657 to work well with MH-E and how to use MH-E's interface that provides
7658 continuing education for these programs.
7659
7660 @vindex mh-junk-program
7661
7662 The default setting of the option @code{mh-junk-program} is
7663 @samp{Auto-detect} which means that MH-E will automatically choose one
7664 of SpamAssassin, bogofilter, or SpamProbe in that order. If, for
7665 example, you have both SpamAssassin and bogofilter installed and you
7666 want to use bogofilter, then you can set this option to
7667 @samp{Bogofilter}.
7668
7669 @findex mh-junk-blacklist
7670 @kindex J b
7671 @vindex mh-junk-disposition
7672
7673 The command @kbd{J b} (@code{mh-junk-blacklist}) trains the spam
7674 program in use with the content of the range (@pxref{Ranges}) and then
7675 handles the message(s) as specified by the option
7676 @code{mh-junk-disposition}. By default, this option is set to
7677 @samp{Delete Spam} but you can also specify the name of the folder
7678 which is useful for building a corpus of spam for training purposes.
7679
7680 @findex mh-junk-whitelist
7681 @kindex J w
7682
7683 In contrast, the command @kbd{J w} (@code{mh-junk-whitelist})
7684 reclassifies a range of messages (@pxref{Ranges}) as ham if it were
7685 incorrectly classified as spam. It then refiles the message into the
7686 @file{+inbox} folder.
7687
7688 @cindex MH profile component, @samp{Previous-Sequence}
7689 @cindex @samp{cur} sequence
7690 @cindex @samp{Previous-Sequence} MH profile component
7691 @cindex sequence, @samp{cur}
7692 @cindex sequence, @samp{Previous-Sequence}
7693 @vindex mh-whitelist-preserves-sequences-flag
7694
7695 If a message is in any sequence (except @samp{Previous-Sequence:} and
7696 @samp{cur}) when it is whitelisted, then it will still be in those
7697 sequences in the destination folder. If this behavior is not desired,
7698 then turn off the option @code{mh-whitelist-preserves-sequences-flag}.
7699
7700 @cindex @file{*MH-E Log*}
7701 @cindex buffers, @file{*MH-E Log*}
7702 @findex call-process
7703 @vindex mh-junk-background
7704
7705 By default, the programs are run in the foreground, but this can be
7706 slow when junking large numbers of messages. If you have enough memory
7707 or don't junk that many messages at the same time, you might try
7708 turning on the option @code{mh-junk-background}. @footnote{Note that
7709 the option @code{mh-junk-background} is used as the @code{display}
7710 argument in the call to @code{call-process}. Therefore, turning on
7711 this option means setting its value to @samp{0}. You can also set its
7712 value to @samp{t} to direct the programs' output to the @file{*MH-E
7713 Log*} buffer; this may be useful for debugging.}
7714
7715 The following sections discuss the various counter-spam measures that
7716 MH-E can work with.
7717
7718 @cindex @file{.procmailrc}
7719 @cindex files, @file{.procmailrc}
7720
7721 @subheading SpamAssassin
7722
7723 @cindex Spamassassin
7724 @cindex spam filters, Spamassassin
7725
7726 SpamAssassin is one of the more popular spam filtering programs. Get
7727 it from your local distribution or from the
7728 @uref{http://spamassassin.apache.org/, SpamAssassin web site}.
7729
7730 To use SpamAssassin, add the following recipes to @file{~/.procmailrc}:
7731
7732 @cindex @command{spamc}
7733 @cindex @samp{X-Spam-Level} header field
7734 @cindex @samp{X-Spam-Status} header field
7735 @cindex header field, @samp{X-Spam-Level}
7736 @cindex header field, @samp{X-Spam-Status}
7737
7738 @smallexample
7739 PATH=$PATH:/usr/bin/mh
7740 MAILDIR=$HOME/`mhparam Path`
7741
7742 # Fight spam with SpamAssassin.
7743 :0fw
7744 | spamc
7745
7746 # Anything with a spam level of 10 or more is junked immediately.
7747 :0:
7748 * ^X-Spam-Level: ..........
7749 /dev/null
7750
7751 :0:
7752 * ^X-Spam-Status: Yes
7753 spam/.
7754 @end smallexample
7755
7756 If you don't use @command{spamc}, use @samp{spamassassin -P -a}.
7757
7758 Note that one of the recipes above throws away messages with a score
7759 greater than or equal to 10. Here's how you can determine a value that
7760 works best for you.
7761
7762 First, run @samp{spamassassin -t} on every mail message in your
7763 archive and use @command{gnumeric} to verify that the average plus the
7764 standard deviation of good mail is under 5, the SpamAssassin default
7765 for ``spam''.
7766
7767 Using @command{gnumeric}, sort the messages by score and view the
7768 messages with the highest score. Determine the score which encompasses
7769 all of your interesting messages and add a couple of points to be
7770 conservative. Add that many dots to the @samp{X-Spam-Level:} header
7771 field above to send messages with that score down the drain.
7772
7773 In the example above, messages with a score of 5--9 are set aside in
7774 the @samp{+spam} folder for later review. The major weakness of
7775 rules-based filters is a plethora of false positives so it is
7776 worthwhile to check.
7777
7778 @findex mh-junk-blacklist
7779 @findex mh-junk-whitelist
7780 @kindex J b
7781 @kindex J w
7782
7783 If SpamAssassin classifies a message incorrectly, or is unsure, you can
7784 use the MH-E commands @kbd{J b} (@code{mh-junk-blacklist}) and
7785 @kbd{J w} (@code{mh-junk-whitelist}).
7786
7787 @cindex @command{sa-learn}
7788 @cindex @file{.spamassassin/user_prefs}
7789 @cindex files, @file{.spamassassin/user_prefs}
7790
7791 The command @kbd{J b} (@code{mh-junk-blacklist}) adds a
7792 @samp{blacklist_from} entry to @file{~/spamassassin/user_prefs},
7793 deletes the message, and sends the message to the Razor, so that
7794 others might not see this spam. If the @command{sa-learn} command is
7795 available, the message is also recategorized as spam.
7796
7797 The command@kbd{J w} (@code{mh-junk-whitelist}) adds a
7798 @samp{whitelist_from} rule to @samp{~/.spamassassin/user_prefs}. If
7799 the @command{sa-learn} command is available, the message is also
7800 recategorized as ham.
7801
7802 Over time, you'll observe that the same host or domain occurs
7803 repeatedly in the @samp{blacklist_from} entries, so you might think
7804 that you could avoid future spam by blacklisting all mail from a
7805 particular domain. The utility function
7806 @code{mh-spamassassin-identify-spammers} helps you do precisely that.
7807 This function displays a frequency count of the hosts and domains in
7808 the @samp{blacklist_from} entries from the last blank line in
7809 @file{~/.spamassassin/user_prefs} to the end of the file. This
7810 information can be used so that you can replace multiple
7811 @samp{blacklist_from} entries with a single wildcard entry such as:
7812
7813 @smallexample
7814 blacklist_from *@@*amazingoffersdirect2u.com
7815 @end smallexample
7816
7817 In versions of SpamAssassin (2.50 and on) that support a Bayesian
7818 classifier, @kbd{J b} @code{(mh-junk-blacklist}) uses the program
7819 @command{sa-learn} to recategorize the message as spam. Neither MH-E,
7820 nor SpamAssassin, rebuilds the database after adding words, so you
7821 will need to run @samp{sa-learn --rebuild} periodically. This can be
7822 done by adding the following to your @file{crontab}:
7823
7824 @smallexample
7825 0 * * * * sa-learn --rebuild > /dev/null 2>&1
7826 @end smallexample
7827
7828 @subheading Bogofilter
7829
7830 @cindex bogofilter
7831 @cindex spam filters, bogofilter
7832
7833 Bogofilter is a Bayesian spam filtering program. Get it from your
7834 local distribution or from the
7835 @uref{http://bogofilter.sourceforge.net/, bogofilter web site}.
7836
7837 Bogofilter is taught by running:
7838
7839 @smallexample
7840 bogofilter -n < good-message
7841 @end smallexample
7842
7843 on every good message, and
7844
7845 @smallexample
7846 bogofilter -s < spam-message
7847 @end smallexample
7848
7849 @cindex full training
7850
7851 on every spam message. This is called a @dfn{full training}; three
7852 other training methods are described in the FAQ that is distributed
7853 with bogofilter. Note that most Bayesian filters need 1000 to 5000 of
7854 each type of message to start doing a good job.
7855
7856 To use bogofilter, add the following recipes to @file{~/.procmailrc}:
7857
7858 @cindex @samp{X-Bogosity} header field
7859 @cindex header field, @samp{X-Bogosity}
7860
7861 @smallexample
7862 PATH=$PATH:/usr/bin/mh
7863 MAILDIR=$HOME/`mhparam Path`
7864
7865 # Fight spam with Bogofilter.
7866 :0fw
7867 | bogofilter -3 -e -p
7868
7869 :0:
7870 * ^X-Bogosity: Yes, tests=bogofilter
7871 spam/.
7872
7873 :0:
7874 * ^X-Bogosity: Unsure, tests=bogofilter
7875 spam/unsure/.
7876 @end smallexample
7877
7878 @findex mh-junk-blacklist
7879 @findex mh-junk-whitelist
7880 @kindex J b
7881 @kindex J w
7882
7883 If bogofilter classifies a message incorrectly, or is unsure, you can
7884 use the MH-E commands @kbd{J b} (@code{mh-junk-blacklist}) and @kbd{J
7885 w} (@code{mh-junk-whitelist}) to update bogofilter's training.
7886
7887 The @cite{Bogofilter FAQ} suggests that you run the following
7888 occasionally to shrink the database:
7889
7890 @smallexample
7891 bogoutil -d wordlist.db | bogoutil -l wordlist.db.new
7892 mv wordlist.db wordlist.db.prv
7893 mv wordlist.db.new wordlist.db
7894 @end smallexample
7895
7896 The @cite{Bogofilter tuning HOWTO} describes how you can fine-tune
7897 bogofilter.
7898
7899 @subheading SpamProbe
7900
7901 @cindex SpamProbe
7902 @cindex spam filters, SpamProbe
7903
7904 SpamProbe is a Bayesian spam filtering program. Get it from your local
7905 distribution or from the @uref{http://spamprobe.sourceforge.net,
7906 SpamProbe web site}.
7907
7908 To use SpamProbe, add the following recipes to @file{~/.procmailrc}:
7909
7910 @cindex @command{formail}
7911 @cindex @samp{X-SpamProbe} header field
7912 @cindex header field, @samp{X-SpamProbe}
7913
7914 @smallexample
7915 PATH=$PATH:/usr/bin/mh
7916 MAILDIR=$HOME/`mhparam Path`
7917
7918 # Fight spam with SpamProbe.
7919 :0
7920 SCORE=| spamprobe receive
7921
7922 :0 wf
7923 | formail -I "X-SpamProbe: $SCORE"
7924
7925 :0:
7926 *^X-SpamProbe: SPAM
7927 spam/.
7928 @end smallexample
7929
7930 @findex mh-junk-blacklist
7931 @findex mh-junk-whitelist
7932 @kindex J b
7933 @kindex J w
7934
7935 If SpamProbe classifies a message incorrectly, you can use the MH-E
7936 commands @kbd{J b} (@code{mh-junk-blacklist}) and @kbd{J w}
7937 (@code{mh-junk-whitelist}) to update SpamProbe's training.
7938
7939 @subheading Other Things You Can Do
7940
7941 There are a couple of things that you can add to @file{~/.procmailrc}
7942 in order to filter out a lot of spam and viruses. The first is to
7943 eliminate any message with a Windows executable (which is most likely
7944 a virus). The second is to eliminate mail in character sets that you
7945 can't read.
7946
7947 @cindex @samp{Content-Transfer-Encoding} header field
7948 @cindex @samp{Content-Type} header field
7949 @cindex @samp{Subject} header field
7950 @cindex header field, @samp{Content-Transfer-Encoding}
7951 @cindex header field, @samp{Content-Type}
7952 @cindex header field, @samp{Subject}
7953
7954 @smallexample
7955 PATH=$PATH:/usr/bin/mh
7956 MAILDIR=$HOME/`mhparam Path`
7957
7958 #
7959 # Filter messages with w32 executables/virii.
7960 #
7961 # These attachments are base64 and have a TVqQAAMAAAAEAAAA//8AALg
7962 # pattern. The string "this program cannot be run in MS-DOS mode"
7963 # encoded in base64 is 4fug4AtAnNIbg and helps to avoid false
7964 # positives (Roland Smith via Pete from the bogofilter mailing list).
7965 #
7966 :0 B:
7967 * ^Content-Transfer-Encoding:.*base64
7968 * ^TVqQAAMAAAAEAAAA//8AALg
7969 * 4fug4AtAnNIbg
7970 spam/exe/.
7971
7972 #
7973 # Filter mail in unreadable character sets (from the Bogofilter FAQ).
7974 #
7975 UNREADABLE='[^?"]*big5|iso-2022-jp|ISO-2022-KR|euc-kr|gb2312|ks_c_5601-1987'
7976
7977 :0:
7978 * 1^0 $ ^Subject:.*=\?($UNREADABLE)
7979 * 1^0 $ ^Content-Type:.*charset="?($UNREADABLE)
7980 spam/unreadable/.
7981
7982 :0:
7983 * ^Content-Type:.*multipart
7984 * B ?? $ ^Content-Type:.*^?.*charset="?($UNREADABLE)
7985 spam/unreadable/.
7986 @end smallexample
7987
7988 @node Miscellaneous, Scan Line Formats, Junk, Top
7989 @chapter Miscellaneous Commands, Variables, and Buffers
7990
7991 This chapter covers the following command and the various MH-E
7992 buffers,
7993
7994 @ftable @code
7995 @item mh-version
7996 Display version information about MH-E and the MH mail handling
7997 system.
7998 @end ftable
7999
8000 @cindex buffers, @file{*MH-E Info*}
8001 @cindex MH-E version
8002 @cindex @file{*MH-E Info*}
8003 @cindex version
8004 @kindex M-x mh-version
8005
8006 One command worth noting is @kbd{M-x mh-version}. You can compare the
8007 version this command prints to the latest release (@pxref{Getting
8008 MH-E}). The output of @kbd{M-x mh-version}, found in a buffer named
8009 @file{*MH-E Info*}, should usually be included with any bug report you
8010 submit (@pxref{Bug Reports}).
8011
8012 @subheading MH-E Buffers
8013
8014 Besides the MH-Folder, MH-Show, and MH-Letter buffers, MH-E creates
8015 several other buffers. They are:
8016
8017 @table @samp
8018 @cindex @file{*MH-E Folders*}
8019 @cindex buffers, @file{*MH-E Folders*}
8020 @findex mh-list-folders
8021 @item *MH-E Folders*
8022 @kindex F l
8023 This buffer contains the output of @kbd{F l} (@code{mh-list-folders}).
8024 @xref{Folders}.
8025 @c -------------------------
8026 @cindex @file{*MH-E Help*}
8027 @cindex buffers, @file{*MH-E Help*}
8028 @findex mh-help
8029 @item *MH-E Help*
8030 @kindex ?
8031 @kindex C-c ?
8032 This buffer contains the output of @kbd{?} (@code{mh-help}) and
8033 @kbd{C-c ?} in MH-Letter mode. @xref{Using This Manual}.
8034 @c -------------------------
8035 @cindex @file{*MH-E Info*}
8036 @cindex buffers, @file{*MH-E Info*}
8037 @item *MH-E Info*
8038 This buffer contains the output of @kbd{M-x mh-version @key{RET}}.
8039 @c -------------------------
8040 @cindex @file{*MH-E Log*}
8041 @cindex buffers, @file{*MH-E Log*}
8042 @item *MH-E Log*
8043 This buffer contains the last 100 lines of the output of the various
8044 MH commands.
8045 @c -------------------------
8046 @cindex @file{*MH-E Mail Delivery*}
8047 @cindex buffers, @file{*MH-E Mail Delivery*}
8048 @item *MH-E Mail Delivery*
8049 This buffer contains the transcript of a mail delivery. @xref{Sending
8050 Message}.
8051 @c -------------------------
8052 @cindex @file{*MH-E Recipients*}
8053 @cindex buffers, @file{*MH-E Recipients*}
8054 @findex mh-check-whom
8055 @item *MH-E Recipients*
8056 @kindex C-c C-w
8057 This buffer contains the output of @kbd{C-c C-w}
8058 (@code{mh-check-whom}) and is killed when draft is sent.
8059 @xref{Checking Recipients}.
8060 @c -------------------------
8061 @cindex @file{*MH-E Sequences*}
8062 @cindex buffers, @file{*MH-E Sequences*}
8063 @item *MH-E Sequences*
8064 This buffer contains the output of @kbd{S l}
8065 (@code{mh-list-sequences}). @xref{Sequences}.
8066 @c -------------------------
8067 @cindex @file{*mh-temp*}
8068 @cindex buffers, @file{*mh-temp*}
8069 @item *mh-temp*
8070 This is a scratch, ephemeral, buffer used by MH-E functions. Note that
8071 it is hidden because the first character in the name is a space.
8072 You'll generally not have any need for this buffer.
8073 @end table
8074
8075 @node Scan Line Formats, Procmail, Miscellaneous, Top
8076 @appendix Scan Line Formats
8077
8078 @cindex scan line formats
8079
8080 This appendix discusses how MH-E creates, parses, and manipulates scan
8081 lines. If you have your own MH scan or inc format files, you
8082 @strong{can} teach MH-E how to handle them, but it isn't easy as
8083 you'll see.
8084
8085 @cindex @samp{mh-scan-line-formats} customization group
8086 @cindex customization group, @samp{mh-scan-line-formats}
8087
8088 This table lists the options in the @samp{mh-scan-line-formats}
8089 customization group.
8090
8091 @vtable @code
8092 @item mh-adaptive-cmd-note-flag
8093 On means that the message number width is determined dynamically
8094 (default: @samp{on}).
8095 @c -------------------------
8096 @item mh-scan-format-file
8097 Specifies the format file to pass to the scan program (default:
8098 @samp{Use MH-E scan Format}).
8099 @c -------------------------
8100 @item mh-scan-prog
8101 Program used to scan messages (default: @code{"scan"}).
8102 @end vtable
8103
8104 @vindex mh-adaptive-cmd-note-flag
8105
8106 There are a couple of caveats when creating your own scan format file.
8107 First, MH-E will not work if your scan lines do not include message
8108 numbers. It will work poorly if you don't dedicate a column for
8109 showing the current message and notations. It is also best to keep the
8110 first column empty to make room for the cursor and so that text isn't
8111 obscured by the current message's overlay arrow when running in a
8112 terminal. You won't be able to use the option
8113 @code{mh-adaptive-cmd-note-flag} or the threading features
8114 (@pxref{Threading}).
8115
8116 @cindex message numbers
8117 @findex mh-set-cmd-note
8118 @vindex mh-adaptive-cmd-note-flag
8119 @vindex mh-scan-format-file
8120
8121 If you've created your own format to handle long message numbers,
8122 you'll be pleased to know you no longer need it since MH-E adapts its
8123 internal format based upon the largest message number if
8124 @code{mh-adaptive-cmd-note-flag} is on (the default). If you prefer
8125 fixed-width message numbers, turn off @code{mh-adaptive-cmd-note-flag}
8126 and call @code{mh-set-cmd-note} with the width specified by your
8127 format file (see @code{mh-scan-format-file}). For example, the default
8128 width is 4, so you would use @samp{(mh-set-cmd-note 4)}.
8129
8130 @vindex mh-adaptive-cmd-note-flag
8131 @vindex mh-scan-format-file
8132 @vindex mh-scan-format-mh
8133 @vindex mh-scan-format-nmh
8134
8135 The default setting for @code{mh-scan-format-file} is @samp{Use MH-E
8136 scan Format}. This means that the format string will be taken from the
8137 either @code{mh-scan-format-mh} or @code{mh-scan-format-nmh} depending
8138 on whether MH or nmh (or GNU mailutils MH) is in use. This setting
8139 also enables you to turn on the option
8140 @code{mh-adaptive-cmd-note-flag}. You can also set this option to
8141 @samp{Use Default scan Format} to get the same output as you would get
8142 if you ran @command{scan} from the shell. If you have a format file
8143 that you want MH-E to use but not MH, you can set this option to
8144 @samp{Specify a scan Format File} and enter the name of your format
8145 file.
8146
8147 @vindex mh-scan-format-file
8148 @vindex mh-scan-format-mh
8149 @vindex mh-scan-format-nmh
8150
8151 The scan format that MH-E uses when @code{mh-scan-format-file} is set
8152 to its default of @samp{Use MH-E scan Format} is held in the variables
8153 @code{mh-scan-format-nmh} and @code{mh-scan-format-mh} depending on
8154 whether you are using nmh (or GNU mailutils MH) or not. Typically, you
8155 create your own format files rather than modifying these variables.
8156 The value of @code{mh-scan-format-nmh} is:
8157
8158 @smallexample
8159 (concat
8160 "%4(msg)"
8161 "%<(cur)+%| %>"
8162 "%<@{replied@}-"
8163 "%?(nonnull(comp@{to@}))%<(mymbox@{to@})t%>"
8164 "%?(nonnull(comp@{cc@}))%<(mymbox@{cc@})c%>"
8165 "%?(nonnull(comp@{bcc@}))%<(mymbox@{bcc@})b%>"
8166 "%?(nonnull(comp@{newsgroups@}))n%>"
8167 "%<(zero) %>"
8168 "%02(mon@{date@})/%02(mday@{date@})%<@{date@} %|*%>"
8169 "%<(mymbox@{from@})%<@{to@}To:%14(decode(friendly@{to@}))%>%>"
8170 "%<(zero)%17(decode(friendly@{from@}))%> "
8171 "%(decode@{subject@})%<@{body@}<<%@{body@}%>")
8172 @end smallexample
8173
8174 @cindex decoding RFC 2047
8175 @cindex RFC 2047, decoding
8176 @vindex mh-scan-format-mh
8177
8178 The setting for @code{mh-scan-format-mh} is similar, except that MH
8179 doesn't have the function @code{decode} (which is used to decode RFC
8180 2047 encodings).
8181
8182 @cindex notations, scan line
8183 @cindex scan line notations
8184
8185 These strings are passed to the @command{scan} program via the
8186 @option{-format} argument. The formats are identical to the defaults
8187 except that additional hints for fontification have been added to the
8188 existing notations in the fifth column (remember that in Emacs, the
8189 columns start at 0). The values of the fifth column, in priority
8190 order, are: @samp{-} if the message has been replied to, @samp{t} if
8191 an address in the @samp{To:} field matches one of the mailboxes of the
8192 current user, @samp{c} if the @samp{Cc:} field matches, @samp{b} if
8193 the @samp{Bcc:} field matches, and @samp{n} if a non-empty
8194 @samp{Newsgroups:} field is present.
8195
8196 @cindex @command{scan}
8197 @cindex MH commands, @command{scan}
8198 @vindex mh-progs
8199 @vindex mh-scan-prog
8200
8201 The name of the program that generates a listing of one line per
8202 message is held in @code{mh-scan-prog} (default: @code{"scan"}).
8203 Unless this variable contains an absolute pathname, it is assumed to
8204 be in the @code{mh-progs} directory (@pxref{Getting Started}). You may
8205 link another program to @command{scan} (see @samp{mh-profile}(5)) to
8206 produce a different type of listing@footnote{See the section
8207 @uref{@value{MH-BOOK-HOME}/faswsprs.html, Find and Specify with scan
8208 pick Ranges Sequences} in the MH book.}.
8209
8210 @cindex regular expressions, scan line formats
8211 @findex mh-set-cmd-note
8212 @findex setq
8213
8214 If you change the format of the scan lines you'll need to tell MH-E
8215 how to parse the new format. As you will see, quite a lot of variables
8216 are involved to do that. Use @kbd{M-x apropos @key{RET}
8217 mh-scan.*regexp @key{RET}} to obtain a list of these variables. You
8218 will also have to call @code{mh-set-cmd-note} if your notations are
8219 not in column 4 (columns in Emacs start with 0). Note that unlike most
8220 of the user options described in this manual, these are variables and
8221 must be set with @code{setq} instead of in a customization buffer. For
8222 help with regular expressions, see
8223 @ifnothtml
8224 @ref{Regexps, , Syntax of Regular Expressions, emacs, The
8225 GNU Emacs Manual}.
8226 @end ifnothtml
8227 @ifhtml
8228 section
8229 @uref{http://www.gnu.org/software/emacs/manual/html_node/emacs/Regexps.html,
8230 Syntax of Regular Expressions} in @cite{The GNU Emacs Manual}.
8231 @end ifhtml
8232
8233 The first variable has to do with pruning out garbage.
8234
8235 @vtable @code
8236 @cindex @command{inc}
8237 @cindex MH commands, @command{inc}
8238 @cindex @command{scan}
8239 @cindex MH commands, @command{scan}
8240 @item mh-scan-valid-regexp
8241 This regular expression describes a valid scan line. This is used to
8242 eliminate error messages that are occasionally produced by
8243 @command{inc}@footnote{See the section
8244 @uref{@value{MH-BOOK-HOME}/reapre.html, Reading Mail: inc show next
8245 prev} in the MH book.} or @command{scan} (default: @code{"^ *[0-9]"}).
8246 @end vtable
8247
8248 Next, many variables control how the scan lines are parsed.
8249
8250 @vtable @code
8251 @vindex mh-folder-body
8252 @vindex mh-folder-font-lock-keywords
8253 @item mh-scan-body-regexp
8254 This regular expression matches the message body fragment. Note that
8255 the default setting of @code{mh-folder-font-lock-keywords} expects
8256 this expression to contain at least one parenthesized expression which
8257 matches the body text as in the default of
8258 @code{"\\(<<\\([^\n]+\\)?\\)"}. If this regular expression is not
8259 correct, the body fragment will not be highlighted with the face
8260 @code{mh-folder-body}.
8261 @c -------------------------
8262 @vindex mh-folder-cur-msg-number
8263 @vindex mh-folder-font-lock-keywords
8264 @vindex mh-note-cur
8265 @item mh-scan-cur-msg-number-regexp
8266 This regular expression matches the current message. It must match
8267 from the beginning of the line. Note that the default setting of
8268 @code{mh-folder-font-lock-keywords} expects this expression to contain
8269 at least one parenthesized expression which matches the message number
8270 as in the default of @w{@code{"^\\( *[0-9]+\\+\\).*"}}. This
8271 expression includes the leading space and current message marker
8272 @samp{+} within the parenthesis since it looks better to highlight
8273 these items as well. The highlighting is done with the face
8274 @code{mh-folder-cur-msg-number}. This regular expression should be
8275 correct as it is needed by non-fontification functions. See also
8276 @code{mh-note-cur}.
8277 @c -------------------------
8278 @vindex mh-folder-date
8279 @vindex mh-folder-font-lock-keywords
8280 @vindex mh-scan-sent-to-me-sender-regexp
8281 @item mh-scan-date-regexp
8282 This regular expression matches a valid date. It must @strong{not} be
8283 anchored to the beginning or the end of the line. Note that the
8284 default setting of @code{mh-folder-font-lock-keywords} expects this
8285 expression to contain only one parenthesized expression which matches
8286 the date field as in the default of
8287 @code{"\\([0-9][0-9]/[0-9][0-9]\\)"}. If this regular expression is
8288 not correct, the date will not be highlighted with the face
8289 @code{mh-folder-date}.
8290 @c -------------------------
8291 @vindex mh-folder-deleted
8292 @vindex mh-folder-font-lock-keywords
8293 @vindex mh-note-deleted
8294 @item mh-scan-deleted-msg-regexp
8295 This regular expression matches deleted messages. It must match from
8296 the beginning of the line. Note that the default setting of
8297 @code{mh-folder-font-lock-keywords} expects this expression to contain
8298 at least one parenthesized expression which matches the message number
8299 as in the default of @code{"^\\( *[0-9]+\\)D"}. This expression
8300 includes the leading space within the parenthesis since it looks
8301 better to highlight it as well. The highlighting is done with the face
8302 @code{mh-folder-deleted}. This regular expression should be correct as
8303 it is needed by non-fontification functions. See also
8304 @code{mh-note-deleted}.
8305 @c -------------------------
8306 @vindex mh-folder-font-lock-keywords
8307 @vindex mh-folder-msg-number
8308 @item mh-scan-good-msg-regexp
8309 This regular expression matches ``good'' messages. It must match from
8310 the beginning of the line. Note that the default setting of
8311 @code{mh-folder-font-lock-keywords} expects this expression to contain
8312 at least one parenthesized expression which matches the message number
8313 as in the default of @w{@code{"^\\( *[0-9]+\\)[^D^0-9]"}}. This
8314 expression includes the leading space within the parenthesis since it
8315 looks better to highlight it as well. The highlighting is done with
8316 the face @code{mh-folder-msg-number}. This regular expression should
8317 be correct as it is needed by non-fontification functions.
8318 @c -------------------------
8319 @vindex mh-scan-format-file
8320 @item mh-scan-msg-format-regexp
8321 This regular expression finds the message number width in a scan
8322 format. Note that the message number must be placed in a parenthesized
8323 expression as in the default of @code{"%\\([0-9]*\\)(msg)"}. This
8324 variable is only consulted if @code{mh-scan-format-file} is set to
8325 @samp{Use MH-E scan Format}.
8326 @c -------------------------
8327 @vindex mh-scan-format-file
8328 @item mh-scan-msg-format-string
8329 This is a format string for the width of the message number in a scan
8330 format. Use @samp{0%d} for zero-filled message numbers. This variable
8331 is only consulted if @code{mh-scan-format-file} is set to @samp{Use
8332 MH-E scan Format} (default: @code{"%d"}).
8333 @c -------------------------
8334 @item mh-scan-msg-number-regexp
8335 This regular expression extracts the message number. It must match
8336 from the beginning of the line. Note that the message number must be
8337 placed in a parenthesized expression as in the default of @w{@code{"^
8338 *\\([0-9]+\\)"}}.
8339 @c -------------------------
8340 @item mh-scan-msg-overflow-regexp
8341 This regular expression matches overflowed message numbers (default:
8342 @code{"^[?0-9][0-9]"}).
8343 @c -------------------------
8344 @item mh-scan-msg-search-regexp
8345 This regular expression matches a particular message. It is a format
8346 string; use @samp{%d} to represent the location of the message number
8347 within the expression as in the default of @code{"^[^0-9]*%d[^0-9]"}.
8348 @c -------------------------
8349 @vindex mh-folder-address
8350 @vindex mh-folder-font-lock-keywords
8351 @vindex mh-folder-to
8352 @item mh-scan-rcpt-regexp
8353 This regular expression specifies the recipient in messages you sent.
8354 Note that the default setting of @code{mh-folder-font-lock-keywords}
8355 expects this expression to contain two parenthesized expressions. The
8356 first is expected to match the @samp{To:} that the default scan format
8357 file generates. The second is expected to match the recipient's name
8358 as in the default of @code{"\\(To:\\)\\(..............\\)"}. If this
8359 regular expression is not correct, the @samp{To:} string will not be
8360 highlighted with the face @code{mh-folder-to} and the recipient will not be
8361 highlighted with the face @code{mh-folder-address}.
8362 @c -------------------------
8363 @vindex mh-folder-font-lock-keywords
8364 @vindex mh-folder-refiled
8365 @vindex mh-note-refiled
8366 @item mh-scan-refiled-msg-regexp
8367 This regular expression matches refiled messages. It must match from
8368 the beginning of the line. Note that the default setting of
8369 @code{mh-folder-font-lock-keywords} expects this expression to contain
8370 at least one parenthesized expression which matches the message number
8371 as in the default of @w{@code{"^\\( *[0-9]+\\)\\^"}}. This expression
8372 includes the leading space within the parenthesis since it looks
8373 better to highlight it as well. The highlighting is done with the face
8374 @code{mh-folder-refiled}. This regular expression should be correct as
8375 it is needed by non-fontification functions. See also
8376 @code{mh-note-refiled}.
8377 @c -------------------------
8378 @vindex mh-folder-font-lock-keywords
8379 @vindex mh-folder-sent-to-me-sender
8380 @vindex mh-mh-folder-sent-to-me-hint
8381 @vindex mh-scan-format-nmh
8382 @item mh-scan-sent-to-me-sender-regexp
8383 This regular expression matches messages sent to us. Note that the
8384 default setting of @code{mh-folder-font-lock-keywords} expects this
8385 expression to contain at least two parenthesized expressions. The
8386 first should match the fontification hint (see
8387 @code{mh-scan-format-nmh}) and the second should match the user name
8388 as in the default of
8389 @w{@code{"^ *[0-9]+.\\([bct]\\).....[ ]*\\(..................\\)"}}.
8390 If this regular expression is not correct, the notation hints will not
8391 be highlighted with the face @code{mh-mh-folder-sent-to-me-hint} and
8392 the sender will not be highlighted with the face
8393 @code{mh-folder-sent-to-me-sender}.
8394 @c -------------------------
8395 @vindex mh-folder-followup
8396 @vindex mh-folder-font-lock-keywords
8397 @vindex mh-folder-subject
8398 @item mh-scan-subject-regexp
8399 This regular expression matches the subject. It must match from the
8400 beginning of the line. Note that the default setting of
8401 @samp{mh-folder-font-lock-keywords} expects this expression to contain
8402 at least three parenthesized expressions. The first is expected to
8403 match the @samp{Re:} string, if any, and is highlighted with the face
8404 @code{mh-folder-followup}. The second matches an optional bracketed
8405 number after @samp{Re:}, such as in @samp{Re[2]:} (and is thus a
8406 sub-expression of the first expression). The third is expected to
8407 match the subject line itself which is highlighted with the face
8408 @code{mh-folder-subject}. For example, the default is
8409 @w{@code{"^ *[0-9]+........[ ]*...................}}@*
8410 @w{@code{\\([Rr][Ee]\\(\\[[0-9]+\\]\\)?:\\s-*\\)*\\([^<\n]*\\)"}}.
8411 This regular expression should be correct as it is needed by
8412 non-fontification functions. Note that this example is broken up on
8413 two lines for readability, but is actually a single string.
8414 @end vtable
8415
8416 Finally, there are a slew of variables that control how MH-E annotates
8417 the scan lines.
8418
8419 @vtable @code
8420 @findex mh-set-cmd-note
8421 @vindex mh-adaptive-cmd-note-flag
8422 @item mh-cmd-note
8423 Column for notations (default: 4). This variable should be set with
8424 the function @code{mh-set-cmd-note}. This variable may be updated
8425 dynamically if @code{mh-adaptive-cmd-note-flag} is on. The following
8426 variables contain the notational characters. Note that columns in
8427 Emacs start with 0.
8428 @c -------------------------
8429 @item mh-note-copied
8430 Messages that have been copied are marked by this character (default:
8431 @code{?C}).
8432 @c -------------------------
8433 @vindex mh-scan-cur-msg-number-regexp
8434 @item mh-note-cur
8435 The current message (in MH, not in MH-E) is marked by this character
8436 (default: @code{?+}). See also @code{mh-scan-cur-msg-number-regexp}.
8437 @c -------------------------
8438 @vindex mh-scan-deleted-msg-regexp
8439 @item mh-note-deleted
8440 Messages that have been deleted are marked by this character (default:
8441 @code{?D}). See also @code{mh-scan-deleted-msg-regexp}.
8442 @c -------------------------
8443 @item mh-note-dist
8444 Messages that have been redistributed are marked by this character
8445 (default: @code{?R}).
8446 @c -------------------------
8447 @item mh-note-forw
8448 Messages that have been forwarded are marked by this character
8449 (default: @code{?F}).
8450 @c -------------------------
8451 @item mh-note-printed
8452 Messages that have been printed are marked by this character (default:
8453 @code{?P}).
8454 @c -------------------------
8455 @vindex mh-scan-refiled-msg-regexp
8456 @item mh-note-refiled
8457 Messages that have been refiled are marked by this character (default:
8458 @code{?^}). See also @code{mh-scan-refiled-msg-regexp}.
8459 @c -------------------------
8460 @item mh-note-repl
8461 Messages that have been replied to are marked by this character
8462 (default: @code{?-}).
8463 @c -------------------------
8464 @item mh-note-seq
8465 Messages in a user-defined sequence are marked by this character
8466 (default: @code{?%}). Messages in the @samp{search} sequence are
8467 marked by this character as well.
8468 @end vtable
8469
8470 For example, let's say I have the following in @file{scan.format}
8471 which displays the sender, the subject, and the message number. This
8472 format places a @samp{+} after the message number for the current
8473 message according to MH; it also uses that column for notations.
8474
8475 @smallexample
8476 %20(decode(friendly@{from@})) %50(decode@{subject@}) %4(msg)%<(cur)+%| %>
8477 @end smallexample
8478
8479 @vindex mh-adaptive-cmd-note-flag
8480 @vindex mh-scan-format-file
8481 @vindex mh-scan-format-file, example
8482
8483 The first thing you have to do is tell MH-E to use this file.
8484 Customize @code{mh-scan-format-file} and set its value to @samp{Use
8485 Default scan Format}. If you didn't get already turn off
8486 @code{mh-adaptive-cmd-note-flag}, you'll need to do that first.
8487
8488 Next, tell MH-E what a valid scan line looks like so that you can at
8489 least display the output of scan in your MH-Folder buffer.
8490
8491 @vindex mh-scan-valid-regexp, example
8492
8493 @smalllisp
8494 (setq mh-scan-valid-regexp "[0-9]+[+D^ ]$")
8495 @end smalllisp
8496
8497 Now, in order to get rid of the @samp{Cursor not pointing to message}
8498 message, you need to tell MH-E how to access the message number. You
8499 should also see why MH-E requires that you include a message number in
8500 the first place.
8501
8502 @vindex mh-scan-msg-number-regexp, example
8503 @vindex mh-scan-msg-search-regexp, example
8504
8505 @smalllisp
8506 (setq mh-scan-msg-number-regexp "^.* \\([0-9]+\\)[+D^ ]$")
8507 (setq mh-scan-msg-search-regexp " %d[+D^ ]$")
8508 @end smalllisp
8509
8510 In order to get the next and previous commands working, add this.
8511
8512 @vindex mh-scan-good-msg-regexp, example
8513
8514 @smalllisp
8515 (setq mh-scan-good-msg-regexp "^.* \\([0-9]+\\)[+D^ ]$")
8516 @end smalllisp
8517
8518 Note that the current message isn't marked with a @samp{+} when moving
8519 between the next and previous messages. Here is the code required to
8520 get this working.
8521
8522 @vindex set-mh-cmd-note, example
8523 @vindex mh-scan-cur-msg-number-regexp, example
8524
8525 @smalllisp
8526 (set-mh-cmd-note 76)
8527 (setq mh-scan-cur-msg-number-regexp "^.* \\([0-9]+\\)\\+$")
8528 @end smalllisp
8529
8530 Finally, add the following to delete and refile messages.
8531
8532 @vindex mh-scan-deleted-msg-regexp, example
8533 @vindex mh-scan-refiled-msg-regexp, example
8534
8535 @smalllisp
8536 (setq mh-scan-deleted-msg-regexp "^.* \\([0-9]+\\)D$")
8537 (setq mh-scan-refiled-msg-regexp "^.* \\([0-9]+\\)\\^$")
8538 @end smalllisp
8539
8540 This is just a bare minimum; it's best to adjust all of the regular
8541 expressions to ensure that MH-E and highlighting perform well.
8542
8543 @node Procmail, Odds and Ends, Scan Line Formats, Top
8544 @appendix Reading Mailing Lists Effectively
8545
8546 @cindex @command{procmail}
8547 @cindex @command{slocal}
8548 @cindex Gnus
8549 @cindex MH commands, @command{slocal}
8550 @cindex Unix commands, @command{procmail}
8551 @cindex mailing lists, reading
8552
8553 This appendix explains how to use @uref{http://www.procmail.org/,
8554 procmail} to file mail from mailing lists into folders which can then
8555 be read easily with MH-E@footnote{The MH equivalent, @command{slocal},
8556 can be used as well, but procmail is more flexible and more packages
8557 exist for procmail than for slocal.}. Some mailing lists have such
8558 high traffic that Gnus must be used and I discuss how to use Gnus
8559 side-by-side with MH-E.
8560
8561 @cindex @file{.procmailrc}
8562 @cindex files, @file{.procmailrc}
8563
8564 First, I'll describe how to put mail from your mailing lists directly
8565 into an MH folder using @command{procmail}. First, add the following
8566 to @file{~/.procmailrc}. While the logging variables aren't strictly
8567 necessary, they are extremely useful.
8568
8569 @smallexample
8570 [1] # Update PATH so procmail can find myrcvstore, rcvstore and mhparam.
8571 [2] PATH=$PATH:/usr/lib/mh:/usr/bin/mh:$HOME/bin
8572 [3]
8573 [4] # Point LOGFILE at the actual log file.
8574 [5] LOGFILE=$HOME/.procmail.log
8575 [6]
8576 [7] # This setting provides just the right amount of information.
8577 [8] LOGABSTRACT=all
8578 [9]
8579 [10] # Uncomment the following line to see how your patterns match.
8580 [11] #VERBOSE=yes
8581 [12]
8582 [13] # Place mail sent to any MH-E mailing list in +mh-e.
8583 [14] :0 w: mh-e$LOCKEXT
8584 [15] * ^TO.*mh-e-.*@@.*sourceforge.net
8585 [16] | myrcvstore -create +mh-e
8586 @end smallexample
8587
8588 @cindex @command{rcvstore}
8589 @cindex MH commands, @command{rcvstore}
8590
8591 Line 14 creates a lock file in your mail directory based upon the name
8592 of the folder. This is done because @command{rcvstore} does not
8593 perform locking. While this lock file will prevent @command{procmail}
8594 from writing to a folder concurrently, there is a slight chance that
8595 you might lose a message if you're performing operations on a folder
8596 at the same time @command{rcvstore} is placing a message there. You
8597 have been warned. Now that that disclaimer is out of the way, note
8598 that I've been using this set-up for over a decade and haven't lost
8599 anything to my knowledge@footnote{See
8600 @uref{https://savannah.nongnu.org/bugs/?func=detailbug&bug_id=4361&group_id=2166,
8601 Savannah issue #4361} to see if @command{rcvstore} locking is still an
8602 issue.}.
8603
8604 @cindex @samp{Unseen-Sequence} MH profile component
8605 @cindex MH profile component, @samp{Unseen-Sequence}
8606
8607 Line 16 uses the following script, @code{myrcvstore}, to massage the
8608 message as described in the comment and file the message in the given
8609 folder@footnote{The @samp{-create} argument wasn't always the default
8610 to @command{rcvstore}.}.
8611
8612 @smallexample
8613 #! /bin/sh
8614
8615 # Accepts a message on standard input and passes it through rcvstore
8616 # after first passing it through any filters. All arguments are passed
8617 # on to rcvstore.
8618
8619 # Force the "From user date" to become part of header. One reason this
8620 # is done is because the presence of the From field confuses dist so
8621 # that dist adds a new header, rather than using the existing header.
8622 # Note that this should not be done for any message that goes into a
8623 # Gnus incoming file (Gnus will thrown an error) nor should it be
8624 # applied to any message that goes to the system mailbox because the
8625 # entire mailbox will be incorporated as a single message.
8626 formail -c -z -R 'From ' X-Envelope-From: |
8627 rcvstore $@@
8628 @end smallexample
8629
8630 If your version of @command{rcvstore} doesn't add messages to the
8631 @samp{unseen} sequence by default, add the following line to your MH
8632 profile:
8633
8634 @smallexample
8635 Unseen-Sequence: unseen
8636 @end smallexample
8637
8638 Now view your new messages with the speedbar (@pxref{Speedbar}) or with
8639 @kbd{F n} (@code{mh-index-new-messages}). @xref{Folders}.
8640
8641 If you're on a mailing list that is so voluminous that it is
8642 impossible to read every message, it usually better to read the
8643 mailing list like a newsgroup in a news reader. Emacs has a built-in
8644 newsreader called Gnus. The remainder of this appendix talks about how
8645 to use Gnus with an MH message store. The version of Gnus that was
8646 used to prepare this manual was 5.10. Versions 5.8 through 5.10 should
8647 work but versions prior to 5.8 use different options.
8648
8649 This table contains a list of Gnus options that you will have to
8650 modify. Note that for them to become accessible, you'll have to load
8651 @file{nnml.el} first. This can be done with @kbd{M-x load-library
8652 @key{RET} nnml @key{RET}}.
8653
8654 @vtable @code
8655 @item gnus-secondary-select-methods
8656 Select the @samp{nnml} value. This select method uses directories for
8657 folders and individual files for messages, just like MH@. You do not
8658 have to set an address.
8659 @c -------------------------
8660 @item mail-sources
8661 Select the @samp{Several files in a directory} value, check the
8662 @samp{Path} box and enter @file{~/Mail} to tell Gnus where to find
8663 your mail.
8664 @c -------------------------
8665 @vindex mail-user-agent
8666 @item message-mail-user-agent
8667 In order to send mail within Gnus using MH-E, set this option to
8668 @samp{mail-user-agent} and set the @code{mail-user-agent} option to
8669 @samp{Emacs interface to MH}.
8670 @c -------------------------
8671 @item nnmail-keep-last-article
8672 Since Gnus keeps track of which messages you have read, it would be
8673 bad if Gnus expired the last message, for example, message 100, and
8674 @command{rcvstore} gave the next new message number 1. Gnus would then
8675 ignore it since it thinks that you've read messages 1--100. Turning on
8676 this option ensures that the last message is never removed thereby
8677 eliminating this problem.
8678 @end vtable
8679
8680 Next add the following to @file{~/.procmailrc}. If you don't subscribe
8681 to the GnuCash mailing list, substitute one to which you are
8682 subscribed.
8683
8684 @smallexample
8685 PATH=$PATH:/usr/bin/mh
8686 MAILDIR=$HOME/`mhparam Path`
8687 # Place mail sent to the GnuCash mailing list in gnucash.spool, where
8688 # Gnus will pick it up.
8689 :0:
8690 * ^TO.*gnucash.*@@.*gnucash.org
8691 gnucash.spool
8692 @end smallexample
8693
8694 Wait for some messages to appear in @file{gnucash.spool} and run Gnus
8695 with @kbd{M-x gnus @key{RET}}. To view the folder created in the
8696 example above, you would tell Gnus about it the first time only with
8697 @kbd{G m gnucash @key{RET} nnml @key{RET}}. In MH-E, this folder is
8698 known as @samp{+gnucash}.
8699
8700 @node Odds and Ends, History, Procmail, Top
8701 @appendix Odds and Ends
8702
8703 This appendix covers a few topics that don't fit elsewhere. Here I
8704 tell you how to report bugs and how to get on the MH-E mailing lists.
8705 I also point out some additional sources of information.
8706
8707 @menu
8708 * Bug Reports::
8709 * Mailing Lists::
8710 * MH FAQ and Support::
8711 * Getting MH-E::
8712 @end menu
8713
8714 @node Bug Reports, Mailing Lists, Odds and Ends, Odds and Ends
8715 @appendixsec Bug Reports
8716
8717 @cindex bugs
8718 @cindex SourceForge
8719 @kindex M-x mh-version
8720
8721 Bug reports should be filed at
8722 @uref{https://sourceforge.net/p/mh-e/bugs/, SourceForge}. You need to
8723 be a SourceForge user to submit bug reports, but this is easy enough
8724 to do that it shouldn't be a restriction for you. Please include the
8725 output of @kbd{M-x mh-version} (@pxref{Miscellaneous}) in any bug
8726 report you send unless you're 110% positive we won't ask for it.
8727
8728 @node Mailing Lists, MH FAQ and Support, Bug Reports, Odds and Ends
8729 @appendixsec MH-E Mailing Lists
8730
8731 @cindex SourceForge
8732 @cindex mailing lists
8733
8734 There are several mailing lists for MH-E@. They are @i{mh-e-users at
8735 lists.sourceforge.net}, @i{mh-e-announce at lists.sourceforge.net},
8736 and @i{mh-e-devel at lists.sourceforge.net}. You can subscribe or view
8737 the archives at @uref{https://sourceforge.net/p/mh-e/mailman/,
8738 SourceForge}. Do not report bugs on these lists; please submit them
8739 via SourceForge (@pxref{Bug Reports}).
8740
8741 @node MH FAQ and Support, Getting MH-E, Mailing Lists, Odds and Ends
8742 @appendixsec MH FAQ and Support
8743
8744 @cindex FAQ
8745 @cindex MH FAQ
8746
8747 The article @uref{http://www.newt.com/faq/mh.html, @cite{MH Frequently
8748 Asked Questions (FAQ) with Answers}} appears monthly in the newsgroup
8749 @samp{comp.mail.mh}. While very little is there that deals with MH-E
8750 specifically, there is an incredible wealth of material about MH
8751 itself which you will find useful.
8752
8753 @cindex support
8754
8755 You can find FAQs on MH-E by searching for @i{labels:support} on the
8756 @uref{https://sourceforge.net/p/mh-e/bugs/search/?q=labels%3Asupport,
8757 Tickets} page on SourceForge. If you don't find the answer to your
8758 question, file a ticket and your question will become a new FAQ!
8759
8760 @node Getting MH-E, , MH FAQ and Support, Odds and Ends
8761 @appendixsec Getting MH-E
8762
8763 @cindex MH-E, obtaining
8764 @cindex getting MH-E
8765 @cindex obtaining MH-E
8766
8767 Because MH-E is undergoing a phase of sustained growth, the version of
8768 MH-E in your Emacs is likely to be out of date although it is most
8769 likely to be more up to date than the copy that comes with the MH
8770 distribution in @file{miscellany/mh-e}.
8771
8772 @cindex change log
8773 @cindex release notes
8774
8775 New MH-E releases are always available for downloading at
8776 @uref{https://sourceforge.net/projects/mh-e/files/, SourceForge}
8777 before they appear in an Emacs release. You can read the release notes
8778 on that page to determine if the given release of MH-E is already
8779 installed in your version of Emacs. You can also read the change log
8780 to see if you are interested in what the given release of MH-E has to
8781 offer (although we have no doubt that you will be extremely interested
8782 in all new releases).
8783
8784 @cindex Debian
8785
8786 If you use Debian, you can install the Debian
8787 @uref{http://packages.debian.org/unstable/mail/mh-e, mh-e package}
8788 instead.
8789
8790 @cindex files, @samp{MH-E-NEWS}
8791 @cindex files, @samp{README}
8792 @cindex news
8793 @cindex @samp{MH-E-NEWS}
8794 @cindex @samp{README}
8795 @kindex M-x mh-version
8796
8797 After you download and extract the MH-E tarball, read the
8798 @file{README} file and @file{MH-E-NEWS}. These correspond to the
8799 release notes and change log mentioned above. The file @file{README}
8800 contains instructions on installing MH-E@. If you're already running
8801 Emacs, please quit that session and start again to load in the new
8802 MH-E@. Check that you're running the new version with the command
8803 @kbd{M-x mh-version}.
8804
8805 @cindex contributed software
8806 @cindex manual
8807 @cindex documentation
8808
8809 In addition to the mh-e package, the
8810 @uref{https://sourceforge.net/projects/mh-e/files/, SourceForge} site
8811 also contains doc and contrib packages. The former is the latest
8812 release of this manual, and the latter contains a few contributed
8813 packages you might find useful.
8814
8815 @node History, GFDL, Odds and Ends, Top
8816 @appendix History of MH-E
8817
8818 @cindex Bill Wohler
8819 @cindex Brian Reid
8820 @cindex Gildea, Stephen
8821 @cindex Jim Larus
8822 @cindex Larus, Jim
8823 @cindex MH-E, versions
8824 @cindex Reid, Brian
8825 @cindex SourceForge
8826 @cindex Stephen Gildea
8827 @cindex Wohler, Bill
8828 @cindex history of MH-E
8829 @cindex versions of MH-E
8830
8831 MH-E was originally written by Brian Reid in 1983 and has changed
8832 hands several times since then. Jim Larus wanted to do something
8833 similar for GNU Emacs, and ended up completely rewriting it that same
8834 year. In 1989, Stephen Gildea picked it up and added many
8835 improvements. Bill Wohler then took over in 2000 and moved its
8836 development to @uref{http://sourceforge.net/, SourceForge} where it
8837 lives today.
8838
8839 @menu
8840 * From Brian Reid::
8841 * From Jim Larus::
8842 * From Stephen Gildea::
8843 * From Bill Wohler::
8844 @end menu
8845
8846 @node From Brian Reid, From Jim Larus, History, History
8847 @appendixsec From Brian Reid
8848
8849 @cindex Brian Reid
8850 @cindex Reid, Brian
8851
8852 One day in 1983 I got the flu and had to stay home from work for three
8853 days with nothing to do. I used that time to write MHE@. The
8854 fundamental idea behind MHE was that it was a ``puppeteer'' driving
8855 the MH programs underneath it. MH had a model that the editor was
8856 supposed to run as a sub-process of the mailer, which seemed to me at
8857 the time to be the tail wagging the dog. So I turned it around and
8858 made the editor drive the MH programs. I made sure that the UCI people
8859 (who were maintaining MH at the time) took in my changes and made them
8860 stick.
8861
8862 Today, I still use my own version of MHE because I don't at all like
8863 the way that GNU MH-E works and I've never gotten to be good enough at
8864 hacking Emacs Lisp to make GNU MH-E do what I want. The Gosling-emacs
8865 version of MHE and the GNU Emacs version of MH-E have almost nothing
8866 in common except similar names. They work differently, have different
8867 conceptual models, and have different key bindings@footnote{After
8868 reading this article, I questioned Brian about his version of MHE, and
8869 received some great ideas for improving MH-E such as a dired-like
8870 method of selecting folders; and removing the prompting when sending
8871 mail, filling in the blanks in the draft buffer instead. I passed them
8872 on to Stephen Gildea, the current maintainer, and he was excited about
8873 the ideas as well. Perhaps one day, MH-E will again resemble MHE
8874 (draft form editing was introduced in version 7.4).}.
8875
8876 Brian Reid, June 1994
8877
8878 @node From Jim Larus, From Stephen Gildea, From Brian Reid, History
8879 @appendixsec From Jim Larus
8880
8881 @cindex Jim Larus
8882 @cindex Larus, Jim
8883
8884 Brian Reid, while at CMU or shortly after going to Stanford wrote a
8885 mail reading program called MHE for Gosling Emacs. It had much the
8886 same structure as MH-E (i.e., invoked MH programs), though it was
8887 simpler and the commands were slightly different. Unfortunately, I no
8888 longer have a copy so the differences are lost in the mists of time.
8889
8890 In '82--83, I was working at BBN and wrote a lot of mlisp code in
8891 Gosling Emacs to make it look more like Tennex Emacs. One of the
8892 packages that I picked up and improved was Reid's mail system. In '83,
8893 I went back to Berkeley. About that time, Stallman's first version of
8894 GNU Emacs came out and people started to move to it from Gosling Emacs
8895 (as I recall, the transition took a year or two). I decided to port
8896 Reid's MHE and used the mlisp to Emacs Lisp translator that came with
8897 GNU Emacs. It did a lousy job and the resulting code didn't work, so I
8898 bit the bullet and rewrote the code by hand (it was a lot smaller and
8899 simpler then, so it took only a day or two).
8900
8901 Soon after that, MH-E became part of the standard Emacs distribution
8902 and suggestions kept dribbling in for improvements. MH-E soon reached
8903 sufficient functionality to keep me happy, but I kept on improving it
8904 because I was a graduate student with plenty of time on my hands and
8905 it was more fun than my dissertation. In retrospect, the one thing
8906 that I regret is not writing any documentation, which seriously
8907 limited the use and appeal of the package.
8908
8909 @cindex @command{xmh}, in MH-E history
8910
8911 In '89, I came to Wisconsin as a professor and decided not to work on
8912 MH-E@. It was stable, except for minor bugs, and had enough
8913 functionality, so I let it be for a few years. Stephen Gildea of BBN
8914 began to pester me about the bugs, but I ignored them. In 1990, he
8915 went off to the X Consortium, said good bye, and said that he would
8916 now be using @command{xmh}. A few months later, he came back and said
8917 that he couldn't stand @command{xmh} and could I put a few more bug fixes
8918 into MH-E@. At that point, I had no interest in fixing MH-E, so I gave
8919 the responsibility of maintenance to him and he has done a fine job
8920 since then.
8921
8922 Jim Larus, June 1994
8923
8924 @node From Stephen Gildea, From Bill Wohler, From Jim Larus, History
8925 @appendixsec From Stephen Gildea
8926
8927 @cindex Gildea, Stephen
8928 @cindex Stephen Gildea
8929
8930 In 1987 I went to work for Bolt Beranek and Newman, as Jim had before
8931 me. In my previous job, I had been using RMAIL, but as my folders tend
8932 to run large, I was frustrated with the speed of RMAIL@. However, I
8933 stuck with it because I wanted the GNU Emacs interface. I am very
8934 familiar and comfortable with the Emacs interface (with just a few
8935 modifications of my own) and dislike having to use applications with
8936 embedded editors; they never live up to Emacs.
8937
8938 MH is the mail reader of choice at BBN, so I converted to it. Since I
8939 didn't want to give up using an Emacs interface, I started using MH-E@.
8940 As is my wont, I started hacking on it almost immediately. I first
8941 used version 3.4m. One of the first features I added was to treat the
8942 folder buffer as a file-visiting buffer: you could lock it, save it,
8943 and be warned of unsaved changes when killing it. I also worked to
8944 bring its functionality a little closer to RMAIL@. Jim Larus was very
8945 cooperative about merging in my changes, and my efforts first appeared
8946 in version 3.6, distributed with Emacs 18.52 in 1988. Next I decided
8947 MH-E was too slow and optimized it a lot. Version, 3.7, distributed
8948 with Emacs 18.56 in 1990, was noticeably faster.
8949
8950 When I moved to the X Consortium I became the first person there to
8951 not use xmh. (There is now one other engineer there using MH-E@.) About
8952 this point I took over maintenance of MH-E from Jim and was finally
8953 able to add some features Jim hadn't accepted, such as the backward
8954 searching undo. My first release was 3.8 (Emacs 18.58) in 1992.
8955
8956 Now, in 1994, we see a flurry of releases, with both 4.0 and 5.0.
8957 Version 4.0 added many new features, including background folder
8958 collection and support for composing @sc{mime} messages. (Reading
8959 @sc{mime} messages remains to be done, alas.) While writing this book,
8960 Bill Wohler gave MH-E its closest examination ever, uncovering bugs
8961 and inconsistencies that required a new major version to fix, and so
8962 version 5 was released.
8963
8964 Stephen Gildea, June 1994
8965
8966 @node From Bill Wohler, , From Stephen Gildea, History
8967 @appendixsec From Bill Wohler
8968
8969 @cindex Wohler, Bill
8970 @cindex Bill Wohler
8971
8972 The preface originally included the following text which I use to
8973 begin my story:
8974
8975 @quotation
8976 But it's important to note a brief history of MH-E.
8977
8978 @w{Version 3} was prevalent through the @w{Emacs 18} and early
8979 @w{Emacs 19} years. Then @w{Version 4} came out (@w{Emacs 19.23}),
8980 which introduced several new and changed commands. Next, @w{Version
8981 5.0} was released, which fixed some bugs and incompatibilities, and
8982 was incorporated into @w{Emacs 19.29}.
8983 @end quotation
8984
8985 After a long break, Stephen handed the reins over to me in 2000. I
8986 moved the project to a new site called SourceForge and organized a
8987 great team of developers. Our first release in late 2001 was version
8988 6. It appeared around the time of Emacs 21.2 and had menus and tool
8989 bar buttons.
8990
8991 Then, indexed searches, improved MIME handling, a speedbar, multiple
8992 identities, alias completion, an index view of unseen messages, spam
8993 software support, Face and X-Image-URL header field support, Fcc
8994 completion, arbitrary range handling, and draft form editing were
8995 introduced in the version 7 series around the time of Emacs 21.4
8996 (2004). Still, Emacs itself contained version 5 of MH-E released back
8997 in 1994.
8998
8999 Version 8 development was mostly driven by the rewrite of the manual.
9000 It also brought GNU mailutils MH support, S/MIME support, picon
9001 support, and an improved interface for hiding header fields. The CVS
9002 repository was migrated from SourceForge to Savannah (only for those
9003 files that were already part of Emacs) and the software was completely
9004 reorganized to push back two decades of entropy. Version 8 appeared in
9005 Emacs 22.1 in 2006.
9006
9007 Development was then quiet for a couple of years. Emacs 23.1, which is
9008 due out in 2009, will contain version 8.1. This version includes a few
9009 new features and several bug fixes.
9010
9011 Bill Wohler, August 2008
9012
9013 @node GFDL, GPL, History, Top
9014 @appendix GNU Free Documentation License
9015 @include doclicense.texi
9016
9017 @node GPL, Key Index, GFDL, Top
9018 @appendix GNU General Public License
9019 @include gpl.texi
9020
9021 @node Key Index, Command Index, GPL, Top
9022 @unnumbered Key (Character) Index
9023 @printindex ky
9024
9025 @node Command Index, Option Index, Key Index, Top
9026 @unnumbered Command Index
9027 @printindex fn
9028
9029 @node Option Index, Concept Index, Command Index, Top
9030 @unnumbered Option (Variable) Index
9031 @printindex vr
9032
9033 @node Concept Index, , Option Index, Top
9034 @unnumbered Concept Index
9035 @printindex cp
9036
9037 @bye
9038
9039 @c Ispell Helpers
9040 @c
9041 @c The following are words that ispell should ignore that would not
9042 @c normally be in a dictionary (global or personal). Be careful not to
9043 @c include words here that could potentially be typos of other words
9044 @c (such as url, elisp, or MHE).
9045 @c
9046 @c LocalWords: CTRL ESC SPC f's
9047 @c LocalWords: addr Aliasfile alist
9048 @c LocalWords: Baushke Bcc BBN Beranek bogofilter bogofilter's
9049 @c LocalWords: cmd CMU contrib cron
9050 @c LocalWords: DesBrisay Dcc devel dir dired docstring filll forw
9051 @c LocalWords: GECOS Gildea Gildea's Ginnean GnuCash goto gnuserv htm
9052 @c LocalWords: ImageMagick inbox ispell keychain
9053 @c LocalWords: Larus licensor LocalWords lookup lpr
9054 @c LocalWords: makeinfo mairix mbox mh mhbuild mhl mhpath mlisp
9055 @c LocalWords: MML msg multipart
9056 @c LocalWords: Namazu NIS nenscript nnml num
9057 @c LocalWords: packmbox passphrase pathname prev procmail prog repl
9058 @c LocalWords: slocal sortm SpamAssassin spammers SpamProbe SpamProbe's
9059 @c LocalWords: sublicense supercite speedbar
9060 @c LocalWords: Tennex texi texinfo Thelen thelenm
9061 @c LocalWords: UCI undeleted whatnow wohler xmh ypcat
9062 @c
9063 @c See http://www.oreilly.com/oreilly/author/stylesheet.html.
9064 @c See http://en.wikipedia.org/.
9065 @c
9066 @c Note the lowercase mh which is needed to avoid hits in the
9067 @c functions and variables. Occasionally, check for accidental
9068 @c inclusion of mh in text by uncommenting the following and executing
9069 @c it with C-x C-e. You want to see "Search failed"
9070 @c (let ((case-fold-search nil))
9071 @c (goto-char (point-min))
9072 @c (search-forward-regexp "^mh\\( \\|$\\)"))
9073 @c
9074 @c An extremely useful setting for texinfo-mode-hook is:
9075 @c (add-to-list
9076 @c 'ispell-skip-region-alist
9077 @c (list
9078 @c (concat "\\(@\\(small\\)?\\(example\\|lisp\\)"
9079 @c "\\(@\\([irw]\\|code\\|var\\){[^}]+}\\|"
9080 @c "@[@{}.]\\|"
9081 @c "[^@]\\|"
9082 @c "@\\(end \\)?group\\|"
9083 @c "@\\(end \\)?cartouche\\)+"
9084 @c "@end \\(small\\)?\\(example\\|lisp\\)\\|"
9085 @c "@\\(code\\|command\\|file\\|kbd\\|sc\\){[^}]+}\\|"
9086 @c "^@end [a-z]+$\\|"
9087 @c "^@\\([fv]\\|print\\)index .*$\\|"
9088 @c "@uref{[^,]+,\\|"
9089 @c "@[a-z]+\\|"
9090 @c "/[a-z.]+[/}]\\)")))))
9091 @c
9092 @c Cross References
9093 @c
9094 @c See existing cross-references to the Emacs manual and the Emacs
9095 @c Lisp manual (search for ``GNU Emacs Manual'' and ``GNU
9096 @c Emacs Lisp Reference Manual'' respectively).
9097
9098 @c @ftable Sorting
9099 @c
9100 @c As per index (sort of): Punctuation, keyboard characters (such as
9101 @c RET and BS) upper and lowercase mixed (lower comes before
9102 @c uppercase), control characters go with uppercase C, meta characters
9103 @c go with uppercase M.
9104 @c In some cases, the sort isn't strictly ASCII.
9105 @c For example, SPC (mh-page-msg) reads better before BS
9106 @c (mh-previous-page) and . (mh-show) is better before ,
9107 @c (mh-header-display).
9108
9109 @c @vtable Sorting
9110 @c
9111 @c Alphabetical, pull hooks into their own table.
9112
9113 @c Local Variables:
9114 @c sentence-end-double-space: nil
9115 @c End: