]> code.delx.au - gnu-emacs/blob - man/mh-e.texi
Move from SourceForge repository to Savannah. This is version 7.93,
[gnu-emacs] / man / mh-e.texi
1 \input texinfo @c -*-texinfo-*-
2 @c
3 @c Note: This document requires makeinfo version 4.6 or greater to build.
4 @c
5 @c %**start of header
6 @setfilename ../info/mh-e
7 @settitle The MH-E Manual
8 @c %**end of header
9
10 @c Version of the software and manual.
11 @set VERSION 7.93
12 @c EDITION of the manual. It is either empty for the first edition or
13 @c has the form ", nth Edition" (without the quotes).
14 @set EDITION
15 @set UPDATED 2006-03-05
16 @set UPDATE-MONTH March, 2006
17
18 @c Other variables.
19 @set MH-BOOK-HOME http://www.ics.uci.edu/~mh/book/mh
20 @set MH-E-HOME http://mh-e.sourceforge.net/
21
22 @c Copyright
23 @copying
24 This is version @value{VERSION}@value{EDITION} of @cite{The MH-E
25 Manual}, last updated @value{UPDATED}
26
27 Copyright @copyright{} 1995,
28 2001, 2002, 2003, 2005, 2006 Free Software Foundation, Inc.
29
30 @quotation
31 The MH-E manual is free documentation; you can redistribute it and/or
32 modify it under the terms of either:
33
34 @enumerate a
35 @item
36 the GNU Free Documentation License, Version 1.2 or any later version
37 published by the Free Software Foundation; with no Invariant Sections,
38 no Front-Cover Texts, and no Back-Cover Texts.
39
40 @item
41 the GNU General Public License as published by the Free Software
42 Foundation; either version 2, or (at your option) any later version.
43 @end enumerate
44
45 The MH-E manual is distributed in the hope that it will be useful, but
46 WITHOUT ANY WARRANTY; without even the implied warranty of
47 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
48 General Public License or GNU Free Documentation License for more
49 details.
50
51 The GNU General Public License and the GNU Free Documentation License
52 appear as appendices to this document. You may also request copies by
53 writing to the Free Software Foundation, Inc., 51 Franklin Street,
54 Fifth Floor, Boston, MA 02110-1301, USA.
55 @end quotation
56 @end copying
57
58 @c Info Directory Entry
59 @dircategory Emacs
60 @direntry
61 * MH-E: (mh-e). Emacs interface to the MH mail system.
62 @end direntry
63
64 @c Title Page
65 @setchapternewpage odd
66 @titlepage
67 @title The MH-E Manual
68 @subtitle Version @value{VERSION}@value{EDITION}
69 @subtitle @value{UPDATE-MONTH}
70 @author Bill Wohler
71
72 @c Copyright Page
73 @page
74 @vskip 0pt plus 1filll
75 @insertcopying
76 @end titlepage
77
78 @ifnottex
79 @html
80 <!--
81 @end html
82 @node Top, Preface, (dir), (dir)
83 @top The MH-E Manual
84 @html
85 -->
86 @end html
87 @insertcopying
88 @end ifnottex
89
90 @c Table of Contents
91 @contents
92
93 @html
94 <!--
95 @end html
96
97 @menu
98 * Preface:: Preface
99 * Conventions:: GNU Emacs Terms and Conventions
100 * Getting Started:: Getting Started
101 * Tour Through MH-E:: Tour Through MH-E
102 * Using This Manual:: Using This Manual
103 * Incorporating Mail:: Incorporating Mail
104 * Reading Mail:: Reading Mail
105 * Folders:: Organizing Your Mail with Folders
106 * Sending Mail:: Sending Mail
107 * Editing Drafts:: Editing a Draft
108 * Aliases:: Aliases
109 * Identities:: Identities
110 * Speedbar:: The Speedbar
111 * Menu Bar:: The Menu Bar
112 * Tool Bar:: The Tool Bar
113 * Searching:: Searching Through Messages
114 * Threading:: Viewing Message Threads
115 * Limits:: Limiting Display
116 * Sequences:: Using Sequences
117 * Junk:: Dealing With Junk Mail
118 * Miscellaneous:: Miscellaneous Commands, Variables, and Buffers
119 * Scan Line Formats:: Scan Line Formats
120 * Procmail:: Reading Mailing Lists Effectively
121 * Odds and Ends:: Odds and Ends
122 * History:: History of MH-E
123 * GFDL:: GNU Free Documentation License
124 * GPL:: GNU Public License
125 * Key Index:: Key (Character) Index
126 * Command Index:: Command Index
127 * Option Index:: Option (Variable) Index
128 * Concept Index:: Concept Index
129
130 @detailmenu
131 --- The Detailed Node Listing ---
132
133 Tour Through MH-E
134
135 * Sending Mail Tour::
136 * Reading Mail Tour::
137 * Processing Mail Tour::
138 * Leaving MH-E::
139 * More About MH-E::
140
141 Using This Manual
142
143 * Options::
144 * Ranges::
145 * Folder Selection::
146
147 Reading Your Mail
148
149 * Viewing::
150 * Viewing Attachments::
151 * HTML::
152 * Digests::
153 * Reading PGP::
154 * Printing::
155 * Files and Pipes::
156 * Navigating::
157 * Miscellaneous Commands and Options::
158
159 Sending Mail
160
161 * Composing::
162 * Replying::
163 * Forwarding::
164 * Redistributing::
165 * Editing Again::
166
167 Editing a Draft
168
169 * Editing Message::
170 * Inserting Letter::
171 * Inserting Messages::
172 * Signature::
173 * Picture::
174 * Adding Attachments::
175 * Sending PGP::
176 * Checking Recipients::
177 * Sending Message::
178 * Killing Draft::
179
180 Odds and Ends
181
182 * Bug Reports::
183 * Mailing Lists::
184 * MH FAQ and Support::
185 * Getting MH-E::
186
187 History of MH-E
188
189 * From Brian Reid::
190 * From Jim Larus::
191 * From Stephen Gildea::
192 * From Bill Wohler::
193
194 @end detailmenu
195 @end menu
196
197 @html
198 -->
199 @end html
200
201 @node Preface, Conventions, Top, Top
202 @unnumbered Preface
203
204 @cindex Emacs
205 @cindex Unix commands, Emacs
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 GNU Emacs@footnote{Version
216 @value{VERSION} of MH-E will appear in GNU Emacs 22.1. It is supported
217 in GNU Emacs 21, as well as XEmacs 21 (except for versions
218 21.5.9-21.5.16). It is compatible with MH versions 6.8.4 and higher,
219 all versions of nmh, and GNU mailutils 0.4 and higher.}, so you
220 shouldn't have to do anything special to use it. This manual covers
221 MH-E version @value{VERSION}. @ref{Getting Started} will help you
222 decide which version you have.
223
224 If you don't already use GNU Emacs but want to learn more, you can
225 read an online tutorial by starting GNU Emacs and typing @kbd{C-h t}
226 (@code{help-with-tutorial}). (To learn about this notation, see
227 @ref{Conventions}.) If you want to take the plunge, consult the
228 @iftex
229 @cite{GNU Emacs Manual},
230 @end iftex
231 @ifinfo
232 @ref{top, , GNU Emacs Manual, emacs, GNU Emacs Manual},
233 @end ifinfo
234 @ifhtml
235 @uref{http://www.gnu.org/software/emacs/manual/html_node/,
236 @cite{GNU Emacs Manual}},
237 @end ifhtml
238 from the Free Software Foundation.
239
240 If more information is needed, you can go to the Unix manual pages of
241 the individual MH commands. When the name is not obvious, I'll guide
242 you to a relevant MH manual page that describes the action more fully.
243
244 This manual is available in both Info and online formats. The Info
245 version is distributed with Emacs and can be accessed with the
246 @command{info} command (@samp{info mh-e}) or within Emacs (@kbd{M-x
247 info @key{RET} m mh-e @key{RET}}). The online version is available at
248 @uref{http://mh-e.sourceforge.net/manual/, SourceForge}. Another great
249 online resource is the book @uref{http://www.ics.uci.edu/~mh/book/,
250 @cite{MH & nmh: Email for Users & Programmers}} (also known as
251 @dfn{the MH book}).
252
253 I hope you enjoy this manual! If you have any comments, or suggestions
254 for this document, please let me know.
255
256 @cindex Bill Wohler
257 @cindex Wohler, Bill
258
259 @noindent
260 Bill Wohler <@i{wohler at newt.com}>@*
261 8 February 1995@*
262 24 February 2006
263
264 @node Conventions, Getting Started, Preface, Top
265 @chapter GNU Emacs Terms and Conventions
266
267 @cindex Emacs
268 @cindex Emacs, terms and conventions
269 @cindex Unix commands, Emacs
270
271 If you're an experienced Emacs user, you can skip the following
272 conventions and definition of terms and go directly to the next
273 section (@pxref{Getting Started}).
274
275 @cindex Emacs commands
276 @cindex MH commands
277 @cindex Unix commands
278 @cindex commands
279 @cindex commands, MH
280 @cindex commands, Unix
281 @cindex commands, shell
282 @cindex functions
283 @cindex shell commands
284
285 In general, @dfn{functions} in this text refer to Emacs Lisp functions
286 that one would call from within Emacs Lisp programs (for example,
287 @code{(mh-inc-folder)}). On the other hand, @dfn{commands} are those
288 things that are run by the user, such as @kbd{i} or @kbd{M-x
289 mh-inc-folder}. Programs outside of Emacs are specifically called MH
290 commands, shell commands, or Unix commands.
291
292 @cindex conventions, key names
293 @cindex key names
294
295 The conventions for key names are as follows:
296
297 @table @kbd
298 @item C-x
299 Hold down the @key{CTRL} (Control) key and press the @kbd{x} key.
300 @c -------------------------
301 @item M-x
302 Hold down the @key{META} or @key{ALT} key and press the @kbd{x} key.
303
304 Since some keyboards don't have a @key{META} key, you can generate
305 @kbd{M-x}, for example, by pressing @key{ESC} (Escape),
306 @emph{releasing it}, and then pressing the @kbd{x} key.
307 @c -------------------------
308 @item @key{RET}
309 Press the @key{RETURN} or @key{ENTER} key. This is normally used to
310 complete a command.
311 @c -------------------------
312 @item @key{SPC}
313 Press the space bar.
314 @c -------------------------
315 @item @key{TAB}
316 Press the @key{TAB} key.
317 @c -------------------------
318 @item @key{DEL}
319 Press the @key{DELETE} key.
320 @c -------------------------
321 @item @key{BS}
322 Press the @key{BACKSPACE} key@footnote{If you are using Version 20 or
323 earlier of Emacs, you will need to use the @key{DEL} key.}.
324 @end table
325
326 @cindex Emacs, prefix argument
327 @cindex prefix argument
328
329 A @dfn{prefix argument} allows you to pass an argument to any Emacs
330 function. To pass an argument, type @kbd{C-u} before the Emacs command
331 or keystroke. Numeric arguments can be passed as well. For example, to
332 insert five f's, use @kbd{C-u 5 f}. There is a default of four when
333 using @kbd{C-u}, and you can use multiple prefix arguments to provide
334 arguments of powers of four. To continue our example, you could insert
335 four f's with @kbd{C-u f}, 16 f's with @kbd{C-u C-u f}, 64 f's with
336 @kbd{C-u C-u C-u f}, and so on. Numeric and valueless negative
337 arguments can also be inserted with the @key{META} key. Examples
338 include @kbd{M-5} to specify an argument of 5, or @kbd{M--} which
339 specifies a negative argument with no particular value.
340
341 @sp 1
342 @center @strong{NOTE}
343
344 @quotation
345 The prefix @kbd{C-u} or @kbd{M-} is not necessary in MH-E's MH-Folder
346 mode (@pxref{Reading Mail Tour}). In this mode, simply enter the
347 numerical argument before entering the command.
348 @end quotation
349 @sp 1
350
351 @cindex Emacs, variables
352 @cindex variables
353
354 Emacs uses @dfn{variables} to hold values. These can be changed via
355 calls to the function @code{setq} in @file{~/.emacs}.
356
357 @cindex Emacs, options
358 @cindex options
359 @findex customize-group
360 @findex customize-option
361
362 Variables in MH-E that are normally modified by the user are called
363 @dfn{options} and are modified through the customize functions (such
364 as @kbd{M-x customize-option} or @kbd{M-x customize-group}).
365 @ifnothtml
366 @xref{Easy Customization,,,emacs,The GNU Emacs Manual}, in @cite{The
367 GNU Emacs Manual}.
368 @end ifnothtml
369 @ifhtml
370 See section
371 @uref{http://www.gnu.org/software/emacs/manual/html_node/Easy-Customization.html,
372 Easy Customization} in @cite{The GNU Emacs Manual}.
373 @end ifhtml
374 @xref{Options}.
375
376 @cindex Emacs, faces
377 @cindex faces
378 @cindex highlighting
379 @findex customize-face
380
381 You can specify various styles for displaying text using @dfn{faces}.
382 MH-E provides a set of faces that you can use to personalize the look
383 of your MH-E buffers. Use the command @kbd{M-x customize-face} to do
384 this.
385 @ifnothtml
386 @xref{Face Customization,,,emacs,The GNU Emacs Manual}, in @cite{The
387 GNU Emacs Manual}.
388 @end ifnothtml
389 @ifhtml
390 See section
391 @uref{http://www.gnu.org/software/emacs/manual/html_node/Face-Customization.html,
392 Face Customization} in @cite{The GNU Emacs Manual}.
393 @end ifhtml
394
395 @cindex hooks
396 @cindex normal hooks
397 @cindex abnormal hooks
398
399 Commands often offer @dfn{hooks} which enable you to extend or modify
400 the way a command works.
401 @ifnothtml
402 @ref{Hooks, , Hooks, emacs, The GNU Emacs Manual}, in @cite{The GNU
403 Emacs Manual}
404 @end ifnothtml
405 @ifhtml
406 See section
407 @uref{http://www.gnu.org/software/emacs/manual/html_node/Hooks.html,
408 Hooks} in @cite{The GNU Emacs Manual}
409 @end ifhtml
410 for a description about @dfn{normal hooks} and @dfn{abnormal hooks}.
411 MH-E uses normal hooks in nearly all cases, so you can assume that we
412 are talking about normal hooks unless we explicitly mention that a hook
413 is abnormal. We also follow the conventions described in that section:
414 the name of the abnormal hooks end in @code{-hooks} and all the rest
415 of the MH-E hooks end in @code{-hook}.
416
417 @cindex Emacs, mark
418 @cindex Emacs, point
419 @cindex Emacs, region
420 @cindex mark
421 @cindex point
422 @cindex region
423
424 There are several other terms that are used in Emacs that you should
425 know. The @dfn{point} is where the cursor currently is. You can save
426 your current place in the file by setting a @dfn{mark}. This operation
427 is useful in several ways. The mark can be later used when defining a
428 @dfn{region}, which is the text between the point and mark. Many
429 commands operate on regions, such as those for deleting text or
430 filling paragraphs. A mark can be set with @kbd{C-@@} (or
431 @kbd{C-@key{SPC}}).
432
433 @cindex Emacs, completion
434 @cindex Emacs, file completion
435 @cindex Emacs, folder completion
436 @cindex Emacs, minibuffer
437 @cindex completion
438 @cindex file completion
439 @cindex folder completion
440 @cindex minibuffer
441
442 The @dfn{minibuffer} is the bottom line of the Emacs window, where all
443 prompting and multiple-character input is directed. You can use
444 @dfn{completion} to enter values such as folders. Completion means
445 that Emacs fills in text for you when you type @key{SPC} or @key{TAB}.
446 A second @key{SPC} or @key{TAB} will list all possibilities at that
447 point.
448 @ifnothtml
449 @xref{Completion, , Completion, emacs, The GNU Emacs Manual}.
450 @end ifnothtml
451 @ifhtml
452 See the section
453 @uref{http://www.gnu.org/software/emacs/manual/html_node/Completion.html,
454 Completion} in @cite{The GNU Emacs Manual}.
455 @end ifhtml
456 Note that @key{SPC} cannot be used for completing filenames and
457 folders.
458
459 The minibuffer is also where you enter Emacs function names after
460 typing @kbd{M-x}. For example, in the preface, I mentioned that you
461 could obtain help with @kbd{C-h t} (@code{help-with-tutorial}). What
462 this means is that you can get a tutorial by typing either @kbd{C-h t}
463 or @kbd{M-x help-with-tutorial}. In the latter case, you are prompted
464 for @samp{help-with-tutorial} in the minibuffer after typing
465 @kbd{M-x}.
466
467 @cindex ~
468
469 The @samp{~} notation in filenames represents your home directory.
470 This notation is used by many shells including @command{bash},
471 @code{tcsh}, and @command{csh}. It is analogous to the environment
472 variable @samp{$HOME}. For example, @file{~/.emacs} can be written
473 @file{$HOME/.emacs} or using the absolute path as in
474 @file{/home/wohler/.emacs} instead.
475
476 @cindex Emacs, interrupting
477 @cindex Emacs, quitting
478 @cindex interrupting
479 @cindex quitting
480
481 @i{In case of trouble:} Emacs can be interrupted at any time with
482 @kbd{C-g}. For example, if you've started a command that requests that
483 you enter something in the minibuffer, but then you change your mind,
484 type @kbd{C-g} and you'll be back where you started. If you want to
485 exit Emacs entirely, use @kbd{C-x C-c}.
486
487 @node Getting Started, Tour Through MH-E, Conventions, Top
488 @chapter Getting Started
489
490 @cindex MH-E, versions
491 @cindex history
492 @cindex versions of MH-E
493
494 Because there are many old versions of MH-E out there, it is important
495 to know which version you have. I'll be talking about @w{Version 8}
496 which is pretty close to @w{Version 6} and @w{Version 7}. It differs
497 from @w{Version 4} and @w{Version 5} and is vastly different from
498 @w{Version 3}. @xref{History}.
499
500 @findex mh-version
501
502 To determine which version of MH-E that you have, enter @kbd{M-x
503 mh-version @key{RET}}. Hopefully it says that you're running
504 @w{Version @value{VERSION}} which is the latest version as of this
505 printing.
506
507 If your version is much older than this, please consider upgrading.
508 You can have your system administrator upgrade the system-wide
509 version, or you can install your own personal version. It's really
510 quite easy. @xref{Getting MH-E}, for instructions for getting and
511 installing MH-E.
512
513 If the @code{mh-version} command displays @samp{No MH variant
514 detected}, then you need to install MH or tell MH-E where to find
515 MH@footnote{In very old versions of MH-E, you may get the error
516 message, @samp{Cannot find the commands `inc' and `mhl' and the file
517 `components'} if MH-E can't find MH. In this case, you need to update
518 MH-E, and you may need to install MH too. However, newer versions of
519 MH-E are better at finding MH if it is on your system.}.
520
521 The option @code{mh-variant} specifies the variant used by MH-E
522 (@pxref{Options}). The default setting of this option is
523 @samp{Auto-detect} which means that MH-E will automatically choose the
524 first of nmh, MH, or GNU mailutils that it finds in the directories
525 listed in @code{mh-path} (which you can customize),
526 @code{mh-sys-path}, and @code{exec-path}. If MH-E can't find MH at
527 all, you may have to customize @code{mh-path} and add the directory in
528 which the command @code{mhparam} is located. If, on the other hand,
529 you have both nmh and mailutils installed (for example) and
530 @code{mh-variant-in-use} was initialized to nmh but you want to use
531 mailutils, then you can set @code{mh-variant} to @samp{mailutils}.
532
533 When @code{mh-variant} is changed, MH-E resets @code{mh-progs},
534 @code{mh-lib}, @code{mh-lib-progs}, @code{mh-flists-present-flag}, and
535 @code{mh-variant-in-use} accordingly.
536
537 @sp 1
538 @center @strong{NOTE}
539
540 @quotation
541 Prior to version 8, it was often necessary to set some of these
542 variables in @file{~/.emacs}; now it is no longer necessary and can
543 actually cause problems.
544 @end quotation
545 @sp 1
546
547 @cindex @command{install-mh}
548 @cindex MH commands, @command{install-mh}
549
550 If you've never run MH before, you need to run @command{install-mh}
551 from the shell before you continue. This sets up your personal MH
552 environment@footnote{See the section
553 @uref{@value{MH-BOOK-HOME}/setup.htm, Setting Up MH} in the MH book.}.
554 If you don't, you'll be greeted with the error message: @samp{Install
555 MH and run install-mh before running MH-E}.
556
557 @cindex @samp{Draft-Folder:} MH profile component
558 @cindex @samp{Path:} MH profile component
559 @cindex @samp{Previous-Sequence:} MH profile component
560 @cindex @samp{Unseen-Sequence:} MH profile component
561 @cindex MH profile component, @samp{Draft-Folder:}
562 @cindex MH profile component, @samp{Path:}
563 @cindex MH profile component, @samp{Previous-Sequence:}
564 @cindex MH profile component, @samp{Unseen-Sequence:}
565 @findex mh-find-path
566 @vindex mh-draft-folder
567 @vindex mh-find-path-hook
568 @vindex mh-inbox
569 @vindex mh-previous-seq
570 @vindex mh-unseen-seq
571 @vindex mh-user-path
572
573 In addition to setting variables that point to MH itself, MH-E also
574 sets a handful of variables that point to where you keep your mail.
575 During initialization, the function @code{mh-find-path} sets
576 @code{mh-user-path} from your @samp{Path:} MH profile component (but
577 defaults to @samp{Mail} if one isn't present), @code{mh-draft-folder}
578 from @samp{Draft-Folder:}, @code{mh-unseen-seq} from
579 @samp{Unseen-Sequence:}, @code{mh-previous-seq} from
580 @samp{Previous-Sequence:}, and @code{mh-inbox} from @samp{Inbox:}
581 (defaults to @samp{+inbox}). The hook @code{mh-find-path-hook} is run
582 after these variables have been set. This hook can be used the change
583 the value of these variables if you need to run with different values
584 between MH and MH-E.
585
586 @node Tour Through MH-E, Using This Manual, Getting Started, Top
587 @chapter Tour Through MH-E
588
589 This chapter introduces some of the terms you'll need to know and then
590 takes you on a tour of MH-E@footnote{The keys mentioned in these
591 chapters refer to the default key bindings. If you've changed the
592 bindings, refer to the command summaries at the beginning of each
593 chapter for a mapping between default key bindings and function
594 names.}. When you're done, you'll be able to send, read, and file
595 mail, which is all that a lot of people ever do. But if you're the
596 curious or adventurous type, read the rest of the manual to be able to
597 use all the features of MH-E. I suggest you read this chapter first to
598 get the big picture, and then you can read the manual as you wish.
599
600 @menu
601 * Sending Mail Tour::
602 * Reading Mail Tour::
603 * Processing Mail Tour::
604 * Leaving MH-E::
605 * More About MH-E::
606 @end menu
607
608 @node Sending Mail Tour, Reading Mail Tour, Tour Through MH-E, Tour Through MH-E
609 @section Sending Mail
610
611 @cindex sending mail
612 @findex mh-smail
613
614 Let's start our tour by sending ourselves a message which we can later
615 read and process. Enter @kbd{M-x mh-smail} to invoke the MH-E program
616 to send messages. You will be prompted in the minibuffer by
617 @samp{To:}. Enter your login name. The next prompt is @samp{Cc:}. Hit
618 @key{RET} to indicate that no carbon copies are to be sent. At the
619 @samp{Subject:} prompt, enter @kbd{Test} or anything else that comes
620 to mind.
621
622 @cindex MH-Letter mode
623 @cindex modes, MH-Letter
624 @cindex mode
625
626 Once you've specified the recipients and subject, your message appears
627 in an Emacs buffer whose mode@footnote{A @dfn{mode} changes Emacs to
628 make it easier to edit a particular type of text.} is MH-Letter. Enter
629 some text in the body of the message, using normal Emacs commands. You
630 should now have something like this@footnote{If you're running Emacs
631 under the X Window System, then you would also see a menu bar. Under
632 Emacs 21, you would also see a tool bar. I've left out the menu bar and
633 tool bar in all of the example screens.}:
634
635 @cartouche
636 @smallexample
637
638
639
640
641
642
643 --:-- *scratch* (Lisp Interaction)--L1--All-------------------------
644 To: wohler
645 cc:
646 Subject: Test
647 --------
648 This is a test message to get the wheels churning...#
649
650
651 --:** @{draft@} (MH-Letter)--L5--All-----------------------------------
652
653 @end smallexample
654 @end cartouche
655 @i{MH-E message composition window}
656
657 Note the line of dashes that separates the header and the body of the
658 message. It is essential that these dashes (or a blank line) are
659 present or the body of your message will be considered to be part of
660 the header.
661
662 @cindex help
663 @kindex C-c C-c
664
665 There are several commands specific to MH-Letter mode@footnote{You can
666 get quick help for the commands used most often with @kbd{C-c ?} or
667 more complete help with the @kbd{C-h m} (@code{describe-mode})
668 command.}, but at this time we'll only use @kbd{C-c C-c} to send your
669 message. Type @kbd{C-c C-c} now. That's all there is to it!
670
671 @node Reading Mail Tour, Processing Mail Tour, Sending Mail Tour, Tour Through MH-E
672 @section Receiving Mail
673
674 @cindex @command{inc}
675 @cindex @command{scan}
676 @cindex MH commands, @command{inc}
677 @cindex MH commands, @command{scan}
678 @cindex MH-Folder mode
679 @cindex modes, MH-Folder
680 @cindex reading mail
681 @findex mh-rmail
682
683 To read the mail you've just sent yourself, enter @kbd{M-x mh-rmail}.
684 This incorporates the new mail and puts the output from
685 @command{inc}@footnote{See the section
686 @uref{@value{MH-BOOK-HOME}/reapre.htm, Reading Mail: inc show next
687 prev} in the MH book.} (called @dfn{scan lines} after the MH program
688 @command{scan}@footnote{See the section
689 @uref{@value{MH-BOOK-HOME}/faswsprs.htm, Find and Specify with scan
690 pick Ranges Sequences} in the MH book.} which prints a one-line
691 summary of each message) into a buffer called @samp{+inbox} whose
692 major mode is MH-Folder.
693
694 @sp 1
695 @center @strong{NOTE}
696
697 @quotation
698 The @kbd{M-x mh-rmail} command will show you only new mail, not mail
699 you have already read. If you were to run this tour again, you would
700 use @kbd{F r} to pull all your messages into MH-E.
701 @end quotation
702 @sp 1
703
704 @kindex @key{RET}
705 @kindex n
706 @kindex p
707
708 You should see the scan line for your message, and perhaps others. Use
709 @kbd{n} or @kbd{p} to move the cursor to your test message and type
710 @key{RET} to read your message. You should see something like:
711
712 @cartouche
713 @smallexample
714 3 t08/24 root received fax files on Wed Aug 24 11:00:13 PDT 1
715 # 4+t08/24 To:wohler Test<<This is a test message to get the wheels
716
717 -:%% @{+inbox@} 4 msgs (1-4) (MH-Folder Show)--L4--Bot--------------
718 To: wohler
719 Subject: Test
720 Date: Wed, 24 Aug 1994 13:01:13 -0700
721 From: Bill Wohler <wohler@@stop.mail-abuse.org>
722
723 This is a test message to get the wheels churning...
724
725
726
727
728
729 --:-- @{show-+inbox@} 4 (MH-Show)--L1--All---------------------------
730
731 @end smallexample
732 @end cartouche
733 @i{After incorporating new messages}
734
735 @kindex @key{DEL}
736 @kindex @key{SPC}
737
738 If you typed a long message, you can view subsequent pages with
739 @key{SPC} and previous pages with @key{DEL}.
740
741 @node Processing Mail Tour, Leaving MH-E, Reading Mail Tour, Tour Through MH-E
742 @section Processing Mail
743
744 @cindex processing mail
745 @kindex r
746
747 The first thing we want to do is reply to the message that we sent
748 ourselves. Ensure that the cursor is still on the same line as your
749 test message and type @kbd{r}. You are prompted in the minibuffer with
750 @samp{Reply to whom:}. Here MH-E is asking whether you'd like to reply
751 to the original sender only, to the sender and primary recipients, or
752 to the sender and all recipients. If you simply hit @key{RET}, you'll
753 reply only to the sender. Hit @key{RET} now.
754
755 You'll find yourself in an Emacs buffer similar to that when you were
756 sending the original message, like this:
757
758 @cartouche
759 @smallexample
760 To: wohler
761 Subject: Re: Test
762 In-reply-to: Bill Wohler's message of Wed, 24 Aug 1994 13:01:13 -0700
763 <199408242001.NAA00505@@stop.mail-abuse.org>
764 --------
765 #
766
767 --:-- @{draft@} (MH-Letter)--L11--Bot---------------------------------
768 To: wohler
769 Subject: Test
770 Date: Wed, 24 Aug 1994 13:01:13 -0700
771 From: Bill Wohler <wohler@@stop.mail-abuse.org>
772
773 This is a test message to get the wheels churning...
774
775 --:-- @{show-+inbox@} 4 (MH-Show)--L1--All----------------------------
776 Composing a reply...done
777 @end smallexample
778 @end cartouche
779 @i{Composition window during reply}
780
781 @kindex C-c C-c
782 @kindex C-c C-f C-t
783
784 By default, MH will not add you to the address list of your replies,
785 so if you find that the @samp{To:} header field is missing, don't
786 worry. In this case, type @kbd{C-c C-f C-t} to create and go to the
787 @samp{To:} field, where you can type your login name again. You can
788 move around with the arrow keys or with @kbd{C-p}
789 (@code{previous-line}), @kbd{C-n} (@code{next-line}), @kbd{C-b}
790 (@code{backward-char}), and @kbd{C-f} (@code{forward-char}) and can
791 delete the previous character with @key{BS}. When you're finished
792 editing your message, send it with @kbd{C-c C-c} as before.
793
794 @cindex folders
795 @kindex o
796
797 You'll often want to save messages that were sent to you in an
798 organized fashion. This is done with @dfn{folders}. You can use
799 folders to keep messages from your friends, or messages related to a
800 particular topic. With your cursor in the MH-Folder buffer and
801 positioned on the message you sent to yourself, type @kbd{o} to output
802 (@command{refile} in MH parlance) that message to a folder. Enter
803 @kbd{test} at the @samp{Destination folder:} prompt and type @kbd{y}
804 (or @key{SPC}) when MH-E asks to create the folder @samp{+test}. Note
805 that a @samp{^} (caret) appears next to the message number, which
806 means that the message has been marked for refiling but has not yet
807 been refiled. We'll talk about how the refile is actually carried out
808 in a moment.
809
810 @cindex MH-Folder mode
811 @cindex modes, MH-Folder
812 @kindex @key{RET}
813 @kindex d
814 @kindex i
815 @kindex x
816
817 Your previous reply is now waiting in the system mailbox. You
818 incorporate this mail into your MH-Folder buffer named @samp{+inbox}
819 with the @kbd{i} command. Do this now. After the mail is incorporated,
820 use @kbd{n} or @kbd{p} to move the cursor to the new message, and read
821 it with @key{RET}. Let's delete this message by typing @kbd{d}. Note
822 that a @samp{D} appears next to the message number. This means that
823 the message is marked for deletion but is not yet deleted. To perform
824 the deletion (and the refile we did previously), use the @kbd{x}
825 command.
826
827 @findex mh-smail
828 @kindex m
829
830 If you want to send another message you can use @kbd{m} instead of
831 @kbd{M-x mh-smail}. So go ahead, send some mail to your friends!
832
833 @cindex help
834 @cindex prefix characters
835 @findex describe-mode
836 @kindex ?
837 @kindex C-h m
838
839 You can get a quick reminder about these commands by typing @kbd{?}.
840 This lists several @dfn{prefix characters}. To list the commands
841 available via the prefix characters, type the prefix character
842 followed by a @kbd{?}, for example, @kbd{F ?}. More complete help is
843 available with the @kbd{C-h m} (@code{describe-mode}) command.
844
845 @node Leaving MH-E, More About MH-E, Processing Mail Tour, Tour Through MH-E
846 @section Leaving MH-E
847
848 @cindex Emacs, quitting
849 @cindex quitting
850
851 You may now wish to exit @command{emacs} entirely. Use @kbd{C-x C-c}
852 to exit @command{emacs}. If you exited without running @kbd{x} in the
853 @samp{+inbox} buffer, Emacs will offer to save it for you. Type
854 @kbd{y} or @key{SPC} to save @samp{+inbox} changes, which means to
855 perform any refiles and deletes that you did there.
856
857 @findex mh-rmail
858 @kindex q
859
860 If you don't want to leave Emacs, you can type @kbd{q} to bury (hide)
861 the MH-E folder or delete it entirely with @kbd{C-x k}. You can then
862 later recall it with @kbd{C-x b} or @kbd{M-x mh-rmail}.
863
864 @cindex @command{packf}
865 @cindex MH commands, @command{packf}
866 @cindex exporting folders
867 @cindex folders, exporting
868 @cindex mbox-style folder
869
870 On the other hand, if you no longer want to use MH and MH-E, you can
871 take your mail with you. You can copy all of your mail into a single
872 file, mbox-style, by using the MH command @command{packf}. For
873 example, to create a file called @file{msgbox} with the messages in
874 your @samp{+inbox} folder, use @samp{packf +inbox}. The
875 @command{packf} command will append the messages to the file if it
876 already exists, so you can use @samp{folders -recurse -fast} in a
877 script to copy all of your messages into a single file, or using the
878 @samp{-file} argument, a file for each folder.
879
880 @node More About MH-E, , Leaving MH-E, Tour Through MH-E
881 @section More About MH-E
882
883 These are the basic commands to get you going, but there are plenty
884 more. If you think that MH-E is for you, read the rest of the manual
885 to find out how you can:
886
887 @itemize @bullet
888 @item
889 Print your messages (@ref{Printing}).
890 @c -------------------------
891 @item
892 Edit messages and include your signature (@ref{Editing Drafts}).
893 @c -------------------------
894 @item
895 Forward messages (@ref{Forwarding}).
896 @c -------------------------
897 @item
898 Read digests (@ref{Digests}).
899 @c -------------------------
900 @item
901 Edit bounced messages (@ref{Editing Again}).
902 @c -------------------------
903 @item
904 Send multimedia messages (@ref{Adding Attachments}).
905 @c -------------------------
906 @item
907 Read HTML messages (@ref{HTML}).
908 @c -------------------------
909 @item
910 Use @ref{Aliases} and @ref{Identities}.
911 @c -------------------------
912 @item
913 Create different views of your mail (@ref{Threading} and @ref{Limits}).
914 @c -------------------------
915 @item
916 Deal with junk mail (@ref{Junk}).
917 @c -------------------------
918 @item
919 Handle signed and encrypted messages (@ref{Reading PGP} and
920 @ref{Sending PGP}).
921 @c -------------------------
922 @item
923 Process mail that was sent with @command{shar} or @command{uuencode}
924 (@ref{Files and Pipes}).
925 @c -------------------------
926 @item
927 Use sequences conveniently (@ref{Sequences}).
928 @c -------------------------
929 @item
930 Use the @ref{Speedbar}, @ref{Tool Bar}, and @ref{Menu Bar}.
931 @c -------------------------
932 @item
933 Show header fields in different fonts (@ref{Reading Mail}).
934 @c -------------------------
935 @item
936 Find previously refiled messages (@ref{Searching}).
937 @c -------------------------
938 @item
939 Place messages in a file (@ref{Files and Pipes}).
940 @end itemize
941
942 Remember that you can also use MH commands when you're not running
943 MH-E (and when you are!).
944
945 @node Using This Manual, Incorporating Mail, Tour Through MH-E, Top
946 @chapter Using This Manual
947
948 This chapter begins the meat of the manual which goes into more detail
949 about every MH-E command and option.
950
951 @cindex Emacs, info
952 @cindex Emacs, online help
953 @cindex info
954 @cindex online help
955 @findex describe-mode
956 @findex mh-help
957 @kindex ?
958 @kindex C-c ?
959
960 There are many commands, but don't get intimidated. There are command
961 summaries at the beginning of each chapter. In case you have or would
962 like to rebind the keys, the command summaries also list the
963 associated Emacs Lisp function. Furthermore, even if you're stranded
964 on a desert island with a laptop and are without your manuals, you can
965 get a summary of all these commands with GNU Emacs online help: use
966 @kbd{C-h m} (@code{describe-mode}) for a brief summary of commands,
967 @kbd{?} (@code{mh-help}) for an even briefer summary@footnote{This
968 help appears in a buffer called @samp{*MH-E Help*}
969 (@pxref{Miscellaneous}).} (@kbd{C-c ?} in MH-Letter mode), or @kbd{C-h
970 i} to read this manual via Info. The online help is quite good; try
971 running @kbd{C-h C-h}. This brings up a list of available help topics,
972 one of which displays the documentation for a given key (like @kbd{C-h
973 k C-n}). Another useful help feature is to view the manual section
974 that describes a given key (such as @kbd{C-h C-k i}). In addition,
975 review @ref{Conventions}, if any of the GNU Emacs conventions are
976 strange to you.
977
978 In addition to all of the commands, it is also possible to reconfigure
979 MH-E to fit the needs of even the most demanding user. The following
980 chapters also describe all of the options, show the defaults, and make
981 recommendations for customization.
982
983 However, when customizing your mail environment, first try to change
984 what you want in MH, and only change MH-E if changing MH is not
985 possible. That way you will get the same behavior inside and outside
986 GNU Emacs. Note that MH-E does not provide hooks for customizations
987 that can be done in MH; this omission is intentional.
988
989 @cindex Emacs, Emacs Lisp manual
990 @cindex Emacs, info
991 @cindex Emacs, online help
992 @cindex info
993 @cindex online help
994
995 I hope I've included enough examples here to get you well on your way.
996 If you want to explore Emacs Lisp further, a programming manual does
997 exist,
998 @c Yes, some of the stuff in the following sections is redundant, but
999 @c TeX barfs if the @ifs are inside the @footnote.
1000 @iftex
1001 @footnote{The @cite{GNU Emacs Lisp Reference Manual} may be available
1002 online in the Info system by typing @kbd{C-h i m Emacs Lisp
1003 @key{RET}}. It is also available online at @*
1004 @uref{http://www.gnu.org/software/emacs/elisp-manual/html_node/}. You
1005 can also order a printed manual, which has the desirable side-effect
1006 of helping to support the Free Software Foundation which made all this
1007 great software available. You can find an order form by running
1008 @kbd{C-h C-d}, or you can request an order form from @i{gnu at
1009 gnu.org}.}
1010 @end iftex
1011 @ifinfo
1012 @footnote{@xref{Top, The GNU Emacs Lisp Reference Manual, , elisp, GNU
1013 Emacs Lisp Reference Manual}, which may be available online in the
1014 Info system. It is also available online at
1015 @uref{http://www.gnu.org/software/emacs/elisp-manual/html_node/}. You
1016 can also order a printed manual, which has the desirable side-effect
1017 of helping to support the Free Software Foundation which made all this
1018 great software available. You can find an order form by running
1019 @kbd{C-h C-d}, or you can request an order form from @i{gnu at
1020 gnu.org}.}
1021 @end ifinfo
1022 @ifhtml
1023 @footnote{The
1024 @uref{http://www.gnu.org/software/emacs/elisp-manual/html_node/,
1025 The GNU Emacs Lisp Reference Manual} may also be available online in
1026 the Info system by typing @kbd{C-h i m Emacs Lisp @key{RET}}. You can
1027 also order a printed manual, which has the desirable side-effect of
1028 helping to support the Free Software Foundation which made all this
1029 great software available. You can find an order form by running
1030 @kbd{C-h C-d}, or you can request an order form from @i{gnu at
1031 gnu.org}.}
1032 @end ifhtml
1033 and you can look at the code itself for examples. Look in the Emacs
1034 Lisp directory on your system (such as
1035 @file{/usr/local/lib/emacs/lisp/mh-e}) and find all the @file{mh-*.el}
1036 files there. When calling MH-E and other Emacs Lisp functions directly
1037 from Emacs Lisp code, you'll need to know the correct arguments. Use
1038 the online help for this. For example, try @kbd{C-h f
1039 mh-execute-commands @key{RET}}. If you write your own functions,
1040 please do not prefix your symbols (variables and functions) with
1041 @samp{mh-}. This prefix is reserved for the MH-E package. To avoid
1042 conflicts with existing MH-E symbols, use a prefix like @samp{my-} or
1043 your initials.
1044
1045 @menu
1046 * Options::
1047 * Ranges::
1048 * Folder Selection::
1049 @end menu
1050
1051 @node Options, Ranges, Using This Manual, Using This Manual
1052 @section Options
1053
1054 @cindex Emacs, customizing
1055 @cindex Emacs, setting options
1056 @cindex customizing MH-E
1057 @cindex setting options
1058 @findex customize-option
1059 @vindex mh-lpr-command-format, example
1060
1061 Many string or integer options are easy to modify using @kbd{M-x
1062 customize-option}. For example, to modify the option that controls
1063 printing, you would run @kbd{M-x customize-option @key{RET}
1064 mh-lpr-command-format @key{RET}}. In the buffer that appears, modify
1065 the string to the right of the variable. For example, you may change
1066 the @command{lpr} command with @samp{nenscript -G -r -2 -i'%s'}. Then
1067 use the @samp{State} combo box and select @samp{Save for Future
1068 Sessions}. @ref{Printing} talks more about this option.
1069
1070 @vindex mh-bury-show-buffer-flag, example
1071
1072 Options can also hold boolean values. In Emacs Lisp, the boolean
1073 values are @code{nil}, which means false, and @code{t}, which means
1074 true. The @code{customize-option} function makes it easy to change
1075 boolean values; simply click on the toggle button in the customize
1076 buffer to switch between @samp{on} (@code{t}) and @samp{off}
1077 (@code{nil}). For example, try setting @code{mh-bury-show-buffer-flag}
1078 to @samp{off} to keep the MH-Show buffer at the top of the buffer
1079 stack. Use the @samp{State} combo box and choose @samp{Set for Current
1080 Session} to see how the option affects the show buffer. Then choose
1081 the @samp{Erase Customization} menu item to reset the option to the
1082 default, which places the MH-Show buffer at the bottom of the buffer
1083 stack.
1084
1085 The text usually says to turn on an option by setting it to a
1086 @emph{non-@code{nil}} value, because sometimes values other than
1087 @samp{on} are meaningful (for example, see @code{mh-mhl-format-file},
1088 described in @ref{Viewing}). Other options, such as hooks, involve a
1089 little more Emacs Lisp programming expertise.
1090
1091 @cindex @samp{mh} customization group
1092 @cindex customization group, @samp{mh}
1093 @findex customize-group
1094 @findex mh-customize
1095
1096 You can browse all of the MH-E options with the @code{customize-group}
1097 function. Try entering @kbd{M-x customize-group @key{RET} mh
1098 @key{RET}} to view the top-level options as well as buttons for all of
1099 the MH-E customization groups. Another way to view the MH-E
1100 customization group is to use @kbd{M-x mh-customize @key{RET}}.
1101
1102 @node Ranges, Folder Selection, Options, Using This Manual
1103 @section Ranges
1104
1105 @c Sync with mh-folder-mode docstring.
1106
1107 @cindex ranges
1108 @cindex message abbreviations
1109 @cindex message ranges
1110
1111 Many commands that operate on individual messages, such as
1112 @code{mh-forward} or @code{mh-refile-msg} take a @code{RANGE}
1113 argument. This argument can be used in several ways.
1114
1115 If you provide the prefix argument @kbd{C-u} to these commands, then
1116 you will be prompted for the message range. This can be any valid MH
1117 range which can include messages, sequences (@pxref{Sequences}), and
1118 the abbreviations (described in the @command{mh}(1) man page):
1119
1120 @table @samp
1121 @item <num1>-<num2>
1122 Indicates all messages in the range <num1> to <num2>, inclusive. The
1123 range must be nonempty.
1124 @c -------------------------
1125 @item <num>:N
1126 @item <num>:+N
1127 @itemx <num>:-N
1128 Up to N messages beginning with (or ending with) message num. Num may
1129 be any of the predefined symbols: first, prev, cur, next or last.
1130 @c -------------------------
1131 @item first:N
1132 @itemx prev:N
1133 @itemx next:N
1134 @itemx last:N
1135 The first, previous, next or last messages, if they exist.
1136 @c -------------------------
1137 @item all
1138 All of the messages.
1139 @end table
1140
1141 For example, a range that shows all of these things is @samp{1 2 3
1142 5-10 last:5 unseen}.
1143
1144 @vindex transient-mark-mode
1145
1146 If the option @code{transient-mark-mode} is set to @code{t} and you
1147 set a region in the MH-Folder buffer, then the MH-E command will
1148 perform the operation on all messages in that region.
1149
1150 @cindex @samp{mh-range} customization group
1151 @cindex customization group, @samp{mh-range}
1152
1153 The @samp{mh-range} customization group contains a single option which
1154 affects how ranges are interpreted.
1155
1156 @vtable @code
1157 @item mh-interpret-number-as-range-flag
1158 On means interpret a number as a range (default: @samp{on}).
1159 @end vtable
1160
1161 Since one of the most frequent ranges used is @samp{last:N}, MH-E will
1162 interpret input such as @samp{200} as @samp{last:200} if the
1163 @code{mh-interpret-number-as-range-flag} option is on (which is the
1164 default). If you need to scan just the message 200, then use the range
1165 @samp{200:1} or @samp{200-200}.
1166
1167 @node Folder Selection, , Ranges, Using This Manual
1168 @section Folder Selection
1169
1170 @cindex folders, selecting
1171
1172 When you choose a folder in MH-E via a command such as @kbd{o}
1173 (@code{mh-refile-msg}), completion is used to enter the folder
1174 @ifnothtml
1175 (@pxref{Completion, , , emacs, The GNU Emacs Manual}).
1176 @end ifnothtml
1177 @ifhtml
1178 (see the section
1179 @uref{http://www.gnu.org/software/emacs/manual/html_node/Completion.html,
1180 Completion} in @cite{The GNU Emacs Manual}).
1181 @end ifhtml
1182 In addition, MH-E has several ways of choosing a suitable default so
1183 that the folder can often be selected with a single @key{RET} key.
1184
1185 @cindex @samp{mh-folder-selection} customization group
1186 @cindex customization group, @samp{mh-folder-selection}
1187
1188 The @samp{mh-folder-selection} customization group contains some
1189 options which are used to help with this.
1190
1191 @vtable @code
1192 @item mh-default-folder-for-message-function
1193 Function to select a default folder for refiling or @samp{Fcc:}
1194 (default: @code{nil}).
1195 @c -------------------------
1196 @item mh-default-folder-list
1197 List of addresses and folders (default: @code{nil}).
1198 @c -------------------------
1199 @item mh-default-folder-must-exist-flag
1200 On means guessed folder name must exist to be used (default:
1201 @samp{on}).
1202 @c -------------------------
1203 @item mh-default-folder-prefix
1204 Prefix used for folder names generated from aliases (default: @code{""}).
1205 @end vtable
1206
1207 You can set the option @code{mh-default-folder-for-message-function}
1208 to a function that provides a default folder for the message to be
1209 refiled. When this function is called, the current buffer contains the
1210 message being refiled and point is at the start of the message. This
1211 function should return the default folder as a string with a leading
1212 @samp{+} sign. It can also return @code{nil} so that the last folder
1213 name is used as the default, or an empty string to suppress the
1214 default entirely.
1215
1216 Otherwise, the name of the destination folder is derived from the
1217 sender as follows:
1218
1219 @enumerate
1220 @item
1221 The folder name associated with the first address found in the list
1222 @code{mh-default-folder-list} is used. Each element in this list
1223 contains a @samp{Check Recipient} item. If this item is turned on,
1224 then the address is checked against the recipient instead of the
1225 sender. This is useful for mailing lists.
1226 @c -------------------------
1227 @item
1228 An alias prefixed by @code{mh-default-folder-prefix} corresponding to
1229 the address is used. The prefix is used to prevent clutter in your
1230 mail directory. @xref{Aliases}.
1231 @end enumerate
1232
1233 If the derived folder does not exist, and
1234 @code{mh-default-folder-must-exist-flag} is @code{t}, then the last
1235 folder name used is suggested. This is useful if you get mail from
1236 various people for whom you have an alias, but file them all in the
1237 same project folder.
1238
1239 @node Incorporating Mail, Reading Mail, Using This Manual, Top
1240 @chapter Incorporating Your Mail
1241
1242 @cindex incorporating
1243
1244 This chapter talks about getting mail from your system mailbox into
1245 your MH @samp{+inbox} folder. The following command accomplishes that
1246 and is found in the @samp{Folder} menu.
1247
1248 @table @kbd
1249 @cindex @samp{Folder > Incorporate New Mail} menu item
1250 @cindex menu item, @samp{Folder > Incorporate New Mail}
1251 @findex mh-inc-folder
1252 @kindex i
1253 @item i
1254 Incorporate new mail into a folder (@code{mh-inc-folder}).
1255 @end table
1256
1257 @cindex @samp{mh-inc} customization group
1258 @cindex customization group, @samp{mh-inc}
1259
1260 The following options in the @samp{mh-inc} customization group are
1261 used.
1262
1263 @vtable @code
1264 @item mh-inc-prog
1265 Program to incorporate mail (default: @samp{"inc"}).
1266 @c -------------------------
1267 @item mh-inc-spool-list
1268 Alternate spool files (default: @code{nil}).
1269 @end vtable
1270
1271 The following hook is available.
1272
1273 @vtable @code
1274 @item mh-inc-folder-hook
1275 Hook run by @samp{mh-inc-folder} after incorporating mail into a
1276 folder (default: @code{nil}).
1277 @end vtable
1278
1279 If at any time you receive new mail, incorporate the new mail into
1280 your @samp{+inbox} buffer with @kbd{i} (@code{mh-inc-folder}). Note
1281 that @kbd{i} will display the @samp{+inbox} buffer, even if there
1282 isn't any new mail. You can incorporate mail from any file into the
1283 current folder by specifying a prefix argument; you'll be prompted for
1284 the name of the file to use as well as the destination folder (for
1285 example, @kbd{C-u i ~/mbox @key{RET} +tmp @key{RET}}).
1286
1287 @cindex @file{.emacs}
1288 @cindex Emacs, notification of new mail
1289 @cindex files, @file{.emacs}
1290 @cindex new mail
1291 @cindex notification of new mail
1292
1293 Emacs can notify you when you have new mail by displaying @samp{Mail}
1294 in the mode line. To enable this behavior, and to have a clock in the
1295 mode line besides, add the following to @file{~/.emacs}:
1296
1297 @findex display-time
1298
1299 @lisp
1300 (display-time)
1301 @end lisp
1302
1303 @cindex @command{inc}
1304 @cindex MH commands, @command{inc}
1305 @cindex incorporating
1306 @vindex mh-progs
1307
1308 The name of the program that incorporates new mail is stored in
1309 @code{mh-inc-prog}; it is @samp{"inc"} by default. This program
1310 generates a one-line summary for each of the new messages. Unless it
1311 is an absolute pathname, the file is assumed to be in the
1312 @code{mh-progs} directory (@pxref{Getting Started}). You may also link
1313 a file to @command{inc} that uses a different format (see
1314 @samp{mh-profile}(5), and sections
1315 @uref{@value{MH-BOOK-HOME}/reapre.htm, Reading Mail: inc show next
1316 prev} and @uref{@value{MH-BOOK-HOME}/mhstr.htm, MH Format Strings} in
1317 the MH book). You'll then need to modify several variables
1318 appropriately (@pxref{Scan Line Formats}).
1319
1320 You can use the @code{mh-inc-spool-list} variable to direct MH-E to
1321 retrieve mail from arbitrary spool files other than your system
1322 mailbox, file it in folders other than your @samp{+inbox}, and assign
1323 key bindings to incorporate this mail.
1324
1325 @cindex @command{procmail}
1326 @cindex @file{.procmailrc}
1327 @cindex Unix commands, @command{procmail}
1328 @cindex files, @file{.procmailrc}
1329
1330 Suppose you are subscribed to the @i{mh-e-devel} mailing list and you
1331 use @command{procmail} to filter this mail into @file{~/mail/mh-e}
1332 with the following recipe in @file{.procmailrc}:
1333
1334 @smallexample
1335 MAILDIR=$HOME/mail
1336 :0:
1337 * ^From mh-e-devel-admin@@stop.mail-abuse.org
1338 mh-e
1339 @end smallexample
1340
1341 In order to incorporate @file{~/mail/mh-e} into @samp{+mh-e} with an
1342 @kbd{I m} (@code{mh-inc-spool-mh-e}) command, customize this option,
1343 and click on the @samp{INS} button. Enter a @samp{Spool File} of
1344 @samp{~/mail/mh-e}, a @samp{Folder} of @samp{mh-e}, and a @samp{Key
1345 Binding} of @samp{m}.
1346
1347 @cindex @command{emacsclient}
1348 @cindex @command{gnuclient}
1349 @cindex @command{xbuffy}
1350 @cindex @samp{gnuserv}
1351 @cindex Unix commands, @command{emacsclient}
1352 @cindex Unix commands, @command{gnuclient}
1353 @cindex Unix commands, @command{xbuffy}
1354
1355 You can use @command{xbuffy} to automate the incorporation of this
1356 mail using the Emacs 22 command @command{emacsclient} as follows:
1357
1358 @smallexample
1359 box ~/mail/mh-e
1360 title mh-e
1361 origMode
1362 polltime 10
1363 headertime 0
1364 command emacsclient --eval '(mh-inc-spool-mh-e)'
1365 @end smallexample
1366
1367 In XEmacs, the command @command{gnuclient} is used in a similar
1368 fashion.
1369
1370 You can set the hook @code{mh-inc-folder-hook}, which is called after
1371 new mail is incorporated by the @kbd{i} (@code{mh-inc-folder})
1372 command. A good use of this hook is to rescan the whole folder either
1373 after running @kbd{M-x mh-rmail} the first time or when you've changed
1374 the message numbers from outside of MH-E.
1375
1376 @findex mh-execute-commands
1377 @findex mh-rescan-folder, example
1378 @findex mh-show, example
1379 @vindex mh-inc-folder-hook, example
1380
1381 @smalllisp
1382 @group
1383 (defun my-mh-inc-folder-hook ()
1384 "Hook to rescan folder after incorporating mail."
1385 (if (buffer-modified-p) ; @r{if outstanding refiles and deletes,}
1386 (mh-execute-commands)) ; @r{carry them out}
1387 (mh-rescan-folder) ; @r{synchronize with +inbox}
1388 (mh-show)) ; @r{show the current message}
1389
1390 (add-hook 'mh-inc-folder-hook 'my-mh-inc-folder-hook)
1391
1392 @i{Rescan folder after incorporating new mail via mh-inc-folder-hook}
1393
1394 @end group
1395 @end smalllisp
1396
1397 @node Reading Mail, Folders, Incorporating Mail, Top
1398 @chapter Reading Your Mail
1399
1400 @cindex MH-Folder mode
1401 @cindex MH-Show mode
1402 @cindex modes, MH-Folder
1403 @cindex modes, MH-Show
1404 @cindex reading mail
1405 @cindex scan lines
1406 @findex mh-rmail
1407
1408 The MH-E entry point for reading mail is @kbd{M-x mh-rmail}. This
1409 command incorporates your mail and creates a buffer called
1410 @samp{+inbox} in MH-Folder mode. The command @kbd{M-x mh-rmail} shows
1411 you only new mail, not mail you have already read@footnote{If you want
1412 to see your old mail as well, use @kbd{F r} to pull all your messages
1413 into MH-E. Or, give a prefix argument to @code{mh-rmail} so it will
1414 prompt you for folder to visit like @kbd{F v} (for example, @kbd{C-u
1415 M-x mh-rmail @key{RET} bob @key{RET}}). @xref{Folders}.}.
1416
1417 The @samp{+inbox} buffer contains @dfn{scan lines}, which are one-line
1418 summaries of each incorporated message. You can perform most MH
1419 commands on these messages via one- or two-letter commands in either
1420 the MH-Folder or MH-Show buffers or by using the @samp{Message} menu.
1421 See @command{scan}(1) for a description of the contents of the scan
1422 lines, and see the Figure in @ref{Reading Mail Tour}, for an example.
1423
1424 @table @kbd
1425 @kindex ?
1426 @findex mh-help
1427 @item ?
1428 Display cheat sheet for the MH-E commands (@code{mh-help}).
1429 @c -------------------------
1430 @cindex @samp{Message > Show Message} menu item
1431 @cindex menu item, @samp{Message > Show Message}
1432 @kindex @key{RET}
1433 @findex mh-show
1434 @item @key{RET}
1435 Display message (@code{mh-show}).
1436 @c -------------------------
1437 @cindex @samp{Message > Show Message with Header} menu item
1438 @cindex menu item, @samp{Message > Show Message with Header}
1439 @kindex , (comma)
1440 @findex mh-header-display
1441 @item , (comma)
1442 Display message with all header fields (@code{mh-header-display}).
1443 @c -------------------------
1444 @kindex ; (semicolon)
1445 @findex mh-toggle-mh-decode-mime-flag
1446 @item ; (semicolon)
1447 Toggle the value of @code{mh-decode-mime-flag}
1448 (@code{mh-toggle-mh-decode-mime-flag}).
1449 @c -------------------------
1450 @kindex @key{SPC}
1451 @findex mh-page-msg
1452 @item @key{SPC}
1453 Display next page in message (@code{mh-page-msg}).
1454 @c -------------------------
1455 @kindex @key{BS}
1456 @findex mh-previous-page
1457 @item @key{BS}
1458 Display previous page in message (@code{mh-previous-page}).
1459 @c -------------------------
1460 @cindex @samp{Message > Write Message to File...} menu item
1461 @cindex menu item, @samp{Message > Write Message to File...}
1462 @kindex >
1463 @findex mh-write-msg-to-file
1464 @item >
1465 Append message to end of file (@code{mh-write-msg-to-file}).
1466 @c -------------------------
1467 @cindex @samp{Message > Pipe Message to Command...} menu item
1468 @cindex menu item, @samp{Message > Pipe Message to Command...}
1469 @kindex |
1470 @findex mh-pipe-msg
1471 @item |
1472 Pipe message through shell command (@code{mh-pipe-msg}).
1473 @c -------------------------
1474 @kindex C-d
1475 @findex mh-delete-msg-no-motion
1476 @item C-d
1477 Delete range, don't move to next message
1478 (@code{mh-delete-msg-no-motion}).
1479 @c -------------------------
1480 @cindex @samp{Message > Delete Message} menu item
1481 @cindex menu item, @samp{Message > Delete Message}
1482 @kindex d
1483 @findex mh-delete-msg
1484 @item d
1485 Delete range (@code{mh-delete-msg}).
1486 @c -------------------------
1487 @kindex D ?
1488 @findex mh-prefix-help
1489 @item D ?
1490 Display cheat sheet for the commands of the current prefix in
1491 minibuffer (@code{mh-prefix-help}).
1492 @c -------------------------
1493 @kindex D @key{SPC}
1494 @findex mh-page-digest
1495 @item D @key{SPC}
1496 Display next message in digest (@code{mh-page-digest}).
1497 @c -------------------------
1498 @kindex D @key{BS}
1499 @findex mh-page-digest-backwards
1500 @item D @key{BS}
1501 Display previous message in digest (@code{mh-page-digest-backwards}).
1502 @c -------------------------
1503 @cindex @samp{Message > Burst Digest Message} menu item
1504 @cindex menu item, @samp{Message > Burst Digest Message}
1505 @kindex D b
1506 @findex mh-burst-digest
1507 @item D b
1508 Break up digest into separate messages (@code{mh-burst-digest}).
1509 @c -------------------------
1510 @cindex @samp{Message > Go to Message by Number...} menu item
1511 @cindex menu item, @samp{Message > Go to Message by Number...}
1512 @kindex g
1513 @findex mh-goto-msg
1514 @item g
1515 Go to a message (@code{mh-goto-msg}).
1516 @c -------------------------
1517 @kindex k
1518 @findex mh-delete-subject-or-thread
1519 @item k
1520 Delete messages with same subject or thread
1521 (@code{mh-delete-subject-or-thread}).
1522 @c -------------------------
1523 @kindex K ?
1524 @findex mh-prefix-help
1525 @item K ?
1526 Display cheat sheet for the commands of the current prefix in
1527 minibuffer (@code{mh-prefix-help}).
1528 @c -------------------------
1529 @kindex K @key{TAB}
1530 @findex mh-next-button
1531 @item K @key{TAB}
1532 Go to the next button (@code{mh-next-button}).
1533 @c -------------------------
1534 @kindex K S-@key{TAB}
1535 @findex mh-prev-button
1536 @item K S-@key{TAB}
1537 Go to the previous button (@code{mh-prev-button}).
1538 @c -------------------------
1539 @kindex K a
1540 @findex mh-mime-save-parts
1541 @item K a
1542 Save attachments (@code{mh-mime-save-parts}).
1543 @c -------------------------
1544 @kindex K e
1545 @findex mh-display-with-external-viewer
1546 @item K e
1547 View attachment externally (@code{mh-display-with-external-viewer}).
1548 @c -------------------------
1549 @kindex K i
1550 @findex mh-folder-inline-mime-part
1551 @item K i
1552 Show attachment verbatim (@code{mh-folder-inline-mime-part}).
1553 @c -------------------------
1554 @kindex K o
1555 @findex mh-folder-save-mime-part
1556 @item K o
1557 Save (output) attachment (@code{mh-folder-save-mime-part}).
1558 @c -------------------------
1559 @kindex K t
1560 @findex mh-toggle-mime-buttons
1561 @item K t
1562 Toggle option @code{mh-display-buttons-for-inline-parts-flag}
1563 (@code{mh-toggle-mime-buttons}).
1564 @c -------------------------
1565 @kindex K v
1566 @findex mh-folder-toggle-mime-part
1567 @item K v
1568 View attachment (@code{mh-folder-toggle-mime-part}).
1569 @c -------------------------
1570 @cindex @samp{Message > Modify Message} menu item
1571 @cindex menu item, @samp{Message > Modify Message}
1572 @kindex M
1573 @findex mh-modify
1574 @item M
1575 Edit message (@code{mh-modify}).
1576 @c -------------------------
1577 @cindex @samp{Message > Go to First Message} menu item
1578 @cindex menu item, @samp{Message > Go to First Message}
1579 @kindex M-<
1580 @findex mh-first-msg
1581 @item M-<
1582 Display first message (@code{mh-first-msg}).
1583 @c -------------------------
1584 @cindex @samp{Message > Go to Last Message} menu item
1585 @cindex menu item, @samp{Message > Go to Last Message}
1586 @kindex M->
1587 @findex mh-last-msg
1588 @item M->
1589 Display last message (@code{mh-last-msg}).
1590 @c -------------------------
1591 @kindex M-n
1592 @findex mh-next-unread-msg
1593 @item M-n
1594 Display next unread message (@code{mh-next-unread-msg}).
1595 @c -------------------------
1596 @kindex M-p
1597 @findex mh-previous-unread-msg
1598 @item M-p
1599 Display previous unread message (@code{mh-previous-unread-msg}).
1600 @c -------------------------
1601 @cindex @samp{Message > Next Message} menu item
1602 @cindex menu item, @samp{Message > Next Message}
1603 @kindex n
1604 @findex mh-next-undeleted-msg
1605 @item n
1606 Display next message (@code{mh-next-undeleted-msg}).
1607 @c -------------------------
1608 @cindex @samp{Message > Previous Message} menu item
1609 @cindex menu item, @samp{Message > Previous Message}
1610 @kindex p
1611 @findex mh-previous-undeleted-msg
1612 @item p
1613 Display previous message (@code{mh-previous-undeleted-msg}).
1614 @c -------------------------
1615 @kindex P ?
1616 @findex mh-prefix-help
1617 @item P ?
1618 Display cheat sheet for the commands of the current prefix in
1619 minibuffer (@code{mh-prefix-help}).
1620 @c -------------------------
1621 @kindex P C
1622 @findex mh-ps-print-toggle-color
1623 @item P C
1624 Toggle whether color is used in printing messages
1625 (@code{mh-ps-print-toggle-color}).
1626 @c -------------------------
1627 @kindex P F
1628 @findex mh-ps-print-toggle-faces
1629 @item P F
1630 Toggle whether printing is done with faces or not
1631 (@code{mh-ps-print-toggle-faces}).
1632 @c -------------------------
1633 @kindex P f
1634 @findex mh-ps-print-msg-file
1635 @item P f
1636 Print range to file (@code{mh-ps-print-msg-file}).
1637 @c -------------------------
1638 @cindex @samp{Message > Print Message} menu item
1639 @cindex menu item, @samp{Message > Print Message}
1640 @kindex P l
1641 @findex mh-print-msg
1642 @item P l
1643 Print range the old fashioned way
1644 (@code{mh-print-msg}).
1645 @c -------------------------
1646 @kindex P p
1647 @findex mh-ps-print-msg
1648 @item P p
1649 Print range (@code{mh-ps-print-msg}).
1650 @c -------------------------
1651 @kindex X ?
1652 @findex mh-prefix-help
1653 @item X ?
1654 Display cheat sheet for the commands of the current prefix in
1655 minibuffer (@code{mh-prefix-help}).
1656 @c -------------------------
1657 @cindex @samp{Message > Unpack Uuencoded Message...} menu item
1658 @cindex menu item, @samp{Message > Unpack Uuencoded Message...}
1659 @kindex X s
1660 @kindex X u
1661 @findex mh-store-msg
1662 @item X s
1663 @itemx X u
1664 Unpack message created with @command{uudecode} or @command{shar}
1665 (@code{mh-store-msg}).
1666 @c -------------------------
1667 @kindex Mouse-2
1668 @findex mh-show-mouse
1669 @item Mouse-2
1670 Move point to mouse event and show message (@code{mh-show-mouse}).
1671 @end table
1672
1673 Within the MH-Show buffer, the following command is defined.
1674
1675 @table @kbd
1676 @kindex @key{RET}
1677 @kindex Mouse-1
1678 @kindex Mouse-2
1679 @findex mh-press-button
1680 @item @key{RET}
1681 @itemx Mouse-1
1682 @itemx Mouse-2
1683 View contents of button (@code{mh-press-button}).
1684 @end table
1685
1686 @cindex @samp{mh-show} customization group
1687 @cindex customization group, @samp{mh-show}
1688
1689 The following table lists options in the @samp{mh-show} customization
1690 group that are used while reading mail.
1691
1692 @vtable @code
1693 @item mh-bury-show-buffer-flag
1694 On means show buffer is buried (default: @samp{on}).
1695 @c -------------------------
1696 @item mh-clean-message-header-flag
1697 On means remove extraneous header fields (default: @samp{on}).
1698 @c -------------------------
1699 @item mh-decode-mime-flag
1700 On means attachments are handled (default: @samp{on} if the Gnus
1701 @samp{mm-decode} package is present).
1702 @c -------------------------
1703 @item mh-display-buttons-for-alternatives-flag
1704 On means display buttons for all alternative attachments (default:
1705 @samp{off}).
1706 @c -------------------------
1707 @item mh-display-buttons-for-inline-parts-flag
1708 On means display buttons for all inline attachments (default:
1709 @samp{off}).
1710 @c -------------------------
1711 @item mh-do-not-confirm-flag
1712 On means non-reversible commands do not prompt for confirmation
1713 (default: @samp{off}).
1714 @c -------------------------
1715 @item mh-fetch-x-image-url
1716 Control fetching of @samp{X-Image-URL:} header field image (default:
1717 @code{Never Fetch}).
1718 @c -------------------------
1719 @item mh-graphical-smileys-flag
1720 On means graphical smileys are displayed (default: @samp{on}).
1721 @c -------------------------
1722 @item mh-graphical-emphasis-flag
1723 On means graphical emphasis is displayed (default: @samp{on}).
1724 @c -------------------------
1725 @item mh-highlight-citation-style
1726 Style for highlighting citations (default: @samp{Multicolor}).
1727 @c -------------------------
1728 @item mh-invisible-header-fields-default
1729 List of hidden header fields (default: a checklist too long to list
1730 here).
1731 @c -------------------------
1732 @item mh-invisible-header-fields
1733 Additional header fields to hide (default: @code{nil}).
1734 @c -------------------------
1735 @item mh-lpr-command-format
1736 Command used to print (default: @samp{"lpr -J '%s'"}).
1737 @c -------------------------
1738 @item mh-max-inline-image-height
1739 Maximum inline image height if \"Content-Disposition:\" is not
1740 present (default: 0).
1741 @c -------------------------
1742 @item mh-max-inline-image-width
1743 Maximum inline image width if \"Content-Disposition:\" is not
1744 present(default: 0).
1745 @c -------------------------
1746 @item mh-mhl-format-file
1747 Specifies the format file to pass to the @command{mhl} program
1748 (default: @samp{Use Default mhl Format (Printing Only)}).
1749 @c -------------------------
1750 @item mh-mime-save-parts-default-directory
1751 Default directory to use for @kbd{K a}.
1752 @c -------------------------
1753 @item mh-print-background-flag
1754 On means messages should be printed in the background (default:
1755 @samp{off}).
1756 @c -------------------------
1757 @item mh-show-maximum-size
1758 Maximum size of message (in bytes) to display automatically (default:
1759 0).
1760 @c -------------------------
1761 @item mh-show-use-xface-flag
1762 On means display face images in MH-Show buffers (default: @code{on}).
1763 @c -------------------------
1764 @item mh-store-default-directory
1765 Default directory for @kbd{X s} (default: @samp{Current}).
1766 @c -------------------------
1767 @item mh-summary-height
1768 Number of lines in MH-Folder buffer (including the mode line)
1769 (default: depends on size of frame).
1770 @end vtable
1771
1772 The following hooks are available.
1773
1774 @vtable @code
1775 @item mh-delete-msg-hook
1776 Hook run after marking each message for deletion (default: @code{nil}).
1777 @c -------------------------
1778 @item mh-show-hook
1779 Hook run after @key{RET} shows a message (default: @code{nil}).
1780 @c -------------------------
1781 @item mh-show-mode-hook
1782 Hook run upon entry to @code{mh-show-mode} (default: @code{nil}).
1783 @end vtable
1784
1785 The following faces are available.
1786
1787 @vtable @code
1788 @item mh-show-cc
1789 Face used to highlight @samp{cc:} header fields.
1790 @c -------------------------
1791 @item mh-show-date
1792 Face used to highlight @samp{Date:} header fields.
1793 @c -------------------------
1794 @item mh-show-from
1795 Face used to highlight @samp{From:} header fields.
1796 @c -------------------------
1797 @item mh-show-header
1798 Face used to deemphasize less interesting header fields.
1799 @c -------------------------
1800 @item mh-show-pgg-bad
1801 Bad PGG signature face.
1802 @c -------------------------
1803 @item mh-show-pgg-good
1804 Good PGG signature face.
1805 @c -------------------------
1806 @item mh-show-pgg-unknown
1807 Unknown or untrusted PGG signature face.
1808 @c -------------------------
1809 @item mh-show-signature
1810 Signature face.
1811 @c -------------------------
1812 @item mh-show-subject
1813 Face used to highlight @samp{Subject:} header fields.
1814 @c -------------------------
1815 @item mh-show-to
1816 Face used to highlight @samp{To:} header fields.
1817 @c -------------------------
1818 @item mh-show-xface
1819 X-Face image face.
1820 @end vtable
1821
1822 The functions and variables introduced here are explained in more
1823 detail in the following sections.
1824
1825 @menu
1826 * Viewing::
1827 * Viewing Attachments::
1828 * HTML::
1829 * Digests::
1830 * Reading PGP::
1831 * Printing::
1832 * Files and Pipes::
1833 * Navigating::
1834 * Miscellaneous Commands and Options::
1835 @end menu
1836
1837 @node Viewing, Viewing Attachments, Reading Mail, Reading Mail
1838 @section Viewing Your Mail
1839
1840 @findex mh-header-display
1841 @findex mh-page-msg
1842 @findex mh-previous-page
1843 @findex mh-show
1844 @findex mh-show-mouse
1845 @kindex , (comma)
1846 @kindex . (period)
1847 @kindex @key{BS}
1848 @kindex @key{RET}
1849 @kindex @key{SPC}
1850 @kindex Mouse-2
1851
1852 The command @key{RET} (@code{mh-show}) displays the message that the
1853 cursor is on while @kbd{Mouse-2} (@code{mh-show-mouse}) displays the
1854 message that the mouse cursor is on. If the message is already
1855 displayed, it scrolls to the beginning of the message. Use @key{SPC}
1856 (@code{mh-page-msg}) and @key{BS} (@code{mh-previous-page}) to move
1857 forwards and backwards one page at a time through the message. You can
1858 give either of these commands a prefix argument that specifies the
1859 number of lines to scroll (such as @kbd{10 @key{SPC}}). The @key{SPC}
1860 command will also show the next undeleted message if it is used at the
1861 bottom of a message. MH-E normally hides a lot of the superfluous
1862 header fields that mailers add to a message, but if you wish to see
1863 all of them, use the command @kbd{,} (comma;
1864 @code{mh-header-display}).
1865
1866 The option @code{mh-show-maximum-size} provides an opportunity to skip
1867 over large messages which may be slow to load. The default value of 0
1868 means that all message are shown regardless of size.
1869
1870 A litany of options control what displayed messages look like.
1871
1872 @vindex mh-show-cc
1873 @vindex mh-show-date
1874 @vindex mh-show-from
1875 @vindex mh-show-header
1876 @vindex mh-show-subject
1877 @vindex mh-show-to
1878
1879 First, the appearance of the header fields can be modified by
1880 customizing the associated face: @code{mh-show-to}, @code{mh-show-cc},
1881 @code{mh-show-from}, @code{mh-show-date}, and @code{mh-show-subject}.
1882 The face @code{mh-show-header} is used to deemphasize the other, less
1883 interesting, header fields.
1884
1885 @cindex regular expressions, @code{mh-invisible-header-fields}
1886 @vindex mh-clean-message-header-flag
1887 @vindex mh-invisible-header-fields-default
1888 @vindex mh-invisible-header-fields
1889
1890 Normally messages are delivered with a handful of uninteresting header
1891 fields. These are hidden by turning on the option
1892 @code{mh-clean-message-header-flag} (which it is by default). The
1893 header fields listed in the option
1894 @code{mh-invisible-header-fields-default} are hidden, although you can
1895 check off any field that you would like to see. Header fields that you
1896 would like to hide that aren't listed can be added to the option
1897 @code{mh-invisible-header-fields} with a couple of caveats. Regular
1898 expressions are not allowed. Unique fields should have a @samp{:}
1899 suffix; otherwise, the element can be used to render invisible an
1900 entire class of fields that start with the same prefix. If you think a
1901 header field should be generally ignored, report a bug (@pxref{Bug
1902 Reports}).
1903
1904 @cindex @samp{Face:} header field
1905 @cindex @samp{X-Face:} header field
1906 @cindex @samp{X-Image-URL:} header field
1907 @cindex header field, @samp{Face:}
1908 @cindex header field, @samp{X-Face:}
1909 @cindex header field, @samp{X-Image-URL:}
1910 @vindex mh-show-use-xface-flag
1911
1912 MH-E can display the content of @samp{Face:}, @samp{X-Face:}, and
1913 @samp{X-Image-URL:} header fields. If any of these fields occur in the
1914 header of your message, the sender's face will appear in the
1915 @samp{From:} header field. If more than one of these fields appear,
1916 then the first field found in the order @samp{Face:}, @samp{X-Face:},
1917 and @samp{X-Image-URL:} will be used. The option
1918 @code{mh-show-use-xface-flag} is used to turn this feature on and off.
1919 This feature will be turned on by default if your system supports it.
1920
1921 The first header field used, if present, is the Gnus-specific
1922 @samp{Face:} field@footnote{The @samp{Face:} field appeared in GNU
1923 Emacs 21 and XEmacs. For more information, see
1924 @uref{http://quimby.gnus.org/circus/face/}.}.
1925
1926 @cindex @command{uncompface}
1927 @cindex Emacs, packages, x-face
1928 @cindex Unix commands, @command{uncompface}
1929 @cindex x-face package
1930 @vindex mh-show-xface
1931
1932 Next is the traditional @samp{X-Face:} header field@footnote{The
1933 display of this field requires the
1934 @uref{ftp://ftp.cs.indiana.edu/pub/faces/compface/compface.tar.Z,
1935 @command{uncompface} program}. Recent versions of XEmacs have internal
1936 support for @samp{X-Face:} images. If your version of XEmacs does not,
1937 then you'll need both @command{uncompface} and the
1938 @uref{ftp://ftp.jpl.org/pub/elisp/, @samp{x-face} package}.}. MH-E
1939 renders the foreground and background of the image using the
1940 associated attributes of the face @code{mh-show-xface}.
1941
1942 @cindex @command{convert}
1943 @cindex @command{wget}
1944 @cindex ImageMagick
1945 @cindex Unix commands, @command{convert}
1946 @cindex Unix commands, @command{wget}
1947 @vindex mh-fetch-x-image-url
1948
1949 Finally, MH-E will display images referenced by the
1950 @samp{X-Image-URL:} header field if neither the @samp{Face:} nor the
1951 @samp{X-Face:} fields are present@footnote{The display of the images
1952 requires the @uref{http://www.gnu.org/software/wget/wget.html,
1953 @command{wget} program} to fetch the image and the @command{convert}
1954 program from the @uref{http://www.imagemagick.org/, ImageMagick
1955 suite}.}. Of the three header fields this is the most efficient in
1956 terms of network usage since the image doesn't need to be transmitted
1957 with every single mail. The option @code{mh-fetch-x-image-url}
1958 controls the fetching of the @samp{X-Image-URL:} header field image
1959 with the following values:
1960
1961 @table @samp
1962 @item Ask Before Fetching
1963 You are prompted before the image is fetched. MH-E will remember your
1964 reply and will either use the already fetched image the next time the
1965 same URL is encountered or silently skip it if you didn't fetch it the
1966 first time. This is a good setting.
1967 @c -------------------------
1968 @item Never Fetch
1969 Images are never fetched and only displayed if they are already
1970 present in the cache. This is the default.
1971 @end table
1972
1973 There isn't a value of @samp{Always Fetch} for privacy and DOS (denial
1974 of service) reasons. For example, fetching a URL can tip off a spammer
1975 that you've read his email (which is why you shouldn't blindly answer
1976 yes if you've set this option to @samp{Ask Before Fetching}). Someone
1977 may also flood your network and fill your disk drive by sending a
1978 torrent of messages, each specifying a unique URL to a very large
1979 file.
1980
1981 @cindex @file{.mhe-x-image-cache}
1982 @cindex files, @file{.mhe-x-image-cache}
1983
1984 The cache of images is found in the directory
1985 @file{.mhe-x-image-cache} within your MH directory. You can add your
1986 own face to the @samp{From:} field too. @xref{Picture}.
1987
1988 @cindex @command{mhl}
1989 @cindex MH commands, @command{mhl}
1990 @vindex mh-mhl-format-file
1991
1992 Normally MH-E takes care of displaying messages itself (rather than
1993 calling an MH program to do the work). If you'd rather have
1994 @command{mhl} display the message (within MH-E), change the option
1995 @code{mh-mhl-format-file} from its default value of @samp{Use Default
1996 mhl Format (Printing Only)}. You can set this option to @samp{Use
1997 Default mhl Format} to get the same output as you would get if you ran
1998 @command{mhl} from the shell. If you have a format file that you want
1999 MH-E to use, you can set this option to @samp{Specify an mhl Format
2000 File} and enter the name of your format file (@command{mhl}(1) or
2001 section @uref{@value{MH-BOOK-HOME}/shomes.htm#Usisho, Using mhl} in
2002 the MH book tells you how to write one). Your format file should
2003 specify a non-zero value for @samp{overflowoffset} to allow MH-E to
2004 parse the header. Note that @command{mhl} is always used for printing
2005 and forwarding; in this case, the value of @code{mh-mhl-format-file}
2006 is consulted if you have specified a format file.
2007
2008 @vindex mh-highlight-citation-style
2009 @cindex citations, highlighting
2010 @cindex highlighting citations
2011
2012 If the sender of the message has cited other messages in his message,
2013 then MH-E will highlight these citations to emphasize the sender's
2014 actual response. The option @code{mh-highlight-citation-style} can be
2015 customized to change the highlighting style. The @samp{Multicolor}
2016 method uses a different color for each indentation while the
2017 @samp{Monotone} method highlights all citations in red. To disable
2018 highlighting of citations entirely, choose @samp{None}.
2019
2020 @cindex URLs, highlighting
2021 @cindex email addresses, highlighting
2022 @cindex highlighting URLs
2023 @cindex highlighting email addresses
2024 @cindex links, following
2025 @findex goto-address-at-point
2026 @kindex C-c @key{RET}
2027 @kindex Mouse-2
2028 @vindex goto-address-highlight-p
2029
2030 Email addresses and URLs in the message are highlighted if the option
2031 @code{goto-address-highlight-p} is on, which it is by default. To view
2032 the web page for a highlighted URL or to send a message using a
2033 highlighted email address, use @kbd{Mouse-2} or @kbd{C-c @key{RET}}.
2034 See @ref{Sending Mail}, to see how to configure Emacs to send the
2035 message using MH-E.
2036
2037 @cindex boldface, showing
2038 @cindex emphasis
2039 @cindex italics, showing
2040 @cindex smileys
2041 @cindex typesetting
2042 @cindex underline, showing
2043 @vindex gnus-emphasis-alist
2044 @vindex mh-decode-mime-flag
2045 @vindex mh-graphical-emphasis-flag
2046 @vindex mh-graphical-smileys-flag
2047
2048 It is a long standing custom to inject body language using a
2049 cornucopia of punctuation, also known as the @dfn{smileys}. MH-E can
2050 render these as graphical widgets if the option
2051 @code{mh-graphical-smileys-flag} is turned on, which it is by default.
2052 Smileys include patterns such as :-) and ;-). Similarly, a few
2053 typesetting features are indicated in ASCII text with certain
2054 characters. If your terminal supports it, MH-E can render these
2055 typesetting directives naturally if the option
2056 @code{mh-graphical-emphasis-flag} is turned on, which it is by
2057 default. For example, _underline_ will be
2058 @ifhtml
2059 @html
2060 <u>underlined</u>,
2061 @end html
2062 @end ifhtml
2063 @ifnothtml
2064 underlined,
2065 @end ifnothtml
2066 *bold* will appear in @b{bold}, /italics/ will appear in @i{italics},
2067 and so on. See the option @code{gnus-emphasis-alist} for the whole
2068 list. Both of these options are disabled if the option
2069 @code{mh-decode-mime-flag} is turned off. @xref{Viewing Attachments}.
2070
2071 @cindex signature separator
2072 @cindex vCard
2073 @vindex mh-show-signature
2074
2075 MH-E normally renders signatures and vCards in italics so that the
2076 body of the message stands out more. MH-E depends on the presence of
2077 the @dfn{signature separator} (@samp{"-- "}) to do this. You can also
2078 customize the face @code{mh-show-signature} so the appearance of the
2079 signature block is more to your liking.
2080
2081 @vindex mh-show-hook
2082 @vindex mh-show-mode-hook
2083
2084 Two hooks can be used to control how messages are displayed. The first
2085 hook, @code{mh-show-mode-hook}, is called early on in the process of
2086 the message display. It is usually used to perform some action on the
2087 message's content. The second hook, @code{mh-show-hook}, is the last
2088 thing called after messages are displayed. It's used to affect the
2089 behavior of MH-E in general or when @code{mh-show-mode-hook} is too
2090 early.
2091
2092 @vindex mh-show-buffer-mode-line-buffer-id
2093 @cindex MH-Show mode
2094 @cindex modes, MH-Show
2095
2096 For those who like to modify their mode lines, use
2097 @code{mh-show-buffer-mode-line-buffer-id} to modify the mode line in
2098 the MH-Show buffers. Place the two escape strings @samp{%s} and
2099 @samp{%d}, which will display the folder name and the message number,
2100 respectively, somewhere in the string in that order. The default value
2101 of @samp{"@{show-%s@} %d"} yields a mode line of
2102
2103 @smallexample
2104 -----@{show-+inbox@} 4 (MH-Show)--Bot--------------------------------
2105 @end smallexample
2106
2107 @node Viewing Attachments, HTML, Viewing, Reading Mail
2108 @section Viewing Attachments
2109
2110 @cindex @command{mhshow}
2111 @cindex @command{show}
2112 @cindex MH commands, @command{mhshow}
2113 @cindex MH commands, @command{show}
2114 @cindex MIME
2115 @cindex attachments
2116 @cindex body parts
2117 @cindex multimedia mail
2118
2119 MH has the ability to display @dfn{@sc{mime}} (Multipurpose Internet
2120 Mail Extensions) messages which are simply messages with additional
2121 @dfn{body parts} or @dfn{attachments}. You can use the MH commands
2122 @command{show}@footnote{See the section
2123 @uref{@value{MH-BOOK-HOME}/reapre.htm, Reading Mail: inc show next
2124 prev} in the MH book.} or @command{mhshow}@footnote{See the section
2125 @uref{@value{MH-BOOK-HOME}/usimim.htm#ReMIMa, Reading MIME Mail} in
2126 the MH book.} from the shell to read @sc{mime} messages@footnote{You
2127 can call them directly from Emacs if you're running the X Window
2128 System: type @kbd{M-! xterm -e mhshow @var{message-number}}. You can
2129 leave out the @samp{xterm -e} if you use @command{mhlist} or
2130 @command{mhstore}.}.
2131
2132 @cindex Emacs, packages, mm-decode
2133 @cindex mm-decode package
2134 @findex mh-toggle-mh-decode-mime-flag
2135 @kindex ; (semicolon)
2136 @vindex mh-decode-mime-flag
2137
2138 MH-E can handle attachments as well if the Gnus @samp{mm-decode}
2139 package is present. If so, the option @code{mh-decode-mime-flag} will
2140 be on. Otherwise, you'll see the @sc{mime} body parts rather than text
2141 or attachments. There isn't much point in turning off the option
2142 @code{mh-decode-mime-flag}; however, you can inspect it if it appears
2143 that the body parts are not being interpreted correctly or toggle it
2144 with the command @kbd{;} (semicolon;
2145 @code{mh-toggle-mh-decode-mime-flag}) to view the raw message. This
2146 option also controls the display of quoted-printable messages and
2147 other graphical widgets. @xref{Viewing}.
2148
2149 @cindex buttons
2150 @kindex Mouse-1
2151 @kindex Mouse-2
2152 @kindex @key{RET}
2153 @findex mh-press-button
2154 @findex mh-next-button
2155 @findex mh-prev-button
2156 @kindex K @key{TAB}
2157 @kindex K S-@key{TAB}
2158
2159 Attachments in MH-E are indicated by buttons like this:
2160
2161 @example
2162 [1. image/jpeg; foo.jpg]...
2163 @end example
2164
2165 To view the contents of the button, use either @kbd{Mouse-1} or
2166 @kbd{Mouse-2} on the button or @key{RET} (@code{mh-press-button}) when
2167 the cursor is over the button. This command is a toggle so if you use
2168 it again on the same attachment, it is hidden. If Emacs does not know
2169 how to display the attachment, then Emacs offers to save the
2170 attachment in a file. To move the cursor to the next button, use the
2171 command @kbd{K @key{TAB}} (@code{mh-next-button}). If the end of the
2172 buffer is reached then the search wraps over to the start of the
2173 buffer. To move the cursor to the previous button, use the command
2174 @kbd{K S-@key{TAB}} (@code{mh-prev-button}). If the beginning of the
2175 buffer is reached then the search wraps over to the end of the buffer.
2176
2177 @cindex attachments, viewing
2178 @cindex viewing attachments
2179 @findex mh-folder-toggle-mime-part
2180 @kindex K v
2181
2182 Another way to view the contents of a button is to use the command
2183 @kbd{K v} (@code{mh-folder-toggle-mime-part}). This command displays
2184 (or hides) the attachment associated with the button under the cursor.
2185 If the cursor is not located over a button, then the cursor first
2186 moves to the next button, wrapping to the beginning of the message if
2187 necessary. This command has the advantage over the previous commands
2188 of working from the MH-Folder buffer. You can also provide a numeric
2189 prefix argument (as in @kbd{4 K v}) to view the attachment labeled
2190 with that number. If Emacs does not know how to display the
2191 attachment, then Emacs offers to save the attachment in a file.
2192
2193 @cindex @file{/etc/mailcap}
2194 @cindex files, @file{/etc/mailcap}
2195 @findex mailcap-mime-info
2196 @findex mh-display-with-external-viewer
2197 @kindex K e
2198
2199 If Emacs does not know how to view an attachment, you could save it
2200 into a file and then run some program to open it. It is easier,
2201 however, to launch the program directly from MH-E with the command
2202 @kbd{K e} (@code{mh-display-with-external-viewer}). While you'll most
2203 likely use this to view spreadsheets and documents, it is also useful
2204 to use your browser to view HTML attachments with higher fidelity than
2205 what Emacs can provide. This command displays the attachment
2206 associated with the button under the cursor. If the cursor is not
2207 located over a button, then the cursor first moves to the next button,
2208 wrapping to the beginning of the message if necessary. You can provide
2209 a numeric prefix argument (as in @kbd{4 K e}) to view the attachment
2210 labeled with that number. This command tries to provide a reasonable
2211 default for the viewer by calling the Emacs function
2212 @code{mailcap-mime-info}. This function usually reads the file
2213 @file{/etc/mailcap}.
2214
2215 @cindex attachments, saving
2216 @cindex saving attachments
2217
2218 @findex mh-folder-save-mime-part
2219 @kindex K o
2220
2221 Use the command @kbd{K o} (@code{mh-folder-save-mime-part}) to save
2222 attachments (the mnemonic is ``output''). This command saves the
2223 attachment associated with the button under the cursor. If the cursor
2224 is not located over a button, then the cursor first moves to the next
2225 button, wrapping to the beginning of the message if necessary. You can
2226 also provide a numeric prefix argument (as in @kbd{3 K o}) to save the
2227 attachment labeled with that number. This command prompts you for a
2228 filename and suggests a specific name if it is available.
2229
2230 @cindex @command{mhn}
2231 @cindex @command{mhstore}
2232 @cindex MH commands, @command{mhn}
2233 @cindex MH commands, @command{mhstore}
2234 @findex mh-mime-save-parts
2235 @kindex K a
2236 @vindex mh-mime-save-parts-default-directory
2237
2238 You can save all of the attachments at once with the command @kbd{K a}
2239 (@code{mh-mime-save-parts}). The attachments are saved in the
2240 directory specified by the option
2241 @code{mh-mime-save-parts-default-directory} unless you use a prefix
2242 argument (as in @kbd{C-u K a}) in which case you are prompted for the
2243 directory. These directories may be superseded by MH profile
2244 components, since this function calls on @command{mhstore}
2245 (@command{mhn}) to do the work.
2246
2247 The default value for the option
2248 @code{mh-mime-save-parts-default-directory} is @samp{Prompt Always} so
2249 that you are always prompted for the directory in which to save the
2250 attachments. However, if you usually use the same directory within a
2251 session, then you can set this option to @samp{Prompt the First Time}
2252 to avoid the prompt each time. you can make this directory permanent
2253 by choosing @samp{Directory} and entering the directory's name.
2254
2255 @cindex attachments, inline
2256 @cindex inline attachments
2257 @findex mh-toggle-mime-buttons
2258 @kindex K t
2259 @vindex mh-display-buttons-for-inline-parts-flag
2260
2261 The sender can request that attachments should be viewed inline so
2262 that they do not really appear like an attachment at all to the
2263 reader. Most of the time, this is desirable, so by default MH-E
2264 suppresses the buttons for inline attachments. On the other hand, you
2265 may receive code or HTML which the sender has added to his message as
2266 inline attachments so that you can read them in MH-E. In this case, it
2267 is useful to see the buttons so that you know you don't have to cut
2268 and paste the code into a file; you can simply save the attachment. If
2269 you want to make the buttons visible for inline attachments, you can
2270 use the command @kbd{K t} (@code{mh-toggle-mime-buttons}) to toggle
2271 the visibility of these buttons. You can turn on these buttons
2272 permanently by turning on the option
2273 @code{mh-display-buttons-for-inline-parts-flag}.
2274
2275 MH-E cannot display all attachments inline however. It can display
2276 text (including @sc{html}) and images.
2277
2278 @cindex @samp{Content-Disposition:} header field
2279 @cindex header field, @samp{Content-Disposition:}
2280 @cindex inline images
2281 @vindex mh-max-inline-image-height
2282 @vindex mh-max-inline-image-width
2283
2284 Some older mail programs do not insert the needed
2285 plumbing@footnote{This plumbing is the @samp{Content-Disposition:}
2286 header field.} to tell MH-E whether to display the attachments inline
2287 or not. If this is the case, MH-E will display these images inline if
2288 they are smaller than the window. However, you might want to allow
2289 larger images to be displayed inline. To do this, you can change the
2290 options @code{mh-max-inline-image-width} and
2291 @code{mh-max-inline-image-height} from their default value of zero to
2292 a large number. The size of your screen is a good choice for these
2293 numbers.
2294
2295 @cindex alternatives
2296 @cindex attachments, alternatives
2297 @vindex mh-display-buttons-for-alternatives-flag
2298
2299 Sometimes, a mail program will produce multiple alternatives of an
2300 attachment in increasing degree of faithfulness to the original
2301 content. By default, only the preferred alternative is displayed. If
2302 the option @code{mh-display-buttons-for-alternatives-flag} is on, then
2303 the preferred part is shown inline and buttons are shown for each of
2304 the other alternatives.
2305
2306 @kindex K i
2307 @findex mh-folder-inline-mime-part
2308
2309 You can view the raw contents of an attachment with the command @kbd{K
2310 i} (@code{mh-folder-inline-mime-part}). This command displays (or
2311 hides) the contents of the attachment associated with the button under
2312 the cursor verbatim. If the cursor is not located over a button, then
2313 the cursor first moves to the next button, wrapping to the beginning
2314 of the message if necessary. You can also provide a numeric prefix
2315 argument (as in @kbd{4 K i}) to view the attachment labeled with that
2316 number.
2317
2318 For additional information on buttons, see
2319 @ifinfo
2320 @ref{Article Buttons,,,gnus}, and @ref{MIME Commands,,,gnus}.
2321 @end ifinfo
2322 @ifnotinfo
2323 the chapters @uref{http://www.gnus.org/manual/gnus_101.html#SEC101,
2324 Article Buttons} and
2325 @uref{http://www.gnus.org/manual/gnus_108.html#SEC108, MIME Commands}
2326 in the @cite{The Gnus Manual}.
2327 @end ifnotinfo
2328
2329 @node HTML, Digests, Viewing Attachments, Reading Mail
2330 @section HTML
2331
2332 @cindex HTML
2333 @cindex Gnus
2334 @vindex mm-text-html-renderer
2335
2336 MH-E can display messages that have been sent in HTML@footnote{This
2337 feature depends on a version of Gnus that is at least 5.10.}. The
2338 content of the message will appear in the MH-Show buffer as you would
2339 expect if the entire message is HTML, or there is an inline HTML body
2340 part. However, if there is an HTML body part that is an attachment,
2341 then you'll see a button like this:
2342
2343 @example
2344 [1. text/html; foo.html]...
2345 @end example
2346
2347 See @ref{Viewing Attachments} to see how to read the contents of this
2348 body part.
2349
2350 The browser that MH-E uses is determined by the option
2351 @code{mm-text-html-renderer}. The default setting is set automatically
2352 based upon the presence of a known browser on your system. If you wish
2353 to use a different browser, then set this option accordingly. See the
2354 documentation for the browser you use for additional information on
2355 how to use it. In particular, find and disable the option to render
2356 images as this can tip off spammers that the email address they have
2357 used is valid.
2358
2359 If you're confused about which @code{mm-text-html-renderer} to use,
2360 here's a brief description of each, sorted by popularity, that
2361 includes the results of a quick poll of MH-E users from 2005-12-23.
2362
2363 @table @asis
2364
2365 @item @samp{w3m} 7
2366 The @samp{w3m} browser requires an external program. It's quick,
2367 produces pretty nice output, and best of all, it's the only browser
2368 that highlights links. These can be clicked with @kbd{Mouse-2} to view
2369 the content of the link in @samp{w3m} or with @kbd{S-Mouse-2} to view
2370 the content of the link in an external browser. The @samp{w3m} browser
2371 handles tables well and actually respects the table's width parameter
2372 (which can cause text to wrap if the author didn't anticipate that the
2373 page would be viewed in Emacs).
2374 @c -------------------------
2375 @item @samp{w3m-standalone} 3
2376 This browser, along with @samp{nil} for the external browser, are the
2377 only choices that work without having to download a separate lisp
2378 package or external program. This browser is quick, but does not show
2379 links. It handles simple tables but some tables get rendered much
2380 wider than the Emacs frame. This browser was the only one not to
2381 handle the escape @samp{&ndash;} (it printed a @samp{?}), but it did
2382 render @samp{&reg;}.
2383 @c -------------------------
2384 @item @samp{links} 1
2385 The @samp{links} browser requires an external program. It's quick, and
2386 produces nicer output than @samp{lynx} on single column mails in
2387 tables. However, it doesn't show links and it doesn't do as nice a job
2388 on multi-column tables as some lines wrap. At least it fits in 80
2389 columns and thus seems better than @samp{w3} and
2390 @samp{w3m-standalone}. Converts escapes such as @samp{&reg;} to (R).
2391 @c -------------------------
2392 @item @samp{lynx} 1
2393 The @samp{lynx} browser requires an external program. It's quick and
2394 produces pretty decent output but it doesn't show links. It doesn't
2395 seem to do multi-column tables which makes output much cleaner. It
2396 centers the output and wraps long lines more than most. Handles
2397 @samp{&reg;}.
2398 @c -------------------------
2399 @item @samp{nil} 1
2400 This choice obviously requires an external browser. Like
2401 @samp{w3m-standalone}, it works out of the box. With this setting,
2402 HTML messages have a button for the body part which you can view with
2403 @kbd{K v} (@code{mh-folder-toggle-mime-part}).
2404 @c -------------------------
2405 @item @samp{w3} 0
2406 This choice does not require an external program as all of the
2407 rendering is done in lisp. You do need to get the package separately.
2408 This browser is @strong{slow}, and doesn't appear to have been updated
2409 since 2001 and the author hasn't responded to my emails. It displays
2410 unknown tags instead of hiding them, so you get to see all the
2411 Microsoft crap in certain messages. Tends to make multi-column tables
2412 wider than even a full-screen Emacs can handle. Like @samp{w3m}, you
2413 can follow links, but you have to find them first as they are not
2414 highlighted. Performs well on single-column tables and handles escapes
2415 such as @samp{&reg;}.
2416 @c -------------------------
2417 @item @samp{html2text} 0
2418 The @samp{html2text} browser requires an external program. I noticed
2419 that it can do some nasty things with simple HTML mails (like filling
2420 the entire message as if it were one paragraph, including signature).
2421 On another message, it displayed half of the HTML tags for some
2422 reason.
2423 @end table
2424
2425 For a couple more sources of information about
2426 @code{mm-text-html-renderer},
2427 @ifinfo
2428 @xref{Display Customization,,,emacs-mime}, and the documentation for
2429 the Gnus command @kbd{W h} (@pxref{Article Washing,,,gnus},).
2430 @end ifinfo
2431 @ifnotinfo
2432 see section @uref{http://www.gnus.org/manual/emacs-mime_6.html,
2433 Display Customization} in the @cite{The Emacs MIME Manual} and the the
2434 documentation for the Gnus command @kbd{W h} (see section
2435 @uref{http://www.gnus.org/manual/gnus_99.html, Article Washing} in the
2436 @cite{The Gnus Manual}).
2437 @end ifnotinfo
2438
2439 @node Digests, Reading PGP, HTML, Reading Mail
2440 @section Digests
2441
2442 @cindex digests
2443 @findex mh-page-digest
2444 @findex mh-page-digest-backwards
2445 @kindex @key{BS}
2446 @kindex @key{SPC}
2447 @kindex D @key{BS}
2448 @kindex D @key{SPC}
2449
2450 A digest is a message that contains other messages. Special MH-E
2451 commands let you read digests conveniently. You can use @key{SPC} and
2452 @key{BS} to page through the digest as if it were a normal message,
2453 but if you wish to skip to the next message in the digest, use
2454 @kbd{D @key{SPC}} (@code{mh-page-digest}). To return to a previous message,
2455 use @kbd{D @key{BS}} (@code{mh-page-digest-backwards}).
2456
2457 @cindex @command{burst}
2458 @cindex MH commands, @command{burst}
2459 @cindex MH-Folder Show mode
2460 @cindex modes, MH-Folder Show
2461 @findex mh-burst-digest
2462 @kindex D b
2463 @kindex d
2464 @kindex t
2465
2466 Another handy command is @kbd{D b} (@code{mh-burst-digest}). This
2467 command uses the MH command @command{burst}@footnote{See the section
2468 @uref{@value{MH-BOOK-HOME}/burdig.htm, Bursting Messages} in the MH
2469 book.} to break out each message in the digest into its own message.
2470 Using this command, you can quickly delete unwanted messages, like
2471 this: Once the digest is split up, toggle out of MH-Folder Show mode
2472 with @kbd{t} (@pxref{Folders}) so that the scan lines fill the screen
2473 and messages aren't displayed. Then use @kbd{d} (@pxref{Reading Mail})
2474 to quickly delete messages that you don't want to read (based on the
2475 @samp{Subject:} header field). You can also burst the digest to reply
2476 directly to the people who posted the messages in the digest. One
2477 problem you may encounter is that the @samp{From:} header fields are
2478 preceded with a @samp{>} so that your reply can't create the
2479 @samp{To:} field correctly. In this case, you must correct the
2480 @samp{To:} field yourself. This is described later (@pxref{Editing
2481 Drafts}).
2482
2483 @node Reading PGP, Printing, Digests, Reading Mail
2484 @section Signed and Encrypted Messages
2485
2486 @cindex GPG
2487 @cindex GnuPG
2488 @cindex Gnus
2489 @cindex OpenPGP
2490 @cindex PGP
2491 @cindex RFC 3156
2492 @cindex encrypted messages
2493 @cindex security
2494 @cindex signed messages
2495
2496 You can read encrypted or signed PGP or GPG messages with
2497 MH-E@footnote{This feature depends on post-5.10 versions of Gnus.
2498 @cite{MIME Security with OpenPGP} is documented in
2499 @uref{http://www.rfc-editor.org/rfc/rfc3156.txt, RFC 3156}. However,
2500 MH-E can also decrypt old-style PGP messages that are not in MIME
2501 format.}. This section assumes that you already have a good
2502 understanding of GPG and have set up your keys appropriately.
2503
2504 If someone sends you a signed message, here is what you'll see:
2505
2506 @smallexample
2507 @group
2508 [[PGP Signed Part:Bill Wohler <wohler@@stop.mail-abuse.org>]]
2509 This is a signed message.
2510
2511 [[End of PGP Signed Part]]
2512 @end group
2513 @end smallexample
2514
2515 @cindex keychain
2516 @cindex key server
2517 @cindex signed messages
2518
2519 If the key for the given signature is not in your keychain, you'll be
2520 given the opportunity to fetch the key from a key server and verify
2521 the key. If the message is really large, the verification process can
2522 take a long time. You can press @kbd{C-g} at any time to
2523 cancel@footnote{Unfortunately in the current version, the validation
2524 process doesn't display a message so it appears that MH-E has hung. We
2525 hope that this will be fixed in the future.}.
2526
2527 If the signature doesn't check out, you might see something like this:
2528
2529 @smallexample
2530 @group
2531 [[PGP Signed Part:Failed]]
2532 This is a signed message.
2533 This is garbage added after the signature was made.
2534
2535 [[End of PGP Signed Part]]
2536 @end group
2537 @end smallexample
2538
2539 @cindex decrypting messages
2540
2541 If someone sends you an encrypted message, MH-E will ask for your
2542 passphrase to decrypt the message. You should see something like this:
2543
2544 @smallexample
2545 @group
2546 [[PGP Encrypted Part:OK]]
2547
2548 [[PGP Signed Part:Bill Wohler <wohler@@stop.mail-abuse.org>]]
2549 This is the secret message.
2550
2551 [[End of PGP Signed Part]]
2552
2553 [[End of PGP Encrypted Part]]
2554 @end group
2555 @end smallexample
2556
2557 If there is a problem decrypting the message, the button will say:
2558
2559 @smallexample
2560 [[PGP Encrypted Part:Failed]]
2561 @end smallexample
2562
2563 You can read the contents of this button using the methods described in
2564 @ref{Viewing Attachments}. If the message were corrupted, you'd see
2565 this:
2566
2567 @smallexample
2568 [[PGP Encrypted Part:Failed]
2569 Invalid base64 data]
2570 @end smallexample
2571
2572 If your passphrase were incorrect, you'd see something like this:
2573
2574 @smallexample
2575 [GNUPG:] ENC_TO CD9C88BB610BD9AD 1 0
2576 [GNUPG:] USERID_HINT CD9C88BB610BD9AD Bill Wohler <wohler@@stop.mail-abuse.org>
2577 [GNUPG:] NEED_PASSPHRASE CD9C88BB610BD9AD CD9C88BB610BD9AD 1 0
2578 [GNUPG:] BAD_PASSPHRASE CD9C88BB610BD9AD
2579 gpg: encrypted with 1024-bit RSA key, ID 610BD9AD, created 1997-09-09
2580 "Bill Wohler <wohler@@stop.mail-abuse.org>"
2581 gpg: public key decryption failed: bad passphrase
2582 [GNUPG:] BEGIN_DECRYPTION
2583 [GNUPG:] DECRYPTION_FAILED
2584 gpg: decryption failed: secret key not available
2585 [GNUPG:] END_DECRYPTION
2586
2587 gpg exited abnormally: '2'
2588 @end smallexample
2589
2590 @vindex mh-show-pgg-bad
2591 @vindex mh-show-pgg-good
2592 @vindex mh-show-pgg-unknown
2593
2594 The appearance of the buttons is controlled by the faces
2595 @code{mh-show-pgg-good}, @code{mh-show-pgg-bad}, and
2596 @code{mh-show-pgg-unknown} depending on the validity of the signature.
2597 The latter is used whether the signature is unknown or untrusted.
2598
2599 @cindex @samp{pgg} customization group
2600 @cindex PGG
2601 @cindex customization group, @samp{pgg}
2602
2603 The @samp{pgg} customization group may have some settings which may
2604 interest you.
2605 @iftex
2606 See @cite{The PGG Manual}.
2607 @end iftex
2608 @ifinfo
2609 @xref{Top, , The PGG Manual, pgg, The PGG Manual}.
2610 @end ifinfo
2611 @ifhtml
2612 See
2613 @uref{http://www.dk.xemacs.org/Documentation/packages/html/pgg.html,
2614 @cite{The PGG Manual}}.
2615 @end ifhtml
2616
2617 @node Printing, Files and Pipes, Reading PGP, Reading Mail
2618 @section Printing Your Mail
2619
2620 @cindex printing
2621 @findex mh-ps-print-msg
2622 @findex mh-ps-print-msg-file
2623 @kindex P f
2624 @kindex P p
2625
2626 To print messages in MH-E, use the command @kbd{P p}
2627 (@code{mh-ps-print-msg}). You can print all the messages in a range
2628 (as in @kbd{C-u P p 1 3 5-7 last:5 frombob @key{RET}},
2629 @pxref{Ranges}). You can also send the output to a file with @kbd{P f}
2630 (@code{mh-ps-print-msg-file}). This command will print inline text
2631 attachments but will not decrypt messages. However, when a message is
2632 displayed in an MH-Show buffer, then that buffer is used verbatim for
2633 printing with the caveat that only text attachments, if opened inline,
2634 are printed. Therefore, encrypted messages can be printed by showing
2635 and decrypting them first. The commands @kbd{P p} and @kbd{P f} do not
2636 use the options @code{mh-lpr-command-format} or
2637 @code{mh-print-background-flag}, described below.
2638
2639 @findex mh-ps-print-toggle-color
2640 @kindex P C
2641 @vindex ps-print-color-p
2642
2643 Colors are emulated on black-and-white printers with shades of gray.
2644 This might produce illegible output, even if your screen colors only
2645 use shades of gray. If this is the case, try using the command @kbd{P
2646 C} (@code{mh-ps-print-toggle-color}) to toggle between color, no
2647 color, and a black and white representation of the colors and see
2648 which works best. You change this setting permanently by customizing
2649 the option @code{ps-print-color-p}.
2650
2651 @findex mh-ps-print-toggle-faces
2652 @kindex P F
2653
2654 Another related function is the command @kbd{P F}
2655 (@code{mh-ps-print-toggle-faces}). This command toggles between using
2656 faces and not. When faces are enabled, the printed message will look
2657 very similar to the message in the MH-Show buffer.
2658
2659 @cindex ps-print package
2660 @cindex Emacs, packages, ps-print
2661
2662 MH-E uses the @samp{ps-print} package to do the printing, so you can
2663 customize the printing further by going to the @samp{ps-print}
2664 customization group.
2665
2666 @cindex @command{lpr}
2667 @cindex @command{mhl}
2668 @cindex MH commands, @command{mhl}
2669 @cindex Unix commands, @command{lpr}
2670 @findex mh-print-msg
2671 @kindex P l
2672
2673 An alternative to using the @samp{ps-print} package is the command
2674 @kbd{P l} (@code{mh-print-msg}) (the @i{l} is for @i{l}ine printer or
2675 @i{l}pr). You can print all the messages in a range. The message is
2676 formatted with @command{mhl}@footnote{See the section
2677 @uref{@value{MH-BOOK-HOME}/shomes.htm#Usisho, Using mhl} in the MH
2678 book.} and printed with the @command{lpr} command.
2679
2680 @vindex mh-lpr-command-format
2681 @vindex mh-print-background-flag
2682
2683 The command @kbd{P l} uses two options. The option
2684 @code{mh-lpr-command-format} contains the Unix command line which
2685 performs the actual printing. The string can contain one escape,
2686 @samp{%s}, which is replaced by the name of the folder and the message
2687 number and is useful for print job names. The default setting is
2688 @samp{"lpr -J '%s'"}. I use @samp{"mpage -h'%s' -b Letter -H1of -mlrtb
2689 -P"} which produces a nice header and adds a bit of margin so the text
2690 fits within my printer's margins. Normally messages are printed in the
2691 foreground. If this is slow on your system, you may elect to turn on
2692 the option @code{mh-print-background-flag} to print in the background.
2693 If you do this, do not delete the message until it is printed or else
2694 the output may be truncated. These options are not used by the
2695 commands @kbd{P p} or @kbd{P f}.
2696
2697 @node Files and Pipes, Navigating, Printing, Reading Mail
2698 @section Files and Pipes
2699
2700 @cindex files
2701 @cindex pipes
2702
2703 @findex mh-refile-or-write-again
2704 @findex mh-write-msg-to-file
2705 @kindex !
2706 @kindex >
2707
2708 MH-E does offer a couple of commands that are not a part of MH@. The
2709 first one, @kbd{>} (@code{mh-write-msg-to-file}), writes a message to
2710 a file. You are prompted for the filename. If the file already exists,
2711 the message is appended to it. You can also write the message to the
2712 file without the header by specifying a prefix argument (such as
2713 @kbd{C-u > /tmp/foobar @key{RET}}). Subsequent writes to the same file
2714 can be made with the command @kbd{!}
2715 (@code{mh-refile-or-write-again}).
2716
2717 @findex mh-pipe-msg
2718 @kindex |
2719
2720 You can also pipe the message through a Unix shell command with the
2721 command @kbd{|} (@code{mh-pipe-msg}). You are prompted for the Unix
2722 command through which you wish to run your message. If you give a
2723 prefix argument to this command, the message header is included in the
2724 text passed to the command (the contrived example @kbd{C-u | lpr}
2725 would be done with the @kbd{l} command instead).
2726
2727 @cindex @command{shar}
2728 @cindex @command{uuencode}
2729 @cindex Unix commands, @command{shar}
2730 @cindex Unix commands, @command{uuencode}
2731 @findex mh-store-msg
2732 @kindex X s
2733 @vindex mh-store-default-directory
2734
2735 If the message is a shell archive @command{shar} or has been run
2736 through @command{uuencode} use @kbd{X s} (@code{mh-store-msg}) to
2737 extract the body of the message. The default directory for extraction
2738 is the current directory; however, you have a chance to specify a
2739 different extraction directory. The next time you use this command,
2740 the default directory is the last directory you used. If you would
2741 like to change the initial default directory, customize the option
2742 @code{mh-store-default-directory}, change the value from
2743 @samp{Current} to @samp{Directory}, and then enter the name of the
2744 directory for storing the content of these messages.
2745
2746 @findex mh-store-buffer
2747
2748 By the way, @kbd{X s} calls the Emacs Lisp function
2749 @code{mh-store-buffer}. I mention this because you can use it directly
2750 if you're editing a buffer that contains a file that has been run
2751 through @command{uuencode} or @command{shar}. For example, you can
2752 extract the contents of the current buffer in your home directory by
2753 typing @kbd{M-x mh-store-buffer @key{RET} ~ @key{RET}}.
2754
2755 @node Navigating, Miscellaneous Commands and Options, Files and Pipes, Reading Mail
2756 @section Navigating
2757
2758 @cindex moving between messages
2759 @cindex navigation
2760 @findex mh-first-msg
2761 @findex mh-goto-msg
2762 @findex mh-last-msg
2763 @findex mh-next-undeleted-msg
2764 @findex mh-next-unread-msg
2765 @findex mh-previous-undeleted-msg
2766 @findex mh-previous-unread-msg
2767 @kindex M-<
2768 @kindex M->
2769 @kindex M-n
2770 @kindex M-p
2771 @kindex g
2772 @kindex n
2773 @kindex p
2774
2775 To move on to the next message, use the command @kbd{n}
2776 (@code{mh-next-undeleted-msg}); use @kbd{p}
2777 (@code{mh-previous-undeleted-msg}) to read the previous message. To
2778 move to the next unread message, use @kbd{M-n}
2779 (@code{mh-next-unread-msg}); use @kbd{M-p}
2780 (@code{mh-previous-unread-msg}) to move to the previous unread
2781 message. These commands can be given a prefix argument to specify how
2782 many messages to skip (for example, @kbd{5 n}). You can also move to a
2783 specific message with @kbd{g} (@code{mh-goto-msg}). You can enter the
2784 message number either before or after typing @kbd{g}. In the latter
2785 case, Emacs prompts you. Finally, you can go to the first or last
2786 message with @kbd{M-<} (@code{mh-first-msg}) and @kbd{M->}
2787 (@code{mh-last-msg}) respectively.
2788
2789 @cindex MH-Folder mode
2790 @cindex modes, MH-Folder
2791 @findex next-line
2792 @findex previous-line
2793 @kindex C-n
2794 @kindex C-p
2795
2796 You can also use the Emacs commands @kbd{C-p} (@code{previous-line})
2797 and @kbd{C-n} (@code{next-line}) to move up and down the scan lines in
2798 the MH-Folder window. These commands can be used in conjunction with
2799 @key{RET} to look at deleted or refiled messages.
2800
2801 @cindex deleting messages
2802 @findex mh-delete-msg
2803 @kindex d
2804
2805 To mark a message for deletion, use the command @kbd{d}
2806 (@code{mh-delete-msg}). A @samp{D} is placed by the message in the
2807 scan window, and the next undeleted message is displayed. If the
2808 previous command had been @kbd{p}, then the next message displayed is
2809 the first undeleted message previous to the message just deleted. Use
2810 @kbd{n} to force subsequent @kbd{d} commands to move forward to the
2811 next undeleted message after deleting the message under the cursor.
2812 You may also specify a range (for example, @kbd{C-u d 1 3 5-7 last:5
2813 frombob @key{RET}}, @pxref{Ranges}).
2814
2815 @findex mh-delete-msg-no-motion
2816 @kindex C-d
2817
2818 The command @kbd{C-d} (@code{mh-delete-msg-no-motion}) marks the
2819 message (or messages in range) for deletion but leaves the cursor at
2820 the current message in case you wish to perform other operations on
2821 the message.
2822
2823 @findex mh-delete-subject
2824 @findex mh-delete-subject-or-thread
2825 @kindex k
2826
2827 And to delete more messages faster, you can use @kbd{k}
2828 (@code{mh-delete-subject-or-thread}) to delete all the messages with
2829 the same subject as the current message. This command puts these
2830 messages in a sequence named @samp{subject}. You can undo this action
2831 by using @kbd{u} (@code{mh-undo}) with a prefix argument and then
2832 specifying the @samp{subject} sequence. However, if the buffer is
2833 displaying a threaded view of the folder then @kbd{k} behaves like
2834 @kbd{T d} (@code{mh-thread-delete}). @xref{Threading}.
2835
2836 @findex mh-execute-commands
2837 @kindex x
2838
2839 However you mark a message for deletion, the command @kbd{x}
2840 (@code{mh-execute-commands}) actually carries out the deletion
2841 (@pxref{Folders}).
2842
2843 @vindex mh-delete-msg-hook
2844
2845 The hook @code{mh-delete-msg-hook} is called after you mark a message
2846 for deletion. For example, a past maintainer of MH-E used this once
2847 when he kept statistics on his mail usage.
2848
2849 @node Miscellaneous Commands and Options, , Navigating, Reading Mail
2850 @section Miscellaneous Commands and Options
2851
2852 This section contains a few more miscellaneous commands and options.
2853
2854 @cindex editing message
2855 @findex mh-modify
2856 @kindex M
2857
2858 There are times when you need to edit a message. For example, you may
2859 need to fix a broken Content-Type header field. You can do this with
2860 the command @kbd{M} (@code{mh-modify}). It displays the raw message in
2861 an editable buffer. When you are done editing, save and kill the
2862 buffer as you would any other.
2863
2864 @vindex mh-do-not-confirm-flag
2865
2866 Commands such as @code{mh-pack-folder} prompt to confirm whether to
2867 process outstanding moves and deletes or not before continuing.
2868 Turning on the option @code{mh-do-not-confirm-flag} means that these
2869 actions will be performed---which is usually desired but cannot be
2870 retracted---without question@footnote{In previous versions of MH-E,
2871 this option suppressed the confirmation in @code{mh-kill-folder}.
2872 Since this kept most users from setting this option,
2873 @code{mh-kill-folder} was modified in version 6.0 to always ask for
2874 confirmation subject to @code{mh-kill-folder-suppress-prompt-hook}.
2875 @xref{Folders}.}.
2876
2877 @cindex MH-Folder mode
2878 @cindex modes, MH-Folder
2879 @vindex mh-summary-height
2880
2881 The option @code{mh-summary-height} controls the number of scan lines
2882 displayed in the MH-Folder window, including the mode line. The
2883 default value of this option is @samp{Automatic} which means that the
2884 MH-Folder buffer will maintain the same proportional size if the frame
2885 is resized. If you'd prefer a fixed height, then choose the
2886 @samp{Fixed Size} option and enter the number of lines you'd like to
2887 see.
2888
2889 @vindex mh-bury-show-buffer-flag
2890
2891 Normally the buffer for displaying messages is buried at the bottom at
2892 the buffer stack. You may wish to disable this feature by turning off
2893 the option @code{mh-bury-show-buffer-flag}. One advantage of not
2894 burying the show buffer is that one can delete the show buffer more
2895 easily in an electric buffer list because of its proximity to its
2896 associated MH-Folder buffer. Try running @kbd{M-x
2897 electric-buffer-list} to see what I mean.
2898
2899 @cindex @file{.emacs}
2900 @cindex files, @file{.emacs}
2901 @cindex reading mail
2902
2903 Before we leave this section, I'll include a function that I use as a
2904 front end to MH-E@footnote{Stephen Gildea's favorite binding is
2905 @kbd{(global-set-key "\C-cr" 'mh-rmail)}.}. It toggles between your
2906 working window configuration, which may be quite involved---windows
2907 filled with source, compilation output, man pages, and other
2908 documentation---and your MH-E window configuration. Like the rest of
2909 the customization described in this section, simply add the following
2910 code to @file{~/.emacs}.
2911
2912 @iftex
2913 @filbreak
2914 @end iftex
2915
2916 @findex mh-rmail, example
2917
2918 @smalllisp
2919 @group
2920 (defvar my-mh-screen-saved nil
2921 "Set to non-@code{nil} when MH-E window configuration shown.")
2922 (defvar my-normal-screen nil "Normal window configuration.")
2923 (defvar my-mh-screen nil "MH-E window configuration.")
2924
2925 (defun my-mh-rmail (&optional arg)
2926 "Toggle between MH-E and normal screen configurations.
2927 With non-@code{nil} or prefix argument, @i{inc} mailbox as well
2928 when going into mail."
2929 (interactive "P") ; @r{user callable function, P=prefix arg}
2930 (setq my-mh-screen-saved ; @r{save state}
2931 (cond
2932 ;; @r{Bring up MH-E screen if arg or normal window configuration.}
2933 ;; @r{If arg or +inbox buffer doesn't exist, run mh-rmail.}
2934 ((or arg (null my-mh-screen-saved))
2935 (setq my-normal-screen (current-window-configuration))
2936 (if (or arg (null (get-buffer "+inbox")))
2937 (mh-rmail)
2938 (set-window-configuration my-mh-screen))
2939 t) ; @r{set my-mh-screen-saved to @code{t}}
2940 ;; @r{Otherwise, save MH-E screen and restore normal screen.}
2941 (t
2942 (setq my-mh-screen (current-window-configuration))
2943 (set-window-configuration my-normal-screen)
2944 nil)))) ; @r{set my-mh-screen-saved to nil}
2945
2946 (global-set-key "\C-x\r" 'my-mh-rmail) ;@r{ call with C-x @key{RET}}
2947
2948 @i{Starting MH-E}
2949
2950 @end group
2951 @end smalllisp
2952
2953 If you type an argument (@kbd{C-u}) or if @code{my-mh-screen-saved} is
2954 @code{nil} (meaning a non-MH-E window configuration), the current
2955 window configuration is saved, either the @samp{+inbox} buffer is
2956 displayed or @code{mh-rmail} is run, and the MH-E window configuration
2957 is shown. Otherwise, the MH-E window configuration is saved and the
2958 original configuration is displayed.
2959
2960 @node Folders, Sending Mail, Reading Mail, Top
2961 @chapter Organizing Your Mail with Folders
2962
2963 @cindex folders
2964 @cindex using folders
2965
2966 This chapter discusses the things you can do with folders within MH-E.
2967 The commands in this chapter are also found in the @samp{Folder} and
2968 @samp{Message} menus.
2969
2970 @table @kbd
2971 @kindex ?
2972 @findex mh-help
2973 @item ?
2974 Display cheat sheet for the MH-E commands (@code{mh-help}).
2975 @c -------------------------
2976 @kindex !
2977 @findex mh-refile-or-write-again
2978 @item !
2979 Repeat last output command (@code{mh-refile-or-write-again}).
2980 @c -------------------------
2981 @cindex @samp{Message > Copy Message to Folder...} menu item
2982 @cindex menu item, @samp{Message > Copy Message to Folder...}
2983 @kindex c
2984 @findex mh-copy-msg
2985 @item c
2986 Copy range to folder (@code{mh-copy-msg}).
2987 @c -------------------------
2988 @kindex F ?
2989 @findex mh-prefix-help
2990 @item F ?
2991 Display cheat sheet for the commands of the current prefix in
2992 minibuffer (@code{mh-prefix-help}).
2993 @c -------------------------
2994 @kindex F '
2995 @findex mh-index-ticked-messages
2996 @item F '
2997 Display ticked messages (@code{mh-index-ticked-messages}).
2998 @c -------------------------
2999 @kindex F c
3000 @findex mh-catchup
3001 @item F c
3002 Delete range from the @samp{unseen} sequence (@code{mh-catchup}).
3003 @c -------------------------
3004 @kindex F k
3005 @findex mh-kill-folder
3006 @item F k
3007 Remove folder (@code{mh-kill-folder}).
3008 @c -------------------------
3009 @cindex @samp{Folder > List Folders} menu item
3010 @cindex menu item, @samp{Folder > List Folders}
3011 @kindex F l
3012 @findex mh-list-folders
3013 @item F l
3014 List all folders (@code{mh-list-folders}).
3015 @c -------------------------
3016 @cindex @samp{Folder > View New Messages} menu item
3017 @cindex menu item, @samp{Folder > View New Messages}
3018 @kindex F n
3019 @findex mh-index-new-messages
3020 @item F n
3021 Display unseen messages (@code{mh-index-new-messages}).
3022 @c -------------------------
3023 @cindex @samp{Folder > Pack Folder} menu item
3024 @cindex menu item, @samp{Folder > Pack Folder}
3025 @kindex F p
3026 @findex mh-pack-folder
3027 @item F p
3028 Pack folder (@code{mh-pack-folder}).
3029 @c -------------------------
3030 @kindex F q
3031 @findex mh-index-sequenced-messages
3032 @item F q
3033 Display messages in any sequence (@code{mh-index-sequenced-messages}).
3034 @c -------------------------
3035 @cindex @samp{Folder > Rescan Folder} menu item
3036 @cindex menu item, @samp{Folder > Rescan Folder}
3037 @kindex F r
3038 @findex mh-rescan-folder
3039 @item F r
3040 Rescan folder (@code{mh-rescan-folder}).
3041 @c -------------------------
3042 @cindex @samp{Folder > Search...} menu item
3043 @cindex menu item, @samp{Folder > Search...}
3044 @kindex F s
3045 @findex mh-search
3046 @item F s
3047 Search your MH mail (@code{mh-search}).
3048 @c -------------------------
3049 @cindex @samp{Folder > Sort Folder} menu item
3050 @cindex menu item, @samp{Folder > Sort Folder}
3051 @kindex F S
3052 @findex mh-sort-folder
3053 @item F S
3054 Sort folder (@code{mh-sort-folder}).
3055 @c -------------------------
3056 @kindex F u
3057 @findex mh-undo-folder
3058 @item F u
3059 Undo all refiles and deletes in the current folder (@code{mh-undo-folder}).
3060 @c -------------------------
3061 @cindex @samp{Folder > Visit a Folder...} menu item
3062 @cindex menu item, @samp{Folder > Visit a Folder...}
3063 @kindex F v
3064 @findex mh-visit-folder
3065 @item F v
3066 Visit folder (@code{mh-visit-folder}).
3067 @c -------------------------
3068 @cindex @samp{Message > Refile Message} menu item
3069 @cindex menu item, @samp{Message > Refile Message}
3070 @kindex o
3071 @findex mh-refile-msg
3072 @item o
3073 Refile (output) range into folder (@code{mh-refile-msg}).
3074 @c -------------------------
3075 @cindex @samp{Folder > Quit MH-E} menu item
3076 @cindex menu item, @samp{Folder > Quit MH-E}
3077 @kindex q
3078 @findex mh-quit
3079 @item q
3080 Quit the current MH-E folder (@code{mh-quit}).
3081 @c -------------------------
3082 @cindex @samp{Folder > Toggle Show/Folder} menu item
3083 @cindex menu item, @samp{Folder > Toggle Show/Folder}
3084 @kindex t
3085 @findex mh-toggle-showing
3086 @item t
3087 Toggle between MH-Folder and MH-Folder Show modes
3088 (@code{mh-toggle-showing}).
3089 @c -------------------------
3090 @cindex @samp{Message > Undo Delete/Refile} menu item
3091 @cindex menu item, @samp{Message > Undo Delete/Refile}
3092 @kindex u
3093 @findex mh-undo
3094 @item u
3095 Undo pending deletes or refiles in range (@code{mh-undo}).
3096 @c -------------------------
3097 @cindex @samp{Message > Execute Delete/Refile} menu item
3098 @cindex menu item, @samp{Message > Execute Delete/Refile}
3099 @kindex x
3100 @findex mh-execute-commands
3101 @item x
3102 Process outstanding delete and refile requests
3103 (@code{mh-execute-commands}).
3104 @end table
3105
3106 @cindex @samp{mh-folder} customization group
3107 @cindex customization group, @samp{mh-folder}
3108
3109 The @samp{mh-folder} customization group is used to tune these
3110 commands.
3111
3112 @vtable @code
3113 @item mh-new-messages-folders
3114 Folders searched for the @samp{unseen} sequence (default:
3115 @code{Inbox}).
3116 @c -------------------------
3117 @item mh-ticked-messages-folders
3118 Folders searched for @code{mh-tick-seq} (default: @code{t}).
3119 @c -------------------------
3120 @item mh-large-folder
3121 The number of messages that indicates a large folder (default: 200).
3122 @c -------------------------
3123 @item mh-recenter-summary-flag
3124 On means to recenter the summary window (default: @samp{off}).
3125 @c -------------------------
3126 @item mh-recursive-folders-flag
3127 On means that commands which operate on folders do so recursively
3128 (default: @samp{off}).
3129 @c -------------------------
3130 @item mh-sortm-args
3131 Additional arguments for @command{sortm} (default: @code{nil}).
3132 @end vtable
3133
3134 The following hooks are available.
3135
3136 @vtable @code
3137 @item mh-after-commands-processed-hook
3138 Hook run by @kbd{x} after performing outstanding refile and delete
3139 requests (default: @code{nil}).
3140 @c -------------------------
3141 @item mh-before-commands-processed-hook
3142 Hook run by @kbd{x} before performing outstanding refile and delete
3143 requests (default: @code{nil}).
3144 @c -------------------------
3145 @item mh-before-quit-hook
3146 Hook run by q before quitting MH-E (default: @code{nil}).
3147 @c -------------------------
3148 @item mh-folder-mode-hook
3149 Hook run by @code{mh-folder-mode} when visiting a new folder (default:
3150 @code{nil}).
3151 @c -------------------------
3152 @item mh-kill-folder-suppress-prompt-hook
3153 Abnormal hook run at the beginning of @code{mh-kill-folder} (default:
3154 @code{'mh-search-p}).
3155 @c -------------------------
3156 @item mh-quit-hook
3157 Hook run by q after quitting MH-E (default: @code{nil}).
3158 @c -------------------------
3159 @item mh-refile-msg-hook
3160 Hook run by o after marking each message for refiling (default:
3161 @code{nil}).
3162 @end vtable
3163
3164 The following faces are available for customizing the appearance of
3165 the MH-Folder buffer. @xref{Scan Line Formats}.
3166
3167 @vtable @code
3168 @item mh-folder-address
3169 Recipient face.
3170 @c -------------------------
3171 @item mh-folder-body
3172 Body text face.
3173 @c -------------------------
3174 @item mh-folder-cur-msg-number
3175 Current message number face.
3176 @c -------------------------
3177 @item mh-folder-date
3178 Date face.
3179 @c -------------------------
3180 @item mh-folder-deleted
3181 Deleted message face.
3182 @c -------------------------
3183 @item mh-folder-followup
3184 @samp{Re:} face.
3185 @c -------------------------
3186 @item mh-folder-msg-number
3187 Message number face.
3188 @c -------------------------
3189 @item mh-folder-refiled
3190 Refiled message face.
3191 @c -------------------------
3192 @vindex mh-scan-format-nmh
3193 @vindex mh-scan-sent-to-me-sender-regexp
3194 @item mh-folder-sent-to-me-hint
3195 Fontification hint face in messages sent directly to us. The detection
3196 of messages sent to us is governed by the scan format
3197 @code{mh-scan-format-nmh} and regular expression
3198 @code{mh-scan-sent-to-me-sender-regexp}.
3199 @c -------------------------
3200 @vindex mh-scan-format-nmh
3201 @vindex mh-scan-sent-to-me-sender-regexp
3202 @item mh-folder-scan-format
3203 Sender face in messages sent directly to us. The detection of messages
3204 sent to us is governed by the scan format @code{mh-scan-format-nmh}
3205 and regular expression @code{mh-scan-sent-to-me-sender-regexp}.
3206 @c -------------------------
3207 @item mh-folder-subject
3208 Subject face.
3209 @c -------------------------
3210 @item mh-folder-tick
3211 Ticked message face.
3212 @c -------------------------
3213 @item mh-folder-to
3214 @samp{To:} face.
3215 @end vtable
3216
3217 The hook @code{mh-folder-mode-hook} is called when visiting a new
3218 folder in MH-Folder mode. This could be used to set your own key
3219 bindings, for example:
3220
3221 @vindex mh-folder-mode-hook, example
3222
3223 @smalllisp
3224 @group
3225 (defvar my-mh-init-done nil
3226 "Non-@code{nil} when one-time MH-E settings made.")
3227
3228 (defun my-mh-folder-mode-hook ()
3229 "Hook to set key bindings in MH-Folder mode."
3230 (if (not my-mh-init-done) ; @r{only need to bind the keys once }
3231 (progn
3232 (local-set-key "//" 'my-search-msg)
3233 (local-set-key "b" 'mh-burst-digest) ; @r{better use of @kbd{b}}
3234 (setq my-mh-init-done t))))
3235
3236 (add-hook 'mh-folder-mode-hook 'my-mh-folder-mode-hook)
3237
3238 (defun my-search-msg ()
3239 "Search for a regexp in the current message."
3240 (interactive) ; @r{user function}
3241 (save-window-excursion
3242 (other-window 1) ; @r{go to next window}
3243 (isearch-forward-regexp))) ; @r{string search; hit return}
3244 ; @r{ when done}
3245
3246 @i{Create additional key bindings via mh-folder-mode-hook}
3247
3248 @end group
3249 @end smalllisp
3250
3251 @cindex @command{folder}
3252 @cindex @command{refile}
3253 @cindex MH commands, @command{folder}
3254 @cindex MH commands, @command{refile}
3255 @findex mh-refile-msg
3256 @kindex o
3257 @vindex mh-refile-msg-hook
3258
3259 MH-E has analogies for each of the MH @command{folder} and
3260 @command{refile} commands@footnote{See the sections
3261 @uref{@value{MH-BOOK-HOME}/fol.htm#Youfol, Your Current Folder:
3262 folder} and @uref{@value{MH-BOOK-HOME}/fol.htm#Movref, Moving and
3263 Linking Messages: refile} in the MH book.}. To refile a message in
3264 another folder, use the command @kbd{o} (@code{mh-refile-msg})
3265 (mnemonic: ``output''). You are prompted for the folder name
3266 (@pxref{Folder Selection}). Note that this command can also be used to
3267 create folders. If you specify a folder that does not exist, you will
3268 be prompted to create it. The hook @code{mh-refile-msg-hook} is called
3269 after a message is marked to be refiled.
3270
3271 If you are refiling several messages into the same folder, you can use
3272 the command @kbd{!} (@code{mh-refile-or-write-again}) to repeat the
3273 last refile or write (see the description of @kbd{>}
3274 (@code{mh-write-msg-to-file} in @ref{Files and Pipes}). You can use a
3275 range in either case (for example, @kbd{C-u o 1 3 5-7 last:5 frombob
3276 @key{RET}}, @pxref{Ranges}).
3277
3278 @cindex expunging refiles and deletes
3279 @cindex undoing refiles and deletes
3280
3281 If you've deleted a message or refiled it, but changed your mind, you
3282 can cancel the action before you've executed it. Use @kbd{u}
3283 (@code{mh-undo}) to undo a refile on or deletion of a single message.
3284 You can also undo refiles and deletes for messages that are found in a
3285 given range (@pxref{Ranges}).
3286
3287 Alternatively, you can use @kbd{F u} (@code{mh-undo-folder}) to undo
3288 all refiles and deletes in the current folder.
3289
3290 If you've marked messages to be deleted or refiled and you want to go
3291 ahead and delete or refile the messages, use @kbd{x}
3292 (@code{mh-execute-commands}). Many MH-E commands that may affect the
3293 numbering of the messages (such as @kbd{F r} or @kbd{F p}) will ask if
3294 you want to process refiles or deletes first and then either run
3295 @kbd{x} for you or undo the pending refiles and deletes, which are
3296 lost.
3297
3298 The command @kbd{x} runs @code{mh-before-commands-processed-hook}
3299 before the commands are processed and
3300 @code{mh-after-commands-processed-hook} after the commands are
3301 processed. Variables that are useful with the former hook include
3302 @code{mh-delete-list} and @code{mh-refile-list} which can be used to
3303 see which changes will be made to the current folder,
3304 @code{mh-current-folder}. Variables that are useful with the latter
3305 hook include @code{mh-folders-changed}, which lists which folders were
3306 affected by deletes and refiles. This list will always include the
3307 current folder @code{mh-current-folder}.
3308
3309 If you wish to copy a message to another folder, you can use the
3310 command @kbd{c} (@code{mh-copy-msg}) (see the @option{-link} argument
3311 to @command{refile}(1)). Like the command @kbd{o}, this command
3312 prompts you for the name of the target folder and you can specify a
3313 range (@pxref{Ranges}). Note that unlike the command @kbd{o}, the copy
3314 takes place immediately. The original copy remains in the current
3315 folder.
3316
3317 @cindex MH-Folder Show mode
3318 @cindex MH-Folder mode
3319 @cindex junk mail
3320 @cindex modes, MH-Folder
3321 @cindex modes, MH-Folder Show
3322 @cindex spam
3323
3324 The command @kbd{t} (@code{mh-toggle-showing}) switches between
3325 MH-Folder mode and MH-Folder Show mode@footnote{For you Emacs wizards,
3326 this is implemented as an Emacs minor mode.}. MH-Folder mode turns off
3327 the associated show buffer so that you can perform operations on the
3328 messages quickly without reading them. This is an excellent way to
3329 prune out your junk mail or to refile a group of messages to another
3330 folder for later examination.
3331
3332 @cindex MH-Folder mode
3333 @cindex MH-Show mode
3334 @cindex modes, MH-Folder
3335 @cindex modes, MH-Show
3336 @cindex moving between messages
3337 @vindex mh-recenter-summary-flag
3338
3339 When you use @kbd{t} to toggle between show mode and scan mode, the
3340 MH-Show buffer is hidden and the MH-Folder buffer is left alone.
3341 Setting @code{mh-recenter-summary-flag} to a non-@code{nil} value
3342 causes the toggle to display as many scan lines as possible, with the
3343 cursor at the middle. The effect of @code{mh-recenter-summary-flag} is
3344 rather useful, but it can be annoying on a slow network connection.
3345
3346 When you want to read the messages that you have refiled into folders,
3347 use the command @kbd{F v} (@code{mh-visit-folder}) to visit the
3348 folder. You are prompted for the folder name. The folder buffer will
3349 show just unseen messages if there are any; otherwise, it will show
3350 all the messages in the buffer as long there are fewer than
3351 @code{mh-large-folder} messages. If there are more, then you are
3352 prompted for a range of messages to scan. You can provide a prefix
3353 argument in order to specify a range of messages to show when you
3354 visit the folder (@pxref{Ranges}). In this case, regions are not used
3355 to specify the range and @code{mh-large-folder} is ignored. Note that
3356 this command can also be used to create folders. If you specify a
3357 folder that does not exist, you will be prompted to create it.
3358
3359 If you forget where you've refiled your messages, you can find them
3360 using @kbd{F s} (@code{mh-search}). @xref{Searching}.
3361
3362 @cindex @command{procmail}
3363 @cindex @command{rcvstore}
3364 @cindex @samp{unseen} sequence
3365 @cindex MH commands, @command{rcvstore}
3366 @cindex Unix commands, @command{procmail}
3367 @cindex sequence, @samp{unseen}
3368 @cindex unseen messages, viewing
3369 @findex mh-index-new-messages
3370 @kindex F n
3371 @vindex mh-new-messages-folders
3372
3373 If you use a program such as @command{procmail} to use
3374 @command{rcvstore} to file your incoming mail automatically, you can
3375 display new, unseen, messages using the command @kbd{F n}
3376 (@code{mh-index-new-messages}). All messages in the @samp{unseen}
3377 sequence from the folders in @code{mh-new-messages-folders} are
3378 listed. However, this list of folders can be overridden with a prefix
3379 argument: with a prefix argument, enter a space-separated list of
3380 folders, or nothing to search all folders.
3381
3382 @cindex @samp{tick} sequence
3383 @cindex sequence, @samp{tick}
3384 @cindex ticked messages, viewing
3385
3386 If you have ticked messages (@pxref{Sequences}), you can display them
3387 using the command @kbd{F '} (@code{mh-index-ticked-messages}). All
3388 messages in the @samp{tick} sequence from the folders in
3389 @code{mh-ticked-messages-folders} are listed. With a prefix argument,
3390 enter a space-separated list of folders, or nothing to search all
3391 folders.
3392
3393 @findex mh-index-sequenced-messages
3394 @kindex F q
3395 @vindex mh-new-messages-folders
3396
3397 You can display messages in any sequence with the command @kbd{F q}
3398 (@code{mh-index-sequenced-messages}). All messages from the folders in
3399 @code{mh-new-messages-folders} in the sequence you provide are listed.
3400 With a prefix argument, enter a space-separated list of folders at the
3401 prompt, or nothing to search all folders.
3402
3403 Set the options @code{mh-new-messages-folders} and
3404 @code{mh-ticked-messages-folders} to @samp{Inbox} to search the
3405 @samp{+inbox} folder or @samp{All} to search all of the top level
3406 folders. Otherwise, list the folders that should be searched with the
3407 @samp{Choose Folders} menu item. See @code{mh-recursive-folders-flag}.
3408
3409 @cindex @samp{*MH-E Folders*}
3410 @cindex buffers, @samp{*MH-E Folders*}
3411
3412 Other commands you can perform on folders include: @kbd{F l}
3413 (@code{mh-list-folders}), to place a listing of all the folders in
3414 your mail directory in a buffer called @samp{*MH-E Folders*}
3415 (@pxref{Miscellaneous}); @kbd{F k} (@code{mh-kill-folder}), to remove
3416 a folder; @kbd{F S} (@code{mh-sort-folder}), to sort the messages by
3417 date (see @command{sortm}(1) to see how to sort by other criteria);
3418 @kbd{F p} (@code{mh-pack-folder}), to pack a folder, removing gaps
3419 from the numbering sequence; and @kbd{F r} (@code{mh-rescan-folder}),
3420 to rescan the folder, which is useful to grab all messages in your
3421 @samp{+inbox} after processing your new mail for the first time. If
3422 you don't want to rescan the entire folder, the commands @kbd{F r} or
3423 @kbd{F p} will accept a range (@pxref{Ranges}).
3424
3425 By default, operations on folders work only one level at a time. Set
3426 @code{mh-recursive-folders-flag} to non-@code{nil} to operate on all
3427 folders. This mostly means that you'll be able to see all your folders
3428 when you press @key{TAB} when prompted for a folder name.
3429
3430 @vindex mh-kill-folder-suppress-prompt-hooks
3431
3432 The hook @code{mh-kill-folder-suppress-prompt-hooks} is an abnormal
3433 hook run at the beginning of the command @kbd{k}. The hook functions
3434 are called with no arguments and should return a non-nil value to
3435 suppress the normal prompt when you remove a folder. This is useful
3436 for folders that are easily regenerated. The default value of
3437 @code{mh-search-p} suppresses the prompt on folders generated by
3438 searching.
3439
3440 @sp 1
3441 @center @strong{NOTE}
3442
3443 @quotation
3444 Use this hook with care. If there is a bug in your hook which returns
3445 @code{t} on @samp{+inbox} and you hit @kbd{k} by accident in the
3446 @code{+inbox} folder, you will not be happy.
3447 @end quotation
3448 @sp 1
3449
3450 @cindex @command{sortm}
3451 @cindex @file{.mh_profile}
3452 @cindex @samp{sortm:} MH profile component
3453 @cindex MH commands, @command{sortm}
3454 @cindex MH profile component, @samp{sortm:}
3455 @cindex files, @file{.mh_profile}
3456
3457 The option @code{mh-sortm-args} holds extra arguments to pass on to
3458 the command @command{sortm}@footnote{See the section
3459 @uref{@value{MH-BOOK-HOME}/sorsor.htm, Sorting Messages: sortm} in the
3460 MH book.} when a prefix argument is used with @kbd{F S}. Normally
3461 default arguments to @command{sortm} are specified in the MH profile.
3462 This option may be used to provide an alternate view. For example,
3463 @samp{'(\"-nolimit\" \"-textfield\" \"subject\")} is a useful setting.
3464
3465 @cindex exiting
3466 @cindex quitting
3467 @findex mh-rmail
3468
3469 When you want to quit using MH-E and go back to editing, you can use
3470 the @kbd{q} (@code{mh-quit}) command. This buries the buffers of the
3471 current MH-E folder and restores the buffers that were present when
3472 you first ran @kbd{M-x mh-rmail}. It also removes any MH-E working
3473 buffers whose name begins with @samp{ *mh-} or @samp{*MH-E }
3474 (@pxref{Miscellaneous}). You can later restore your MH-E session by
3475 selecting the @samp{+inbox} buffer or by running @kbd{M-x mh-rmail}
3476 again.
3477
3478 @vindex mh-before-quit-hook
3479 @vindex mh-quit-hook
3480
3481 The two hooks @code{mh-before-quit-hook} and @code{mh-quit-hook} are
3482 called by @kbd{q} (@code{mh-quit}). The former one is called before
3483 the quit occurs, so you might use it to perform any MH-E operations;
3484 you could perform some query and abort the quit or call
3485 @code{mh-execute-commands}, for example. The latter is not run in an
3486 MH-E context, so you might use it to modify the window setup. For
3487 example, if the window configuration was saved as in the example in
3488 @ref{Miscellaneous Commands and Options}, you would also want to set
3489 @code{mh-quit-hook} to the following:
3490
3491 @c XXX Replace this with my example for killing the mail buffers.
3492
3493 @vindex mh-quit-hook, example
3494
3495 @smalllisp
3496 @group
3497 (defun my-mh-quit-hook ()
3498 "Clear window configuration variables as the MH window is gone."
3499 (setq my-mh-screen-saved nil)
3500 (setq my-mh-screen nil)
3501 (if my-normal-screen
3502 (set-window-configuration my-normal-screen))
3503 (setq my-normal-screen nil))
3504
3505 @i{Clean up window setup in mh-quit-hook}
3506 @end group
3507 @end smalllisp
3508
3509 @cindex folders, renaming
3510 @cindex renaming folders
3511 @findex dired-do-rename
3512 @kindex R
3513
3514 You can use dired to manipulate the folders themselves. For example, I
3515 renamed my @samp{+out} folder to the more common @samp{+outbox} by
3516 running dired on my mail directory (@kbd{M-x dired RET ~/Mail RET}),
3517 moving my cursor to @samp{out} and using the command @kbd{R}
3518 (@code{dired-do-rename}).
3519
3520 @node Sending Mail, Editing Drafts, Folders, Top
3521 @chapter Sending Mail
3522
3523 @cindex sending mail
3524 @findex mh-smail
3525
3526 You can send a mail message in several ways. You can call @kbd{M-x
3527 mh-smail} directly, or from the command line like this:
3528
3529 @cindex starting from command line
3530
3531 @example
3532 $ @kbd{emacs -f mh-smail}
3533 @end example
3534
3535 @findex goto-address-at-point
3536 @vindex mail-user-agent
3537
3538 There are some commands that need to send a mail message, such as
3539 @code{goto-address-at-point}. You can configure Emacs to have these
3540 commands use MH-E by setting the option @code{mail-user-agent} to
3541 @samp{Emacs interface to MH}.
3542
3543 From within MH-E's MH-Folder mode, other methods of sending mail are
3544 available as well. These can also be found in the @samp{Message} menu.
3545
3546 @table @kbd
3547 @cindex @samp{Message > Edit Message Again} menu item
3548 @cindex menu item, @samp{Message > Edit Message Again}
3549 @kindex e
3550 @findex mh-edit-again
3551 @item e
3552 Edit a message to send it again (@code{mh-edit-again}).
3553 @c -------------------------
3554 @cindex @samp{Message > Re-edit a Bounced Message} menu item
3555 @cindex menu item, @samp{Message > Re-edit a Bounced Message}
3556 @kindex E
3557 @findex mh-extract-rejected-mail
3558 @item E
3559 Edit a message that was returned by the mail system
3560 (@code{mh-extract-rejected-mail}).
3561 @c -------------------------
3562 @cindex @samp{Message > Forward Message...} menu item
3563 @cindex menu item, @samp{Message > Forward Message...}
3564 @kindex f
3565 @findex mh-forward
3566 @item f
3567 Forward message (@code{mh-forward}).
3568 @c -------------------------
3569 @cindex @samp{Message > Reply to Message...} menu item
3570 @cindex menu item, @samp{Message > Reply to Message...}
3571 @kindex r
3572 @findex mh-reply
3573 @item r
3574 Reply to a message (@code{mh-reply}).
3575 @c -------------------------
3576 @cindex @samp{Message > Compose a New Message} menu item
3577 @cindex menu item, @samp{Message > Compose a New Message}
3578 @kindex s
3579 @findex mh-send
3580 @item s
3581 Compose a message (@code{mh-send}).
3582 @c -------------------------
3583 @cindex @samp{Message > Redistribute Message...} menu item
3584 @cindex menu item, @samp{Message > Redistribute Message...}
3585 @kindex M-d
3586 @findex mh-redistribute
3587 @item M-d
3588 Redistribute a message (@code{mh-redistribute}).
3589 @c -------------------------
3590 @findex mh-smail
3591 @item M-x mh-smail
3592 Compose a message with the MH mail system.
3593 @c -------------------------
3594 @findex mh-smail-other-window
3595 @item M-x mh-smail-other-window
3596 Compose a message with the MH mail system in other window.
3597 @end table
3598
3599 @cindex @samp{mh-sending-mail} customization group
3600 @cindex customization group, @samp{mh-sending-mail}
3601
3602 In addition, several options from the @samp{mh-sending-mail}
3603 customization group are useful when sending mail or replying to mail.
3604 They are summarized in the following table.
3605
3606 @vtable @code
3607 @item mh-compose-forward-as-mime-flag
3608 On means that messages are forwarded as attachments (default:
3609 @samp{on}).
3610 @c -------------------------
3611 @item mh-compose-letter-function
3612 Hook run when starting a new draft (default: @code{nil}).
3613 @c -------------------------
3614 @item mh-compose-prompt-flag
3615 On means prompt for header fields when composing a new draft (default:
3616 @samp{off}).
3617 @c -------------------------
3618 @item mh-forward-subject-format
3619 Format string for forwarded message subject (default: @samp{"%s:
3620 %s"}).
3621 @c -------------------------
3622 @item mh-insert-x-mailer-flag
3623 On means append an @samp{X-Mailer:} header field to the header
3624 (default: @samp{on}).
3625 @c -------------------------
3626 @item mh-redist-full-contents-flag
3627 On means the @command{dist} command needs entire letter for
3628 redistribution (default: @samp{off}).
3629 @c -------------------------
3630 @item mh-reply-default-reply-to
3631 Sets the person or persons to whom a reply will be sent (default:
3632 @samp{Prompt}).
3633 @c -------------------------
3634 @item mh-reply-show-message-flag
3635 On means the MH-Show buffer is displayed using @kbd{r}
3636 (@code{mh-reply}) (default: @samp{on}).
3637 @end vtable
3638
3639 The following hooks are available.
3640
3641 @vtable @code
3642 @item mh-forward-hook
3643 Hook run by @code{mh-forward} on a forwarded letter (default:
3644 @code{nil}).
3645 @c -------------------------
3646 @item mh-letter-mode-hook
3647 Hook run by @code{mh-letter-mode} on a new letter (default:
3648 @code{nil}).
3649 @end vtable
3650
3651 The functions and options introduced here are explained in more detail
3652 in the following sections.
3653
3654 @menu
3655 * Composing::
3656 * Replying::
3657 * Forwarding::
3658 * Redistributing::
3659 * Editing Again::
3660 @end menu
3661
3662 @node Composing, Replying, Sending Mail, Sending Mail
3663 @section Composing
3664
3665 @cindex @file{.emacs}
3666 @cindex MH-Folder mode
3667 @cindex composing mail
3668 @cindex draft
3669 @cindex files, @file{.emacs}
3670 @cindex modes, MH-Folder
3671 @cindex sending mail
3672 @findex mh-smail
3673 @findex mh-smail-other-window
3674
3675 Outside of an MH-Folder buffer, you must call either @kbd{M-x
3676 mh-smail} or @kbd{M-x mh-smail-other-window} to compose a new message.
3677 The former command always creates a two-window layout with the current
3678 buffer on top and the draft on the bottom. Use the latter command if
3679 you would rather preserve the window layout. You may find adding the
3680 following key bindings to @file{~/.emacs} useful:
3681
3682 @smalllisp
3683 (global-set-key "\C-xm" 'mh-smail)
3684 (global-set-key "\C-x4m" 'mh-smail-other-window)
3685 @end smalllisp
3686
3687 @cindex MH-Letter mode
3688 @cindex draft folder
3689 @cindex modes, MH-Letter
3690 @findex mh-send
3691 @kindex m
3692
3693 From within a MH-Folder buffer, you can simply use the command @kbd{m}
3694 (@code{mh-send}). However you invoke @code{mh-send}, your letter
3695 appears in an Emacs buffer whose mode is MH-Letter (see the Figure in
3696 @ref{Sending Mail Tour} to see what the buffer looks like). MH-Letter
3697 mode allows you to edit your message, to check the validity of the
3698 recipients, to insert attachments and other messages into your
3699 message, and to send the message. We'll go more into depth about
3700 editing a @dfn{draft}@footnote{I highly recommend that you use a
3701 @dfn{draft folder} so that you can edit several drafts in parallel. To
3702 do so, create a folder named @samp{+drafts} for example, and add the
3703 profile component @samp{Draft-Folder: drafts} (see
3704 @code{mh-profile}(5)).} (a message you're composing) in just a moment
3705 (@pxref{Editing Drafts}).
3706
3707 @vindex mh-compose-prompt-flag
3708
3709 If you prefer to be prompted for the recipient and subject fields
3710 before the MH-Letter buffer appears, turn on the option
3711 @code{mh-compose-prompt-flag}.
3712
3713 @cindex @samp{X-Mailer:} header field
3714 @cindex header field, @samp{X-Mailer:}
3715 @vindex mh-insert-x-mailer-flag
3716
3717 MH-E adds an @samp{X-Mailer:} header field to the header that includes
3718 the version of MH-E and Emacs that you are using. If you don't want to
3719 participate in our marketing, you can turn off the option
3720 @code{mh-insert-x-mailer-flag}.
3721
3722 @cindex @command{repl}
3723 @cindex @file{components}
3724 @cindex MH commands, @command{repl}
3725 @cindex Mail mode
3726 @cindex files, @file{components}
3727 @cindex modes, Mail
3728 @vindex mail-mode-hook
3729 @vindex mh-letter-mode-hook
3730 @vindex text-mode-hook
3731
3732 Two hooks are provided to run commands on your freshly created draft.
3733 The first hook, @code{mh-letter-mode-hook}, allows you to do some
3734 processing before editing a letter@footnote{Actually, because
3735 MH-Letter mode inherits from Mail mode, the hooks
3736 @code{text-mode-hook} and @code{mail-mode-hook} are run (in that
3737 order) before @code{mh-letter-mode-hook}.}. For example, you may wish
3738 to modify the header after @command{repl} has done its work, or you
3739 may have a complicated @file{components} file and need to tell MH-E
3740 where the cursor should go. Here's an example of how you would use
3741 this hook. You can add the hook using @code{add-hook} or by running
3742 @kbd{M-x customize-option @key{RET} mh-letter-mode-hook
3743 @key{RET}}---all of the other hooks are set in a similar fashion.
3744
3745 @findex mh-insert-signature, example
3746
3747 @smalllisp
3748 @group
3749 (defvar letter-mode-init-done-flag nil
3750 "Non-nil means one-time MH-E settings have been made.")
3751
3752 (defun my-mh-letter-mode-hook ()
3753 "Prepare letter for editing."
3754 (when (not letter-mode-init-done) ; @r{only need to bind the keys once}
3755 (local-set-key "\C-ctb" 'add-enriched-text)
3756 (local-set-key "\C-cti" 'add-enriched-text)
3757 (local-set-key "\C-ctf" 'add-enriched-text)
3758 (local-set-key "\C-cts" 'add-enriched-text)
3759 (local-set-key "\C-ctB" 'add-enriched-text)
3760 (local-set-key "\C-ctu" 'add-enriched-text)
3761 (local-set-key "\C-ctc" 'add-enriched-text)
3762 (setq letter-mode-init-done t))
3763 (save-excursion
3764 (goto-char (point-max)) ; @r{go to end of message to}
3765 (mh-insert-signature))) ; @r{insert signature}
3766
3767 (add-hook 'mh-letter-mode-hook 'my-mh-letter-mode-hook)
3768
3769 @i{Prepare draft for editing via mh-letter-mode-hook}
3770
3771 @end group
3772 @end smalllisp
3773
3774 The function, @code{add-enriched-text} is defined in the example in
3775 @ref{Adding Attachments}.
3776
3777 @vindex mh-compose-letter-function
3778
3779 The second hook, a function really, is
3780 @code{mh-compose-letter-function}. Like @code{mh-letter-mode-hook}, it
3781 is called just before editing a new message; however, it is the last
3782 function called before you edit your message. The consequence of this
3783 is that you can write a function to write and send the message for
3784 you. This function is passed three arguments: the contents of the
3785 @samp{To:}, @samp{Subject:}, and @samp{Cc:} header fields.
3786
3787 @node Replying, Forwarding, Composing, Sending Mail
3788 @section Replying to Mail
3789
3790 @cindex @command{mhl}
3791 @cindex @file{mhl.reply}
3792 @cindex MH commands, @command{mhl}
3793 @cindex files, @file{mhl.reply}
3794 @cindex replying
3795 @findex mh-reply
3796 @kindex r
3797
3798 To compose a reply to a message, use the @kbd{r} (@code{mh-reply})
3799 command.
3800
3801 When you reply to a message, you are first prompted with @samp{Reply
3802 to whom?}. You have several choices here.
3803
3804 @smallexample
3805 @group
3806 @b{Response} @b{Reply Goes To}
3807
3808 @kbd{from} @r{The person who sent the message. This is the default,}
3809 @r{so @key{RET} is sufficient.}
3810
3811 @kbd{to} @r{Replies to the sender, plus all recipients in the}
3812 @r{@samp{To:} header field.}
3813
3814 @kbd{all}
3815 @kbd{cc} @r{Forms a reply to the sender, plus all recipients.}
3816 @end group
3817 @end smallexample
3818
3819 @cindex @command{repl}
3820 @cindex MH commands, @command{repl}
3821
3822 Depending on your answer, @command{repl}@footnote{See the section
3823 @uref{@value{MH-BOOK-HOME}/reprep.htm, Replying to Messages: repl} in
3824 the MH book.} is given a different argument to form your reply.
3825 Specifically, a choice of @kbd{from} or none at all runs @samp{repl
3826 -nocc all}, and a choice of @kbd{to} runs @samp{repl -cc to}. Finally,
3827 either @kbd{cc} or @kbd{all} runs @samp{repl -cc all -nocc me}.
3828
3829 @cindex MH-Letter mode
3830 @cindex MH-Show mode
3831 @cindex draft
3832 @cindex modes, MH-Letter
3833 @cindex modes, MH-Show
3834
3835 Two windows are then created. One window contains the message to which
3836 you are replying in an MH-Show buffer. Your draft, in MH-Letter mode
3837 (@pxref{Editing Drafts}), is in the other window.
3838
3839 If you supply a prefix argument (as in @kbd{C-u r}), the message you
3840 are replying to is inserted in your reply after having first been run
3841 through @command{mhl} with the format file @file{mhl.reply}. See
3842 @command{mhl}(1) or the section
3843 @uref{@value{MH-BOOK-HOME}/shomes.htm#Usisho, Using mhl} in the MH
3844 book to see how you can modify the default @file{mhl.reply} file.
3845
3846 @vindex mh-yank-behavior
3847
3848 Alternatively, you can customize the option @code{mh-yank-behavior}
3849 and choose one of its @samp{Automatically} variants to do the same
3850 thing. @xref{Inserting Letter}. If you do so, the prefix argument has
3851 no effect.
3852
3853 Another way to include the message automatically in your draft is to
3854 use @samp{repl: -filter repl.filter} in your MH profile.
3855
3856 If you include the message automatically, you can hide the MH-Show
3857 buffer by turning off the option @code{mh-reply-show-message-flag}.
3858
3859 If you wish to customize the header or other parts of the reply draft,
3860 please see @command{repl}(1) and @code{mh-format}(5).
3861
3862 @vindex mh-reply-default-reply-to
3863
3864 The @code{mh-reply-default-reply-to} option is set to @samp{Prompt} by
3865 default so that you are prompted for the recipient of a reply. If you
3866 find that most of the time that you specify @kbd{cc} when you reply to
3867 a message, set this option to @samp{cc}. Other choices include
3868 @samp{from}, @samp{to}, or @samp{all}. You can always edit the
3869 recipients in the draft.
3870
3871 @node Forwarding, Redistributing, Replying, Sending Mail
3872 @section Forwarding Mail
3873
3874 @cindex @command{forw}
3875 @cindex MH commands, @command{forw}
3876 @cindex draft
3877 @cindex forwarding
3878 @findex mh-forward
3879 @kindex f
3880 @vindex mh-forward-hook
3881
3882 To forward a message, use the @kbd{f} (@code{mh-forward}) command. You
3883 are prompted for the @samp{To:} and @samp{cc:} recipients. You are
3884 given a draft to edit that looks like it would if you had run the MH
3885 command @command{forw}@footnote{See the section
3886 @uref{@value{MH-BOOK-HOME}/forfor.htm, Forwarding Messages: forw} in
3887 the MH book.}. You can then add some text (@pxref{Editing Drafts}).
3888 You can forward several messages by using a range (@pxref{Ranges}).
3889 All of the messages in the range are inserted into your draft. The
3890 hook @code{mh-forward-hook} is called on the draft.
3891
3892 @cindex @file{.mh_profile}
3893 @cindex @samp{forw:} MH profile component
3894 @cindex MH profile component, @samp{forw:}
3895 @cindex files, @file{.mh_profile}
3896 @vindex mh-compose-forward-as-mime-flag
3897
3898 By default, the option @code{mh-compose-forward-as-mime-flag} is on
3899 which means that the forwarded messages are included as attachments.
3900 If you would prefer to forward your messages verbatim (as text,
3901 inline), then turn off this option. Forwarding messages verbatim works
3902 well for short, textual messages, but your recipient won't be able to
3903 view any non-textual attachments that were in the forwarded message.
3904 Be aware that if you have @samp{forw: -mime} in your MH profile, then
3905 forwarded messages will always be included as attachments regardless
3906 of the settings of @code{mh-compose-forward-as-mime-flag}.
3907
3908 @vindex mh-forward-subject-format
3909
3910 The format of the @samp{Subject:} header field for forwarded messages
3911 is controlled by the option @code{mh-forward-subject-format}. This
3912 option is a string which includes two escapes (@samp{%s}). The first
3913 @samp{%s} is replaced with the sender of the original message, and the
3914 second one is replaced with the original @samp{Subject:}. The default
3915 value of @samp{"%s: %s"} takes a message with the header:
3916
3917 @smallexample
3918 @group
3919 To: Bill Wohler <wohler@@stop.mail-abuse.org>
3920 Subject: Re: 49er football
3921 From: Greg DesBrisay <gd@@stop.mail-abuse.org>
3922 @end group
3923 @end smallexample
3924
3925 and creates a subject header field of:
3926
3927 @smallexample
3928 Subject: Greg DesBrisay: Re: 49er football
3929 @end smallexample
3930
3931 @node Redistributing, Editing Again, Forwarding, Sending Mail
3932 @section Redistributing Your Mail
3933
3934 @cindex @command{dist}
3935 @cindex MH commands, @command{dist}
3936 @cindex redistributing
3937 @findex mh-redistribute
3938 @kindex M-d
3939
3940 The command @kbd{M-d} (@code{mh-redistribute}) is similar in function
3941 to forwarding mail, but it does not allow you to edit the message, nor
3942 does it add your name to the @samp{From:} header field. It appears to
3943 the recipient as if the message had come from the original sender.
3944 When you run this command, you are prompted for the recipients.
3945
3946 For more information on redistributing messages, see
3947 @command{dist}(1). Also investigate the command @kbd{e}
3948 (@code{mh-edit-again}) for another way to redistribute messages
3949 (@pxref{Editing Again}).
3950
3951 @cindex @command{send}
3952 @cindex MH commands, @command{send}
3953 @vindex mh-redist-full-contents-flag
3954
3955 The option @code{mh-redist-full-contents-flag} must be turned on if
3956 @command{dist}@footnote{See the section
3957 @uref{@value{MH-BOOK-HOME}/disdis.htm, Distributing Messages with
3958 dist} in the MH book.} requires the whole letter for redistribution,
3959 which is the case if @command{send}@footnote{See the section
3960 @uref{@value{MH-BOOK-HOME}/sensen.htm, Sending Some Mail: comp send}
3961 in the MH book.} is compiled with the @sc{berk} option (which many
3962 people abhor). If you find that MH will not allow you to redistribute
3963 a message that has been redistributed before, turn off this option.
3964
3965 @node Editing Again, , Redistributing, Sending Mail
3966 @section Editing Old Drafts and Bounced Messages
3967
3968 @cindex @file{draft}
3969 @cindex files, @file{draft}
3970 @cindex re-editing drafts
3971 @findex mh-edit-again
3972 @kindex e
3973
3974 If you don't complete a draft for one reason or another, and if the
3975 draft buffer is no longer available, you can pick your draft up again
3976 with @kbd{e} (@code{mh-edit-again}). If you don't use a draft
3977 folder, your last @file{draft} file will be used. If you use draft
3978 folders, you'll need to visit the draft folder with @kbd{F v drafts
3979 @key{RET}}, use @kbd{n} to move to the appropriate message, and then
3980 use @kbd{e} to prepare the message for editing.
3981
3982 The @kbd{e} command can also be used to take messages that were sent
3983 to you and to send them to more people.
3984
3985 @cindex Mailer-Daemon
3986 @findex mh-extract-rejected-mail
3987 @kindex E
3988
3989 Don't use @kbd{e} to re-edit a message from a @i{Mailer-Daemon} who
3990 complained that your mail wasn't posted for some reason or another. In
3991 this case, use @kbd{E} (@code{mh-extract-rejected-mail}) to prepare
3992 the message for editing by removing the @i{Mailer-Daemon} envelope and
3993 unneeded header fields. Fix whatever addressing problem you had, and
3994 send the message again with @kbd{C-c C-c}.
3995
3996 @node Editing Drafts, Aliases, Sending Mail, Top
3997 @chapter Editing a Draft
3998
3999 @cindex MH-Letter mode
4000 @cindex draft
4001 @cindex editing draft
4002 @cindex modes, MH-Letter
4003
4004 When you edit a message that you want to send (called a @dfn{draft} in
4005 this case), the mode used is MH-Letter. This mode provides several
4006 commands in addition to the normal Emacs editing commands to help you
4007 edit your draft. These can also be found in the @samp{Letter} menu.
4008
4009 @table @kbd
4010 @kindex @key{SPC}
4011 @findex mh-letter-complete-or-space
4012 @item @key{SPC}
4013 Perform completion or insert space (@code{mh-letter-complete-or-space}).
4014 @c -------------------------
4015 @kindex M-@key{TAB}
4016 @findex mh-letter-complete
4017 @item M-@key{TAB}
4018 Perform completion on header field or word preceding point
4019 (@code{mh-letter-complete}).
4020 @c -------------------------
4021 @kindex , (comma)
4022 @findex mh-letter-confirm-address
4023 @item , (comma)
4024 Flash alias expansion (@code{mh-letter-confirm-address}).
4025 @c -------------------------
4026 @kindex @key{TAB}
4027 @findex mh-letter-next-header-field-or-indent
4028 @item @key{TAB}
4029 Cycle to next field (@code{mh-letter-next-header-field-or-indent}).
4030 @c -------------------------
4031 @kindex S-@key{TAB}
4032 @findex mh-letter-previous-header-field
4033 @item S-@key{TAB}
4034 Cycle to the previous header field
4035 (@code{mh-letter-previous-header-field}).
4036 @c -------------------------
4037 @kindex C-c ?
4038 @findex mh-help
4039 @item C-c ?
4040 Display cheat sheet for the MH-E commands (@code{mh-help}).
4041 @c -------------------------
4042 @cindex @samp{Letter > Send This Draft} menu item
4043 @cindex menu item, @samp{Letter > Send This Draft}
4044 @kindex C-c C-c
4045 @findex mh-send-letter
4046 @item C-c C-c
4047 Save draft and send message (@code{mh-send-letter}).
4048 @c -------------------------
4049 @kindex C-c C-d
4050 @findex mh-insert-identity
4051 @item C-c C-d
4052 Insert fields specified by the given identity
4053 (@code{mh-insert-identity}). @xref{Identities}.
4054 @c -------------------------
4055 @cindex @samp{Letter > Pull in All Compositions (MH)} menu item
4056 @cindex menu item, @samp{Letter > Pull in All Compositions (MH)}
4057 @kindex C-c C-e
4058 @findex mh-mh-to-mime
4059 @item C-c C-e
4060 Compose @sc{mime} message from MH-style directives
4061 (@code{mh-mh-to-mime}).
4062 @c -------------------------
4063 @kindex C-c C-f C-a
4064 @kindex C-c C-f a
4065 @findex mh-to-field
4066 @item C-c C-f C-a
4067 @itemx C-c C-f a
4068 Move to @samp{Mail-Reply-To:} header field (@code{mh-to-field}).
4069 @c -------------------------
4070 @kindex C-c C-f C-b
4071 @kindex C-c C-f b
4072 @item C-c C-f C-b
4073 @itemx C-c C-f b
4074 Move to @samp{Bcc:} header field (@code{mh-to-field}).
4075 @c -------------------------
4076 @kindex C-c C-f C-c
4077 @kindex C-c C-f c
4078 @item C-c C-f C-c
4079 @itemx C-c C-f c
4080 Move to @samp{Cc:} header field (@code{mh-to-field}).
4081 @c -------------------------
4082 @kindex C-c C-f C-d
4083 @kindex C-c C-f d
4084 @item C-c C-f C-d
4085 @itemx C-c C-f d
4086 Move to @samp{Dcc:} header field (@code{mh-to-field}).
4087 @c -------------------------
4088 @kindex C-c C-f C-f
4089 @kindex C-c C-f f
4090 @findex mh-to-fcc
4091 @item C-c C-f C-f
4092 @itemx C-c C-f f
4093 Move to @samp{Fcc:} header field (@code{mh-to-fcc}).
4094 @c -------------------------
4095 @kindex C-c C-f C-l
4096 @kindex C-c C-f l
4097 @item C-c C-f C-l
4098 @itemx C-c C-f l
4099 Move to @samp{Mail-Followup-To:} header field (@code{mh-to-field}).
4100 @c -------------------------
4101 @kindex C-c C-f C-m
4102 @kindex C-c C-f m
4103 @item C-c C-f C-m
4104 @itemx C-c C-f m
4105 Move to @samp{From:} header field (@code{mh-to-field}).
4106 @c -------------------------
4107 @kindex C-c C-f C-r
4108 @kindex C-c C-f r
4109 @item C-c C-f C-r
4110 @itemx C-c C-f r
4111 Move to @samp{Reply-To:} header field (@code{mh-to-field}).
4112 @c -------------------------
4113 @kindex C-c C-f C-s
4114 @kindex C-c C-f s
4115 @item C-c C-f C-s
4116 @itemx C-c C-f s
4117 Move to @samp{Subject:} header field (@code{mh-to-field}).
4118 @c -------------------------
4119 @kindex C-c C-f C-t
4120 @kindex C-c C-f t
4121 @item C-c C-f C-t
4122 @itemx C-c C-f t
4123 Move to @samp{To:} header field (@code{mh-to-field}).
4124 @c -------------------------
4125 @cindex @samp{Letter > Insert a Message...} menu item
4126 @cindex menu item, @samp{Letter > Insert a Message...}
4127 @kindex C-c C-i
4128 @findex mh-insert-letter
4129 @item C-c C-i
4130 Insert a message (@code{mh-insert-letter}).
4131 @c -------------------------
4132 @kindex C-c C-m C-e
4133 @findex mh-mml-secure-message-encrypt
4134 @item C-c C-m C-e
4135 Add tag to encrypt the message (@code{mh-mml-secure-message-encrypt}).
4136 @c -------------------------
4137 @cindex @samp{Letter > Compose Forward...} menu item
4138 @cindex menu item, @samp{Letter > Compose Forward...}
4139 @kindex C-c C-m C-f
4140 @kindex C-c C-m f
4141 @findex mh-compose-forward
4142 @item C-c C-m C-f
4143 @itemx C-c C-m f
4144 Add tag to forward a message (@code{mh-compose-forward}).
4145 @c -------------------------
4146 @cindex @samp{Letter > Compose Get File (MH)...} menu item
4147 @cindex menu item, @samp{Letter > Compose Get File (MH)...}
4148 @kindex C-c C-m C-g
4149 @kindex C-c C-m g
4150 @findex mh-mh-compose-anon-ftp
4151 @item C-c C-m C-g
4152 @itemx C-c C-m g
4153 Add tag to include anonymous ftp reference to a file
4154 (@code{mh-mh-compose-anon-ftp}).
4155 @c -------------------------
4156 @cindex @samp{Letter > Compose Insertion...} menu item
4157 @cindex menu item, @samp{Letter > Compose Insertion...}
4158 @kindex C-c C-m C-i
4159 @kindex C-c C-m i
4160 @findex mh-compose-insertion
4161 @item C-c C-m C-i
4162 @itemx C-c C-m i
4163 Add tag to include a file such as an image or sound
4164 (@code{mh-compose-insertion}).
4165 @c -------------------------
4166 @cindex @samp{Letter > Pull in All Compositions (MML)} menu item
4167 @cindex menu item, @samp{Letter > Pull in All Compositions (MML)}
4168 @kindex C-c C-m C-m
4169 @kindex C-c C-m m
4170 @findex mh-mml-to-mime
4171 @item C-c C-m C-m
4172 @itemx C-c C-m m
4173 Compose @sc{mime} message from MML tags (@code{mh-mml-to-mime}).
4174 @c -------------------------
4175 @kindex C-c C-m C-n
4176 @kindex C-c C-m n
4177 @findex mh-mml-unsecure-message
4178 @item C-c C-m C-n
4179 @itemx C-c C-m n
4180 Remove any secure message tags (@code{mh-mml-unsecure-message}).
4181 @c -------------------------
4182 @kindex C-c C-m C-s
4183 @findex mh-mml-secure-message-sign
4184 @item C-c C-m C-s
4185 Add tag to sign the message (@code{mh-mml-secure-message-sign}).
4186 @c -------------------------
4187 @cindex @samp{Letter > Compose Compressed tar (MH)...} menu item
4188 @cindex menu item, @samp{Letter > Compose Compressed tar (MH)...}
4189 @kindex C-c C-m C-t
4190 @kindex C-c C-m t
4191 @findex mh-mh-compose-external-compressed-tar
4192 @item C-c C-m C-t
4193 @itemx C-c C-m t
4194 Add tag to include anonymous ftp reference to a compressed tar file
4195 (@code{mh-mh-compose-external-compressed-tar}).
4196 @c -------------------------
4197 @cindex @samp{Letter > Revert to Non-MIME Edit (MH)} menu item
4198 @cindex menu item, @samp{Letter > Revert to Non-MIME Edit (MH)}
4199 @kindex C-c C-m C-u
4200 @kindex C-c C-m u
4201 @findex mh-mh-to-mime-undo
4202 @item C-c C-m C-u
4203 @itemx C-c C-m u
4204 Undo effects of @kbd{C-c C-e} (@code{mh-mh-to-mime-undo}).
4205 @c -------------------------
4206 @kindex C-c C-m C-x
4207 @kindex C-c C-m x
4208 @findex mh-mh-compose-external-type
4209 @item C-c C-m C-x
4210 @itemx C-c C-m x
4211 Add tag to refer to a remote file
4212 (@code{mh-mh-compose-external-type}).
4213 @c -------------------------
4214 @kindex C-c C-m e e
4215 @findex mh-mml-secure-message-encrypt
4216 @item C-c C-m e e
4217 Add tag to encrypt the message (@code{mh-mml-secure-message-encrypt}).
4218 @c -------------------------
4219 @kindex C-c C-m e s
4220 @findex mh-mml-secure-message-signencrypt
4221 @item C-c C-m e s
4222 Add tag to encrypt and sign the message@*
4223 (@code{mh-mml-secure-message-signencrypt}).
4224 @c -------------------------
4225 @kindex C-c C-m s e
4226 @findex mh-mml-secure-message-signencrypt
4227 @item C-c C-m s e
4228 Add tag to encrypt and sign the message@*
4229 (@code{mh-mml-secure-message-signencrypt}).
4230 @c -------------------------
4231 @kindex C-c C-m s s
4232 @findex mh-mml-secure-message-sign
4233 @item C-c C-m s s
4234 Add tag to sign the message (@code{mh-mml-secure-message-sign}).
4235 @c -------------------------
4236 @cindex @samp{Letter > Split Current Line} menu item
4237 @cindex menu item, @samp{Letter > Split Current Line}
4238 @kindex C-c C-o
4239 @findex mh-open-line
4240 @item C-c C-o
4241 Insert a newline and leave point before it (@code{mh-open-line}).
4242 @c -------------------------
4243 @cindex @samp{Letter > Kill This Draft} menu item
4244 @cindex menu item, @samp{Letter > Kill This Draft}
4245 @kindex C-c C-q
4246 @findex mh-fully-kill-draft
4247 @item C-c C-q
4248 Quit editing and delete draft message (@code{mh-fully-kill-draft}).
4249 @c -------------------------
4250 @cindex @samp{Letter > Insert Signature} menu item
4251 @cindex menu item, @samp{Letter > Insert Signature}
4252 @kindex C-c C-s
4253 @findex mh-insert-signature
4254 @item C-c C-s
4255 Insert signature in message (@code{mh-insert-signature}).
4256 @c -------------------------
4257 @kindex C-c C-t
4258 @findex mh-letter-toggle-header-field-display
4259 @item C-c C-t
4260 Toggle display of header field at point
4261 (@code{mh-letter-toggle-header-field-display}).
4262 @c -------------------------
4263 @cindex @samp{Letter > Check Recipient} menu item
4264 @cindex menu item, @samp{Letter > Check Recipient}
4265 @kindex C-c C-w
4266 @findex mh-check-whom
4267 @item C-c C-w
4268 Verify recipients, showing expansion of any aliases
4269 (@code{mh-check-whom}).
4270 @c -------------------------
4271 @cindex @samp{Letter > Yank Current Message} menu item
4272 @cindex menu item, @samp{Letter > Yank Current Message}
4273 @kindex C-c C-y
4274 @findex mh-yank-cur-msg
4275 @item C-c C-y
4276 Insert the current message into the draft buffer
4277 (@code{mh-yank-cur-msg}).
4278 @c -------------------------
4279 @kindex C-c M-d
4280 @findex mh-insert-auto-fields
4281 @item C-c M-d
4282 Insert custom fields if recipient is found in
4283 @code{mh-auto-fields-list} (@code{mh-insert-auto-fields}).
4284 @xref{Identities}.
4285 @end table
4286
4287 @cindex @samp{mh-letter} customization group
4288 @cindex customization group, @samp{mh-letter}
4289
4290 Several options from the @samp{mh-letter} customization group are used
4291 while editing a draft.
4292
4293 @vtable @code
4294 @item mh-compose-insertion
4295 Type of @sc{mime} message tags in messages (default: @samp{MML} if
4296 available; otherwise @samp{MH}).
4297 @c -------------------------
4298 @item mh-compose-skipped-header-fields
4299 List of header fields to skip over when navigating in draft (default:
4300 @code{'("From"} @code{"Organization"} @code{"References"}
4301 @code{"In-Reply-To"} @code{"X-Face"} @code{"Face"}
4302 @code{"X-Image-URL"} @code{"X-Mailer")}.
4303 @c -------------------------
4304 @item mh-compose-space-does-completion-flag
4305 On means @key{SPC} does completion in message header (default:
4306 @samp{off}).
4307 @c -------------------------
4308 @item mh-delete-yanked-msg-window-flag
4309 On means delete any window displaying the message (default: @samp{off}).
4310 @c -------------------------
4311 @item mh-extract-from-attribution-verb
4312 Verb to use for attribution when a message is yanked by @kbd{C-c C-y}
4313 (default: @samp{"wrote:"}).
4314 @c -------------------------
4315 @item mh-ins-buf-prefix
4316 String to put before each line of a yanked or inserted message
4317 (default: @samp{"> "}).
4318 @c -------------------------
4319 @item mh-letter-complete-function
4320 Function to call when completing outside of address or folder fields
4321 (default: @code{ispell-complete-word}).
4322 @c -------------------------
4323 @item mh-letter-fill-column
4324 Fill column to use in MH-Letter mode (default: 72).
4325 @c -------------------------
4326 @item mh-mml-method-default
4327 Default method to use in security tags (default: @samp{PGP (MIME)} if
4328 support for it is available; otherwise @samp{None}).
4329 @c -------------------------
4330 @item mh-signature-file-name
4331 Source of user's signature (default: @samp{"~/.signature"}).
4332 @c -------------------------
4333 @item mh-signature-separator-flag
4334 On means a signature separator should be inserted (default:
4335 @samp{on}).
4336 @c -------------------------
4337 @item mh-x-face-file
4338 File containing X-Face or Face header field to insert in outgoing mail.
4339 (default: @samp{"~/.face"}).
4340 @c -------------------------
4341 @item mh-yank-behavior
4342 Controls which part of a message is yanked by @kbd{C-c C-y} (default:
4343 @samp{Body With Attribution}).
4344 @end vtable
4345
4346 The following hooks are available.
4347
4348 @vtable @code
4349 @item mail-citation-hook
4350 Hook for modifying a citation just inserted in the mail buffer
4351 (default: @code{nil}).
4352 @c -------------------------
4353 @item mh-before-send-letter-hook
4354 Hook run at the beginning of the @kbd{C-c C-c} command (default:
4355 @samp{nil}).
4356 @c -------------------------
4357 @item mh-mh-to-mime-hook
4358 Hook run on the formatted letter by @kbd{C-c C-e} (default:
4359 @samp{nil}).
4360 @c -------------------------
4361 @item mh-insert-signature-hook
4362 Hook run by @kbd{C-c C-s} after signature has been inserted (default:
4363 @code{nil}).
4364 @end vtable
4365
4366 The following face is available.
4367
4368 @vtable @code
4369 @item mh-letter-header-field
4370 Editable header field value face in draft buffers.
4371 @end vtable
4372
4373 The commands and options introduced here are explained in more
4374 detail in the following sections.
4375
4376 @menu
4377 * Editing Message::
4378 * Inserting Letter::
4379 * Inserting Messages::
4380 * Signature::
4381 * Picture::
4382 * Adding Attachments::
4383 * Sending PGP::
4384 * Checking Recipients::
4385 * Sending Message::
4386 * Killing Draft::
4387 @end menu
4388
4389 @node Editing Message, Inserting Letter, Editing Drafts, Editing Drafts
4390 @section Editing the Message
4391
4392 @cindex @samp{Bcc:} header field
4393 @cindex @samp{Cc:} header field
4394 @cindex @samp{Dcc:} header field
4395 @cindex @samp{From:} header field
4396 @cindex @samp{Mail-Followup-To:} header field
4397 @cindex @samp{Mail-Reply-To:} header field
4398 @cindex @samp{Reply-To:} header field
4399 @cindex @samp{Subject:} header field
4400 @cindex @samp{To:} header field
4401 @cindex editing header
4402 @cindex header field, @samp{Bcc:}
4403 @cindex header field, @samp{Cc:}
4404 @cindex header field, @samp{Dcc:}
4405 @cindex header field, @samp{From:}
4406 @cindex header field, @samp{Mail-Followup-To:}
4407 @cindex header field, @samp{Mail-Reply-To:}
4408 @cindex header field, @samp{Reply-To:}
4409 @cindex header field, @samp{Subject:}
4410 @cindex header field, @samp{To:}
4411 @findex mh-to-field
4412 @kindex C-c C-f C-t
4413 @kindex C-c C-f t
4414
4415 Because the header is part of the message, you can edit the header
4416 fields as you wish. However, several convenience commands exist to
4417 help you create and edit them. For example, the command @kbd{C-c C-f
4418 C-t} (@code{mh-to-field}; alternatively, @kbd{C-c C-f t}) moves the
4419 cursor to the @samp{To:} header field, creating it if necessary. The
4420 commands for moving to the @samp{Cc:}, @samp{Subject:}, @samp{From:},
4421 @samp{Reply-To:}, @samp{Mail-Reply-To:}, @samp{Mail-Followup-To},
4422 @samp{Bcc:}, and @samp{Dcc:} header fields are similar.
4423
4424 @findex mh-to-fcc
4425 @kindex C-c C-f C-f
4426 @kindex C-c C-f f
4427
4428 One command behaves differently from the others, namely, @kbd{C-c C-f
4429 C-f} (@code{mh-to-fcc}; alternatively, @kbd{C-c C-f f}). This command
4430 will prompt you for the folder name in which to file a copy of the
4431 draft. @xref{Folder Selection}.
4432
4433 @findex indent-relative
4434 @findex mh-letter-next-header-field-or-indent
4435 @findex mh-letter-previous-header-field
4436 @kindex S-@key{TAB}
4437 @kindex @key{TAB}
4438 @vindex mh-compose-skipped-header-fields
4439 @vindex mh-letter-header-field
4440
4441 Within the header of the message, the command@* @key{TAB}
4442 (@code{mh-letter-next-header-field-or-indent}) moves between fields
4443 that are highlighted with the face @code{mh-letter-header-field},
4444 skipping those fields listed in
4445 @code{mh-compose-skipped-header-fields}. After the last field, this
4446 command then moves point to the message body before cycling back to
4447 the first field. If point is already past the first line of the
4448 message body, then this command indents by calling
4449 @code{indent-relative} with the given prefix argument. The command
4450 @kbd{S-@key{TAB}} (@code{mh-letter-previous-header-field}) moves
4451 backwards between the fields and cycles to the body of the message
4452 after the first field. Unlike the command @key{TAB}, it will always
4453 take point to the last field from anywhere in the body.
4454
4455 @cindex alias completion
4456 @cindex completion
4457 @cindex spell check
4458 @findex ispell-complete-word
4459 @findex mh-letter-complete
4460 @findex mh-letter-complete-or-space
4461 @findex mh-letter-confirm-address
4462 @kindex , (comma)
4463 @kindex M-@key{TAB}
4464 @kindex @key{SPC}
4465 @vindex mh-letter-complete-function
4466
4467 If the field contains addresses (for example, @samp{To:} or
4468 @samp{Cc:}) or folders (for example, @samp{Fcc:}) then the command
4469 @kbd{M-@key{TAB}} (@code{mh-letter-complete}) will provide alias
4470 completion (@pxref{Aliases}). In the body of the message,
4471 @kbd{M-@key{TAB}} runs @code{mh-letter-complete-function} instead,
4472 which is set to @samp{'ispell-complete-word} by default. The command
4473 @kbd{M-@key{TAB}} (@code{mh-letter-complete}) takes a prefix argument
4474 that is passed to the @code{mh-letter-complete-function}. In addition,
4475 turn on the option @code{mh-compose-space-does-completion-flag} to use
4476 the command @key{SPC} (@code{mh-letter-complete-or-space}) to perform
4477 completion in the header as well; use a prefix argument to specify
4478 more than one space. Addresses are separated by a comma; when you
4479 press the comma, the command @code{mh-letter-confirm-address} flashes
4480 the alias expansion in the minibuffer if
4481 @code{mh-alias-flash-on-comma} is turned on.
4482
4483 @kindex C-c C-t
4484 @findex mh-letter-toggle-header-field-display
4485 @c XXX Document the replacement for the inaccessible 'long argument.
4486
4487 Use the command @kbd{C-c C-t}
4488 @code{mh-letter-toggle-header-field-display} to display truncated
4489 header fields. This command is a toggle so entering it again will hide
4490 the field. This command takes a prefix argument: if negative then the
4491 field is hidden, if positive then the field is displayed (for example,
4492 @kbd{C-u C-c C-t}).
4493
4494 Be sure to leave a row of dashes or a blank line between the header
4495 and the body of the message.
4496
4497 @vindex mh-letter-fill-column
4498
4499 The body of the message is edited as you would edit any Emacs buffer
4500 although there are a few commands and options to assist you. You can
4501 change the fill column in MH-Letter mode with the option
4502 @code{mh-letter-fill-column}. By default, this option is 72 to allow
4503 others to quote your message without line wrapping.
4504
4505 @cindex filling paragraphs
4506 @cindex paragraphs, filling
4507 @findex fill-paragraph
4508 @kindex M-q
4509 @vindex mh-ins-buf-prefix
4510
4511 You'll often include messages that were sent from user agents that
4512 haven't yet realized that paragraphs consist of more than a single
4513 line. This makes for long lines that wrap in an ugly fashion. You'll
4514 find that @kbd{M-q} (@code{fill-paragraph}) works well even on these
4515 quoted messages, even if they are nested, just as long as all of the
4516 quotes match the value of @code{mh-ins-buf-prefix} (@pxref{Inserting
4517 Letter}). For example, let's assume you have the following in your
4518 draft:
4519
4520 @example
4521 @group
4522 > Hopefully this gives you an idea of what I'm currently doing. I'm \
4523 not sure yet whether I'm completely satisfied with my setup, but \
4524 it's worked okay for me so far.
4525 @end group
4526 @end example
4527
4528 Running @kbd{M-q} on this paragraph produces:
4529
4530 @example
4531 @group
4532 > Hopefully this gives you an idea of what I'm currently doing. I'm not
4533 > sure yet whether I'm completely satisfied with my setup, but it's
4534 > worked okay for me so far.
4535 @end group
4536 @end example
4537
4538 @findex mh-open-line
4539 @findex open-line
4540 @kindex C-c C-o
4541 @kindex C-o
4542
4543 The command @kbd{C-c C-o} (@code{mh-open-line}) is similar to the
4544 command @kbd{C-o} (@code{open-line}) in that it inserts a newline
4545 after point. It differs in that it also inserts the right number of
4546 quoting characters and spaces so that the next line begins in the same
4547 column as it was. This is useful when breaking up paragraphs in
4548 replies. For example, if this command was used when point was after
4549 the first period in the paragraph above, the result would be this:
4550
4551 @example
4552 @group
4553 > Hopefully this gives you an idea of what I'm currently doing.
4554
4555 > I'm not
4556 > sure yet whether I'm completely satisfied with my setup, but it's
4557 > worked okay for me so far.
4558 @end group
4559 @end example
4560
4561 @node Inserting Letter, Inserting Messages, Editing Message, Editing Drafts
4562 @section Inserting Letter to Which You're Replying
4563
4564 @cindex inserting messages
4565 @cindex replying to messages
4566 @cindex yanking messages
4567 @findex mh-yank-cur-msg
4568 @kindex C-c C-y
4569
4570 It is often useful to insert a snippet of text from a letter that
4571 someone mailed to provide some context for your reply. The command
4572 @kbd{C-c C-y} (@code{mh-yank-cur-msg}) does this by adding an
4573 attribution, yanking a portion of text from the message to which
4574 you're replying, and inserting @code{mh-ins-buf-prefix} (@samp{> })
4575 before each line.
4576
4577 @example
4578 @group
4579 Michael W Thelen <thelenm@@stop.mail-abuse.org> wrote:
4580
4581 > Hopefully this gives you an idea of what I'm currently doing. I'm not
4582 > sure yet whether I'm completely satisfied with my setup, but it's
4583 > worked okay for me so far.
4584 @end group
4585 @end example
4586
4587 @vindex mh-extract-from-attribution-verb
4588
4589 The attribution consists of the sender's name and email address
4590 followed by the content of the option
4591 @code{mh-extract-from-attribution-verb}. This option can be set to
4592 @samp{wrote:}, @samp{a écrit:}, and @samp{schrieb:}. You can also use
4593 the @samp{Custom String} menu item to enter your own verb.
4594
4595 @vindex mh-ins-buf-prefix
4596
4597 The prefix @samp{"> "} is the default setting for the option
4598 @code{mh-ins-buf-prefix}. I suggest that you not modify this option
4599 since it is used by many mailers and news readers: messages are far
4600 easier to read if several included messages have all been indented by
4601 the same string. This prefix is not inserted if you use one of the
4602 supercite flavors of @code{mh-yank-behavior} or you have added a
4603 @code{mail-citation-hook} as described below.
4604
4605 @vindex mh-delete-yanked-msg-window-flag
4606
4607 You can also turn on the @code{mh-delete-yanked-msg-window-flag}
4608 option to delete the window containing the original message after
4609 yanking it to make more room on your screen for your reply.
4610
4611 @vindex mh-yank-behavior
4612 @cindex Emacs, packages, supercite
4613 @cindex supercite package
4614
4615 You can control how the message to which you are replying is yanked
4616 into your reply using @code{mh-yank-behavior}. To include the entire
4617 message, including the entire header, use @samp{Body and
4618 Header}@footnote{If you'd rather have the header cleaned up, use
4619 @kbd{C-u r} instead of @kbd{r} when replying
4620 (@pxref{Replying}).}@footnote{In the past you would use this setting
4621 and set @code{mail-citation-hook} to @samp{supercite}, but this usage
4622 is now deprecated in favor of the @samp{Invoke supercite} setting.}.
4623 Use @samp{Body} to yank just the body without the header. To yank only
4624 the portion of the message following the point, set this option to
4625 @samp{Below Point}.
4626
4627 Choose @samp{Invoke supercite}@footnote{@emph{Supercite} is a
4628 full-bodied, full-featured, citation package that comes standard with
4629 Emacs.} to pass the entire message and header through supercite.
4630
4631 If the @samp{Body With Attribution} setting is used, then the message
4632 minus the header is yanked and a simple attribution line is added at
4633 the top using the value of the option
4634 @code{mh-extract-from-attribution-verb}. This is the default.
4635
4636 If the @samp{Invoke supercite} or @samp{Body With Attribution}
4637 settings are used, the @samp{-noformat} argument is passed to the
4638 @command{repl} program to override a @samp{-filter} or @samp{-format}
4639 argument. These settings also have @samp{Automatically} variants that
4640 perform the action automatically when you reply so that you don't need
4641 to use @kbd{C-c C-y} at all. Note that this automatic action is only
4642 performed if the show buffer matches the message being replied to.
4643 People who use the automatic variants tend to turn on the option
4644 @code{mh-delete-yanked-msg-window-flag} as well so that the show
4645 window is never displayed.
4646
4647 If the show buffer has a region, the option @code{mh-yank-behavior} is
4648 ignored unless its value is one of @samp{Attribution} variants in
4649 which case the attribution is added to the yanked region.
4650
4651 @findex trivial-cite
4652 @vindex mail-citation-hook
4653
4654 If this isn't enough, you can gain full control over the appearance of
4655 the included text by setting @code{mail-citation-hook} to a function
4656 that modifies it. This hook is ignored if the option
4657 @code{mh-yank-behavior} is set to one of the supercite flavors.
4658 Otherwise, this option controls how much of the message is passed to
4659 the hook. The function can find the citation between point and mark
4660 and it should leave point and mark around the modified citation text
4661 for the next hook function. The standard prefix
4662 @code{mh-ins-buf-prefix} is not added if this hook is set.
4663
4664 For example, if you use the hook function
4665 @uref{http://shasta.cs.uiuc.edu/~lrclause/tc.html,
4666 @code{trivial-cite}} (which is NOT part of Emacs), set
4667 @code{mh-yank-behavior} to @samp{Body and Header}.
4668
4669 @node Inserting Messages, Signature, Inserting Letter, Editing Drafts
4670 @section Inserting Messages
4671
4672 @cindex inserting messages
4673 @findex mh-insert-letter
4674 @findex mh-yank-behavior
4675 @kindex C-c C-i
4676 @vindex mh-ins-buf-prefix
4677 @vindex mh-invisible-header-fields-compiled
4678
4679 Messages can be inserted with @kbd{C-c C-i} (@code{mh-insert-letter}).
4680 This command prompts you for the folder and message number, which
4681 defaults to the current message in that folder. It then inserts the
4682 messages, indented by @code{mh-ins-buf-prefix} (@samp{> }) unless
4683 @code{mh-yank-behavior} is set to one of the supercite flavors in
4684 which case supercite is used to format the message. Certain
4685 undesirable header fields (see
4686 @code{mh-invisible-header-fields-compiled}) are removed before
4687 insertion.
4688
4689 If given a prefix argument (like @kbd{C-u C-c C-i}), the header is
4690 left intact, the message is not indented, and @samp{> } is not
4691 inserted before each line. This command leaves the mark before the
4692 letter and point after it.
4693
4694 @node Signature, Picture, Inserting Messages, Editing Drafts
4695 @section Inserting Your Signature
4696
4697 @cindex signature
4698 @findex mh-insert-signature
4699 @kindex C-c C-s
4700
4701 You can insert your signature at the current cursor location with the
4702 command @kbd{C-c C-s} (@code{mh-insert-signature}).
4703
4704 @cindex @file{.signature}
4705 @cindex files, @file{.signature}
4706 @cindex vCard
4707 @vindex mh-signature-file-name
4708
4709 By default, the text of your signature is taken from the file
4710 @file{~/.signature}. You can read from other sources by changing the
4711 option @code{mh-signature-file-name}. This file may contain a
4712 @dfn{vCard} in which case an attachment is added with the vCard.
4713
4714 @findex mh-signature-separator-p
4715 @vindex mh-signature-separator
4716 @vindex mh-signature-separator-regexp
4717
4718 The option @code{mh-signature-file-name} may also be a symbol, in
4719 which case that function is called. You may not want a signature
4720 separator to be added for you; instead you may want to insert one
4721 yourself. Options that you may find useful to do this include
4722 @code{mh-signature-separator} (when inserting a signature separator)
4723 and @code{mh-signature-separator-regexp} (for finding said separator).
4724 The function @code{mh-signature-separator-p}, which reports @code{t}
4725 if the buffer contains a separator, may be useful as well.
4726
4727 @cindex signature separator
4728 @vindex mh-signature-separator-flag
4729
4730 A signature separator (@samp{"-- "}) will be added if the signature
4731 block does not contain one and @code{mh-signature-separator-flag} is
4732 on. It is not recommended that you change this option since various
4733 mail user agents, including MH-E, use the separator to present the
4734 signature differently, and to suppress the signature when replying or
4735 yanking a letter into a draft.
4736
4737 @vindex mh-insert-signature-hook
4738
4739 The hook @code{mh-insert-signature-hook} is run after the signature is
4740 inserted. Hook functions may access the actual name of the file or the
4741 function used to insert the signature with
4742 @code{mh-signature-file-name}.
4743
4744 The signature can also be inserted using Identities.
4745 @xref{Identities}.
4746
4747 @node Picture, Adding Attachments, Signature, Editing Drafts
4748 @section Inserting Your Picture
4749
4750 @cindex @file{.face}
4751 @cindex files, @file{.face}
4752 @vindex mh-x-face-file
4753
4754 You can insert your picture in the header of your mail message so that
4755 recipients see your face in the @samp{From:} header field if their
4756 mail user agent is sophisticated enough. In MH-E, this is done by
4757 placing your image in the file named by the option
4758 @code{mh-x-face-file} which is @file{~/.face} by default.
4759
4760 @cindex @samp{Face:} header field
4761 @cindex @samp{X-Face:} header field
4762 @cindex @samp{X-Image-URL:} header field
4763 @cindex header field, @samp{Face:}
4764 @cindex header field, @samp{X-Face:}
4765 @cindex header field, @samp{X-Image-URL:}
4766
4767 If the file starts with either of the strings @samp{X-Face:},
4768 @samp{Face:} or @samp{X-Image-URL:} then the contents are added to the
4769 message header verbatim. Otherwise it is assumed that the file
4770 contains the value of the @samp{X-Face:} header field.
4771
4772 @cindex @command{compface}
4773 @cindex Unix commands, @command{compface}
4774
4775 The @samp{X-Face:} header field, which is a low-resolution, black and
4776 white image, can be generated using the
4777 @uref{ftp://ftp.cs.indiana.edu/pub/faces/compface/compface.tar.Z,
4778 @command{compface}} command. The @uref{http://www.dairiki.org/xface/,
4779 @cite{Online X-Face Converter}} is a useful resource for quick
4780 conversion of images into @samp{X-Face:} header fields.
4781
4782 Use the @uref{http://quimby.gnus.org/circus/face/make-face,
4783 @command{make-face}} script to convert a JPEG image to the higher
4784 resolution, color, @samp{Face:} header field.
4785
4786 The URL of any image can be used for the @samp{X-Image-URL:} field and
4787 no processing of the image is required.
4788
4789 To prevent the setting of any of these header fields, either set
4790 @code{mh-x-face-file} to @code{nil}, or simply ensure that the file
4791 defined by this option doesn't exist.
4792
4793 @xref{Viewing}, to see how these header fields are displayed in MH-E.
4794
4795 @node Adding Attachments, Sending PGP, Picture, Editing Drafts
4796 @section Adding Attachments
4797
4798 @cindex @command{mhbuild}
4799 @cindex @command{mhn}
4800 @cindex MH commands, @command{mhbuild}
4801 @cindex MH commands, @command{mhn}
4802 @cindex MIME
4803 @cindex multimedia mail
4804
4805 MH-E has the capability to create multimedia messages. It uses the
4806 @sc{mime} (Multipurpose Internet Mail Extensions)
4807 protocol@footnote{@sc{mime} is defined in
4808 @uref{http://www.rfc-editor.org/rfc/rfc2045.txt, RFC 2045}.} The
4809 @sc{mime} protocol allows you to incorporate images, sound, video,
4810 binary files, and even commands that fetch a file with @samp{ftp} when
4811 your recipient reads the message!
4812
4813 If you were to create a multimedia message with plain MH commands, you
4814 would insert @command{mhbuild} or @command{mhn} directives (henceforth
4815 called @dfn{MH-style directives} into your draft and use the
4816 @command{mhbuild} command in nmh or @command{mhn} command in MH and
4817 GNU mailutils to expand them. MH-E works in much the same way,
4818 although it provides a handful of commands prefixed with @kbd{C-c C-m}
4819 to insert the directives so you don't need to remember the syntax of
4820 them. Remember: you can always add MH-style directives by
4821 hand@footnote{See the section
4822 @uref{@value{MH-BOOK-HOME}/usimim.htm#SeMIMa, Sending MIME Mail} in
4823 the MH book.}.
4824
4825 @cindex MIME Meta Language (MML)
4826 @cindex MML
4827 @vindex mh-compose-insertion
4828
4829 In addition to MH-style directives, MH-E also supports MML (@sc{mime}
4830 Meta Language) tags@footnote{
4831 @ifinfo
4832 @c Although the third argument should default to the
4833 @c first, makeinfo goes to the wrong Info file without it being
4834 @c different--it seems to be getting our own Composing node.
4835 @xref{Composing,,Composing with MML,emacs-mime}.
4836 @end ifinfo
4837 @ifnotinfo
4838 See the section Composing in
4839 @uref{http://www.gnus.org/manual/emacs-mime.html, @cite{The Emacs MIME
4840 Manual}}.
4841 @end ifnotinfo
4842 }. The option @code{mh-compose-insertion} can be used to choose
4843 between them. By default, this option is set to @samp{MML} if it is
4844 supported since it provides a lot more functionality. This option can
4845 also be set to @samp{MH} if MH-style directives are preferred.
4846
4847 @cindex media types
4848 @cindex MIME, media types
4849
4850 The MH-E @sc{mime} commands require a @dfn{media type} for each body
4851 part or attachment. For example, a PDF document is of type
4852 @samp{application/pdf} and an HTML document is of type
4853 @samp{text/html}. Some commands fill in the media type for you,
4854 whereas others require you to enter one.
4855
4856 @cindex @command{file}
4857 @cindex @file{/etc/mime.types}
4858 @cindex Unix commands, @command{file}
4859 @cindex files, @file{/etc/mime.types}
4860 @findex mailcap-mime-types
4861
4862 In the cases where MH-E can do so, it will determine the media type
4863 automatically. It uses the @command{file} command to do this. Failing
4864 that, the Emacs function @code{mailcap-mime-types} is used to provide
4865 a list from which to choose. This function usually reads the file
4866 @file{/etc/mime.types}.
4867
4868 Whether the media type is chosen automatically, or you choose it from
4869 a list, use the type that seems to match best the file that you are
4870 including. In the case of binaries, the media type
4871 @samp{application/x-executable} can be useful. If you can't find an
4872 appropriate media type, use @samp{text/plain} for text messages and
4873 @samp{application/octet-stream} for everything else.
4874
4875 @cindex content description
4876 @cindex MIME, content description
4877
4878 You are also sometimes asked for a @dfn{content description}. This is
4879 simply an optional brief phrase, in your own words, that describes the
4880 object. If you don't care to enter a content description, just press
4881 return and none will be included; however, a reader may skip over
4882 multimedia fields unless the content description is compelling.
4883
4884 You can also create your own @sc{mime} body parts. In the following
4885 example, I describe how you can create and edit a @samp{text/enriched}
4886 body part to liven up your plain text messages with boldface,
4887 underlining, and italics. I include an Emacs function which inserts
4888 enriched text tags.
4889
4890 @smalllisp
4891 @group
4892 (defvar enriched-text-types '(("b" . "bold") ("i" . "italic")
4893 ("u" . "underline")
4894 ("s" . "smaller") ("B" . "bigger")
4895 ("f" . "fixed")
4896 ("c" . "center"))
4897 "Alist of (final-character . tag) choices for add-enriched-text.
4898 Additional types can be found in RFC 1563.")
4899
4900 (defun add-enriched-text (begin end)
4901 "Add enriched text tags around region.
4902 The tag used comes from the list enriched-text-types and is
4903 specified by the last keystroke of the command. When called from Lisp,
4904 arguments are BEGIN and END@."
4905 (interactive "r")
4906 ;; @r{Set type to the tag indicated by the last keystroke.}
4907 (let ((type (cdr (assoc (char-to-string (logior last-input-char ?@w{`}))
4908 enriched-text-types))))
4909 (save-restriction ; @r{restores state from narrow-to-region}
4910 (narrow-to-region begin end) ; @r{narrow view to region}
4911 (goto-char (point-min)) ; @r{move to beginning of text}
4912 (insert "<" type ">") ; @r{insert beginning tag}
4913 (goto-char (point-max)) ; @r{move to end of text}
4914 (insert "</" type ">")))) ; @r{insert terminating tag}
4915 @i{Emacs function for entering enriched text}
4916
4917 @end group
4918 @end smalllisp
4919
4920 To use the function @code{add-enriched-text}, first add it to
4921 @file{~/.emacs} and create key bindings for it (@pxref{Composing}).
4922
4923 Then, in your plain text message, set the mark with @kbd{C-@@} or
4924 @kbd{C-@key{SPC}}, type in the text to be highlighted, and type @kbd{C-c t
4925 b}. This adds @samp{<bold>} where you set the mark and adds
4926 @samp{</bold>} at the location of your cursor, giving you something
4927 like: @samp{You should be <bold>very</bold>}.
4928
4929 Before sending this message, use @kbd{C-c C-m C-m}
4930 (@code{mh-mml-to-mime})@footnote{Use @kbd{C-c C-e}
4931 (@code{mh-mh-to-mime}) if you're using MH-style directives.} to add
4932 MIME header fields. Then replace @samp{text/plain} with
4933 @samp{text/enriched} in the @samp{Content-Type:} header field.
4934
4935 You may also be interested in investigating @code{sgml-mode}.
4936
4937 @subheading Including Files
4938
4939 @cindex MIME, images
4940 @cindex MIME, sound
4941 @cindex MIME, video
4942 @cindex attachments, inserting
4943 @cindex images
4944 @cindex sound
4945 @cindex video
4946 @findex mh-compose-insertion
4947 @kindex C-c C-m C-i
4948 @kindex C-c C-m i
4949
4950 Binaries, images, sound, and video can be inserted in your message
4951 with the command @kbd{C-c C-m C-i} (@code{mh-compose-insertion}). You
4952 are prompted for the filename containing the object, the media type if
4953 it cannot be determined automatically, and a content description. If
4954 you're using MH-style directives, you will also be prompted for
4955 additional attributes.
4956
4957 @subheading Forwarding Multimedia Messages
4958
4959 @findex mh-compose-forward
4960 @kindex C-c C-m C-f
4961 @kindex C-c C-m f
4962
4963 Mail may be forwarded with @sc{mime} using the command @kbd{C-c C-m
4964 C-f} (@code{mh-compose-forward}). You are prompted for a content
4965 description, the name of the folder in which the messages to forward
4966 are located, and a range of messages, which defaults to the current
4967 message in that folder. @xref{Ranges}.
4968
4969 @subheading Including an FTP Reference
4970
4971 @cindex @command{ftp}
4972 @cindex MIME, @command{ftp}
4973 @cindex Unix commands, @command{ftp}
4974 @findex mh-mh-compose-anon-ftp
4975 @kindex C-c C-m C-g
4976 @kindex C-c C-m g
4977
4978 You can have your message initiate an @command{ftp} transfer when the
4979 recipient reads the message. To do this, use the command @kbd{C-c C-m
4980 C-g} (@code{mh-mh-compose-anon-ftp}). You are prompted for the remote
4981 host and filename, the media type, and the content description.
4982
4983 @subheading Including tar Files
4984
4985 @cindex @command{ftp}
4986 @cindex @command{tar}
4987 @cindex MIME, @command{ftp}
4988 @cindex MIME, @command{tar}
4989 @cindex Unix commands, @command{ftp}
4990 @cindex Unix commands, @command{tar}
4991 @findex mh-mh-compose-external-compressed-tar
4992 @kindex C-c C-m C-t
4993 @kindex C-c C-m t
4994
4995 If the remote file is a compressed tar file, you can use @kbd{C-c C-m
4996 C-t} (@code{mh-mh-compose-external-compressed-tar}). Then, in addition
4997 to retrieving the file via anonymous @emph{ftp} as per the command
4998 @kbd{C-c C-m C-g} (@code{mh-mh-compose-anon-ftp}), the file will also
4999 be uncompressed and untarred. You are prompted for the remote host and
5000 filename and the content description.
5001
5002 @subheading Including Other External Files
5003
5004 @findex mh-mh-compose-external-type
5005 @kindex C-c C-m C-x
5006 @kindex C-c C-m x
5007
5008 The command @kbd{C-c C-m C-x} (@code{mh-mh-compose-external-type}) is
5009 a general utility for referencing external files. In fact, all of the
5010 other commands that insert tags to access external files call this
5011 command. You are prompted for the access type, remote host and
5012 filename, and content type. If you provide a prefix argument, you are
5013 also prompted for a content description, attributes, parameters, and a
5014 comment.
5015
5016 @subheading Previewing Multimedia Messages
5017
5018 When you are finished editing a @sc{mime} message, it might look like this:
5019
5020 @cartouche
5021 @smallexample
5022 3 t08/24 root received fax files on Wed Aug 24 11:00:
5023 4+t08/24 To:wohler Test<<This is a test message to get the
5024
5025
5026
5027
5028
5029 --:%% @{+inbox@} 4 msgs (1-4) (MH-Folder Show)--L4--Bot---------------
5030 To: wohler
5031 cc:
5032 Subject: Test of MIME
5033 --------
5034 Here is the SETI@@Home logo:
5035
5036 <#part type="image/x-xpm" filename="~/lib/images/setiathome.xpm"
5037 disposition=inline description="SETI@@home logo">
5038 <#/part>
5039 --:** @{draft@} (MH-Letter)--L8--All----------------------------------
5040
5041 @end smallexample
5042 @end cartouche
5043 @i{MH-E @sc{mime} draft}
5044
5045 @findex mh-mml-to-mime
5046 @kindex C-c C-m C-m
5047 @kindex C-c C-m m
5048
5049 Typically, you send a message with attachments just like any other
5050 message (@pxref{Sending Message}).
5051
5052 However, you may take a sneak preview of the @sc{mime} encoding if you
5053 wish by running the command @kbd{C-c C-m C-m} (@code{mh-mml-to-mime}).
5054 The following screen shows the @sc{mime} encoding specified by the
5055 tags. You can see why mail user agents are usually built to hide these
5056 details from the user.
5057
5058 @cartouche
5059 @smallexample
5060 To: wohler
5061 cc:
5062 Subject: Test of MIME
5063 MIME-Version: 1.0
5064 Content-Type: multipart/mixed; boundary="=-=-="
5065 --------
5066 --=-=-=
5067
5068 Here is the SETI@@Home logo:
5069
5070
5071 --=-=-=
5072 Content-Type: image/x-xpm
5073 Content-Disposition: inline; filename=setiathome.xpm
5074 Content-Transfer-Encoding: base64
5075 Content-Description: SETI@@home logo
5076
5077 LyogWFBNICovCnN0YXRpYyBjaGFyICogc2V0aWF0aG9tZV94cG1bXSA9IHsKIjQ1IDQ1IDc2NCAy
5078 --:-- @{draft@} (MH-Letter)--L2--Top----------------------------------
5079
5080 @end smallexample
5081 @end cartouche
5082 @i{MH-E @sc{mime} draft ready to send}
5083
5084 This action can be undone by running @kbd{C-_} (@code{undo}).
5085
5086 @cindex @command{mhbuild}
5087 @cindex @command{mhn}
5088 @cindex MH commands, @command{mhbuild}
5089 @cindex MH commands, @command{mhn}
5090 @findex mh-mh-to-mime
5091 @findex mh-mh-to-mime-undo
5092 @kindex C-c C-e
5093 @kindex C-c C-m C-u
5094 @kindex C-c C-m u
5095
5096 If you're using MH-style directives, use @kbd{C-c C-e}
5097 (@code{mh-mh-to-mime}) instead of @kbd{C-c C-m C-m}. This runs the
5098 command @command{mhbuild} (@command{mhn}) on the message which expands
5099 the tags@footnote{See the section
5100 @uref{@value{MH-BOOK-HOME}/usimim.htm#SeMIMa, Sending MIME Mail} in
5101 the MH book.}. This action can be undone by running @kbd{C-c C-m C-u}
5102 (@code{mh-mh-to-mime-undo}), which works by reverting to a backup
5103 file. You are prompted to confirm this action, but you can avoid the
5104 confirmation by adding an argument (for example, @kbd{C-u C-c C-m
5105 C-u}).
5106
5107 @vindex mh-mh-to-mime-args
5108
5109 If you wish to pass additional arguments to @command{mhbuild}
5110 (@command{mhn}) to affect how it builds your message, use the option
5111 @code{mh-mh-to-mime-args}. For example, you can build a consistency
5112 check into the message by setting @code{mh-mh-to-mime-args} to
5113 @samp{-check}. The recipient of your message can then run
5114 @samp{mhbuild -check} on the message---@command{mhbuild}
5115 (@command{mhn}) will complain if the message has been corrupted on the
5116 way. The command @kbd{C-c C-e} (@code{mh-mh-to-mime}) only consults
5117 this option when given a prefix argument (as in @kbd{C-u C-c C-e}).
5118
5119 @vindex mh-mh-to-mime-hook
5120
5121 The hook @code{mh-mh-to-mime-hook} is called after the message has
5122 been formatted by @kbd{C-c C-e} (@code{mh-mh-to-mime})
5123
5124 @node Sending PGP, Checking Recipients, Adding Attachments, Editing Drafts
5125 @section Signing and Encrypting Messages
5126
5127 @cindex signing messages
5128 @cindex encrypting messages
5129 @cindex RFC 3156
5130
5131 MH-E can sign and encrypt messages as defined in
5132 @uref{http://www.rfc-editor.org/rfc/rfc3156.txt, RFC 3156}. If you
5133 should choose to sign or encrypt your message, use one of the
5134 following commands to do so any time before sending your message.
5135
5136 @findex mh-mml-secure-message-encrypt
5137 @findex mh-mml-secure-message-sign
5138 @findex mh-mml-secure-message-signencrypt
5139 @kindex C-c C-m C-e
5140 @kindex C-c C-m C-s
5141 @kindex C-c C-m e e
5142 @kindex C-c C-m e s
5143 @kindex C-c C-m s e
5144 @kindex C-c C-m s s
5145
5146 The command @kbd{C-c C-m C-s} (@code{mh-mml-secure-message-sign})
5147 inserts the following tag:
5148
5149 @example
5150 <#secure method=pgpmime mode=sign>
5151 @end example
5152
5153 This is used to sign your message digitally. Likewise, the command
5154 @kbd{C-c C-m C-e} (@code{mh-mml-secure-message-encrypt}) inserts the
5155 following tag:
5156
5157 @example
5158 <#secure method=pgpmime mode=encrypt>
5159 @end example
5160
5161 This is used to encrypt your message. Finally, the command @kbd{C-c
5162 C-m s e} (@code{mh-mml-secure-message-signencrypt}) inserts the
5163 following tag:
5164
5165 @example
5166 <#secure method=pgpmime mode=signencrypt>
5167 @end example
5168
5169 @findex mh-mml-unsecure-message
5170 @kindex C-c C-m C-n
5171 @kindex C-c C-m n
5172
5173 This is used to sign and encrypt your message. In each of these cases,
5174 a proper multipart message is created for you when you send the
5175 message. Use the command @kbd{C-c C-m C-n}
5176 (@code{mh-mml-unsecure-message}) to remove these tags. Use a prefix
5177 argument (as in @kbd{C-u C-c C-m s e}) to be prompted for one of the
5178 possible security methods (see @code{mh-mml-method-default}).
5179
5180 @vindex mh-mml-method-default
5181
5182 The option @code{mh-mml-method-default} is used to select between a
5183 variety of mail security mechanisms. The default is @samp{PGP (MIME)}
5184 if it is supported; otherwise, the default is @samp{None}. Other
5185 mechanisms include vanilla @samp{PGP} and @samp{S/MIME}.
5186
5187 @cindex @samp{pgg} customization group
5188 @cindex PGG
5189 @cindex customization group, @samp{pgg}
5190
5191 The @samp{pgg} customization group may have some settings which may
5192 interest you.
5193 @iftex
5194 See @cite{The PGG Manual}.
5195 @end iftex
5196 @ifinfo
5197 @xref{Top, , The PGG Manual, pgg, The PGG Manual}.
5198 @end ifinfo
5199 @ifhtml
5200 See
5201 @uref{http://www.dk.xemacs.org/Documentation/packages/html/pgg.html,
5202 @cite{The PGG Manual}}.
5203 @end ifhtml
5204
5205 @cindex @samp{Fcc:} header field
5206 @cindex header field, @samp{Fcc:}
5207 @vindex pgg-encrypt-for-me
5208
5209 In particular, I turn on the option @code{pgg-encrypt-for-me} so that
5210 all messages I encrypt are encrypted with my public key as well. If
5211 you keep a copy of all of your outgoing mail with a @samp{Fcc:} header
5212 field, this setting is vital so that you can read the mail you write!
5213
5214 @node Checking Recipients, Sending Message, Sending PGP, Editing Drafts
5215 @section Checking Recipients
5216
5217 @cindex @samp{*MH-E Recipients*}
5218 @cindex @command{whom}
5219 @cindex MH commands, @command{whom}
5220 @cindex buffers, @samp{*MH-E Recipients*}
5221 @cindex checking recipients
5222 @cindex recipients, checking
5223 @findex mh-check-whom
5224 @kindex C-c C-w
5225
5226 The command @kbd{C-c C-w} (@code{mh-check-whom}) expands aliases so
5227 you can check the actual address(es) in the alias. A new buffer named
5228 @samp{*MH-E Recipients*} is created with the output of @command{whom}
5229 (@pxref{Miscellaneous})@footnote{See the section
5230 @uref{@value{MH-BOOK-HOME}/senove.htm#WhaPro, What now? -- and the
5231 whatnow Program} in the MH book.}.
5232
5233 @node Sending Message, Killing Draft, Checking Recipients, Editing Drafts
5234 @section Sending a Message
5235
5236 @cindex @samp{*MH-E Mail Delivery*}
5237 @cindex buffers, @samp{*MH-E Mail Delivery*}
5238 @cindex sending mail
5239 @findex mh-send-letter
5240 @kindex C-c C-c
5241
5242 When you are all through editing a message, you send it with the
5243 command @kbd{C-c C-c} (@code{mh-send-letter}). You can give a prefix
5244 argument (as in @kbd{C-u C-c C-c}) to monitor the first stage of the
5245 delivery; this output can be found in a buffer called @samp{*MH-E Mail
5246 Delivery*} (@pxref{Miscellaneous}).
5247
5248 @cindex sending mail
5249 @cindex spell check
5250 @vindex mh-before-send-letter-hook
5251
5252 The hook @code{mh-before-send-letter-hook} is run at the beginning of
5253 the command @kbd{C-c C-c}. For example, if you want to check your
5254 spelling in your message before sending, add the function
5255 @code{ispell-message}.
5256
5257 @cindex @command{send}
5258 @cindex MH commands, @command{send}
5259 @vindex mh-send-prog
5260
5261 In case the MH @command{send} program@footnote{See the section
5262 @uref{@value{MH-BOOK-HOME}/sensen.htm, Sending Some Mail: comp send}
5263 in the MH book.} is installed under a different name, use
5264 @code{mh-send-prog} to tell MH-E the name.
5265
5266 @node Killing Draft, , Sending Message, Editing Drafts
5267 @section Killing the Draft
5268
5269 @cindex killing draft
5270 @findex kill-buffer
5271 @findex mh-fully-kill-draft
5272 @kindex C-c C-q
5273 @kindex C-x k
5274
5275 If for some reason you are not happy with the draft, you can use the
5276 command @kbd{C-c C-q} (@code{mh-fully-kill-draft}) to kill the draft
5277 buffer and delete the draft message. Use the command @kbd{C-x k}
5278 (@code{kill-buffer}) if you don't want to delete the draft message.
5279
5280 @node Aliases, Identities, Editing Drafts, Top
5281 @chapter Aliases
5282
5283 @cindex aliases
5284
5285 MH aliases are used in the same way in MH-E as they are in MH. Any
5286 alias listed as a recipient will be expanded when the message is sent.
5287 This chapter discusses other things you can do with aliases in MH-E.
5288
5289 @cindex MH-Letter mode
5290 @cindex modes, MH-Letter
5291
5292 The following commands are available in MH-Letter mode with the
5293 exception of @code{mh-alias-reload} which can be called from anywhere.
5294
5295 @table @kbd
5296 @kindex @key{SPC}
5297 @findex mh-letter-complete-or-space
5298 @item @key{SPC}
5299 Perform completion or insert space (@code{mh-letter-complete-or-space}).
5300 @c -------------------------
5301 @kindex M-@key{TAB}
5302 @findex mh-letter-complete
5303 @item M-@key{TAB}
5304 Perform completion on header field or word preceding point
5305 (@code{mh-letter-complete}).
5306 @c -------------------------
5307 @findex mh-alias-apropos
5308 @item mh-alias-apropos
5309 Show all aliases or addresses that match a regular expression.
5310 @c -------------------------
5311 @findex mh-alias-grab-from-field
5312 @item mh-alias-grab-from-field
5313 Add alias for the sender of the current message
5314 @c -------------------------
5315 @findex mh-alias-reload
5316 @item mh-alias-reload
5317 Reload MH aliases.
5318 @end table
5319
5320 @cindex @samp{mh-alias} customization group
5321 @cindex customization group, @samp{mh-alias}
5322
5323 The @samp{mh-alias} customization group contains options associated
5324 with aliases.
5325
5326 @vtable @code
5327 @item mh-alias-completion-ignore-case-flag
5328 On means don't consider case significant in MH alias completion
5329 (default: @samp{on}).
5330 @c -------------------------
5331 @item mh-alias-expand-aliases-flag
5332 On means to expand aliases entered in the minibuffer (default:
5333 @samp{off}).
5334 @c -------------------------
5335 @item mh-alias-flash-on-comma
5336 Specify whether to flash address or warn on translation (default: @samp{Flash
5337 but Don't Warn If No Alias}).
5338 @c -------------------------
5339 @item mh-alias-insert-file
5340 Filename used to store a new MH-E alias (default: @samp{Use Aliasfile
5341 Profile Component}).
5342 @c -------------------------
5343 @item mh-alias-insertion-location
5344 Specifies where new aliases are entered in alias files (default:
5345 @samp{Alphabetical}).
5346 @c -------------------------
5347 @item mh-alias-local-users
5348 If @samp{on}, local users are added to alias completion (default:
5349 @samp{on}).
5350 @c -------------------------
5351 @item mh-alias-local-users-prefix
5352 String prefixed to the real names of users from the password file
5353 (default: @samp{"local."}.
5354 @c -------------------------
5355 @item mh-alias-passwd-gecos-comma-separator-flag
5356 On means the GECOS field in the password file uses a comma separator
5357 (default: @samp{on}).
5358 @end vtable
5359
5360 The following hook is available.
5361
5362 @vtable @code
5363 @item mh-alias-reloaded-hook
5364 Hook run by @code{mh-alias-reload} after loading aliases (default:
5365 @code{nil}).
5366 @end vtable
5367
5368 @heading Adding Addresses to Draft
5369
5370 You can use aliases when you are adding recipients to a message.
5371
5372 @findex minibuffer-complete
5373 @kindex @key{TAB}
5374
5375 In order to use minibuffer prompting for recipients and the subject
5376 line in the minibuffer, turn on the option
5377 @code{mh-compose-prompt-flag} (@pxref{Composing}), and use the
5378 @key{TAB} (@code{minibuffer-complete}) command to complete aliases
5379 (and optionally local logins) when prompted for the recipients. Turn
5380 on the option @code{mh-alias-expand-aliases-flag} if you want these
5381 aliases to be expanded to their respective addresses in the draft.
5382
5383 Otherwise, you can complete aliases in the header of the draft with
5384 @kbd{M-@key{TAB}} (@code{mh-letter-complete}) or @key{SPC}
5385 (@code{mh-letter-complete-or-space}).
5386
5387 As MH ignores case in the aliases, so too does MH-E. However, you may
5388 turn off the option @code{mh-alias-completion-ignore-case-flag} to
5389 make case significant which can be used to segregate completion of
5390 your aliases. You might use uppercase for mailing lists and lowercase
5391 for people. For example, you might have:
5392
5393 @example
5394 mark.baushke: Mark Baushke <mdb@@stop.mail-abuse.org>
5395 MH-E: MH-E Mailing List <mh-e-devel@@stop.mail-abuse.org>
5396 @end example
5397
5398 When this option is turned off, if you were to type @kbd{M} in the
5399 @samp{To:} field and then @kbd{M-@key{TAB}}, then you'd get the list;
5400 if you started with @kbd{m} and then entered @kbd{M-@key{TAB}}, then
5401 you'd get Mark's address. Note that this option affects completion
5402 only. If you were to enter @kbd{Mark.Baushke}, it would still be
5403 identified with your @samp{mark.baushke} alias.
5404
5405 To verify that the alias you've entered is valid, the alias will be
5406 displayed in the minibuffer when you type a comma
5407 (@code{mh-letter-confirm-address} or
5408 @code{mh-alias-minibuffer-confirm-address} if the option
5409 @code{mh-compose-prompt-flag} is turned on). @xref{Composing}. This
5410 behavior can be controlled with the option
5411 @code{mh-alias-flash-on-comma} which provides three choices:
5412 @samp{Flash but Don't Warn If No Alias}, @samp{Flash and Warn If No
5413 Alias}, and @samp{Don't Flash Nor Warn If No Alias}.
5414
5415 For another way to verify the alias expansion, see @ref{Checking
5416 Recipients}.
5417
5418 @heading Loading Aliases
5419
5420 @cindex @command{ali}
5421 @cindex @file{/etc/nmh/MailAliases}
5422 @cindex @samp{Aliasfile:} MH profile component
5423 @cindex MH commands, @command{ali}
5424 @cindex MH profile component, @samp{Aliasfile:}
5425 @cindex files, @file{/etc/nmh/MailAliases}
5426
5427 MH-E loads aliases for completion and folder name hints from various
5428 places. It uses the MH command @command{ali}@footnote{See the section
5429 @uref{@value{MH-BOOK-HOME}/mh.htm, MH Aliases} in the MH book.} to
5430 read aliases from the files listed in the profile component
5431 @samp{Aliasfile:} as well as system-wide aliases (for example,
5432 @file{/etc/nmh/MailAliases}).
5433
5434 @cindex @file{/etc/passwd}
5435 @cindex files, @file{/etc/passwd}
5436
5437 In addition, aliases are created from @file{/etc/passwd} entries with
5438 a user ID larger than a magical number, typically 200. This can be a
5439 handy tool on a machine where you and co-workers exchange messages.
5440 These aliases have the form @samp{local.@var{first.last}} if a real
5441 name is present in the password file. Otherwise, the alias will have
5442 the form @samp{local.@var{login}}.
5443
5444 The prefix @samp{local.} can be modified via the option
5445 @code{mh-alias-local-users-prefix}. This option can also be set to
5446 @samp{Use Login}.
5447
5448 For example, consider the following password file entry:
5449
5450 @example
5451 psg:x:1000:1000:Peter S Galbraith,,,:/home/psg:/bin/tcsh
5452 @end example
5453
5454 The following settings of option @code{mh-alias-local-users-prefix}
5455 will produce the associated aliases:
5456
5457 @table @code
5458 @item "local."
5459 local.peter.galbraith
5460 @c -------------------------
5461 @item ""
5462 peter.galbraith
5463 @c -------------------------
5464 @item Use Login
5465 psg
5466 @end table
5467
5468 In the example above, commas are used to separate different values
5469 within the so-called GECOS field. This is a fairly common usage.
5470 However, in the rare case that the GECOS field in your password file
5471 is not separated by commas and whose contents may contain commas, you
5472 can turn the option @code{mh-alias-passwd-gecos-comma-separator-flag}
5473 off.
5474
5475 @cindex @samp{ypcat passwd}
5476 @cindex NIS, obtaining local aliases from
5477
5478 If you're on a system with thousands of users you don't know, and the
5479 loading of local aliases slows MH-E down noticeably, then the local
5480 alias feature can be disabled by turning off the option
5481 @code{mh-alias-local-users}. This option also takes a string which is
5482 executed to generate the password file. For example, use @samp{ypcat
5483 passwd} to obtain the NIS password file.
5484
5485 Since aliases are updated frequently, MH-E reloads aliases
5486 automatically whenever an alias lookup occurs if an alias source has
5487 changed. However, you can reload your aliases manually by calling the
5488 command @kbd{M-x mh-alias-reload} directly. This command runs
5489 @code{mh-alias-reloaded-hook} after the aliases have been loaded.
5490
5491 @heading Adding Aliases
5492
5493 In the past, you have manually added aliases to your alias file(s)
5494 listed in your @samp{Aliasfile:} profile component. MH-E provides
5495 other methods for maintaining your alias file(s).
5496
5497 You can use the @kbd{M-x mh-alias-add-alias} command which will prompt
5498 you for the alias and address that you would like to add. If the alias
5499 exists already, you will have the choice of inserting the new alias
5500 before or after the old alias. In the former case, this alias will be
5501 used when sending mail to this alias. In the latter case, the alias
5502 serves as an additional folder name hint when filing messages
5503 (@pxref{Folder Selection}).
5504
5505 Earlier, the alias prefix @samp{local} was presented. You can use
5506 other prefixes to organize your aliases or disambiguate entries. You
5507 might use prefixes for locales, jobs, or activities. For example, I
5508 have:
5509
5510 @example
5511 ; Work
5512 attensity.don.mitchell: Don Mitchell <dmitchell@@stop.mail-abuse.com>
5513 isharp.don.mitchell: Don Mitchell <donaldsmitchell@@stop.mail-abuse.com>
5514 ...
5515 ; Sport
5516 diving.ken.mayer: Ken Mayer <kmayer@@stop.mail-abuse.com>
5517 sailing.mike.maloney: Mike Maloney <mmaloney@@stop.mail-abuse.com>
5518 ...
5519 ; Personal
5520 ariane.kolkmann: Ariane Kolkmann <ArianeKolkmann@@stop.mail-abuse.com>
5521 ...
5522 @end example
5523
5524 Using prefixes instead of postfixes helps you explore aliases during
5525 completion. If you forget the name of an old dive buddy, you can enter
5526 @samp{div} and then @key{SPC} to get a listing of all your dive buddies.
5527
5528 An alias for the sender of the current message is added automatically
5529 by clicking on the @samp{Grab From alias} tool bar button or by running
5530 the @kbd{M-x mh-alias-grab-from-field} command. Aliases for other
5531 recipients of the current message are added by placing your cursor
5532 over the desired recipient and giving the @kbd{M-x
5533 mh-alias-add-address-under-point} command.
5534
5535 The options @code{mh-alias-insert-file} and
5536 @code{mh-alias-insertion-location} controls how and where these aliases
5537 are inserted.
5538
5539 The default setting of this option is @samp{Use Aliasfile Profile
5540 Component}. This option can also hold the name of a file or a list a
5541 file names. If this option is set to a list of file names, or the
5542 @samp{Aliasfile:} profile component contains more than one file name,
5543 MH-E will prompt for one of them.
5544
5545 The option @code{mh-alias-insertion-location} is set to
5546 @samp{Alphabetical} by default. If you organize your alias file in
5547 other ways, then the settings @samp{Top} and @samp{Bottom} might be
5548 more appropriate.
5549
5550 @heading Querying Aliases
5551
5552 @cindex regular expressions, @code{mh-alias-apropos}
5553
5554 If you can't quite remember an alias, you can use @kbd{M-x
5555 mh-alias-apropos} to show all aliases or addresses that match a
5556 regular expression
5557 @ifnothtml
5558 (@pxref{Regexps, , Syntax of Regular Expressions, emacs, The
5559 GNU Emacs Manual}).
5560 @end ifnothtml
5561 @ifhtml
5562 (see the section
5563 @uref{http://www.gnu.org/software/emacs/manual/html_node/Regexps.html,
5564 Syntax of Regular Expressions} in
5565 @cite{The GNU Emacs Manual}).
5566 @end ifhtml
5567
5568 @node Identities, Speedbar, Aliases, Top
5569 @chapter Identities
5570
5571 @cindex identities
5572 @cindex multiple personalities
5573
5574 MH-E supports the concept of multiple personalities or identities.
5575 This means that you can easily have a different header and signature
5576 at home and at work.
5577
5578 A couple of commands are used to insert identities in MH-Letter mode
5579 which are also found in the @samp{Identity} menu.
5580
5581 @table @kbd
5582 @kindex C-c C-d
5583 @findex mh-insert-identity
5584 @item C-c C-d
5585 Insert fields specified by given identity (@code{mh-insert-identity}).
5586 @c -------------------------
5587 @cindex @samp{Identity > Insert Auto Fields} menu item
5588 @cindex menu item, @samp{Identity > Insert Auto Fields}
5589 @kindex C-c M-d
5590 @findex mh-insert-auto-fields
5591 @item C-c M-d
5592 Insert custom fields if recipient found in @code{mh-auto-fields-list}
5593 (@code{mh-insert-auto-fields}).
5594 @end table
5595
5596 @cindex @samp{mh-identity} customization group
5597 @cindex customization group, @samp{mh-identity}
5598
5599 The @samp{mh-identity} customization group contains the following
5600 options.
5601
5602 @vtable @code
5603 @item mh-auto-fields-list
5604 List of recipients for which header lines are automatically inserted
5605 (default: @code{nil}).
5606 @c -------------------------
5607 @item mh-auto-fields-prompt-flag
5608 On means to prompt before sending if fields inserted (default:
5609 @samp{on})
5610 @c -------------------------
5611 @item mh-identity-default
5612 Default identity to use when @code{mh-letter-mode} is called (default:
5613 @samp{None}).
5614 @c -------------------------
5615 @item mh-identity-handlers
5616 Handler functions for fields in @code{mh-identity-list}.
5617 @c -------------------------
5618 @item mh-identity-list
5619 List of identities (default: @code{nil}).
5620 @end vtable
5621
5622 Some of the common header fields that people change depending on the
5623 context are the @samp{From:} and @samp{Organization:} fields, as well
5624 as the signature.
5625
5626 This is done by customizing the option @code{mh-identity-list}. In the
5627 customization buffer for this option, click on the @samp{INS} button
5628 and enter a label such as @samp{Home} or @samp{Work}. Then click on
5629 the @samp{INS} button with the label @samp{Add at least one item
5630 below}. The @samp{Value Menu} has the following menu items:
5631
5632 @table @samp
5633 @cindex header field, @samp{From:}
5634 @cindex @samp{From:} header field
5635 @item From Field
5636 Specify an alternate @samp{From:} header field. You must include a
5637 valid email address. A standard format is @samp{First Last
5638 <login@@host.domain>}. If you use an initial with a period, then you
5639 must quote your name as in @samp{"First I. Last"
5640 <login@@host.domain>}.
5641 @c -------------------------
5642 @cindex header field, @samp{Organization:}
5643 @cindex @samp{Organization:} header field
5644 @item Organization Field
5645 People usually list the name of the company where they work here.
5646 @c -------------------------
5647 @item Other Field
5648 Set any arbitrary header field and value here. Unless the header field
5649 is a standard one, precede the name of your field's label with
5650 @samp{X-}, as in @samp{X-Fruit-of-the-Day:}.
5651 @c -------------------------
5652 @item Attribution Verb
5653 This value overrides the setting of
5654 @code{mh-extract-from-attribution-verb}. @xref{Inserting Letter}.
5655 @c -------------------------
5656 @cindex signature
5657 @vindex mh-signature-file-name
5658 @item Signature
5659 Set your signature with this item. You can specify the contents of
5660 @code{mh-signature-file-name}, a file, or a function.
5661 @xref{Signature}.
5662 @c -------------------------
5663 @item GPG Key ID
5664 Specify a different key to sign or encrypt messages.
5665 @end table
5666
5667 @cindex Identity menu
5668 @cindex menu, Identity
5669
5670 You can select the identities you have added via the menu called
5671 @samp{Identity} in the MH-Letter buffer. You can also use @kbd{C-c
5672 C-d} (@code{mh-insert-identity}). To clear the fields and signature
5673 added by the identity, select the @samp{None} identity.
5674
5675 @cindex @samp{Identity > Save as Default} menu item
5676 @cindex menu item, @samp{Identity > Save as Default}
5677 @cindex @samp{Identity > Set Default for Session} menu item
5678 @cindex menu item, @samp{Identity > Set Default for Session}
5679 @cindex @samp{Identity > Customize Identities} menu item
5680 @cindex menu item, @samp{Identity > Customize Identities}
5681
5682 The @samp{Identity} menu contains two other items to save you from
5683 having to set the identity on every message. The menu item @samp{Set
5684 Default for Session} can be used to set the default identity to the
5685 current identity until you exit Emacs. The menu item @samp{Save as
5686 Default} sets the option @code{mh-identity-default} to the current
5687 identity setting. You can also customize the option
5688 @code{mh-identity-default} in the usual fashion. If you find that you
5689 need to add another identity, the menu item @samp{Customize
5690 Identities} is available for your convenience.
5691
5692 @cindex regular expressions, @code{mh-auto-fields-list}
5693
5694 The option @code{mh-auto-fields-list} can also be used to set the
5695 identity depending on the recipient to provide even more control. To
5696 customize @code{mh-auto-fields-list}, click on the @samp{INS} button
5697 and enter a regular expression for the recipient's address
5698 @ifnothtml
5699 (@pxref{Regexps, , Syntax of Regular Expressions, emacs, The
5700 GNU Emacs Manual}).
5701 @end ifnothtml
5702 @ifhtml
5703 (see the section
5704 @uref{http://www.gnu.org/software/emacs/manual/html_node/Regexps.html,
5705 Syntax of Regular Expressions} in
5706 @cite{The GNU Emacs Manual}).
5707 @end ifhtml
5708 Click on the @samp{INS} button with the @samp{Add at least one item
5709 below} label. The @samp{Value Menu} contains the following menu items:
5710
5711 @table @samp
5712 @item Identity
5713 Select an identity from those configured in @code{mh-identity-list}.
5714 All of the information for that identity will be added if the
5715 recipient matches.
5716 @c -------------------------
5717 @cindex @samp{Fcc:} header field
5718 @cindex header field, @samp{Fcc:}
5719 @item Fcc Field
5720 Insert an @samp{Fcc:} header field with the folder you provide. When
5721 you send the message, MH will put a copy of your message in this
5722 folder.
5723 @c -------------------------
5724 @cindex @samp{Mail-Followup-To:} header field
5725 @cindex header field, @samp{Mail-Followup-To:}
5726 @item Mail-Followup-To Field
5727 Insert an @samp{Mail-Followup-To:} header field with the recipients
5728 you provide. If the recipient's mail user agent supports this header
5729 field@footnote{@samp{Mail-Followup-To:} is supported by nmh.}, then
5730 their replies will go to the addresses listed. This is useful if their
5731 replies go both to the list and to you and you don't have a mechanism
5732 to suppress duplicates. If you reply to someone not on the list, you
5733 must either remove the @samp{Mail-Followup-To:} field, or ensure the
5734 recipient is also listed there so that he receives replies to your
5735 reply.
5736 @c -------------------------
5737 @item Other Field
5738 Other header fields may be added using this menu item.
5739 @end table
5740
5741 These fields can only be added after the recipient is known. Because
5742 you can continue to add recipients as you edit the draft, MH-E waits
5743 until the message is sent to perform the auto-insertions. This seems
5744 strange at first, but you'll get used to it. There are two ways to
5745 help you feel that the desired fields are added. The first is the
5746 action when the message is sent: if any fields are added
5747 automatically, you are given a chance to see and to confirm these
5748 fields before the message is actually sent. You can do away with this
5749 confirmation by turning off the option
5750 @code{mh-auto-fields-prompt-flag}. The second method is manual: once
5751 the header contains one or more recipients, you may run the command
5752 @kbd{C-c M-d} (@code{mh-insert-auto-fields}) or choose the
5753 @samp{Identity -> Insert Auto Fields} menu item to insert these fields
5754 manually. However, if you use this command, the automatic insertion
5755 when the message is sent is disabled.
5756
5757 You should avoid using the same header field in
5758 @code{mh-auto-fields-list} and @code{mh-identity-list} definitions
5759 that may apply to the same message as the result is undefined.
5760
5761 The option @code{mh-identity-handlers} is used to change the way that
5762 fields, signatures, and attributions in @code{mh-identity-list} are
5763 added. To customize @code{mh-identity-handlers}, replace the name of
5764 an existing handler function associated with the field you want to
5765 change with the name of a function you have written. You can also
5766 click on an @samp{INS} button and insert a field of your choice and
5767 the name of the function you have written to handle it.
5768
5769 The @samp{Field} field can be any field that you've used in your
5770 @code{mh-identity-list}. The special fields @samp{:attribution-verb},
5771 @samp{:signature}, or @samp{:pgg-default-user-id} are used for the
5772 @code{mh-identity-list} choices @samp{Attribution Verb},
5773 @samp{Signature}, and @samp{GPG Key ID} respectively.
5774
5775 The handler associated with the @samp{:default} field is used when no
5776 other field matches.
5777
5778 The handler functions are passed two or three arguments: the field
5779 itself (for example, @samp{From}), or one of the special fields (for
5780 example, @samp{:signature}), and the action @samp{'remove} or
5781 @samp{'add}. If the action is @samp{'add}, an additional argument
5782 containing the value for the field is given.
5783
5784 @node Speedbar, Menu Bar, Identities, Top
5785 @chapter The Speedbar
5786
5787 @cindex folder navigation
5788 @cindex speedbar
5789
5790 You can also use the speedbar
5791 @ifnothtml
5792 (@pxref{Speedbar, , Speedbar Frames, emacs, The GNU Emacs Manual},)
5793 @end ifnothtml
5794 @ifhtml
5795 (see the section
5796 @uref{http://www.gnu.org/software/emacs/manual/html_node/Speedbar.html,
5797 Speedbar Frames} in @cite{The GNU Emacs Manual})
5798 @end ifhtml
5799 to view your folders. To bring up the speedbar, run @kbd{M-x speedbar
5800 @key{RET}}. You will see a new frame appear with all of your MH
5801 folders. Folders with unseen messages appear in boldface. Click on a
5802 folder name with @kbd{Mouse-2} to visit that folder in a similar
5803 fashion to the command @kbd{F v} (@code{mh-visit-folder})
5804 (@pxref{Folders}). Click on the @samp{+} icon to expand and view the
5805 sub-folders of that folder.
5806
5807 The speedbar can be manipulated with the keyboard as well. Use the
5808 Emacs navigational keys (like the arrow keys, or @kbd{C-n}) to move
5809 the cursor over the desired folder and then use the shortcuts for the
5810 menu items listed in the table below.
5811
5812 @table @samp
5813 @findex mh-speed-view
5814 @item Visit Folder (@key{RET})
5815 Visits the selected folder just as if you had used @kbd{F v}
5816 (@code{mh-speed-view}).
5817 @c -------------------------
5818 @findex mh-speed-expand-folder
5819 @item Expand Nested Folders (@kbd{+})
5820 Expands the selected folder in the speedbar, exposing the children
5821 folders inside it (@code{mh-speed-expand-folder}).
5822 @c -------------------------
5823 @findex mh-speed-contract-folder
5824 @item Contract Nested Folders (@kbd{-})
5825 Contracts or collapses the selected folder in the speedbar, hiding the
5826 children folders inside it (@code{mh-speed-contract-folder}).
5827 @c -------------------------
5828 @findex mh-speed-refresh
5829 @item Refresh Speedbar (@kbd{r})
5830 Regenerates the list of folders in the speedbar. Run this command if
5831 you've added or deleted a folder, or want to update the unseen message
5832 count before the next automatic update (@code{mh-speed-refresh}).
5833 @end table
5834
5835 You can click on @kbd{Mouse-3} to bring up a context menu that
5836 contains these items. Dismiss the speedbar with @kbd{C-x 5 0}
5837 (@code{delete-frame}).
5838
5839 @cindex @command{flists}
5840 @cindex MH commands, @command{flists}
5841 @cindex @samp{mh-speedbar} customization group
5842 @cindex customization group, @samp{mh-speedbar}
5843
5844 The MH-E speedbar uses the MH command @command{flists}@footnote{See
5845 the section @uref{@value{MH-BOOK-HOME}/morseq.htm#flist, Searching for
5846 Sequences with flist} in the MH book.} to generate the list of
5847 folders. The @samp{mh-speedbar} customization group contains the
5848 following option which controls how often the speedbar calls
5849 @command{flists}.
5850
5851 @vtable @code
5852 @item mh-speed-update-interval
5853 Time between speedbar updates in seconds (default: 60). Set to 0 to
5854 disable automatic update.
5855 @end vtable
5856
5857 You can modify the appearance of the folders in the speedbar by
5858 customizing the following faces.
5859
5860 @vtable @code
5861 @item mh-speedbar-folder
5862 Basic folder face.
5863 @c -------------------------
5864 @item mh-speedbar-folder-with-unseen-messages
5865 Folder face when folder contains unread messages.
5866 @c -------------------------
5867 @item mh-speedbar-selected-folder
5868 Selected folder face.
5869 @c -------------------------
5870 @item mh-speedbar-selected-folder-with-unseen-messages
5871 Selected folder face when folder contains unread messages.
5872 @end vtable
5873
5874 @node Menu Bar, Tool Bar, Speedbar, Top
5875 @chapter The Menu Bar
5876
5877 @cindex menu bar
5878
5879 @cindex Folder menu
5880 @cindex Identity menu
5881 @cindex Letter menu
5882 @cindex MH-Folder mode
5883 @cindex MH-Letter mode
5884 @cindex MH-Search mode
5885 @cindex Message menu
5886 @cindex Search menu
5887 @cindex Sequence menu
5888 @cindex menu, Folder
5889 @cindex menu, Identity
5890 @cindex menu, Letter
5891 @cindex menu, Message
5892 @cindex menu, Search
5893 @cindex menu, Sequence
5894 @cindex modes, MH-Folder
5895 @cindex modes, MH-Letter
5896 @cindex modes, MH-Search
5897
5898 For those of you who prefer to mouse and menu instead of using the
5899 meta-coke-bottle-bucky keys, MH-E provides menu items for most of its
5900 functions. The MH-Folder buffer adds the @samp{Folder},
5901 @samp{Message}, and @samp{Sequence} menus. The MH-Letter buffer adds
5902 the @samp{Identity} and @samp{Letter} menus. The MH-Search buffer adds
5903 the @samp{Search} menu. There's no need to list the actual items here,
5904 as you can more easily see them for yourself, and the functions are
5905 already described elsewhere in this manual.
5906
5907 For a description of the menu bar, please
5908 @ifnothtml
5909 @xref{Menu Bar, , The Menu Bar, emacs, The GNU Emacs Manual}.
5910 @end ifnothtml
5911 @ifhtml
5912 see the section
5913 @uref{http://www.gnu.org/software/emacs/manual/html_node/Menu-Bar.html,
5914 The Menu Bar} in @cite{The GNU Emacs Manual}.
5915 @end ifhtml
5916
5917 The Emacs manual describes how to get online help for a particular
5918 menu item. You can also look up a menu item in the index of this
5919 manual in two ways: all of the menu items are listed alphabetically,
5920 and you can also browse all of the items under the index entry
5921 @samp{menu item}.
5922
5923 @node Tool Bar, Searching, Menu Bar, Top
5924 @chapter The Tool Bar
5925
5926 @cindex tool bar
5927 @cindex @samp{mh-tool-bar} customization group
5928 @cindex customization group, @samp{mh-tool-bar}
5929
5930 Emacs also provides a graphical tool bar. For a description of the
5931 tool bar, please
5932 @ifnothtml
5933 @xref{Tool Bars, , Tool Bars, emacs, The GNU Emacs Manual}.
5934 @end ifnothtml
5935 @ifhtml
5936 see the section
5937 @uref{http://www.gnu.org/software/emacs/manual/html_node/Tool-Bars.html,
5938 Tool Bars} in @cite{The GNU Emacs Manual}.
5939 @end ifhtml
5940
5941 MH-E adds several icons to this tool bar; you can modify the MH-E
5942 aspects of the tool bar via the @samp{mh-tool-bar} customization group.
5943
5944 @vtable @code
5945 @item mh-tool-bar-folder-buttons
5946 List of buttons to include in MH-Folder tool bar (default: a checklist
5947 too long to list here).
5948 @c -------------------------
5949 @item mh-tool-bar-letter-buttons
5950 List of buttons to include in MH-Letter tool bar (default: a checklist
5951 too long to list here).
5952 @c -------------------------
5953 @item mh-tool-bar-search-function
5954 Function called by the tool bar search button (default:
5955 @code{mh-search}).
5956 @c -------------------------
5957 @item mh-xemacs-tool-bar-position
5958 Tool bar location (default: @samp{Same As Default Tool Bar}).
5959 @c -------------------------
5960 @item mh-xemacs-use-tool-bar-flag
5961 If on, use tool bar (default: on, if supported).
5962 @end vtable
5963
5964 In GNU Emacs, icons for some of MH-E's functions are added to the tool
5965 bar. In XEmacs, you have the opportunity to create a separate tool bar for
5966 the MH-E icons.
5967
5968 In either case, you can select which of these functions you'd like to
5969 see by customizing the options @code{mh-tool-bar-folder-buttons} and
5970 @code{mh-tool-bar-letter-buttons}. As you probably guessed, the former
5971 customizes the tool bar in MH-Folder mode and the latter in MH-Letter
5972 mode. Both of these options present you with a list of functions;
5973 check the functions whose icons you want to see and clear the check
5974 boxes for those you don't.
5975
5976 The function associated with the searching icon can be set via the
5977 option @code{mh-tool-bar-search-function}. By default, this is set to
5978 @code{mh-search}. @xref{Searching}. You can also choose @samp{Other
5979 Function} from the @samp{Value Menu} and enter a function of your own
5980 choosing.
5981
5982 XEmacs provides a couple of extra options. The first,
5983 @code{mh-xemacs-use-tool-bar-flag}, controls whether to show the MH-E
5984 icons at all. By default, this option is turned on if the window
5985 system supports tool bars. If your system doesn't support tool bars,
5986 then you won't be able to turn on this option.
5987
5988 The second extra option is @code{mh-xemacs-tool-bar-position} which
5989 controls the placement of the tool bar along the four edges of the
5990 frame. You can choose from one of @samp{Same As Default Tool Bar},
5991 @samp{Top}, @samp{Bottom}, @samp{Left}, or @samp{Right}. If this
5992 variable is set to anything other than @samp{Same As Default Tool Bar}
5993 and the default tool bar is in a different location, then two tool
5994 bars will be displayed: the MH-E tool bar and the default tool bar."
5995
5996 @node Searching, Threading, Tool Bar, Top
5997 @chapter Searching Through Messages
5998
5999 @cindex searching
6000
6001 @findex mh-search
6002 @kindex F s
6003
6004 Earlier, the command @kbd{F s} (@code{mh-search}) was introduced which
6005 helps you find messages that lie buried in your folders
6006 (@pxref{Folders}). This chapter covers this command in more detail.
6007 Several commands are used to compose the search criteria and to start
6008 searching. A couple of them can be found in the @samp{Search} menu.
6009
6010 @table @kbd
6011 @kindex C-c ?
6012 @findex mh-help
6013 @item C-c ?
6014 Display cheat sheet for the MH-E commands (@code{mh-help}).
6015 @c -------------------------
6016 @cindex @samp{Search > Perform Search} menu item
6017 @cindex menu item, @samp{Search > Perform Search}
6018 @kindex C-c C-c
6019 @findex mh-index-do-search
6020 @item C-c C-c
6021 Find messages using @code{mh-search-program}
6022 (@code{mh-index-do-search}).
6023 @c -------------------------
6024 @cindex @samp{Search > Search with pick} menu item
6025 @cindex menu item, @samp{Search > Search with pick}
6026 @kindex C-c C-p
6027 @findex mh-pick-do-search
6028 @item C-c C-p
6029 Find messages using @command{pick} (@code{mh-pick-do-search}).
6030 @c -------------------------
6031 @kindex C-c ?
6032 @findex mh-help
6033 @item C-c ?
6034 Display cheat sheet for the MH-E commands (@code{mh-help}).
6035 @c -------------------------
6036 @kindex C-c C-f C-a
6037 @kindex C-c C-f a
6038 @findex mh-to-field
6039 @item C-c C-f a
6040 @itemx C-c C-f C-a
6041 Move to @samp{Mail-Reply-To:} header field (@code{mh-to-field}).
6042 @c -------------------------
6043 @kindex C-c C-f C-b
6044 @kindex C-c C-f b
6045 @item C-c C-f b
6046 @itemx C-c C-f C-b
6047 Move to @samp{Bcc:} header field (@code{mh-to-field}).
6048 @c -------------------------
6049 @kindex C-c C-f C-c
6050 @kindex C-c C-f c
6051 @item C-c C-f c
6052 @itemx C-c C-f C-c
6053 Move to @samp{Cc:} header field (@code{mh-to-field}).
6054 @c -------------------------
6055 @kindex C-c C-f C-d
6056 @kindex C-c C-f d
6057 @item C-c C-f d
6058 @itemx C-c C-f C-d
6059 Move to @samp{Dcc:} header field (@code{mh-to-field}).
6060 @c -------------------------
6061 @kindex C-c C-f C-f
6062 @kindex C-c C-f f
6063 @item C-c C-f f
6064 @itemx C-c C-f C-f
6065 Move to @samp{Fcc:} header field (@code{mh-to-field}).
6066 @c -------------------------
6067 @kindex C-c C-f C-l
6068 @kindex C-c C-f l
6069 @item C-c C-f l
6070 @itemx C-c C-f C-l
6071 Move to @samp{Mail-Followup-To:} header field (@code{mh-to-field}).
6072 @c -------------------------
6073 @kindex C-c C-f C-m
6074 @kindex C-c C-f m
6075 @item C-c C-f m
6076 @itemx C-c C-f C-m
6077 Move to @samp{From:} header field (@code{mh-to-field}).
6078 @c -------------------------
6079 @kindex C-c C-f C-r
6080 @kindex C-c C-f r
6081 @item C-c C-f r
6082 @itemx C-c C-f C-r
6083 Move to @samp{Reply-To:} header field (@code{mh-to-field}).
6084 @c -------------------------
6085 @kindex C-c C-f C-s
6086 @kindex C-c C-f s
6087 @item C-c C-f s
6088 @itemx C-c C-f C-s
6089 Move to @samp{Subject:} header field (@code{mh-to-field}).
6090 @c -------------------------
6091 @kindex C-c C-f C-t
6092 @kindex C-c C-f t
6093 @item C-c C-f t
6094 @itemx C-c C-f C-t
6095 Move to @samp{To:} header field (@code{mh-to-field}).
6096 @end table
6097
6098 Another few commands are available in the MH-Folder buffer resulting
6099 from a search.
6100
6101 @table @kbd
6102 @kindex @key{TAB}
6103 @findex mh-index-next-folder
6104 @item @key{TAB}
6105 Jump to the next folder marker (@code{mh-index-next-folder}).
6106 @c -------------------------
6107 @kindex S-@key{TAB}
6108 @findex mh-index-previous-folder
6109 @item S-@key{TAB}
6110 Jump to the previous folder marker (@code{mh-index-previous-folder}).
6111 @c -------------------------
6112 @kindex v
6113 @findex mh-index-visit-folder
6114 @item v
6115 Visit original folder from where the message at point was found
6116 (@code{mh-index-visit-folder}).
6117 @end table
6118
6119 @cindex @samp{mh-search} customization group
6120 @cindex customization group, @samp{mh-search}
6121
6122 There is one option from the @samp{mh-search} customization group used
6123 in searching.
6124
6125 @vtable @code
6126 @item mh-search-program
6127 Search program that MH-E shall use (default: @samp{Auto-detect}).
6128 @end vtable
6129
6130 The following hook is available.
6131
6132 @vtable @code
6133 @item mh-search-mode-hook
6134 Hook run upon entry to @code{mh-search-mode} (default: @code{nil}).
6135 @end vtable
6136
6137 The following face is available.
6138
6139 @vtable @code
6140 @item mh-search-folder
6141 Folder heading face in MH-Folder buffers created by searches.
6142 @end vtable
6143
6144 The command @kbd{F s} (@code{mh-search-folder}) helps you find
6145 messages in your entire corpus of mail. You can search for messages to
6146 or from a particular person or about a particular subject. In fact,
6147 you can also search for messages containing selected strings in any
6148 arbitrary header field or any string found within the messages.
6149
6150 Out of the box, MH-E uses @command{pick} to find messages. With a
6151 little extra effort, you can set an indexing program which rewards you
6152 with extremely quick results. The drawback is that sometimes the index
6153 does not contain the words you're looking for. You can still use
6154 @command{pick} in these situations.
6155
6156 You are prompted for the folder to search. This can be @samp{all} to
6157 search all folders. Note that the search works recursively on the
6158 listed folder.
6159
6160 @cindex MH-Search mode
6161 @cindex modes, MH-Search
6162
6163 Next, an MH-Search buffer appears where you can enter search criteria.
6164
6165 @cartouche
6166 @smallexample
6167 From: #
6168 To:
6169 Cc:
6170 Date:
6171 Subject:
6172 --------
6173
6174
6175
6176
6177
6178
6179
6180
6181
6182 --:** search-pattern (MH-Search)--L1--All-----------------------------
6183
6184 @end smallexample
6185 @end cartouche
6186 @i{Search window}
6187
6188 @cindex @command{pick}
6189 @cindex MH commands, @command{pick}
6190
6191 Edit this template by entering your search criteria in an appropriate
6192 header field that is already there, or create a new field yourself. If
6193 the string you're looking for could be anywhere in a message, then
6194 place the string underneath the row of dashes.
6195
6196 As an example, let's say that we want to find messages from Ginnean
6197 about horseback riding in the Kosciusko National Park (Australia)
6198 during January, 1994. Normally we would start with a broad search and
6199 narrow it down if necessary to produce a manageable amount of data,
6200 but we'll cut to the chase and create a fairly restrictive set of
6201 criteria as follows:
6202
6203 @smallexample
6204 @group
6205 From: ginnean
6206 To:
6207 Cc:
6208 Date: Jan 1994
6209 Subject:
6210 --------
6211 horse
6212 kosciusko
6213 @end group
6214 @end smallexample
6215
6216 As with MH-Letter mode, MH-Search provides commands like @kbd{C-c C-f
6217 C-t} (@code{mh-to-field}) to help you fill in the blanks.
6218 @xref{Editing Message}.
6219
6220 If you find that you do the same thing over and over when editing the
6221 search template, you may wish to bind some shortcuts to keys. This can
6222 be done with the variable @code{mh-search-mode-hook}, which is called
6223 when @kbd{F s} is run on a new pattern.
6224
6225 @cindex @samp{+mhe-index}
6226 @cindex folders, @samp{+mhe-index}
6227 @findex mh-index-do-search
6228 @findex mh-index-next-folder
6229 @findex mh-index-previous-folder
6230 @findex mh-pick-do-search
6231 @kindex @key{TAB}
6232 @kindex C-c C-c
6233 @kindex F s
6234 @kindex S-@key{TAB}
6235 @vindex mh-search-folder
6236
6237 To perform the search, type @kbd{C-c C-c} (@code{mh-index-do-search}).
6238 Sometimes you're searching for text that is either not indexed, or
6239 hasn't been indexed yet. In this case you can override the default
6240 method with the pick method by running the command @kbd{C-c C-p}
6241 (@code{mh-pick-do-search}).
6242
6243 The messages that are found are put in a temporary sub-folder of
6244 @samp{+mhe-index} and are displayed in an MH-Folder buffer. This
6245 buffer is special because it displays messages from multiple folders;
6246 each set of messages from a given folder has a heading with the folder
6247 name. The appearance of the heading can be modified by customizing the
6248 face @code{mh-search-folder}. You can jump back and forth between the
6249 headings using the commands @kbd{@key{TAB}}
6250 (@code{mh-index-next-folder}) and @kbd{S-@key{TAB}}
6251 (@code{mh-index-previous-folder}).
6252
6253 In addition, the command @kbd{v} (@code{mh-index-visit-folder}) can be
6254 used to visit the folder of the message at point. Initially, only the
6255 messages that matched the search criteria are displayed in the folder.
6256 While the temporary buffer has its own set of message numbers, the
6257 actual messages numbers are shown in the visited folder. Thus, the
6258 command @kbd{v} is useful to find the actual message number of an
6259 interesting message, or to view surrounding messages with the command
6260 @kbd{F r} @code{mh-rescan-folder}. @xref{Folders}.
6261
6262 Because this folder is temporary, you'll probably get in the habit of
6263 killing it when you're done with @kbd{F k} (@code{mh-kill-folder}).
6264 @xref{Folders}.
6265
6266 You can regenerate the results by running @kbd{F s} with a prefix
6267 argument.
6268
6269 @cindex @command{procmail}
6270 @cindex Unix commands, @command{procmail}
6271 @cindex @samp{X-MHE-Checksum:} header field
6272 @cindex header field, @samp{X-MHE-Checksum:}
6273
6274 Note: This command uses an @samp{X-MHE-Checksum:} header field to
6275 cache the MD5 checksum of a message. This means that if an incoming
6276 message already contains an @samp{X-MHE-Checksum:} field, that message
6277 might not be found by this command. The following @command{procmail}
6278 recipe avoids this problem by renaming the existing header field:
6279
6280 @smallexample
6281 @group
6282 :0 wf
6283 | formail -R "X-MHE-Checksum" "X-Old-MHE-Checksum"
6284 @end group
6285 @end smallexample
6286
6287 @xref{Limits}, for an alternative interface to searching.
6288
6289 @section Configuring Indexed Searches
6290
6291 @cindex @command{grep}
6292 @cindex @command{mairix}
6293 @cindex @command{namazu}
6294 @cindex @command{pick}
6295 @cindex @command{swish++}
6296 @cindex @command{swish-e}
6297 @cindex Unix commands, @command{grep}
6298 @cindex Unix commands, @command{mairix}
6299 @cindex Unix commands, @command{namazu}
6300 @cindex Unix commands, @command{pick}
6301 @cindex Unix commands, @command{swish++}
6302 @cindex Unix commands, @command{swish-e}
6303 @findex mh-search
6304 @kindex F s
6305 @vindex mh-search-program
6306
6307 The command @kbd{F s} (@code{mh-search}) runs the command defined by
6308 the option @code{mh-search-program}. The default value is
6309 @samp{Auto-detect} which means that MH-E will automatically choose one
6310 of @command{swish++}, @command{swish-e}, @command{mairix},
6311 @command{namazu}, @command{pick} and @command{grep} in that order. If,
6312 for example, you have both @command{swish++} and @command{mairix}
6313 installed and you want to use @command{mairix}, then you can set this
6314 option to @samp{mairix}.
6315
6316 The following sub-sections describe how to set up the various indexing
6317 programs to use with MH-E.
6318
6319 @subsection swish++
6320
6321 @cindex @command{swish++}
6322 @cindex Unix commands, @command{swish++}
6323
6324 In the examples below, replace @file{/home/user/Mail} with the path to
6325 your MH directory.
6326
6327 First create the directory @file{/home/user/Mail/.swish++}. Then
6328 create the file @file{/home/user/Mail/.swish++/swish++.conf} with the
6329 following contents:
6330
6331 @smallexample
6332 @group
6333 IncludeMeta Bcc Cc Comments Content-Description From Keywords
6334 IncludeMeta Newsgroups Resent-To Subject To
6335 IncludeMeta Message-Id References In-Reply-To
6336 IncludeFile Mail *
6337 IndexFile /home/user/Mail/.swish++/swish++.index
6338 @end group
6339 @end smallexample
6340
6341 Use the following command line to generate the swish index. Run this
6342 daily from cron:
6343
6344 @smallexample
6345 @group
6346 find /home/user/Mail -path /home/user/Mail/mhe-index -prune \
6347 -o -path /home/user/Mail/.swish++ -prune \
6348 -o -name "[0-9]*" -print \
6349 | index -c /home/user/Mail/.swish++/swish++.conf -
6350 @end group
6351 @end smallexample
6352
6353 This command does not index the folders that hold the results of your
6354 searches in @samp{+mhe-index} since they tend to be ephemeral and the
6355 original messages are indexed anyway.
6356
6357 @cindex @command{index}
6358 @cindex Unix commands, @command{index}
6359 @cindex @command{index++}
6360 @cindex Unix commands, @command{index++}
6361
6362 On some systems (Debian GNU/Linux, for example), use @command{index++}
6363 instead of @command{index}.
6364
6365 @subsection swish
6366
6367 @cindex @command{swish-e}
6368 @cindex Unix commands, @command{swish-e}
6369
6370 In the examples below, replace @file{/home/user/Mail} with the path to
6371 your MH directory.
6372
6373 First create the directory @file{/home/user/Mail/.swish}. Then create
6374 the file @file{/home/user/Mail/.swish/config} with the following
6375 contents:
6376
6377 @smallexample
6378 @group
6379 DefaultContents TXT*
6380 IndexDir /home/user/Mail
6381 IndexFile /home/user/Mail/.swish/index
6382 IndexName "Mail Index"
6383 IndexDescription "Mail Index"
6384 IndexPointer "http://nowhere"
6385 IndexAdmin "nobody"
6386 #MetaNames automatic
6387 IndexReport 3
6388 FollowSymLinks no
6389 UseStemming no
6390 IgnoreTotalWordCountWhenRanking yes
6391 WordCharacters abcdefghijklmnopqrstuvwxyz0123456789-
6392 BeginCharacters abcdefghijklmnopqrstuvwxyz
6393 EndCharacters abcdefghijklmnopqrstuvwxyz0123456789
6394 IgnoreLimit 50 1000
6395 IndexComments 0
6396 FileRules filename contains \D
6397 FileRules pathname contains /home/user/Mail/.swish
6398 FileRules pathname contains /home/user/Mail/mhe-index
6399 FileRules filename is index
6400 @end group
6401 @end smallexample
6402
6403 This configuration does not index the folders that hold the results of
6404 your searches in @samp{+mhe-index} since they tend to be ephemeral and
6405 the original messages are indexed anyway.
6406
6407 If there are any directories you would like to ignore, append lines
6408 like the following to @file{config}:
6409
6410 @smallexample
6411 FileRules pathname contains /home/user/Mail/scripts
6412 @end smallexample
6413
6414 @cindex @command{swish-e}
6415 @cindex Unix commands, @command{swish-e}
6416
6417 Use the following command line to generate the swish index. Run this
6418 daily from cron:
6419
6420 @smallexample
6421 swish-e -c /home/user/Mail/.swish/config
6422 @end smallexample
6423
6424 @subsection mairix
6425
6426 @cindex @command{mairix}
6427 @cindex Unix commands, @command{mairix}
6428
6429 In the examples below, replace @file{/home/user/Mail} with the path to
6430 your MH directory.
6431
6432 First create the directory @file{/home/user/Mail/.mairix}. Then create
6433 the file @file{/home/user/Mail/.mairix/config} with the following
6434 contents:
6435
6436 @smallexample
6437 @group
6438 base=/home/user/Mail
6439
6440 # List of folders that should be indexed. 3 dots at the end means there
6441 # are subfolders within the folder
6442 mh=archive...:inbox:drafts:news:sent:trash
6443
6444 vfolder_format=raw
6445 database=/home/user/Mail/mairix/database
6446 @end group
6447 @end smallexample
6448
6449 Use the following command line to generate the mairix index. Run this daily
6450 from cron:
6451
6452 @smallexample
6453 mairix -f /home/user/Mail/.mairix/config
6454 @end smallexample
6455
6456 @subsection namazu
6457
6458 @cindex @command{namazu}
6459 @cindex Unix commands, @command{namazu}
6460
6461 In the examples below, replace @file{/home/user/Mail} with the path to
6462 your MH directory.
6463
6464 First create the directory @file{/home/user/Mail/.namazu}. Then create
6465 the file @file{/home/user/Mail/.namazu/mknmzrc} with the following
6466 contents:
6467
6468 @smallexample
6469 @group
6470 package conf; # Don't remove this line!
6471 $ADDRESS = 'user@@localhost';
6472 $ALLOW_FILE = "[0-9]*";
6473 $EXCLUDE_PATH = "^/home/user/Mail/(mhe-index|spam)";
6474 @end group
6475 @end smallexample
6476
6477 This configuration does not index the folders that hold the results of
6478 your searches in @samp{+mhe-index} since they tend to be ephemeral and
6479 the original messages are indexed anyway.
6480
6481 Use the following command line to generate the namazu index. Run this
6482 daily from cron:
6483
6484 @smallexample
6485 mknmz -f /home/user/Mail/.namazu/mknmzrc -O /home/user/Mail/.namazu \
6486 /home/user/Mail
6487 @end smallexample
6488
6489 @subsection pick
6490
6491 @cindex @command{pick}
6492 @cindex MH commands, @command{pick}
6493
6494 This search method does not require any setup.
6495
6496 Read @command{pick}(1) or the section
6497 @uref{@value{MH-BOOK-HOME}/finpic.htm, Finding Messages with pick} in
6498 the MH book to find out more about how to enter the criteria.
6499
6500 @subsection grep
6501
6502 @cindex @command{grep}
6503 @cindex Unix commands, @command{grep}
6504
6505 This search method does not require any setup.
6506
6507 Unlike the other search methods, this method does not use the
6508 MH-Search buffer. Instead, you simply enter a regular expression in
6509 the minibuffer. For help in constructing regular expressions, see your
6510 man page for @command{grep}.
6511
6512 @node Threading, Limits, Searching, Top
6513 @chapter Viewing Message Threads
6514
6515 @cindex threading
6516
6517 MH-E groups messages by @dfn{threads} which are messages that are part
6518 of the same discussion and usually all have the same @samp{Subject:}
6519 header field. Other ways to organize messages in a folder include
6520 limiting (@pxref{Limits}) or using full-text indexed searches
6521 (@pxref{Searching}).
6522
6523 A thread begins with a single message called a @dfn{root}. All replies
6524 to the same message are @dfn{siblings} of each other. Any message that
6525 has replies to it is an @dfn{ancestor} of those replies.
6526
6527 There are several commands that you can use to navigate and operate on
6528 threads.
6529
6530 @table @kbd
6531 @kindex T ?
6532 @findex mh-prefix-help
6533 @item T ?
6534 Display cheat sheet for the commands of the current prefix in
6535 minibuffer (@code{mh-prefix-help}).
6536 @c -------------------------
6537 @kindex T o
6538 @findex mh-thread-refile
6539 @item T o
6540 Refile (output) thread into folder (@code{mh-thread-refile}).
6541 @c -------------------------
6542 @kindex T d
6543 @findex mh-thread-delete
6544 @item T d
6545 Delete thread (@code{mh-thread-delete}).
6546 @c -------------------------
6547 @kindex T t
6548 @findex mh-toggle-threads
6549 @item T t
6550 Toggle threaded view of folder (@code{mh-toggle-threads}).
6551 @c -------------------------
6552 @kindex T n
6553 @findex mh-thread-next-sibling
6554 @item T n
6555 Display next sibling (@code{mh-thread-next-sibling}).
6556 @c -------------------------
6557 @kindex T p
6558 @findex mh-thread-previous-sibling
6559 @item T p
6560 Display previous sibling (@code{mh-thread-previous-sibling}).
6561 @c -------------------------
6562 @kindex T u
6563 @findex mh-thread-ancestor
6564 @item T u
6565 Display ancestor of current message (@code{mh-thread-ancestor}).
6566 @end table
6567
6568 The @samp{mh-thread} customization group contains one option.
6569
6570 @vtable @code
6571 @item mh-show-threads-flag
6572 On means new folders start in threaded mode (default: @samp{off}).
6573 @end vtable
6574
6575 Threading large number of messages can be time consuming so the option
6576 @code{mh-show-threads-flag} is turned off by default. If you turn on
6577 this option, then threading will be done only if the number of
6578 messages being threaded is less than @code{mh-large-folder}. In any
6579 event, threading can be turned on (and off) with the command @kbd{T t}
6580 (@code{mh-toggle-threads}).
6581
6582 There are a few commands to help you navigate threads. If you do not
6583 care for the way a particular thread has turned, you can move up the
6584 chain of messages with the command @kbd{T u}
6585 (@code{mh-thread-ancestor}. At any point you can use @kbd{T n}
6586 (@code{mh-thread-next-sibling} or @kbd{T p}
6587 (@code{mh-thread-previous-sibling}) to jump to the next or previous
6588 sibling, skipping the sub-threads. The command @kbd{T u} can also take
6589 a prefix argument to jump to the message that started everything.
6590
6591 There are threaded equivalents for the commands that delete and refile
6592 messages. For example, @kbd{T o} (@code{mh-thread-refile}) refiles the
6593 current message and all its children. Similarly, the command @kbd{T d}
6594 (@code{mh-thread-delete}) deletes the current message and all its
6595 children. These commands do not refile or delete sibling messages.
6596 @xref{Navigating}, for a description of the similar command @kbd{k}
6597 (@code{mh-delete-subject-or-thread}).
6598
6599 If you find that threading is too slow, it may be that you have
6600 @code{mh-large-folder} set too high. Threading is one of the few
6601 features of MH-E that really benefits from compiling. If you haven't
6602 compiled MH-E, I encourage you to do so@footnote{If you're not sure
6603 if MH-E has been byte-compiled, you could try running @samp{locate
6604 mh-thread.elc} or otherwise find MH-E on your system and ensure that
6605 @file{mh-thread.elc} exists. If you have multiple versions and you
6606 find that one is compiled but the other is not, then go into your
6607 @samp{*scratch*} buffer in Emacs, enter @kbd{load-path C-j}, and
6608 ensure that the byte-compiled version appears first in the
6609 @code{load-path}. If you find that MH-E is not compiled and you
6610 installed MH-E yourself, please refer to the installation directions
6611 in the file @file{README} in the distribution.}.
6612
6613 @node Limits, Sequences, Threading, Top
6614 @chapter Limiting Display
6615
6616 @cindex limits
6617 @cindex filters
6618
6619 Another way to organize messages in a folder besides threading
6620 (@pxref{Threading}) or using full-text indexed searches
6621 (@pxref{Searching}) is by limiting the folder display to messages that
6622 are similar to the current message.
6623
6624 @table @kbd
6625 @kindex / ?
6626 @findex mh-prefix-help
6627 @item / ?
6628 Display cheat sheet for the commands of the current prefix in
6629 minibuffer (@code{mh-prefix-help}).
6630 @c -------------------------
6631 @cindex @samp{Sequence > Narrow to Tick Sequence} menu item
6632 @cindex menu item, @samp{Sequence > Narrow to Tick Sequence}
6633 @kindex / '
6634 @findex mh-narrow-to-tick
6635 @item / '
6636 Limit to messages in the @samp{tick} sequence
6637 (@code{mh-narrow-to-tick}).
6638 @c -------------------------
6639 @kindex / c
6640 @findex mh-narrow-to-cc
6641 @item / c
6642 Limit to messages with the same @samp{Cc:} field
6643 (@code{mh-narrow-to-cc}).
6644 @c -------------------------
6645 @kindex / m
6646 @findex mh-narrow-to-from
6647 @item / m
6648 Limit to messages with the same @samp{From:} field
6649 (@code{mh-narrow-to-from}).
6650 @c -------------------------
6651 @kindex / g
6652 @findex mh-narrow-to-range
6653 @item / g
6654 Limit to range (@code{mh-narrow-to-range}).
6655 @c -------------------------
6656 @cindex @samp{Sequence > Narrow to Subject Sequence} menu item
6657 @cindex menu item, @samp{Sequence > Narrow to Subject Sequence}
6658 @kindex / s
6659 @findex mh-narrow-to-subject
6660 @item / s
6661 Limit to messages with the same @samp{Subject:} field
6662 (@code{mh-narrow-to-subject}).
6663 @c -------------------------
6664 @kindex / t
6665 @findex mh-narrow-to-to
6666 @item / t
6667 Limit to messages with the same @samp{To:} field
6668 (@code{mh-narrow-to-to}).
6669 @c -------------------------
6670 @cindex @samp{Sequence > Widen from Sequence} menu item
6671 @cindex menu item, @samp{Sequence > Widen from Sequence}
6672 @kindex / w
6673 @findex mh-widen
6674 @item / w
6675 Remove last restriction (@code{mh-widen}).
6676 @end table
6677
6678 All of the limiting commands above refine the display in some way.
6679
6680 @cindex @command{pick}
6681 @cindex MH commands, @command{pick}
6682
6683 The commands @kbd{/ c}, @code{/ m}, @code{/ s}, and @code{/ t}
6684 restrict the display to messages matching the content of the
6685 respective field in the current message. However, you can give any of
6686 these a prefix argument to edit the @command{pick} expression used to
6687 narrow the view@footnote{See @command{pick}(1) or the section
6688 @uref{@value{MH-BOOK-HOME}/finpic.htm, Finding Messages with pick} in
6689 the MH book.}.
6690
6691 @cindex @samp{tick} sequence
6692 @cindex sequence, @samp{tick}
6693 @cindex ticked messages, viewing
6694
6695 You can also limit the display to messages in the @samp{tick} sequence
6696 with the command @kbd{/ '} (@code{mh-narrow-to-tick}).
6697 @xref{Sequences}, for information on putting message into the
6698 @samp{tick} sequence. Use the @kbd{/ g} (@code{mh-narrow-to-range})
6699 command to limit the display to messages in a range (@pxref{Ranges}).
6700
6701 Each limit can be undone in turn with the @kbd{/ w} (@code{mh-widen})
6702 command. Give this command a prefix argument to remove all limits.
6703
6704 @node Sequences, Junk, Limits, Top
6705 @chapter Using Sequences
6706
6707 @cindex sequences
6708
6709 For the whole scoop on MH sequences, refer to
6710 @samp{mh-sequence}(5)@footnote{See the section
6711 @uref{@value{MH-BOOK-HOME}/morseq.htm, More About Sequences} in the MH
6712 book.}. As you've read, several of the MH-E commands can operate on a
6713 sequence, which is a shorthand for a range or group of messages. For
6714 example, you might want to forward several messages to a friend or
6715 colleague. Here's how to manipulate sequences. These commands are also
6716 available in the @samp{Sequence} menu.
6717
6718 @table @kbd
6719 @cindex @samp{Sequence > Toggle Tick Mark} menu item
6720 @cindex menu item, @samp{Sequence > Toggle Tick Mark}
6721 @kindex '
6722 @findex mh-toggle-tick
6723 @item '
6724 Toggle tick mark of range (@code{mh-toggle-tick}).
6725 @c -------------------------
6726 @kindex S ?
6727 @findex mh-prefix-help
6728 @item S ?
6729 Display cheat sheet for the commands of the current prefix in
6730 minibuffer (@code{mh-prefix-help}).
6731 @c -------------------------
6732 @cindex @samp{Sequence > Narrow to Tick Sequence} menu item
6733 @cindex menu item, @samp{Sequence > Narrow to Tick Sequence}
6734 @kindex S '
6735 @findex mh-narrow-to-tick
6736 @item S '
6737 Limit to ticked messages (@code{mh-narrow-to-tick}).
6738 @c -------------------------
6739 @cindex @samp{Sequence > Delete Message from Sequence...} menu item
6740 @cindex menu item, @samp{Sequence > Delete Message from Sequence...}
6741 @kindex S d
6742 @findex mh-delete-msg-from-seq
6743 @item S d
6744 Delete range from sequence (@code{mh-delete-msg-from-seq}).
6745 @c -------------------------
6746 @cindex @samp{Sequence > Delete Sequence...} menu item
6747 @cindex menu item, @samp{Sequence > Delete Sequence...}
6748 @kindex S k
6749 @findex mh-delete-seq
6750 @item S k
6751 Delete sequence (@code{mh-delete-seq}).
6752 @c -------------------------
6753 @cindex @samp{Sequence > List Sequences in Folder...} menu item
6754 @cindex menu item, @samp{Sequence > List Sequences in Folder...}
6755 @kindex S l
6756 @findex mh-list-sequences
6757 @item S l
6758 List all sequences in folder (@code{mh-list-sequences}).
6759 @c -------------------------
6760 @cindex @samp{Sequence > Narrow to Sequence...} menu item
6761 @cindex menu item, @samp{Sequence > Narrow to Sequence...}
6762 @kindex S n
6763 @findex mh-narrow-to-seq
6764 @item S n
6765 Restrict display to messages in sequence (@code{mh-narrow-to-seq}).
6766 @c -------------------------
6767 @cindex @samp{Sequence > Add Message to Sequence...} menu item
6768 @cindex menu item, @samp{Sequence > Add Message to Sequence...}
6769 @kindex S p
6770 @findex mh-put-msg-in-seq
6771 @item S p
6772 Add range to sequence (@code{mh-put-msg-in-seq}).
6773 @c -------------------------
6774 @cindex @samp{Sequence > List Sequences for Message} menu item
6775 @cindex menu item, @samp{Sequence > List Sequences for Message}
6776 @kindex S s
6777 @findex mh-msg-is-in-seq
6778 @item S s
6779 Display the sequences in which the current message appears
6780 (@code{mh-msg-is-in-seq}).
6781 @c -------------------------
6782 @cindex @samp{Sequence > Widen from Sequence} menu item
6783 @cindex menu item, @samp{Sequence > Widen from Sequence}
6784 @kindex S w
6785 @findex mh-widen
6786 @item S w
6787 Remove last restriction (@code{mh-widen}).
6788 @c -------------------------
6789 @findex mh-update-sequences
6790 @item M-x mh-update-sequences
6791 Flush MH-E's state out to MH@.
6792 @end table
6793
6794 @cindex @samp{mh-sequences} customization group
6795 @cindex customization group, @samp{mh-sequences}
6796
6797 The @samp{mh-sequences} customization group contains the options
6798 associated with sequences.
6799
6800 @vtable @code
6801 @item mh-refile-preserves-sequences-flag
6802 On means that sequences are preserved when messages are refiled
6803 (default: @samp{on}).
6804 @c -------------------------
6805 @item mh-tick-seq
6806 The name of the MH sequence for ticked messages (default: @samp{'tick}).
6807 @c -------------------------
6808 @item mh-update-sequences-after-mh-show-flag
6809 On means flush MH sequences to disk after message is shown (default:
6810 @samp{on}).
6811 @end vtable
6812
6813 The following hook is available.
6814
6815 @vtable @code
6816 @item mh-unseen-updated-hook
6817 Hook run after the unseen sequence has been updated (default: @code{nil}).
6818 @end vtable
6819
6820 @cindex @command{pick}
6821 @cindex MH commands, @command{pick}
6822
6823 To place a message in a sequence, use @kbd{S p}
6824 (@code{mh-put-msg-in-seq}). Give @kbd{S p} a range and you can add all
6825 the messages in a sequence to another sequence (for example, @kbd{C-u
6826 S p SourceSequence @key{RET} DestSequence @key{RET}}, @pxref{Ranges}).
6827
6828 @cindex @samp{tick} sequence
6829 @cindex sequence, @samp{tick}
6830 @cindex ticking messages
6831
6832 One specific use of the @kbd{S p} command is @kbd{'}
6833 (@code{mh-toggle-tick}) which adds messages to the @samp{tick}
6834 sequence. This sequence can be viewed later with the @kbd{F '} command
6835 (@pxref{Folders}).
6836
6837 You can customize the option @code{mh-tick-seq} if you already use the
6838 @samp{tick} sequence for your own use. You can also disable all of the
6839 ticking functions by choosing the @samp{Disable Ticking} item but
6840 there isn't much advantage to that.
6841
6842 @cindex MH-Folder mode
6843 @cindex modes, MH-Folder
6844
6845 Once you've placed some messages in a sequence, you may wish to narrow
6846 the field of view to just those messages in the sequence you've
6847 created. To do this, use @kbd{S n} (@code{mh-narrow-to-seq}). You are
6848 prompted for the name of the sequence. What this does is show only
6849 those messages that are in the selected sequence in the MH-Folder
6850 buffer. In addition, it limits further MH-E searches to just those
6851 messages. To narrow the view to the messages in the @samp{tick}
6852 sequence, use @kbd{S '} (@code{mh-narrow-to-tick}). When you want to
6853 widen the view to all your messages again, use @kbd{S w}
6854 (@code{mh-widen}).
6855
6856 @cindex @samp{*MH-E Sequences*}
6857 @cindex buffers, @samp{*MH-E Sequences*}
6858
6859 You can see which sequences in which a message appears with the
6860 command @kbd{S s} (@code{mh-msg-is-in-seq}). Use a prefix argument to
6861 display the sequences in which another message appears (as in @kbd{C-u
6862 42 S s @key{RET}}). Or, you can list all sequences in a selected
6863 folder (default is current folder) with @kbd{S l}
6864 (@code{mh-list-sequences}). The list appears in a buffer named
6865 @samp{*MH-E Sequences*} (@pxref{Miscellaneous}).
6866
6867 @cindex @samp{Previous-Sequence:} MH profile component
6868 @cindex @samp{cur} sequence
6869 @cindex MH profile component, @samp{Previous-Sequence:}
6870 @cindex sequence, @samp{Previous-Sequence}
6871 @cindex sequence, @samp{cur}
6872
6873 If a message is in any sequence (except
6874 @samp{Previous-Sequence:}@footnote{See @samp{mh-profile}(5)).} and
6875 @samp{cur}) when it is refiled, then it will still be in those
6876 sequences in the destination folder. If this behavior is not desired,
6877 then turn off the option @code{mh-refile-preserves-sequences-flag}.
6878
6879 If you want to remove a message (or range, @pxref{Ranges}) from a
6880 sequence, use @kbd{S d} (@code{mh-delete-msg-from-seq}). If you want
6881 to delete an entire sequence, use @kbd{S k} (@code{mh-delete-seq}). In
6882 the latter case you are prompted for the sequence to delete. Note that
6883 this deletes only the sequence, not the messages in the sequence. If
6884 you want to delete the messages, use @kbd{C-u d} (@pxref{Reading
6885 Mail}).
6886
6887 @cindex @samp{Unseen-Sequence:} MH profile component
6888 @cindex MH profile component, @samp{Unseen-Sequence:}
6889 @cindex sequence, @samp{Unseen-Sequence}
6890
6891 Three sequences are maintained internally by MH-E and pushed out to MH
6892 when a message is shown. They include the sequence specified by your
6893 @samp{Unseen-Sequence:} profile component, @samp{cur}, and the
6894 sequence listed by the option @code{mh-tick-seq} which is @samp{tick}
6895 by default. If you do not like this behavior, turn off the option
6896 @code{mh-update-sequences-after-mh-show-flag}. You can then update the
6897 state manually with the @kbd{x}, @kbd{q}, or @kbd{M-x
6898 mh-update-sequences} commands.
6899
6900 @vindex mh-seen-list
6901 @vindex mh-unseen-updated-hook
6902
6903 The hook @code{mh-unseen-updated-hook} is run after the unseen
6904 sequence has been updated. The variable @code{mh-seen-list} can be
6905 used by this hook to obtain the list of messages which were removed
6906 from the unseen sequence.
6907
6908 @cindex @command{mark}
6909 @cindex MH commands, @command{mark}
6910
6911 With the exceptions of @kbd{S n} and @kbd{S w}, the underlying MH
6912 command dealing with sequences is @command{mark}@footnote{See the
6913 section @uref{@value{MH-BOOK-HOME}/mmbwm.htm, Make Message Bookmarks
6914 with mark} in the MH book.}.
6915
6916 @node Junk, Miscellaneous, Sequences, Top
6917 @chapter Dealing With Junk Mail
6918
6919 @cindex Marshall Rose
6920 @cindex junk mail
6921 @cindex spam
6922
6923 Marshall Rose once wrote a paper on MH entitled, @cite{How to process
6924 200 messages a day and still get some real work done}. This chapter
6925 could be entitled, @cite{How to process 1000 spams a day and still get
6926 some real work done}.
6927
6928 @cindex blacklisting
6929 @cindex ham
6930 @cindex viruses
6931 @cindex whitelisting
6932 @cindex worms
6933
6934 We use the terms @dfn{junk mail} and @dfn{spam} interchangeably for
6935 any unwanted message which includes spam, @dfn{viruses}, and
6936 @dfn{worms}. The opposite of spam is @dfn{ham}. The act of classifying
6937 a sender as one who sends junk mail is called @dfn{blacklisting}; the
6938 opposite is called @dfn{whitelisting}.
6939
6940 @table @kbd
6941 @kindex J ?
6942 @findex mh-prefix-help
6943 @item J ?
6944 Display cheat sheet for the commands of the current prefix in
6945 minibuffer (@code{mh-prefix-help}).
6946 @c -------------------------
6947 @kindex J b
6948 @findex mh-junk-blacklist
6949 @item J b
6950 Blacklist range as spam (@code{mh-junk-blacklist}).
6951 @c -------------------------
6952 @kindex J w
6953 @findex mh-junk-whitelist
6954 @item J w
6955 Whitelist range as ham (@code{mh-junk-whitelist}).
6956 @c -------------------------
6957 @item @code{mh-spamassassin-identify-spammers}
6958 Identify spammers who are repeat offenders.
6959 @end table
6960
6961 @cindex @samp{mh-junk} customization group
6962 @cindex customization group, @samp{mh-junk}
6963
6964 The following table lists the options from the @samp{mh-junk}
6965 customization group.
6966
6967 @vtable @code
6968 @item mh-junk-background
6969 If on, spam programs are run in background (default: @samp{off}).
6970 @c -------------------------
6971 @item mh-junk-disposition
6972 Disposition of junk mail (default: @samp{Delete Spam}).
6973 @c -------------------------
6974 @item mh-junk-program
6975 Spam program that MH-E should use (default: @samp{Auto-detect}).
6976 @end vtable
6977
6978 @cindex SpamProbe
6979 @cindex Spamassassin
6980 @cindex bogofilter
6981 @cindex spam filters, SpamProbe
6982 @cindex spam filters, Spamassassin
6983 @cindex spam filters, bogofilter
6984
6985 MH-E depends on @uref{http://www.spamassassin.org/, SpamAssassin},
6986 @uref{http://bogofilter.sourceforge.net/, bogofilter}, or
6987 @uref{http://spamprobe.sourceforge.net/, SpamProbe} to throw the dreck
6988 away. This chapter describes briefly how to configure these programs
6989 to work well with MH-E and how to use MH-E's interface that provides
6990 continuing education for these programs.
6991
6992 The default setting of the option @code{mh-junk-program} is
6993 @samp{Auto-detect} which means that MH-E will automatically choose one
6994 of SpamAssassin, bogofilter, or SpamProbe in that order. If, for
6995 example, you have both SpamAssassin and bogofilter installed and you
6996 want to use bogofilter, then you can set this option to
6997 @samp{Bogofilter}.
6998
6999 The command @kbd{J b} (@code{mh-junk-blacklist}) trains the spam
7000 program in use with the content of the range (@pxref{Ranges}) and then
7001 handles the message(s) as specified by the option
7002 @code{mh-junk-disposition}. By default, this option is set to
7003 @samp{Delete Spam} but you can also specify the name of the folder
7004 which is useful for building a corpus of spam for training purposes.
7005
7006 In contrast, the command @kbd{J w} (@code{mh-junk-whitelist})
7007 reclassifies a range of messages (@pxref{Ranges}) as ham if it were
7008 incorrectly classified as spam. It then refiles the message into the
7009 @file{+inbox} folder.
7010
7011 By default, the programs are run in the foreground, but this can be
7012 slow when junking large numbers of messages. If you have enough memory
7013 or don't junk that many messages at the same time, you might try
7014 turning on the option @code{mh-junk-background}.
7015
7016 The following sections discuss the various counter-spam measures that
7017 MH-E can work with.
7018
7019 @cindex @file{.procmailrc}
7020 @cindex files, @file{.procmailrc}
7021
7022 @heading SpamAssassin
7023
7024 SpamAssassin is one of the more popular spam filtering programs. Get
7025 it from your local distribution or from the
7026 @uref{http://spamassassin.org/, SpamAssassin web site}.
7027
7028 To use SpamAssassin, add the following recipes to @file{~/.procmailrc}:
7029
7030 @cindex @command{spamc}
7031 @cindex @samp{X-Spam-Level:} header field
7032 @cindex @samp{X-Spam-Status:} header field
7033 @cindex header field, @samp{X-Spam-Level:}
7034 @cindex header field, @samp{X-Spam-Status:}
7035
7036 @smallexample
7037 MAILDIR=$HOME/`mhparam Path`
7038
7039 # Fight spam with SpamAssassin.
7040 :0fw
7041 | spamc
7042
7043 # Anything with a spam level of 10 or more is junked immediately.
7044 :0:
7045 * ^X-Spam-Level: ..........
7046 /dev/null
7047
7048 :0:
7049 * ^X-Spam-Status: Yes
7050 spam/.
7051 @end smallexample
7052
7053 If you don't use @command{spamc}, use @samp{spamassassin -P -a}.
7054
7055 Note that one of the recipes above throws away messages with a score
7056 greater than or equal to 10. Here's how you can determine a value that
7057 works best for you.
7058
7059 First, run @samp{spamassassin -t} on every mail message in your
7060 archive and use @command{gnumeric} to verify that the average plus the
7061 standard deviation of good mail is under 5, the SpamAssassin default
7062 for "spam".
7063
7064 Using @command{gnumeric}, sort the messages by score and view the
7065 messages with the highest score. Determine the score which encompasses
7066 all of your interesting messages and add a couple of points to be
7067 conservative. Add that many dots to the @samp{X-Spam-Level:} header
7068 field above to send messages with that score down the drain.
7069
7070 In the example above, messages with a score of 5-9 are set aside in
7071 the @samp{+spam} folder for later review. The major weakness of
7072 rules-based filters is a plethora of false positives so it is
7073 worthwhile to check.
7074
7075 If SpamAssassin classifies a message incorrectly, or is unsure, you can
7076 use the MH-E commands @kbd{J b} (@code{mh-junk-blacklist}) and
7077 @kbd{J w} (@code{mh-junk-whitelist}).
7078
7079 @cindex @command{sa-learn}
7080 @cindex @file{.spamassassin/user_prefs}
7081 @cindex files, @file{.spamassassin/user_prefs}
7082
7083 The command @kbd{J b} (@code{mh-junk-blacklist}) adds a
7084 @samp{blacklist_from} entry to @file{~/spamassassin/user_prefs},
7085 deletes the message, and sends the message to the Razor, so that
7086 others might not see this spam. If the @command{sa-learn} command is
7087 available, the message is also recategorized as spam.
7088
7089 The command@kbd{J w} (@code{mh-junk-whitelist}) adds a
7090 @samp{whitelist_from} rule to @samp{~/.spamassassin/user_prefs}. If
7091 the @command{sa-learn} command is available, the message is also
7092 recategorized as ham.
7093
7094 Over time, you'll observe that the same host or domain occurs
7095 repeatedly in the @samp{blacklist_from} entries, so you might think
7096 that you could avoid future spam by blacklisting all mail from a
7097 particular domain. The utility function
7098 @code{mh-spamassassin-identify-spammers} helps you do precisely that.
7099 This function displays a frequency count of the hosts and domains in
7100 the @samp{blacklist_from} entries from the last blank line in
7101 @file{~/.spamassassin/user_prefs} to the end of the file. This
7102 information can be used so that you can replace multiple
7103 @samp{blacklist_from} entries with a single wildcard entry such as:
7104
7105 @smallexample
7106 blacklist_from *@@*amazingoffersdirect2u.com
7107 @end smallexample
7108
7109 In versions of SpamAssassin (2.50 and on) that support a Bayesian
7110 classifier, @kbd{J b} @code{(mh-junk-blacklist}) uses the program
7111 @command{sa-learn} to recategorize the message as spam. Neither MH-E,
7112 nor SpamAssassin, rebuilds the database after adding words, so you
7113 will need to run @samp{sa-learn --rebuild} periodically. This can be
7114 done by adding the following to your @file{crontab}:
7115
7116 @smallexample
7117 0 * * * * sa-learn --rebuild > /dev/null 2>&1
7118 @end smallexample
7119
7120 @heading Bogofilter
7121
7122 Bogofilter is a Bayesian spam filtering program. Get it from your
7123 local distribution or from the
7124 @uref{http://bogofilter.sourceforge.net/, bogofilter web site}.
7125
7126 Bogofilter is taught by running:
7127
7128 @smallexample
7129 bogofilter -n < good-message
7130 @end smallexample
7131
7132 on every good message, and
7133
7134 @smallexample
7135 bogofilter -s < spam-message
7136 @end smallexample
7137
7138 @cindex full training
7139
7140 on every spam message. This is called a @dfn{full training}; three
7141 other training methods are described in the FAQ that is distributed
7142 with bogofilter. Note that most Bayesian filters need 1000 to 5000 of
7143 each type of message to start doing a good job.
7144
7145 To use bogofilter, add the following recipes to @file{~/.procmailrc}:
7146
7147 @cindex @samp{X-Bogosity:} header field
7148 @cindex header field, @samp{X-Bogosity:}
7149
7150 @smallexample
7151 MAILDIR=$HOME/`mhparam Path`
7152
7153 # Fight spam with Bogofilter.
7154 :0fw
7155 | bogofilter -3 -e -p
7156
7157 :0:
7158 * ^X-Bogosity: Yes, tests=bogofilter
7159 spam/.
7160
7161 :0:
7162 * ^X-Bogosity: Unsure, tests=bogofilter
7163 spam/unsure/.
7164 @end smallexample
7165
7166 If bogofilter classifies a message incorrectly, or is unsure, you can
7167 use the MH-E commands @kbd{J b} (@code{mh-junk-blacklist}) and @kbd{J
7168 w} (@code{mh-junk-whitelist}) to update bogofilter's training.
7169
7170 The @cite{Bogofilter FAQ} suggests that you run the following
7171 occasionally to shrink the database:
7172
7173 @smallexample
7174 bogoutil -d wordlist.db | bogoutil -l wordlist.db.new
7175 mv wordlist.db wordlist.db.prv
7176 mv wordlist.db.new wordlist.db
7177 @end smallexample
7178
7179 The @cite{Bogofilter tuning HOWTO} describes how you can fine-tune
7180 bogofilter.
7181
7182 @heading SpamProbe
7183
7184 SpamProbe is a Bayesian spam filtering program. Get it from your local
7185 distribution or from the @uref{http://spamprobe.sourceforge.net,
7186 SpamProbe web site}.
7187
7188 To use SpamProbe, add the following recipes to @file{~/.procmailrc}:
7189
7190 @cindex @command{formail}
7191 @cindex @samp{X-SpamProbe:} header field
7192 @cindex header field, @samp{X-SpamProbe:}
7193
7194 @smallexample
7195 MAILDIR=$HOME/`mhparam Path`
7196
7197 # Fight spam with SpamProbe.
7198 :0
7199 SCORE=| spamprobe receive
7200
7201 :0 wf
7202 | formail -I "X-SpamProbe: $SCORE"
7203
7204 :0:
7205 *^X-SpamProbe: SPAM
7206 spam/.
7207 @end smallexample
7208
7209 If SpamProbe classifies a message incorrectly, you can use the MH-E
7210 commands @kbd{J b} (@code{mh-junk-blacklist}) and @kbd{J w}
7211 (@code{mh-junk-whitelist}) to update SpamProbe's training.
7212
7213 @heading Other Things You Can Do
7214
7215 There are a couple of things that you can add to @file{~/.procmailrc}
7216 in order to filter out a lot of spam and viruses. The first is to
7217 eliminate any message with a Windows executable (which is most likely
7218 a virus). The second is to eliminate mail in character sets that you
7219 can't read.
7220
7221 @cindex @samp{Content-Transfer-Encoding:} header field
7222 @cindex @samp{Content-Type:} header field
7223 @cindex @samp{Subject:} header field
7224 @cindex header field, @samp{Content-Transfer-Encoding:}
7225 @cindex header field, @samp{Content-Type:}
7226 @cindex header field, @samp{Subject:}
7227
7228 @smallexample
7229 MAILDIR=$HOME/`mhparam Path`
7230
7231 #
7232 # Filter messages with win32 executables/virii.
7233 #
7234 # These attachments are base64 and have a TVqQAAMAAAAEAAAA//8AALg
7235 # pattern. The string "this program cannot be run in MS-DOS mode"
7236 # encoded in base64 is 4fug4AtAnNIbg and helps to avoid false
7237 # positives (Roland Smith via Pete from the bogofilter mailing list).
7238 #
7239 :0 B:
7240 * ^Content-Transfer-Encoding:.*base64
7241 * ^TVqQAAMAAAAEAAAA//8AALg
7242 * 4fug4AtAnNIbg
7243 spam/exe/.
7244
7245 #
7246 # Filter mail in unreadable character sets (from the Bogofilter FAQ).
7247 #
7248 UNREADABLE='[^?"]*big5|iso-2022-jp|ISO-2022-KR|euc-kr|gb2312|ks_c_5601-1987'
7249
7250 :0:
7251 * 1^0 $ ^Subject:.*=\?($UNREADABLE)
7252 * 1^0 $ ^Content-Type:.*charset="?($UNREADABLE)
7253 spam/unreadable/.
7254
7255 :0:
7256 * ^Content-Type:.*multipart
7257 * B ?? $ ^Content-Type:.*^?.*charset="?($UNREADABLE)
7258 spam/unreadable/.
7259 @end smallexample
7260
7261 @node Miscellaneous, Scan Line Formats, Junk, Top
7262 @chapter Miscellaneous Commands, Variables, and Buffers
7263
7264 This chapter covers the following command and the various MH-E
7265 buffers,
7266
7267 @ftable @code
7268 @item mh-version
7269 Display version information about MH-E and the MH mail handling
7270 system.
7271 @end ftable
7272
7273 @cindex @samp{*MH-E Info*}
7274 @cindex MH-E version
7275 @cindex buffers, @samp{*MH-E Info*}
7276 @cindex version
7277
7278 One command worth noting is @kbd{M-x mh-version}. You can compare the
7279 version this command prints to the latest release (@pxref{Getting
7280 MH-E}). The output of @kbd{M-x mh-version}, found in a buffer named
7281 @samp{*MH-E Info*}, should usually be included with any bug report you
7282 submit (@pxref{Bug Reports}).
7283
7284 @heading MH-E Buffers
7285
7286 Besides the MH-Folder, MH-Show, and MH-Letter buffers, MH-E creates
7287 several other buffers. They are:
7288
7289 @table @samp
7290 @cindex @samp{*MH-E Folders*}
7291 @cindex buffers, @samp{*MH-E Folders*}
7292 @findex mh-list-folders
7293 @item *MH-E Folders*
7294 @kindex F l
7295 This buffer contains the output of @kbd{F l} (@code{mh-list-folders}).
7296 @xref{Folders}.
7297 @c -------------------------
7298 @cindex @samp{*MH-E Help*}
7299 @cindex buffers, @samp{*MH-E Help*}
7300 @findex mh-help
7301 @item *MH-E Help*
7302 @kindex ?
7303 @kindex C-c ?
7304 This buffer contains the output of @kbd{?} (@code{mh-help}) and
7305 @kbd{C-c ?} in MH-Letter mode. @xref{Using This Manual}.
7306 @c -------------------------
7307 @cindex @samp{*MH-E Info*}
7308 @cindex buffers, @samp{*MH-E Info*}
7309 @item *MH-E Info*
7310 This buffer contains the output of @kbd{M-x mh-version @key{RET}}.
7311 @c -------------------------
7312 @cindex @samp{*MH-E Log*}
7313 @cindex buffers, @samp{*MH-E Log*}
7314 @item *MH-E Log*
7315 This buffer contains the last 100 lines of the output of the various
7316 MH commands.
7317 @c -------------------------
7318 @cindex @samp{*MH-E Mail Delivery*}
7319 @cindex buffers, @samp{*MH-E Mail Delivery*}
7320 @item *MH-E Mail Delivery*
7321 This buffer contains the transcript of a mail delivery. @xref{Sending
7322 Message}.
7323 @c -------------------------
7324 @cindex @samp{*MH-E Recipients*}
7325 @cindex buffers, @samp{*MH-E Recipients*}
7326 @findex mh-check-whom
7327 @item *MH-E Recipients*
7328 @kindex C-c C-w
7329 This buffer contains the output of @kbd{C-c C-w}
7330 (@code{mh-check-whom}) and is killed when draft is sent.
7331 @xref{Checking Recipients}.
7332 @c -------------------------
7333 @cindex @samp{*MH-E Sequences*}
7334 @cindex buffers, @samp{*MH-E Sequences*}
7335 @item *MH-E Sequences*
7336 This buffer contains the output of @kbd{S l}
7337 (@code{mh-list-sequences}). @xref{Sequences}.
7338 @c -------------------------
7339 @cindex @samp{*mh-temp*}
7340 @cindex buffers, @samp{*mh-temp*}
7341 @item *mh-temp
7342 This is a scratch, ephemeral, buffer used by MH-E functions. Note that
7343 it is hidden because the first character in the name is a space.
7344 You'll generally not have any need for this buffer.
7345 @end table
7346
7347 @node Scan Line Formats, Procmail, Miscellaneous, Top
7348 @appendix Scan Line Formats
7349
7350 @cindex scan line formats
7351
7352 This appendix discusses how MH-E creates, parses, and manipulates scan
7353 lines. If you have your own MH scan or inc format files, you
7354 @strong{can} teach MH-E how to handle them, but it isn't easy as
7355 you'll see.
7356
7357 @cindex @samp{mh-scan-line-formats} customization group
7358 @cindex customization group, @samp{mh-scan-line-formats}
7359
7360 This table lists the options in the @samp{mh-scan-line-formats}
7361 customization group.
7362
7363 @vtable @code
7364 @item mh-adaptive-cmd-note-flag
7365 On means that the message number width is determined dynamically
7366 (default: @samp{on}).
7367 @c -------------------------
7368 @item mh-scan-format-file
7369 Specifies the format file to pass to the scan program (default:
7370 @samp{Use MH-E scan Format}).
7371 @c -------------------------
7372 @item mh-scan-prog
7373 Program used to scan messages (default: @samp{"scan"}).
7374 @end vtable
7375
7376 @findex mh-set-cmd-note
7377 @vindex mh-adaptive-cmd-note-flag
7378 @vindex mh-scan-format-file
7379
7380 There are a couple of caveats when creating your own scan format file.
7381 First, MH-E will not work if your scan lines do not include message
7382 numbers. It will work poorly if you don't dedicate a column for
7383 showing the current message and notations. You won't be able to use
7384 the option @code{mh-adaptive-cmd-note-flag} or the threading features
7385 (@pxref{Threading}).
7386
7387 @cindex message numbers
7388
7389 If you've created your own format to handle long message numbers,
7390 you'll be pleased to know you no longer need it since MH-E adapts its
7391 internal format based upon the largest message number if
7392 @code{mh-adaptive-cmd-note-flag} is on (the default). If you prefer
7393 fixed-width message numbers, turn off @code{mh-adaptive-cmd-note-flag}
7394 and call @code{mh-set-cmd-note} with the width specified by your
7395 format file (see @code{mh-scan-format-file}). For example, the default
7396 width is 4, so you would use @samp{(mh-set-cmd-note 4)}.
7397
7398 @vindex mh-scan-format-nmh
7399 @vindex mh-scan-format-mh
7400
7401 The default setting for @code{mh-scan-format-file} is @samp{Use MH-E
7402 scan Format}. This means that the format string will be taken from the
7403 either @code{mh-scan-format-mh} or @code{mh-scan-format-nmh} depending
7404 on whether MH or nmh (or GNU mailutils) is in use. This setting also
7405 enables you to turn on the option @code{mh-adaptive-cmd-note-flag}.
7406 You can also set this option to @samp{Use Default scan Format} to get
7407 the same output as you would get if you ran @command{scan} from the
7408 shell. If you have a format file that you want MH-E to use but not MH,
7409 you can set this option to @samp{Specify a scan Format File} and enter
7410 the name of your format file.
7411
7412 The scan format that MH-E uses when @code{mh-scan-format-file} is set
7413 to its default of @samp{Use MH-E scan Format} is held in the variables
7414 @code{mh-scan-format-nmh} and @code{mh-scan-format-mh} depending on
7415 whether you are using nmh (or GNU mailutils) or not. Typically, you
7416 create your own format files rather than modifying these variables.
7417 The value of @code{mh-scan-format-nmh} is:
7418
7419 @smallexample
7420 (concat
7421 "%4(msg)"
7422 "%<(cur)+%| %>"
7423 "%<@{replied@}-"
7424 "%?(nonnull(comp@{to@}))%<(mymbox@{to@})t%>"
7425 "%?(nonnull(comp@{cc@}))%<(mymbox@{cc@})c%>"
7426 "%?(nonnull(comp@{bcc@}))%<(mymbox@{bcc@})b%>"
7427 "%?(nonnull(comp@{newsgroups@}))n%>"
7428 "%<(zero) %>"
7429 "%02(mon@{date@})/%02(mday@{date@})%<@{date@} %|*%>"
7430 "%<(mymbox@{from@})%<@{to@}To:%14(decode(friendly@{to@}))%>%>"
7431 "%<(zero)%17(decode(friendly@{from@}))%> "
7432 "%(decode@{subject@})%<@{body@}<<%@{body@}%>")
7433 @end smallexample
7434
7435 @cindex RFC 2047, decoding
7436 @cindex decoding RFC 2047
7437
7438 The setting for @code{mh-scan-format-mh} is similar, except that MH
7439 doesn't have the function @code{decode} (which is used to decode RFC
7440 2047 encodings).
7441
7442 @cindex notations, scan line
7443 @cindex scan line notations
7444
7445 These strings are passed to the @command{scan} program via the
7446 @option{-format} argument. The formats are identical to the defaults
7447 except that additional hints for fontification have been added to the
7448 existing notations in the fifth column (remember that in Emacs, the
7449 columns start at 0). The values of the fifth column, in priority
7450 order, are: @samp{-} if the message has been replied to, @samp{t} if
7451 an address in the @samp{To:} field matches one of the mailboxes of the
7452 current user, @samp{c} if the @samp{Cc:} field matches, @samp{b} if
7453 the @samp{Bcc:} field matches, and @samp{n} if a non-empty
7454 @samp{Newsgroups:} field is present.
7455
7456 @cindex @command{scan}
7457 @cindex MH commands, @command{scan}
7458 @vindex mh-progs
7459 @vindex mh-scan-prog
7460
7461 The name of the program that generates a listing of one line per
7462 message is held in @code{mh-scan-prog} (default: @samp{"scan"}).
7463 Unless this variable contains an absolute pathname, it is assumed to
7464 be in the @code{mh-progs} directory (@pxref{Getting Started}). You may
7465 link another program to @command{scan} (see @samp{mh-profile}(5)) to
7466 produce a different type of listing@footnote{See the section
7467 @uref{@value{MH-BOOK-HOME}/faswsprs.htm, Find and Specify with scan
7468 pick Ranges Sequences} in the MH book.}.
7469
7470 @cindex regular expressions, scan line formats
7471
7472 If you change the format of the scan lines you'll need to tell MH-E
7473 how to parse the new format. As you will see, quite a lot of variables
7474 are involved to do that. Use @samp{M-x apropos @key{RET} mh-scan.*regexp'}
7475 to obtain a list of these variables. You will also have to call
7476 @code{mh-set-cmd-note} if your notations are not in column 4 (columns
7477 in Emacs start with 0). Note that unlike most of the user options
7478 described in this manual, these are variables and must be set with
7479 @code{setq} instead of in a customization buffer. For help with
7480 regular expressions, see
7481 @ifnothtml
7482 @ref{Regexps, , Syntax of Regular Expressions, emacs, The
7483 GNU Emacs Manual}
7484 @end ifnothtml
7485 @ifhtml
7486 the section
7487 @uref{http://www.gnu.org/software/emacs/manual/html_node/Regexps.html,
7488 Syntax of Regular Expressions} in
7489 @cite{The GNU Emacs Manual}).
7490 @end ifhtml
7491
7492 The first variable has to do with pruning out garbage.
7493
7494 @vtable @code
7495 @cindex @command{inc}
7496 @cindex MH commands, @command{inc}
7497 @cindex @command{scan}
7498 @cindex MH commands, @command{scan}
7499 @item mh-scan-valid-regexp
7500 This regular expression describes a valid scan line. This is used to
7501 eliminate error messages that are occasionally produced by
7502 @command{inc}@footnote{See the section
7503 @uref{@value{MH-BOOK-HOME}/reapre.htm, Reading Mail: inc show next
7504 prev} in the MH book.} or @command{scan} (default: @samp{"^ *[0-9]"}).
7505 @end vtable
7506
7507 Next, many variables control how the scan lines are parsed.
7508
7509 @vindex mh-folder-font-lock-keywords
7510
7511 @vtable @code
7512 @vindex mh-folder-body
7513 @vindex mh-folder-font-lock-keywords
7514 @item mh-scan-body-regexp
7515 This regular expression matches the message body fragment. Note that
7516 the default setting of @code{mh-folder-font-lock-keywords} expects
7517 this expression to contain at least one parenthesized expression which
7518 matches the body text as in the default of
7519 @samp{"\\(<<\\([^\n]+\\)?\\)"}. If this regular expression is not
7520 correct, the body fragment will not be highlighted with the face
7521 @code{mh-folder-body}.
7522 @c -------------------------
7523 @vindex mh-folder-cur-msg-number
7524 @vindex mh-folder-font-lock-keywords
7525 @vindex mh-note-cur
7526 @item mh-scan-cur-msg-number-regexp
7527 This regular expression matches the current message. It must match
7528 from the beginning of the line. Note that the default setting of
7529 @code{mh-folder-font-lock-keywords} expects this expression to contain
7530 at least one parenthesized expression which matches the message number
7531 as in the default of @w{@samp{"^\\( *[0-9]+\\+\\).*"}}. This
7532 expression includes the leading space and current message marker
7533 @samp{+} within the parenthesis since it looks better to highlight
7534 these items as well. The highlighting is done with the face
7535 @code{mh-folder-cur-msg-number}. This regular expression should be
7536 correct as it is needed by non-fontification functions. See also
7537 @code{mh-note-cur}.
7538 @c -------------------------
7539 @vindex mh-folder-date
7540 @vindex mh-folder-font-lock-keywords
7541 @vindex mh-scan-sent-to-me-sender-regexp
7542 @item mh-scan-date-regexp
7543 This regular expression matches a valid date. It must @strong{not} be
7544 anchored to the beginning or the end of the line. Note that the
7545 default setting of @code{mh-folder-font-lock-keywords} expects this
7546 expression to contain only one parenthesized expression which matches
7547 the date field as in the default of
7548 @samp{"\\([0-9][0-9]/[0-9][0-9]\\)"}. If this regular expression is
7549 not correct, the date will not be highlighted with the face
7550 @code{mh-folder-date}.
7551 @c -------------------------
7552 @vindex mh-folder-deleted
7553 @vindex mh-folder-font-lock-keywords
7554 @vindex mh-note-deleted
7555 @item mh-scan-deleted-msg-regexp
7556 This regular expression matches deleted messages. It must match from
7557 the beginning of the line. Note that the default setting of
7558 @code{mh-folder-font-lock-keywords} expects this expression to contain
7559 at least one parenthesized expression which matches the message number
7560 as in the default of @samp{"^\\( *[0-9]+\\)D"}. This expression
7561 includes the leading space within the parenthesis since it looks
7562 better to highlight it as well. The highlighting is done with the face
7563 @code{mh-folder-deleted}. This regular expression should be correct as
7564 it is needed by non-fontification functions. See also
7565 @code{mh-note-deleted}.
7566 @c -------------------------
7567 @vindex mh-folder-font-lock-keywords
7568 @vindex mh-folder-msg-number
7569 @item mh-scan-good-msg-regexp
7570 This regular expression matches ``good'' messages. It must match from
7571 the beginning of the line. Note that the default setting of
7572 @code{mh-folder-font-lock-keywords} expects this expression to contain
7573 at least one parenthesized expression which matches the message number
7574 as in the default of @w{@samp{"^\\( *[0-9]+\\)[^D^0-9]"}}. This
7575 expression includes the leading space within the parenthesis since it
7576 looks better to highlight it as well. The highlighting is done with
7577 the face @code{mh-folder-msg-number}. This regular expression should
7578 be correct as it is needed by non-fontification functions.
7579 @c -------------------------
7580 @vindex mh-scan-format-file
7581 @item mh-scan-msg-format-regexp
7582 This regular expression finds the message number width in a scan
7583 format. Note that the message number must be placed in a parenthesized
7584 expression as in the default of @samp{"%\\([0-9]*\\)(msg)"}. This
7585 variable is only consulted if @code{mh-scan-format-file} is set to
7586 @samp{Use MH-E scan Format}.
7587 @c -------------------------
7588 @vindex mh-scan-format-file
7589 @item mh-scan-msg-format-string
7590 This is a format string for the width of the message number in a scan
7591 format. Use @samp{0%d} for zero-filled message numbers. This variable
7592 is only consulted if @code{mh-scan-format-file} is set to @samp{Use
7593 MH-E scan Format} (default: @samp{"%d"}).
7594 @c -------------------------
7595 @item mh-scan-msg-number-regexp
7596 This regular expression extracts the message number. It must match
7597 from the beginning of the line. Note that the message number must be
7598 placed in a parenthesized expression as in the default of @w{@samp{"^
7599 *\\([0-9]+\\)"}}.
7600 @c -------------------------
7601 @item mh-scan-msg-overflow-regexp
7602 This regular expression matches overflowed message numbers (default:
7603 @samp{"^[?0-9][0-9]"}).
7604 @c -------------------------
7605 @item mh-scan-msg-search-regexp
7606 This regular expression matches a particular message. It is a format
7607 string; use @samp{%d} to represent the location of the message number
7608 within the expression as in the default of @samp{"^[^0-9]*%d[^0-9]"}.
7609 @c -------------------------
7610 @vindex mh-folder-address
7611 @vindex mh-folder-font-lock-keywords
7612 @vindex mh-folder-to
7613 @item mh-scan-rcpt-regexp
7614 This regular expression specifies the recipient in messages you sent.
7615 Note that the default setting of @code{mh-folder-font-lock-keywords}
7616 expects this expression to contain two parenthesized expressions. The
7617 first is expected to match the @samp{To:} that the default scan format
7618 file generates. The second is expected to match the recipient's name
7619 as in the default of @samp{"\\(To:\\)\\(..............\\)"}. If this
7620 regular expression is not correct, the @samp{To:} string will not be
7621 highlighted with the face @code{mh-folder-to} and the recipient will not be
7622 highlighted with the face @code{mh-folder-address}.
7623 @c -------------------------
7624 @vindex mh-folder-font-lock-keywords
7625 @vindex mh-folder-refiled
7626 @vindex mh-note-refiled
7627 @item mh-scan-refiled-msg-regexp
7628 This regular expression matches refiled messages. It must match from
7629 the beginning of the line. Note that the default setting of
7630 @code{mh-folder-font-lock-keywords} expects this expression to contain
7631 at least one parenthesized expression which matches the message number
7632 as in the default of @w{@samp{"^\\( *[0-9]+\\)\\^"}}. This expression
7633 includes the leading space within the parenthesis since it looks
7634 better to highlight it as well. The highlighting is done with the face
7635 @code{mh-folder-refiled}. This regular expression should be correct as
7636 it is needed by non-fontification functions. See also
7637 @code{mh-note-refiled}.
7638 @c -------------------------
7639 @vindex mh-folder-font-lock-keywords
7640 @vindex mh-folder-sent-to-me-sender
7641 @vindex mh-mh-folder-sent-to-me-hint
7642 @vindex mh-scan-format-nmh
7643 @item mh-scan-sent-to-me-sender-regexp
7644 This regular expression matches messages sent to us. Note that the
7645 default setting of @code{mh-folder-font-lock-keywords} expects this
7646 expression to contain at least two parenthesized expressions. The
7647 first should match the fontification hint (see
7648 @code{mh-scan-format-nmh}) and the second should match the user name
7649 as in the default of
7650 @w{@samp{"^ *[0-9]+.\\([bct]\\).....[ ]*\\(..................\\)"}}.
7651 If this regular expression is not correct, the notation hints will not
7652 be highlighted with the face @code{mh-mh-folder-sent-to-me-hint} and
7653 the sender will not be highlighted with the face
7654 @code{mh-folder-sent-to-me-sender}.
7655 @c -------------------------
7656 @vindex mh-folder-followup
7657 @vindex mh-folder-font-lock-keywords
7658 @vindex mh-folder-subject
7659 @item mh-scan-subject-regexp
7660 This regular expression matches the subject. It must match from the
7661 beginning of the line. Note that the default setting of
7662 @samp{mh-folder-font-lock-keywords} expects this expression to contain
7663 at least three parenthesized expressions. The first is expected to
7664 match the @samp{Re:} string, if any, and is highlighted with the face
7665 @code{mh-folder-followup}. The second matches an optional bracketed
7666 number after @samp{Re:}, such as in @samp{Re[2]:} (and is thus a
7667 sub-expression of the first expression). The third is expected to
7668 match the subject line itself which is highlighted with the face
7669 @code{mh-folder-subject}. For example, the default is
7670 @w{@samp{"^ *[0-9]+........[ ]*...................}}@*
7671 @w{@samp{\\([Rr][Ee]\\(\\[[0-9]+\\]\\)?:\\s-*\\)*\\([^<\n]*\\)"}}.
7672 This regular expression should be correct as it is needed by
7673 non-fontification functions. Note that this example is broken up on
7674 two lines for readability, but is actually a single string.
7675 @end vtable
7676
7677 Finally, there are a slew of variables that control how MH-E annotates
7678 the scan lines.
7679
7680 @vtable @code
7681 @item mh-cmd-note
7682 Column for notations (default: 4). This variable should be set with
7683 the function @code{mh-set-cmd-note}. This variable may be updated
7684 dynamically if @code{mh-adaptive-cmd-note-flag} is on. The following
7685 variables contain the notational characters. Note that columns in
7686 Emacs start with 0.
7687 @c -------------------------
7688 @item mh-note-copied
7689 Messages that have been copied are marked by this character (default:
7690 @samp{?C}).
7691 @c -------------------------
7692 @item mh-note-cur
7693 The current message (in MH, not in MH-E) is marked by this character
7694 (default: @samp{?+}). See also @code{mh-scan-cur-msg-number-regexp}.
7695 @c -------------------------
7696 @item mh-note-deleted
7697 Messages that have been deleted are marked by this character (default:
7698 @samp{?D}). See also @code{mh-scan-deleted-msg-regexp}.
7699 @c -------------------------
7700 @item mh-note-dist
7701 Messages that have been redistributed are marked by this character
7702 (default: @samp{?R}).
7703 @c -------------------------
7704 @item mh-note-forw
7705 Messages that have been forwarded are marked by this character
7706 (default: @samp{?F}).
7707 @c -------------------------
7708 @item mh-note-printed
7709 Messages that have been printed are marked by this character (default:
7710 @samp{?P}).
7711 @c -------------------------
7712 @item mh-note-refiled
7713 Messages that have been refiled are marked by this character (default:
7714 @samp{?^}). See also @code{mh-scan-refiled-msg-regexp}.
7715 @c -------------------------
7716 @item mh-note-repl
7717 Messages that have been replied to are marked by this character
7718 (default: @samp{?-}).
7719 @c -------------------------
7720 @item mh-note-seq
7721 Messages in a user-defined sequence are marked by this character
7722 (default: @samp{?%}). Messages in the @samp{search} sequence are
7723 marked by this character as well.
7724 @end vtable
7725
7726 For example, let's say I have the following in @file{scan.format}
7727 which displays the sender, the subject, and the message number. This
7728 format places a @samp{+} after the message number for the current
7729 message according to MH; it also uses that column for notations.
7730
7731 @example
7732 %20(decode(friendly@{from@})) %50(decode@{subject@}) %4(msg)%<(cur)+%| %>
7733 @end example
7734
7735 @vindex mh-scan-format-file, example
7736
7737 The first thing you have to do is tell MH-E to use this file.
7738 Customize @code{mh-scan-format-file} and set its value to @samp{Use
7739 Default scan Format}. If you didn't get already turn off
7740 @code{mh-adaptive-cmd-note-flag}, you'll need to do that first.
7741
7742 Next, tell MH-E what a valid scan line looks like so that you can at
7743 least display the output of scan in your MH-Folder buffer.
7744
7745 @vindex mh-scan-valid-regexp, example
7746
7747 @lisp
7748 (setq mh-scan-valid-regexp "[0-9]+[+D^ ]$")
7749 @end lisp
7750
7751 Now, in order to get rid of the @samp{Cursor not pointing to message}
7752 message, you need to tell MH-E how to access the message number. You
7753 should also see why MH-E requires that you include a message number in
7754 the first place.
7755
7756 @vindex mh-scan-msg-number-regexp, example
7757 @vindex mh-scan-msg-search-regexp, example
7758
7759 @lisp
7760 (setq mh-scan-msg-number-regexp "^.* \\([0-9]+\\)[+D^ ]$")
7761 (setq mh-scan-msg-search-regexp " %d[+D^ ]$")
7762 @end lisp
7763
7764 In order to get the next and previous commands working, add this.
7765
7766 @vindex mh-scan-good-msg-regexp, example
7767
7768 @lisp
7769 (setq mh-scan-good-msg-regexp "^.* \\([0-9]+\\)[+D^ ]$")
7770 @end lisp
7771
7772 Note that the current message isn't marked with a @samp{+} when moving
7773 between the next and previous messages. Here is the code required to
7774 get this working.
7775
7776 @vindex set-mh-cmd-note, example
7777 @vindex mh-scan-cur-msg-number-regexp, example
7778
7779 @lisp
7780 (set-mh-cmd-note 76)
7781 (setq mh-scan-cur-msg-number-regexp "^.* \\([0-9]+\\)\\+$")
7782 @end lisp
7783
7784 Finally, add the following to delete and refile messages.
7785
7786 @vindex mh-scan-deleted-msg-regexp, example
7787 @vindex mh-scan-refiled-msg-regexp, example
7788
7789 @lisp
7790 (setq mh-scan-deleted-msg-regexp "^.* \\([0-9]+\\)D$")
7791 (setq mh-scan-refiled-msg-regexp "^.* \\([0-9]+\\)\\^$")
7792 @end lisp
7793
7794 This is just a bare minimum; it's best to adjust all of the regular
7795 expressions to ensure that MH-E and highlighting perform well.
7796
7797 @node Procmail, Odds and Ends, Scan Line Formats, Top
7798 @appendix Reading Mailing Lists Effectively
7799
7800 @cindex @command{procmail}
7801 @cindex @command{slocal}
7802 @cindex Gnus
7803 @cindex MH commands, @command{slocal}
7804 @cindex Unix commands, @command{procmail}
7805 @cindex mailing lists, reading
7806
7807 This appendix explains how to use @uref{http://www.procmail.org/,
7808 procmail} to file mail from mailing lists into folders which can then
7809 be read easily with MH-E@footnote{The MH equivalent, @command{slocal},
7810 can be used as well, but procmail is more flexible and more packages
7811 exist for procmail than for slocal.}. Some mailing lists have such
7812 high traffic that Gnus must be used and I discuss how to use Gnus
7813 side-by-side with MH-E.
7814
7815 @cindex @file{.procmailrc}
7816 @cindex files, @file{.procmailrc}
7817
7818 First, I'll describe how to put mail from your mailing lists directly
7819 into an MH folder using @command{procmail}. First, add the following
7820 to @file{~/.procmailrc}. While the logging variables aren't strictly
7821 necessary, they are extremely useful.
7822
7823 @smallexample
7824 [1] # Update PATH so procmail can find myrcvstore, rcvstore and mhparam.
7825 [2] PATH=$PATH:/usr/lib/mh:/usr/bin/mh:$HOME/bin
7826 [3]
7827 [4] # Point LOGFILE at the actual log file.
7828 [5] LOGFILE=$HOME/.procmail.log
7829 [6]
7830 [7] # This setting provides just the right amount of information.
7831 [8] LOGABSTRACT=all
7832 [9]
7833 [10] # Uncomment the following line to see how your patterns match.
7834 [11] #VERBOSE=yes
7835 [12]
7836 [13] # Place mail sent to any MH-E mailing list in +mh-e.
7837 [14] :0 w: mh-e$LOCKEXT
7838 [15] * ^TO.*mh-e-.*@.*sourceforge.net
7839 [16] | myrcvstore -create +mh-e
7840 @end smallexample
7841
7842 @cindex @command{rcvstore}
7843 @cindex MH commands, @command{rcvstore}
7844
7845 Line 14 creates a lock file in your mail directory based upon the name
7846 of the folder. This is done because @command{rcvstore} does not
7847 perform locking. While this lock file will prevent @command{procmail}
7848 from writing to a folder concurrently, there is a slight chance that
7849 you might lose a message if you're performing operations on a folder
7850 at the same time @command{rcvstore} is placing a message there. You
7851 have been warned. Now that that disclaimer is out of the way, note
7852 that I've been using this set-up for over a decade and haven't lost
7853 anything to my knowledge@footnote{See
7854 @uref{https://savannah.nongnu.org/bugs/?func=detailbug&bug_id=4361&group_id=2166,
7855 Savannah issue #4361} to see if @command{rcvstore} locking is still an
7856 issue.}.
7857
7858 @cindex @samp{Unseen-Sequence:} MH profile component
7859 @cindex MH profile component, @samp{Unseen-Sequence:}
7860
7861 Line 16 uses the following script, @code{myrcvstore}, to massage the
7862 message as described in the comment and file the message in the given
7863 folder@footnote{The @samp{-create} argument wasn't always the default
7864 to @command{rcvstore}.}.
7865
7866 @smallexample
7867 #! /bin/sh
7868
7869 # Accepts a message on standard input and passes it through rcvstore
7870 # after first passing it through any filters. All arguments are passed
7871 # on to rcvstore.
7872
7873 # Force the "From user date" to become part of header. One reason this
7874 # is done is because the presence of the From field confuses dist so
7875 # that dist adds a new header, rather than using the existing header.
7876 # Note that this should not be done for any message that goes into a
7877 # Gnus incoming file (Gnus will thrown an error) nor should it be
7878 # applied to any message that goes to the system mailbox because the
7879 # entire mailbox will be incorporated as a single message.
7880 formail -c -z -R 'From ' X-Envelope-From: |
7881 rcvstore $@@
7882 @end smallexample
7883
7884 If your version of @command{rcvstore} doesn't add messages to the
7885 @samp{unseen} sequence by default, add the following line to your MH
7886 profile:
7887
7888 @example
7889 Unseen-Sequence: unseen
7890 @end example
7891
7892 Now view your new messages with the speedbar (@pxref{Speedbar}) or with
7893 @kbd{F n} (@code{mh-index-new-messages}). @xref{Folders}.
7894
7895 If you're on a mailing list that is so voluminous that it is
7896 impossible to read every message, it usually better to read the
7897 mailing list like a newsgroup in a news reader. Emacs has a built-in
7898 newsreader called Gnus. The remainder of this appendix talks about how
7899 to use Gnus with an MH message store. The version of Gnus that was
7900 used to prepare this manual was 5.10. Versions 5.8 through 5.10 should
7901 work but versions prior to 5.8 use different options.
7902
7903 This table contains a list of Gnus options that you will have to
7904 modify. Note that for them to become accessible, you'll have to load
7905 @file{nnml.el} first. This can be done with @kbd{M-x load-library
7906 @key{RET} nnml @key{RET}}.
7907
7908 @vtable @code
7909 @item gnus-secondary-select-methods
7910 Select the @samp{nnml} value. This select method uses directories for
7911 folders and individual files for messages, just like MH. You do not
7912 have to set an address.
7913 @c -------------------------
7914 @item mail-sources
7915 Select the @samp{Several files in a directory} value, check the
7916 @samp{Path} box and enter @file{~/Mail} to tell Gnus where to find
7917 your mail.
7918 @c -------------------------
7919 @item message-mail-user-agent
7920 In order to send mail within Gnus using MH-E, set this option to
7921 @samp{mail-user-agent} and set the @samp{mail-user-agent} option to
7922 @samp{Emacs interface to MH}.
7923 @c -------------------------
7924 @item nnmail-keep-last-article
7925 Since Gnus keeps track of which messages you have read, it would be
7926 bad if Gnus expired the last message, for example, message 100, and
7927 @command{rcvstore} gave the next new message number 1. Gnus would then
7928 ignore it since it thinks that you've read messages 1-100. Turning on
7929 this option ensures that the last message is never removed thereby
7930 eliminating this problem.
7931 @end vtable
7932
7933 Next add the following to @file{~/.procmailrc}. If you don't subscribe
7934 to the GnuCash mailing list, substitute one to which you are
7935 subscribed.
7936
7937 @example
7938 MAILDIR=$HOME/`mhparam Path`
7939 # Place mail sent to the GnuCash mailing list in gnucash.spool, where
7940 # Gnus will pick it up.
7941 :0:
7942 * ^TO.*gnucash.*@.*gnucash.org
7943 gnucash.spool
7944 @end example
7945
7946 Wait for some messages to appear in @file{gnucash.spool} and run Gnus
7947 with @kbd{M-x gnus @key{RET}}. To view the folder created in the
7948 example above, you would tell Gnus about it the first time only with
7949 @kbd{G m gnucash @key{RET} nnml @key{RET}}. In MH-E, this folder is
7950 known as @samp{+gnucash}.
7951
7952 @node Odds and Ends, History, Procmail, Top
7953 @appendix Odds and Ends
7954
7955 This appendix covers a few topics that don't fit elsewhere. Here I
7956 tell you how to report bugs and how to get on the MH-E mailing lists.
7957 I also point out some additional sources of information.
7958
7959 @menu
7960 * Bug Reports::
7961 * Mailing Lists::
7962 * MH FAQ and Support::
7963 * Getting MH-E::
7964 @end menu
7965
7966 @node Bug Reports, Mailing Lists, Odds and Ends, Odds and Ends
7967 @appendixsec Bug Reports
7968
7969 @cindex SourceForge
7970 @cindex bugs
7971
7972 Bug reports should be filed at
7973 @uref{https://sourceforge.net/bugs/?group_id=13357, SourceForge}. You
7974 need to be a SourceForge user to submit bug reports, but this is easy
7975 enough to do that it shouldn't be a restriction for you. Please
7976 include the output of @kbd{M-x mh-version} (@pxref{Miscellaneous}) in
7977 any bug report you send unless you're 110% positive we won't ask for
7978 it.
7979
7980 @node Mailing Lists, MH FAQ and Support, Bug Reports, Odds and Ends
7981 @appendixsec MH-E Mailing Lists
7982
7983 @cindex SourceForge
7984 @cindex mailing lists
7985
7986 There are several mailing lists for MH-E. They are @i{mh-e-users at
7987 lists.sourceforge.net}, @i{mh-e-announce at lists.sourceforge.net},
7988 and @i{mh-e-devel at lists.sourceforge.net}. You can subscribe or view
7989 the archives at @uref{https://sourceforge.net/mail/?group_id=13357,
7990 SourceForge}. Do not report bugs on these lists; please submit them
7991 via SourceForge (@pxref{Bug Reports}).
7992
7993 @node MH FAQ and Support, Getting MH-E, Mailing Lists, Odds and Ends
7994 @appendixsec MH FAQ and Support
7995
7996 @cindex FAQ
7997 @cindex MH FAQ
7998
7999 The article @uref{http://www.newt.com/faq/mh.html, @cite{MH Frequently
8000 Asked Questions (FAQ) with Answers}} appears monthly in the newsgroup
8001 @samp{comp.mail.mh}. While very little is there that deals with MH-E
8002 specifically, there is an incredible wealth of material about MH
8003 itself which you will find useful.
8004
8005 @cindex support
8006
8007 You can find FAQs on MH-E at the
8008 @uref{https://sourceforge.net/support/?group_id=13357, Support
8009 Requests} page on SourceForge. If you don't find the answer to your
8010 question, file a support request and your question will become a new
8011 FAQ!
8012
8013 @node Getting MH-E, , MH FAQ and Support, Odds and Ends
8014 @appendixsec Getting MH-E
8015
8016 @cindex MH-E, obtaining
8017 @cindex getting MH-E
8018 @cindex obtaining MH-E
8019
8020 Because MH-E is undergoing a phase of sustained growth, the version of
8021 MH-E in your Emacs is likely to be out of date although it is most
8022 likely to be more up to date than the copy that comes with the MH
8023 distribution in @file{miscellany/mh-e}.
8024
8025 @cindex change log
8026 @cindex release notes
8027
8028 @c intentionally wordy to avoid overfull hbox
8029 New MH-E releases are always available for downloading at
8030 @uref{https://sourceforge.net/project/showfiles.php?group_id=13357,
8031 SourceForge} before they appear in an Emacs release. You can read the
8032 release notes on that page to determine if the given release of MH-E
8033 is already installed in your version of Emacs. You can also read the
8034 change log to see if you are interested in what the given release of
8035 MH-E has to offer (although we have no doubt that you will be
8036 extremely interested in all new releases).
8037
8038 @cindex @samp{MH-E-NEWS}
8039 @cindex @samp{README}
8040 @cindex files, @samp{MH-E-NEWS}
8041 @cindex files, @samp{README}
8042 @cindex news
8043
8044 After you download and extract the MH-E tarball, read the
8045 @file{README} file and @file{MH-E-NEWS}. These correspond to the
8046 release notes and change log mentioned above. The file @file{README}
8047 contains instructions on installing MH-E. If you're already running
8048 Emacs, please quit that session and start again to load in the new
8049 MH-E. Check that you're running the new version with the command
8050 @kbd{M-x mh-version}.
8051
8052 @cindex contributed software
8053 @cindex manual
8054 @cindex documentation
8055
8056 In addition to the mh-e package, the
8057 @uref{https://sourceforge.net/project/showfiles.php?group_id=13357,
8058 SourceForge} site also contains doc and contrib packages. The former
8059 is the latest release of this manual, and the latter contains a few
8060 contributed packages you might find useful.
8061
8062 @node History, GFDL, Odds and Ends, Top
8063 @appendix History of MH-E
8064
8065 @cindex Bill Wohler
8066 @cindex Brian Reid
8067 @cindex Gildea, Stephen
8068 @cindex Jim Larus
8069 @cindex Larus, Jim
8070 @cindex MH-E, versions
8071 @cindex Reid, Brian
8072 @cindex SourceForge
8073 @cindex Stephen Gildea
8074 @cindex Wohler, Bill
8075 @cindex history of MH-E
8076 @cindex versions of MH-E
8077
8078 MH-E was originally written by Brian Reid in 1983 and has changed
8079 hands several times since then. Jim Larus wanted to do something
8080 similar for GNU Emacs, and ended up completely rewriting it that same
8081 year. In 1989, Stephen Gildea picked it up and added many
8082 improvements. Bill Wohler then took over in 2000 and moved its
8083 development to @uref{http://sourceforge.net/, SourceForge} where it
8084 lives today.
8085
8086 @menu
8087 * From Brian Reid::
8088 * From Jim Larus::
8089 * From Stephen Gildea::
8090 * From Bill Wohler::
8091 @end menu
8092
8093 @node From Brian Reid, From Jim Larus, History, History
8094 @appendixsec From Brian Reid
8095
8096 @cindex Brian Reid
8097 @cindex Reid, Brian
8098
8099 One day in 1983 I got the flu and had to stay home from work for three
8100 days with nothing to do. I used that time to write MHE@. The
8101 fundamental idea behind MHE was that it was a ``puppeteer'' driving
8102 the MH programs underneath it. MH had a model that the editor was
8103 supposed to run as a sub-process of the mailer, which seemed to me at
8104 the time to be the tail wagging the dog. So I turned it around and
8105 made the editor drive the MH programs. I made sure that the UCI people
8106 (who were maintaining MH at the time) took in my changes and made them
8107 stick.
8108
8109 Today, I still use my own version of MHE because I don't at all like
8110 the way that GNU MH-E works and I've never gotten to be good enough at
8111 hacking Emacs Lisp to make GNU MH-E do what I want. The Gosling-emacs
8112 version of MHE and the GNU Emacs version of MH-E have almost nothing
8113 in common except similar names. They work differently, have different
8114 conceptual models, and have different key bindings@footnote{After
8115 reading this article, I questioned Brian about his version of MHE, and
8116 received some great ideas for improving MH-E such as a dired-like
8117 method of selecting folders; and removing the prompting when sending
8118 mail, filling in the blanks in the draft buffer instead. I passed them
8119 on to Stephen Gildea, the current maintainer, and he was excited about
8120 the ideas as well. Perhaps one day, MH-E will again resemble MHE
8121 (draft form editing was introduced in version 7.4).}.
8122
8123 Brian Reid, June 1994
8124
8125 @node From Jim Larus, From Stephen Gildea, From Brian Reid, History
8126 @appendixsec From Jim Larus
8127
8128 @cindex Jim Larus
8129 @cindex Larus, Jim
8130
8131 Brian Reid, while at CMU or shortly after going to Stanford wrote a
8132 mail reading program called MHE for Gosling Emacs. It had much the
8133 same structure as MH-E (i.e., invoked MH programs), though it was
8134 simpler and the commands were slightly different. Unfortunately, I no
8135 longer have a copy so the differences are lost in the mists of time.
8136
8137 In '82-83, I was working at BBN and wrote a lot of mlisp code in
8138 Gosling Emacs to make it look more like Tennex Emacs. One of the
8139 packages that I picked up and improved was Reid's mail system. In '83,
8140 I went back to Berkeley. About that time, Stallman's first version of
8141 GNU Emacs came out and people started to move to it from Gosling Emacs
8142 (as I recall, the transition took a year or two). I decided to port
8143 Reid's MHE and used the mlisp to Emacs Lisp translator that came with
8144 GNU Emacs. It did a lousy job and the resulting code didn't work, so I
8145 bit the bullet and rewrote the code by hand (it was a lot smaller and
8146 simpler then, so it took only a day or two).
8147
8148 Soon after that, MH-E became part of the standard Emacs distribution
8149 and suggestions kept dribbling in for improvements. MH-E soon reached
8150 sufficient functionality to keep me happy, but I kept on improving it
8151 because I was a graduate student with plenty of time on my hands and
8152 it was more fun than my dissertation. In retrospect, the one thing
8153 that I regret is not writing any documentation, which seriously
8154 limited the use and appeal of the package.
8155
8156 @cindex @command{xmh}, in MH-E history
8157
8158 In '89, I came to Wisconsin as a professor and decided not to work on
8159 MH-E. It was stable, except for minor bugs, and had enough
8160 functionality, so I let it be for a few years. Stephen Gildea of BBN
8161 began to pester me about the bugs, but I ignored them. In 1990, he
8162 went off to the X Consortium, said good bye, and said that he would
8163 now be using @command{xmh}. A few months later, he came back and said
8164 that he couldn't stand @command{xmh} and could I put a few more bug fixes
8165 into MH-E. At that point, I had no interest in fixing MH-E, so I gave
8166 the responsibility of maintenance to him and he has done a fine job
8167 since then.
8168
8169 Jim Larus, June 1994
8170
8171 @node From Stephen Gildea, From Bill Wohler, From Jim Larus, History
8172 @appendixsec From Stephen Gildea
8173
8174 @cindex Gildea, Stephen
8175 @cindex Stephen Gildea
8176
8177 In 1987 I went to work for Bolt Beranek and Newman, as Jim had before
8178 me. In my previous job, I had been using RMAIL, but as my folders tend
8179 to run large, I was frustrated with the speed of RMAIL@. However, I
8180 stuck with it because I wanted the GNU Emacs interface. I am very
8181 familiar and comfortable with the Emacs interface (with just a few
8182 modifications of my own) and dislike having to use applications with
8183 embedded editors; they never live up to Emacs.
8184
8185 MH is the mail reader of choice at BBN, so I converted to it. Since I
8186 didn't want to give up using an Emacs interface, I started using MH-E.
8187 As is my wont, I started hacking on it almost immediately. I first
8188 used version 3.4m. One of the first features I added was to treat the
8189 folder buffer as a file-visiting buffer: you could lock it, save it,
8190 and be warned of unsaved changes when killing it. I also worked to
8191 bring its functionality a little closer to RMAIL@. Jim Larus was very
8192 cooperative about merging in my changes, and my efforts first appeared
8193 in version 3.6, distributed with Emacs 18.52 in 1988. Next I decided
8194 MH-E was too slow and optimized it a lot. Version, 3.7, distributed
8195 with Emacs 18.56 in 1990, was noticeably faster.
8196
8197 When I moved to the X Consortium I became the first person there to
8198 not use xmh. (There is now one other engineer there using MH-E.) About
8199 this point I took over maintenance of MH-E from Jim and was finally
8200 able to add some features Jim hadn't accepted, such as the backward
8201 searching undo. My first release was 3.8 (Emacs 18.58) in 1992.
8202
8203 Now, in 1994, we see a flurry of releases, with both 4.0 and 5.0.
8204 Version 4.0 added many new features, including background folder
8205 collection and support for composing @sc{mime} messages. (Reading
8206 @sc{mime} messages remains to be done, alas.) While writing this book,
8207 Bill Wohler gave MH-E its closest examination ever, uncovering bugs
8208 and inconsistencies that required a new major version to fix, and so
8209 version 5 was released.
8210
8211 Stephen Gildea, June 1994
8212
8213 @node From Bill Wohler, , From Stephen Gildea, History
8214 @appendixsec From Bill Wohler
8215
8216 @cindex Wohler, Bill
8217 @cindex Bill Wohler
8218
8219 The preface originally included the following text which I use to
8220 begin my story:
8221
8222 @quotation
8223 But it's important to note a brief history of MH-E.
8224
8225 @w{Version 3} was prevalent through the @w{Emacs 18} and early
8226 @w{Emacs 19} years. Then @w{Version 4} came out (@w{Emacs 19.23}),
8227 which introduced several new and changed commands. Next, @w{Version
8228 5.0} was released, which fixed some bugs and incompatibilities, and
8229 was incorporated into @w{Emacs 19.29}.
8230 @end quotation
8231
8232 After a long break, Stephen handed the reins over to me in 2000. I
8233 moved the project to a new site called SourceForge and organized a
8234 great team of developers. Our first release in late 2001 was version
8235 6. It appeared in Emacs 21.2 and had menus and tool bar buttons.
8236
8237 Then, indexed searches, improved MIME handling, a speedbar, multiple
8238 identities, alias completion, an index view of unseen messages, spam
8239 software support, Face and X-Image-URL header field support, Fcc
8240 completion, arbitrary range handling, and draft form editing were
8241 introduced in the version 7 series in Emacs 21.4 (2004).
8242
8243 Version 8 development was mostly driven by the rewrite of the manual.
8244 It also brought mailutils support, S/MIME support, picon support, and
8245 an improved interface for hiding header fields. The CVS repository was
8246 migrated from SourceForge to Savannah (only for those files that were
8247 already part of Emacs) and the software was completely reorganized to
8248 push back two decades of entropy. It appeared in Emacs 22.1 (2006).
8249
8250 Bill Wohler, February 2006
8251
8252 @node GFDL, GPL, History, Top
8253 @appendix GNU FREE DOCUMENTATION LICENSE
8254 @center Version 1.2, November 2002
8255
8256 @display
8257 Copyright (C) 2000,2001,2002 Free Software Foundation, Inc.
8258 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
8259
8260 Everyone is permitted to copy and distribute verbatim copies
8261 of this license document, but changing it is not allowed.
8262 @end display
8263 @sp 1
8264 @enumerate 0
8265 @item
8266 PREAMBLE
8267
8268 The purpose of this License is to make a manual, textbook, or other
8269 functional and useful document ``free'' in the sense of freedom: to
8270 assure everyone the effective freedom to copy and redistribute it,
8271 with or without modifying it, either commercially or noncommercially.
8272 Secondarily, this License preserves for the author and publisher a way
8273 to get credit for their work, while not being considered responsible
8274 for modifications made by others.
8275
8276 This License is a kind of ``copyleft'', which means that derivative
8277 works of the document must themselves be free in the same sense. It
8278 complements the GNU General Public License, which is a copyleft
8279 license designed for free software.
8280
8281 We have designed this License in order to use it for manuals for free
8282 software, because free software needs free documentation: a free
8283 program should come with manuals providing the same freedoms that the
8284 software does. But this License is not limited to software manuals;
8285 it can be used for any textual work, regardless of subject matter or
8286 whether it is published as a printed book. We recommend this License
8287 principally for works whose purpose is instruction or reference.
8288
8289 @sp 1
8290 @item
8291 APPLICABILITY AND DEFINITIONS
8292
8293 This License applies to any manual or other work, in any medium, that
8294 contains a notice placed by the copyright holder saying it can be
8295 distributed under the terms of this License. Such a notice grants a
8296 world-wide, royalty-free license, unlimited in duration, to use that
8297 work under the conditions stated herein. The ``Document'', below,
8298 refers to any such manual or work. Any member of the public is a
8299 licensee, and is addressed as ``you''. You accept the license if you
8300 copy, modify or distribute the work in a way requiring permission
8301 under copyright law.
8302
8303 A ``Modified Version'' of the Document means any work containing the
8304 Document or a portion of it, either copied verbatim, or with
8305 modifications and/or translated into another language.
8306
8307 A ``Secondary Section'' is a named appendix or a front-matter section of
8308 the Document that deals exclusively with the relationship of the
8309 publishers or authors of the Document to the Document's overall subject
8310 (or to related matters) and contains nothing that could fall directly
8311 within that overall subject. (Thus, if the Document is in part a
8312 textbook of mathematics, a Secondary Section may not explain any
8313 mathematics.) The relationship could be a matter of historical
8314 connection with the subject or with related matters, or of legal,
8315 commercial, philosophical, ethical or political position regarding
8316 them.
8317
8318 The ``Invariant Sections'' are certain Secondary Sections whose titles
8319 are designated, as being those of Invariant Sections, in the notice
8320 that says that the Document is released under this License. If a
8321 section does not fit the above definition of Secondary then it is not
8322 allowed to be designated as Invariant. The Document may contain zero
8323 Invariant Sections. If the Document does not identify any Invariant
8324 Sections then there are none.
8325
8326 The ``Cover Texts'' are certain short passages of text that are listed,
8327 as Front-Cover Texts or Back-Cover Texts, in the notice that says that
8328 the Document is released under this License. A Front-Cover Text may
8329 be at most 5 words, and a Back-Cover Text may be at most 25 words.
8330
8331 A ``Transparent'' copy of the Document means a machine-readable copy,
8332 represented in a format whose specification is available to the
8333 general public, that is suitable for revising the document
8334 straightforwardly with generic text editors or (for images composed of
8335 pixels) generic paint programs or (for drawings) some widely available
8336 drawing editor, and that is suitable for input to text formatters or
8337 for automatic translation to a variety of formats suitable for input
8338 to text formatters. A copy made in an otherwise Transparent file
8339 format whose markup, or absence of markup, has been arranged to thwart
8340 or discourage subsequent modification by readers is not Transparent.
8341 An image format is not Transparent if used for any substantial amount
8342 of text. A copy that is not ``Transparent'' is called ``Opaque.''
8343
8344
8345 Examples of suitable formats for Transparent copies include plain
8346 ASCII without markup, Texinfo input format, LaTeX input format, SGML
8347 or XML using a publicly available DTD, and standard-conforming simple
8348 HTML, PostScript or PDF designed for human modification. Examples of
8349 transparent image formats include PNG, XCF and JPG. Opaque formats
8350 include proprietary formats that can be read and edited only by
8351 proprietary word processors, SGML or XML for which the DTD and/or
8352 processing tools are not generally available, and the
8353 machine-generated HTML, PostScript or PDF produced by some word
8354 processors for output purposes only.
8355
8356 The ``Title Page'' means, for a printed book, the title page itself,
8357 plus such following pages as are needed to hold, legibly, the material
8358 this License requires to appear in the title page. For works in
8359 formats which do not have any title page as such, ``Title Page'' means
8360 the text near the most prominent appearance of the work's title,
8361 preceding the beginning of the body of the text.
8362
8363 A section ``Entitled XYZ'' means a named subunit of the Document whose
8364 title either is precisely XYZ or contains XYZ in parentheses following
8365 text that translates XYZ in another language. (Here XYZ stands for a
8366 specific section name mentioned below, such as ``Acknowledgements'',
8367 ``Dedications'', ``Endorsements'', or ``History''.) To ``Preserve the Title''
8368 of such a section when you modify the Document means that it remains a
8369 section ``Entitled XYZ'' according to this definition.
8370
8371 The Document may include Warranty Disclaimers next to the notice which
8372 states that this License applies to the Document. These Warranty
8373 Disclaimers are considered to be included by reference in this
8374 License, but only as regards disclaiming warranties: any other
8375 implication that these Warranty Disclaimers may have is void and has
8376 no effect on the meaning of this License.
8377 @sp 1
8378 @item
8379 VERBATIM COPYING
8380
8381 You may copy and distribute the Document in any medium, either
8382 commercially or noncommercially, provided that this License, the
8383 copyright notices, and the license notice saying this License applies
8384 to the Document are reproduced in all copies, and that you add no other
8385 conditions whatsoever to those of this License. You may not use
8386 technical measures to obstruct or control the reading or further
8387 copying of the copies you make or distribute. However, you may accept
8388 compensation in exchange for copies. If you distribute a large enough
8389 number of copies you must also follow the conditions in section 3.
8390
8391 You may also lend copies, under the same conditions stated above, and
8392 you may publicly display copies.
8393 @sp 1
8394 @item
8395 COPYING IN QUANTITY
8396
8397 If you publish printed copies (or copies in media that commonly have
8398 printed covers) of the Document, numbering more than 100, and the
8399 Document's license notice requires Cover Texts, you must enclose the
8400 copies in covers that carry, clearly and legibly, all these Cover
8401 Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on
8402 the back cover. Both covers must also clearly and legibly identify
8403 you as the publisher of these copies. The front cover must present
8404 the full title with all words of the title equally prominent and
8405 visible. You may add other material on the covers in addition.
8406 Copying with changes limited to the covers, as long as they preserve
8407 the title of the Document and satisfy these conditions, can be treated
8408 as verbatim copying in other respects.
8409
8410 If the required texts for either cover are too voluminous to fit
8411 legibly, you should put the first ones listed (as many as fit
8412 reasonably) on the actual cover, and continue the rest onto adjacent
8413 pages.
8414
8415 If you publish or distribute Opaque copies of the Document numbering
8416 more than 100, you must either include a machine-readable Transparent
8417 copy along with each Opaque copy, or state in or with each Opaque copy
8418 a computer-network location from which the general network-using
8419 public has access to download using public-standard network protocols
8420 a complete Transparent copy of the Document, free of added material.
8421 If you use the latter option, you must take reasonably prudent steps,
8422 when you begin distribution of Opaque copies in quantity, to ensure
8423 that this Transparent copy will remain thus accessible at the stated
8424 location until at least one year after the last time you distribute an
8425 Opaque copy (directly or through your agents or retailers) of that
8426 edition to the public.
8427
8428 It is requested, but not required, that you contact the authors of the
8429 Document well before redistributing any large number of copies, to give
8430 them a chance to provide you with an updated version of the Document.
8431 @sp 1
8432 @item
8433 MODIFICATIONS
8434
8435 You may copy and distribute a Modified Version of the Document under
8436 the conditions of sections 2 and 3 above, provided that you release
8437 the Modified Version under precisely this License, with the Modified
8438 Version filling the role of the Document, thus licensing distribution
8439 and modification of the Modified Version to whoever possesses a copy
8440 of it. In addition, you must do these things in the Modified Version:
8441
8442 A. Use in the Title Page (and on the covers, if any) a title distinct
8443 from that of the Document, and from those of previous versions
8444 (which should, if there were any, be listed in the History section
8445 of the Document). You may use the same title as a previous version
8446 if the original publisher of that version gives permission.@*
8447 B. List on the Title Page, as authors, one or more persons or entities
8448 responsible for authorship of the modifications in the Modified
8449 Version, together with at least five of the principal authors of the
8450 Document (all of its principal authors, if it has fewer than five),
8451 unless they release you from this requirement.@*
8452 C. State on the Title page the name of the publisher of the
8453 Modified Version, as the publisher.@*
8454 D. Preserve all the copyright notices of the Document.@*
8455 E. Add an appropriate copyright notice for your modifications
8456 adjacent to the other copyright notices.@*
8457 F. Include, immediately after the copyright notices, a license notice
8458 giving the public permission to use the Modified Version under the
8459 terms of this License, in the form shown in the Addendum below.@*
8460 G. Preserve in that license notice the full lists of Invariant Sections
8461 and required Cover Texts given in the Document's license notice.@*
8462 H. Include an unaltered copy of this License.@*
8463 I. Preserve the section Entitled ``History'', Preserve its Title, and add
8464 to it an item stating at least the title, year, new authors, and
8465 publisher of the Modified Version as given on the Title Page. If
8466 there is no section Entitled ``History'' in the Document, create one
8467 stating the title, year, authors, and publisher of the Document as
8468 given on its Title Page, then add an item describing the Modified
8469 Version as stated in the previous sentence.@*
8470 J. Preserve the network location, if any, given in the Document for
8471 public access to a Transparent copy of the Document, and likewise
8472 the network locations given in the Document for previous versions
8473 it was based on. These may be placed in the ``History'' section.
8474 You may omit a network location for a work that was published at
8475 least four years before the Document itself, or if the original
8476 publisher of the version it refers to gives permission.@*
8477 K. For any section Entitled ``Acknowledgements'' or ``Dedications'',
8478 Preserve the Title of the section, and preserve in the section all
8479 the substance and tone of each of the contributor acknowledgements
8480 and/or dedications given therein.@*
8481 L. Preserve all the Invariant Sections of the Document,
8482 unaltered in their text and in their titles. Section numbers
8483 or the equivalent are not considered part of the section titles.@*
8484 M. Delete any section Entitled ``Endorsements.'' Such a section
8485 may not be included in the Modified Version.@*
8486 N. Do not retitle any existing section to be Entitled ``Endorsements''
8487 or to conflict in title with any Invariant Section.@*
8488 O. Preserve any Warranty Disclaimers.@*
8489 @sp 1
8490 If the Modified Version includes new front-matter sections or
8491 appendices that qualify as Secondary Sections and contain no material
8492 copied from the Document, you may at your option designate some or all
8493 of these sections as invariant. To do this, add their titles to the
8494 list of Invariant Sections in the Modified Version's license notice.
8495 These titles must be distinct from any other section titles.
8496
8497 You may add a section Entitled ``Endorsements'', provided it contains
8498 nothing but endorsements of your Modified Version by various
8499 parties--for example, statements of peer review or that the text has
8500 been approved by an organization as the authoritative definition of a
8501 standard.
8502
8503 You may add a passage of up to five words as a Front-Cover Text, and a
8504 passage of up to 25 words as a Back-Cover Text, to the end of the list
8505 of Cover Texts in the Modified Version. Only one passage of
8506 Front-Cover Text and one of Back-Cover Text may be added by (or
8507 through arrangements made by) any one entity. If the Document already
8508 includes a cover text for the same cover, previously added by you or
8509 by arrangement made by the same entity you are acting on behalf of,
8510 you may not add another; but you may replace the old one, on explicit
8511 permission from the previous publisher that added the old one.
8512
8513 The author(s) and publisher(s) of the Document do not by this License
8514 give permission to use their names for publicity for or to assert or
8515 imply endorsement of any Modified Version.
8516 @sp 1
8517 @item
8518 COMBINING DOCUMENTS
8519
8520 You may combine the Document with other documents released under this
8521 License, under the terms defined in section 4 above for modified
8522 versions, provided that you include in the combination all of the
8523 Invariant Sections of all of the original documents, unmodified, and
8524 list them all as Invariant Sections of your combined work in its
8525 license notice, and that you preserve all their Warranty Disclaimers.
8526
8527 The combined work need only contain one copy of this License, and
8528 multiple identical Invariant Sections may be replaced with a single
8529 copy. If there are multiple Invariant Sections with the same name but
8530 different contents, make the title of each such section unique by
8531 adding at the end of it, in parentheses, the name of the original
8532 author or publisher of that section if known, or else a unique number.
8533 Make the same adjustment to the section titles in the list of
8534 Invariant Sections in the license notice of the combined work.
8535
8536 In the combination, you must combine any sections Entitled ``History''
8537 in the various original documents, forming one section Entitled
8538 ``History''; likewise combine any sections Entitled ``Acknowledgements'',
8539 and any sections Entitled ``Dedications.'' You must delete all sections
8540 Entitled ``Endorsements.''
8541 @sp 1
8542 @item
8543 COLLECTIONS OF DOCUMENTS
8544
8545 You may make a collection consisting of the Document and other documents
8546 released under this License, and replace the individual copies of this
8547 License in the various documents with a single copy that is included in
8548 the collection, provided that you follow the rules of this License for
8549 verbatim copying of each of the documents in all other respects.
8550
8551 You may extract a single document from such a collection, and distribute
8552 it individually under this License, provided you insert a copy of this
8553 License into the extracted document, and follow this License in all
8554 other respects regarding verbatim copying of that document.
8555 @sp 1
8556 @item
8557 AGGREGATION WITH INDEPENDENT WORKS
8558
8559 A compilation of the Document or its derivatives with other separate
8560 and independent documents or works, in or on a volume of a storage or
8561 distribution medium, is called an ``aggregate'' if the copyright
8562 resulting from the compilation is not used to limit the legal rights
8563 of the compilation's users beyond what the individual works permit.
8564 When the Document is included in an aggregate, this License does not
8565 apply to the other works in the aggregate which are not themselves
8566 derivative works of the Document.
8567
8568 If the Cover Text requirement of section 3 is applicable to these
8569 copies of the Document, then if the Document is less than one half of
8570 the entire aggregate, the Document's Cover Texts may be placed on
8571 covers that bracket the Document within the aggregate, or the
8572 electronic equivalent of covers if the Document is in electronic form.
8573 Otherwise they must appear on printed covers that bracket the whole
8574 aggregate.
8575 @sp 1
8576 @item
8577 TRANSLATION
8578
8579 Translation is considered a kind of modification, so you may
8580 distribute translations of the Document under the terms of section 4.
8581 Replacing Invariant Sections with translations requires special
8582 permission from their copyright holders, but you may include
8583 translations of some or all Invariant Sections in addition to the
8584 original versions of these Invariant Sections. You may include a
8585 translation of this License, and all the license notices in the
8586 Document, and any Warranty Disclaimers, provided that you also include
8587 the original English version of this License and the original versions
8588 of those notices and disclaimers. In case of a disagreement between
8589 the translation and the original version of this License or a notice
8590 or disclaimer, the original version will prevail.
8591
8592 If a section in the Document is Entitled ``Acknowledgements'',
8593 ``Dedications'', or ``History'', the requirement (section 4) to Preserve
8594 its Title (section 1) will typically require changing the actual
8595 title.
8596 @sp 1
8597 @item
8598 TERMINATION
8599
8600 You may not copy, modify, sublicense, or distribute the Document except
8601 as expressly provided for under this License. Any other attempt to
8602 copy, modify, sublicense or distribute the Document is void, and will
8603 automatically terminate your rights under this License. However,
8604 parties who have received copies, or rights, from you under this
8605 License will not have their licenses terminated so long as such
8606 parties remain in full compliance.
8607 @sp 1
8608 @item
8609 FUTURE REVISIONS OF THIS LICENSE
8610
8611 The Free Software Foundation may publish new, revised versions
8612 of the GNU Free Documentation License from time to time. Such new
8613 versions will be similar in spirit to the present version, but may
8614 differ in detail to address new problems or concerns. See
8615 http://www.gnu.org/copyleft/.
8616
8617 Each version of the License is given a distinguishing version number.
8618 If the Document specifies that a particular numbered version of this
8619 License ``or any later version'' applies to it, you have the option of
8620 following the terms and conditions either of that specified version or
8621 of any later version that has been published (not as a draft) by the
8622 Free Software Foundation. If the Document does not specify a version
8623 number of this License, you may choose any version ever published (not
8624 as a draft) by the Free Software Foundation.
8625
8626 @end enumerate
8627
8628 @unnumberedsec ADDENDUM: How to use this License for your documents
8629
8630 To use this License in a document you have written, include a copy of
8631 the License in the document and put the following copyright and
8632 license notices just after the title page:
8633
8634 @smallexample
8635 @group
8636 Copyright (C) @var{year} @var{your name}.
8637 Permission is granted to copy, distribute and/or modify this document
8638 under the terms of the GNU Free Documentation License, Version 1.2
8639 or any later version published by the Free Software Foundation;
8640 with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
8641 A copy of the license is included in the section entitled ``GNU
8642 Free Documentation License''.
8643 @end group
8644 @end smallexample
8645
8646 If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts,
8647 replace the ``with...Texts.'' line with this:
8648
8649 @smallexample
8650 @group
8651 with the Invariant Sections being @var{list their titles}, with the
8652 Front-Cover Texts being @var{list}, and with the Back-Cover Texts being
8653 @var{list}.
8654 @end group
8655 @end smallexample
8656
8657 If you have Invariant Sections without Cover Texts, or some other
8658 combination of the three, merge those two alternatives to suit the
8659 situation.
8660
8661 If your document contains nontrivial examples of program code, we
8662 recommend releasing these examples in parallel under your choice of
8663 free software license, such as the GNU General Public License,
8664 to permit their use in free software.
8665
8666 @node GPL, Key Index, GFDL, Top
8667 @appendix GNU GENERAL PUBLIC LICENSE
8668 @center Version 2, June 1991
8669
8670 @display
8671 Copyright @copyright{} 1989, 1991 Free Software Foundation, Inc.
8672 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
8673
8674 Everyone is permitted to copy and distribute verbatim copies
8675 of this license document, but changing it is not allowed.
8676 @end display
8677
8678 @unnumberedsec Preamble
8679
8680 The licenses for most software are designed to take away your
8681 freedom to share and change it. By contrast, the GNU General Public
8682 License is intended to guarantee your freedom to share and change free
8683 software---to make sure the software is free for all its users. This
8684 General Public License applies to most of the Free Software
8685 Foundation's software and to any other program whose authors commit to
8686 using it. (Some other Free Software Foundation software is covered by
8687 the GNU Library General Public License instead.) You can apply it to
8688 your programs, too.
8689
8690 When we speak of free software, we are referring to freedom, not
8691 price. Our General Public Licenses are designed to make sure that you
8692 have the freedom to distribute copies of free software (and charge for
8693 this service if you wish), that you receive source code or can get it
8694 if you want it, that you can change the software or use pieces of it
8695 in new free programs; and that you know you can do these things.
8696
8697 To protect your rights, we need to make restrictions that forbid
8698 anyone to deny you these rights or to ask you to surrender the rights.
8699 These restrictions translate to certain responsibilities for you if you
8700 distribute copies of the software, or if you modify it.
8701
8702 For example, if you distribute copies of such a program, whether
8703 gratis or for a fee, you must give the recipients all the rights that
8704 you have. You must make sure that they, too, receive or can get the
8705 source code. And you must show them these terms so they know their
8706 rights.
8707
8708 We protect your rights with two steps: (1) copyright the software, and
8709 (2) offer you this license which gives you legal permission to copy,
8710 distribute and/or modify the software.
8711
8712 Also, for each author's protection and ours, we want to make certain
8713 that everyone understands that there is no warranty for this free
8714 software. If the software is modified by someone else and passed on, we
8715 want its recipients to know that what they have is not the original, so
8716 that any problems introduced by others will not reflect on the original
8717 authors' reputations.
8718
8719 Finally, any free program is threatened constantly by software
8720 patents. We wish to avoid the danger that redistributors of a free
8721 program will individually obtain patent licenses, in effect making the
8722 program proprietary. To prevent this, we have made it clear that any
8723 patent must be licensed for everyone's free use or not licensed at all.
8724
8725 The precise terms and conditions for copying, distribution and
8726 modification follow.
8727
8728 @iftex
8729 @unnumberedsec TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
8730 @end iftex
8731 @ifinfo
8732 @center TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
8733 @end ifinfo
8734
8735 @enumerate 0
8736 @item
8737 This License applies to any program or other work which contains
8738 a notice placed by the copyright holder saying it may be distributed
8739 under the terms of this General Public License. The ``Program,'' below,
8740 refers to any such program or work, and a ``work based on the Program''
8741 means either the Program or any derivative work under copyright law:
8742 that is to say, a work containing the Program or a portion of it,
8743 either verbatim or with modifications and/or translated into another
8744 language. (Hereinafter, translation is included without limitation in
8745 the term ``modification.'') Each licensee is addressed as ``you.''
8746
8747 Activities other than copying, distribution and modification are not
8748 covered by this License; they are outside its scope. The act of
8749 running the Program is not restricted, and the output from the Program
8750 is covered only if its contents constitute a work based on the
8751 Program (independent of having been made by running the Program).
8752 Whether that is true depends on what the Program does.
8753
8754 @item
8755 You may copy and distribute verbatim copies of the Program's
8756 source code as you receive it, in any medium, provided that you
8757 conspicuously and appropriately publish on each copy an appropriate
8758 copyright notice and disclaimer of warranty; keep intact all the
8759 notices that refer to this License and to the absence of any warranty;
8760 and give any other recipients of the Program a copy of this License
8761 along with the Program.
8762
8763 You may charge a fee for the physical act of transferring a copy, and
8764 you may at your option offer warranty protection in exchange for a fee.
8765
8766 @item
8767 You may modify your copy or copies of the Program or any portion
8768 of it, thus forming a work based on the Program, and copy and
8769 distribute such modifications or work under the terms of Section 1
8770 above, provided that you also meet all of these conditions:
8771
8772 @enumerate a
8773 @item
8774 You must cause the modified files to carry prominent notices
8775 stating that you changed the files and the date of any change.
8776
8777 @item
8778 You must cause any work that you distribute or publish, that in
8779 whole or in part contains or is derived from the Program or any
8780 part thereof, to be licensed as a whole at no charge to all third
8781 parties under the terms of this License.
8782
8783 @item
8784 If the modified program normally reads commands interactively
8785 when run, you must cause it, when started running for such
8786 interactive use in the most ordinary way, to print or display an
8787 announcement including an appropriate copyright notice and a
8788 notice that there is no warranty (or else, saying that you provide
8789 a warranty) and that users may redistribute the program under
8790 these conditions, and telling the user how to view a copy of this
8791 License. (Exception: if the Program itself is interactive but
8792 does not normally print such an announcement, your work based on
8793 the Program is not required to print an announcement.)
8794 @end enumerate
8795
8796 These requirements apply to the modified work as a whole. If
8797 identifiable sections of that work are not derived from the Program,
8798 and can be reasonably considered independent and separate works in
8799 themselves, then this License, and its terms, do not apply to those
8800 sections when you distribute them as separate works. But when you
8801 distribute the same sections as part of a whole which is a work based
8802 on the Program, the distribution of the whole must be on the terms of
8803 this License, whose permissions for other licensees extend to the
8804 entire whole, and thus to each and every part regardless of who wrote it.
8805
8806 Thus, it is not the intent of this section to claim rights or contest
8807 your rights to work written entirely by you; rather, the intent is to
8808 exercise the right to control the distribution of derivative or
8809 collective works based on the Program.
8810
8811 In addition, mere aggregation of another work not based on the Program
8812 with the Program (or with a work based on the Program) on a volume of
8813 a storage or distribution medium does not bring the other work under
8814 the scope of this License.
8815
8816 @item
8817 You may copy and distribute the Program (or a work based on it,
8818 under Section 2) in object code or executable form under the terms of
8819 Sections 1 and 2 above provided that you also do one of the following:
8820
8821 @enumerate a
8822 @item
8823 Accompany it with the complete corresponding machine-readable
8824 source code, which must be distributed under the terms of Sections
8825 1 and 2 above on a medium customarily used for software interchange; or,
8826
8827 @item
8828 Accompany it with a written offer, valid for at least three
8829 years, to give any third party, for a charge no more than your
8830 cost of physically performing source distribution, a complete
8831 machine-readable copy of the corresponding source code, to be
8832 distributed under the terms of Sections 1 and 2 above on a medium
8833 customarily used for software interchange; or,
8834
8835 @item
8836 Accompany it with the information you received as to the offer
8837 to distribute corresponding source code. (This alternative is
8838 allowed only for noncommercial distribution and only if you
8839 received the program in object code or executable form with such
8840 an offer, in accord with Subsection b above.)
8841 @end enumerate
8842
8843 The source code for a work means the preferred form of the work for
8844 making modifications to it. For an executable work, complete source
8845 code means all the source code for all modules it contains, plus any
8846 associated interface definition files, plus the scripts used to
8847 control compilation and installation of the executable. However, as a
8848 special exception, the source code distributed need not include
8849 anything that is normally distributed (in either source or binary
8850 form) with the major components (compiler, kernel, and so on) of the
8851 operating system on which the executable runs, unless that component
8852 itself accompanies the executable.
8853
8854 If distribution of executable or object code is made by offering
8855 access to copy from a designated place, then offering equivalent
8856 access to copy the source code from the same place counts as
8857 distribution of the source code, even though third parties are not
8858 compelled to copy the source along with the object code.
8859
8860 @item
8861 You may not copy, modify, sublicense, or distribute the Program
8862 except as expressly provided under this License. Any attempt
8863 otherwise to copy, modify, sublicense or distribute the Program is
8864 void, and will automatically terminate your rights under this License.
8865 However, parties who have received copies, or rights, from you under
8866 this License will not have their licenses terminated so long as such
8867 parties remain in full compliance.
8868
8869 @item
8870 You are not required to accept this License, since you have not
8871 signed it. However, nothing else grants you permission to modify or
8872 distribute the Program or its derivative works. These actions are
8873 prohibited by law if you do not accept this License. Therefore, by
8874 modifying or distributing the Program (or any work based on the
8875 Program), you indicate your acceptance of this License to do so, and
8876 all its terms and conditions for copying, distributing or modifying
8877 the Program or works based on it.
8878
8879 @item
8880 Each time you redistribute the Program (or any work based on the
8881 Program), the recipient automatically receives a license from the
8882 original licensor to copy, distribute or modify the Program subject to
8883 these terms and conditions. You may not impose any further
8884 restrictions on the recipients' exercise of the rights granted herein.
8885 You are not responsible for enforcing compliance by third parties to
8886 this License.
8887
8888 @item
8889 If, as a consequence of a court judgment or allegation of patent
8890 infringement or for any other reason (not limited to patent issues),
8891 conditions are imposed on you (whether by court order, agreement or
8892 otherwise) that contradict the conditions of this License, they do not
8893 excuse you from the conditions of this License. If you cannot
8894 distribute so as to satisfy simultaneously your obligations under this
8895 License and any other pertinent obligations, then as a consequence you
8896 may not distribute the Program at all. For example, if a patent
8897 license would not permit royalty-free redistribution of the Program by
8898 all those who receive copies directly or indirectly through you, then
8899 the only way you could satisfy both it and this License would be to
8900 refrain entirely from distribution of the Program.
8901
8902 If any portion of this section is held invalid or unenforceable under
8903 any particular circumstance, the balance of the section is intended to
8904 apply and the section as a whole is intended to apply in other
8905 circumstances.
8906
8907 It is not the purpose of this section to induce you to infringe any
8908 patents or other property right claims or to contest validity of any
8909 such claims; this section has the sole purpose of protecting the
8910 integrity of the free software distribution system, which is
8911 implemented by public license practices. Many people have made
8912 generous contributions to the wide range of software distributed
8913 through that system in reliance on consistent application of that
8914 system; it is up to the author/donor to decide if he or she is willing
8915 to distribute software through any other system and a licensee cannot
8916 impose that choice.
8917
8918 This section is intended to make thoroughly clear what is believed to
8919 be a consequence of the rest of this License.
8920
8921 @item
8922 If the distribution and/or use of the Program is restricted in
8923 certain countries either by patents or by copyrighted interfaces, the
8924 original copyright holder who places the Program under this License
8925 may add an explicit geographical distribution limitation excluding
8926 those countries, so that distribution is permitted only in or among
8927 countries not thus excluded. In such case, this License incorporates
8928 the limitation as if written in the body of this License.
8929
8930 @item
8931 The Free Software Foundation may publish revised and/or new versions
8932 of the General Public License from time to time. Such new versions will
8933 be similar in spirit to the present version, but may differ in detail to
8934 address new problems or concerns.
8935
8936 Each version is given a distinguishing version number. If the Program
8937 specifies a version number of this License which applies to it and ``any
8938 later version,'' you have the option of following the terms and conditions
8939 either of that version or of any later version published by the Free
8940 Software Foundation. If the Program does not specify a version number of
8941 this License, you may choose any version ever published by the Free Software
8942 Foundation.
8943
8944 @item
8945 If you wish to incorporate parts of the Program into other free
8946 programs whose distribution conditions are different, write to the author
8947 to ask for permission. For software which is copyrighted by the Free
8948 Software Foundation, write to the Free Software Foundation; we sometimes
8949 make exceptions for this. Our decision will be guided by the two goals
8950 of preserving the free status of all derivatives of our free software and
8951 of promoting the sharing and reuse of software generally.
8952
8953 @iftex
8954 @heading NO WARRANTY
8955 @end iftex
8956 @ifinfo
8957 @center NO WARRANTY
8958 @end ifinfo
8959
8960 @item
8961 BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
8962 FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW@. EXCEPT WHEN
8963 OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
8964 PROVIDE THE PROGRAM ``AS IS'' WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
8965 OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
8966 MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE@. THE ENTIRE RISK AS
8967 TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU@. SHOULD THE
8968 PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
8969 REPAIR OR CORRECTION.
8970
8971 @item
8972 IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
8973 WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
8974 REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
8975 INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
8976 OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
8977 TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
8978 YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
8979 PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
8980 POSSIBILITY OF SUCH DAMAGES.
8981 @end enumerate
8982
8983 @iftex
8984 @heading END OF TERMS AND CONDITIONS
8985 @end iftex
8986 @ifinfo
8987 @center END OF TERMS AND CONDITIONS
8988 @end ifinfo
8989
8990 @page
8991 @unnumberedsec How to Apply These Terms to Your New Programs
8992
8993 If you develop a new program, and you want it to be of the greatest
8994 possible use to the public, the best way to achieve this is to make it
8995 free software which everyone can redistribute and change under these terms.
8996
8997 To do so, attach the following notices to the program. It is safest
8998 to attach them to the start of each source file to most effectively
8999 convey the exclusion of warranty; and each file should have at least
9000 the ``copyright'' line and a pointer to where the full notice is found.
9001
9002 @smallexample
9003 @var{one line to give the program's name and an idea of what it does.}
9004 Copyright (C) 19@var{yy} @var{name of author}
9005
9006 This program is free software; you can redistribute it and/or
9007 modify it under the terms of the GNU General Public License
9008 as published by the Free Software Foundation; either version 2
9009 of the License, or (at your option) any later version.
9010
9011 This program is distributed in the hope that it will be useful,
9012 but WITHOUT ANY WARRANTY; without even the implied warranty of
9013 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE@. See the
9014 GNU General Public License for more details.
9015
9016 You should have received a copy of the GNU General Public License along
9017 with this program; if not, write to the Free Software Foundation, Inc.,
9018 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
9019 @end smallexample
9020
9021 Also add information on how to contact you by electronic and paper mail.
9022
9023 If the program is interactive, make it output a short notice like this
9024 when it starts in an interactive mode:
9025
9026 @smallexample
9027 Gnomovision version 69, Copyright (C) 20@var{yy} @var{name of author}
9028 Gnomovision comes with ABSOLUTELY NO WARRANTY; for details
9029 type `show w'. This is free software, and you are welcome
9030 to redistribute it under certain conditions; type `show c'
9031 for details.
9032 @end smallexample
9033
9034 The hypothetical commands @samp{show w} and @samp{show c} should show
9035 the appropriate parts of the General Public License. Of course, the
9036 commands you use may be called something other than @samp{show w} and
9037 @samp{show c}; they could even be mouse-clicks or menu items---whatever
9038 suits your program.
9039
9040 You should also get your employer (if you work as a programmer) or your
9041 school, if any, to sign a ``copyright disclaimer'' for the program, if
9042 necessary. Here is a sample; alter the names:
9043
9044 @smallexample
9045 @group
9046 Yoyodyne, Inc., hereby disclaims all copyright
9047 interest in the program `Gnomovision'
9048 (which makes passes at compilers) written
9049 by James Hacker.
9050
9051 @var{signature of Ty Coon}, 1 April 1989
9052 Ty Coon, President of Vice
9053 @end group
9054 @end smallexample
9055
9056 This General Public License does not permit incorporating your program into
9057 proprietary programs. If your program is a subroutine library, you may
9058 consider it more useful to permit linking proprietary applications with the
9059 library. If this is what you want to do, use the GNU Library General
9060 Public License instead of this License.
9061
9062 @node Key Index, Command Index, GPL, Top
9063 @unnumbered Key (Character) Index
9064 @printindex ky
9065
9066 @node Command Index, Option Index, Key Index, Top
9067 @unnumbered Command Index
9068 @printindex fn
9069
9070 @node Option Index, Concept Index, Command Index, Top
9071 @unnumbered Option (Variable) Index
9072 @printindex vr
9073
9074 @node Concept Index, , Option Index, Top
9075 @unnumbered Concept Index
9076 @printindex cp
9077
9078 @bye
9079
9080 @c Ispell Helpers
9081 @c
9082 @c The following are words that ispell should ignore that would not
9083 @c normally be in a dictionary (global or personal). Be careful not to
9084 @c include words here that could potentially be typos of other words
9085 @c (such as url, elisp, or MHE).
9086 @c
9087 @c LocalWords: CTRL ESC SPC f's
9088 @c LocalWords: addr Aliasfile alist
9089 @c LocalWords: Baushke Bcc BBN Beranek bogofilter bogofilter's
9090 @c LocalWords: cmd CMU contrib cron
9091 @c LocalWords: DesBrisay Dcc devel dir dired docstring filll forw
9092 @c LocalWords: GECOS Gildea Gildea's Ginnean GnuCash goto gnuserv htm
9093 @c LocalWords: ImageMagick inbox ispell keychain
9094 @c LocalWords: Larus licensor LocalWords lookup lpr
9095 @c LocalWords: makeinfo mairix mbox mh mhbuild mhl mhpath mlisp
9096 @c LocalWords: MML msg multipart
9097 @c LocalWords: Namazu NIS nenscript nnml num
9098 @c LocalWords: packmbox passphrase pathname prev procmail prog repl
9099 @c LocalWords: slocal sortm SpamAssassin spammers SpamProbe SpamProbe's
9100 @c LocalWords: sublicense supercite speedbar
9101 @c LocalWords: Tennex texi texinfo Thelen thelenm
9102 @c LocalWords: UCI undeleted whatnow wohler xmh ypcat
9103 @c
9104 @c See http://www.oreilly.com/oreilly/author/stylesheet.html.
9105 @c See http://en.wikipedia.org/.
9106 @c
9107 @c Note the lowercase mh which is needed to avoid hits in the
9108 @c functions and variables. Occasionally, check for accidental
9109 @c inclusion of mh in text by uncommenting the following and executing
9110 @c it with C-x C-e. You want to see "Search failed"
9111 @c (let ((case-fold-search nil))
9112 @c (goto-char (point-min))
9113 @c (search-forward-regexp "^mh\\( \\|$\\)"))
9114 @c
9115 @c An extremely useful setting for texinfo-mode-hook is:
9116 @c (add-to-list
9117 @c 'ispell-skip-region-alist
9118 @c (list
9119 @c (concat "\\(@\\(small\\)?\\(example\\|lisp\\)"
9120 @c "\\(@\\([irw]\\|code\\|var\\){[^}]+}\\|"
9121 @c "@[@{}.]\\|"
9122 @c "[^@]\\|"
9123 @c "@\\(end \\)?group\\|"
9124 @c "@\\(end \\)?cartouche\\)+"
9125 @c "@end \\(small\\)?\\(example\\|lisp\\)\\|"
9126 @c "@\\(code\\|command\\|file\\|kbd\\|sc\\){[^}]+}\\|"
9127 @c "^@end [a-z]+$\\|"
9128 @c "^@\\([fv]\\|print\\)index .*$\\|"
9129 @c "@uref{[^,]+,\\|"
9130 @c "@[a-z]+\\|"
9131 @c "/[a-z.]+[/}]\\)")))))
9132 @c
9133 @c Cross References
9134 @c
9135 @c See existing cross-references to the Emacs manual and the Emacs
9136 @c Lisp manual (search for ``GNU Emacs Manual'' and ``GNU
9137 @c Emacs Lisp Reference Manual'' respectively).
9138
9139 @c @ftable Sorting
9140 @c
9141 @c As per index (sort of): Punctuation, keyboard characters (such as
9142 @c RET and BS) upper and lowercase mixed (lower comes before
9143 @c uppercase), control characters go with uppercase C, meta characters
9144 @c go with uppercase M.
9145 @c In some cases, the sort isn't strictly ASCII.
9146 @c For example, SPC (mh-page-msg) reads better before BS
9147 @c (mh-previous-page) and . (mh-show) is better before ,
9148 @c (mh-header-display).
9149
9150 @c @vtable Sorting
9151 @c
9152 @c Alphabetical, pull hooks into their own table.
9153
9154 @c Local Variables:
9155 @c sentence-end-double-space: nil
9156 @c End: