* doc/misc/mh-e.texi: Replace another `:' in an index entry.
[bpt/emacs.git] / doc / misc / mh-e.texi
CommitLineData
681ebc33 1\input texinfo @c -*- mode: texinfo; coding: utf-8; -*-
4009494e
GM
2@c
3@c Note: This document requires makeinfo version 4.6 or greater to build.
4@c
5@c %**start of header
db78a8cb 6@setfilename ../../info/mh-e
4009494e 7@settitle The MH-E Manual
c6ab4664 8@documentencoding UTF-8
4009494e
GM
9@c %**end of header
10
11@c Version of the software and manual.
fc0c5af8 12@set VERSION 8.5
4009494e
GM
13@c Edition of the manual. It is either empty for the first edition or
14@c has the form ", nth Edition" (without the quotes).
2a1cf2b9 15@set EDITION
fc0c5af8
BW
16@set UPDATED 2013-03-02
17@set UPDATE-MONTH March, 2013
4009494e
GM
18
19@c Other variables.
20@set MH-BOOK-HOME http://rand-mh.sourceforge.net/book/mh
21@set MH-E-HOME http://mh-e.sourceforge.net/
22
23@c Copyright
24@copying
25This is version @value{VERSION}@value{EDITION} of @cite{The MH-E
26Manual}, last updated @value{UPDATED}.
27
6bc383b1 28Copyright @copyright{} 1995, 2001--2003, 2005--2014 Free Software
f99f1641 29Foundation, Inc.
4009494e 30
2ecba534
BW
31@c This dual license has been agreed upon by the FSF.
32
4009494e 33@quotation
6a359279 34Permission is granted to copy, distribute and/or modify this document
2ecba534
BW
35under the terms of either:
36
37@enumerate a
38@item
6a2c4aec 39the GNU Free Documentation License, Version 1.3 or any later version
2ecba534
BW
40published by the Free Software Foundation; with no Invariant Sections,
41with the Front-Cover texts being ``A GNU Manual,'' and with the
42Back-Cover Texts as in (a) below. A copy of the license is included in
43the section entitled ``GNU Free Documentation License.''
6a359279
GM
44
45(a) The FSF's Back-Cover Text is: ``You have the freedom to copy and
6bf430d1 46modify this GNU manual.''
2ecba534
BW
47
48@item
49the GNU General Public License as published by the Free Software
50Foundation; either version 3, or (at your option) any later version. A
51copy of the license is included in the section entitled ``GNU General
52Public License.''
53@end enumerate
54
4009494e
GM
55@end quotation
56@end copying
57
58@c Info Directory Entry
0c973505 59@dircategory Emacs network features
4009494e 60@direntry
9360256a 61* MH-E: (mh-e). Emacs interface to the MH mail system.
4009494e
GM
62@end direntry
63
64@c Title Page
4009494e
GM
65@titlepage
66@title The MH-E Manual
67@subtitle Version @value{VERSION}@value{EDITION}
68@subtitle @value{UPDATE-MONTH}
69@author Bill Wohler
70
71@c Copyright Page
72@page
73@vskip 0pt plus 1filll
74@insertcopying
75@end titlepage
76
77@ifnottex
78@html
79<!--
80@end html
81@node Top, Preface, (dir), (dir)
82@top The MH-E Manual
83@html
84-->
85@end html
86@insertcopying
87@end ifnottex
88
89@c Table of Contents
90@contents
91
92@html
93<!--
94@end html
95
96@menu
97* Preface:: Preface
98* Conventions:: GNU Emacs Terms and Conventions
99* Getting Started:: Getting Started
100* Tour Through MH-E:: Tour Through MH-E
101* Using This Manual:: Using This Manual
102* Incorporating Mail:: Incorporating Mail
103* Reading Mail:: Reading Mail
104* Folders:: Organizing Your Mail with Folders
105* Sending Mail:: Sending Mail
106* Editing Drafts:: Editing a Draft
107* Aliases:: Aliases
108* Identities:: Identities
109* Speedbar:: The Speedbar
110* Menu Bar:: The Menu Bar
111* Tool Bar:: The Tool Bar
112* Searching:: Searching Through Messages
113* Threading:: Viewing Message Threads
114* Limits:: Limiting Display
115* Sequences:: Using Sequences
116* Junk:: Dealing With Junk Mail
117* Miscellaneous:: Miscellaneous Commands, Variables, and Buffers
118* Scan Line Formats:: Scan Line Formats
119* Procmail:: Reading Mailing Lists Effectively
120* Odds and Ends:: Odds and Ends
121* History:: History of MH-E
122* GFDL:: GNU Free Documentation License
2ecba534 123* GPL:: GNU General Public License
4009494e
GM
124* Key Index:: Key (Character) Index
125* Command Index:: Command Index
126* Option Index:: Option (Variable) Index
127* Concept Index:: Concept Index
128
129@detailmenu
130 --- The Detailed Node Listing ---
131
132Tour Through MH-E
133
134* Sending Mail Tour::
135* Reading Mail Tour::
136* Processing Mail Tour::
137* Leaving MH-E::
138* More About MH-E::
139
140Using This Manual
141
142* Options::
143* Ranges::
144* Folder Selection::
145
146Reading Your Mail
147
148* Viewing::
149* Viewing Attachments::
150* HTML::
151* Digests::
152* Reading PGP::
153* Printing::
154* Files and Pipes::
155* Navigating::
156* Miscellaneous Commands and Options::
157
158Sending Mail
159
160* Composing::
161* Replying::
162* Forwarding::
163* Redistributing::
164* Editing Again::
165
166Editing a Draft
167
168* Editing Message::
169* Inserting Letter::
170* Inserting Messages::
171* Signature::
172* Picture::
173* Adding Attachments::
174* Sending PGP::
175* Checking Recipients::
176* Sending Message::
177* Killing Draft::
178
179Odds and Ends
180
181* Bug Reports::
182* Mailing Lists::
183* MH FAQ and Support::
184* Getting MH-E::
185
186History of MH-E
187
188* From Brian Reid::
189* From Jim Larus::
190* From Stephen Gildea::
191* From Bill Wohler::
192
193@end detailmenu
194@end menu
195
196@html
197-->
198@end html
199
200@node Preface, Conventions, Top, Top
201@unnumbered Preface
202
203@cindex Emacs
204@cindex Unix commands, Emacs
205@cindex preface
206
207This manual introduces another interface to the MH mail system that is
208accessible through the GNU Emacs editor, namely, @emph{MH-E}. MH-E is
209easy to use. I don't assume that you know GNU Emacs or even MH at this
1df7defd 210point, since I didn't know either of them when I discovered MH-E@.
4009494e
GM
211However, MH-E was the tip of the iceberg, and I discovered more and
212more niceties about GNU Emacs and MH@. Now I'm fully hooked on both of
213them.
214
47301027 215The MH-E package is distributed with Emacs@footnote{Version
d0457b57 216@value{VERSION} of MH-E appeared in Emacs 24.4. It is supported in GNU
b523dc20
BW
217Emacs 23 and higher, as well as XEmacs 21.4.22 and 21.5.31. MH-E is
218known not to work with GNU Emacs versions 20 and below, and XEmacs
f99f1641 219version 21.5.9--21.5.16. It is compatible with MH versions 6.8.4 and
b523dc20 220higher, all versions of nmh, and GNU mailutils 1.0 and higher}, so you
30864d5f
BW
221shouldn't have to do anything special to use it. Gnus is also
222required; version 5.10 or higher is recommended. This manual covers
4009494e
GM
223MH-E version @value{VERSION}. To help you decide which version you
224have, see @ref{Getting Started}.
225
226@findex help-with-tutorial
227@kindex C-h t
228
229If you don't already use GNU Emacs but want to learn more, you can
230read an online tutorial by starting GNU Emacs and typing @kbd{C-h t}
231(@code{help-with-tutorial}). (To learn about this notation, see
232@ref{Conventions}.) If you want to take the plunge, consult the
233@iftex
234@cite{GNU Emacs Manual},
235@end iftex
236@ifinfo
a944db14 237@ref{Top, , GNU Emacs Manual, emacs, GNU Emacs Manual},
4009494e
GM
238@end ifinfo
239@ifhtml
fc0c5af8 240@uref{http://www.gnu.org/software/emacs/manual/html_node/emacs/,
4009494e
GM
241@cite{GNU Emacs Manual}},
242@end ifhtml
243from the Free Software Foundation.
244
245If more information is needed, you can go to the Unix manual pages of
246the individual MH commands. When the name is not obvious, I'll guide
247you to a relevant MH manual page that describes the action more fully.
248
b3a271a5
GM
249@c ":" does not work in index entries in Info.
250@cindex @cite{MH & nmh - Email for Users & Programmers}
4009494e
GM
251@cindex MH book
252@cindex info
253@kindex C-h i
254
255This manual is available in both Info and online formats. The Info
256version is distributed with Emacs and can be accessed with the
257@command{info} command (@samp{info mh-e}) or within Emacs (@kbd{C-h i
258m mh-e @key{RET}}). The online version is available at
259@uref{http://mh-e.sourceforge.net/manual/, SourceForge}. Another great
fc0c5af8
BW
260online resource is the book
261@uref{http://rand-mh.sourceforge.net/book/, @cite{MH & nmh: Email for
262Users & Programmers}} (also known as @dfn{the MH book}).
4009494e
GM
263
264I hope you enjoy this manual! If you have any comments, or suggestions
265for this document, please let me know.
266
267@cindex Bill Wohler
268@cindex Wohler, Bill
269
270@noindent
271Bill Wohler <@i{wohler at newt.com}>@*
2728 February 1995@*
27324 February 2006
274
275@node Conventions, Getting Started, Preface, Top
276@chapter GNU Emacs Terms and Conventions
277
278@cindex Emacs
279@cindex Emacs, conventions
280@cindex Emacs, terms
281@cindex Unix commands, Emacs
282@cindex conventions, Emacs
283@cindex terms, Emacs
284
285If you're an experienced Emacs user, you can skip the following
286conventions and definition of terms and go directly to the next
287section (@pxref{Getting Started}).
288
289@cindex Emacs commands
290@cindex MH commands
291@cindex Unix commands
292@cindex commands
293@cindex commands, MH
294@cindex commands, Unix
295@cindex commands, shell
296@cindex functions
297@cindex shell commands
298
299In general, @dfn{functions} in this text refer to Emacs Lisp functions
300that one would call from within Emacs Lisp programs (for example,
301@code{(mh-inc-folder)}). On the other hand, @dfn{commands} are those
302things that are run by the user, such as @kbd{i} or @kbd{M-x
303mh-inc-folder}. Programs outside of Emacs are specifically called MH
304commands, shell commands, or Unix commands.
305
306@cindex conventions, key names
307@cindex key names
308
309The conventions for key names are as follows:
310
311@table @kbd
312@item C-x
313Hold down the @key{CTRL} (Control) key and press the @kbd{x} key.
314@c -------------------------
315@item M-x
316Hold down the @key{META} or @key{ALT} key and press the @kbd{x} key.
317
318Since some keyboards don't have a @key{META} key, you can generate
319@kbd{M-x}, for example, by pressing @key{ESC} (Escape),
320@emph{releasing it}, and then pressing the @kbd{x} key.
321@c -------------------------
322@item @key{RET}
323Press the @key{RETURN} or @key{ENTER} key. This is normally used to
324complete a command.
325@c -------------------------
326@item @key{SPC}
327Press the space bar.
328@c -------------------------
329@item @key{TAB}
330Press the @key{TAB} key.
331@c -------------------------
332@item @key{DEL}
333Press the @key{DELETE} key.
334@c -------------------------
335@item @key{BS}
336Press the @key{BACKSPACE} key@footnote{If you are using Version 20 or
337earlier of Emacs, you will need to use the @key{DEL} key.}.
338@end table
339
340@cindex Emacs, prefix argument
341@cindex prefix argument
342@kindex C-u
343
344A @dfn{prefix argument} allows you to pass an argument to any Emacs
345function. To pass an argument, type @kbd{C-u} before the Emacs command
346or keystroke. Numeric arguments can be passed as well. For example, to
347insert five f's, use @kbd{C-u 5 f}. There is a default of four when
348using @kbd{C-u}, and you can use multiple prefix arguments to provide
349arguments of powers of four. To continue our example, you could insert
350four f's with @kbd{C-u f}, 16 f's with @kbd{C-u C-u f}, 64 f's with
351@kbd{C-u C-u C-u f}, and so on. Numeric and valueless negative
352arguments can also be inserted with the @key{META} key. Examples
353include @kbd{M-5} to specify an argument of 5, or @kbd{M--} which
354specifies a negative argument with no particular value.
355
356@sp 1
357@center @strong{NOTE}
358
359@quotation
360The prefix @kbd{C-u} or @kbd{M-} is not necessary in MH-E's MH-Folder
361mode (@pxref{Reading Mail Tour}). In this mode, simply enter the
362numerical argument before entering the command.
363@end quotation
364@sp 1
365
366@cindex @file{.emacs}
367@cindex Emacs, variables
368@cindex files, @file{.emacs}
369@cindex variables
370@findex setq
371
372Emacs uses @dfn{variables} to hold values. These can be changed via
373calls to the function @code{setq} in @file{~/.emacs}.
374
375@cindex Emacs, options
376@cindex options
377@findex customize-group
378@findex customize-option
379
380Variables in MH-E that are normally modified by the user are called
381@dfn{options} and are modified through the customize functions (such
382as @kbd{M-x customize-option} or @kbd{M-x customize-group}).
383@ifnothtml
384@xref{Easy Customization,,,emacs,The GNU Emacs Manual}, in @cite{The
385GNU Emacs Manual}.
386@end ifnothtml
387@ifhtml
388See section
fc0c5af8 389@uref{http://www.gnu.org/software/emacs/manual/html_node/emacs/Easy-Customization.html,
4009494e
GM
390Easy Customization} in @cite{The GNU Emacs Manual}.
391@end ifhtml
392@xref{Options}.
393
394@cindex Emacs, faces
395@cindex faces
396@cindex highlighting
397@findex customize-face
398
399You can specify various styles for displaying text using @dfn{faces}.
400MH-E provides a set of faces that you can use to personalize the look
401of your MH-E buffers. Use the command @kbd{M-x customize-face} to do
402this.
403@ifnothtml
404@xref{Face Customization,,,emacs,The GNU Emacs Manual}, in @cite{The
405GNU Emacs Manual}.
406@end ifnothtml
407@ifhtml
408See section
fc0c5af8 409@uref{http://www.gnu.org/software/emacs/manual/html_node/emacs/Face-Customization.html,
4009494e
GM
410Face Customization} in @cite{The GNU Emacs Manual}.
411@end ifhtml
412
413@cindex abnormal hooks
414@cindex hooks
415@cindex normal hooks
416@findex add-hook
417@findex customize-option
418
419Commands often offer @dfn{hooks} which enable you to extend or modify
420the way a command works.
421@ifnothtml
422@ref{Hooks, , Hooks, emacs, The GNU Emacs Manual}, in @cite{The GNU
423Emacs Manual}
424@end ifnothtml
425@ifhtml
426See section
fc0c5af8 427@uref{http://www.gnu.org/software/emacs/manual/html_node/emacs/Hooks.html,
4009494e
GM
428Hooks} in @cite{The GNU Emacs Manual}
429@end ifhtml
430for a description about @dfn{normal hooks} and @dfn{abnormal hooks}.
431MH-E uses normal hooks in nearly all cases, so you can assume that we
432are talking about normal hooks unless we explicitly mention that a
433hook is abnormal. We also follow the conventions described in that
d1069532 434section: the name of the abnormal hooks end in @code{-functions} and all
4009494e
GM
435the rest of the MH-E hooks end in @code{-hook}. You can add hooks with
436either @code{customize-option} or @code{add-hook}.
437
438@cindex Emacs, mark
439@cindex Emacs, point
440@cindex Emacs, region
441@cindex mark
442@cindex point
443@cindex region
444@kindex C-@@
445@kindex C-@key{SPC}
446
447There are several other terms that are used in Emacs that you should
448know. The @dfn{point} is where the cursor currently is. You can save
449your current place in the file by setting a @dfn{mark}. This operation
450is useful in several ways. The mark can be later used when defining a
451@dfn{region}, which is the text between the point and mark. Many
452commands operate on regions, such as those for deleting text or
453filling paragraphs. A mark can be set with @kbd{C-@@} (or
454@kbd{C-@key{SPC}}).
455
456@cindex completion
457@cindex Emacs, completion
458@cindex Emacs, file completion
459@cindex Emacs, folder completion
460@cindex Emacs, minibuffer
461@cindex file completion
462@cindex folder completion
463@cindex minibuffer
464@kindex SPC
465@kindex TAB
466
467The @dfn{minibuffer} is the bottom line of the Emacs window, where all
468prompting and multiple-character input is directed. You can use
469@dfn{completion} to enter values such as folders. Completion means
470that Emacs fills in text for you when you type @key{SPC} or @key{TAB}.
471A second @key{SPC} or @key{TAB} will list all possibilities at that
472point.
473@ifnothtml
474@xref{Completion, , Completion, emacs, The GNU Emacs Manual}.
475@end ifnothtml
476@ifhtml
477See the section
fc0c5af8 478@uref{http://www.gnu.org/software/emacs/manual/html_node/emacs/Completion.html,
4009494e
GM
479Completion} in @cite{The GNU Emacs Manual}.
480@end ifhtml
481Note that @key{SPC} cannot be used for completing filenames and
482folders.
483
484@findex help-with-tutorial
485@kindex C-h t
486@kindex M-x
487
488The minibuffer is also where you enter Emacs function names after
489typing @kbd{M-x}. For example, in the preface, I mentioned that you
490could obtain help with @kbd{C-h t} (@code{help-with-tutorial}). What
491this means is that you can get a tutorial by typing either @kbd{C-h t}
492or @kbd{M-x help-with-tutorial}. In the latter case, you are prompted
493for @samp{help-with-tutorial} in the minibuffer after typing
494@kbd{M-x}.
495
496@cindex ~
497
498The @samp{~} notation in filenames represents your home directory.
499This notation is used by many shells including @command{bash},
500@code{tcsh}, and @command{csh}. It is analogous to the environment
501variable @samp{$HOME}. For example, @file{~/.emacs} can be written
502@file{$HOME/.emacs} or using the absolute path as in
503@file{/home/wohler/.emacs} instead.
504
505@cindex Emacs, interrupting
506@cindex Emacs, quitting
507@cindex interrupting
508@cindex quitting
509
510@i{In case of trouble:} Emacs can be interrupted at any time with
511@kbd{C-g}. For example, if you've started a command that requests that
512you enter something in the minibuffer, but then you change your mind,
513type @kbd{C-g} and you'll be back where you started. If you want to
514exit Emacs entirely, use @kbd{C-x C-c}.
515
516@node Getting Started, Tour Through MH-E, Conventions, Top
517@chapter Getting Started
518
519@cindex MH-E, versions
520@cindex history
521@cindex versions of MH-E
522
523Because there are many old versions of MH-E out there, it is important
524to know which version you have. I'll be talking about @w{Version 8}
525which is pretty close to @w{Version 6} and @w{Version 7}. It differs
526from @w{Version 4} and @w{Version 5} and is vastly different from
527@w{Version 3}. @xref{History}.
528
529@findex mh-version
530
531To determine which version of MH-E that you have, enter @kbd{M-x
532mh-version @key{RET}}. Hopefully it says that you're running
533@w{Version @value{VERSION}} which is the latest version as of this
534printing.
535
536If your version is much older than this, please consider upgrading.
537You can have your system administrator upgrade the system-wide
538version, or you can install your own personal version. It's really
539quite easy. @xref{Getting MH-E}, for instructions for getting and
540installing MH-E.
541
542If the @code{mh-version} command displays @samp{No MH variant
543detected}@footnote{In very old versions of MH-E, you may get the error
544message, @samp{Cannot find the commands `inc' and `mhl' and the file
1df7defd 545`components'} if MH-E can't find MH@. In this case, you need to update
4009494e
GM
546MH-E, and you may need to install MH too. However, newer versions of
547MH-E are better at finding MH if it is on your system.}, then you need
548to install MH or tell MH-E where to find MH.
549
550@cindex Debian
551@cindex nmh
8c20bd92 552@cindex GNU mailutils MH
4009494e
GM
553
554If you don't have MH on your system already, you must install a
fc0c5af8
BW
555variant of MH@. The Debian mh-e package does this for you
556automatically (@pxref{Getting MH-E}). Most people use
4009494e 557@uref{http://www.nongnu.org/nmh/, nmh}, but you may be interested in
fc0c5af8
BW
558trying out @uref{http://mailutils.org/, GNU mailutils MH}, which
559supports IMAP@. Your GNU/Linux distribution probably has packages for
560both of these.
4009494e
GM
561
562@cindex @command{install-mh}
563@cindex MH commands, @command{install-mh}
564@cindex MH book
565
566If you've never run MH before, you need to run @command{install-mh}
567from the shell before you continue. This sets up your personal MH
568environment@footnote{See the section
569@uref{@value{MH-BOOK-HOME}/../overall/setup.html, Setting Up MH} in the
570MH book.}. If you don't, you'll be greeted with the error message:
571@samp{Install MH and run install-mh before running MH-E}. This is all
572you need to know about MH to use MH-E, but the more you know about MH,
573the more you can leverage its power. See the
574@uref{@value{MH-BOOK-HOME}/../, MH book} to learn more about MH.
575
36a672f6 576@cindex @samp{Path} MH profile component
4009494e
GM
577@cindex MH profile
578@cindex MH profile component
36a672f6 579@cindex MH profile component, @samp{Path}
4009494e
GM
580
581Your MH environment includes your @dfn{MH profile} which is found in
49dbbaf2
SE
582the file @file{~/.mh_profile}, or the file named in the environment
583variable @samp{$MH}. This file contains a number of @dfn{MH
4009494e
GM
584profile components}. For example, the @samp{Path:} MH profile
585component contains the path to your mail directory, which is
586@file{~/Mail} by default.
587
588@cindex @command{mhparam}
589@cindex MH commands, @command{mhparam}
590@vindex exec-path
591@vindex mh-path
592@vindex mh-sys-path
593@vindex mh-variant
594@vindex mh-variant-in-use
595
596There are several options MH-E uses to interact with your MH
597installation. The option @code{mh-variant} specifies the variant used
598by MH-E (@pxref{Options}). The default setting of this option is
599@samp{Auto-detect} which means that MH-E will automatically choose the
8c20bd92 600first of nmh, MH, or GNU mailutils MH that it finds in the directories
4009494e
GM
601listed in @code{mh-path} (which you can customize),
602@code{mh-sys-path}, and @code{exec-path}. If MH-E can't find MH at
603all, you may have to customize @code{mh-path} and add the directory in
604which the command @command{mhparam} is located. If, on the other hand,
8c20bd92 605you have both nmh and GNU mailutils MH installed (for example) and
4009494e 606@code{mh-variant-in-use} was initialized to nmh but you want to use
8c20bd92
BW
607GNU mailutils MH, then you can set @code{mh-variant} to
608@samp{gnu-mh}.
4009494e
GM
609
610@vindex mh-flists-present-flag
611@vindex mh-lib
612@vindex mh-lib-progs
613@vindex mh-progs
614
615When @code{mh-variant} is changed, MH-E resets @code{mh-progs},
616@code{mh-lib}, @code{mh-lib-progs}, @code{mh-flists-present-flag}, and
617@code{mh-variant-in-use} accordingly.
618
619@cindex @file{.emacs}
620@cindex files, @file{.emacs}
621
622@sp 1
623@center @strong{NOTE}
624
625@quotation
626Prior to version 8, it was often necessary to set some of these
627variables in @file{~/.emacs}; now it is no longer necessary and can
628actually cause problems.
629@end quotation
630@sp 1
631
36a672f6
GM
632@cindex MH profile component, @samp{Draft-Folder}
633@cindex MH profile component, @samp{Path}
634@cindex MH profile component, @samp{Previous-Sequence}
635@cindex MH profile component, @samp{Unseen-Sequence}
636@cindex @samp{Draft-Folder} MH profile component
637@cindex @samp{Path} MH profile component
638@cindex @samp{Previous-Sequence} MH profile component
639@cindex @samp{Unseen-Sequence} MH profile component
4009494e
GM
640@findex mh-find-path
641@vindex mh-draft-folder
642@vindex mh-find-path-hook
643@vindex mh-inbox
644@vindex mh-previous-seq
645@vindex mh-unseen-seq
646@vindex mh-user-path
647
648In addition to setting variables that point to MH itself, MH-E also
649sets a handful of variables that point to where you keep your mail.
650During initialization, the function @code{mh-find-path} sets
651@code{mh-user-path} from your @samp{Path:} MH profile component (but
652defaults to @samp{Mail} if one isn't present), @code{mh-draft-folder}
653from @samp{Draft-Folder:}, @code{mh-unseen-seq} from
654@samp{Unseen-Sequence:}, @code{mh-previous-seq} from
655@samp{Previous-Sequence:}, and @code{mh-inbox} from @samp{Inbox:}
656(defaults to @samp{+inbox}). The hook @code{mh-find-path-hook} is run
657after these variables have been set. This hook can be used the change
658the value of these variables if you need to run with different values
659between MH and MH-E.
660
661@node Tour Through MH-E, Using This Manual, Getting Started, Top
662@chapter Tour Through MH-E
663
664@cindex introduction
665@cindex tour
666@cindex tutorial
667
668This chapter introduces some of the terms you'll need to know and then
669takes you on a tour of MH-E@footnote{The keys mentioned in these
670chapters refer to the default key bindings. If you've changed the
671bindings, refer to the command summaries at the beginning of each
672chapter for a mapping between default key bindings and function
673names.}. When you're done, you'll be able to send, read, and file
674mail, which is all that a lot of people ever do. But if you're the
675curious or adventurous type, read the rest of the manual to be able to
1df7defd 676use all the features of MH-E@. I suggest you read this chapter first to
4009494e
GM
677get the big picture, and then you can read the manual as you wish.
678
679@menu
680* Sending Mail Tour::
681* Reading Mail Tour::
682* Processing Mail Tour::
683* Leaving MH-E::
684* More About MH-E::
685@end menu
686
687@node Sending Mail Tour, Reading Mail Tour, Tour Through MH-E, Tour Through MH-E
688@section Sending Mail
689
690@cindex MH-Letter mode
691@cindex mode
692@cindex modes, MH-Letter
693@cindex sending mail
694@findex mh-smail
695@kindex M-x mh-smail
696
697Let's start our tour by sending ourselves a message which we can later
698read and process. Enter @kbd{M-x mh-smail} to invoke the MH-E program
699to send messages. Your message appears in an Emacs buffer whose
700mode@footnote{A @dfn{mode} changes Emacs to make it easier to edit a
701particular type of text.} is MH-Letter.
702
703Enter your login name in the @samp{To:} header field. Press the
704@key{TAB} twice to move the cursor past the @samp{Cc:} field, since no
705carbon copies are to be sent, and on to the @samp{Subject:} field.
706Enter @kbd{Test} or anything else that comes to mind.
707
708Press @key{TAB} again to move the cursor to the body of the message.
709Enter some text, using normal Emacs commands. You should now have
710something like this@footnote{If you're running Emacs under the X
711Window System, then you would also see a menu bar and a tool bar. I've
712left out the menu bar and tool bar in all of the example screens.}:
713
714@cartouche
715@smallexample
716
717
718
719
720
721
722--:-- *scratch* All L1 (Lisp Interaction)-------------------------
723To: wohler
724cc:
725Subject: Test
3cf38f97 726X-Mailer: MH-E 8.1; nmh 1.1; GNU Emacs 23.1
4009494e
GM
727--------
728This is a test message to get the wheels churning...#
729
730
731--:** @{draft@} All L5 (MH-Letter)----------------------------------
732Type C-c C-c to send message, C-C ? for help
733@end smallexample
734@end cartouche
735@i{MH-E message composition window}
736
737Note the line of dashes that separates the header and the body of the
738message. It is essential that these dashes (or a blank line) are
739present or the body of your message will be considered to be part of
740the header.
741
742@cindex help
743@findex describe-mode
744@kindex C-c ?
745@kindex C-c C-c
746@kindex C-h m
747
748There are several commands specific to MH-Letter mode@footnote{You can
749get quick help for the commands used most often with @kbd{C-c ?} or
750more complete help with the @kbd{C-h m} (@code{describe-mode})
751command.}, but at this time we'll only use @kbd{C-c C-c} to send your
752message. Type @kbd{C-c C-c} now. That's all there is to it!
753
754@node Reading Mail Tour, Processing Mail Tour, Sending Mail Tour, Tour Through MH-E
755@section Receiving Mail
756
757@cindex @command{inc}
758@cindex @command{scan}
759@cindex MH commands, @command{inc}
760@cindex MH commands, @command{scan}
761@cindex MH-Folder mode
762@cindex modes, MH-Folder
763@cindex reading mail
764@findex mh-rmail
765@kindex M-x mh-rmail
766
767To read the mail you've just sent yourself, enter @kbd{M-x mh-rmail}.
768This incorporates the new mail and puts the output from
769@command{inc}@footnote{See the section
770@uref{@value{MH-BOOK-HOME}/reapre.html, Reading Mail: inc show next
771prev} in the MH book.} (called @dfn{scan lines} after the MH program
772@command{scan}@footnote{See the section
773@uref{@value{MH-BOOK-HOME}/faswsprs.html, Find and Specify with scan
774pick Ranges Sequences} in the MH book.} which prints a one-line
775summary of each message) into a buffer called @samp{+inbox} whose
776major mode is MH-Folder.
777
778@findex mh-rmail
779@kindex F r
780@kindex M-x mh-rmail
781
782@sp 1
783@center @strong{NOTE}
784
785@quotation
786
787The @kbd{M-x mh-rmail} command will show you only new mail, not mail
788you have already read. If you were to run this tour again, you would
789use @kbd{F r} to pull all your messages into MH-E.
790@end quotation
791@sp 1
792
793@kindex @key{RET}
794@kindex n
795@kindex p
796
797You should see the scan line for your message, and perhaps others. Use
798@kbd{n} or @kbd{p} to move the cursor to your test message and type
799@key{RET} to read your message. You should see something like:
800
801@cartouche
802@smallexample
803 3 t08/24 root received fax files on Wed Aug 24 11:00:13 PDT 1
804# 4+t08/24 To:wohler Test<<This is a test message to get the wheels
805
806-:%% @{+inbox/select@} 4 msgs (1-4) Bot L4 (MH-Folder Show)---------
807To: wohler
808Subject: Test
3cf38f97 809X-Mailer: MH-E 8.1; nmh 1.1; GNU Emacs 23.1
4009494e
GM
810Date: Fri, 17 Mar 2006 10:49:11 -0800
811From: Bill Wohler <wohler@@stop.mail-abuse.org>
812
813This is a test message to get the wheels churning...
814
815
816
817--:-- @{show-+inbox@} 4 All L1 (MH-Show)----------------------------
818
819@end smallexample
820@end cartouche
821@i{After incorporating new messages}
822
823@kindex @key{DEL}
824@kindex @key{SPC}
825
826If you typed a long message, you can view subsequent pages with
827@key{SPC} and previous pages with @key{DEL}.
828
829@node Processing Mail Tour, Leaving MH-E, Reading Mail Tour, Tour Through MH-E
830@section Processing Mail
831
832@cindex processing mail
833@kindex @key{RET}
834@kindex r
835
836The first thing we want to do is reply to the message that we sent
837ourselves. Ensure that the cursor is still on the same line as your
838test message and type @kbd{r}. You are prompted in the minibuffer with
839@samp{Reply to whom:}. Here MH-E is asking whether you'd like to reply
840to the original sender only, to the sender and primary recipients, or
841to the sender and all recipients. You can press @key{TAB} to see these
842choices. If you simply press @key{RET}, you'll reply only to the
843sender. Press @key{RET} now.
844
845You'll find yourself in an Emacs buffer similar to that when you were
846sending the original message, like this:
847
848@cartouche
849@smallexample
850To:
851cc:
852Subject: Re: Test
853In-reply-to: <31054.1142621351@@stop.mail-abuse.org>
854References: <31054.1142621351@@stop.mail-abuse.org>
855Comments: In-reply-to Bill Wohler <wohler@@stop.mail-abuse.org>
856 message dated "Fri, 17 Mar 2006 10:49:11 -0800."
3cf38f97 857X-Mailer: MH-E 8.1; nmh 1.1; GNU Emacs 23.1
4009494e
GM
858--------
859#
860
861--:-- @{draft@} All L10 (MH-Letter)----------------------------------
862To: wohler
863Subject: Test
3cf38f97 864X-Mailer: MH-E 8.1; nmh 1.1; GNU Emacs 23.1
4009494e
GM
865Date: Fri, 17 Mar 2006 10:49:11 -0800
866From: Bill Wohler <wohler@@stop.mail-abuse.org>
867
868This is a test message to get the wheels churning...
869
870--:-- @{show-+inbox@} 4 All L1 (MH-Show)----------------------------
871Type C-c C-c to send message, C-c ? for help
872@end smallexample
873@end cartouche
874@i{Composition window during reply}
875
876@findex backward-char
877@findex forward-char
878@findex next-line
879@findex previous-line
880@kindex C-b
881@kindex C-c C-c
882@kindex C-c C-f C-t
883@kindex C-f
884@kindex C-n
885@kindex C-p
886@kindex @key{BS}
887
888By default, MH will not add you to the address list of your replies,
889so if you find that the @samp{To:} header field is missing, don't
890worry. In this case, type @kbd{C-c C-f C-t} to create and go to the
891@samp{To:} field, where you can type your login name again. You can
892move around with the arrow keys or with @kbd{C-p}
893(@code{previous-line}), @kbd{C-n} (@code{next-line}), @kbd{C-b}
894(@code{backward-char}), and @kbd{C-f} (@code{forward-char}) and can
895delete the previous character with @key{BS}. When you're finished
896editing your message, send it with @kbd{C-c C-c} as before.
897
898@cindex @command{refile}
899@cindex MH commands, @command{refile}
900@cindex folders
901@kindex @key{SPC}
902@kindex o
903
904You'll often want to save messages that were sent to you in an
905organized fashion. This is done with @dfn{folders}. You can use
906folders to keep messages from your friends, or messages related to a
907particular topic. With your cursor in the MH-Folder buffer and
908positioned on the message you sent to yourself, type @kbd{o} to output
909(@command{refile} in MH parlance) that message to a folder. Enter
910@kbd{test} at the @samp{Destination folder:} prompt and type @kbd{y}
911(or @key{SPC}) when MH-E asks to create the folder @samp{+test}. Note
912that a @samp{^} (caret) appears next to the message number, which
913means that the message has been marked for refiling but has not yet
914been refiled. We'll talk about how the refile is actually carried out
915in a moment.
916
917@cindex MH-Folder mode
918@cindex modes, MH-Folder
919@kindex d
920@kindex i
921@kindex @key{RET}
922@kindex n
923@kindex p
924@kindex x
925
926Your previous reply is now waiting in the system mailbox. You
927incorporate this mail into your MH-Folder buffer named @samp{+inbox}
928with the @kbd{i} command. Do this now. After the mail is incorporated,
929use @kbd{n} or @kbd{p} to move the cursor to the new message, and read
930it with @key{RET}. Let's delete this message by typing @kbd{d}. Note
931that a @samp{D} appears next to the message number. This means that
932the message is marked for deletion but is not yet deleted. To perform
933the deletion (and the refile we did previously), use the @kbd{x}
934command.
935
936@findex mh-smail
937@kindex m
938@kindex M-x mh-smail
939
940If you want to send another message you can use @kbd{m} instead of
941@kbd{M-x mh-smail}. So go ahead, send some mail to your friends!
942
943@cindex help
944@cindex prefix characters
945@findex describe-mode
946@kindex ?
947@kindex C-h m
948@kindex F ?
949
950You can get a quick reminder about these commands by typing @kbd{?}.
951This lists several @dfn{prefix characters}. To list the commands
952available via the prefix characters, type the prefix character
953followed by a @kbd{?}, for example, @kbd{F ?}. More complete help is
954available with the @kbd{C-h m} (@code{describe-mode}) command.
955
956@node Leaving MH-E, More About MH-E, Processing Mail Tour, Tour Through MH-E
957@section Leaving MH-E
958
959@cindex Emacs, quitting
960@cindex quitting
961@kindex C-x C-c
962@kindex x
963
964You may now wish to exit @command{emacs} entirely. Use @kbd{C-x C-c}
965to exit @command{emacs}. If you exited without running @kbd{x} in the
966@samp{+inbox} buffer, Emacs will offer to save it for you. Type
967@kbd{y} or @key{SPC} to save @samp{+inbox} changes, which means to
968perform any refiles and deletes that you did there.
969
970@findex mh-rmail
971@kindex C-x b
972@kindex C-x k
973@kindex M-x mh-rmail
974@kindex q
975
976If you don't want to leave Emacs, you can type @kbd{q} to bury (hide)
977the MH-E folder or delete it entirely with @kbd{C-x k}. You can then
978later recall it with @kbd{C-x b} or @kbd{M-x mh-rmail}.
979
980@cindex @command{packf}
981@cindex MH commands, @command{packf}
982@cindex exporting folders
983@cindex folders, exporting
984@cindex mbox-style folder
985
986On the other hand, if you no longer want to use MH and MH-E, you can
987take your mail with you. You can copy all of your mail into a single
988file, mbox-style, by using the MH command @command{packf}. For
989example, to create a file called @file{msgbox} with the messages in
990your @samp{+inbox} folder, use @samp{packf +inbox}. The
991@command{packf} command will append the messages to the file if it
992already exists, so you can use @samp{folders -recurse -fast} in a
993script to copy all of your messages into a single file, or using the
994@samp{-file} argument, a file for each folder.
995
996@node More About MH-E, , Leaving MH-E, Tour Through MH-E
997@section More About MH-E
998
999These are the basic commands to get you going, but there are plenty
1000more. If you think that MH-E is for you, read the rest of the manual
1001to find out how you can:
1002
1003@itemize @bullet
1004@item
1005Print your messages (@pxref{Printing}).
1006@c -------------------------
1007@item
1008Edit messages and include your signature (@pxref{Editing Drafts}).
1009@c -------------------------
1010@item
1011Forward messages (@pxref{Forwarding}).
1012@c -------------------------
1013@item
1014Read digests (@pxref{Digests}).
1015@c -------------------------
1016@item
1017Edit bounced messages (@pxref{Editing Again}).
1018@c -------------------------
1019@item
1020Send multimedia messages (@pxref{Adding Attachments}).
1021@c -------------------------
1022@item
1023Read HTML messages (@pxref{HTML}).
1024@c -------------------------
1025@item
1026Use aliases and identities (see @ref{Aliases}, @pxref{Identities}).
1027@c -------------------------
1028@item
1029Create different views of your mail (see @ref{Threading}, @pxref{Limits}).
1030@c -------------------------
1031@item
1032Deal with junk mail (@pxref{Junk}).
1033@c -------------------------
1034@item
1035Handle signed and encrypted messages (see @ref{Reading PGP},
1036@pxref{Sending PGP}).
1037@c -------------------------
1038@item
1039Process mail that was sent with @command{shar} or @command{uuencode}
1040(@pxref{Files and Pipes}).
1041@c -------------------------
1042@item
1043Use sequences conveniently (@pxref{Sequences}).
1044@c -------------------------
1045@item
1046Use the speedbar, tool bar, and menu bar (see @ref{Speedbar}, see @ref{Tool
1047Bar}, @pxref{Menu Bar}).
1048@c -------------------------
1049@item
1050Show header fields in different fonts (@pxref{Reading Mail}).
1051@c -------------------------
1052@item
1053Find previously refiled messages (@pxref{Searching}).
1054@c -------------------------
1055@item
1056Place messages in a file (@pxref{Files and Pipes}).
1057@end itemize
1058
1059Remember that you can also use MH commands when you're not running
1060MH-E (and when you are!).
1061
1062@node Using This Manual, Incorporating Mail, Tour Through MH-E, Top
1063@chapter Using This Manual
1064
1065This chapter begins the meat of the manual which goes into more detail
1066about every MH-E command and option.
1067
1068@cindex Emacs, info
1069@cindex Emacs, online help
1070@cindex info
1071@cindex online help
1072@findex describe-mode
1073@findex mh-help
1074@kindex ?
1075@kindex C-c ?
1076@kindex C-h C-h
1077@kindex C-h C-k i
1078@kindex C-h i
1079@kindex C-h m
1080
1081There are many commands, but don't get intimidated. There are command
1082summaries at the beginning of each chapter. In case you have or would
1083like to rebind the keys, the command summaries also list the
1084associated Emacs Lisp function. Furthermore, even if you're stranded
1085on a desert island with a laptop and are without your manuals, you can
1086get a summary of all these commands with GNU Emacs online help: use
1087@kbd{C-h m} (@code{describe-mode}) for a brief summary of commands,
1088@kbd{?} (@code{mh-help}) for an even briefer summary@footnote{This
1089help appears in a buffer called @samp{*MH-E Help*}
1090(@pxref{Miscellaneous}).} (@kbd{C-c ?} in MH-Letter mode), or @kbd{C-h
1091i} to read this manual via Info. The online help is quite good; try
1092running @kbd{C-h C-h}. This brings up a list of available help topics,
1093one of which displays the documentation for a given key (like @kbd{C-h
1094k C-n}). Another useful help feature is to view the manual section
1095that describes a given key (such as @kbd{C-h K i}). In addition,
1096review @ref{Conventions}, if any of the GNU Emacs conventions are
1097strange to you.
1098
1099In addition to all of the commands, it is also possible to reconfigure
1100MH-E to fit the needs of even the most demanding user. The following
1101chapters also describe all of the options, show the defaults, and make
1102recommendations for customization.
1103
1104However, when customizing your mail environment, first try to change
1105what you want in MH, and only change MH-E if changing MH is not
1106possible. That way you will get the same behavior inside and outside
1107GNU Emacs. Note that MH-E does not provide hooks for customizations
1108that can be done in MH; this omission is intentional.
1109
1110@cindex Emacs Lisp Manual
1111@cindex Emacs, Emacs Lisp Manual
1112@cindex Emacs, info
1113@cindex Emacs, online help
1114@cindex info
1115@cindex online help
1116
1117I hope I've included enough examples here to get you well on your way.
1118If you want to explore Emacs Lisp further, a programming manual does
1119exist,
1120@c Yes, some of the stuff in the following sections is redundant, but
1121@c TeX barfs if the @ifs are inside the @footnote.
1122@iftex
1123@footnote{The @cite{GNU Emacs Lisp Reference Manual} may be available
1124online in the Info system by typing @kbd{C-h i m Emacs Lisp
1125@key{RET}}. It is also available online at @*
3cab18a3 1126@uref{http://www.gnu.org/software/emacs/manual/elisp.html}.}
4009494e
GM
1127@end iftex
1128@ifinfo
1129@footnote{@xref{Top, The GNU Emacs Lisp Reference Manual, , elisp, GNU
1130Emacs Lisp Reference Manual}, which may be available online in the
1131Info system. It is also available online at
3cab18a3 1132@uref{http://www.gnu.org/software/emacs/manual/elisp.html}.}
4009494e
GM
1133@end ifinfo
1134@ifhtml
1135@footnote{The
5154917e 1136@uref{http://www.gnu.org/software/emacs/manual/elisp.html,
4009494e 1137The GNU Emacs Lisp Reference Manual} may also be available online in
3cab18a3 1138the Info system by typing @kbd{C-h i m Emacs Lisp @key{RET}}.}
4009494e
GM
1139@end ifhtml
1140and you can look at the code itself for examples. Look in the Emacs
1141Lisp directory on your system (such as
5154917e 1142@file{/usr/local/share/emacs/lisp/mh-e}) and find all the @file{mh-*.el}
4009494e
GM
1143files there. When calling MH-E and other Emacs Lisp functions directly
1144from Emacs Lisp code, you'll need to know the correct arguments. Use
1145the online help for this. For example, try @kbd{C-h f
1146mh-execute-commands @key{RET}}. If you write your own functions,
1147please do not prefix your symbols (variables and functions) with
1148@samp{mh-}. This prefix is reserved for the MH-E package. To avoid
1149conflicts with existing MH-E symbols, use a prefix like @samp{my-} or
1150your initials. (Unless, of course, your initials happen to be @emph{mh}!)
1151
1152@menu
1153* Options::
1154* Ranges::
1155* Folder Selection::
1156@end menu
1157
1158@node Options, Ranges, Using This Manual, Using This Manual
1159@section Options
1160
1161@cindex Emacs, customizing
1162@cindex Emacs, setting options
1163@cindex customizing MH-E
1164@cindex setting options
1165@findex customize-option
1166@vindex mh-lpr-command-format, example
1167
1168Many string or integer options are easy to modify using @kbd{M-x
1169customize-option}. For example, to modify the option that controls
1170printing, you would run @kbd{M-x customize-option @key{RET}
1171mh-lpr-command-format @key{RET}}. In the buffer that appears, modify
1172the string to the right of the variable. For example, you may change
1173the @command{lpr} command with @samp{nenscript -G -r -2 -i'%s'}. Then
1174use the @samp{State} combo box and select @samp{Save for Future
1175Sessions}. To read more about @code{mh-lpr-command-format}, see
1176@ref{Printing}.
1177
1178@cindex nil
1179@cindex off, option
1180@cindex on, option
1181@cindex option, turning on and off
1182@cindex t
1183@findex customize-option
1184@vindex mh-bury-show-buffer-flag, example
1185
1186Options can also hold boolean values. In Emacs Lisp, the boolean
1187values are @code{nil}, which means false, and @code{t}, which means
1188true. The @code{customize-option} function makes it easy to change
1189boolean values; simply click on the toggle button in the customize
1190buffer to switch between @samp{on} (@code{t}) and @samp{off}
1191(@code{nil}). For example, try setting @code{mh-bury-show-buffer-flag}
1192to @samp{off} to keep the MH-Show buffer at the top of the buffer
1193stack. Use the @samp{State} combo box and choose @samp{Set for Current
1194Session} to see how the option affects the show buffer. Then choose
1195the @samp{Erase Customization} menu item to reset the option to the
1196default, which places the MH-Show buffer at the bottom of the buffer
1197stack.
1198
1199@vindex mh-mhl-format-file, example
1200
1201The text usually says to turn on an option by setting it to a
1202@emph{non-@code{nil}} value, because sometimes values other than
1203@samp{on} are meaningful. An example of this is the variable
1204@code{mh-mhl-format-file} (@pxref{Viewing}). Other options, such as
1205hooks, involve a little more Emacs Lisp programming expertise.
1206
1207@cindex customization group, @samp{mh}
1208@cindex @samp{mh} customization group
1209@findex customize-group
1210@findex mh-customize
1211
1212You can browse all of the MH-E options with the @code{customize-group}
1213function. Try entering @kbd{M-x customize-group @key{RET} mh
1214@key{RET}} to view the top-level options as well as buttons for all of
1215the MH-E customization groups. Another way to view the MH-E
1216customization group is to use @kbd{M-x mh-customize @key{RET}}.
1217
1218@node Ranges, Folder Selection, Options, Using This Manual
1219@section Ranges
1220
1221@c Sync with mh-folder-mode docstring.
1222
1223@cindex message abbreviations
1224@cindex message ranges
1225@cindex ranges
1226
1227Many commands that operate on individual messages, such as
1228@code{mh-forward} or @code{mh-refile-msg} take a @code{RANGE}
1229argument. This argument can be used in several ways.
1230
1231@kindex C-u, with ranges
1232
1233If you provide the prefix argument @kbd{C-u} to these commands, then
1234you will be prompted for the message range. This can be any valid MH
1235range which can include messages, sequences (@pxref{Sequences}), and
1236the abbreviations (described in the @command{mh}(1) man page):
1237
1238@table @samp
1239@item <num1>-<num2>
1240Indicates all messages in the range <num1> to <num2>, inclusive. The
1241range must be nonempty.
1242@c -------------------------
1243@item <num>:N
1244@itemx <num>:+N
1245@itemx <num>:-N
1246Up to N messages beginning with (or ending with) message num. Num may
1247be any of the predefined symbols: first, prev, cur, next or last.
1248@c -------------------------
1249@item first:N
1250@itemx prev:N
1251@itemx next:N
1252@itemx last:N
1253The first, previous, next or last messages, if they exist.
1254@c -------------------------
1255@item all
1256All of the messages.
1257@end table
1258
1259For example, a range that shows all of these things is @samp{1 2 3
12605-10 last:5 unseen}.
1261
1262@vindex transient-mark-mode
1263
1264If the option @code{transient-mark-mode} is turned on and you set a
1265region in the MH-Folder buffer, then the MH-E command will perform the
1266operation on all messages in that region.
1267
1268@cindex @samp{mh-range} customization group
1269@cindex customization group, @samp{mh-range}
1270
1271The @samp{mh-range} customization group contains a single option which
1272affects how ranges are interpreted.
1273
1274@vtable @code
1275@item mh-interpret-number-as-range-flag
1276On means interpret a number as a range (default: @samp{on}).
1277@end vtable
1278
1279@vindex mh-interpret-number-as-range-flag
1280
1281Since one of the most frequent ranges used is @samp{last:N}, MH-E will
1282interpret input such as @samp{200} as @samp{last:200} if the
1283@code{mh-interpret-number-as-range-flag} option is on (which is the
1284default). If you need to scan just the message 200, then use the range
1285@samp{200:1} or @samp{200-200}.
1286
1287@node Folder Selection, , Ranges, Using This Manual
1288@section Folder Selection
1289
1290@cindex completion, folders
1291@cindex folders, completion
1292@cindex folders, selecting
1293
1294When you choose a folder in MH-E via a command such as @kbd{o}
1295(@code{mh-refile-msg}), completion is used to enter the folder
1296@ifnothtml
1297(@pxref{Completion, , , emacs, The GNU Emacs Manual}).
1298@end ifnothtml
1299@ifhtml
1300(see the section
fc0c5af8 1301@uref{http://www.gnu.org/software/emacs/manual/html_node/emacs/Completion.html,
4009494e
GM
1302Completion} in @cite{The GNU Emacs Manual}).
1303@end ifhtml
1304In addition, MH-E has several ways of choosing a suitable default so
1305that the folder can often be selected with a single @key{RET} key.
1306
1307@cindex customization group, @samp{mh-folder-selection}
1308@cindex @samp{mh-folder-selection} customization group
1309
1310The @samp{mh-folder-selection} customization group contains some
1311options which are used to help with this.
1312
1313@vtable @code
1314@item mh-default-folder-for-message-function
1315Function to select a default folder for refiling or @samp{Fcc:}
1316(default: @code{nil}).
1317@c -------------------------
1318@item mh-default-folder-list
1319List of addresses and folders (default: @code{nil}).
1320@c -------------------------
1321@item mh-default-folder-must-exist-flag
1322On means guessed folder name must exist to be used (default:
1323@samp{on}).
1324@c -------------------------
1325@item mh-default-folder-prefix
1326Prefix used for folder names generated from aliases (default: @code{""}).
1327@end vtable
1328
1329@vindex mh-default-folder-for-message-function
1330
1331You can set the option @code{mh-default-folder-for-message-function}
1332to a function that provides a default folder for the message to be
1333refiled. When this function is called, the current buffer contains the
1334message being refiled and point is at the start of the message. This
1335function should return the default folder as a string with a leading
1336@samp{+} sign. It can also return @code{nil} so that the last folder
1337name is used as the default, or an empty string to suppress the
1338default entirely.
1339
1340Otherwise, the name of the destination folder is derived from the
1341sender as follows:
1342
1343@enumerate
1344@vindex mh-default-folder-list
1345@item
1346The folder name associated with the first address found in the list
1347@code{mh-default-folder-list} is used. Each element in this list
1348contains a @samp{Check Recipient} item. If this item is turned on,
1349then the address is checked against the recipient instead of the
1350sender. This is useful for mailing lists.
1351@c -------------------------
1352@vindex mh-default-folder-prefix
1353@item
1354An alias prefixed by @code{mh-default-folder-prefix} corresponding to
1355the address is used. The prefix is used to prevent clutter in your
1356mail directory. @xref{Aliases}.
1357@end enumerate
1358
1359@vindex mh-default-folder-must-exist-flag
1360
1361If the derived folder does not exist, and
1362@code{mh-default-folder-must-exist-flag} is @code{t}, then the last
1363folder name used is suggested. This is useful if you get mail from
1364various people for whom you have an alias, but file them all in the
1365same project folder.
1366
1367@node Incorporating Mail, Reading Mail, Using This Manual, Top
1368@chapter Incorporating Your Mail
1369
1370@cindex @samp{Folder} menu
1371@cindex incorporating
1372@cindex menu, @samp{Folder}
1373
1374This chapter talks about getting mail from your system mailbox into
1375your MH @samp{+inbox} folder. The following command accomplishes that
1376and is found in the @samp{Folder} menu.
1377
1378@table @kbd
1379@cindex @samp{Folder > Incorporate New Mail} menu item
1380@cindex menu item, @samp{Folder > Incorporate New Mail}
1381@findex mh-inc-folder
1382@kindex i
1383@item i
1384Incorporate new mail into a folder (@code{mh-inc-folder}).
1385@end table
1386
1387@cindex @samp{mh-inc} customization group
1388@cindex customization group, @samp{mh-inc}
1389
1390The following options in the @samp{mh-inc} customization group are
1391used.
1392
1393@vtable @code
1394@item mh-inc-prog
1395Program to incorporate mail (default: @code{"inc"}).
1396@c -------------------------
1397@item mh-inc-spool-list
1398Alternate spool files (default: @code{nil}).
1399@end vtable
1400
1401The following hook is available.
1402
1403@vtable @code
1404@findex mh-inc-folder
1405@item mh-inc-folder-hook
1406Hook run by @code{mh-inc-folder} after incorporating mail into a
1407folder (default: @code{nil}).
1408@end vtable
1409
1410@cindex @samp{+inbox}
1411@findex mh-inc-folder
1412@kindex i
1413
1414If at any time you receive new mail, incorporate the new mail into
1415your @samp{+inbox} buffer with @kbd{i} (@code{mh-inc-folder}). Note
1416that @kbd{i} will display the @samp{+inbox} buffer, even if there
1417isn't any new mail. You can incorporate mail from any file into the
1418current folder by specifying a prefix argument; you'll be prompted for
1419the name of the file to use as well as the destination folder (for
1420example, @kbd{C-u i ~/mbox @key{RET} +tmp @key{RET}}).
1421
1422@cindex @file{.emacs}
1423@cindex Emacs, notification of new mail
1424@cindex files, @file{.emacs}
1425@cindex new mail
1426@cindex notification of new mail
1427
1428Emacs can notify you when you have new mail by displaying @samp{Mail}
1429in the mode line. To enable this behavior, and to have a clock in the
1430mode line as well, add the following to @file{~/.emacs}:
1431
1432@findex display-time
1433
1434@smalllisp
1435(display-time)
1436@end smalllisp
1437
1438@cindex @command{inc}
1439@cindex incorporating
1440@cindex MH commands, @command{inc}
1441@vindex mh-inc-prog
1442@vindex mh-progs
1443
1444The name of the program that incorporates new mail is stored in
1445@code{mh-inc-prog}; it is @code{"inc"} by default. This program
1446generates a one-line summary for each of the new messages. Unless it
1447is an absolute pathname, the file is assumed to be in the
1448@code{mh-progs} directory (@pxref{Getting Started}). You may also link
1449a file to @command{inc} that uses a different format (see
1450@samp{mh-profile}(5), and sections
1451@uref{@value{MH-BOOK-HOME}/reapre.html, Reading Mail: inc show next
1452prev} and @uref{@value{MH-BOOK-HOME}/mhstr.html, MH Format Strings} in
1453the MH book). You'll then need to modify several variables
1454appropriately (@pxref{Scan Line Formats}).
1455
1456@vindex mh-inc-spool-list
1457
1458You can use the @code{mh-inc-spool-list} variable to direct MH-E to
1459retrieve mail from arbitrary spool files other than your system
1460mailbox, file it in folders other than your @samp{+inbox}, and assign
1461key bindings to incorporate this mail.
1462
1463@cindex @command{procmail}
1464@cindex @file{.procmailrc}
1465@cindex Unix commands, @command{procmail}
1466@cindex files, @file{.procmailrc}
1467
1468Suppose you are subscribed to the @i{mh-e-devel} mailing list and you
1469use @command{procmail} to filter this mail into @file{~/mail/mh-e}
1470with the following recipe in @file{.procmailrc}:
1471
1472@smallexample
1473PATH=$PATH:/usr/bin/mh
1474MAILDIR=$HOME/`mhparam Path`
1475:0:
1476* ^From mh-e-devel-admin@@stop.mail-abuse.org
1477mh-e
1478@end smallexample
1479
1480@findex mh-inc-spool-*
1481@kindex I *
1482
1483In order to incorporate @file{~/mail/mh-e} into @samp{+mh-e} with an
1484@kbd{I m} (@code{mh-inc-spool-mh-e}) command, customize this option,
1485and click on the @samp{INS} button. Enter a @samp{Spool File} of
1486@samp{~/mail/mh-e}, a @samp{Folder} of @samp{mh-e}, and a @samp{Key
1487Binding} of @samp{m}.
1488
1489@cindex @command{emacsclient}
1490@cindex @command{gnuclient}
1491@cindex @command{xbuffy}
1492@cindex @samp{gnuserv}
1493@cindex Unix commands, @command{emacsclient}
1494@cindex Unix commands, @command{gnuclient}
1495@cindex Unix commands, @command{xbuffy}
1496
1497You can use @command{xbuffy} to automate the incorporation of this
3cf38f97 1498mail using the Emacs 23 command @command{emacsclient} as follows:
4009494e
GM
1499
1500@smallexample
1501box ~/mail/mh-e
1502 title mh-e
1503 origMode
1504 polltime 10
1505 headertime 0
1506 command emacsclient --eval '(mh-inc-spool-mh-e)'
1507@end smallexample
1508
1509In XEmacs, the command @command{gnuclient} is used in a similar
1510fashion.
1511
1512@findex mh-inc-folder
1513@kindex i
1514@vindex mh-inc-folder-hook
1515
1516You can set the hook @code{mh-inc-folder-hook}, which is called after
1517new mail is incorporated by the @kbd{i} (@code{mh-inc-folder})
1518command. A good use of this hook is to rescan the whole folder either
1519after running @kbd{M-x mh-rmail} the first time or when you've changed
1520the message numbers from outside of MH-E.
1521
1522@findex mh-execute-commands
1523@findex mh-rescan-folder, example
1524@findex mh-show, example
1525@vindex mh-inc-folder-hook, example
1526
1527@smalllisp
1528@group
1529(defun my-mh-inc-folder-hook ()
1530 "Hook to rescan folder after incorporating mail."
1531 (if (buffer-modified-p) ; @r{if outstanding refiles and deletes,}
1532 (mh-execute-commands)) ; @r{carry them out}
1533 (mh-rescan-folder) ; @r{synchronize with +inbox}
1534 (mh-show)) ; @r{show the current message}
1535
1536(add-hook 'mh-inc-folder-hook 'my-mh-inc-folder-hook)
1537
1538@i{Rescan folder after incorporating new mail via mh-inc-folder-hook}
1539
1540@end group
1541@end smalllisp
1542
1543@node Reading Mail, Folders, Incorporating Mail, Top
1544@chapter Reading Your Mail
1545
1546@cindex @samp{+inbox}
1547@cindex MH-Folder mode
1548@cindex MH-Show mode
1549@cindex modes, MH-Folder
1550@cindex modes, MH-Show
1551@cindex reading mail
1552@findex mh-rmail
1553@kindex F r
1554@kindex F v
1555@kindex M-x mh-rmail
1556
1557The MH-E entry point for reading mail is @kbd{M-x mh-rmail}. This
1558command incorporates your mail and creates a buffer called
1559@samp{+inbox} in MH-Folder mode. The command @kbd{M-x mh-rmail} shows
1560you only new mail, not mail you have already read@footnote{If you want
1561to see your old mail as well, use @kbd{F r} to pull all your messages
1df7defd 1562into MH-E@. Or, give a prefix argument to @code{mh-rmail} so it will
4009494e
GM
1563prompt you for folder to visit like @kbd{F v} (for example, @kbd{C-u
1564M-x mh-rmail @key{RET} bob @key{RET}}). @xref{Folders}.}.
1565
1566@findex display-time
1567@vindex read-mail-command
1568
1569There are some commands that need to read mail, such as @kbd{Mouse-2}
1570over the @samp{Mail} button that @code{display-time} adds to the mode
1571line. You can configure Emacs to have these commands use MH-E by
1572setting the option @code{read-mail-command} to @samp{mh-rmail}.
1573
1574@cindex @command{scan}
1575@cindex @samp{Message} menu
1576@cindex MH commands, @command{scan}
1577@cindex menu, @samp{Message}
1578@cindex scan lines
1579
1580The @samp{+inbox} buffer contains @dfn{scan lines}, which are one-line
1581summaries of each incorporated message. You can perform most MH
1582commands on these messages via one- or two-letter commands in either
1583the MH-Folder or MH-Show buffers or by using the @samp{Message} menu.
1584See @command{scan}(1) for a description of the contents of the scan
1585lines, and see the Figure in @ref{Reading Mail Tour}, for an example.
1586
1587@table @kbd
1588@kindex ?
1589@findex mh-help
1590@item ?
1591Display cheat sheet for the MH-E commands (@code{mh-help}).
1592@c -------------------------
1593@cindex @samp{Message > Show Message} menu item
1594@cindex menu item, @samp{Message > Show Message}
1595@kindex @key{RET}
1596@findex mh-show
1597@item @key{RET}
1598Display message (@code{mh-show}).
1599@c -------------------------
1600@cindex @samp{Message > Show Message with Header} menu item
1601@cindex menu item, @samp{Message > Show Message with Header}
1602@kindex , (comma)
1603@findex mh-header-display
1604@item , (comma)
1605Display message with all header fields (@code{mh-header-display}).
1606@c -------------------------
bfe16263
BW
1607@cindex @samp{Message > Show Message with Preferred Alternative} menu item
1608@cindex menu item, @samp{Message > Show Message with Preferred Alternative}
1609@kindex : (colon)
1610@findex mh-show-preferred-alternative
1611@item : (colon)
1612Display message with the default preferred alternative
1613(@code{mh-show-preferred-alternative}).
1614@c -------------------------
4009494e
GM
1615@kindex ; (semicolon)
1616@findex mh-toggle-mh-decode-mime-flag
1617@item ; (semicolon)
1618Toggle the value of @code{mh-decode-mime-flag}
1619(@code{mh-toggle-mh-decode-mime-flag}).
1620@c -------------------------
1621@kindex @key{SPC}
1622@findex mh-page-msg
1623@item @key{SPC}
1624Display next page in message (@code{mh-page-msg}).
1625@c -------------------------
1626@kindex @key{BS}
1627@findex mh-previous-page
1628@item @key{BS}
1629Display previous page in message (@code{mh-previous-page}).
1630@c -------------------------
1631@cindex @samp{Message > Write Message to File...} menu item
1632@cindex menu item, @samp{Message > Write Message to File...}
1633@kindex >
1634@findex mh-write-msg-to-file
1635@item >
1636Append message to end of file (@code{mh-write-msg-to-file}).
1637@c -------------------------
1638@cindex @samp{Message > Pipe Message to Command...} menu item
1639@cindex menu item, @samp{Message > Pipe Message to Command...}
1640@kindex |
1641@findex mh-pipe-msg
1642@item |
1643Pipe message through shell command (@code{mh-pipe-msg}).
1644@c -------------------------
1645@kindex C-d
1646@findex mh-delete-msg-no-motion
1647@item C-d
1648Delete range, don't move to next message
1649(@code{mh-delete-msg-no-motion}).
1650@c -------------------------
1651@cindex @samp{Message > Delete Message} menu item
1652@cindex menu item, @samp{Message > Delete Message}
1653@kindex d
1654@findex mh-delete-msg
1655@item d
1656Delete range (@code{mh-delete-msg}).
1657@c -------------------------
1658@kindex D ?
1659@findex mh-prefix-help
1660@item D ?
1661Display cheat sheet for the commands of the current prefix in
1662minibuffer (@code{mh-prefix-help}).
1663@c -------------------------
1664@kindex D @key{SPC}
1665@findex mh-page-digest
1666@item D @key{SPC}
1667Display next message in digest (@code{mh-page-digest}).
1668@c -------------------------
1669@kindex D @key{BS}
1670@findex mh-page-digest-backwards
1671@item D @key{BS}
1672Display previous message in digest (@code{mh-page-digest-backwards}).
1673@c -------------------------
1674@cindex @samp{Message > Burst Digest Message} menu item
1675@cindex menu item, @samp{Message > Burst Digest Message}
1676@kindex D b
1677@findex mh-burst-digest
1678@item D b
1679Break up digest into separate messages (@code{mh-burst-digest}).
1680@c -------------------------
1681@cindex @samp{Message > Go to Message by Number...} menu item
1682@cindex menu item, @samp{Message > Go to Message by Number...}
1683@kindex g
1684@findex mh-goto-msg
1685@item g
1686Go to a message (@code{mh-goto-msg}).
1687@c -------------------------
1688@kindex k
1689@findex mh-delete-subject-or-thread
1690@item k
1691Delete messages with same subject or thread
1692(@code{mh-delete-subject-or-thread}).
1693@c -------------------------
1694@kindex K ?
1695@findex mh-prefix-help
1696@item K ?
1697Display cheat sheet for the commands of the current prefix in
1698minibuffer (@code{mh-prefix-help}).
1699@c -------------------------
1700@kindex K @key{TAB}
1701@findex mh-next-button
1702@item K @key{TAB}
1703Go to the next button (@code{mh-next-button}).
1704@c -------------------------
1705@kindex K S-@key{TAB}
1706@findex mh-prev-button
1707@item K S-@key{TAB}
1708Go to the previous button (@code{mh-prev-button}).
1709@c -------------------------
1710@kindex K a
1711@findex mh-mime-save-parts
1712@item K a
1713Save attachments (@code{mh-mime-save-parts}).
1714@c -------------------------
1715@kindex K e
1716@findex mh-display-with-external-viewer
1717@item K e
1718View attachment externally (@code{mh-display-with-external-viewer}).
1719@c -------------------------
1720@kindex K i
1721@findex mh-folder-inline-mime-part
1722@item K i
1723Show attachment verbatim (@code{mh-folder-inline-mime-part}).
1724@c -------------------------
1725@kindex K o
1726@findex mh-folder-save-mime-part
1727@item K o
1728Save (output) attachment (@code{mh-folder-save-mime-part}).
1729@c -------------------------
1730@kindex K t
1731@findex mh-toggle-mime-buttons
1732@item K t
1733Toggle option @code{mh-display-buttons-for-inline-parts-flag}
1734(@code{mh-toggle-mime-buttons}).
1735@c -------------------------
1736@kindex K v
1737@findex mh-folder-toggle-mime-part
1738@item K v
1739View attachment (@code{mh-folder-toggle-mime-part}).
1740@c -------------------------
1741@cindex @samp{Message > Modify Message} menu item
1742@cindex menu item, @samp{Message > Modify Message}
1743@kindex M
1744@findex mh-modify
1745@item M
1746Edit message (@code{mh-modify}).
1747@c -------------------------
1748@cindex @samp{Message > Go to First Message} menu item
1749@cindex menu item, @samp{Message > Go to First Message}
1750@kindex M-<
1751@findex mh-first-msg
1752@item M-<
1753Display first message (@code{mh-first-msg}).
1754@c -------------------------
1755@cindex @samp{Message > Go to Last Message} menu item
1756@cindex menu item, @samp{Message > Go to Last Message}
1757@kindex M->
1758@findex mh-last-msg
1759@item M->
1760Display last message (@code{mh-last-msg}).
1761@c -------------------------
1762@kindex M-n
1763@findex mh-next-unread-msg
1764@item M-n
1765Display next unread message (@code{mh-next-unread-msg}).
1766@c -------------------------
1767@kindex M-p
1768@findex mh-previous-unread-msg
1769@item M-p
1770Display previous unread message (@code{mh-previous-unread-msg}).
1771@c -------------------------
1772@cindex @samp{Message > Next Message} menu item
1773@cindex menu item, @samp{Message > Next Message}
1774@kindex n
1775@findex mh-next-undeleted-msg
1776@item n
1777Display next message (@code{mh-next-undeleted-msg}).
1778@c -------------------------
1779@cindex @samp{Message > Previous Message} menu item
1780@cindex menu item, @samp{Message > Previous Message}
1781@kindex p
1782@findex mh-previous-undeleted-msg
1783@item p
1784Display previous message (@code{mh-previous-undeleted-msg}).
1785@c -------------------------
1786@kindex P ?
1787@findex mh-prefix-help
1788@item P ?
1789Display cheat sheet for the commands of the current prefix in
1790minibuffer (@code{mh-prefix-help}).
1791@c -------------------------
1792@kindex P C
1793@findex mh-ps-print-toggle-color
1794@item P C
1795Toggle whether color is used in printing messages
1796(@code{mh-ps-print-toggle-color}).
1797@c -------------------------
1798@kindex P F
1799@findex mh-ps-print-toggle-faces
1800@item P F
1801Toggle whether printing is done with faces or not
1802(@code{mh-ps-print-toggle-faces}).
1803@c -------------------------
1804@kindex P f
1805@findex mh-ps-print-msg-file
1806@item P f
1807Print range to file (@code{mh-ps-print-msg-file}).
1808@c -------------------------
1809@cindex @samp{Message > Print Message} menu item
1810@cindex menu item, @samp{Message > Print Message}
1811@kindex P l
1812@findex mh-print-msg
1813@item P l
1814Print range the old fashioned way
1815(@code{mh-print-msg}).
1816@c -------------------------
1817@kindex P p
1818@findex mh-ps-print-msg
1819@item P p
1820Print range (@code{mh-ps-print-msg}).
1821@c -------------------------
1822@kindex X ?
1823@findex mh-prefix-help
1824@item X ?
1825Display cheat sheet for the commands of the current prefix in
1826minibuffer (@code{mh-prefix-help}).
1827@c -------------------------
1828@cindex @samp{Message > Unpack Uuencoded Message...} menu item
1829@cindex menu item, @samp{Message > Unpack Uuencoded Message...}
1830@kindex X s
1831@kindex X u
1832@findex mh-store-msg
1833@item X s
1834@itemx X u
1835Unpack message created with @command{uudecode} or @command{shar}
1836(@code{mh-store-msg}).
1837@c -------------------------
1838@kindex Mouse-2
1839@findex mh-show-mouse
1840@item Mouse-2
1841Move point to mouse event and show message (@code{mh-show-mouse}).
1842@end table
1843
1844Within the MH-Show buffer, the following command is defined.
1845
1846@table @kbd
1847@kindex @key{RET}
1848@kindex Mouse-1
1849@kindex Mouse-2
1850@findex mh-press-button
1851@item @key{RET}
1852@itemx Mouse-1
1853@itemx Mouse-2
1854View contents of button (@code{mh-press-button}).
1855@end table
1856
1857@cindex @samp{mh-show} customization group
1858@cindex customization group, @samp{mh-show}
1859
1860The following table lists options in the @samp{mh-show} customization
1861group that are used while reading mail.
1862
1863@vtable @code
1864@item mh-bury-show-buffer-flag
1865On means show buffer is buried (default: @samp{on}).
1866@c -------------------------
1867@item mh-clean-message-header-flag
1868On means remove extraneous header fields (default: @samp{on}).
1869@c -------------------------
1870@item mh-decode-mime-flag
1871On means attachments are handled (default: @samp{on} if the Gnus
1872@samp{mm-decode} package is present).
1873@c -------------------------
1874@item mh-display-buttons-for-alternatives-flag
1875On means display buttons for all alternative attachments (default:
1876@samp{off}).
1877@c -------------------------
1878@item mh-display-buttons-for-inline-parts-flag
1879On means display buttons for all inline attachments (default:
1880@samp{off}).
1881@c -------------------------
1882@item mh-do-not-confirm-flag
1883On means non-reversible commands do not prompt for confirmation
1884(default: @samp{off}).
1885@c -------------------------
1886@item mh-fetch-x-image-url
1887Control fetching of @samp{X-Image-URL:} header field image (default:
1888@samp{Never Fetch}).
1889@c -------------------------
1890@item mh-graphical-smileys-flag
1891On means graphical smileys are displayed (default: @samp{on}).
1892@c -------------------------
1893@item mh-graphical-emphasis-flag
1894On means graphical emphasis is displayed (default: @samp{on}).
1895@c -------------------------
1896@item mh-highlight-citation-style
1897Style for highlighting citations (default: @samp{Multicolor}).
1898@c -------------------------
1899@item mh-invisible-header-fields-default
1900List of hidden header fields (default: a checklist too long to list
1901here).
1902@c -------------------------
1903@item mh-invisible-header-fields
1904Additional header fields to hide (default: @code{nil}).
1905@c -------------------------
1906@item mh-lpr-command-format
1907Command used to print (default: @code{"lpr -J '%s'"}).
1908@c -------------------------
1909@item mh-max-inline-image-height
1910Maximum inline image height if @samp{Content-Disposition:} is not
1911present (default: 0).
1912@c -------------------------
1913@item mh-max-inline-image-width
1914Maximum inline image width if @samp{Content-Disposition:} is not
1915present(default: 0).
1916@c -------------------------
1917@item mh-mhl-format-file
1918Specifies the format file to pass to the @command{mhl} program
1919(default: @samp{Use Default mhl Format (Printing Only)}).
1920@c -------------------------
1921@item mh-mime-save-parts-default-directory
1922Default directory to use for @kbd{K a}.
1923@c -------------------------
1924@item mh-print-background-flag
1925On means messages should be printed in the background (default:
1926@samp{off}).
1927@c -------------------------
1928@item mh-show-buffer-mode-line-buffer-id
1929Format string to produce @code{mode-line-buffer-identification} for
1930show buffers (default: @code{" @{show-%s@} %d"}).
1931@c -------------------------
1932@item mh-show-maximum-size
1933Maximum size of message (in bytes) to display automatically (default:
19340).
1935@c -------------------------
1936@item mh-show-use-xface-flag
1937On means display face images in MH-Show buffers (default: @samp{on}).
1938@c -------------------------
1939@item mh-store-default-directory
1940Default directory for @kbd{X s} (default: @samp{Current}).
1941@c -------------------------
1942@item mh-summary-height
1943Number of lines in MH-Folder buffer (including the mode line)
1944(default: depends on size of frame).
1945@end vtable
1946
1947The following hooks are available.
1948
1949@vtable @code
1950@item mh-delete-msg-hook
1951Hook run after marking each message for deletion (default: @code{nil}).
1952@c -------------------------
1953@item mh-show-hook
1954Hook run after @key{RET} shows a message (default: @code{nil}).
1955@c -------------------------
1956@item mh-show-mode-hook
1957Hook run upon entry to @code{mh-show-mode} (default: @code{nil}).
1958@end vtable
1959
1960The following faces are available.
1961
1962@vtable @code
1963@item mh-show-cc
1964Face used to highlight @samp{cc:} header fields.
1965@c -------------------------
1966@item mh-show-date
1967Face used to highlight @samp{Date:} header fields.
1968@c -------------------------
1969@item mh-show-from
1970Face used to highlight @samp{From:} header fields.
1971@c -------------------------
1972@item mh-show-header
1973Face used to deemphasize less interesting header fields.
1974@c -------------------------
1975@item mh-show-pgg-bad
1976Bad PGG signature face.
1977@c -------------------------
1978@item mh-show-pgg-good
1979Good PGG signature face.
1980@c -------------------------
1981@item mh-show-pgg-unknown
1982Unknown or untrusted PGG signature face.
1983@c -------------------------
1984@item mh-show-signature
1985Signature face.
1986@c -------------------------
1987@item mh-show-subject
1988Face used to highlight @samp{Subject:} header fields.
1989@c -------------------------
1990@item mh-show-to
1991Face used to highlight @samp{To:} header fields.
1992@c -------------------------
1993@item mh-show-xface
1994X-Face image face.
1995@end vtable
1996
1997The functions and variables introduced here are explained in more
1998detail in the following sections.
1999
2000@menu
2001* Viewing::
2002* Viewing Attachments::
2003* HTML::
2004* Digests::
2005* Reading PGP::
2006* Printing::
2007* Files and Pipes::
2008* Navigating::
2009* Miscellaneous Commands and Options::
2010@end menu
2011
2012@node Viewing, Viewing Attachments, Reading Mail, Reading Mail
2013@section Viewing Your Mail
2014
2015@findex mh-header-display
2016@findex mh-page-msg
2017@findex mh-previous-page
2018@findex mh-show
2019@findex mh-show-mouse
2020@kindex , (comma)
2021@kindex . (period)
2022@kindex @key{BS}
2023@kindex @key{RET}
2024@kindex @key{SPC}
2025@kindex Mouse-2
2026
2027The command @key{RET} (@code{mh-show}) displays the message that the
2028cursor is on while @kbd{Mouse-2} (@code{mh-show-mouse}) displays the
2029message that the mouse cursor is on. If the message is already
2030displayed, it scrolls to the beginning of the message. Use @key{SPC}
2031(@code{mh-page-msg}) and @key{BS} (@code{mh-previous-page}) to move
2032forwards and backwards one page at a time through the message. You can
2033give either of these commands a prefix argument that specifies the
2034number of lines to scroll (such as @kbd{10 @key{SPC}}). The @key{SPC}
2035command will also show the next undeleted message if it is used at the
2036bottom of a message. MH-E normally hides a lot of the superfluous
2037header fields that mailers add to a message, but if you wish to see
2038all of them, use the command @kbd{,} (comma;
2039@code{mh-header-display}).
2040
2041@vindex mh-show-maximum-size
2042
2043The option @code{mh-show-maximum-size} provides an opportunity to skip
2044over large messages which may be slow to load. The default value of 0
2045means that all message are shown regardless of size.
2046
2047A litany of options control what displayed messages look like.
2048
2049@vindex mh-show-cc
2050@vindex mh-show-date
2051@vindex mh-show-from
2052@vindex mh-show-header
2053@vindex mh-show-subject
2054@vindex mh-show-to
2055
2056First, the appearance of the header fields can be modified by
2057customizing the associated face: @code{mh-show-to}, @code{mh-show-cc},
2058@code{mh-show-from}, @code{mh-show-date}, and @code{mh-show-subject}.
2059The face @code{mh-show-header} is used to deemphasize the other, less
2060interesting, header fields.
2061
2062@cindex regular expressions, @code{mh-invisible-header-fields}
2063@vindex mh-clean-message-header-flag
2064@vindex mh-invisible-header-fields
2065@vindex mh-invisible-header-fields-default
2066
2067Normally messages are delivered with a handful of uninteresting header
2068fields. These are hidden by turning on the option
2069@code{mh-clean-message-header-flag} (which it is by default). The
2070header fields listed in the option
2071@code{mh-invisible-header-fields-default} are hidden, although you can
2072check off any field that you would like to see. Header fields that you
2073would like to hide that aren't listed can be added to the option
2074@code{mh-invisible-header-fields} with a couple of caveats. Regular
2075expressions are not allowed. Unique fields should have a @samp{:}
2076suffix; otherwise, the element can be used to render invisible an
2077entire class of fields that start with the same prefix. If you think a
2940c053 2078header field should be generally ignored, please update
fc0c5af8 2079@uref{https://sourceforge.net/p/mh-e/bugs/245/, SF #245}.
4009494e 2080
36a672f6
GM
2081@cindex header field, @samp{Face}
2082@cindex header field, @samp{X-Face}
2083@cindex header field, @samp{X-Image-URL}
2084@cindex @samp{Face} header field
2085@cindex @samp{X-Face} header field
2086@cindex @samp{X-Image-URL} header field
4009494e
GM
2087@vindex mh-show-use-xface-flag
2088
2089MH-E can display the content of @samp{Face:}, @samp{X-Face:}, and
2090@samp{X-Image-URL:} header fields. If any of these fields occur in the
2091header of your message, the sender's face will appear in the
2092@samp{From:} header field. If more than one of these fields appear,
2093then the first field found in the order @samp{Face:}, @samp{X-Face:},
2094and @samp{X-Image-URL:} will be used. The option
2095@code{mh-show-use-xface-flag} is used to turn this feature on and off.
2096This feature will be turned on by default if your system supports it.
2097
2098The first header field used, if present, is the Gnus-specific
2099@samp{Face:} field@footnote{The @samp{Face:} field appeared in GNU
2100Emacs 21 and XEmacs. For more information, see
2101@uref{http://quimby.gnus.org/circus/face/}.}.
2102
2103@cindex @command{uncompface}
2104@cindex Emacs, packages, x-face
2105@cindex Unix commands, @command{uncompface}
2106@cindex x-face package
2107@vindex mh-show-xface
2108
2109Next is the traditional @samp{X-Face:} header field@footnote{The
2110display of this field requires the
2111@uref{ftp://ftp.cs.indiana.edu/pub/faces/compface/compface.tar.Z,
2112@command{uncompface} program}. Recent versions of XEmacs have internal
2113support for @samp{X-Face:} images. If your version of XEmacs does not,
2114then you'll need both @command{uncompface} and the
2115@uref{ftp://ftp.jpl.org/pub/elisp/, @samp{x-face} package}.}. MH-E
2116renders the foreground and background of the image using the
2117associated attributes of the face @code{mh-show-xface}.
2118
2119@cindex @command{convert}
2120@cindex @command{wget}
2121@cindex ImageMagick
2122@cindex Unix commands, @command{convert}
2123@cindex Unix commands, @command{wget}
2124@vindex mh-fetch-x-image-url
2125
2126Finally, MH-E will display images referenced by the
2127@samp{X-Image-URL:} header field if neither the @samp{Face:} nor the
2128@samp{X-Face:} fields are present@footnote{The display of the images
2129requires the @uref{http://www.gnu.org/software/wget/wget.html,
2130@command{wget} program} to fetch the image and the @command{convert}
fc0c5af8
BW
2131program from the @uref{http://www.imagemagick.org/script/index.php,
2132ImageMagick suite}.}. Of the three header fields this is the most
2133efficient in terms of network usage since the image doesn't need to be
2134transmitted with every single mail. The option
2135@code{mh-fetch-x-image-url} controls the fetching of the
2136@samp{X-Image-URL:} header field image with the following values:
4009494e
GM
2137
2138@table @samp
2139@item Ask Before Fetching
2140You are prompted before the image is fetched. MH-E will remember your
2141reply and will either use the already fetched image the next time the
2142same URL is encountered or silently skip it if you didn't fetch it the
2143first time. This is a good setting.
2144@c -------------------------
2145@item Never Fetch
2146Images are never fetched and only displayed if they are already
2147present in the cache. This is the default.
2148@end table
2149
2150There isn't a value of @samp{Always Fetch} for privacy and DOS (denial
2151of service) reasons. For example, fetching a URL can tip off a spammer
2152that you've read his email (which is why you shouldn't blindly answer
2153yes if you've set this option to @samp{Ask Before Fetching}). Someone
2154may also flood your network and fill your disk drive by sending a
2155torrent of messages, each specifying a unique URL to a very large
2156file.
2157
2158@cindex @file{.mhe-x-image-cache}
2159@cindex files, @file{.mhe-x-image-cache}
2160
2161The cache of images is found in the directory
2162@file{.mhe-x-image-cache} within your MH directory. You can add your
2163own face to the @samp{From:} field too. @xref{Picture}.
2164
2165@cindex @command{mhl}
2166@cindex MH commands, @command{mhl}
2167@vindex mh-mhl-format-file
2168
2169Normally MH-E takes care of displaying messages itself (rather than
2170calling an MH program to do the work). If you'd rather have
2171@command{mhl} display the message (within MH-E), change the option
2172@code{mh-mhl-format-file} from its default value of @samp{Use Default
2173mhl Format (Printing Only)}. You can set this option to @samp{Use
2174Default mhl Format} to get the same output as you would get if you ran
2175@command{mhl} from the shell. If you have a format file that you want
2176MH-E to use, you can set this option to @samp{Specify an mhl Format
2177File} and enter the name of your format file (@command{mhl}(1) or
2178section @uref{@value{MH-BOOK-HOME}/shomes.html#Usisho, Using mhl} in
2179the MH book tells you how to write one). Your format file should
2180specify a non-zero value for @samp{overflowoffset} to allow MH-E to
2181parse the header. Note that @command{mhl} is always used for printing
2182and forwarding; in this case, the value of @code{mh-mhl-format-file}
2183is consulted if you have specified a format file.
2184
2185@cindex citations, highlighting
2186@cindex highlighting citations
2187@vindex mh-highlight-citation-style
2188
2189If the sender of the message has cited other messages in his message,
2190then MH-E will highlight these citations to emphasize the sender's
2191actual response. The option @code{mh-highlight-citation-style} can be
2192customized to change the highlighting style. The @samp{Multicolor}
2193method uses a different color for each indentation while the
2194@samp{Monotone} method highlights all citations in red. To disable
2195highlighting of citations entirely, choose @samp{None}.
2196
2197@cindex URLs, highlighting
2198@cindex email addresses, highlighting
2199@cindex highlighting URLs
2200@cindex highlighting email addresses
2201@cindex links, following
2202@findex goto-address-at-point
2203@kindex C-c @key{RET}
2204@kindex Mouse-2
2205@vindex goto-address-highlight-p
2206
2207Email addresses and URLs in the message are highlighted if the option
2208@code{goto-address-highlight-p} is on, which it is by default. To view
2209the web page for a highlighted URL or to send a message using a
2210highlighted email address, use @kbd{Mouse-2} or @kbd{C-c @key{RET}}
2211(@code{goto-address-at-point}). @xref{Sending Mail}, to see how to
2212configure Emacs to send the message using MH-E.
2213
2214@cindex boldface, showing
2215@cindex emphasis
2216@cindex italics, showing
2217@cindex smileys
2218@cindex typesetting
2219@cindex underline, showing
2220@vindex gnus-emphasis-alist
2221@vindex mh-decode-mime-flag
2222@vindex mh-graphical-emphasis-flag
2223@vindex mh-graphical-smileys-flag
2224
2225It is a long standing custom to inject body language using a
2226cornucopia of punctuation, also known as the @dfn{smileys}. MH-E can
2227render these as graphical widgets if the option
2228@code{mh-graphical-smileys-flag} is turned on, which it is by default.
2229Smileys include patterns such as :-) and ;-). Similarly, a few
2230typesetting features are indicated in ASCII text with certain
2231characters. If your terminal supports it, MH-E can render these
2232typesetting directives naturally if the option
2233@code{mh-graphical-emphasis-flag} is turned on, which it is by
2234default. For example, _underline_ will be
2235@ifhtml
2236@html
2237<u>underlined</u>,
2238@end html
2239@end ifhtml
2240@ifnothtml
2241underlined,
2242@end ifnothtml
2243*bold* will appear in @b{bold}, /italics/ will appear in @i{italics},
2244and so on. See the option @code{gnus-emphasis-alist} for the whole
2245list. Both of these options are disabled if the option
2246@code{mh-decode-mime-flag} is turned off. @xref{Viewing Attachments}.
2247
2248@cindex signature separator
2249@cindex vCard
2250@vindex mh-show-signature
2251
2252MH-E normally renders signatures and vCards in italics so that the
2253body of the message stands out more. MH-E depends on the presence of
2254the @dfn{signature separator} (@code{"-- "}) to do this. You can also
2255customize the face @code{mh-show-signature} so the appearance of the
2256signature block is more to your liking.
2257
2258@vindex mh-show-hook
2259@vindex mh-show-mode-hook
2260
2261Two hooks can be used to control how messages are displayed. The first
2262hook, @code{mh-show-mode-hook}, is called early on in the process of
2263the message display. It is usually used to perform some action on the
2264message's content. The second hook, @code{mh-show-hook}, is the last
2265thing called after messages are displayed. It's used to affect the
2266behavior of MH-E in general or when @code{mh-show-mode-hook} is too
2267early.
2268
2269@cindex MH-Show mode
2270@cindex modes, MH-Show
2271@vindex mh-show-buffer-mode-line-buffer-id
2272
2273For those who like to modify their mode lines, use
2274@code{mh-show-buffer-mode-line-buffer-id} to modify the mode line in
2275the MH-Show buffers. Place the two escape strings @samp{%s} and
2276@samp{%d}, which will display the folder name and the message number,
2277respectively, somewhere in the string in that order. The default value
2278of @code{"@{show-%s@} %d"} yields a mode line of
2279
2280@smallexample
2281-----@{show-+inbox@} 4 (MH-Show)--Bot--------------------------------
2282@end smallexample
2283
2284@node Viewing Attachments, HTML, Viewing, Reading Mail
2285@section Viewing Attachments
2286
2287@cindex attachments
2288@cindex body parts
2289@cindex @command{mhshow}
2290@cindex @command{show}
2291@cindex MH commands, @command{mhshow}
2292@cindex MH commands, @command{show}
2293@cindex MIME
2294@cindex multimedia mail
2295
2296MH has the ability to display @dfn{@sc{mime}} (Multipurpose Internet
2297Mail Extensions) messages which are simply messages with additional
2298@dfn{body parts} or @dfn{attachments}. You can use the MH commands
2299@command{show}@footnote{See the section
2300@uref{@value{MH-BOOK-HOME}/reapre.html, Reading Mail: inc show next
2301prev} in the MH book.} or @command{mhshow}@footnote{See the section
2302@uref{@value{MH-BOOK-HOME}/usimim.html#ReMIMa, Reading MIME Mail} in
2303the MH book.} from the shell to read @sc{mime} messages@footnote{You
2304can call them directly from Emacs if you're running the X Window
2305System: type @kbd{M-! xterm -e mhshow @var{message-number}}. You can
2306leave out the @samp{xterm -e} if you use @command{mhlist} or
2307@command{mhstore}.}.
2308
2309@cindex Emacs, packages, mm-decode
2310@cindex mm-decode package
2311@findex mh-toggle-mh-decode-mime-flag
2312@kindex ; (semicolon)
2313@vindex mh-decode-mime-flag
2314
2315MH-E can handle attachments as well if the Gnus @samp{mm-decode}
2316package is present. If so, the option @code{mh-decode-mime-flag} will
2317be on. Otherwise, you'll see the @sc{mime} body parts rather than text
2318or attachments. There isn't much point in turning off the option
2319@code{mh-decode-mime-flag}; however, you can inspect it if it appears
2320that the body parts are not being interpreted correctly or toggle it
2321with the command @kbd{;} (semicolon;
2322@code{mh-toggle-mh-decode-mime-flag}) to view the raw message. This
2323option also controls the display of quoted-printable messages and
2324other graphical widgets. @xref{Viewing}.
2325
2326@cindex buttons
2327
2328Attachments in MH-E are indicated by @dfn{buttons} like this:
2329
2330@smallexample
2331[1. image/jpeg; foo.jpg]...
2332@end smallexample
2333
2334@findex mh-next-button
2335@findex mh-press-button
2336@findex mh-prev-button
2337@kindex @key{RET}
2338@kindex K @key{TAB}
2339@kindex K S-@key{TAB}
2340@kindex Mouse-1
2341@kindex Mouse-2
2342
2343To view the contents of the button, use either @kbd{Mouse-1} or
2344@kbd{Mouse-2} on the button or @key{RET} (@code{mh-press-button}) when
2345the cursor is over the button. This command is a toggle so if you use
2346it again on the same attachment, it is hidden. If Emacs does not know
2347how to display the attachment, then Emacs offers to save the
2348attachment in a file. To move the cursor to the next button, use the
2349command @kbd{K @key{TAB}} (@code{mh-next-button}). If the end of the
2350buffer is reached then the search wraps over to the start of the
2351buffer. To move the cursor to the previous button, use the command
2352@kbd{K S-@key{TAB}} (@code{mh-prev-button}). If the beginning of the
2353buffer is reached then the search wraps over to the end of the buffer.
2354
2355@cindex attachments, viewing
2356@cindex viewing attachments
2357@findex mh-folder-toggle-mime-part
2358@kindex K v
2359
2360Another way to view the contents of a button is to use the command
2361@kbd{K v} (@code{mh-folder-toggle-mime-part}). This command displays
2362(or hides) the attachment associated with the button under the cursor.
2363If the cursor is not located over a button, then the cursor first
2364moves to the next button, wrapping to the beginning of the message if
2365necessary. This command has the advantage over the previous commands
2366of working from the MH-Folder buffer. You can also provide a numeric
2367prefix argument (as in @kbd{4 K v}) to view the attachment labeled
2368with that number. If Emacs does not know how to display the
2369attachment, then Emacs offers to save the attachment in a file.
2370
2371@cindex @file{/etc/mailcap}
2372@cindex files, @file{/etc/mailcap}
2373@findex mailcap-mime-info
2374@findex mh-display-with-external-viewer
2375@kindex K e
2376
2377If Emacs does not know how to view an attachment, you could save it
2378into a file and then run some program to open it. It is easier,
2379however, to launch the program directly from MH-E with the command
2380@kbd{K e} (@code{mh-display-with-external-viewer}). While you'll most
2381likely use this to view spreadsheets and documents, it is also useful
2382to use your browser to view HTML attachments with higher fidelity than
2383what Emacs can provide. This command displays the attachment
2384associated with the button under the cursor. If the cursor is not
2385located over a button, then the cursor first moves to the next button,
2386wrapping to the beginning of the message if necessary. You can provide
2387a numeric prefix argument (as in @kbd{4 K e}) to view the attachment
2388labeled with that number. This command tries to provide a reasonable
2389default for the viewer by calling the Emacs function
2390@code{mailcap-mime-info}. This function usually reads the file
2391@file{/etc/mailcap}.
2392
2393@cindex attachments, saving
2394@cindex saving attachments
2395@findex mh-folder-save-mime-part
2396@kindex K o
2397
2398Use the command @kbd{K o} (@code{mh-folder-save-mime-part}) to save
2399attachments (the mnemonic is ``output''). This command saves the
2400attachment associated with the button under the cursor. If the cursor
2401is not located over a button, then the cursor first moves to the next
2402button, wrapping to the beginning of the message if necessary. You can
2403also provide a numeric prefix argument (as in @kbd{3 K o}) to save the
2404attachment labeled with that number. This command prompts you for a
2405filename and suggests a specific name if it is available.
2406
2407@cindex @command{mhn}
2408@cindex @command{mhstore}
2409@cindex MH commands, @command{mhn}
2410@cindex MH commands, @command{mhstore}
2411@findex mh-mime-save-parts
2412@kindex K a
2413@vindex mh-mime-save-parts-default-directory
2414
2415You can save all of the attachments at once with the command @kbd{K a}
2416(@code{mh-mime-save-parts}). The attachments are saved in the
2417directory specified by the option
2418@code{mh-mime-save-parts-default-directory} unless you use a prefix
2419argument (as in @kbd{C-u K a}) in which case you are prompted for the
2420directory. These directories may be superseded by MH profile
2421components, since this function calls on @command{mhstore}
2422(@command{mhn}) to do the work.
2423
2424@vindex mh-mime-save-parts-default-directory
2425
2426The default value for the option
2427@code{mh-mime-save-parts-default-directory} is @samp{Prompt Always} so
2428that you are always prompted for the directory in which to save the
2429attachments. However, if you usually use the same directory within a
2430session, then you can set this option to @samp{Prompt the First Time}
2431to avoid the prompt each time. you can make this directory permanent
2432by choosing @samp{Directory} and entering the directory's name.
2433
2434@cindex attachments, inline
2435@cindex inline attachments
2436@findex mh-toggle-mime-buttons
2437@kindex K t
2438@vindex mh-display-buttons-for-inline-parts-flag
2439
2440The sender can request that attachments should be viewed inline so
2441that they do not really appear like an attachment at all to the
2442reader. Most of the time, this is desirable, so by default MH-E
2443suppresses the buttons for inline attachments. On the other hand, you
2444may receive code or HTML which the sender has added to his message as
1df7defd 2445inline attachments so that you can read them in MH-E@. In this case, it
4009494e
GM
2446is useful to see the buttons so that you know you don't have to cut
2447and paste the code into a file; you can simply save the attachment. If
2448you want to make the buttons visible for inline attachments, you can
2449use the command @kbd{K t} (@code{mh-toggle-mime-buttons}) to toggle
2450the visibility of these buttons. You can turn on these buttons
2451permanently by turning on the option
2452@code{mh-display-buttons-for-inline-parts-flag}.
2453
2454MH-E cannot display all attachments inline however. It can display
2455text (including @sc{html}) and images.
2456
36a672f6 2457@cindex header field, @samp{Content-Disposition}
4009494e 2458@cindex inline images
36a672f6 2459@cindex @samp{Content-Disposition} header field
4009494e
GM
2460@vindex mh-max-inline-image-height
2461@vindex mh-max-inline-image-width
2462
2463Some older mail programs do not insert the needed
2464plumbing@footnote{This plumbing is the @samp{Content-Disposition:}
2465header field.} to tell MH-E whether to display the attachments inline
2466or not. If this is the case, MH-E will display these images inline if
2467they are smaller than the window. However, you might want to allow
2468larger images to be displayed inline. To do this, you can change the
2469options @code{mh-max-inline-image-width} and
2470@code{mh-max-inline-image-height} from their default value of zero to
2471a large number. The size of your screen is a good choice for these
2472numbers.
2473
2474@cindex alternatives
2475@cindex attachments, alternatives
2476@vindex mh-display-buttons-for-alternatives-flag
2477
2478Sometimes, a mail program will produce multiple alternatives of an
2479attachment in increasing degree of faithfulness to the original
2480content. By default, only the preferred alternative is displayed. If
2481the option @code{mh-display-buttons-for-alternatives-flag} is on, then
2482the preferred part is shown inline and buttons are shown for each of
2483the other alternatives.
2484
2485@vindex mm-discouraged-alternatives
2486
2487Many people prefer to see the @samp{text/plain} alternative rather
2488than the @samp{text/html} alternative. To do this in MH-E, customize
2489the option @code{mm-discouraged-alternatives}, and add
2490@samp{text/html}. The next best alternative, if any, will be shown.
2491
bfe16263
BW
2492@findex mh-show-preferred-alternative
2493@kindex : (colon)
2494
2495Occasionally, though, you might want to see the preferred alternative.
2496The command @kbd{:} (@code{mh-show-preferred-alternative}) displays
2497the message with the default preferred alternative. This is as if
2498@code{mm-discouraged-alternatives} is set to @samp{nil}. Use the
2499command @key{RET} (@code{mh-show}) to show the message normally again.
2500
4009494e
GM
2501@kindex K i
2502@findex mh-folder-inline-mime-part
2503
2504You can view the raw contents of an attachment with the command @kbd{K
2505i} (@code{mh-folder-inline-mime-part}). This command displays (or
2506hides) the contents of the attachment associated with the button under
2507the cursor verbatim. If the cursor is not located over a button, then
2508the cursor first moves to the next button, wrapping to the beginning
2509of the message if necessary. You can also provide a numeric prefix
2510argument (as in @kbd{4 K i}) to view the attachment labeled with that
2511number.
2512
2513For additional information on buttons, see
2514@ifinfo
2515@ref{Article Buttons,,,gnus}, and @ref{MIME Commands,,,gnus}.
2516@end ifinfo
2517@ifnotinfo
2518the chapters @uref{http://www.gnus.org/manual/gnus_101.html#SEC101,
2519Article Buttons} and
2520@uref{http://www.gnus.org/manual/gnus_108.html#SEC108, MIME Commands}
2521in the @cite{The Gnus Manual}.
2522@end ifnotinfo
2523
2524@node HTML, Digests, Viewing Attachments, Reading Mail
2525@section HTML
2526
2527@cindex HTML
2528@cindex Gnus
2529
2530MH-E can display messages that have been sent in HTML@footnote{This
2531feature depends on a version of Gnus that is at least 5.10.}. The
2532content of the message will appear in the MH-Show buffer as you would
2533expect if the entire message is HTML, or there is an inline HTML body
2534part. However, if there is an HTML body part that is an attachment,
2535then you'll see a button like this:
2536
2537@smallexample
2538[1. text/html; foo.html]...
2539@end smallexample
2540
2541To see how to read the contents of this body part, see @ref{Viewing
2542Attachments}.
2543
2544@vindex mm-text-html-renderer
2545
2546The browser that MH-E uses is determined by the option
2547@code{mm-text-html-renderer}. The default setting is set automatically
2548based upon the presence of a known browser on your system. If you wish
2549to use a different browser, then set this option accordingly. See the
2550documentation for the browser you use for additional information on
2551how to use it. In particular, find and disable the option to render
2552images as this can tip off spammers that the email address they have
2553used is valid.
2554
2555@vindex mm-text-html-renderer
2556
2557If you're confused about which @code{mm-text-html-renderer} to use,
2558here's a brief description of each, sorted by popularity, that
2559includes the results of a quick poll of MH-E users from 2005-12-23.
2560
2561@table @asis
2562@cindex browser, @samp{w3m}
2563@cindex @samp{w3m}
2564@kindex Mouse-2
4009494e
GM
2565@item @samp{w3m} 7
2566The @samp{w3m} browser requires an external program. It's quick,
2567produces pretty nice output, and best of all, it's the only browser
2568that highlights links. These can be clicked with @kbd{Mouse-2} to view
567b9191
BW
2569the content of the link in @samp{w3m}. The @samp{w3m} browser handles
2570tables well and actually respects the table's width parameter (which
2571can cause text to wrap if the author didn't anticipate that the page
2572would be viewed in Emacs).
4009494e
GM
2573@c -------------------------
2574@cindex browser, @samp{w3m-standalone}
2575@cindex @samp{w3m-standalone}
2576@item @samp{w3m-standalone} 3
2577This browser, along with @samp{nil} for the external browser, are the
2578only choices that work without having to download a separate lisp
2579package or external program. This browser is quick, but does not show
2580links. It handles simple tables but some tables get rendered much
2581wider than the Emacs frame. This browser was the only one not to
2582handle the escape @samp{&ndash;} (it printed a @samp{?}), but it did
2583render @samp{&reg;}.
2584@c -------------------------
2585@cindex browser, @samp{links}
2586@cindex @samp{links}
2587@item @samp{links} 1
2588The @samp{links} browser requires an external program. It's quick, and
2589produces nicer output than @samp{lynx} on single column mails in
2590tables. However, it doesn't show links and it doesn't do as nice a job
2591on multi-column tables as some lines wrap. At least it fits in 80
2592columns and thus seems better than @samp{w3} and
2593@samp{w3m-standalone}. Converts escapes such as @samp{&reg;} to (R).
2594@c -------------------------
2595@cindex browser, @samp{lynx}
2596@cindex @samp{lynx}
2597@item @samp{lynx} 1
2598The @samp{lynx} browser requires an external program. It's quick and
2599produces pretty decent output but it doesn't show links. It doesn't
2600seem to do multi-column tables which makes output much cleaner. It
2601centers the output and wraps long lines more than most. Handles
2602@samp{&reg;}.
2603@c -------------------------
2604@item @samp{nil} 1
2605This choice obviously requires an external browser. Like
2606@samp{w3m-standalone}, it works out of the box. With this setting,
2607HTML messages have a button for the body part which you can view with
2608@kbd{K v} (@code{mh-folder-toggle-mime-part}).
2609@c -------------------------
2610@cindex browser, @samp{w3}
2611@cindex @samp{w3}
2612@item @samp{w3} 0
2613This choice does not require an external program as all of the
2614rendering is done in lisp. You do need to get the package separately.
2615This browser is @strong{slow}, and doesn't appear to have been updated
2616since 2001 and the author hasn't responded to my emails. It displays
2617unknown tags instead of hiding them, so you get to see all the
2618Microsoft crap in certain messages. Tends to make multi-column tables
2619wider than even a full-screen Emacs can handle. Like @samp{w3m}, you
2620can follow links, but you have to find them first as they are not
2621highlighted. Performs well on single-column tables and handles escapes
2622such as @samp{&reg;}.
2623@c -------------------------
2624@cindex browser, @samp{html2text}
2625@cindex @samp{html2text}
2626@item @samp{html2text} 0
2627The @samp{html2text} browser requires an external program. I noticed
2628that it can do some nasty things with simple HTML mails (like filling
2629the entire message as if it were one paragraph, including signature).
2630On another message, it displayed half of the HTML tags for some
2631reason.
2632@end table
2633
2634@vindex mm-text-html-renderer
2635
2636For a couple more sources of information about
2637@code{mm-text-html-renderer},
2638@ifinfo
2639@xref{Display Customization,,,emacs-mime}, and the documentation for
2640the Gnus command @kbd{W h} (@pxref{Article Washing,,,gnus},).
2641@end ifinfo
2642@ifnotinfo
2643see section @uref{http://www.gnus.org/manual/emacs-mime_6.html,
2644Display Customization} in the @cite{The Emacs MIME Manual} and the
2645documentation for the Gnus command @kbd{W h} (see section
2646@uref{http://www.gnus.org/manual/gnus_99.html, Article Washing} in the
2647@cite{The Gnus Manual}).
2648@end ifnotinfo
2649
567b9191
BW
2650@cindex @file{.emacs}
2651@cindex files, @file{.emacs}
2652@findex browse-url-at-mouse
2653@kindex S-Mouse-2
2654
867d4bb3 2655A useful key binding that you can add to @file{~/.emacs} is the
567b9191
BW
2656following which displays an HTML link or textual URL in an external
2657browser when clicked with @kbd{S-mouse-2}. This binding works in any
2658buffer, including HTML buffers.
2659
2660@smalllisp
2661(global-set-key [S-mouse-2] 'browse-url-at-mouse)
2662@end smalllisp
2663
4009494e
GM
2664@node Digests, Reading PGP, HTML, Reading Mail
2665@section Digests
2666
2667@cindex digests
2668@findex mh-page-digest
2669@findex mh-page-digest-backwards
2670@kindex D @key{BS}
2671@kindex D @key{SPC}
2672@kindex @key{BS}
2673@kindex @key{SPC}
2674
2675A digest is a message that contains other messages. Special MH-E
2676commands let you read digests conveniently. You can use @key{SPC} and
2677@key{BS} to page through the digest as if it were a normal message,
2678but if you wish to skip to the next message in the digest, use
2679@kbd{D @key{SPC}} (@code{mh-page-digest}). To return to a previous message,
2680use @kbd{D @key{BS}} (@code{mh-page-digest-backwards}).
2681
2682@cindex @command{burst}
2683@cindex MH commands, @command{burst}
2684@cindex MH-Folder Show mode
2685@cindex modes, MH-Folder Show
2686@findex mh-burst-digest
2687@kindex d
2688@kindex D b
2689@kindex t
2690
2691Another handy command is @kbd{D b} (@code{mh-burst-digest}). This
2692command uses the MH command @command{burst}@footnote{See the section
2693@uref{@value{MH-BOOK-HOME}/burdig.html, Bursting Messages} in the MH
2694book.} to break out each message in the digest into its own message.
2695Using this command, you can quickly delete unwanted messages, like
2696this: Once the digest is split up, toggle out of MH-Folder Show mode
2697with @kbd{t} (@pxref{Folders}) so that the scan lines fill the screen
2698and messages aren't displayed. Then use @kbd{d} (@pxref{Reading Mail})
2699to quickly delete messages that you don't want to read (based on the
2700@samp{Subject:} header field). You can also burst the digest to reply
2701directly to the people who posted the messages in the digest. One
2702problem you may encounter is that the @samp{From:} header fields are
2703preceded with a @samp{>} so that your reply can't create the
2704@samp{To:} field correctly. In this case, you must correct the
2705@samp{To:} field yourself. This is described later (@pxref{Editing
2706Drafts}).
2707
2708@node Reading PGP, Printing, Digests, Reading Mail
2709@section Signed and Encrypted Messages
2710
2711@cindex GPG
2712@cindex GnuPG
2713@cindex Gnus
2714@cindex OpenPGP
2715@cindex PGP
2716@cindex RFC 3156
2717@cindex encrypted messages
2718@cindex security
2719@cindex signed messages
2720
2721You can read encrypted or signed PGP or GPG messages with
2722MH-E@footnote{This feature depends on post-5.10 versions of Gnus.
2723@cite{MIME Security with OpenPGP} is documented in
2724@uref{http://www.rfc-editor.org/rfc/rfc3156.txt, RFC 3156}. However,
2725MH-E can also decrypt old-style PGP messages that are not in MIME
2726format.}. This section assumes that you already have a good
2727understanding of GPG and have set up your keys appropriately.
2728
2729If someone sends you a signed message, here is what you'll see:
2730
2731@smallexample
2732@group
2733[[PGP Signed Part:Bill Wohler <wohler@@stop.mail-abuse.org>]]
2734This is a signed message.
2735
2736[[End of PGP Signed Part]]
2737@end group
2738@end smallexample
2739
2740@cindex keychain
2741@cindex key server
2742@cindex signed messages
2743
2744If the key for the given signature is not in your keychain, you'll be
2745given the opportunity to fetch the key from a key server and verify
2746the key. If the message is really large, the verification process can
2747take a long time. You can press @kbd{C-g} at any time to
2748cancel@footnote{Unfortunately in the current version, the validation
2749process doesn't display a message so it appears that MH-E has hung. We
2750hope that this will be fixed in the future.}.
2751
2752If the signature doesn't check out, you might see something like this:
2753
2754@smallexample
2755@group
2756[[PGP Signed Part:Failed]]
2757This is a signed message.
2758This is garbage added after the signature was made.
2759
2760[[End of PGP Signed Part]]
2761@end group
2762@end smallexample
2763
2764@cindex decrypting messages
2765
2766If someone sends you an encrypted message, MH-E will ask for your
2767passphrase to decrypt the message. You should see something like this:
2768
2769@smallexample
2770@group
2771[[PGP Encrypted Part:OK]]
2772
2773[[PGP Signed Part:Bill Wohler <wohler@@stop.mail-abuse.org>]]
2774This is the secret message.
2775
2776[[End of PGP Signed Part]]
2777
2778[[End of PGP Encrypted Part]]
2779@end group
2780@end smallexample
2781
2782If there is a problem decrypting the message, the button will say:
2783
2784@smallexample
2785[[PGP Encrypted Part:Failed]]
2786@end smallexample
2787
2788You can read the contents of this button using the methods described in
2789@ref{Viewing Attachments}. If the message were corrupted, you'd see
2790this:
2791
2792@smallexample
2793[[PGP Encrypted Part:Failed]
2794Invalid base64 data]
2795@end smallexample
2796
2797If your passphrase were incorrect, you'd see something like this:
2798
2799@smallexample
2800[GNUPG:] ENC_TO CD9C88BB610BD9AD 1 0
2801[GNUPG:] USERID_HINT CD9C88BB610BD9AD Bill Wohler <wohler@@stop.mail-abuse.org>
2802[GNUPG:] NEED_PASSPHRASE CD9C88BB610BD9AD CD9C88BB610BD9AD 1 0
2803[GNUPG:] BAD_PASSPHRASE CD9C88BB610BD9AD
2804gpg: encrypted with 1024-bit RSA key, ID 610BD9AD, created 1997-09-09
2805 "Bill Wohler <wohler@@stop.mail-abuse.org>"
2806gpg: public key decryption failed: bad passphrase
2807[GNUPG:] BEGIN_DECRYPTION
2808[GNUPG:] DECRYPTION_FAILED
2809gpg: decryption failed: secret key not available
2810[GNUPG:] END_DECRYPTION
2811
2812gpg exited abnormally: '2'
2813@end smallexample
2814
2815@vindex mh-show-pgg-bad
2816@vindex mh-show-pgg-good
2817@vindex mh-show-pgg-unknown
2818
2819The appearance of the buttons is controlled by the faces
2820@code{mh-show-pgg-good}, @code{mh-show-pgg-bad}, and
2821@code{mh-show-pgg-unknown} depending on the validity of the signature.
2822The latter is used whether the signature is unknown or untrusted.
2823
2824@cindex @samp{pgg} customization group
2825@cindex PGG
2826@cindex customization group, @samp{pgg}
2827
2828The @samp{pgg} customization group may have some settings which may
2829interest you.
2830@iftex
2831See @cite{The PGG Manual}.
2832@end iftex
2833@ifinfo
2834@xref{Top, , The PGG Manual, pgg, The PGG Manual}.
2835@end ifinfo
2836@ifhtml
2837See
5154917e 2838@uref{http://www.gnu.org/software/emacs/manual/pgg.html,
4009494e
GM
2839@cite{The PGG Manual}}.
2840@end ifhtml
2841
2842@node Printing, Files and Pipes, Reading PGP, Reading Mail
2843@section Printing Your Mail
2844
2845@cindex printing
2846@findex mh-ps-print-msg
2847@findex mh-ps-print-msg-file
2848@kindex P f
2849@kindex P p
2850@vindex mh-lpr-command-format
2851@vindex mh-print-background-flag
2852
2853To print messages in MH-E, use the command @kbd{P p}
2854(@code{mh-ps-print-msg}). You can print all the messages in a range
2855(as in @kbd{C-u P p 1 3 5-7 last:5 frombob @key{RET}},
2856@pxref{Ranges}). You can also send the output to a file with @kbd{P f}
2857(@code{mh-ps-print-msg-file}). This command will print inline text
2858attachments but will not decrypt messages. However, when a message is
2859displayed in an MH-Show buffer, then that buffer is used verbatim for
2860printing with the caveat that only text attachments, if opened inline,
2861are printed. Therefore, encrypted messages can be printed by showing
2862and decrypting them first. The commands @kbd{P p} and @kbd{P f} do not
2863use the options @code{mh-lpr-command-format} or
2864@code{mh-print-background-flag}, described below.
2865
2866@findex mh-ps-print-toggle-color
2867@kindex P C
2868@vindex ps-print-color-p
2869
2870Colors are emulated on black-and-white printers with shades of gray.
2871This might produce illegible output, even if your screen colors only
2872use shades of gray. If this is the case, try using the command @kbd{P
2873C} (@code{mh-ps-print-toggle-color}) to toggle between color, no
2874color, and a black and white representation of the colors and see
2875which works best. You change this setting permanently by customizing
2876the option @code{ps-print-color-p}.
2877
2878@findex mh-ps-print-toggle-faces
2879@kindex P F
2880
2881Another related function is the command @kbd{P F}
2882(@code{mh-ps-print-toggle-faces}). This command toggles between using
2883faces and not. When faces are enabled, the printed message will look
2884very similar to the message in the MH-Show buffer.
2885
2886@cindex ps-print package
2887@cindex Emacs, packages, ps-print
2888
2889MH-E uses the @samp{ps-print} package to do the printing, so you can
2890customize the printing further by going to the @samp{ps-print}
2891customization group.
2892
2893@cindex @command{lpr}
2894@cindex @command{mhl}
2895@cindex MH commands, @command{mhl}
2896@cindex Unix commands, @command{lpr}
2897@findex mh-print-msg
2898@kindex P l
2899
2900An alternative to using the @samp{ps-print} package is the command
2901@kbd{P l} (@code{mh-print-msg}) (the @i{l} is for @i{l}ine printer or
2902@i{l}pr). You can print all the messages in a range. The message is
2903formatted with @command{mhl}@footnote{See the section
2904@uref{@value{MH-BOOK-HOME}/shomes.html#Usisho, Using mhl} in the MH
2905book.} and printed with the @command{lpr} command.
2906
2907@kindex P f
2908@kindex P l
2909@kindex P p
2910@vindex mh-lpr-command-format
2911@vindex mh-print-background-flag
2912
2913The command @kbd{P l} uses two options. The option
2914@code{mh-lpr-command-format} contains the Unix command line which
2915performs the actual printing. The string can contain one escape,
2916@samp{%s}, which is replaced by the name of the folder and the message
2917number and is useful for print job names. The default setting is
2918@code{"lpr -J '%s'"}. I use @code{"mpage -h'%s' -b Letter -H1of -mlrtb
2919-P"} which produces a nice header and adds a bit of margin so the text
2920fits within my printer's margins. Normally messages are printed in the
2921foreground. If this is slow on your system, you may elect to turn on
2922the option @code{mh-print-background-flag} to print in the background.
2923If you do this, do not delete the message until it is printed or else
2924the output may be truncated. These options are not used by the
2925commands @kbd{P p} or @kbd{P f}.
2926
2927@node Files and Pipes, Navigating, Printing, Reading Mail
2928@section Files and Pipes
2929
2930@cindex files
2931@cindex pipes
2932@findex mh-refile-or-write-again
2933@findex mh-write-msg-to-file
2934@kindex >
2935@kindex !
2936
2937MH-E does offer a couple of commands that are not a part of MH@. The
2938first one, @kbd{>} (@code{mh-write-msg-to-file}), writes a message to
2939a file. You are prompted for the filename. If the file already exists,
2940the message is appended to it. You can also write the message to the
2941file without the header by specifying a prefix argument (such as
2942@kbd{C-u > /tmp/foobar @key{RET}}). Subsequent writes to the same file
2943can be made with the command @kbd{!}
2944(@code{mh-refile-or-write-again}).
2945
2946@findex mh-pipe-msg
2947@kindex |
2948@kindex l
2949
2950You can also pipe the message through a Unix shell command with the
2951command @kbd{|} (@code{mh-pipe-msg}). You are prompted for the Unix
2952command through which you wish to run your message. If you give a
2953prefix argument to this command, the message header is included in the
2954text passed to the command (the contrived example @kbd{C-u | lpr}
2955would be done with the @kbd{l} command instead).
2956
2957@cindex @command{shar}
2958@cindex @command{uuencode}
2959@cindex Unix commands, @command{shar}
2960@cindex Unix commands, @command{uuencode}
2961@findex mh-store-msg
2962@kindex X s
2963@vindex mh-store-default-directory
2964
2965If the message is a shell archive @command{shar} or has been run
2966through @command{uuencode} use @kbd{X s} (@code{mh-store-msg}) to
2967extract the body of the message. The default directory for extraction
2968is the current directory; however, you have a chance to specify a
2969different extraction directory. The next time you use this command,
2970the default directory is the last directory you used. If you would
2971like to change the initial default directory, customize the option
2972@code{mh-store-default-directory}, change the value from
2973@samp{Current} to @samp{Directory}, and then enter the name of the
2974directory for storing the content of these messages.
2975
2976@findex mh-store-buffer
2977@kindex @key{RET}
2978@kindex X s
2979
2980By the way, @kbd{X s} calls the Emacs Lisp function
2981@code{mh-store-buffer}. I mention this because you can use it directly
2982if you're editing a buffer that contains a file that has been run
2983through @command{uuencode} or @command{shar}. For example, you can
2984extract the contents of the current buffer in your home directory by
2985typing @kbd{M-x mh-store-buffer @key{RET} ~ @key{RET}}.
2986
2987@node Navigating, Miscellaneous Commands and Options, Files and Pipes, Reading Mail
2988@section Navigating
2989
2990@cindex moving between messages
2991@cindex navigation
2992@findex mh-first-msg
2993@findex mh-goto-msg
2994@findex mh-last-msg
2995@findex mh-next-undeleted-msg
2996@findex mh-next-unread-msg
2997@findex mh-previous-undeleted-msg
2998@findex mh-previous-unread-msg
2999@kindex g
3000@kindex M-<
3001@kindex M->
3002@kindex M-n
3003@kindex M-p
3004@kindex n
3005@kindex p
3006
3007To move on to the next message, use the command @kbd{n}
3008(@code{mh-next-undeleted-msg}); use @kbd{p}
3009(@code{mh-previous-undeleted-msg}) to read the previous message. To
3010move to the next unread message, use @kbd{M-n}
3011(@code{mh-next-unread-msg}); use @kbd{M-p}
3012(@code{mh-previous-unread-msg}) to move to the previous unread
3013message. These commands can be given a prefix argument to specify how
3014many messages to skip (for example, @kbd{5 n}). You can also move to a
3015specific message with @kbd{g} (@code{mh-goto-msg}). You can enter the
3016message number either before or after typing @kbd{g}. In the latter
3017case, Emacs prompts you. Finally, you can go to the first or last
3018message with @kbd{M-<} (@code{mh-first-msg}) and @kbd{M->}
3019(@code{mh-last-msg}) respectively.
3020
3021@cindex MH-Folder mode
3022@cindex modes, MH-Folder
3023@findex next-line
3024@findex previous-line
3025@kindex C-n
3026@kindex C-p
3027@kindex @key{RET}
3028
3029You can also use the Emacs commands @kbd{C-p} (@code{previous-line})
3030and @kbd{C-n} (@code{next-line}) to move up and down the scan lines in
3031the MH-Folder window. These commands can be used in conjunction with
3032@key{RET} to look at deleted or refiled messages.
3033
3034@cindex deleting messages
3035@findex mh-delete-msg
3036@kindex d
3037@kindex n
3038@kindex p
3039
3040To mark a message for deletion, use the command @kbd{d}
3041(@code{mh-delete-msg}). A @samp{D} is placed by the message in the
3042scan window, and the next undeleted message is displayed. If the
3043previous command had been @kbd{p}, then the next message displayed is
3044the first undeleted message previous to the message just deleted. Use
3045@kbd{n} to force subsequent @kbd{d} commands to move forward to the
3046next undeleted message after deleting the message under the cursor.
3047You may also specify a range (for example, @kbd{C-u d 1 3 5-7 last:5
3048frombob @key{RET}}, @pxref{Ranges}).
3049
3050@findex mh-delete-msg-no-motion
3051@kindex C-d
3052
3053The command @kbd{C-d} (@code{mh-delete-msg-no-motion}) marks the
3054message (or messages in range) for deletion but leaves the cursor at
3055the current message in case you wish to perform other operations on
3056the message.
3057
3058@findex mh-delete-subject
3059@findex mh-delete-subject-or-thread
3060@findex mh-thread-delete
3061@findex mh-undo
3062@kindex k
3063@kindex T d
3064@kindex u
3065
3066And to delete more messages faster, you can use @kbd{k}
3067(@code{mh-delete-subject-or-thread}) to delete all the messages with
3068the same subject as the current message. This command puts these
3069messages in a sequence named @samp{subject}. You can undo this action
3070by using @kbd{u} (@code{mh-undo}) with a prefix argument and then
3071specifying the @samp{subject} sequence. However, if the buffer is
3072displaying a threaded view of the folder then @kbd{k} behaves like
3073@kbd{T d} (@code{mh-thread-delete}). @xref{Threading}.
3074
3075@findex mh-execute-commands
3076@kindex x
3077
3078However you mark a message for deletion, the command @kbd{x}
3079(@code{mh-execute-commands}) actually carries out the deletion
3080(@pxref{Folders}).
3081
3082@vindex mh-delete-msg-hook
3083
3084The hook @code{mh-delete-msg-hook} is called after you mark a message
3085for deletion. For example, a past maintainer of MH-E used this once
3086when he kept statistics on his mail usage.
3087
3088@node Miscellaneous Commands and Options, , Navigating, Reading Mail
3089@section Miscellaneous Commands and Options
3090
3091This section contains a few more miscellaneous commands and options.
3092
3093@cindex editing message
3094@findex mh-modify
3095@kindex M
3096
3097There are times when you need to edit a message. For example, you may
3098need to fix a broken Content-Type header field. You can do this with
3099the command @kbd{M} (@code{mh-modify}). It displays the raw message in
3100an editable buffer. When you are done editing, save and kill the
3101buffer as you would any other.
3102
3103@findex mh-kill-folder
3104@findex mh-pack-folder
3105@vindex mh-do-not-confirm-flag
3106
3107Commands such as @code{mh-pack-folder} prompt to confirm whether to
3108process outstanding moves and deletes or not before continuing.
3109Turning on the option @code{mh-do-not-confirm-flag} means that these
3110actions will be performed---which is usually desired but cannot be
3111retracted---without question@footnote{In previous versions of MH-E,
3112this option suppressed the confirmation in @code{mh-kill-folder}.
3113Since this kept most users from setting this option,
3114@code{mh-kill-folder} was modified in version 6.0 to always ask for
3115confirmation subject to @code{mh-kill-folder-suppress-prompt-hook}.
3116@xref{Folders}.}.
3117
3118@cindex MH-Folder mode
3119@cindex modes, MH-Folder
3120@vindex mh-summary-height
3121
3122The option @code{mh-summary-height} controls the number of scan lines
3123displayed in the MH-Folder window, including the mode line. The
3124default value of this option is @samp{Automatic} which means that the
3125MH-Folder buffer will maintain the same proportional size if the frame
3126is resized. If you'd prefer a fixed height, then choose the
3127@samp{Fixed Size} option and enter the number of lines you'd like to
3128see.
3129
3130@vindex mh-bury-show-buffer-flag
3131
3132Normally the buffer for displaying messages is buried at the bottom at
3133the buffer stack. You may wish to disable this feature by turning off
3134the option @code{mh-bury-show-buffer-flag}. One advantage of not
3135burying the show buffer is that one can delete the show buffer more
3136easily in an electric buffer list because of its proximity to its
3137associated MH-Folder buffer. Try running @kbd{M-x
3138electric-buffer-list} to see what I mean.
3139
3140@cindex @file{.emacs}
3141@cindex files, @file{.emacs}
3142@cindex reading mail
3143
3144Before we leave this section, I'll include a function that I use as a
3145front end to MH-E@footnote{Stephen Gildea's favorite binding is
3146@kbd{(global-set-key "\C-cr" 'mh-rmail)}.}. It toggles between your
3147working window configuration, which may be quite involved---windows
3148filled with source, compilation output, man pages, and other
3149documentation---and your MH-E window configuration. Like the rest of
3150the customization described in this section, simply add the following
3151code to @file{~/.emacs}.
3152
3153@iftex
3154@filbreak
3155@end iftex
3156
3157@findex mh-rmail, example
3158
3159@smalllisp
3160@group
3161(defvar my-mh-screen-saved nil
3162 "Set to non-@code{nil} when MH-E window configuration shown.")
3163(defvar my-normal-screen nil "Normal window configuration.")
3164(defvar my-mh-screen nil "MH-E window configuration.")
3165
3166(defun my-mh-rmail (&optional arg)
3167 "Toggle between MH-E and normal screen configurations.
3168With non-@code{nil} or prefix argument, @i{inc} mailbox as well
3169when going into mail."
3170 (interactive "P") ; @r{user callable function, P=prefix arg}
3171 (setq my-mh-screen-saved ; @r{save state}
3172 (cond
3173 ;; @r{Bring up MH-E screen if arg or normal window configuration.}
3174 ;; @r{If arg or +inbox buffer doesn't exist, run mh-rmail.}
3175 ((or arg (null my-mh-screen-saved))
3176 (setq my-normal-screen (current-window-configuration))
3177 (if (or arg (null (get-buffer "+inbox")))
3178 (mh-rmail)
3179 (set-window-configuration my-mh-screen))
3180 t) ; @r{set my-mh-screen-saved to @code{t}}
3181 ;; @r{Otherwise, save MH-E screen and restore normal screen.}
3182 (t
3183 (setq my-mh-screen (current-window-configuration))
3184 (set-window-configuration my-normal-screen)
3185 nil)))) ; @r{set my-mh-screen-saved to nil}
3186
3187(global-set-key "\C-x\r" 'my-mh-rmail) ;@r{ call with C-x @key{RET}}
3188
3189@i{Starting MH-E}
3190
3191@end group
3192@end smalllisp
3193
3194If you type an argument (@kbd{C-u}) or if @code{my-mh-screen-saved} is
3195@code{nil} (meaning a non-MH-E window configuration), the current
3196window configuration is saved, either the @samp{+inbox} buffer is
3197displayed or @code{mh-rmail} is run, and the MH-E window configuration
3198is shown. Otherwise, the MH-E window configuration is saved and the
3199original configuration is displayed.
3200
3201@node Folders, Sending Mail, Reading Mail, Top
3202@chapter Organizing Your Mail with Folders
3203
3204@cindex @samp{Folder} menu
3205@cindex @samp{Message} menu
3206@cindex folders
3207@cindex menu, @samp{Folder}
3208@cindex menu, @samp{Message}
3209@cindex using folders
3210
1df7defd 3211This chapter discusses the things you can do with folders within MH-E@.
4009494e
GM
3212The commands in this chapter are also found in the @samp{Folder} and
3213@samp{Message} menus.
3214
3215@table @kbd
3216@kindex ?
3217@findex mh-help
3218@item ?
3219Display cheat sheet for the MH-E commands (@code{mh-help}).
3220@c -------------------------
3221@kindex !
3222@findex mh-refile-or-write-again
3223@item !
3224Repeat last output command (@code{mh-refile-or-write-again}).
3225@c -------------------------
3226@cindex @samp{Message > Copy Message to Folder...} menu item
3227@cindex menu item, @samp{Message > Copy Message to Folder...}
3228@kindex c
3229@findex mh-copy-msg
3230@item c
3231Copy range to folder (@code{mh-copy-msg}).
3232@c -------------------------
3233@kindex F ?
3234@findex mh-prefix-help
3235@item F ?
3236Display cheat sheet for the commands of the current prefix in
3237minibuffer (@code{mh-prefix-help}).
3238@c -------------------------
3239@kindex F '
3240@findex mh-index-ticked-messages
3241@item F '
3242Display ticked messages (@code{mh-index-ticked-messages}).
3243@c -------------------------
3244@kindex F c
3245@findex mh-catchup
3246@item F c
3247Delete range from the @samp{unseen} sequence (@code{mh-catchup}).
3248@c -------------------------
3249@kindex F k
3250@findex mh-kill-folder
3251@item F k
3252Remove folder (@code{mh-kill-folder}).
3253@c -------------------------
3254@cindex @samp{Folder > List Folders} menu item
3255@cindex menu item, @samp{Folder > List Folders}
3256@kindex F l
3257@findex mh-list-folders
3258@item F l
3259List all folders (@code{mh-list-folders}).
3260@c -------------------------
3261@cindex @samp{Folder > View New Messages} menu item
3262@cindex menu item, @samp{Folder > View New Messages}
3263@kindex F n
3264@findex mh-index-new-messages
3265@item F n
3266Display unseen messages (@code{mh-index-new-messages}).
3267@c -------------------------
3268@cindex @samp{Folder > Pack Folder} menu item
3269@cindex menu item, @samp{Folder > Pack Folder}
3270@kindex F p
3271@findex mh-pack-folder
3272@item F p
3273Pack folder (@code{mh-pack-folder}).
3274@c -------------------------
3275@kindex F q
3276@findex mh-index-sequenced-messages
3277@item F q
3278Display messages in any sequence (@code{mh-index-sequenced-messages}).
3279@c -------------------------
3280@cindex @samp{Folder > Rescan Folder} menu item
3281@cindex menu item, @samp{Folder > Rescan Folder}
3282@kindex F r
3283@findex mh-rescan-folder
3284@item F r
3285Rescan folder (@code{mh-rescan-folder}).
3286@c -------------------------
3287@cindex @samp{Folder > Search...} menu item
3288@cindex menu item, @samp{Folder > Search...}
3289@kindex F s
3290@findex mh-search
3291@item F s
3292Search your MH mail (@code{mh-search}).
3293@c -------------------------
3294@cindex @samp{Folder > Sort Folder} menu item
3295@cindex menu item, @samp{Folder > Sort Folder}
3296@kindex F S
3297@findex mh-sort-folder
3298@item F S
3299Sort folder (@code{mh-sort-folder}).
3300@c -------------------------
3301@kindex F u
3302@findex mh-undo-folder
3303@item F u
3304Undo all refiles and deletes in the current folder (@code{mh-undo-folder}).
3305@c -------------------------
3306@cindex @samp{Folder > Visit a Folder...} menu item
3307@cindex menu item, @samp{Folder > Visit a Folder...}
3308@kindex F v
3309@findex mh-visit-folder
3310@item F v
3311Visit folder (@code{mh-visit-folder}).
3312@c -------------------------
3313@cindex @samp{Message > Refile Message} menu item
3314@cindex menu item, @samp{Message > Refile Message}
3315@kindex o
3316@findex mh-refile-msg
3317@item o
3318Refile (output) range into folder (@code{mh-refile-msg}).
3319@c -------------------------
3320@cindex @samp{Folder > Quit MH-E} menu item
3321@cindex menu item, @samp{Folder > Quit MH-E}
3322@kindex q
3323@findex mh-quit
3324@item q
3325Quit the current MH-E folder (@code{mh-quit}).
3326@c -------------------------
3327@cindex @samp{Folder > Toggle Show/Folder} menu item
3328@cindex menu item, @samp{Folder > Toggle Show/Folder}
3329@kindex t
3330@findex mh-toggle-showing
3331@item t
3332Toggle between MH-Folder and MH-Folder Show modes
3333(@code{mh-toggle-showing}).
3334@c -------------------------
3335@cindex @samp{Message > Undo Delete/Refile} menu item
3336@cindex menu item, @samp{Message > Undo Delete/Refile}
3337@kindex u
3338@findex mh-undo
3339@item u
3340Undo pending deletes or refiles in range (@code{mh-undo}).
3341@c -------------------------
3342@cindex @samp{Message > Execute Delete/Refile} menu item
3343@cindex menu item, @samp{Message > Execute Delete/Refile}
3344@kindex x
3345@findex mh-execute-commands
3346@item x
3347Process outstanding delete and refile requests
3348(@code{mh-execute-commands}).
3349@end table
3350
3351@cindex @samp{mh-folder} customization group
3352@cindex customization group, @samp{mh-folder}
3353
3354The @samp{mh-folder} customization group is used to tune these
3355commands.
3356
3357@vtable @code
3358@item mh-new-messages-folders
3359Folders searched for the @samp{unseen} sequence (default:
3360@code{Inbox}).
3361@c -------------------------
3362@item mh-ticked-messages-folders
3363Folders searched for @code{mh-tick-seq} (default: @code{t}).
3364@c -------------------------
3365@item mh-large-folder
3366The number of messages that indicates a large folder (default: 200).
3367@c -------------------------
3368@item mh-recenter-summary-flag
3369On means to recenter the summary window (default: @samp{off}).
3370@c -------------------------
3371@item mh-recursive-folders-flag
3372On means that commands which operate on folders do so recursively
3373(default: @samp{off}).
3374@c -------------------------
3375@item mh-sortm-args
3376Additional arguments for @command{sortm} (default: @code{nil}).
3377@end vtable
3378
3379The following hooks are available.
3380
3381@vtable @code
3382@item mh-after-commands-processed-hook
3383Hook run by @kbd{x} after performing outstanding refile and delete
3384requests (default: @code{nil}).
3385@c -------------------------
3386@item mh-before-commands-processed-hook
3387Hook run by @kbd{x} before performing outstanding refile and delete
3388requests (default: @code{nil}).
3389@c -------------------------
3390@item mh-before-quit-hook
3391Hook run by q before quitting MH-E (default: @code{nil}).
3392@c -------------------------
3393@item mh-folder-mode-hook
3394Hook run by @code{mh-folder-mode} when visiting a new folder (default:
3395@code{nil}).
3396@c -------------------------
3397@item mh-kill-folder-suppress-prompt-hook
3398Abnormal hook run at the beginning of @code{mh-kill-folder} (default:
3399@code{'mh-search-p}).
3400@c -------------------------
2a1cf2b9
BW
3401@item mh-pack-folder-hook
3402Hook run by @code{mh-pack-folder} after renumbering the messages
3403(default: @code{nil}).
3404@c -------------------------
4009494e
GM
3405@item mh-quit-hook
3406Hook run by q after quitting MH-E (default: @code{nil}).
3407@c -------------------------
3408@item mh-refile-msg-hook
3409Hook run by o after marking each message for refiling (default:
3410@code{nil}).
3411@end vtable
3412
3413The following faces are available for customizing the appearance of
3414the MH-Folder buffer. @xref{Scan Line Formats}.
3415
3416@vtable @code
3417@item mh-folder-address
3418Recipient face.
3419@c -------------------------
3420@item mh-folder-body
3421Body text face.
3422@c -------------------------
3423@item mh-folder-cur-msg-number
3424Current message number face.
3425@c -------------------------
3426@item mh-folder-date
3427Date face.
3428@c -------------------------
3429@item mh-folder-deleted
3430Deleted message face.
3431@c -------------------------
3432@item mh-folder-followup
3433@samp{Re:} face.
3434@c -------------------------
3435@item mh-folder-msg-number
3436Message number face.
3437@c -------------------------
3438@item mh-folder-refiled
3439Refiled message face.
3440@c -------------------------
3441@vindex mh-scan-format-nmh
3442@vindex mh-scan-sent-to-me-sender-regexp
3443@item mh-folder-sent-to-me-hint
3444Fontification hint face in messages sent directly to us. The detection
3445of messages sent to us is governed by the scan format
3446@code{mh-scan-format-nmh} and regular expression
3447@code{mh-scan-sent-to-me-sender-regexp}.
3448@c -------------------------
3449@vindex mh-scan-format-nmh
3450@vindex mh-scan-sent-to-me-sender-regexp
3451@item mh-folder-scan-format
3452Sender face in messages sent directly to us. The detection of messages
3453sent to us is governed by the scan format @code{mh-scan-format-nmh}
3454and regular expression @code{mh-scan-sent-to-me-sender-regexp}.
3455@c -------------------------
3456@item mh-folder-subject
3457Subject face.
3458@c -------------------------
3459@item mh-folder-tick
3460Ticked message face.
3461@c -------------------------
3462@item mh-folder-to
3463@samp{To:} face.
3464@end vtable
3465
3466@vindex mh-folder-mode-hook
3467
3468The hook @code{mh-folder-mode-hook} is called when visiting a new
3469folder in MH-Folder mode. This could be used to set your own key
3470bindings, for example:
3471
3472@vindex mh-folder-mode-hook, example
3473
3474@smalllisp
3475@group
3476(defvar my-mh-init-done nil
3477 "Non-@code{nil} when one-time MH-E settings made.")
3478
3479(defun my-mh-folder-mode-hook ()
3480 "Hook to set key bindings in MH-Folder mode."
3481 (if (not my-mh-init-done) ; @r{only need to bind the keys once }
3482 (progn
3483 (local-set-key "//" 'my-search-msg)
3484 (local-set-key "b" 'mh-burst-digest) ; @r{better use of @kbd{b}}
3485 (setq my-mh-init-done t))))
3486
3487(add-hook 'mh-folder-mode-hook 'my-mh-folder-mode-hook)
3488
3489(defun my-search-msg ()
3490 "Search for a regexp in the current message."
3491 (interactive) ; @r{user function}
3492 (save-window-excursion
3493 (other-window 1) ; @r{go to next window}
3494 (isearch-forward-regexp))) ; @r{string search; hit return}
3495 ; @r{ when done}
3496
3497@i{Create additional key bindings via mh-folder-mode-hook}
3498
3499@end group
3500@end smalllisp
3501
3502@cindex @command{folder}
3503@cindex @command{refile}
3504@cindex MH commands, @command{folder}
3505@cindex MH commands, @command{refile}
3506@findex mh-refile-msg
3507@kindex o
3508@vindex mh-refile-msg-hook
3509
3510MH-E has analogies for each of the MH @command{folder} and
3511@command{refile} commands@footnote{See the sections
3512@uref{@value{MH-BOOK-HOME}/fol.html#Youfol, Your Current Folder:
3513folder} and @uref{@value{MH-BOOK-HOME}/fol.html#Movref, Moving and
3514Linking Messages: refile} in the MH book.}. To refile a message in
3515another folder, use the command @kbd{o} (@code{mh-refile-msg})
3516(mnemonic: ``output''). You are prompted for the folder name
3517(@pxref{Folder Selection}). Note that this command can also be used to
3518create folders. If you specify a folder that does not exist, you will
3519be prompted to create it. The hook @code{mh-refile-msg-hook} is called
3520after a message is marked to be refiled.
3521
3522@findex mh-write-msg-to-file
3523@kindex !
3524
3525If you are refiling several messages into the same folder, you can use
3526the command @kbd{!} (@code{mh-refile-or-write-again}) to repeat the
3527last refile or write (for the description of @kbd{>}
3528(@code{mh-write-msg-to-file}), @pxref{Files and Pipes}). You can use a
3529range in either case (for example, @kbd{C-u o 1 3 5-7 last:5 frombob
3530@key{RET}}, @pxref{Ranges}).
3531
3532@cindex expunging refiles and deletes
3533@cindex undoing refiles and deletes
3534@findex mh-undo
3535@kindex u
3536
3537If you've deleted a message or refiled it, but changed your mind, you
3538can cancel the action before you've executed it. Use @kbd{u}
3539(@code{mh-undo}) to undo a refile on or deletion of a single message.
3540You can also undo refiles and deletes for messages that are found in a
3541given range (@pxref{Ranges}).
3542
3543@findex mh-undo-folder
3544@kindex F u
3545
3546Alternatively, you can use @kbd{F u} (@code{mh-undo-folder}) to undo
3547all refiles and deletes in the current folder.
3548
3549@findex mh-execute-commands
3550@kindex x
3551
3552If you've marked messages to be deleted or refiled and you want to go
3553ahead and delete or refile the messages, use @kbd{x}
3554(@code{mh-execute-commands}). Many MH-E commands that may affect the
3555numbering of the messages (such as @kbd{F r} or @kbd{F p}) will ask if
3556you want to process refiles or deletes first and then either run
3557@kbd{x} for you or undo the pending refiles and deletes.
3558
3559@kindex x
3560@vindex mh-after-commands-processed-hook
3561@vindex mh-before-commands-processed-hook
bfe16263 3562@vindex mh-current-folder
4009494e
GM
3563
3564The command @kbd{x} runs @code{mh-before-commands-processed-hook}
3565before the commands are processed and
3566@code{mh-after-commands-processed-hook} after the commands are
3567processed. Variables that are useful with the former hook include
3568@code{mh-delete-list} and @code{mh-refile-list} which can be used to
3569see which changes will be made to the current folder,
3570@code{mh-current-folder}. Variables that are useful with the latter
3571hook include @code{mh-folders-changed}, which lists which folders were
3572affected by deletes and refiles. This list will always include the
3573current folder @code{mh-current-folder}.
3574
3575@findex mh-copy-msg
3576@kindex c
3577@kindex o
3578
3579If you wish to copy a message to another folder, you can use the
3580command @kbd{c} (@code{mh-copy-msg}) (see the @option{-link} argument
3581to @command{refile}(1)). Like the command @kbd{o}, this command
3582prompts you for the name of the target folder and you can specify a
3583range (@pxref{Ranges}). Note that unlike the command @kbd{o}, the copy
3584takes place immediately. The original copy remains in the current
3585folder.
3586
3587@cindex junk mail
3588@cindex MH-Folder mode
3589@cindex MH-Folder Show mode
3590@cindex modes, MH-Folder
3591@cindex modes, MH-Folder Show
3592@cindex spam
3593@findex mh-toggle-showing
3594@kindex t
3595
3596The command @kbd{t} (@code{mh-toggle-showing}) switches between
3597MH-Folder mode and MH-Folder Show mode@footnote{For you Emacs wizards,
3598this is implemented as an Emacs minor mode.}. MH-Folder mode turns off
3599the associated show buffer so that you can perform operations on the
3600messages quickly without reading them. This is an excellent way to
3601prune out your junk mail or to refile a group of messages to another
3602folder for later examination.
3603
3604@cindex MH-Folder mode
3605@cindex MH-Show mode
3606@cindex modes, MH-Folder
3607@cindex modes, MH-Show
3608@cindex moving between messages
3609@kindex t
3610@vindex mh-recenter-summary-flag
3611
3612When you use @kbd{t} to toggle from MH-Folder Show mode to MH-Folder
3613mode, the MH-Show buffer is hidden and the MH-Folder buffer is left
3614alone. Setting @code{mh-recenter-summary-flag} to a non-@code{nil}
3615value causes the toggle to display as many scan lines as possible,
3616with the cursor at the middle. The effect of
3617@code{mh-recenter-summary-flag} is rather useful, but it can be
3618annoying on a slow network connection.
3619
3620@findex mh-visit-folder
3621@kindex F v
3622@vindex mh-large-folder
3623
3624When you want to read the messages that you have refiled into folders,
3625use the command @kbd{F v} (@code{mh-visit-folder}) to visit the
3626folder. You are prompted for the folder name. The folder buffer will
3627show just unseen messages if there are any; otherwise, it will show
3628all the messages in the buffer as long there are fewer than
3629@code{mh-large-folder} messages. If there are more, then you are
3630prompted for a range of messages to scan. You can provide a prefix
3631argument in order to specify a range of messages to show when you
3632visit the folder (@pxref{Ranges}). In this case, regions are not used
3633to specify the range and @code{mh-large-folder} is ignored. Note that
3634this command can also be used to create folders. If you specify a
3635folder that does not exist, you will be prompted to create it.
3636
3637@findex mh-search
3638@kindex F s
3639
3640If you forget where you've refiled your messages, you can find them
3641using @kbd{F s} (@code{mh-search}). @xref{Searching}.
3642
3643@cindex @command{procmail}
3644@cindex @samp{unseen} sequence
3645@cindex sequence, @samp{unseen}
3646@cindex Unix commands, @command{procmail}
3647@cindex unseen messages, viewing
3648@findex mh-index-new-messages
3649@kindex F n
3650@vindex mh-new-messages-folders
3651
3652If you use a program such as @command{procmail} to file your incoming
3653mail automatically, you can display new, unseen, messages using the
3654command @kbd{F n} (@code{mh-index-new-messages}). All messages in the
3655@samp{unseen} sequence from the folders in
3656@code{mh-new-messages-folders} are listed. However, this list of
3657folders can be overridden with a prefix argument: with a prefix
3658argument, enter a space-separated list of folders, or nothing to
3659search all folders.
3660
3661@cindex @samp{tick} sequence
3662@cindex sequence, @samp{tick}
3663@cindex ticked messages, viewing
3664@findex mh-index-ticked-messages
3665@kindex F '
3666@vindex mh-ticked-messages-folders
3667
3668If you have ticked messages (@pxref{Sequences}), you can display them
3669using the command @kbd{F '} (@code{mh-index-ticked-messages}). All
3670messages in the @samp{tick} sequence from the folders in
3671@code{mh-ticked-messages-folders} are listed. With a prefix argument,
3672enter a space-separated list of folders, or nothing to search all
3673folders.
3674
3675@findex mh-index-sequenced-messages
3676@kindex F q
3677@vindex mh-new-messages-folders
3678
3679You can display messages in any sequence with the command @kbd{F q}
3680(@code{mh-index-sequenced-messages}). All messages from the folders in
3681@code{mh-new-messages-folders} in the sequence you provide are listed.
3682With a prefix argument, enter a space-separated list of folders at the
3683prompt, or nothing to search all folders.
3684
3685@vindex mh-new-messages-folders
3686@vindex mh-recursive-folders-flag
3687@vindex mh-ticked-messages-folders
3688
3689Set the options @code{mh-new-messages-folders} and
3690@code{mh-ticked-messages-folders} to @samp{Inbox} to search the
3691@samp{+inbox} folder or @samp{All} to search all of the top level
3692folders. Otherwise, list the folders that should be searched with the
3693@samp{Choose Folders} menu item. See @code{mh-recursive-folders-flag}.
3694
3695@cindex buffers, @samp{*MH-E Folders*}
3696@cindex @samp{*MH-E Folders*}
3697@findex mh-kill-folder
3698@findex mh-list-folders
3699@findex mh-pack-folder
3700@findex mh-rescan-folder
3701@findex mh-sort-folder
3702@kindex F k
3703@kindex F l
3704@kindex F p
3705@kindex F r
3706@kindex F S
3707
3708Other commands you can perform on folders include: @kbd{F l}
3709(@code{mh-list-folders}), to place a listing of all the folders in
3710your mail directory in a buffer called @samp{*MH-E Folders*}
3711(@pxref{Miscellaneous}); @kbd{F k} (@code{mh-kill-folder}), to remove
3712a folder; @kbd{F S} (@code{mh-sort-folder}), to sort the messages by
3713date (see @command{sortm}(1) to see how to sort by other criteria);
3714@kbd{F p} (@code{mh-pack-folder}), to pack a folder, removing gaps
3715from the numbering sequence; and @kbd{F r} (@code{mh-rescan-folder}),
3716to rescan the folder, which is useful to grab all messages in your
3717@samp{+inbox} after processing your new mail for the first time. If
3718you don't want to rescan the entire folder, the commands @kbd{F r} or
3719@kbd{F p} will accept a range (@pxref{Ranges}).
3720
2a1cf2b9
BW
3721@kindex F p
3722@vindex mh-pack-folder-hook
3723
3724The command @kbd{F p} runs @code{mh-pack-folder-hook} after
3725renumbering the messages. A variable that is useful with this hook
3726is @code{mh-current-folder}.
3727
4009494e
GM
3728@kindex @key{TAB}
3729@vindex mh-recursive-folders-flag
3730
3731By default, operations on folders work only one level at a time. Set
3732@code{mh-recursive-folders-flag} to non-@code{nil} to operate on all
3733folders. This mostly means that you'll be able to see all your folders
3734when you press @key{TAB} when prompted for a folder name.
3735
3736@findex mh-search-p
3737@kindex k
d1069532 3738@vindex mh-kill-folder-suppress-prompt-functions
4009494e 3739
d1069532 3740The hook @code{mh-kill-folder-suppress-prompt-functions} is an abnormal
4009494e
GM
3741hook run at the beginning of the command @kbd{k}. The hook functions
3742are called with no arguments and should return a non-nil value to
3743suppress the normal prompt when you remove a folder. This is useful
3744for folders that are easily regenerated. The default value of
3745@code{mh-search-p} suppresses the prompt on folders generated by
3746searching.
3747
3748@sp 1
3749@center @strong{NOTE}
3750
3751@quotation
3752Use this hook with care. If there is a bug in your hook which returns
3753@code{t} on @samp{+inbox} and you press @kbd{k} by accident in the
3754@code{+inbox} folder, you will not be happy.
3755@end quotation
3756@sp 1
3757
3758@cindex @command{sortm}
3759@cindex @file{.mh_profile}
3760@cindex files, @file{.mh_profile}
3761@cindex MH commands, @command{sortm}
36a672f6
GM
3762@cindex MH profile component, @samp{sortm}
3763@cindex @samp{sortm} MH profile component
4009494e
GM
3764@kindex F S
3765@vindex mh-sortm-args
3766
3767The option @code{mh-sortm-args} holds extra arguments to pass on to
3768the command @command{sortm}@footnote{See the section
3769@uref{@value{MH-BOOK-HOME}/sorsor.html, Sorting Messages: sortm} in the
3770MH book.} when a prefix argument is used with @kbd{F S}. Normally
3771default arguments to @command{sortm} are specified in the MH profile.
3772This option may be used to provide an alternate view. For example,
3773@samp{'(\"-nolimit\" \"-textfield\" \"subject\")} is a useful setting.
3774
3775@cindex exiting
3776@cindex quitting
3777@findex mh-quit
3778@kindex q
3779
3780When you want to quit using MH-E and go back to editing, you can use
3781the @kbd{q} (@code{mh-quit}) command. This buries the buffers of the
3782current MH-E folder and restores the buffers that were present when
3783you first ran @kbd{M-x mh-rmail}. It also removes any MH-E working
3784buffers whose name begins with @samp{ *mh-} or @samp{*MH-E }
3785(@pxref{Miscellaneous}). You can later restore your MH-E session by
3786selecting the @samp{+inbox} buffer or by running @kbd{M-x mh-rmail}
3787again.
3788
3789@findex mh-execute-commands
3790@kindex q
3791@vindex mh-before-quit-hook
3792@vindex mh-before-quit-hook, example
3793@vindex mh-quit-hook
3794@vindex mh-quit-hook, example
3795
3796The two hooks @code{mh-before-quit-hook} and @code{mh-quit-hook} are
3797called by @kbd{q}. The former one is called before the quit occurs, so
3798you might use it to perform any MH-E operations; you could perform
3799some query and abort the quit or call @code{mh-execute-commands}, for
3800example. The latter is not run in an MH-E context, so you might use it
3801to modify the window setup. If you find that @kbd{q} buries a lot of
3802buffers that you would rather remove, you can use both
3803@code{mh-before-quit-hook} and @code{mh-quit-hook} to accomplish that.
3804
3805@smalllisp
3806@group
3807(defvar my-mh-folder-buffer-to-delete nil
3808 "Folder buffer that is being quit.")
3809
3810(defun my-mh-before-quit-hook ()
3811 "Save folder buffer that is to be deleted."
3812 (setq my-mh-folder-buffer-to-delete (current-buffer)))
3813
3814(defun my-mh-quit-hook ()
3815 "Kill folder buffer rather than just bury it."
3816 (set-buffer my-mh-folder-buffer-to-delete)
3817 (if (get-buffer mh-show-buffer)
3818 (kill-buffer mh-show-buffer))
3819 (kill-buffer (current-buffer)))
3820
3821@i{Kill MH-Folder buffer instead of burying it}
3822@end group
3823@end smalllisp
3824
3825@cindex folders, renaming
3826@cindex renaming folders
3827@findex dired
3828@findex dired-do-rename
3829
3830You can use dired to manipulate the folders themselves. For example, I
3831renamed my @samp{+out} folder to the more common @samp{+outbox} by
3832running dired on my mail directory (@kbd{M-x dired RET ~/Mail RET}),
3833moving my cursor to @samp{out} and using the command @kbd{R}
3834(@code{dired-do-rename}).
3835
3836@node Sending Mail, Editing Drafts, Folders, Top
3837@chapter Sending Mail
3838
3839@cindex sending mail
3840@findex mh-smail
3841@kindex M-x mh-smail
3842
3843You can send a mail message in several ways. You can call @kbd{M-x
3844mh-smail} directly, or from the command line like this:
3845
3846@cindex starting from command line
3847
3848@smallexample
3849$ @kbd{emacs -f mh-smail}
3850@end smallexample
3851
3852@findex goto-address-at-point
3853@vindex mail-user-agent
3854
3855There are some commands that need to send a mail message, such as
3856@code{goto-address-at-point}. You can configure Emacs to have these
3857commands use MH-E by setting the option @code{mail-user-agent} to
3858@samp{Emacs interface to MH}.
3859
3860@cindex @samp{Message} menu
3861@cindex menu, @samp{Message}
3862
3863From within MH-E's MH-Folder mode, other methods of sending mail are
3864available as well. These can also be found in the @samp{Message} menu.
3865
3866@table @kbd
3867@cindex @samp{Message > Edit Message Again} menu item
3868@cindex menu item, @samp{Message > Edit Message Again}
3869@kindex e
3870@findex mh-edit-again
3871@item e
3872Edit a message to send it again (@code{mh-edit-again}).
3873@c -------------------------
3874@cindex @samp{Message > Re-edit a Bounced Message} menu item
3875@cindex menu item, @samp{Message > Re-edit a Bounced Message}
3876@kindex E
3877@findex mh-extract-rejected-mail
3878@item E
3879Edit a message that was returned by the mail system
3880(@code{mh-extract-rejected-mail}).
3881@c -------------------------
3882@cindex @samp{Message > Forward Message...} menu item
3883@cindex menu item, @samp{Message > Forward Message...}
3884@kindex f
3885@findex mh-forward
3886@item f
3887Forward message (@code{mh-forward}).
3888@c -------------------------
3889@cindex @samp{Message > Reply to Message...} menu item
3890@cindex menu item, @samp{Message > Reply to Message...}
3891@kindex r
3892@findex mh-reply
3893@item r
3894Reply to a message (@code{mh-reply}).
3895@c -------------------------
3896@cindex @samp{Message > Compose a New Message} menu item
3897@cindex menu item, @samp{Message > Compose a New Message}
3898@kindex s
3899@findex mh-send
3900@item s
3901Compose a message (@code{mh-send}).
3902@c -------------------------
3903@cindex @samp{Message > Redistribute Message...} menu item
3904@cindex menu item, @samp{Message > Redistribute Message...}
3905@kindex M-d
3906@findex mh-redistribute
3907@item M-d
3908Redistribute a message (@code{mh-redistribute}).
3909@c -------------------------
3910@findex mh-smail
3911@item M-x mh-smail
3912Compose a message with the MH mail system.
3913@c -------------------------
3914@findex mh-smail-other-window
3915@item M-x mh-smail-other-window
3916Compose a message with the MH mail system in other window.
3917@end table
3918
3919@cindex @samp{mh-sending-mail} customization group
3920@cindex customization group, @samp{mh-sending-mail}
3921
3922In addition, several options from the @samp{mh-sending-mail}
3923customization group are useful when sending mail or replying to mail.
3924They are summarized in the following table.
3925
3926@vtable @code
3927@item mh-compose-forward-as-mime-flag
3928On means that messages are forwarded as attachments (default:
3929@samp{on}).
3930@c -------------------------
3931@item mh-compose-letter-function
3932Hook run when starting a new draft (default: @code{nil}).
3933@c -------------------------
3934@item mh-compose-prompt-flag
3935On means prompt for header fields when composing a new draft (default:
3936@samp{off}).
3937@c -------------------------
3938@item mh-forward-subject-format
3939Format string for forwarded message subject (default: @code{"%s:
3940%s"}).
3941@c -------------------------
3942@item mh-insert-x-mailer-flag
3943On means append an @samp{X-Mailer:} header field to the header
3944(default: @samp{on}).
3945@c -------------------------
3946@item mh-redist-full-contents-flag
3947On means the @command{dist} command needs entire letter for
3948redistribution (default: @samp{off}).
3949@c -------------------------
3950@item mh-reply-default-reply-to
3951Sets the person or persons to whom a reply will be sent (default:
3952@samp{Prompt}).
3953@c -------------------------
3954@item mh-reply-show-message-flag
3955On means the MH-Show buffer is displayed using @kbd{r}
3956(@code{mh-reply}) (default: @samp{on}).
3957@end vtable
3958
3959The following hooks are available.
3960
3961@vtable @code
bfe16263
BW
3962@item mh-annotate-msg-hook
3963Hook run by @code{mh-annotate-msg} after annotation (default:
3964@code{nil}).
3965@c -------------------------
4009494e
GM
3966@item mh-forward-hook
3967Hook run by @code{mh-forward} on a forwarded letter (default:
3968@code{nil}).
3969@c -------------------------
3970@item mh-letter-mode-hook
3971Hook run by @code{mh-letter-mode} on a new letter (default:
3972@code{nil}).
3973@end vtable
3974
bfe16263
BW
3975@findex mh-annotate-msg
3976@vindex mh-annotate-list
3977@vindex mh-annotate-msg-hook
3978@vindex mh-current-folder
3979
3980A hook that is called whenever a message is sent and after the scan
3981lines and message are annotated is @code{mh-annotate-msg-hook}. Hook
3982functions can access the current folder name with
3983@code{mh-current-folder} and obtain the message numbers of the
3984annotated messages with @code{mh-annotate-list}.
3985
3986The rest of the functions and options introduced here are explained in
3987more detail in the following sections.
4009494e
GM
3988
3989@menu
3990* Composing::
3991* Replying::
3992* Forwarding::
3993* Redistributing::
3994* Editing Again::
3995@end menu
3996
3997@node Composing, Replying, Sending Mail, Sending Mail
3998@section Composing
3999
4000@cindex @file{.emacs}
4001@cindex MH-Folder mode
4002@cindex composing mail
4003@cindex draft
4004@cindex files, @file{.emacs}
4005@cindex modes, MH-Folder
4006@cindex sending mail
4007@findex mh-smail
4008@findex mh-smail-other-window
4009@kindex M-x mh-smail
4010@kindex M-x mh-smail-other-window
4011
4012Outside of an MH-Folder buffer, you must call either @kbd{M-x
4013mh-smail} or @kbd{M-x mh-smail-other-window} to compose a new message.
4014The former command always creates a two-window layout with the current
4015buffer on top and the draft on the bottom. Use the latter command if
4016you would rather preserve the window layout. You may find adding the
4017following key bindings to @file{~/.emacs} useful:
4018
4019@smalllisp
4020(global-set-key "\C-xm" 'mh-smail)
4021(global-set-key "\C-x4m" 'mh-smail-other-window)
4022@end smalllisp
4023
4024@cindex draft folder
4025@cindex MH-Letter mode
4026@cindex modes, MH-Letter
4027@findex mh-send
4028@kindex m
4029
4030From within a MH-Folder buffer, you can simply use the command @kbd{m}
4031(@code{mh-send}). However you invoke @code{mh-send}, your letter
4032appears in an Emacs buffer whose mode is MH-Letter (to see what the
4033buffer looks like, @pxref{Sending Mail Tour}). MH-Letter mode allows
4034you to edit your message, to check the validity of the recipients, to
4035insert attachments and other messages into your message, and to send
4036the message. We'll go more into depth about editing a
4037@dfn{draft}@footnote{I highly recommend that you use a @dfn{draft
4038folder} so that you can edit several drafts in parallel. To do so,
4039create a folder named @samp{+drafts} for example, and add the profile
4040component @samp{Draft-Folder: drafts} (see @code{mh-profile}(5)).} (a
4041message you're composing) in just a moment (@pxref{Editing Drafts}).
4042
4043@vindex mh-compose-prompt-flag
4044
4045If you prefer to be prompted for the recipient and subject fields
4046before the MH-Letter buffer appears, turn on the option
4047@code{mh-compose-prompt-flag}.
4048
36a672f6
GM
4049@cindex header field, @samp{X-Mailer}
4050@cindex @samp{X-Mailer} header field
4009494e
GM
4051@vindex mh-insert-x-mailer-flag
4052
4053MH-E adds an @samp{X-Mailer:} header field to the header that includes
4054the version of MH-E and Emacs that you are using. If you don't want to
4055participate in our marketing, you can turn off the option
4056@code{mh-insert-x-mailer-flag}.
4057
4058@cindex @command{repl}
4059@cindex @file{components}
4060@cindex MH commands, @command{repl}
4061@cindex MH-Letter mode
4062@cindex Mail mode
4063@cindex files, @file{components}
4064@cindex modes, MH-Letter
4065@cindex modes, Mail
4066@vindex mail-mode-hook
4067@vindex mh-letter-mode-hook
4068@vindex text-mode-hook
4069
4070Two hooks are provided to run commands on your freshly created draft.
4071The first hook, @code{mh-letter-mode-hook}, allows you to do some
4072processing before editing a letter@footnote{Actually, because
4073MH-Letter mode inherits from Mail mode, the hooks
4074@code{text-mode-hook} and @code{mail-mode-hook} are run (in that
4075order) before @code{mh-letter-mode-hook}.}. For example, you may wish
4076to modify the header after @command{repl} has done its work, or you
4077may have a complicated @file{components} file and need to tell MH-E
4078where the cursor should go. Here's an example of how you would use
4079this hook.
4080
4081@findex mh-insert-signature, example
4082
4083@smalllisp
4084@group
4085(defvar letter-mode-init-done-flag nil
4086 "Non-nil means one-time MH-E settings have been made.")
4087
4088(defun my-mh-letter-mode-hook ()
4089 "Prepare letter for editing."
4090 (when (not letter-mode-init-done) ; @r{only need to bind the keys once}
4091 (local-set-key "\C-ctb" 'add-enriched-text)
4092 (local-set-key "\C-cti" 'add-enriched-text)
4093 (local-set-key "\C-ctf" 'add-enriched-text)
4094 (local-set-key "\C-cts" 'add-enriched-text)
4095 (local-set-key "\C-ctB" 'add-enriched-text)
4096 (local-set-key "\C-ctu" 'add-enriched-text)
4097 (local-set-key "\C-ctc" 'add-enriched-text)
4098 (setq letter-mode-init-done t))
4099 (save-excursion
4100 (goto-char (point-max)) ; @r{go to end of message to}
4101 (mh-insert-signature))) ; @r{insert signature}
4102
4103@i{Prepare draft for editing via mh-letter-mode-hook}
4104
4105@end group
4106@end smalllisp
4107
4108The function, @code{add-enriched-text} is defined in the example in
4109@ref{Adding Attachments}.
4110
4111@vindex mh-compose-letter-function
4112@vindex mh-letter-mode-hook
4113
4114The second hook, a function really, is
4115@code{mh-compose-letter-function}. Like @code{mh-letter-mode-hook}, it
4116is called just before editing a new message; however, it is the last
4117function called before you edit your message. The consequence of this
4118is that you can write a function to write and send the message for
4119you. This function is passed three arguments: the contents of the
4120@samp{To:}, @samp{Subject:}, and @samp{Cc:} header fields.
4121
4122@node Replying, Forwarding, Composing, Sending Mail
4123@section Replying to Mail
4124
4125@cindex @command{mhl}
4126@cindex @file{mhl.reply}
4127@cindex MH commands, @command{mhl}
4128@cindex files, @file{mhl.reply}
4129@cindex replying
4130@findex mh-reply
4131@kindex r
4132
4133To compose a reply to a message, use the @kbd{r} (@code{mh-reply})
4134command.
4135
4136When you reply to a message, you are first prompted with @samp{Reply
4137to whom?}. You have several choices here.
4138
4139@quotation
4140@multitable @columnfractions .20 .80
4141@c @headitem Response @tab Reply Goes To
4142@c XXX @headitem not yet supported by SourceForge's texi2pdf.
4143@item @b{Response} @tab @b{Reply Goes To}
4144@c -------------------------
4145@item @kbd{from}
4146@tab
4147The person who sent the message. This is the default, so @key{RET} is
4148sufficient.
4149@c -------------------------
4150@item @kbd{to}
4151@tab
4152Replies to the sender, plus all recipients in the @samp{To:} header field.
4153@c -------------------------
4154@item @kbd{cc}@*@kbd{all}
4155@tab
4156Forms a reply to the addresses in the @samp{Mail-Followup-To:} header
4157field if one exists; otherwise forms a reply to the sender, plus all
4158recipients.
4159@end multitable
4160@end quotation
4161
4162@cindex @command{repl}
4163@cindex MH commands, @command{repl}
4164@vindex mh-reply-default-reply-to
4165
4166Depending on your answer, @command{repl}@footnote{See the section
4167@uref{@value{MH-BOOK-HOME}/reprep.html, Replying to Messages: repl} in
4168the MH book.} is given a different argument to form your reply.
4169Specifically, a choice of @kbd{from} or none at all runs @samp{repl
4170-nocc all}, and a choice of @kbd{to} runs @samp{repl -cc to}. Finally,
4171either @kbd{cc} or @kbd{all} runs @samp{repl -cc all -nocc me}. If you
4172find that most of the time you specify one of these choices when you
4173reply to a message, you can change the option
4174@code{mh-reply-default-reply-to} from its default value of
4175@samp{Prompt} to one of the choices listed above. You can always edit
4176the recipients in the draft.
4177
36a672f6
GM
4178@cindex @samp{repl} MH profile component
4179@cindex MH profile component, @samp{repl}
4009494e
GM
4180@cindex MH-Letter mode
4181@cindex MH-Show mode
4182@cindex draft
4183@cindex modes, MH-Letter
4184@cindex modes, MH-Show
4185
4186Two windows are then created. One window contains the message to which
4187you are replying in an MH-Show buffer. Your draft, in MH-Letter mode
4188(@pxref{Editing Drafts}), is in the other window. If the reply draft
4189was not one that you expected, check the things that affect the
4190behavior of @command{repl} which include the @samp{repl:} profile
4191component and the @file{replcomps} and @file{replgroupcomps} files.
4192
4193If you supply a prefix argument (as in @kbd{C-u r}), the message you
4194are replying to is inserted in your reply after having first been run
4195through @command{mhl} with the format file @file{mhl.reply}. See
4196@command{mhl}(1) or the section
4197@uref{@value{MH-BOOK-HOME}/shomes.html#Usisho, Using mhl} in the MH
4198book to see how you can modify the default @file{mhl.reply} file.
4199
4200@vindex mh-yank-behavior
4201
4202Alternatively, you can customize the option @code{mh-yank-behavior}
4203and choose one of its @samp{Automatically} variants to do the same
4204thing. @xref{Inserting Letter}. If you do so, the prefix argument has
4205no effect.
4206
4207Another way to include the message automatically in your draft is to
4208use @samp{repl: -filter repl.filter} in your MH profile.
4209
4210@vindex mh-reply-show-message-flag
4211
4212If you include the message automatically, you can hide the MH-Show
4213buffer by turning off the option @code{mh-reply-show-message-flag}.
4214
4215If you wish to customize the header or other parts of the reply draft,
4216please see @command{repl}(1) and @code{mh-format}(5).
4217
4218@node Forwarding, Redistributing, Replying, Sending Mail
4219@section Forwarding Mail
4220
4221@cindex @command{forw}
4222@cindex draft
4223@cindex forwarding
4224@cindex MH commands, @command{forw}
4225@findex mh-forward
4226@kindex f
4227@vindex mh-forward-hook
4228
4229To forward a message, use the @kbd{f} (@code{mh-forward}) command. You
4230are prompted for the @samp{To:} and @samp{cc:} recipients. You are
4231given a draft to edit that looks like it would if you had run the MH
4232command @command{forw}@footnote{See the section
4233@uref{@value{MH-BOOK-HOME}/forfor.html, Forwarding Messages: forw} in
4234the MH book.}. You can then add some text (@pxref{Editing Drafts}).
4235You can forward several messages by using a range (@pxref{Ranges}).
4236All of the messages in the range are inserted into your draft. The
4237hook @code{mh-forward-hook} is called on the draft.
4238
4239@cindex @file{.mh_profile}
4240@cindex files, @file{.mh_profile}
36a672f6
GM
4241@cindex MH profile component, @samp{forw}
4242@cindex @samp{forw} MH profile component
4009494e
GM
4243@vindex mh-compose-forward-as-mime-flag
4244
4245By default, the option @code{mh-compose-forward-as-mime-flag} is on
4246which means that the forwarded messages are included as attachments.
30864d5f
BW
4247These are inline attachments so the forwarded message should appear in
4248the body of your recipient's mail program. If you would prefer to
4249forward your messages verbatim (as text, inline), then turn off this
4250option. Forwarding messages verbatim works well for short, textual
4251messages, but your recipient won't be able to view any non-textual
4252attachments that were in the forwarded message. Be aware that if you
4253have @samp{forw: -mime} in your MH profile, then forwarded messages
4254will always be included as attachments regardless of the settings of
4255@code{mh-compose-forward-as-mime-flag}.
4009494e
GM
4256
4257@vindex mh-forward-subject-format
4258
4259The format of the @samp{Subject:} header field for forwarded messages
4260is controlled by the option @code{mh-forward-subject-format}. This
4261option is a string which includes two escapes (@samp{%s}). The first
4262@samp{%s} is replaced with the sender of the original message, and the
4263second one is replaced with the original @samp{Subject:}. The default
4264value of @code{"%s: %s"} takes a message with the header:
4265
4266@smallexample
4267@group
4268To: Bill Wohler <wohler@@stop.mail-abuse.org>
4269Subject: Re: 49er football
4270From: Greg DesBrisay <gd@@stop.mail-abuse.org>
4271@end group
4272@end smallexample
4273
4274and creates a subject header field of:
4275
4276@smallexample
4277Subject: Greg DesBrisay: Re: 49er football
4278@end smallexample
4279
4280@node Redistributing, Editing Again, Forwarding, Sending Mail
4281@section Redistributing Your Mail
4282
4283@cindex @command{dist}
4284@cindex MH commands, @command{dist}
4285@cindex redistributing
4286@findex mh-redistribute
4287@kindex M-d
4288
4289The command @kbd{M-d} (@code{mh-redistribute}) is similar in function
4290to forwarding mail, but it does not allow you to edit the message, nor
4291does it add your name to the @samp{From:} header field. It appears to
4292the recipient as if the message had come from the original sender.
4293When you run this command, you are prompted for the recipients.
4294
4295@findex mh-edit-again
4296@kindex e
4297
4298For more information on redistributing messages, see
4299@command{dist}(1). Also investigate the command @kbd{e}
4300(@code{mh-edit-again}) for another way to redistribute messages
4301(@pxref{Editing Again}).
4302
4303@cindex @command{send}
4304@cindex MH commands, @command{send}
4305@vindex mh-redist-full-contents-flag
4306
4307The option @code{mh-redist-full-contents-flag} must be turned on if
4308@command{dist}@footnote{See the section
4309@uref{@value{MH-BOOK-HOME}/disdis.html, Distributing Messages with
4310dist} in the MH book.} requires the whole letter for redistribution,
4311which is the case if @command{send}@footnote{See the section
4312@uref{@value{MH-BOOK-HOME}/sensen.html, Sending Some Mail: comp send}
4313in the MH book.} is compiled with the @sc{berk} option (which many
4314people abhor). If you find that MH will not allow you to redistribute
4315a message that has been redistributed before, turn off this option.
4316
bfe16263
BW
4317The hook @code{mh-annotate-msg-hook} is run after annotating the
4318message and scan line (@pxref{Sending Mail}).
4319
4009494e
GM
4320@node Editing Again, , Redistributing, Sending Mail
4321@section Editing Old Drafts and Bounced Messages
4322
4323@cindex @file{draft}
4324@cindex files, @file{draft}
4325@cindex re-editing drafts
4326@findex mh-edit-again
4327@kindex F v drafts
4328@kindex e
4329@kindex n
4330
4331If you don't complete a draft for one reason or another, and if the
4332draft buffer is no longer available, you can pick your draft up again
4333with @kbd{e} (@code{mh-edit-again}). If you don't use a draft
4334folder, your last @file{draft} file will be used. If you use draft
4335folders, you'll need to visit the draft folder with @kbd{F v drafts
4336@key{RET}}, use @kbd{n} to move to the appropriate message, and then
4337use @kbd{e} to prepare the message for editing.
4338
4339@kindex e
4340
4341The @kbd{e} command can also be used to take messages that were sent
4342to you and to send them to more people.
4343
4344@cindex Mailer-Daemon
4345@findex mh-extract-rejected-mail
4346@kindex C-c C-c
4347@kindex E
4348
4349Don't use @kbd{e} to re-edit a message from a @i{Mailer-Daemon} who
4350complained that your mail wasn't posted for some reason or another. In
4351this case, use @kbd{E} (@code{mh-extract-rejected-mail}) to prepare
4352the message for editing by removing the @i{Mailer-Daemon} envelope and
4353unneeded header fields. Fix whatever addressing problem you had, and
4354send the message again with @kbd{C-c C-c}.
4355
4356@node Editing Drafts, Aliases, Sending Mail, Top
4357@chapter Editing a Draft
4358
4359@cindex @samp{Letter} menu
4360@cindex MH-Letter mode
4361@cindex draft
4362@cindex editing draft
4363@cindex menu, @samp{Letter}
4364@cindex modes, MH-Letter
4365
4366When you edit a message that you want to send (called a @dfn{draft} in
4367this case), the mode used is MH-Letter. This mode provides several
4368commands in addition to the normal Emacs editing commands to help you
4369edit your draft. These can also be found in the @samp{Letter} menu.
4370
4371@table @kbd
4372@kindex @key{SPC}
4373@findex mh-letter-complete-or-space
4374@item @key{SPC}
4375Perform completion or insert space (@code{mh-letter-complete-or-space}).
4376@c -------------------------
4377@kindex M-@key{TAB}
4378@findex mh-letter-complete
4379@item M-@key{TAB}
4380Perform completion on header field or word preceding point
4381(@code{mh-letter-complete}).
4382@c -------------------------
4383@kindex , (comma)
4384@findex mh-letter-confirm-address
4385@item , (comma)
4386Flash alias expansion (@code{mh-letter-confirm-address}).
4387@c -------------------------
4388@kindex @key{TAB}
4389@findex mh-letter-next-header-field-or-indent
4390@item @key{TAB}
4391Cycle to next field (@code{mh-letter-next-header-field-or-indent}).
4392@c -------------------------
4393@kindex S-@key{TAB}
4394@findex mh-letter-previous-header-field
4395@item S-@key{TAB}
4396Cycle to the previous header field
4397(@code{mh-letter-previous-header-field}).
4398@c -------------------------
4399@kindex C-c ?
4400@findex mh-help
4401@item C-c ?
4402Display cheat sheet for the MH-E commands (@code{mh-help}).
4403@c -------------------------
4404@cindex @samp{Letter > Send This Draft} menu item
4405@cindex menu item, @samp{Letter > Send This Draft}
4406@kindex C-c C-c
4407@findex mh-send-letter
4408@item C-c C-c
4409Save draft and send message (@code{mh-send-letter}).
4410@c -------------------------
4411@kindex C-c C-d
4412@findex mh-insert-identity
4413@item C-c C-d
4414Insert fields specified by the given identity
4415(@code{mh-insert-identity}). @xref{Identities}.
4416@c -------------------------
4417@cindex @samp{Letter > Pull in All Compositions (MH)} menu item
4418@cindex menu item, @samp{Letter > Pull in All Compositions (MH)}
4419@kindex C-c C-e
4420@findex mh-mh-to-mime
4421@item C-c C-e
4422Compose @sc{mime} message from MH-style directives
4423(@code{mh-mh-to-mime}).
4424@c -------------------------
4425@kindex C-c C-f C-a
4426@kindex C-c C-f a
4427@findex mh-to-field
4428@item C-c C-f C-a
4429@itemx C-c C-f a
4430Move to @samp{Mail-Reply-To:} header field (@code{mh-to-field}).
4431@c -------------------------
4432@kindex C-c C-f C-b
4433@kindex C-c C-f b
4434@item C-c C-f C-b
4435@itemx C-c C-f b
4436Move to @samp{Bcc:} header field (@code{mh-to-field}).
4437@c -------------------------
4438@kindex C-c C-f C-c
4439@kindex C-c C-f c
4440@item C-c C-f C-c
4441@itemx C-c C-f c
4442Move to @samp{Cc:} header field (@code{mh-to-field}).
4443@c -------------------------
4444@kindex C-c C-f C-d
4445@kindex C-c C-f d
4446@item C-c C-f C-d
4447@itemx C-c C-f d
4448Move to @samp{Dcc:} header field (@code{mh-to-field}).
4449@c -------------------------
4450@kindex C-c C-f C-f
4451@kindex C-c C-f f
4452@findex mh-to-fcc
4453@item C-c C-f C-f
4454@itemx C-c C-f f
4455Move to @samp{Fcc:} header field (@code{mh-to-fcc}).
4456@c -------------------------
4457@kindex C-c C-f C-l
4458@kindex C-c C-f l
4459@item C-c C-f C-l
4460@itemx C-c C-f l
4461Move to @samp{Mail-Followup-To:} header field (@code{mh-to-field}).
4462@c -------------------------
4463@kindex C-c C-f C-m
4464@kindex C-c C-f m
4465@item C-c C-f C-m
4466@itemx C-c C-f m
4467Move to @samp{From:} header field (@code{mh-to-field}).
4468@c -------------------------
4469@kindex C-c C-f C-r
4470@kindex C-c C-f r
4471@item C-c C-f C-r
4472@itemx C-c C-f r
4473Move to @samp{Reply-To:} header field (@code{mh-to-field}).
4474@c -------------------------
4475@kindex C-c C-f C-s
4476@kindex C-c C-f s
4477@item C-c C-f C-s
4478@itemx C-c C-f s
4479Move to @samp{Subject:} header field (@code{mh-to-field}).
4480@c -------------------------
4481@kindex C-c C-f C-t
4482@kindex C-c C-f t
4483@item C-c C-f C-t
4484@itemx C-c C-f t
4485Move to @samp{To:} header field (@code{mh-to-field}).
4486@c -------------------------
4487@cindex @samp{Letter > Insert a Message...} menu item
4488@cindex menu item, @samp{Letter > Insert a Message...}
4489@kindex C-c C-i
4490@findex mh-insert-letter
4491@item C-c C-i
4492Insert a message (@code{mh-insert-letter}).
4493@c -------------------------
4494@kindex C-c C-m C-e
4495@findex mh-mml-secure-message-encrypt
4496@item C-c C-m C-e
4497Add tag to encrypt the message (@code{mh-mml-secure-message-encrypt}).
4498@c -------------------------
4499@cindex @samp{Letter > Compose Forward...} menu item
4500@cindex menu item, @samp{Letter > Compose Forward...}
4501@kindex C-c C-m C-f
4502@kindex C-c C-m f
4503@findex mh-compose-forward
4504@item C-c C-m C-f
4505@itemx C-c C-m f
4506Add tag to forward a message (@code{mh-compose-forward}).
4507@c -------------------------
4508@cindex @samp{Letter > Compose Get File (MH)...} menu item
4509@cindex menu item, @samp{Letter > Compose Get File (MH)...}
4510@kindex C-c C-m C-g
4511@kindex C-c C-m g
4512@findex mh-mh-compose-anon-ftp
4513@item C-c C-m C-g
4514@itemx C-c C-m g
4515Add tag to include anonymous ftp reference to a file
4516(@code{mh-mh-compose-anon-ftp}).
4517@c -------------------------
4518@cindex @samp{Letter > Compose Insertion...} menu item
4519@cindex menu item, @samp{Letter > Compose Insertion...}
4520@kindex C-c C-m C-i
4521@kindex C-c C-m i
4522@findex mh-compose-insertion
4523@item C-c C-m C-i
4524@itemx C-c C-m i
4525Add tag to include a file such as an image or sound
4526(@code{mh-compose-insertion}).
4527@c -------------------------
4528@cindex @samp{Letter > Pull in All Compositions (MML)} menu item
4529@cindex menu item, @samp{Letter > Pull in All Compositions (MML)}
4530@kindex C-c C-m C-m
4531@kindex C-c C-m m
4532@findex mh-mml-to-mime
4533@item C-c C-m C-m
4534@itemx C-c C-m m
4535Compose @sc{mime} message from MML tags (@code{mh-mml-to-mime}).
4536@c -------------------------
4537@kindex C-c C-m C-n
4538@kindex C-c C-m n
4539@findex mh-mml-unsecure-message
4540@item C-c C-m C-n
4541@itemx C-c C-m n
4542Remove any secure message tags (@code{mh-mml-unsecure-message}).
4543@c -------------------------
4544@kindex C-c C-m C-s
4545@findex mh-mml-secure-message-sign
4546@item C-c C-m C-s
4547Add tag to sign the message (@code{mh-mml-secure-message-sign}).
4548@c -------------------------
4549@cindex @samp{Letter > Compose Compressed tar (MH)...} menu item
4550@cindex menu item, @samp{Letter > Compose Compressed tar (MH)...}
4551@kindex C-c C-m C-t
4552@kindex C-c C-m t
4553@findex mh-mh-compose-external-compressed-tar
4554@item C-c C-m C-t
4555@itemx C-c C-m t
4556Add tag to include anonymous ftp reference to a compressed tar file
4557(@code{mh-mh-compose-external-compressed-tar}).
4558@c -------------------------
4559@cindex @samp{Letter > Revert to Non-MIME Edit (MH)} menu item
4560@cindex menu item, @samp{Letter > Revert to Non-MIME Edit (MH)}
4561@kindex C-c C-m C-u
4562@kindex C-c C-m u
4563@findex mh-mh-to-mime-undo
4564@item C-c C-m C-u
4565@itemx C-c C-m u
4566Undo effects of @kbd{C-c C-e} (@code{mh-mh-to-mime-undo}).
4567@c -------------------------
4568@kindex C-c C-m C-x
4569@kindex C-c C-m x
4570@findex mh-mh-compose-external-type
4571@item C-c C-m C-x
4572@itemx C-c C-m x
4573Add tag to refer to a remote file
4574(@code{mh-mh-compose-external-type}).
4575@c -------------------------
4576@kindex C-c C-m e e
4577@findex mh-mml-secure-message-encrypt
4578@item C-c C-m e e
4579Add tag to encrypt the message (@code{mh-mml-secure-message-encrypt}).
4580@c -------------------------
4581@kindex C-c C-m e s
4582@findex mh-mml-secure-message-signencrypt
4583@item C-c C-m e s
4584Add tag to encrypt and sign the message@*
4585(@code{mh-mml-secure-message-signencrypt}).
4586@c -------------------------
4587@kindex C-c C-m s e
4588@findex mh-mml-secure-message-signencrypt
4589@item C-c C-m s e
4590Add tag to encrypt and sign the message@*
4591(@code{mh-mml-secure-message-signencrypt}).
4592@c -------------------------
4593@kindex C-c C-m s s
4594@findex mh-mml-secure-message-sign
4595@item C-c C-m s s
4596Add tag to sign the message (@code{mh-mml-secure-message-sign}).
4597@c -------------------------
4598@cindex @samp{Letter > Split Current Line} menu item
4599@cindex menu item, @samp{Letter > Split Current Line}
4600@kindex C-c C-o
4601@findex mh-open-line
4602@item C-c C-o
4603Insert a newline and leave point before it (@code{mh-open-line}).
4604@c -------------------------
4605@cindex @samp{Letter > Kill This Draft} menu item
4606@cindex menu item, @samp{Letter > Kill This Draft}
4607@kindex C-c C-q
4608@findex mh-fully-kill-draft
4609@item C-c C-q
4610Quit editing and delete draft message (@code{mh-fully-kill-draft}).
4611@c -------------------------
4612@cindex @samp{Letter > Insert Signature} menu item
4613@cindex menu item, @samp{Letter > Insert Signature}
4614@kindex C-c C-s
4615@findex mh-insert-signature
4616@item C-c C-s
4617Insert signature in message (@code{mh-insert-signature}).
4618@c -------------------------
4619@kindex C-c C-t
4620@findex mh-letter-toggle-header-field-display
4621@item C-c C-t
4622Toggle display of header field at point
4623(@code{mh-letter-toggle-header-field-display}).
4624@c -------------------------
4625@cindex @samp{Letter > Check Recipient} menu item
4626@cindex menu item, @samp{Letter > Check Recipient}
4627@kindex C-c C-w
4628@findex mh-check-whom
4629@item C-c C-w
4630Verify recipients, showing expansion of any aliases
4631(@code{mh-check-whom}).
4632@c -------------------------
4633@cindex @samp{Letter > Yank Current Message} menu item
4634@cindex menu item, @samp{Letter > Yank Current Message}
4635@kindex C-c C-y
4636@findex mh-yank-cur-msg
4637@item C-c C-y
4638Insert the current message into the draft buffer
4639(@code{mh-yank-cur-msg}).
4640@c -------------------------
4641@kindex C-c M-d
4642@findex mh-insert-auto-fields
4643@item C-c M-d
4644Insert custom fields if recipient is found in
4645@code{mh-auto-fields-list} (@code{mh-insert-auto-fields}).
4646@xref{Identities}.
4647@end table
4648
4649@cindex @samp{mh-letter} customization group
4650@cindex customization group, @samp{mh-letter}
4651
4652Several options from the @samp{mh-letter} customization group are used
4653while editing a draft.
4654
4655@vtable @code
4656@item mh-compose-insertion
4657Type of @sc{mime} message tags in messages (default: @samp{MML} if
4658available; otherwise @samp{MH}).
4659@c -------------------------
4660@item mh-compose-skipped-header-fields
4661List of header fields to skip over when navigating in draft (default:
4662@code{'("From"} @code{"Organization"} @code{"References"}
4663@code{"In-Reply-To"} @code{"X-Face"} @code{"Face"}
4664@code{"X-Image-URL"} @code{"X-Mailer")}.
4665@c -------------------------
4666@item mh-compose-space-does-completion-flag
4667On means @key{SPC} does completion in message header (default:
4668@samp{off}).
4669@c -------------------------
4670@item mh-delete-yanked-msg-window-flag
4671On means delete any window displaying the message (default: @samp{off}).
4672@c -------------------------
4673@item mh-extract-from-attribution-verb
4674Verb to use for attribution when a message is yanked by @kbd{C-c C-y}
4675(default: @code{"wrote:"}).
4676@c -------------------------
4677@item mh-ins-buf-prefix
4678String to put before each line of a yanked or inserted message
4679(default: @code{"> "}).
4680@c -------------------------
4681@item mh-letter-complete-function
4682Function to call when completing outside of address or folder fields
4683(default: @code{ispell-complete-word}).
4684@c -------------------------
4685@item mh-letter-fill-column
4686Fill column to use in MH-Letter mode (default: 72).
4687@c -------------------------
4688@item mh-mml-method-default
4689Default method to use in security tags (default: @samp{PGP (MIME)} if
4690support for it is available; otherwise @samp{None}).
4691@c -------------------------
4692@item mh-signature-file-name
4693Source of user's signature (default: @code{"~/.signature"}).
4694@c -------------------------
4695@item mh-signature-separator-flag
4696On means a signature separator should be inserted (default:
4697@samp{on}).
4698@c -------------------------
4699@item mh-x-face-file
4700File containing X-Face or Face header field to insert in outgoing mail.
4701(default: @code{"~/.face"}).
4702@c -------------------------
4703@item mh-yank-behavior
4704Controls which part of a message is yanked by @kbd{C-c C-y} (default:
4705@samp{Body With Attribution}).
4706@end vtable
4707
4708The following hooks are available.
4709
4710@vtable @code
4711@item mail-citation-hook
4712Hook for modifying a citation just inserted in the mail buffer
4713(default: @code{nil}).
4714@c -------------------------
4715@item mh-before-send-letter-hook
4716Hook run at the beginning of the @kbd{C-c C-c} command (default:
4717@samp{nil}).
4718@c -------------------------
4719@item mh-mh-to-mime-hook
4720Hook run on the formatted letter by @kbd{C-c C-e} (default:
4721@samp{nil}).
4722@c -------------------------
4723@item mh-insert-signature-hook
4724Hook run by @kbd{C-c C-s} after signature has been inserted (default:
4725@code{nil}).
4726@end vtable
4727
4728The following face is available.
4729
4730@vtable @code
4731@item mh-letter-header-field
4732Editable header field value face in draft buffers.
4733@end vtable
4734
4735The commands and options introduced here are explained in more
4736detail in the following sections.
4737
4738@menu
4739* Editing Message::
4740* Inserting Letter::
4741* Inserting Messages::
4742* Signature::
4743* Picture::
4744* Adding Attachments::
4745* Sending PGP::
4746* Checking Recipients::
4747* Sending Message::
4748* Killing Draft::
4749@end menu
4750
4751@node Editing Message, Inserting Letter, Editing Drafts, Editing Drafts
4752@section Editing the Message
4753
36a672f6
GM
4754@cindex @samp{Bcc} header field
4755@cindex @samp{Cc} header field
4756@cindex @samp{Dcc} header field
4757@cindex @samp{From} header field
4758@cindex @samp{Mail-Followup-To} header field
4759@cindex @samp{Mail-Reply-To} header field
4760@cindex @samp{Reply-To} header field
4761@cindex @samp{Subject} header field
4762@cindex @samp{To} header field
4009494e 4763@cindex editing header
36a672f6
GM
4764@cindex header field, @samp{Bcc}
4765@cindex header field, @samp{Cc}
4766@cindex header field, @samp{Dcc}
4767@cindex header field, @samp{From}
4768@cindex header field, @samp{Mail-Followup-To}
4769@cindex header field, @samp{Mail-Reply-To}
4770@cindex header field, @samp{Reply-To}
4771@cindex header field, @samp{Subject}
4772@cindex header field, @samp{To}
4009494e
GM
4773@findex mh-to-field
4774@kindex C-c C-f C-t
4775@kindex C-c C-f t
4776
4777Because the header is part of the message, you can edit the header
4778fields as you wish. However, several convenience commands exist to
4779help you create and edit them. For example, the command @kbd{C-c C-f
4780C-t} (@code{mh-to-field}; alternatively, @kbd{C-c C-f t}) moves the
4781cursor to the @samp{To:} header field, creating it if necessary. The
4782commands for moving to the @samp{Cc:}, @samp{Subject:}, @samp{From:},
4783@samp{Reply-To:}, @samp{Mail-Reply-To:}, @samp{Mail-Followup-To},
4784@samp{Bcc:}, and @samp{Dcc:} header fields are similar.
4785
4786@findex mh-to-fcc
4787@kindex C-c C-f C-f
4788@kindex C-c C-f f
4789
4790One command behaves differently from the others, namely, @kbd{C-c C-f
4791C-f} (@code{mh-to-fcc}; alternatively, @kbd{C-c C-f f}). This command
4792will prompt you for the folder name in which to file a copy of the
4793draft. @xref{Folder Selection}.
4794
4795@findex indent-relative
4796@findex mh-letter-next-header-field-or-indent
4797@findex mh-letter-previous-header-field
4798@kindex @key{TAB}
4799@kindex S-@key{TAB}
4800@vindex mh-compose-skipped-header-fields
4801@vindex mh-letter-header-field
4802
4803Within the header of the message, the command@* @key{TAB}
4804(@code{mh-letter-next-header-field-or-indent}) moves between fields
4805that are highlighted with the face @code{mh-letter-header-field},
4806skipping those fields listed in
4807@code{mh-compose-skipped-header-fields}. After the last field, this
4808command then moves point to the message body before cycling back to
4809the first field. If point is already past the first line of the
4810message body, then this command indents by calling
4811@code{indent-relative} with the given prefix argument. The command
4812@kbd{S-@key{TAB}} (@code{mh-letter-previous-header-field}) moves
4813backwards between the fields and cycles to the body of the message
4814after the first field. Unlike the command @key{TAB}, it will always
4815take point to the last field from anywhere in the body.
4816
4817@cindex alias completion
4818@cindex completion
4819@cindex spell check
4820@findex ispell-complete-word
4821@findex mh-letter-complete
4822@findex mh-letter-complete-or-space
4823@findex mh-letter-confirm-address
4824@kindex , (comma)
4825@kindex @key{SPC}
4826@kindex M-@key{TAB}
4827@vindex mh-alias-flash-on-comma
4828@vindex mh-compose-space-does-completion-flag
4829@vindex mh-letter-complete-function
4830
4831If the field contains addresses (for example, @samp{To:} or
4832@samp{Cc:}) or folders (for example, @samp{Fcc:}) then the command
4833@kbd{M-@key{TAB}} (@code{mh-letter-complete}) will provide alias
4834completion (@pxref{Aliases}). In the body of the message,
4835@kbd{M-@key{TAB}} runs @code{mh-letter-complete-function} instead,
4836which is set to @samp{'ispell-complete-word} by default. The command
4837@kbd{M-@key{TAB}} (@code{mh-letter-complete}) takes a prefix argument
4838that is passed to the @code{mh-letter-complete-function}. In addition,
4839turn on the option @code{mh-compose-space-does-completion-flag} to use
4840the command @key{SPC} (@code{mh-letter-complete-or-space}) to perform
4841completion in the header as well; use a prefix argument to specify
4842more than one space. Addresses are separated by a comma; when you
4843press the comma, the command @code{mh-letter-confirm-address} flashes
4844the alias expansion in the minibuffer if
4845@code{mh-alias-flash-on-comma} is turned on.
4846
4847@c XXX Document the replacement for the inaccessible 'long argument.
4848
4849@findex mh-letter-toggle-header-field-display
4850@kindex C-c C-t
4851
4852Use the command @kbd{C-c C-t}
4853@code{mh-letter-toggle-header-field-display} to display truncated
4854header fields. This command is a toggle so entering it again will hide
4855the field. This command takes a prefix argument: if negative then the
4856field is hidden, if positive then the field is displayed (for example,
4857@kbd{C-u C-c C-t}).
4858
4859Be sure to leave a row of dashes or a blank line between the header
4860and the body of the message.
4861
4862@vindex mh-letter-fill-column
4863
4864The body of the message is edited as you would edit any Emacs buffer
4865although there are a few commands and options to assist you. You can
4866change the fill column in MH-Letter mode with the option
4867@code{mh-letter-fill-column}. By default, this option is 72 to allow
4868others to quote your message without line wrapping.
4869
4870@cindex filling paragraphs
4871@cindex paragraphs, filling
4872@findex fill-paragraph
4873@kindex M-q
4874@vindex mh-ins-buf-prefix
4875
4876You'll often include messages that were sent from user agents that
4877haven't yet realized that paragraphs consist of more than a single
4878line. This makes for long lines that wrap in an ugly fashion. You'll
4879find that @kbd{M-q} (@code{fill-paragraph}) works well even on these
4880quoted messages, even if they are nested, just as long as all of the
4881quotes match the value of @code{mh-ins-buf-prefix} (@pxref{Inserting
4882Letter}). For example, let's assume you have the following in your
4883draft:
4884
4885@smallexample
4886@group
4887> Hopefully this gives you an idea of what I'm currently doing. I'm \
4888not sure yet whether I'm completely satisfied with my setup, but \
4889it's worked okay for me so far.
4890@end group
4891@end smallexample
4892
4893Running @kbd{M-q} on this paragraph produces:
4894
4895@smallexample
4896@group
4897> Hopefully this gives you an idea of what I'm currently doing. I'm not
4898> sure yet whether I'm completely satisfied with my setup, but it's
4899> worked okay for me so far.
4900@end group
4901@end smallexample
4902
4903@findex mh-open-line
4904@findex open-line
4905@kindex C-c C-o
4906@kindex C-o
4907
4908The command @kbd{C-c C-o} (@code{mh-open-line}) is similar to the
4909command @kbd{C-o} (@code{open-line}) in that it inserts a newline
4910after point. It differs in that it also inserts the right number of
4911quoting characters and spaces so that the next line begins in the same
4912column as it was. This is useful when breaking up paragraphs in
4913replies. For example, if this command was used when point was after
4914the first period in the paragraph above, the result would be this:
4915
4916@smallexample
4917@group
4918> Hopefully this gives you an idea of what I'm currently doing.
4919
4920> I'm not
4921> sure yet whether I'm completely satisfied with my setup, but it's
4922> worked okay for me so far.
4923@end group
4924@end smallexample
4925
4926@node Inserting Letter, Inserting Messages, Editing Message, Editing Drafts
4927@section Inserting Letter to Which You're Replying
4928
4929@cindex inserting messages
4930@cindex replying to messages
4931@cindex yanking messages
4932@findex mh-yank-cur-msg
4933@kindex C-c C-y
4934@vindex mh-ins-buf-prefix
4935
4936It is often useful to insert a snippet of text from a letter that
4937someone mailed to provide some context for your reply. The command
4938@kbd{C-c C-y} (@code{mh-yank-cur-msg}) does this by adding an
4939attribution, yanking a portion of text from the message to which
4940you're replying, and inserting @code{mh-ins-buf-prefix} (@samp{> })
4941before each line.
4942
4943@smallexample
4944@group
4945Michael W Thelen <thelenm@@stop.mail-abuse.org> wrote:
4946
4947> Hopefully this gives you an idea of what I'm currently doing. I'm not
4948> sure yet whether I'm completely satisfied with my setup, but it's
4949> worked okay for me so far.
4950@end group
4951@end smallexample
4952
4953@vindex mh-extract-from-attribution-verb
4954
4955The attribution consists of the sender's name and email address
4956followed by the content of the option
4957@code{mh-extract-from-attribution-verb}. This option can be set to
681ebc33 4958@samp{wrote:}, @samp{a écrit:}, and @samp{schrieb:}. You can also use
4009494e
GM
4959the @samp{Custom String} menu item to enter your own verb.
4960
4961@vindex mail-citation-hook
4962@vindex mh-ins-buf-prefix
4963@vindex mh-yank-behavior
4964
4965The prefix @code{"> "} is the default setting for the option
4966@code{mh-ins-buf-prefix}. I suggest that you not modify this option
4967since it is used by many mailers and news readers: messages are far
4968easier to read if several included messages have all been indented by
4969the same string. This prefix is not inserted if you use one of the
4970supercite flavors of @code{mh-yank-behavior} or you have added a
4971@code{mail-citation-hook} as described below.
4972
4973@vindex mh-delete-yanked-msg-window-flag
4974
4975You can also turn on the @code{mh-delete-yanked-msg-window-flag}
4976option to delete the window containing the original message after
4977yanking it to make more room on your screen for your reply.
4978
4979@cindex Emacs, packages, supercite
4980@cindex supercite package
4981@kindex r
4982@vindex mail-citation-hook
4983@vindex mh-yank-behavior
4984
4985You can control how the message to which you are replying is yanked
4986into your reply using @code{mh-yank-behavior}. To include the entire
4987message, including the entire header, use @samp{Body and
4988Header}@footnote{If you'd rather have the header cleaned up, use
4989@kbd{C-u r} instead of @kbd{r} when replying
4990(@pxref{Replying}).}@footnote{In the past you would use this setting
4991and set @code{mail-citation-hook} to @samp{supercite}, but this usage
4992is now deprecated in favor of the @samp{Invoke supercite} setting.}.
4993Use @samp{Body} to yank just the body without the header. To yank only
4994the portion of the message following the point, set this option to
4995@samp{Below Point}.
4996
4997Choose @samp{Invoke supercite}@footnote{@emph{Supercite} is a
4998full-bodied, full-featured, citation package that comes standard with
4999Emacs.} to pass the entire message and header through supercite.
5000
5001@vindex mh-extract-from-attribution-verb
5002
5003If the @samp{Body With Attribution} setting is used, then the message
5004minus the header is yanked and a simple attribution line is added at
5005the top using the value of the option
5006@code{mh-extract-from-attribution-verb}. This is the default.
5007
5008@kindex C-c C-y
5009@vindex mh-delete-yanked-msg-window-flag
5010
5011If the @samp{Invoke supercite} or @samp{Body With Attribution}
5012settings are used, the @samp{-noformat} argument is passed to the
5013@command{repl} program to override a @samp{-filter} or @samp{-format}
5014argument. These settings also have @samp{Automatically} variants that
5015perform the action automatically when you reply so that you don't need
5016to use @kbd{C-c C-y} at all. Note that this automatic action is only
5017performed if the show buffer matches the message being replied to.
5018People who use the automatic variants tend to turn on the option
5019@code{mh-delete-yanked-msg-window-flag} as well so that the show
5020window is never displayed.
5021
5022@vindex mh-yank-behavior
5023
5024If the show buffer has a region, the option @code{mh-yank-behavior} is
5025ignored unless its value is one of @samp{Attribution} variants in
5026which case the attribution is added to the yanked region.
5027
5028@findex trivial-cite
5029@vindex mail-citation-hook
5030@vindex mh-ins-buf-prefix
5031@vindex mh-yank-behavior
5032
5033If this isn't enough, you can gain full control over the appearance of
5034the included text by setting @code{mail-citation-hook} to a function
5035that modifies it. This hook is ignored if the option
5036@code{mh-yank-behavior} is set to one of the supercite flavors.
5037Otherwise, this option controls how much of the message is passed to
5038the hook. The function can find the citation between point and mark
5039and it should leave point and mark around the modified citation text
5040for the next hook function. The standard prefix
5041@code{mh-ins-buf-prefix} is not added if this hook is set.
5042
5043@cindex Emacs, packages, trivial-cite
5044@cindex trivial-cite package
5045@vindex mh-yank-behavior
5046
5047For example, if you use the hook function
5154917e 5048@uref{http://www.emacswiki.org/emacs/TrivialCite,
4009494e
GM
5049@code{trivial-cite}} (which is NOT part of Emacs), set
5050@code{mh-yank-behavior} to @samp{Body and Header}.
5051
5052@node Inserting Messages, Signature, Inserting Letter, Editing Drafts
5053@section Inserting Messages
5054
5055@cindex inserting messages
5056@findex mh-insert-letter
5057@findex mh-yank-behavior
5058@kindex C-c C-i
5059@vindex mh-ins-buf-prefix
5060@vindex mh-invisible-header-fields-compiled
5061@vindex mh-yank-behavior
5062
5063Messages can be inserted with @kbd{C-c C-i} (@code{mh-insert-letter}).
5064This command prompts you for the folder and message number, which
5065defaults to the current message in that folder. It then inserts the
5066messages, indented by @code{mh-ins-buf-prefix} (@samp{> }) unless
5067@code{mh-yank-behavior} is set to one of the supercite flavors in
5068which case supercite is used to format the message. Certain
5069undesirable header fields (see
5070@code{mh-invisible-header-fields-compiled}) are removed before
5071insertion.
5072
5073If given a prefix argument (like @kbd{C-u C-c C-i}), the header is
5074left intact, the message is not indented, and @samp{> } is not
5075inserted before each line. This command leaves the mark before the
5076letter and point after it.
5077
5078@node Signature, Picture, Inserting Messages, Editing Drafts
5079@section Inserting Your Signature
5080
5081@cindex signature
5082@findex mh-insert-signature
5083@kindex C-c C-s
5084
5085You can insert your signature at the current cursor location with the
5086command @kbd{C-c C-s} (@code{mh-insert-signature}).
5087
5088@cindex files, @file{.signature}
5089@cindex @file{.signature}
5090@cindex vCard
5091@vindex mh-signature-file-name
5092
5093By default, the text of your signature is taken from the file
5094@file{~/.signature}. You can read from other sources by changing the
5095option @code{mh-signature-file-name}. This file may contain a
5096@dfn{vCard} in which case an attachment is added with the vCard.
5097
5098@findex mh-signature-separator-p
5099@vindex mh-signature-file-name
5100@vindex mh-signature-separator
5101@vindex mh-signature-separator-regexp
5102
5103The option @code{mh-signature-file-name} may also be a symbol, in
5104which case that function is called. You may not want a signature
5105separator to be added for you; instead you may want to insert one
5106yourself. Options that you may find useful to do this include
5107@code{mh-signature-separator} (when inserting a signature separator)
5108and @code{mh-signature-separator-regexp} (for finding said separator).
5109The function @code{mh-signature-separator-p}, which reports @code{t}
5110if the buffer contains a separator, may be useful as well.
5111
5112@cindex signature separator
5113@vindex mh-signature-separator-flag
5114
5115A signature separator (@code{"-- "}) will be added if the signature
5116block does not contain one and @code{mh-signature-separator-flag} is
5117on. It is not recommended that you change this option since various
5118mail user agents, including MH-E, use the separator to present the
5119signature differently, and to suppress the signature when replying or
5120yanking a letter into a draft.
5121
5122@vindex mh-insert-signature-hook
5123@vindex mh-signature-file-name
5124
5125The hook @code{mh-insert-signature-hook} is run after the signature is
5126inserted. Hook functions may access the actual name of the file or the
5127function used to insert the signature with
5128@code{mh-signature-file-name}.
5129
5130The signature can also be inserted using Identities.
5131@xref{Identities}.
5132
5133@node Picture, Adding Attachments, Signature, Editing Drafts
5134@section Inserting Your Picture
5135
5136@cindex @file{.face}
5137@cindex files, @file{.face}
5138@vindex mh-x-face-file
5139
5140You can insert your picture in the header of your mail message so that
5141recipients see your face in the @samp{From:} header field if their
5142mail user agent is sophisticated enough. In MH-E, this is done by
5143placing your image in the file named by the option
5144@code{mh-x-face-file} which is @file{~/.face} by default.
5145
36a672f6
GM
5146@cindex @samp{Face} header field
5147@cindex @samp{X-Face} header field
5148@cindex @samp{X-Image-URL} header field
5149@cindex header field, @samp{Face}
5150@cindex header field, @samp{X-Face}
5151@cindex header field, @samp{X-Image-URL}
4009494e
GM
5152
5153If the file starts with either of the strings @samp{X-Face:},
5154@samp{Face:} or @samp{X-Image-URL:} then the contents are added to the
5155message header verbatim. Otherwise it is assumed that the file
5156contains the value of the @samp{X-Face:} header field.
5157
5158@cindex @command{compface}
5159@cindex Unix commands, @command{compface}
5160
5161The @samp{X-Face:} header field, which is a low-resolution, black and
5162white image, can be generated using the
5163@uref{ftp://ftp.cs.indiana.edu/pub/faces/compface/compface.tar.Z,
5164@command{compface}} command. The @uref{http://www.dairiki.org/xface/,
5165@cite{Online X-Face Converter}} is a useful resource for quick
5166conversion of images into @samp{X-Face:} header fields.
5167
5168Use the @uref{http://quimby.gnus.org/circus/face/make-face,
5169@command{make-face}} script to convert a JPEG image to the higher
5170resolution, color, @samp{Face:} header field.
5171
5172The URL of any image can be used for the @samp{X-Image-URL:} field and
5173no processing of the image is required.
5174
5175@vindex mh-x-face-file
5176
5177To prevent the setting of any of these header fields, either set
5178@code{mh-x-face-file} to @code{nil}, or simply ensure that the file
5179defined by this option doesn't exist.
5180
5181@xref{Viewing}, to see how these header fields are displayed in MH-E.
5182
5183@node Adding Attachments, Sending PGP, Picture, Editing Drafts
5184@section Adding Attachments
5185
5186@cindex @command{mhbuild}
5187@cindex @command{mhn}
5188@cindex MH commands, @command{mhbuild}
5189@cindex MH commands, @command{mhn}
5190@cindex MIME
5191@cindex multimedia mail
5192
5193MH-E has the capability to create multimedia messages. It uses the
5194@sc{mime} (Multipurpose Internet Mail Extensions)
5195protocol@footnote{@sc{mime} is defined in
5196@uref{http://www.rfc-editor.org/rfc/rfc2045.txt, RFC 2045}.} The
5197@sc{mime} protocol allows you to incorporate images, sound, video,
5198binary files, and even commands that fetch a file with @samp{ftp} when
5199your recipient reads the message!
5200
5201@kindex C-c C-m
5202
5203If you were to create a multimedia message with plain MH commands, you
5204would insert @command{mhbuild} or @command{mhn} directives (henceforth
5205called @dfn{MH-style directives} into your draft and use the
5206@command{mhbuild} command in nmh or @command{mhn} command in MH and
5207GNU mailutils to expand them. MH-E works in much the same way,
5208although it provides a handful of commands prefixed with @kbd{C-c C-m}
5209to insert the directives so you don't need to remember the syntax of
5210them. Remember: you can always add MH-style directives by
5211hand@footnote{See the section
5212@uref{@value{MH-BOOK-HOME}/usimim.html#SeMIMa, Sending MIME Mail} in
5213the MH book.}.
5214
5215@cindex MIME Meta Language (MML)
5216@cindex MML
5217@vindex mh-compose-insertion
5218
5219In addition to MH-style directives, MH-E also supports MML (@sc{mime}
5220Meta Language) tags@footnote{
5221@ifinfo
5222@c Although the third argument should default to the
5223@c first, makeinfo goes to the wrong Info file without it being
5224@c different--it seems to be getting our own Composing node.
5225@xref{Composing,,Composing with MML,emacs-mime}.
5226@end ifinfo
5227@ifnotinfo
5228See the section Composing in
5229@uref{http://www.gnus.org/manual/emacs-mime.html, @cite{The Emacs MIME
5230Manual}}.
5231@end ifnotinfo
5232}. The option @code{mh-compose-insertion} can be used to choose
5233between them. By default, this option is set to @samp{MML} if it is
5234supported since it provides a lot more functionality. This option can
5235also be set to @samp{MH} if MH-style directives are preferred.
5236
5237@cindex media types
5238@cindex MIME, media types
5239
5240The MH-E @sc{mime} commands require a @dfn{media type} for each body
5241part or attachment. For example, a PDF document is of type
5242@samp{application/pdf} and an HTML document is of type
5243@samp{text/html}. Some commands fill in the media type for you,
5244whereas others require you to enter one.
5245
5246@cindex @command{file}
5247@cindex @file{/etc/mime.types}
5248@cindex files, @file{/etc/mime.types}
5249@cindex Unix commands, @command{file}
5250@findex mailcap-mime-types
5251
5252In the cases where MH-E can do so, it will determine the media type
5253automatically. It uses the @command{file} command to do this. Failing
5254that, the Emacs function @code{mailcap-mime-types} is used to provide
5255a list from which to choose. This function usually reads the file
5256@file{/etc/mime.types}.
5257
5258Whether the media type is chosen automatically, or you choose it from
5259a list, use the type that seems to match best the file that you are
5260including. In the case of binaries, the media type
5261@samp{application/x-executable} can be useful. If you can't find an
5262appropriate media type, use @samp{text/plain} for text messages and
5263@samp{application/octet-stream} for everything else.
5264
5265@cindex content description
5266@cindex MIME, content description
5267
5268You are also sometimes asked for a @dfn{content description}. This is
5269simply an optional brief phrase, in your own words, that describes the
5270object. If you don't care to enter a content description, just press
5271return and none will be included; however, a reader may skip over
5272multimedia fields unless the content description is compelling.
5273
5274You can also create your own @sc{mime} body parts. In the following
5275example, I describe how you can create and edit a @samp{text/enriched}
5276body part to liven up your plain text messages with boldface,
5277underlining, and italics. I include an Emacs function which inserts
5278enriched text tags.
5279
5280@smalllisp
5281@group
5282(defvar enriched-text-types '(("b" . "bold") ("i" . "italic")
5283 ("u" . "underline")
5284 ("s" . "smaller") ("B" . "bigger")
5285 ("f" . "fixed")
5286 ("c" . "center"))
5287 "Alist of (final-character . tag) choices for add-enriched-text.
5288Additional types can be found in RFC 1563.")
5289
5290(defun add-enriched-text (begin end)
5291 "Add enriched text tags around region.
5292The tag used comes from the list enriched-text-types and is
5293specified by the last keystroke of the command. When called from Lisp,
5294arguments are BEGIN and END@."
5295 (interactive "r")
5296 ;; @r{Set type to the tag indicated by the last keystroke.}
5297 (let ((type (cdr (assoc (char-to-string (logior last-input-char ?@w{`}))
5298 enriched-text-types))))
5299 (save-restriction ; @r{restores state from narrow-to-region}
5300 (narrow-to-region begin end) ; @r{narrow view to region}
5301 (goto-char (point-min)) ; @r{move to beginning of text}
5302 (insert "<" type ">") ; @r{insert beginning tag}
5303 (goto-char (point-max)) ; @r{move to end of text}
5304 (insert "</" type ">")))) ; @r{insert terminating tag}
5305@i{Emacs function for entering enriched text}
5306
5307@end group
5308@end smalllisp
5309
5310To use the function @code{add-enriched-text}, first add it to
5311@file{~/.emacs} and create key bindings for it (@pxref{Composing}).
5312
5313Then, in your plain text message, set the mark with @kbd{C-@@} or
5314@kbd{C-@key{SPC}}, type in the text to be highlighted, and type @kbd{C-c t
5315b}. This adds @samp{<bold>} where you set the mark and adds
5316@samp{</bold>} at the location of your cursor, giving you something
5317like: @samp{You should be <bold>very</bold>}.
5318
5319Before sending this message, use @kbd{C-c C-m C-m}
5320(@code{mh-mml-to-mime})@footnote{Use @kbd{C-c C-e}
5321(@code{mh-mh-to-mime}) if you're using MH-style directives.} to add
5322MIME header fields. Then replace @samp{text/plain} with
5323@samp{text/enriched} in the @samp{Content-Type:} header field.
5324
5325You may also be interested in investigating @code{sgml-mode}.
5326
5327@subheading Including Files
5328
5329@cindex attachments, inserting
5330@cindex images
5331@cindex MIME, images
5332@cindex MIME, sound
5333@cindex MIME, video
5334@cindex sound
5335@cindex video
5336@findex mh-compose-insertion
5337@kindex C-c C-m C-i
5338@kindex C-c C-m i
5339@vindex mh-compose-insertion
5340
5341Binaries, images, sound, and video can be inserted in your message
5342with the command @kbd{C-c C-m C-i} (@code{mh-compose-insertion}). You
5343are prompted for the filename containing the object, the media type if
5344it cannot be determined automatically, and a content description. If
5345you're using MH-style directives, you will also be prompted for
5346additional attributes.
5347
5348@subheading Forwarding Multimedia Messages
5349
5350@findex mh-compose-forward
5351@kindex C-c C-m C-f
5352@kindex C-c C-m f
5353
5354Mail may be forwarded with @sc{mime} using the command @kbd{C-c C-m
5355C-f} (@code{mh-compose-forward}). You are prompted for a content
5356description, the name of the folder in which the messages to forward
5357are located, and a range of messages, which defaults to the current
5358message in that folder. @xref{Ranges}.
5359
5360@subheading Including an FTP Reference
5361
5362@cindex @command{ftp}
5363@cindex MIME, @command{ftp}
5364@cindex Unix commands, @command{ftp}
5365@findex mh-mh-compose-anon-ftp
5366@kindex C-c C-m C-g
5367@kindex C-c C-m g
5368
5369You can have your message initiate an @command{ftp} transfer when the
5370recipient reads the message. To do this, use the command @kbd{C-c C-m
5371C-g} (@code{mh-mh-compose-anon-ftp}). You are prompted for the remote
5372host and filename, the media type, and the content description.
5373
5374@subheading Including tar Files
5375
5376@cindex @command{ftp}
5377@cindex @command{tar}
5378@cindex MIME, @command{ftp}
5379@cindex MIME, @command{tar}
5380@cindex Unix commands, @command{ftp}
5381@cindex Unix commands, @command{tar}
5382@findex mh-mh-compose-anon-ftp
5383@findex mh-mh-compose-external-compressed-tar
5384@kindex C-c C-m C-g
5385@kindex C-c C-m C-t
5386@kindex C-c C-m t
5387
5388If the remote file is a compressed tar file, you can use @kbd{C-c C-m
5389C-t} (@code{mh-mh-compose-external-compressed-tar}). Then, in addition
5390to retrieving the file via anonymous @emph{ftp} as per the command
5391@kbd{C-c C-m C-g} (@code{mh-mh-compose-anon-ftp}), the file will also
5392be uncompressed and untarred. You are prompted for the remote host and
5393filename and the content description.
5394
5395@subheading Including Other External Files
5396
5397@findex mh-mh-compose-external-type
5398@kindex C-c C-m C-x
5399@kindex C-c C-m x
5400
5401The command @kbd{C-c C-m C-x} (@code{mh-mh-compose-external-type}) is
5402a general utility for referencing external files. In fact, all of the
5403other commands that insert tags to access external files call this
5404command. You are prompted for the access type, remote host and
5405filename, and content type. If you provide a prefix argument, you are
5406also prompted for a content description, attributes, parameters, and a
5407comment.
5408
5409@subheading Previewing Multimedia Messages
5410
5411When you are finished editing a @sc{mime} message, it might look like this:
5412
5413@cartouche
5414@smallexample
54153 t08/24 root received fax files on Wed Aug 24 11:00:
54164+t08/24 To:wohler Test<<This is a test message to get the
5417
5418
5419
5420
5421
5422--:%% @{+inbox@} 4 msgs (1-4) Bot L4 (MH-Folder Show)---------------
5423To: wohler
5424cc:
5425Subject: Test of MIME
5426--------
5427Here is the SETI@@Home logo:
5428
5429<#part type="image/x-xpm" filename="~/lib/images/setiathome.xpm"
5430disposition=inline description="SETI@@home logo">
5431<#/part>
5432--:** @{draft@} All L8 (MH-Letter)----------------------------------
5433
5434@end smallexample
5435@end cartouche
5436@i{MH-E @sc{mime} draft}
5437
5438@findex mh-mml-to-mime
5439@kindex C-c C-m C-m
5440@kindex C-c C-m m
5441
5442Typically, you send a message with attachments just like any other
5443message (@pxref{Sending Message}).
5444
5445@findex mh-mml-to-mime
5446@kindex C-c C-m C-m
5447
5448However, you may take a sneak preview of the @sc{mime} encoding if you
5449wish by running the command @kbd{C-c C-m C-m} (@code{mh-mml-to-mime}).
5450The following screen shows the @sc{mime} encoding specified by the
5451tags. You can see why mail user agents are usually built to hide these
5452details from the user.
5453
5454@cartouche
5455@smallexample
5456To: wohler
5457cc:
5458Subject: Test of MIME
3cf38f97 5459X-Mailer: MH-E 8.1; nmh 1.1; GNU Emacs 23.1
4009494e
GM
5460MIME-Version: 1.0
5461Content-Type: multipart/mixed; boundary="=-=-="
5462--------
5463--=-=-=
5464
5465Here is the SETI@@Home logo:
5466
5467
5468--=-=-=
5469Content-Type: image/x-xpm
5470Content-Disposition: inline; filename=setiathome.xpm
5471Content-Transfer-Encoding: base64
5472Content-Description: SETI@@home logo
5473
5474LyogWFBNICovCnN0YXRpYyBjaGFyICogc2V0aWF0aG9tZV94cG1bXSA9IHsKIjQ1IDQ1IDc2N
5475--:-- @{draft@} Top L1 (MH-Letter)----------------------------------
5476
5477@end smallexample
5478@end cartouche
5479@i{MH-E @sc{mime} draft ready to send}
5480
5481@cindex undo effects of mh-mml-to-mime
5482
5483This action can be undone by running @kbd{C-_} (@code{undo}).
5484
5485@cindex @command{mhbuild}
5486@cindex @command{mhn}
5487@cindex MH commands, @command{mhbuild}
5488@cindex MH commands, @command{mhn}
5489@cindex undo effects of mh-mh-to-mime
5490@findex mh-mh-to-mime
5491@findex mh-mh-to-mime-undo
5492@kindex C-c C-e
5493@kindex C-c C-m C-m
5494@kindex C-c C-m C-u
5495@kindex C-c C-m u
5496
5497If you're using MH-style directives, use @kbd{C-c C-e}
5498(@code{mh-mh-to-mime}) instead of @kbd{C-c C-m C-m}. This runs the
5499command @command{mhbuild} (@command{mhn}) on the message which expands
5500the tags@footnote{See the section
5501@uref{@value{MH-BOOK-HOME}/usimim.html#SeMIMa, Sending MIME Mail} in
5502the MH book.}. This action can be undone by running @kbd{C-c C-m C-u}
5503(@code{mh-mh-to-mime-undo}), which works by reverting to a backup
5504file. You are prompted to confirm this action, but you can avoid the
5505confirmation by adding an argument (for example, @kbd{C-u C-c C-m
5506C-u}).
5507
5508@kindex C-c C-e
5509@vindex mh-mh-to-mime-args
5510
5511If you wish to pass additional arguments to @command{mhbuild}
5512(@command{mhn}) to affect how it builds your message, use the option
5513@code{mh-mh-to-mime-args}. For example, you can build a consistency
5514check into the message by setting @code{mh-mh-to-mime-args} to
5515@samp{-check}. The recipient of your message can then run
5516@samp{mhbuild -check} on the message---@command{mhbuild}
5517(@command{mhn}) will complain if the message has been corrupted on the
5518way. The command @kbd{C-c C-e} only consults this option when given a
5519prefix argument (as in @kbd{C-u C-c C-e}).
5520
5521@kindex C-c C-e
5522@vindex mh-mh-to-mime-hook
5523
5524The hook @code{mh-mh-to-mime-hook} is called after the message has
5525been formatted by @kbd{C-c C-e}.
5526
5527@node Sending PGP, Checking Recipients, Adding Attachments, Editing Drafts
5528@section Signing and Encrypting Messages
5529
5530@cindex signing messages
5531@cindex encrypting messages
5532@cindex RFC 3156
5533
5534MH-E can sign and encrypt messages as defined in
5535@uref{http://www.rfc-editor.org/rfc/rfc3156.txt, RFC 3156}. If you
5536should choose to sign or encrypt your message, use one of the
5537following commands to do so any time before sending your message.
5538
5539@findex mh-mml-secure-message-encrypt
5540@findex mh-mml-secure-message-sign
5541@findex mh-mml-secure-message-signencrypt
5542@kindex C-c C-m C-e
5543@kindex C-c C-m C-s
5544@kindex C-c C-m e e
5545@kindex C-c C-m e s
5546@kindex C-c C-m s e
5547@kindex C-c C-m s s
5548
5549The command @kbd{C-c C-m C-s} (@code{mh-mml-secure-message-sign})
5550inserts the following tag:
5551
5552@smallexample
5553<#secure method=pgpmime mode=sign>
5554@end smallexample
5555
5556This is used to sign your message digitally. Likewise, the command
5557@kbd{C-c C-m C-e} (@code{mh-mml-secure-message-encrypt}) inserts the
5558following tag:
5559
5560@smallexample
5561<#secure method=pgpmime mode=encrypt>
5562@end smallexample
5563
5564This is used to encrypt your message. Finally, the command @kbd{C-c
5565C-m s e} (@code{mh-mml-secure-message-signencrypt}) inserts the
5566following tag:
5567
5568@smallexample
5569<#secure method=pgpmime mode=signencrypt>
5570@end smallexample
5571
5572@findex mh-mml-unsecure-message
5573@kindex C-c C-m C-n
5574@kindex C-c C-m n
5575@vindex mh-mml-method-default
5576
5577This is used to sign and encrypt your message. In each of these cases,
5578a proper multipart message is created for you when you send the
5579message. Use the command @kbd{C-c C-m C-n}
5580(@code{mh-mml-unsecure-message}) to remove these tags. Use a prefix
5581argument (as in @kbd{C-u C-c C-m s e}) to be prompted for one of the
5582possible security methods (see @code{mh-mml-method-default}).
5583
5584@vindex mh-mml-method-default
5585
5586The option @code{mh-mml-method-default} is used to select between a
5587variety of mail security mechanisms. The default is @samp{PGP (MIME)}
5588if it is supported; otherwise, the default is @samp{None}. Other
5589mechanisms include vanilla @samp{PGP} and @samp{S/MIME}.
5590
5591@cindex @samp{pgg} customization group
5592@cindex PGG
5593@cindex customization group, @samp{pgg}
5594
5595The @samp{pgg} customization group may have some settings which may
5596interest you.
5597@iftex
5598See @cite{The PGG Manual}.
5599@end iftex
5600@ifinfo
5601@xref{Top, , The PGG Manual, pgg, The PGG Manual}.
5602@end ifinfo
5603@ifhtml
5604See
5154917e 5605@uref{http://www.gnu.org/software/emacs/manual/pgg.html,
4009494e
GM
5606@cite{The PGG Manual}}.
5607@end ifhtml
5608
36a672f6
GM
5609@cindex header field, @samp{Fcc}
5610@cindex @samp{Fcc} header field
4009494e
GM
5611@vindex pgg-encrypt-for-me
5612
5613In particular, I turn on the option @code{pgg-encrypt-for-me} so that
5614all messages I encrypt are encrypted with my public key as well. If
5615you keep a copy of all of your outgoing mail with a @samp{Fcc:} header
5616field, this setting is vital so that you can read the mail you write!
5617
5618@node Checking Recipients, Sending Message, Sending PGP, Editing Drafts
5619@section Checking Recipients
5620
5621@cindex @samp{*MH-E Recipients*}
5622@cindex @command{whom}
5623@cindex MH commands, @command{whom}
5624@cindex buffers, @samp{*MH-E Recipients*}
5625@cindex checking recipients
5626@cindex recipients, checking
5627@findex mh-check-whom
5628@kindex C-c C-w
5629
5630The command @kbd{C-c C-w} (@code{mh-check-whom}) expands aliases so
5631you can check the actual address(es) in the alias. A new buffer named
5632@samp{*MH-E Recipients*} is created with the output of @command{whom}
5633(@pxref{Miscellaneous})@footnote{See the section
f99f1641 5634@uref{@value{MH-BOOK-HOME}/senove.html#WhaPro, What now?---and the
4009494e
GM
5635whatnow Program} in the MH book.}.
5636
5637@node Sending Message, Killing Draft, Checking Recipients, Editing Drafts
5638@section Sending a Message
5639
5640@cindex buffers, @samp{*MH-E Mail Delivery*}
5641@cindex @samp{*MH-E Mail Delivery*}
5642@cindex sending mail
5643@findex mh-send-letter
5644@kindex C-c C-c
5645
5646When you are all through editing a message, you send it with the
5647command @kbd{C-c C-c} (@code{mh-send-letter}). You can give a prefix
5648argument (as in @kbd{C-u C-c C-c}) to monitor the first stage of the
5649delivery; this output can be found in a buffer called @samp{*MH-E Mail
5650Delivery*} (@pxref{Miscellaneous}).
5651
5652@cindex sending mail
5653@cindex spell check
5654@findex ispell-message
5655@kindex C-c C-c
5656@vindex mh-before-send-letter-hook
5657
5658The hook @code{mh-before-send-letter-hook} is run at the beginning of
5659the command @kbd{C-c C-c}. For example, if you want to check your
5660spelling in your message before sending, add the function
5661@code{ispell-message}.
5662
5663@cindex @command{send}
5664@cindex MH commands, @command{send}
5665@vindex mh-send-prog
5666
5667In case the MH @command{send} program@footnote{See the section
5668@uref{@value{MH-BOOK-HOME}/sensen.html, Sending Some Mail: comp send}
5669in the MH book.} is installed under a different name, use
5670@code{mh-send-prog} to tell MH-E the name.
5671
bfe16263
BW
5672The hook @code{mh-annotate-msg-hook} is run after annotating the
5673message and scan line (@pxref{Sending Mail}).
5674
4009494e
GM
5675@node Killing Draft, , Sending Message, Editing Drafts
5676@section Killing the Draft
5677
5678@cindex killing draft
5679@findex kill-buffer
5680@findex mh-fully-kill-draft
5681@kindex C-c C-q
5682@kindex C-x k
5683
5684If for some reason you are not happy with the draft, you can use the
5685command @kbd{C-c C-q} (@code{mh-fully-kill-draft}) to kill the draft
5686buffer and delete the draft message. Use the command @kbd{C-x k}
5687(@code{kill-buffer}) if you don't want to delete the draft message.
5688
5689@node Aliases, Identities, Editing Drafts, Top
5690@chapter Aliases
5691
5692@cindex aliases
5693
1df7defd 5694MH aliases are used in the same way in MH-E as they are in MH@. Any
4009494e
GM
5695alias listed as a recipient will be expanded when the message is sent.
5696This chapter discusses other things you can do with aliases in MH-E.
5697
5698@cindex MH-Letter mode
5699@cindex modes, MH-Letter
5700
5701The following commands are available in MH-Letter mode with the
5702exception of @code{mh-alias-reload} which can be called from anywhere.
5703
5704@table @kbd
5705@kindex @key{SPC}
5706@findex mh-letter-complete-or-space
5707@item @key{SPC}
5708Perform completion or insert space (@code{mh-letter-complete-or-space}).
5709@c -------------------------
5710@kindex M-@key{TAB}
5711@findex mh-letter-complete
5712@item M-@key{TAB}
5713Perform completion on header field or word preceding point
5714(@code{mh-letter-complete}).
5715@c -------------------------
5716@findex mh-alias-apropos
5717@item mh-alias-apropos
5718Show all aliases or addresses that match a regular expression.
5719@c -------------------------
5720@findex mh-alias-grab-from-field
5721@item mh-alias-grab-from-field
5722Add alias for the sender of the current message
5723@c -------------------------
5724@findex mh-alias-reload
5725@item mh-alias-reload
5726Reload MH aliases.
5727@end table
5728
5729@cindex @samp{mh-alias} customization group
5730@cindex customization group, @samp{mh-alias}
5731
5732The @samp{mh-alias} customization group contains options associated
5733with aliases.
5734
5735@vtable @code
5736@item mh-alias-completion-ignore-case-flag
5737On means don't consider case significant in MH alias completion
5738(default: @samp{on}).
5739@c -------------------------
5740@item mh-alias-expand-aliases-flag
5741On means to expand aliases entered in the minibuffer (default:
5742@samp{off}).
5743@c -------------------------
5744@item mh-alias-flash-on-comma
5745Specify whether to flash address or warn on translation (default: @samp{Flash
5746but Don't Warn If No Alias}).
5747@c -------------------------
5748@item mh-alias-insert-file
5749Filename used to store a new MH-E alias (default: @samp{Use Aliasfile
5750Profile Component}).
5751@c -------------------------
5752@item mh-alias-insertion-location
5753Specifies where new aliases are entered in alias files (default:
5754@samp{Alphabetical}).
5755@c -------------------------
5756@item mh-alias-local-users
5757If @samp{on}, local users are added to alias completion (default:
5758@samp{on}).
5759@c -------------------------
5760@item mh-alias-local-users-prefix
5761String prefixed to the real names of users from the password file
5762(default: @code{"local."}.
5763@c -------------------------
5764@item mh-alias-passwd-gecos-comma-separator-flag
5765On means the GECOS field in the password file uses a comma separator
5766(default: @samp{on}).
5767@end vtable
5768
5769The following hook is available.
5770
5771@vtable @code
5772@item mh-alias-reloaded-hook
5773Hook run by @code{mh-alias-reload} after loading aliases (default:
5774@code{nil}).
5775@end vtable
5776
5777@subheading Adding Addresses to Draft
5778
5779You can use aliases when you are adding recipients to a message.
5780
5781@findex minibuffer-complete
5782@kindex @key{TAB}
5783@vindex mh-alias-expand-aliases-flag
5784@vindex mh-compose-prompt-flag
5785
5786In order to use minibuffer prompting for recipients and the subject
5787line in the minibuffer, turn on the option
5788@code{mh-compose-prompt-flag} (@pxref{Composing}), and use the
5789@key{TAB} (@code{minibuffer-complete}) command to complete aliases
5790(and optionally local logins) when prompted for the recipients. Turn
5791on the option @code{mh-alias-expand-aliases-flag} if you want these
5792aliases to be expanded to their respective addresses in the draft.
5793
5794@findex mh-letter-complete
5795@findex mh-letter-complete-or-space
5796@kindex @key{SPC}
5797@kindex M-@key{TAB}
5798
5799Otherwise, you can complete aliases in the header of the draft with
5800@kbd{M-@key{TAB}} (@code{mh-letter-complete}) or @key{SPC}
5801(@code{mh-letter-complete-or-space}).
5802
5803@vindex mh-alias-completion-ignore-case-flag
5804
1df7defd 5805As MH ignores case in the aliases, so too does MH-E@. However, you may
4009494e
GM
5806turn off the option @code{mh-alias-completion-ignore-case-flag} to
5807make case significant which can be used to segregate completion of
5808your aliases. You might use uppercase for mailing lists and lowercase
5809for people. For example, you might have:
5810
5811@smallexample
5812mark.baushke: Mark Baushke <mdb@@stop.mail-abuse.org>
5813MH-E: MH-E Mailing List <mh-e-devel@@stop.mail-abuse.org>
5814@end smallexample
5815
5816When this option is turned off, if you were to type @kbd{M} in the
5817@samp{To:} field and then @kbd{M-@key{TAB}}, then you'd get the list;
5818if you started with @kbd{m} and then entered @kbd{M-@key{TAB}}, then
5819you'd get Mark's address. Note that this option affects completion
5820only. If you were to enter @kbd{Mark.Baushke}, it would still be
5821identified with your @samp{mark.baushke} alias.
5822
5823@findex mh-alias-minibuffer-confirm-address
5824@findex mh-letter-confirm-address
5825@vindex mh-alias-flash-on-comma
5826@vindex mh-compose-prompt-flag
5827
5828To verify that the alias you've entered is valid, the alias will be
5829displayed in the minibuffer when you type a comma
5830(@code{mh-letter-confirm-address} or
5831@code{mh-alias-minibuffer-confirm-address} if the option
5832@code{mh-compose-prompt-flag} is turned on). @xref{Composing}. This
5833behavior can be controlled with the option
5834@code{mh-alias-flash-on-comma} which provides three choices:
5835@samp{Flash but Don't Warn If No Alias}, @samp{Flash and Warn If No
5836Alias}, and @samp{Don't Flash Nor Warn If No Alias}.
5837
5838For another way to verify the alias expansion, see @ref{Checking
5839Recipients}.
5840
5841@subheading Loading Aliases
5842
5843@cindex @command{ali}
5844@cindex @file{/etc/nmh/MailAliases}
36a672f6 5845@cindex @samp{Aliasfile} MH profile component
4009494e 5846@cindex MH commands, @command{ali}
36a672f6 5847@cindex MH profile component, @samp{Aliasfile}
4009494e
GM
5848@cindex files, @file{/etc/nmh/MailAliases}
5849
5850MH-E loads aliases for completion and folder name hints from various
5851places. It uses the MH command @command{ali}@footnote{See the section
5852@uref{@value{MH-BOOK-HOME}/mh.html, MH Aliases} in the MH book.} to
5853read aliases from the files listed in the profile component
5854@samp{Aliasfile:} as well as system-wide aliases (for example,
5855@file{/etc/nmh/MailAliases}).
5856
5857@cindex @file{/etc/passwd}
5858@cindex files, @file{/etc/passwd}
5859
5860In addition, aliases are created from @file{/etc/passwd} entries with
5861a user ID larger than a magical number, typically 200. This can be a
5862handy tool on a machine where you and co-workers exchange messages.
5863These aliases have the form @samp{local.@var{first.last}} if a real
5864name is present in the password file. Otherwise, the alias will have
5865the form @samp{local.@var{login}}.
5866
5867@vindex mh-alias-local-users-prefix
5868
5869The prefix @samp{local.} can be modified via the option
5870@code{mh-alias-local-users-prefix}. This option can also be set to
5871@samp{Use Login}.
5872
5873For example, consider the following password file entry:
5874
5875@smallexample
5876psg:x:1000:1000:Peter S Galbraith,,,:/home/psg:/bin/tcsh
5877@end smallexample
5878
5879@vindex mh-alias-local-users-prefix
5880
5881The following settings of option @code{mh-alias-local-users-prefix}
5882will produce the associated aliases:
5883
5884@table @code
5885@item "local."
5886local.peter.galbraith
5887@c -------------------------
5888@item ""
5889peter.galbraith
5890@c -------------------------
5891@item Use Login
5892psg
5893@end table
5894
5895@vindex mh-alias-passwd-gecos-comma-separator-flag
5896
5897In the example above, commas are used to separate different values
5898within the so-called GECOS field. This is a fairly common usage.
5899However, in the rare case that the GECOS field in your password file
5900is not separated by commas and whose contents may contain commas, you
5901can turn the option @code{mh-alias-passwd-gecos-comma-separator-flag}
5902off.
5903
5904@cindex NIS, obtaining local aliases from
5905@cindex @samp{ypcat passwd}
5906@vindex mh-alias-local-users
5907
5908If you're on a system with thousands of users you don't know, and the
5909loading of local aliases slows MH-E down noticeably, then the local
5910alias feature can be disabled by turning off the option
5911@code{mh-alias-local-users}. This option also takes a string which is
5912executed to generate the password file. For example, use @samp{ypcat
5913passwd} to obtain the NIS password file.
5914
5915@findex mh-alias-reload
5916@kindex M-x mh-alias-reload
5917@vindex mh-alias-reloaded-hook
5918
5919Since aliases are updated frequently, MH-E reloads aliases
5920automatically whenever an alias lookup occurs if an alias source has
5921changed. However, you can reload your aliases manually by calling the
5922command @kbd{M-x mh-alias-reload} directly. This command runs
5923@code{mh-alias-reloaded-hook} after the aliases have been loaded.
5924
5925@subheading Adding Aliases
5926
5927In the past, you have manually added aliases to your alias file(s)
5928listed in your @samp{Aliasfile:} profile component. MH-E provides
5929other methods for maintaining your alias file(s).
5930
5931@findex mh-alias-add-alias
5932@kindex M-x mh-alias-add-alias
5933
5934You can use the @kbd{M-x mh-alias-add-alias} command which will prompt
5935you for the alias and address that you would like to add. If the alias
5936exists already, you will have the choice of inserting the new alias
5937before or after the old alias. In the former case, this alias will be
5938used when sending mail to this alias. In the latter case, the alias
5939serves as an additional folder name hint when filing messages
5940(@pxref{Folder Selection}).
5941
5942Earlier, the alias prefix @samp{local} was presented. You can use
5943other prefixes to organize your aliases or disambiguate entries. You
5944might use prefixes for locales, jobs, or activities. For example, I
5945have:
5946
5947@smallexample
5948@group
5949; Work
5950attensity.don.mitchell: Don Mitchell <dmitchell@@stop.mail-abuse.com>
5951isharp.don.mitchell: Don Mitchell <donaldsmitchell@@stop.mail-abuse.com>
5952...
5953; Sport
5954diving.ken.mayer: Ken Mayer <kmayer@@stop.mail-abuse.com>
5955sailing.mike.maloney: Mike Maloney <mmaloney@@stop.mail-abuse.com>
5956...
5957; Personal
5958ariane.kolkmann: Ariane Kolkmann <ArianeKolkmann@@stop.mail-abuse.com>
5959...
5960@end group
5961@end smallexample
5962
5963Using prefixes instead of postfixes helps you explore aliases during
5964completion. If you forget the name of an old dive buddy, you can enter
5965@samp{div} and then @key{SPC} to get a listing of all your dive buddies.
5966
5967@kindex M-x mh-alias-add-address-under-point
5968@kindex M-x mh-alias-grab-from-field
5969
5970An alias for the sender of the current message is added automatically
5971by clicking on the @samp{Grab From alias} tool bar button or by running
5972the @kbd{M-x mh-alias-grab-from-field} command. Aliases for other
5973recipients of the current message are added by placing your cursor
5974over the desired recipient and giving the @kbd{M-x
5975mh-alias-add-address-under-point} command.
5976
5977@vindex mh-alias-insert-file
5978@vindex mh-alias-insertion-location
5979
5980The options @code{mh-alias-insert-file} and
5981@code{mh-alias-insertion-location} controls how and where these aliases
5982are inserted.
5983
5984@vindex mh-alias-insert-file
5985
5986The default setting of option @code{mh-alias-insert-file} is @samp{Use
5987Aliasfile Profile Component}. This option can also hold the name of a
5988file or a list a file names. If this option is set to a list of file
5989names, or the @samp{Aliasfile:} profile component contains more than
5990one file name, MH-E will prompt for one of them.
5991
5992@vindex mh-alias-insertion-location
5993
5994The option @code{mh-alias-insertion-location} is set to
5995@samp{Alphabetical} by default. If you organize your alias file in
5996other ways, then the settings @samp{Top} and @samp{Bottom} might be
5997more appropriate.
5998
5999@subheading Querying Aliases
6000
6001@cindex regular expressions, @code{mh-alias-apropos}
6002@findex mh-alias-apropos
6003@kindex M-x mh-alias-apropos
6004
6005If you can't quite remember an alias, you can use @kbd{M-x
6006mh-alias-apropos} to show all aliases or addresses that match a
6007regular expression
6008@ifnothtml
6009(@pxref{Regexps, , Syntax of Regular Expressions, emacs, The
6010GNU Emacs Manual}).
6011@end ifnothtml
6012@ifhtml
6013(see the section
fc0c5af8 6014@uref{http://www.gnu.org/software/emacs/manual/html_node/emacs/Regexps.html,
4009494e
GM
6015Syntax of Regular Expressions} in
6016@cite{The GNU Emacs Manual}).
6017@end ifhtml
6018
6019@node Identities, Speedbar, Aliases, Top
6020@chapter Identities
6021
6022@cindex identities
6023@cindex multiple personalities
6024
6025MH-E supports the concept of multiple personalities or identities.
6026This means that you can easily have a different header and signature
6027at home and at work.
6028
6029@cindex @samp{Identity} menu
6030@cindex menu, @samp{Identity}
6031
6032A couple of commands are used to insert identities in MH-Letter mode
6033which are also found in the @samp{Identity} menu.
6034
6035@table @kbd
6036@kindex C-c C-d
6037@findex mh-insert-identity
6038@item C-c C-d
6039Insert fields specified by given identity (@code{mh-insert-identity}).
6040@c -------------------------
6041@cindex @samp{Identity > Insert Auto Fields} menu item
6042@cindex menu item, @samp{Identity > Insert Auto Fields}
6043@kindex C-c M-d
6044@findex mh-insert-auto-fields
6045@item C-c M-d
6046Insert custom fields if recipient found in @code{mh-auto-fields-list}
6047(@code{mh-insert-auto-fields}).
6048@end table
6049
6050@cindex @samp{mh-identity} customization group
6051@cindex customization group, @samp{mh-identity}
6052
6053The @samp{mh-identity} customization group contains the following
6054options.
6055
6056@vtable @code
6057@item mh-auto-fields-list
6058List of recipients for which header lines are automatically inserted
6059(default: @code{nil}).
6060@c -------------------------
6061@item mh-auto-fields-prompt-flag
6062On means to prompt before sending if fields inserted (default:
6063@samp{on})
6064@c -------------------------
6065@item mh-identity-default
6066Default identity to use when @code{mh-letter-mode} is called (default:
6067@samp{None}).
6068@c -------------------------
6069@item mh-identity-handlers
6070Handler functions for fields in @code{mh-identity-list}.
6071@c -------------------------
6072@item mh-identity-list
6073List of identities (default: @code{nil}).
6074@end vtable
6075
6076Some of the common header fields that people change depending on the
6077context are the @samp{From:} and @samp{Organization:} fields, as well
6078as the signature.
6079
6080@vindex mh-identity-list
6081
6082This is done by customizing the option @code{mh-identity-list}. In the
6083customization buffer for this option, click on the @samp{INS} button
6084and enter a label such as @samp{Home} or @samp{Work}. Then click on
6085the @samp{INS} button with the label @samp{Add at least one item
6086below}. The @samp{Value Menu} has the following menu items:
6087
6088@table @samp
36a672f6
GM
6089@cindex header field, @samp{From}
6090@cindex @samp{From} header field
4009494e
GM
6091@item From Field
6092Specify an alternate @samp{From:} header field. You must include a
6093valid email address. A standard format is @samp{First Last
6094<login@@host.domain>}. If you use an initial with a period, then you
6095must quote your name as in @samp{"First I. Last"
6096<login@@host.domain>}.
6097@c -------------------------
36a672f6
GM
6098@cindex header field, @samp{Organization}
6099@cindex @samp{Organization} header field
4009494e
GM
6100@item Organization Field
6101People usually list the name of the company where they work here.
6102@c -------------------------
6103@item Other Field
6104Set any arbitrary header field and value here. Unless the header field
6105is a standard one, precede the name of your field's label with
6106@samp{X-}, as in @samp{X-Fruit-of-the-Day:}.
6107@c -------------------------
6108@item Attribution Verb
6109This value overrides the setting of
6110@code{mh-extract-from-attribution-verb}. @xref{Inserting Letter}.
6111@c -------------------------
6112@cindex signature
6113@vindex mh-signature-file-name
6114@item Signature
6115Set your signature with this item. You can specify the contents of
6116@code{mh-signature-file-name}, a file, or a function.
6117@xref{Signature}.
6118@c -------------------------
6119@item GPG Key ID
6120Specify a different key to sign or encrypt messages.
6121@end table
6122
6123@cindex Identity menu
6124@cindex menu, Identity
6125@findex mh-insert-identity
6126@kindex C-c C-d
6127
6128You can select the identities you have added via the menu called
6129@samp{Identity} in the MH-Letter buffer. You can also use @kbd{C-c
6130C-d} (@code{mh-insert-identity}). To clear the fields and signature
6131added by the identity, select the @samp{None} identity.
6132
6133@cindex menu item, @samp{Identity > Customize Identities}
6134@cindex menu item, @samp{Identity > Save as Default}
6135@cindex menu item, @samp{Identity > Set Default for Session}
6136@cindex @samp{Identity > Customize Identities} menu item
6137@cindex @samp{Identity > Save as Default} menu item
6138@cindex @samp{Identity > Set Default for Session} menu item
6139@vindex mh-identity-default
6140
6141The @samp{Identity} menu contains two other items to save you from
6142having to set the identity on every message. The menu item @samp{Set
6143Default for Session} can be used to set the default identity to the
6144current identity until you exit Emacs. The menu item @samp{Save as
6145Default} sets the option @code{mh-identity-default} to the current
6146identity setting. You can also customize the option
6147@code{mh-identity-default} in the usual fashion. If you find that you
6148need to add another identity, the menu item @samp{Customize
6149Identities} is available for your convenience.
6150
6151@cindex regular expressions, @code{mh-auto-fields-list}
6152@vindex mh-auto-fields-list
6153
6154The option @code{mh-auto-fields-list} can also be used to set the
6155identity depending on the recipient to provide even more control. To
6156customize @code{mh-auto-fields-list}, click on the @samp{INS} button
6157and enter a regular expression for the recipient's address
6158@ifnothtml
6159(@pxref{Regexps, , Syntax of Regular Expressions, emacs, The
6160GNU Emacs Manual}).
6161@end ifnothtml
6162@ifhtml
6163(see the section
fc0c5af8 6164@uref{http://www.gnu.org/software/emacs/manual/html_node/emacs/Regexps.html,
4009494e
GM
6165Syntax of Regular Expressions} in
6166@cite{The GNU Emacs Manual}).
6167@end ifhtml
6168Click on the @samp{INS} button with the @samp{Add at least one item
6169below} label. The @samp{Value Menu} contains the following menu items:
6170
6171@table @samp
6172@item Identity
6173Select an identity from those configured in @code{mh-identity-list}.
6174All of the information for that identity will be added if the
6175recipient matches.
6176@c -------------------------
36a672f6
GM
6177@cindex @samp{Fcc} header field
6178@cindex header field, @samp{Fcc}
4009494e
GM
6179@item Fcc Field
6180Insert an @samp{Fcc:} header field with the folder you provide. When
6181you send the message, MH will put a copy of your message in this
6182folder.
6183@c -------------------------
36a672f6
GM
6184@cindex @samp{Mail-Followup-To} header field
6185@cindex header field, @samp{Mail-Followup-To}
4009494e
GM
6186@item Mail-Followup-To Field
6187Insert an @samp{Mail-Followup-To:} header field with the recipients
6188you provide. If the recipient's mail user agent supports this header
6189field@footnote{@samp{Mail-Followup-To:} is supported by nmh.}, then
6190their replies will go to the addresses listed. This is useful if their
6191replies go both to the list and to you and you don't have a mechanism
6192to suppress duplicates. If you reply to someone not on the list, you
6193must either remove the @samp{Mail-Followup-To:} field, or ensure the
6194recipient is also listed there so that he receives replies to your
6195reply.
6196@c -------------------------
6197@item Other Field
6198Other header fields may be added using this menu item.
6199@end table
6200
6201@findex mh-insert-auto-fields
6202@kindex C-c M-d
6203@vindex mh-auto-fields-prompt-flag
6204
6205These fields can only be added after the recipient is known. Because
6206you can continue to add recipients as you edit the draft, MH-E waits
6207until the message is sent to perform the auto-insertions. This seems
6208strange at first, but you'll get used to it. There are two ways to
6209help you feel that the desired fields are added. The first is the
6210action when the message is sent: if any fields are added
6211automatically, you are given a chance to see and to confirm these
6212fields before the message is actually sent. You can do away with this
6213confirmation by turning off the option
6214@code{mh-auto-fields-prompt-flag}. The second method is manual: once
6215the header contains one or more recipients, you may run the command
6216@kbd{C-c M-d} (@code{mh-insert-auto-fields}) or choose the
6217@samp{Identity -> Insert Auto Fields} menu item to insert these fields
6218manually. However, if you use this command, the automatic insertion
6219when the message is sent is disabled.
6220
6221@vindex mh-auto-fields-list
6222@vindex mh-identity-list
6223
6224You should avoid using the same header field in
6225@code{mh-auto-fields-list} and @code{mh-identity-list} definitions
6226that may apply to the same message as the result is undefined.
6227
6228@vindex mh-identity-handlers
6229@vindex mh-identity-list
6230
6231The option @code{mh-identity-handlers} is used to change the way that
6232fields, signatures, and attributions in @code{mh-identity-list} are
6233added. To customize @code{mh-identity-handlers}, replace the name of
6234an existing handler function associated with the field you want to
6235change with the name of a function you have written. You can also
6236click on an @samp{INS} button and insert a field of your choice and
6237the name of the function you have written to handle it.
6238
6239@vindex mh-identity-list
6240
6241The @samp{Field} field can be any field that you've used in your
6242@code{mh-identity-list}. The special fields @samp{:attribution-verb},
6243@samp{:signature}, or @samp{:pgg-default-user-id} are used for the
6244@code{mh-identity-list} choices @samp{Attribution Verb},
6245@samp{Signature}, and @samp{GPG Key ID} respectively.
6246
6247The handler associated with the @samp{:default} field is used when no
6248other field matches.
6249
6250The handler functions are passed two or three arguments: the field
6251itself (for example, @samp{From}), or one of the special fields (for
6252example, @samp{:signature}), and the action @samp{'remove} or
6253@samp{'add}. If the action is @samp{'add}, an additional argument
6254containing the value for the field is given.
6255
6256@node Speedbar, Menu Bar, Identities, Top
6257@chapter The Speedbar
6258
6259@cindex folder navigation
6260@cindex speedbar
6261@findex mh-visit-folder
6262@kindex F v
6263@kindex M-x speedbar
6264@kindex Mouse-2
6265
6266You can also use the speedbar
6267@ifnothtml
6268(@pxref{Speedbar, , Speedbar Frames, emacs, The GNU Emacs Manual},)
6269@end ifnothtml
6270@ifhtml
6271(see the section
fc0c5af8 6272@uref{http://www.gnu.org/software/emacs/manual/html_node/emacs/Speedbar.html,
4009494e
GM
6273Speedbar Frames} in @cite{The GNU Emacs Manual})
6274@end ifhtml
6275to view your folders. To bring up the speedbar, run @kbd{M-x speedbar
6276@key{RET}}. You will see a new frame appear with all of your MH
6277folders. Folders with unseen messages appear in boldface. Click on a
6278folder name with @kbd{Mouse-2} to visit that folder in a similar
6279fashion to the command @kbd{F v} (@code{mh-visit-folder})
6280(@pxref{Folders}). Click on the @samp{+} icon to expand and view the
6281sub-folders of that folder.
6282
6283The speedbar can be manipulated with the keyboard as well. Use the
6284Emacs navigational keys (like the arrow keys, or @kbd{C-n}) to move
6285the cursor over the desired folder and then use the shortcuts for the
6286menu items listed in the table below.
6287
6288@table @samp
6289@findex mh-speed-view
6290@item Visit Folder (@key{RET})
6291Visits the selected folder just as if you had used @kbd{F v}
6292(@code{mh-speed-view}).
6293@c -------------------------
6294@findex mh-speed-expand-folder
6295@item Expand Nested Folders (@kbd{+})
6296Expands the selected folder in the speedbar, exposing the children
6297folders inside it (@code{mh-speed-expand-folder}).
6298@c -------------------------
6299@findex mh-speed-contract-folder
6300@item Contract Nested Folders (@kbd{-})
6301Contracts or collapses the selected folder in the speedbar, hiding the
6302children folders inside it (@code{mh-speed-contract-folder}).
6303@c -------------------------
6304@findex mh-speed-refresh
6305@item Refresh Speedbar (@kbd{r})
6306Regenerates the list of folders in the speedbar. Run this command if
6307you've added or deleted a folder, or want to update the unseen message
6308count before the next automatic update (@code{mh-speed-refresh}).
6309@end table
6310
6311@findex delete-frame
6312@kindex C-x 5 0
6313@kindex Mouse-3
6314
6315You can click on @kbd{Mouse-3} to bring up a context menu that
6316contains these items. Dismiss the speedbar with @kbd{C-x 5 0}
6317(@code{delete-frame}).
6318
6319@cindex @command{flists}
6320@cindex MH commands, @command{flists}
6321@cindex @samp{mh-speedbar} customization group
6322@cindex customization group, @samp{mh-speedbar}
6323
6324The MH-E speedbar uses the MH command @command{flists}@footnote{See
6325the section @uref{@value{MH-BOOK-HOME}/morseq.html#flist, Searching for
6326Sequences with flist} in the MH book.} to generate the list of
6327folders. The @samp{mh-speedbar} customization group contains the
6328following option which controls how often the speedbar calls
6329@command{flists}.
6330
6331@vtable @code
6332@item mh-speed-update-interval
6333Time between speedbar updates in seconds (default: 60). Set to 0 to
6334disable automatic update.
6335@end vtable
6336
6337You can modify the appearance of the folders in the speedbar by
6338customizing the following faces.
6339
6340@vtable @code
6341@item mh-speedbar-folder
6342Basic folder face.
6343@c -------------------------
6344@item mh-speedbar-folder-with-unseen-messages
6345Folder face when folder contains unread messages.
6346@c -------------------------
6347@item mh-speedbar-selected-folder
6348Selected folder face.
6349@c -------------------------
6350@item mh-speedbar-selected-folder-with-unseen-messages
6351Selected folder face when folder contains unread messages.
6352@end vtable
6353
6354@node Menu Bar, Tool Bar, Speedbar, Top
6355@chapter The Menu Bar
6356
6357@cindex @samp{Folder} menu
6358@cindex @samp{Identity} menu
6359@cindex @samp{Letter} menu
6360@cindex @samp{Message} menu
6361@cindex @samp{Search} menu
6362@cindex @samp{Sequence} menu
6363@cindex Folder menu
6364@cindex Identity menu
6365@cindex Letter menu
6366@cindex MH-Folder mode
6367@cindex MH-Letter mode
6368@cindex MH-Search mode
6369@cindex Message menu
6370@cindex Search menu
6371@cindex Sequence menu
6372@cindex menu bar
6373@cindex menu, Folder
6374@cindex menu, Identity
6375@cindex menu, Letter
6376@cindex menu, Message
6377@cindex menu, Search
6378@cindex menu, Sequence
6379@cindex menu, @samp{Folder}
6380@cindex menu, @samp{Identity}
6381@cindex menu, @samp{Letter}
6382@cindex menu, @samp{Message}
6383@cindex menu, @samp{Search}
6384@cindex menu, @samp{Sequence}
6385@cindex modes, MH-Folder
6386@cindex modes, MH-Letter
6387@cindex modes, MH-Search
6388
6389For those of you who prefer to mouse and menu instead of using the
6390meta-coke-bottle-bucky keys, MH-E provides menu items for most of its
6391functions. The MH-Folder buffer adds the @samp{Folder},
6392@samp{Message}, and @samp{Sequence} menus. The MH-Letter buffer adds
6393the @samp{Identity} and @samp{Letter} menus. The MH-Search buffer adds
6394the @samp{Search} menu. There's no need to list the actual items here,
6395as you can more easily see them for yourself, and the functions are
6396already described elsewhere in this manual.
6397
6398For a description of the menu bar, please
6399@ifnothtml
6400@xref{Menu Bar, , The Menu Bar, emacs, The GNU Emacs Manual}.
6401@end ifnothtml
6402@ifhtml
6403see the section
fc0c5af8 6404@uref{http://www.gnu.org/software/emacs/manual/html_node/emacs/Menu-Bar.html,
4009494e
GM
6405The Menu Bar} in @cite{The GNU Emacs Manual}.
6406@end ifhtml
6407
6408The Emacs manual describes how to get online help for a particular
6409menu item. You can also look up a menu item in the index of this
6410manual in two ways: all of the menu items are listed alphabetically,
6411and you can also browse all of the items under the index entry
6412@samp{menu item}.
6413
6414@node Tool Bar, Searching, Menu Bar, Top
6415@chapter The Tool Bar
6416
6417@cindex tool bar
6418
6419Emacs also provides a graphical tool bar. For a description of the
6420tool bar, please
6421@ifnothtml
6422@xref{Tool Bars, , Tool Bars, emacs, The GNU Emacs Manual}.
6423@end ifnothtml
6424@ifhtml
6425see the section
fc0c5af8 6426@uref{http://www.gnu.org/software/emacs/manual/html_node/emacs/Tool-Bars.html,
4009494e
GM
6427Tool Bars} in @cite{The GNU Emacs Manual}.
6428@end ifhtml
6429
6430@cindex @samp{mh-tool-bar} customization group
6431@cindex customization group, @samp{mh-tool-bar}
6432
6433MH-E adds several icons to this tool bar; you can modify the MH-E
6434aspects of the tool bar via the @samp{mh-tool-bar} customization group.
6435
6436@vtable @code
6437@item mh-tool-bar-folder-buttons
6438List of buttons to include in MH-Folder tool bar (default: a checklist
6439too long to list here).
6440@c -------------------------
6441@item mh-tool-bar-letter-buttons
6442List of buttons to include in MH-Letter tool bar (default: a checklist
6443too long to list here).
6444@c -------------------------
6445@item mh-tool-bar-search-function
6446Function called by the tool bar search button (default:
6447@code{mh-search}).
6448@c -------------------------
6449@item mh-xemacs-tool-bar-position
6450Tool bar location (default: @samp{Same As Default Tool Bar}).
6451@c -------------------------
6452@item mh-xemacs-use-tool-bar-flag
6453If @samp{on}, use tool bar (default: @samp{on}, if supported).
6454@end vtable
6455
6456In GNU Emacs, icons for some of MH-E's functions are added to the tool
6457bar. In XEmacs, you have the opportunity to create a separate tool bar for
6458the MH-E icons.
6459
6460@vindex mh-tool-bar-folder-buttons
6461@vindex mh-tool-bar-letter-buttons
6462
6463In either case, you can select which of these functions you'd like to
6464see by customizing the options @code{mh-tool-bar-folder-buttons} and
6465@code{mh-tool-bar-letter-buttons}. As you probably guessed, the former
6466customizes the tool bar in MH-Folder mode and the latter in MH-Letter
6467mode. Both of these options present you with a list of functions;
6468check the functions whose icons you want to see and clear the check
6469boxes for those you don't.
6470
6471@findex mh-search
6472@vindex mh-tool-bar-search-function
6473
6474The function associated with the searching icon can be set via the
6475option @code{mh-tool-bar-search-function}. By default, this is set to
6476@code{mh-search}. @xref{Searching}. You can also choose @samp{Other
6477Function} from the @samp{Value Menu} and enter a function of your own
6478choosing.
6479
6480@vindex mh-xemacs-use-tool-bar-flag
6481
6482XEmacs provides a couple of extra options. The first,
6483@code{mh-xemacs-use-tool-bar-flag}, controls whether to show the MH-E
6484icons at all. By default, this option is turned on if the window
6485system supports tool bars. If your system doesn't support tool bars,
6486then you won't be able to turn on this option.
6487
6488@vindex mh-xemacs-tool-bar-position
6489
6490The second extra option is @code{mh-xemacs-tool-bar-position} which
6491controls the placement of the tool bar along the four edges of the
6492frame. You can choose from one of @samp{Same As Default Tool Bar},
6493@samp{Top}, @samp{Bottom}, @samp{Left}, or @samp{Right}. If this
6494variable is set to anything other than @samp{Same As Default Tool Bar}
6495and the default tool bar is in a different location, then two tool
6496bars will be displayed: the MH-E tool bar and the default tool bar.
6497
6498@node Searching, Threading, Tool Bar, Top
6499@chapter Searching Through Messages
6500
6501@cindex @samp{Search} menu
6502@cindex menu, @samp{Search}
6503@cindex searching
6504@findex mh-search
6505@kindex F s
6506
6507Earlier, the command @kbd{F s} (@code{mh-search}) was introduced which
6508helps you find messages that lie buried in your folders
6509(@pxref{Folders}). This chapter covers this command in more detail.
6510Several commands are used to compose the search criteria and to start
6511searching. A couple of them can be found in the @samp{Search} menu.
6512
6513@table @kbd
6514@kindex C-c ?
6515@findex mh-help
6516@item C-c ?
6517Display cheat sheet for the MH-E commands (@code{mh-help}).
6518@c -------------------------
6519@cindex @samp{Search > Perform Search} menu item
6520@cindex menu item, @samp{Search > Perform Search}
6521@kindex C-c C-c
6522@findex mh-index-do-search
6523@item C-c C-c
6524Find messages using @code{mh-search-program}
6525(@code{mh-index-do-search}).
6526@c -------------------------
6527@cindex @samp{Search > Search with pick} menu item
6528@cindex menu item, @samp{Search > Search with pick}
6529@kindex C-c C-p
6530@findex mh-pick-do-search
6531@item C-c C-p
6532Find messages using @command{pick} (@code{mh-pick-do-search}).
6533@c -------------------------
6534@kindex C-c ?
6535@findex mh-help
6536@item C-c ?
6537Display cheat sheet for the MH-E commands (@code{mh-help}).
6538@c -------------------------
6539@kindex C-c C-f C-a
6540@kindex C-c C-f a
6541@findex mh-to-field
6542@item C-c C-f a
6543@itemx C-c C-f C-a
6544Move to @samp{Mail-Reply-To:} header field (@code{mh-to-field}).
6545@c -------------------------
6546@kindex C-c C-f C-b
6547@kindex C-c C-f b
6548@item C-c C-f b
6549@itemx C-c C-f C-b
6550Move to @samp{Bcc:} header field (@code{mh-to-field}).
6551@c -------------------------
6552@kindex C-c C-f C-c
6553@kindex C-c C-f c
6554@item C-c C-f c
6555@itemx C-c C-f C-c
6556Move to @samp{Cc:} header field (@code{mh-to-field}).
6557@c -------------------------
6558@kindex C-c C-f C-d
6559@kindex C-c C-f d
6560@item C-c C-f d
6561@itemx C-c C-f C-d
6562Move to @samp{Dcc:} header field (@code{mh-to-field}).
6563@c -------------------------
6564@kindex C-c C-f C-f
6565@kindex C-c C-f f
6566@item C-c C-f f
6567@itemx C-c C-f C-f
6568Move to @samp{Fcc:} header field (@code{mh-to-field}).
6569@c -------------------------
6570@kindex C-c C-f C-l
6571@kindex C-c C-f l
6572@item C-c C-f l
6573@itemx C-c C-f C-l
6574Move to @samp{Mail-Followup-To:} header field (@code{mh-to-field}).
6575@c -------------------------
6576@kindex C-c C-f C-m
6577@kindex C-c C-f m
6578@item C-c C-f m
6579@itemx C-c C-f C-m
6580Move to @samp{From:} header field (@code{mh-to-field}).
6581@c -------------------------
6582@kindex C-c C-f C-r
6583@kindex C-c C-f r
6584@item C-c C-f r
6585@itemx C-c C-f C-r
6586Move to @samp{Reply-To:} header field (@code{mh-to-field}).
6587@c -------------------------
6588@kindex C-c C-f C-s
6589@kindex C-c C-f s
6590@item C-c C-f s
6591@itemx C-c C-f C-s
6592Move to @samp{Subject:} header field (@code{mh-to-field}).
6593@c -------------------------
6594@kindex C-c C-f C-t
6595@kindex C-c C-f t
6596@item C-c C-f t
6597@itemx C-c C-f C-t
6598Move to @samp{To:} header field (@code{mh-to-field}).
6599@end table
6600
6601Another few commands are available in the MH-Folder buffer resulting
6602from a search.
6603
6604@table @kbd
6605@kindex @key{TAB}
6606@findex mh-index-next-folder
6607@item @key{TAB}
6608Jump to the next folder marker (@code{mh-index-next-folder}).
6609@c -------------------------
6610@kindex S-@key{TAB}
6611@findex mh-index-previous-folder
6612@item S-@key{TAB}
6613Jump to the previous folder marker (@code{mh-index-previous-folder}).
6614@c -------------------------
6615@kindex v
6616@findex mh-index-visit-folder
6617@item v
6618Visit original folder from where the message at point was found
6619(@code{mh-index-visit-folder}).
6620@end table
6621
6622@cindex @samp{mh-search} customization group
6623@cindex customization group, @samp{mh-search}
6624
6625There is one option from the @samp{mh-search} customization group used
6626in searching.
6627
6628@vtable @code
6629@item mh-search-program
6630Search program that MH-E shall use (default: @samp{Auto-detect}).
6631@end vtable
6632
6633The following hook is available.
6634
6635@vtable @code
6636@item mh-search-mode-hook
6637Hook run upon entry to @code{mh-search-mode} (default: @code{nil}).
6638@end vtable
6639
6640The following face is available.
6641
6642@vtable @code
6643@item mh-search-folder
6644Folder heading face in MH-Folder buffers created by searches.
6645@end vtable
6646
6647@findex mh-search-folder
6648@kindex F s
6649
6650The command @kbd{F s} (@code{mh-search-folder}) helps you find
6651messages in your entire corpus of mail. You can search for messages to
6652or from a particular person or about a particular subject. In fact,
6653you can also search for messages containing selected strings in any
6654arbitrary header field or any string found within the messages.
6655
6656@cindex @command{pick}
6657@cindex MH commands, @command{pick}
6658
6659Out of the box, MH-E uses @command{pick} to find messages. With a
6660little extra effort, you can set an indexing program which rewards you
6661with extremely quick results. The drawback is that sometimes the index
6662does not contain the words you're looking for. You can still use
6663@command{pick} in these situations.
6664
6665You are prompted for the folder to search. This can be @samp{all} to
6666search all folders. Note that the search works recursively on the
6667listed folder.
6668
6669@cindex MH-Search mode
6670@cindex modes, MH-Search
6671
6672Next, an MH-Search buffer appears where you can enter search criteria.
6673
6674@cartouche
6675@smallexample
6676From:
6677To:
6678Cc:
6679Date:
6680Subject:
6681--------
6682#
6683
6684
6685
6686
6687
6688
6689
6690
6691--:** search-pattern All L7 (MH-Search)---------------------------
6692Type C-c C-c to search messages, C-c C-p to use pick, C-c ? for help
6693@end smallexample
6694@end cartouche
6695@i{Search window}
6696
6697@cindex @command{pick}
6698@cindex MH commands, @command{pick}
6699
6700Edit this template by entering your search criteria in an appropriate
6701header field that is already there, or create a new field yourself. If
6702the string you're looking for could be anywhere in a message, then
6703place the string underneath the row of dashes.
6704
6705As an example, let's say that we want to find messages from Ginnean
6706about horseback riding in the Kosciusko National Park (Australia)
6707during January, 1994. Normally we would start with a broad search and
6708narrow it down if necessary to produce a manageable amount of data,
6709but we'll cut to the chase and create a fairly restrictive set of
6710criteria as follows:
6711
6712@smallexample
6713@group
6714From: ginnean
6715To:
6716Cc:
6717Date: Jan 1994
6718Subject:
6719--------
6720horse
6721kosciusko
6722@end group
6723@end smallexample
6724
6725@findex mh-to-field
6726@kindex C-c C-f C-t
6727
6728As with MH-Letter mode, MH-Search provides commands like @kbd{C-c C-f
6729C-t} (@code{mh-to-field}) to help you fill in the blanks.
6730@xref{Editing Message}.
6731
6732@kindex F s
6733@vindex mh-search-mode-hook
6734
6735If you find that you do the same thing over and over when editing the
6736search template, you may wish to bind some shortcuts to keys. This can
6737be done with the variable @code{mh-search-mode-hook}, which is called
6738when @kbd{F s} is run on a new pattern.
6739
6740@findex mh-index-do-search
6741@findex mh-pick-do-search
6742@kindex C-c C-c
6743@kindex C-c C-p
6744
6745To perform the search, type @kbd{C-c C-c} (@code{mh-index-do-search}).
6746Sometimes you're searching for text that is either not indexed, or
6747hasn't been indexed yet. In this case you can override the default
6748method with the pick method by running the command @kbd{C-c C-p}
6749(@code{mh-pick-do-search}).
6750
6751@cindex folders, @samp{+mhe-index}
6752@cindex @samp{+mhe-index}
6753@findex mh-index-next-folder
6754@findex mh-index-previous-folder
6755@kindex @key{TAB}
6756@kindex S-@key{TAB}
6757@vindex mh-search-folder
6758
6759The messages that are found are put in a temporary sub-folder of
6760@samp{+mhe-index} and are displayed in an MH-Folder buffer. This
6761buffer is special because it displays messages from multiple folders;
6762each set of messages from a given folder has a heading with the folder
6763name. The appearance of the heading can be modified by customizing the
6764face @code{mh-search-folder}. You can jump back and forth between the
6765headings using the commands @kbd{@key{TAB}}
6766(@code{mh-index-next-folder}) and @kbd{S-@key{TAB}}
6767(@code{mh-index-previous-folder}).
6768
6769@findex mh-index-visit-folder
6770@findex mh-rescan-folder
6771@kindex F r
6772@kindex v
6773
6774In addition, the command @kbd{v} (@code{mh-index-visit-folder}) can be
6775used to visit the folder of the message at point. Initially, only the
6776messages that matched the search criteria are displayed in the folder.
6777While the temporary buffer has its own set of message numbers, the
6778actual messages numbers are shown in the visited folder. Thus, the
6779command @kbd{v} is useful to find the actual message number of an
6780interesting message, or to view surrounding messages with the command
6781@kbd{F r} @code{mh-rescan-folder}. @xref{Folders}.
6782
6783@findex mh-kill-folder
6784@kindex F k
6785
6786Because this folder is temporary, you'll probably get in the habit of
6787killing it when you're done with @kbd{F k} (@code{mh-kill-folder}).
6788@xref{Folders}.
6789
6790@kindex F s
6791
6792You can regenerate the results by running @kbd{F s} with a prefix
6793argument.
6794
6795@cindex @command{procmail}
6796@cindex Unix commands, @command{procmail}
36a672f6
GM
6797@cindex @samp{X-MHE-Checksum} header field
6798@cindex header field, @samp{X-MHE-Checksum}
4009494e
GM
6799
6800Note: This command uses an @samp{X-MHE-Checksum:} header field to
6801cache the MD5 checksum of a message. This means that if an incoming
6802message already contains an @samp{X-MHE-Checksum:} field, that message
6803might not be found by this command. The following @command{procmail}
6804recipe avoids this problem by renaming the existing header field:
6805
6806@smallexample
6807@group
6808:0 wf
6809| formail -R "X-MHE-Checksum" "X-Old-MHE-Checksum"
6810@end group
6811@end smallexample
6812
6813@xref{Limits}, for an alternative interface to searching.
6814
6815@section Configuring Indexed Searches
6816
6817@cindex @command{grep}
6818@cindex @command{mairix}
6819@cindex @command{namazu}
6820@cindex @command{pick}
6821@cindex @command{swish++}
6822@cindex @command{swish-e}
6823@cindex Unix commands, @command{grep}
6824@cindex Unix commands, @command{mairix}
6825@cindex Unix commands, @command{namazu}
6826@cindex Unix commands, @command{pick}
6827@cindex Unix commands, @command{swish++}
6828@cindex Unix commands, @command{swish-e}
6829@findex mh-search
6830@kindex F s
6831@vindex mh-search-program
6832
6833The command @kbd{F s} (@code{mh-search}) runs the command defined by
6834the option @code{mh-search-program}. The default value is
6835@samp{Auto-detect} which means that MH-E will automatically choose one
6836of @command{swish++}, @command{swish-e}, @command{mairix},
6837@command{namazu}, @command{pick} and @command{grep} in that order. If,
6838for example, you have both @command{swish++} and @command{mairix}
6839installed and you want to use @command{mairix}, then you can set this
6840option to @samp{mairix}.
6841
6842The following sub-sections describe how to set up the various indexing
6843programs to use with MH-E.
6844
6845@subsection swish++
6846
6847@cindex @command{swish++}
6848@cindex Unix commands, @command{swish++}
6849
6850In the examples below, replace @file{/home/user/Mail} with the path to
6851your MH directory.
6852
6853First create the directory @file{/home/user/Mail/.swish++}. Then
6854create the file @file{/home/user/Mail/.swish++/swish++.conf} with the
6855following contents:
6856
6857@smallexample
6858@group
6859IncludeMeta Bcc Cc Comments Content-Description From Keywords
6860IncludeMeta Newsgroups Resent-To Subject To
6861IncludeMeta Message-Id References In-Reply-To
6862IncludeFile Mail *
6863IndexFile /home/user/Mail/.swish++/swish++.index
6864@end group
6865@end smallexample
6866
6867Use the following command line to generate the swish index. Run this
6868daily from cron:
6869
6870@smallexample
6871@group
6872find /home/user/Mail -path /home/user/Mail/mhe-index -prune \
6873 -o -path /home/user/Mail/.swish++ -prune \
6874 -o -name "[0-9]*" -print \
6875 | index -c /home/user/Mail/.swish++/swish++.conf -
6876@end group
6877@end smallexample
6878
6879This command does not index the folders that hold the results of your
6880searches in @samp{+mhe-index} since they tend to be ephemeral and the
6881original messages are indexed anyway.
6882
6883@cindex @command{index}
6884@cindex Unix commands, @command{index}
6885@cindex @command{index++}
6886@cindex Unix commands, @command{index++}
6887
6888On some systems (Debian GNU/Linux, for example), use @command{index++}
6889instead of @command{index}.
6890
6891@subsection swish
6892
6893@cindex @command{swish-e}
6894@cindex Unix commands, @command{swish-e}
6895
6896In the examples below, replace @file{/home/user/Mail} with the path to
6897your MH directory.
6898
6899First create the directory @file{/home/user/Mail/.swish}. Then create
6900the file @file{/home/user/Mail/.swish/config} with the following
6901contents:
6902
6903@smallexample
6904@group
6905DefaultContents TXT*
6906IndexDir /home/user/Mail
6907IndexFile /home/user/Mail/.swish/index
6908IndexName "Mail Index"
6909IndexDescription "Mail Index"
6910IndexPointer "http://nowhere"
6911IndexAdmin "nobody"
6912#MetaNames automatic
6913IndexReport 3
6914FollowSymLinks no
6915UseStemming no
6916IgnoreTotalWordCountWhenRanking yes
6917WordCharacters abcdefghijklmnopqrstuvwxyz0123456789-
6918BeginCharacters abcdefghijklmnopqrstuvwxyz
6919EndCharacters abcdefghijklmnopqrstuvwxyz0123456789
6920IgnoreLimit 50 1000
6921IndexComments 0
6922FileRules filename contains \D
6923FileRules pathname contains /home/user/Mail/.swish
6924FileRules pathname contains /home/user/Mail/mhe-index
6925FileRules filename is index
6926@end group
6927@end smallexample
6928
6929This configuration does not index the folders that hold the results of
6930your searches in @samp{+mhe-index} since they tend to be ephemeral and
6931the original messages are indexed anyway.
6932
6933If there are any directories you would like to ignore, append lines
6934like the following to @file{config}:
6935
6936@smallexample
6937FileRules pathname contains /home/user/Mail/scripts
6938@end smallexample
6939
6940@cindex @command{swish-e}
6941@cindex Unix commands, @command{swish-e}
6942
6943Use the following command line to generate the swish index. Run this
6944daily from cron:
6945
6946@smallexample
6947swish-e -c /home/user/Mail/.swish/config
6948@end smallexample
6949
6950@subsection mairix
6951
6952@cindex @command{mairix}
6953@cindex Unix commands, @command{mairix}
6954
cf1f2c3e
BW
6955In the examples below, replace @file{~/Mail} with the path to your MH
6956directory.
4009494e 6957
cf1f2c3e
BW
6958First create the directory @file{~/Mail/.mairix}. Then create the file
6959@file{~/Mail/.mairix/config} with the following contents:
4009494e
GM
6960
6961@smallexample
6962@group
cf1f2c3e 6963base=~/Mail
4009494e
GM
6964
6965# List of folders that should be indexed. 3 dots at the end means there
6966# are subfolders within the folder
6967mh=archive...:inbox:drafts:news:sent:trash
6968
cf1f2c3e
BW
6969mformat=mh
6970database=~/Mail/.mairix/database
4009494e
GM
6971@end group
6972@end smallexample
6973
6974Use the following command line to generate the mairix index. Run this daily
6975from cron:
6976
6977@smallexample
cf1f2c3e 6978mairix -f ~/Mail/.mairix/config
4009494e
GM
6979@end smallexample
6980
6981@subsection namazu
6982
6983@cindex @command{namazu}
6984@cindex Unix commands, @command{namazu}
6985
6986In the examples below, replace @file{/home/user/Mail} with the path to
6987your MH directory.
6988
6989First create the directory @file{/home/user/Mail/.namazu}. Then create
6990the file @file{/home/user/Mail/.namazu/mknmzrc} with the following
6991contents:
6992
6993@smallexample
6994@group
6995package conf; # Don't remove this line!
6996$ADDRESS = 'user@@localhost';
6997$ALLOW_FILE = "[0-9]*";
6998$EXCLUDE_PATH = "^/home/user/Mail/(mhe-index|spam)";
6999@end group
7000@end smallexample
7001
7002This configuration does not index the folders that hold the results of
7003your searches in @samp{+mhe-index} since they tend to be ephemeral and
7004the original messages are indexed anyway.
7005
7006Use the following command line to generate the namazu index. Run this
7007daily from cron:
7008
7009@smallexample
7010mknmz -f /home/user/Mail/.namazu/mknmzrc -O /home/user/Mail/.namazu \
6ddf13e4 7011 -q /home/user/Mail
4009494e
GM
7012@end smallexample
7013
7014@subsection pick
7015
7016@cindex @command{pick}
7017@cindex MH commands, @command{pick}
7018
7019This search method does not require any setup.
7020
7021Read @command{pick}(1) or the section
7022@uref{@value{MH-BOOK-HOME}/finpic.html, Finding Messages with pick} in
7023the MH book to find out more about how to enter the criteria.
7024
7025@subsection grep
7026
7027@cindex @command{grep}
7028@cindex Unix commands, @command{grep}
7029
7030This search method does not require any setup.
7031
7032Unlike the other search methods, this method does not use the
7033MH-Search buffer. Instead, you simply enter a regular expression in
7034the minibuffer. For help in constructing regular expressions, see your
7035man page for @command{grep}.
7036
7037@node Threading, Limits, Searching, Top
7038@chapter Viewing Message Threads
7039
7040@cindex threading
7041
7042MH-E groups messages by @dfn{threads} which are messages that are part
7043of the same discussion and usually all have the same @samp{Subject:}
7044header field. Other ways to organize messages in a folder include
7045limiting (@pxref{Limits}) or using full-text indexed searches
7046(@pxref{Searching}).
7047
7048@cindex root, in threads
7049@cindex siblings, in threads
7050@cindex ancestor, in threads
7051
7052A thread begins with a single message called a @dfn{root}. All replies
7053to the same message are @dfn{siblings} of each other. Any message that
7054has replies to it is an @dfn{ancestor} of those replies.
7055
7056There are several commands that you can use to navigate and operate on
7057threads.
7058
7059@table @kbd
7060@kindex T ?
7061@findex mh-prefix-help
7062@item T ?
7063Display cheat sheet for the commands of the current prefix in
7064minibuffer (@code{mh-prefix-help}).
7065@c -------------------------
7066@kindex T o
7067@findex mh-thread-refile
7068@item T o
7069Refile (output) thread into folder (@code{mh-thread-refile}).
7070@c -------------------------
7071@kindex T d
7072@findex mh-thread-delete
7073@item T d
7074Delete thread (@code{mh-thread-delete}).
7075@c -------------------------
7076@kindex T t
7077@findex mh-toggle-threads
7078@item T t
7079Toggle threaded view of folder (@code{mh-toggle-threads}).
7080@c -------------------------
7081@kindex T n
7082@findex mh-thread-next-sibling
7083@item T n
7084Display next sibling (@code{mh-thread-next-sibling}).
7085@c -------------------------
7086@kindex T p
7087@findex mh-thread-previous-sibling
7088@item T p
7089Display previous sibling (@code{mh-thread-previous-sibling}).
7090@c -------------------------
7091@kindex T u
7092@findex mh-thread-ancestor
7093@item T u
7094Display ancestor of current message (@code{mh-thread-ancestor}).
7095@end table
7096
7097@cindex @samp{mh-thread} customization group
7098@cindex customization group, @samp{mh-thread}
7099
7100The @samp{mh-thread} customization group contains one option.
7101
7102@vtable @code
7103@item mh-show-threads-flag
7104On means new folders start in threaded mode (default: @samp{off}).
7105@end vtable
7106
7107@findex mh-toggle-threads
7108@kindex T t
7109@vindex mh-large-folder
7110@vindex mh-show-threads-flag
7111
7112Threading large number of messages can be time consuming so the option
7113@code{mh-show-threads-flag} is turned off by default. If you turn on
7114this option, then threading will be done only if the number of
7115messages being threaded is less than @code{mh-large-folder}. In any
7116event, threading can be turned on (and off) with the command @kbd{T t}
7117(@code{mh-toggle-threads}).
7118
7119@findex mh-thread-ancestor
7120@findex mh-thread-next-sibling
7121@findex mh-thread-previous-sibling
7122@kindex T n
7123@kindex T p
7124@kindex T u
7125
7126There are a few commands to help you navigate threads. If you do not
7127care for the way a particular thread has turned, you can move up the
7128chain of messages with the command @kbd{T u}
7129(@code{mh-thread-ancestor}. At any point you can use @kbd{T n}
7130(@code{mh-thread-next-sibling} or @kbd{T p}
7131(@code{mh-thread-previous-sibling}) to jump to the next or previous
7132sibling, skipping the sub-threads. The command @kbd{T u} can also take
7133a prefix argument to jump to the message that started everything.
7134
7135@findex mh-delete-subject-or-thread
7136@findex mh-thread-delete
7137@findex mh-thread-refile
7138@kindex k
7139@kindex T d
7140@kindex T o
7141
7142There are threaded equivalents for the commands that delete and refile
7143messages. For example, @kbd{T o} (@code{mh-thread-refile}) refiles the
7144current message and all its children. Similarly, the command @kbd{T d}
7145(@code{mh-thread-delete}) deletes the current message and all its
7146children. These commands do not refile or delete sibling messages.
7147@xref{Navigating}, for a description of the similar command @kbd{k}
7148(@code{mh-delete-subject-or-thread}).
7149
7150@vindex mh-large-folder
7151
7152If you find that threading is too slow, it may be that you have
7153@code{mh-large-folder} set too high. Also, threading is one of the few
7154features of MH-E that really benefits from compiling. If you haven't
7155compiled MH-E, I encourage you to do so@footnote{If you're not sure if
7156MH-E has been byte-compiled, you could try running @samp{locate
7157mh-thread.elc} or otherwise find MH-E on your system and ensure that
7158@file{mh-thread.elc} exists. If you have multiple versions and you
7159find that one is compiled but the other is not, then go into your
7160@samp{*scratch*} buffer in Emacs, enter @kbd{load-path C-j}, and
7161ensure that the byte-compiled version appears first in the
7162@code{load-path}. If you find that MH-E is not compiled and you
7163installed MH-E yourself, please refer to the installation directions
7164in the file @file{README} in the distribution.}.
7165
7166@node Limits, Sequences, Threading, Top
7167@chapter Limiting Display
7168
7169@cindex limits
7170@cindex filters
7171
7172Another way to organize messages in a folder besides threading
7173(@pxref{Threading}) or using full-text indexed searches
7174(@pxref{Searching}) is by limiting the folder display to messages that
7175are similar to the current message.
7176
7177@table @kbd
7178@kindex / ?
7179@findex mh-prefix-help
7180@item / ?
7181Display cheat sheet for the commands of the current prefix in
7182minibuffer (@code{mh-prefix-help}).
7183@c -------------------------
7184@cindex @samp{Sequence > Narrow to Tick Sequence} menu item
7185@cindex menu item, @samp{Sequence > Narrow to Tick Sequence}
7186@kindex / '
7187@findex mh-narrow-to-tick
7188@item / '
7189Limit to messages in the @samp{tick} sequence
7190(@code{mh-narrow-to-tick}).
7191@c -------------------------
7192@kindex / c
7193@findex mh-narrow-to-cc
7194@item / c
7195Limit to messages with the same @samp{Cc:} field
7196(@code{mh-narrow-to-cc}).
7197@c -------------------------
7198@kindex / m
7199@findex mh-narrow-to-from
7200@item / m
7201Limit to messages with the same @samp{From:} field
7202(@code{mh-narrow-to-from}).
7203@c -------------------------
7204@kindex / g
7205@findex mh-narrow-to-range
7206@item / g
7207Limit to range (@code{mh-narrow-to-range}).
7208@c -------------------------
7209@cindex @samp{Sequence > Narrow to Subject Sequence} menu item
7210@cindex menu item, @samp{Sequence > Narrow to Subject Sequence}
7211@kindex / s
7212@findex mh-narrow-to-subject
7213@item / s
7214Limit to messages with the same @samp{Subject:} field
7215(@code{mh-narrow-to-subject}).
7216@c -------------------------
7217@kindex / t
7218@findex mh-narrow-to-to
7219@item / t
7220Limit to messages with the same @samp{To:} field
7221(@code{mh-narrow-to-to}).
7222@c -------------------------
7223@cindex @samp{Sequence > Widen from Sequence} menu item
7224@cindex menu item, @samp{Sequence > Widen from Sequence}
7225@kindex / w
7226@findex mh-widen
7227@item / w
7228Remove last restriction (@code{mh-widen}).
7229@end table
7230
7231All of the limiting commands above refine the display in some way.
7232
7233@cindex @command{pick}
7234@cindex MH commands, @command{pick}
7235@findex mh-narrow-to-cc
7236@findex mh-narrow-to-from
7237@findex mh-narrow-to-subject
7238@findex mh-narrow-to-to
7239@kindex / c
7240@kindex / m
7241@kindex / s
7242@kindex / t
7243
7244The commands @kbd{/ c} (@code{mh-narrow-to-cc}), @kbd{/ m}
7245(@code{mh-narrow-to-from}), @kbd{/ s} (@code{mh-narrow-to-subject}),
7246and @kbd{/ t} (@code{mh-narrow-to-to}) restrict the display to
7247messages matching the content of the respective field in the current
7248message. However, you can give any of these a prefix argument to edit
7249the @command{pick} expression used to narrow the view@footnote{See
7250@command{pick}(1) or the section
7251@uref{@value{MH-BOOK-HOME}/finpic.html, Finding Messages with pick} in
7252the MH book.}.
7253
7254@cindex @samp{tick} sequence
7255@cindex sequence, @samp{tick}
7256@cindex ticked messages, viewing
7257@findex mh-narrow-to-range
7258@findex mh-narrow-to-tick
7259@kindex / '
7260@kindex / g
7261
7262You can also limit the display to messages in the @samp{tick} sequence
7263with the command @kbd{/ '} (@code{mh-narrow-to-tick}).
7264@xref{Sequences}, for information on putting message into the
7265@samp{tick} sequence. Use the @kbd{/ g} (@code{mh-narrow-to-range})
7266command to limit the display to messages in a range (@pxref{Ranges}).
7267
7268@findex mh-widen
7269@kindex / w
7270
7271Each limit can be undone in turn with the @kbd{/ w} (@code{mh-widen})
7272command. Give this command a prefix argument to remove all limits.
7273
7274@node Sequences, Junk, Limits, Top
7275@chapter Using Sequences
7276
7277@cindex @samp{Sequence} menu
7278@cindex menu, @samp{Sequence}
7279@cindex sequences
7280
7281For the whole scoop on MH sequences, refer to
7282@samp{mh-sequence}(5)@footnote{See the section
7283@uref{@value{MH-BOOK-HOME}/morseq.html, More About Sequences} in the MH
7284book.}. As you've read, several of the MH-E commands can operate on a
7285sequence, which is a shorthand for a range or group of messages. For
7286example, you might want to forward several messages to a friend or
7287colleague. Here's how to manipulate sequences. These commands are also
7288available in the @samp{Sequence} menu.
7289
7290@table @kbd
7291@cindex @samp{Sequence > Toggle Tick Mark} menu item
7292@cindex menu item, @samp{Sequence > Toggle Tick Mark}
7293@kindex '
7294@findex mh-toggle-tick
7295@item '
7296Toggle tick mark of range (@code{mh-toggle-tick}).
7297@c -------------------------
7298@kindex S ?
7299@findex mh-prefix-help
7300@item S ?
7301Display cheat sheet for the commands of the current prefix in
7302minibuffer (@code{mh-prefix-help}).
7303@c -------------------------
7304@cindex @samp{Sequence > Narrow to Tick Sequence} menu item
7305@cindex menu item, @samp{Sequence > Narrow to Tick Sequence}
7306@kindex S '
7307@findex mh-narrow-to-tick
7308@item S '
7309Limit to ticked messages (@code{mh-narrow-to-tick}).
7310@c -------------------------
7311@cindex @samp{Sequence > Delete Message from Sequence...} menu item
7312@cindex menu item, @samp{Sequence > Delete Message from Sequence...}
7313@kindex S d
7314@findex mh-delete-msg-from-seq
7315@item S d
7316Delete range from sequence (@code{mh-delete-msg-from-seq}).
7317@c -------------------------
7318@cindex @samp{Sequence > Delete Sequence...} menu item
7319@cindex menu item, @samp{Sequence > Delete Sequence...}
7320@kindex S k
7321@findex mh-delete-seq
7322@item S k
7323Delete sequence (@code{mh-delete-seq}).
7324@c -------------------------
7325@cindex @samp{Sequence > List Sequences in Folder...} menu item
7326@cindex menu item, @samp{Sequence > List Sequences in Folder...}
7327@kindex S l
7328@findex mh-list-sequences
7329@item S l
7330List all sequences in folder (@code{mh-list-sequences}).
7331@c -------------------------
7332@cindex @samp{Sequence > Narrow to Sequence...} menu item
7333@cindex menu item, @samp{Sequence > Narrow to Sequence...}
7334@kindex S n
7335@findex mh-narrow-to-seq
7336@item S n
7337Restrict display to messages in sequence (@code{mh-narrow-to-seq}).
7338@c -------------------------
7339@cindex @samp{Sequence > Add Message to Sequence...} menu item
7340@cindex menu item, @samp{Sequence > Add Message to Sequence...}
7341@kindex S p
7342@findex mh-put-msg-in-seq
7343@item S p
7344Add range to sequence (@code{mh-put-msg-in-seq}).
7345@c -------------------------
7346@cindex @samp{Sequence > List Sequences for Message} menu item
7347@cindex menu item, @samp{Sequence > List Sequences for Message}
7348@kindex S s
7349@findex mh-msg-is-in-seq
7350@item S s
7351Display the sequences in which the current message appears
7352(@code{mh-msg-is-in-seq}).
7353@c -------------------------
7354@cindex @samp{Sequence > Widen from Sequence} menu item
7355@cindex menu item, @samp{Sequence > Widen from Sequence}
7356@kindex S w
7357@findex mh-widen
7358@item S w
7359Remove last restriction (@code{mh-widen}).
7360@c -------------------------
7361@findex mh-update-sequences
7362@item M-x mh-update-sequences
7363Flush MH-E's state out to MH@.
7364@end table
7365
7366@cindex @samp{mh-sequences} customization group
7367@cindex customization group, @samp{mh-sequences}
7368
7369The @samp{mh-sequences} customization group contains the options
7370associated with sequences.
7371
7372@vtable @code
7373@item mh-refile-preserves-sequences-flag
7374On means that sequences are preserved when messages are refiled
7375(default: @samp{on}).
7376@c -------------------------
7377@item mh-tick-seq
7378The name of the MH sequence for ticked messages (default: @samp{'tick}).
7379@c -------------------------
7380@item mh-update-sequences-after-mh-show-flag
7381On means flush MH sequences to disk after message is shown (default:
7382@samp{on}).
551aaa66
BW
7383@item mh-whitelist-preserves-sequences-flag
7384On means that sequences are preserved when messages are whitelisted
7385(default: @samp{on}).
4009494e
GM
7386@end vtable
7387
7388The following hook is available.
7389
7390@vtable @code
7391@item mh-unseen-updated-hook
7392Hook run after the unseen sequence has been updated (default: @code{nil}).
7393@end vtable
7394
7395@cindex @command{pick}
7396@cindex MH commands, @command{pick}
7397@findex mh-put-msg-in-seq
7398@kindex S p
7399
7400To place a message in a sequence, use @kbd{S p}
7401(@code{mh-put-msg-in-seq}). Give @kbd{S p} a range and you can add all
7402the messages in a sequence to another sequence (for example, @kbd{C-u
7403S p SourceSequence @key{RET} DestSequence @key{RET}}, @pxref{Ranges}).
7404
7405@cindex @samp{tick} sequence
7406@cindex sequence, @samp{tick}
7407@cindex ticking messages
7408@findex mh-index-ticked-messages
7409@findex mh-toggle-tick
7410@kindex '
7411@kindex F '
7412@kindex S p
7413
7414One specific use of the @kbd{S p} command is @kbd{'}
7415(@code{mh-toggle-tick}) which adds messages to the @samp{tick}
7416sequence. This sequence can be viewed later with the @kbd{F '}
7417(@code{mh-index-ticked-messages}) command (@pxref{Folders}).
7418
7419@vindex mh-tick-seq
7420
7421You can customize the option @code{mh-tick-seq} if you already use the
7422@samp{tick} sequence for your own use. You can also disable all of the
7423ticking functions by choosing the @samp{Disable Ticking} item but
7424there isn't much advantage to that.
7425
7426@cindex MH-Folder mode
7427@cindex modes, MH-Folder
7428@findex mh-narrow-to-seq
7429@findex mh-narrow-to-tick
7430@findex mh-widen
7431@kindex S '
7432@kindex S n
7433@kindex S w
7434
7435Once you've placed some messages in a sequence, you may wish to narrow
7436the field of view to just those messages in the sequence you've
7437created. To do this, use @kbd{S n} (@code{mh-narrow-to-seq}). You are
7438prompted for the name of the sequence. What this does is show only
7439those messages that are in the selected sequence in the MH-Folder
7440buffer. In addition, it limits further MH-E searches to just those
7441messages. To narrow the view to the messages in the @samp{tick}
7442sequence, use @kbd{S '} (@code{mh-narrow-to-tick}). When you want to
7443widen the view to all your messages again, use @kbd{S w}
7444(@code{mh-widen}).
7445
7446@cindex buffers, @samp{*MH-E Sequences*}
7447@cindex @samp{*MH-E Sequences*}
7448@findex mh-list-sequences
7449@findex mh-msg-is-in-seq
7450@kindex S l
7451@kindex S s
7452
7453You can see which sequences in which a message appears with the
7454command @kbd{S s} (@code{mh-msg-is-in-seq}). Use a prefix argument to
7455display the sequences in which another message appears (as in @kbd{C-u
745642 S s @key{RET}}). Or, you can list all sequences in a selected
7457folder (default is current folder) with @kbd{S l}
7458(@code{mh-list-sequences}). The list appears in a buffer named
7459@samp{*MH-E Sequences*} (@pxref{Miscellaneous}).
7460
36a672f6 7461@cindex MH profile component, @samp{Previous-Sequence}
4009494e 7462@cindex @samp{cur} sequence
36a672f6 7463@cindex @samp{Previous-Sequence} MH profile component
4009494e
GM
7464@cindex sequence, @samp{cur}
7465@cindex sequence, @samp{Previous-Sequence}
7466@vindex mh-refile-preserves-sequences-flag
7467
7468If a message is in any sequence (except
7469@samp{Previous-Sequence:}@footnote{See @samp{mh-profile}(5)).} and
7470@samp{cur}) when it is refiled, then it will still be in those
7471sequences in the destination folder. If this behavior is not desired,
7472then turn off the option @code{mh-refile-preserves-sequences-flag}.
7473
7474@findex mh-delete-msg-from-seq
7475@findex mh-delete-seq
7476@kindex d
7477@kindex S d
7478@kindex S k
7479
7480If you want to remove a message (or range, @pxref{Ranges}) from a
7481sequence, use @kbd{S d} (@code{mh-delete-msg-from-seq}). If you want
7482to delete an entire sequence, use @kbd{S k} (@code{mh-delete-seq}). In
7483the latter case you are prompted for the sequence to delete. Note that
7484this deletes only the sequence, not the messages in the sequence. If
7485you want to delete the messages, use @kbd{C-u d} (@pxref{Reading
7486Mail}).
7487
36a672f6 7488@cindex @samp{Unseen-Sequence} MH profile component
4009494e
GM
7489@cindex @samp{cur} sequence
7490@cindex @samp{tick} sequence
36a672f6 7491@cindex MH profile component, @samp{Unseen-Sequence}
4009494e
GM
7492@cindex sequence, @samp{Unseen-Sequence}
7493@cindex sequence, @samp{cur}
7494@cindex sequence, @samp{tick}
7495@findex mh-update-sequences
7496@kindex M-x mh-update-sequences
7497@kindex q
7498@kindex x
7499@vindex mh-tick-seq
7500@vindex mh-update-sequences-after-mh-show-flag
7501
7502Three sequences are maintained internally by MH-E and pushed out to MH
7503when a message is shown. They include the sequence specified by your
7504@samp{Unseen-Sequence:} profile component, @samp{cur}, and the
7505sequence listed by the option @code{mh-tick-seq} which is @samp{tick}
7506by default. If you do not like this behavior, turn off the option
7507@code{mh-update-sequences-after-mh-show-flag}. You can then update the
7508state manually with the @kbd{x}, @kbd{q}, or @kbd{M-x
7509mh-update-sequences} commands.
7510
7511@vindex mh-seen-list
7512@vindex mh-unseen-updated-hook
7513
7514The hook @code{mh-unseen-updated-hook} is run after the unseen
7515sequence has been updated. The variable @code{mh-seen-list} can be
7516used by this hook to obtain the list of messages which were removed
7517from the unseen sequence.
7518
7519@cindex @command{mark}
7520@cindex MH commands, @command{mark}
7521@kindex S n
7522@kindex S w
7523
7524With the exceptions of @kbd{S n} and @kbd{S w}, the underlying MH
7525command dealing with sequences is @command{mark}@footnote{See the
7526section @uref{@value{MH-BOOK-HOME}/mmbwm.html, Make Message Bookmarks
7527with mark} in the MH book.}.
7528
7529@node Junk, Miscellaneous, Sequences, Top
7530@chapter Dealing With Junk Mail
7531
7532@cindex Marshall Rose
7533@cindex junk mail
7534@cindex spam
7535
7536Marshall Rose once wrote a paper on MH entitled, @cite{How to process
7537200 messages a day and still get some real work done}. This chapter
7538could be entitled, @cite{How to process 1000 spams a day and still get
7539some real work done}.
7540
7541@cindex blacklisting
7542@cindex ham
7543@cindex viruses
7544@cindex whitelisting
7545@cindex worms
7546
7547We use the terms @dfn{junk mail} and @dfn{spam} interchangeably for
7548any unwanted message which includes spam, @dfn{viruses}, and
7549@dfn{worms}. The opposite of spam is @dfn{ham}. The act of classifying
7550a sender as one who sends junk mail is called @dfn{blacklisting}; the
7551opposite is called @dfn{whitelisting}.
7552
7553@table @kbd
7554@kindex J ?
7555@findex mh-prefix-help
7556@item J ?
7557Display cheat sheet for the commands of the current prefix in
7558minibuffer (@code{mh-prefix-help}).
7559@c -------------------------
7560@kindex J b
7561@findex mh-junk-blacklist
7562@item J b
7563Blacklist range as spam (@code{mh-junk-blacklist}).
7564@c -------------------------
7565@kindex J w
7566@findex mh-junk-whitelist
7567@item J w
7568Whitelist range as ham (@code{mh-junk-whitelist}).
7569@c -------------------------
7570@item @code{mh-spamassassin-identify-spammers}
7571Identify spammers who are repeat offenders.
7572@end table
7573
7574@cindex @samp{mh-junk} customization group
7575@cindex customization group, @samp{mh-junk}
7576
7577The following table lists the options from the @samp{mh-junk}
7578customization group.
7579
7580@vtable @code
7581@item mh-junk-background
7582If on, spam programs are run in background (default: @samp{off}).
7583@c -------------------------
7584@item mh-junk-disposition
7585Disposition of junk mail (default: @samp{Delete Spam}).
7586@c -------------------------
7587@item mh-junk-program
7588Spam program that MH-E should use (default: @samp{Auto-detect}).
7589@end vtable
7590
551aaa66
BW
7591@cindex @samp{mh-sequences} customization group
7592@cindex customization group, @samp{mh-sequences}
7593
7594The following option in the @samp{mh-sequences} customization group is
7595also available.
7596
7597@vtable @code
7598@item mh-whitelist-preserves-sequences-flag
7599On means that sequences are preserved when messages are whitelisted
7600(default: @samp{on}).
7601@end vtable
7602
7603The following hooks are available.
7604
7605@vtable @code
7606@item mh-blacklist-msg-hook
7607Hook run by @kbd{J b} (@code{mh-junk-blacklist}) after marking each
7608message for blacklisting (default: @code{nil}).
7609@c -------------------------
7610@item mh-whitelist-msg-hook
7611Hook run by @kbd{J w} (@code{mh-junk-whitelist}) after marking each
7612message for whitelisting (default @samp{nil}).
7613@end vtable
7614
7615The following faces are available.
7616
7617@vtable @code
7618@item mh-folder-blacklisted
7619Blacklisted message face.
7620@c -------------------------
7621@item mh-folder-whitelisted
7622Whitelisted message face
7623@end vtable
7624
4009494e
GM
7625@cindex SpamProbe
7626@cindex Spamassassin
7627@cindex bogofilter
7628@cindex spam filters, SpamProbe
7629@cindex spam filters, Spamassassin
7630@cindex spam filters, bogofilter
7631
7632MH-E depends on @uref{http://spamassassin.apache.org/, SpamAssassin},
7633@uref{http://bogofilter.sourceforge.net/, bogofilter}, or
7634@uref{http://spamprobe.sourceforge.net/, SpamProbe} to throw the dreck
7635away. This chapter describes briefly how to configure these programs
7636to work well with MH-E and how to use MH-E's interface that provides
7637continuing education for these programs.
7638
7639@vindex mh-junk-program
7640
7641The default setting of the option @code{mh-junk-program} is
7642@samp{Auto-detect} which means that MH-E will automatically choose one
7643of SpamAssassin, bogofilter, or SpamProbe in that order. If, for
7644example, you have both SpamAssassin and bogofilter installed and you
7645want to use bogofilter, then you can set this option to
7646@samp{Bogofilter}.
7647
7648@findex mh-junk-blacklist
7649@kindex J b
7650@vindex mh-junk-disposition
7651
7652The command @kbd{J b} (@code{mh-junk-blacklist}) trains the spam
7653program in use with the content of the range (@pxref{Ranges}) and then
7654handles the message(s) as specified by the option
7655@code{mh-junk-disposition}. By default, this option is set to
7656@samp{Delete Spam} but you can also specify the name of the folder
7657which is useful for building a corpus of spam for training purposes.
7658
7659@findex mh-junk-whitelist
7660@kindex J w
7661
7662In contrast, the command @kbd{J w} (@code{mh-junk-whitelist})
7663reclassifies a range of messages (@pxref{Ranges}) as ham if it were
7664incorrectly classified as spam. It then refiles the message into the
7665@file{+inbox} folder.
7666
36a672f6 7667@cindex MH profile component, @samp{Previous-Sequence}
551aaa66 7668@cindex @samp{cur} sequence
36a672f6 7669@cindex @samp{Previous-Sequence} MH profile component
551aaa66
BW
7670@cindex sequence, @samp{cur}
7671@cindex sequence, @samp{Previous-Sequence}
7672@vindex mh-whitelist-preserves-sequences-flag
7673
7674If a message is in any sequence (except @samp{Previous-Sequence:} and
7675@samp{cur}) when it is whitelisted, then it will still be in those
7676sequences in the destination folder. If this behavior is not desired,
7677then turn off the option @code{mh-whitelist-preserves-sequences-flag}.
7678
4009494e
GM
7679@cindex @samp{*MH-E Log*}
7680@cindex buffers, @samp{*MH-E Log*}
7681@findex call-process
7682@vindex mh-junk-background
7683
7684By default, the programs are run in the foreground, but this can be
7685slow when junking large numbers of messages. If you have enough memory
7686or don't junk that many messages at the same time, you might try
7687turning on the option @code{mh-junk-background}. @footnote{Note that
7688the option @code{mh-junk-background} is used as the @code{display}
7689argument in the call to @code{call-process}. Therefore, turning on
7690this option means setting its value to @samp{0}. You can also set its
7691value to @samp{t} to direct the programs' output to the @samp{*MH-E
7692Log*} buffer; this may be useful for debugging.}
7693
7694The following sections discuss the various counter-spam measures that
7695MH-E can work with.
7696
7697@cindex @file{.procmailrc}
7698@cindex files, @file{.procmailrc}
7699
7700@subheading SpamAssassin
7701
7702@cindex Spamassassin
7703@cindex spam filters, Spamassassin
7704
7705SpamAssassin is one of the more popular spam filtering programs. Get
7706it from your local distribution or from the
7707@uref{http://spamassassin.apache.org/, SpamAssassin web site}.
7708
7709To use SpamAssassin, add the following recipes to @file{~/.procmailrc}:
7710
7711@cindex @command{spamc}
36a672f6
GM
7712@cindex @samp{X-Spam-Level} header field
7713@cindex @samp{X-Spam-Status} header field
7714@cindex header field, @samp{X-Spam-Level}
7715@cindex header field, @samp{X-Spam-Status}
4009494e
GM
7716
7717@smallexample
7718PATH=$PATH:/usr/bin/mh
7719MAILDIR=$HOME/`mhparam Path`
7720
7721# Fight spam with SpamAssassin.
7722:0fw
7723| spamc
7724
7725# Anything with a spam level of 10 or more is junked immediately.
7726:0:
7727* ^X-Spam-Level: ..........
7728/dev/null
7729
7730:0:
7731* ^X-Spam-Status: Yes
7732spam/.
7733@end smallexample
7734
7735If you don't use @command{spamc}, use @samp{spamassassin -P -a}.
7736
7737Note that one of the recipes above throws away messages with a score
7738greater than or equal to 10. Here's how you can determine a value that
7739works best for you.
7740
7741First, run @samp{spamassassin -t} on every mail message in your
7742archive and use @command{gnumeric} to verify that the average plus the
7743standard deviation of good mail is under 5, the SpamAssassin default
7744for ``spam''.
7745
7746Using @command{gnumeric}, sort the messages by score and view the
7747messages with the highest score. Determine the score which encompasses
7748all of your interesting messages and add a couple of points to be
7749conservative. Add that many dots to the @samp{X-Spam-Level:} header
7750field above to send messages with that score down the drain.
7751
f99f1641 7752In the example above, messages with a score of 5--9 are set aside in
4009494e
GM
7753the @samp{+spam} folder for later review. The major weakness of
7754rules-based filters is a plethora of false positives so it is
7755worthwhile to check.
7756
7757@findex mh-junk-blacklist
7758@findex mh-junk-whitelist
7759@kindex J b
7760@kindex J w
7761
7762If SpamAssassin classifies a message incorrectly, or is unsure, you can
7763use the MH-E commands @kbd{J b} (@code{mh-junk-blacklist}) and
7764@kbd{J w} (@code{mh-junk-whitelist}).
7765
7766@cindex @command{sa-learn}
7767@cindex @file{.spamassassin/user_prefs}
7768@cindex files, @file{.spamassassin/user_prefs}
7769
7770The command @kbd{J b} (@code{mh-junk-blacklist}) adds a
7771@samp{blacklist_from} entry to @file{~/spamassassin/user_prefs},
7772deletes the message, and sends the message to the Razor, so that
7773others might not see this spam. If the @command{sa-learn} command is
7774available, the message is also recategorized as spam.
7775
7776The command@kbd{J w} (@code{mh-junk-whitelist}) adds a
7777@samp{whitelist_from} rule to @samp{~/.spamassassin/user_prefs}. If
7778the @command{sa-learn} command is available, the message is also
7779recategorized as ham.
7780
7781Over time, you'll observe that the same host or domain occurs
7782repeatedly in the @samp{blacklist_from} entries, so you might think
7783that you could avoid future spam by blacklisting all mail from a
7784particular domain. The utility function
7785@code{mh-spamassassin-identify-spammers} helps you do precisely that.
7786This function displays a frequency count of the hosts and domains in
7787the @samp{blacklist_from} entries from the last blank line in
7788@file{~/.spamassassin/user_prefs} to the end of the file. This
7789information can be used so that you can replace multiple
7790@samp{blacklist_from} entries with a single wildcard entry such as:
7791
7792@smallexample
7793blacklist_from *@@*amazingoffersdirect2u.com
7794@end smallexample
7795
7796In versions of SpamAssassin (2.50 and on) that support a Bayesian
7797classifier, @kbd{J b} @code{(mh-junk-blacklist}) uses the program
7798@command{sa-learn} to recategorize the message as spam. Neither MH-E,
7799nor SpamAssassin, rebuilds the database after adding words, so you
7800will need to run @samp{sa-learn --rebuild} periodically. This can be
7801done by adding the following to your @file{crontab}:
7802
7803@smallexample
9360256a 78040 * * * * sa-learn --rebuild > /dev/null 2>&1
4009494e
GM
7805@end smallexample
7806
7807@subheading Bogofilter
7808
7809@cindex bogofilter
7810@cindex spam filters, bogofilter
7811
7812Bogofilter is a Bayesian spam filtering program. Get it from your
7813local distribution or from the
7814@uref{http://bogofilter.sourceforge.net/, bogofilter web site}.
7815
7816Bogofilter is taught by running:
7817
7818@smallexample
7819bogofilter -n < good-message
7820@end smallexample
7821
7822on every good message, and
7823
7824@smallexample
7825bogofilter -s < spam-message
7826@end smallexample
7827
7828@cindex full training
7829
7830on every spam message. This is called a @dfn{full training}; three
7831other training methods are described in the FAQ that is distributed
7832with bogofilter. Note that most Bayesian filters need 1000 to 5000 of
7833each type of message to start doing a good job.
7834
7835To use bogofilter, add the following recipes to @file{~/.procmailrc}:
7836
36a672f6
GM
7837@cindex @samp{X-Bogosity} header field
7838@cindex header field, @samp{X-Bogosity}
4009494e
GM
7839
7840@smallexample
7841PATH=$PATH:/usr/bin/mh
7842MAILDIR=$HOME/`mhparam Path`
7843
7844# Fight spam with Bogofilter.
7845:0fw
7846| bogofilter -3 -e -p
7847
7848:0:
7849* ^X-Bogosity: Yes, tests=bogofilter
7850spam/.
7851
7852:0:
7853* ^X-Bogosity: Unsure, tests=bogofilter
7854spam/unsure/.
7855@end smallexample
7856
7857@findex mh-junk-blacklist
7858@findex mh-junk-whitelist
7859@kindex J b
7860@kindex J w
7861
7862If bogofilter classifies a message incorrectly, or is unsure, you can
7863use the MH-E commands @kbd{J b} (@code{mh-junk-blacklist}) and @kbd{J
7864w} (@code{mh-junk-whitelist}) to update bogofilter's training.
7865
7866The @cite{Bogofilter FAQ} suggests that you run the following
7867occasionally to shrink the database:
7868
7869@smallexample
7870bogoutil -d wordlist.db | bogoutil -l wordlist.db.new
7871mv wordlist.db wordlist.db.prv
7872mv wordlist.db.new wordlist.db
7873@end smallexample
7874
7875The @cite{Bogofilter tuning HOWTO} describes how you can fine-tune
7876bogofilter.
7877
7878@subheading SpamProbe
7879
7880@cindex SpamProbe
7881@cindex spam filters, SpamProbe
7882
7883SpamProbe is a Bayesian spam filtering program. Get it from your local
7884distribution or from the @uref{http://spamprobe.sourceforge.net,
7885SpamProbe web site}.
7886
7887To use SpamProbe, add the following recipes to @file{~/.procmailrc}:
7888
7889@cindex @command{formail}
36a672f6
GM
7890@cindex @samp{X-SpamProbe} header field
7891@cindex header field, @samp{X-SpamProbe}
4009494e
GM
7892
7893@smallexample
7894PATH=$PATH:/usr/bin/mh
7895MAILDIR=$HOME/`mhparam Path`
7896
7897# Fight spam with SpamProbe.
7898:0
7899SCORE=| spamprobe receive
7900
7901:0 wf
7902| formail -I "X-SpamProbe: $SCORE"
7903
7904:0:
7905*^X-SpamProbe: SPAM
7906spam/.
7907@end smallexample
7908
7909@findex mh-junk-blacklist
7910@findex mh-junk-whitelist
7911@kindex J b
7912@kindex J w
7913
7914If SpamProbe classifies a message incorrectly, you can use the MH-E
7915commands @kbd{J b} (@code{mh-junk-blacklist}) and @kbd{J w}
7916(@code{mh-junk-whitelist}) to update SpamProbe's training.
7917
7918@subheading Other Things You Can Do
7919
7920There are a couple of things that you can add to @file{~/.procmailrc}
7921in order to filter out a lot of spam and viruses. The first is to
7922eliminate any message with a Windows executable (which is most likely
7923a virus). The second is to eliminate mail in character sets that you
7924can't read.
7925
36a672f6
GM
7926@cindex @samp{Content-Transfer-Encoding} header field
7927@cindex @samp{Content-Type} header field
7928@cindex @samp{Subject} header field
7929@cindex header field, @samp{Content-Transfer-Encoding}
7930@cindex header field, @samp{Content-Type}
7931@cindex header field, @samp{Subject}
4009494e
GM
7932
7933@smallexample
7934PATH=$PATH:/usr/bin/mh
7935MAILDIR=$HOME/`mhparam Path`
7936
7937#
b46a6a83 7938# Filter messages with w32 executables/virii.
4009494e
GM
7939#
7940# These attachments are base64 and have a TVqQAAMAAAAEAAAA//8AALg
7941# pattern. The string "this program cannot be run in MS-DOS mode"
7942# encoded in base64 is 4fug4AtAnNIbg and helps to avoid false
7943# positives (Roland Smith via Pete from the bogofilter mailing list).
7944#
7945:0 B:
7946* ^Content-Transfer-Encoding:.*base64
7947* ^TVqQAAMAAAAEAAAA//8AALg
7948* 4fug4AtAnNIbg
7949spam/exe/.
7950
7951#
7952# Filter mail in unreadable character sets (from the Bogofilter FAQ).
7953#
7954UNREADABLE='[^?"]*big5|iso-2022-jp|ISO-2022-KR|euc-kr|gb2312|ks_c_5601-1987'
7955
7956:0:
7957* 1^0 $ ^Subject:.*=\?($UNREADABLE)
7958* 1^0 $ ^Content-Type:.*charset="?($UNREADABLE)
7959spam/unreadable/.
7960
7961:0:
7962* ^Content-Type:.*multipart
7963* B ?? $ ^Content-Type:.*^?.*charset="?($UNREADABLE)
7964spam/unreadable/.
7965@end smallexample
7966
7967@node Miscellaneous, Scan Line Formats, Junk, Top
7968@chapter Miscellaneous Commands, Variables, and Buffers
7969
7970This chapter covers the following command and the various MH-E
7971buffers,
7972
7973@ftable @code
7974@item mh-version
7975Display version information about MH-E and the MH mail handling
7976system.
7977@end ftable
7978
7979@cindex buffers, @samp{*MH-E Info*}
7980@cindex MH-E version
7981@cindex @samp{*MH-E Info*}
7982@cindex version
7983@kindex M-x mh-version
7984
7985One command worth noting is @kbd{M-x mh-version}. You can compare the
7986version this command prints to the latest release (@pxref{Getting
7987MH-E}). The output of @kbd{M-x mh-version}, found in a buffer named
7988@samp{*MH-E Info*}, should usually be included with any bug report you
7989submit (@pxref{Bug Reports}).
7990
7991@subheading MH-E Buffers
7992
7993Besides the MH-Folder, MH-Show, and MH-Letter buffers, MH-E creates
7994several other buffers. They are:
7995
7996@table @samp
7997@cindex @samp{*MH-E Folders*}
7998@cindex buffers, @samp{*MH-E Folders*}
7999@findex mh-list-folders
8000@item *MH-E Folders*
8001@kindex F l
8002This buffer contains the output of @kbd{F l} (@code{mh-list-folders}).
8003@xref{Folders}.
8004@c -------------------------
8005@cindex @samp{*MH-E Help*}
8006@cindex buffers, @samp{*MH-E Help*}
8007@findex mh-help
8008@item *MH-E Help*
8009@kindex ?
8010@kindex C-c ?
8011This buffer contains the output of @kbd{?} (@code{mh-help}) and
8012@kbd{C-c ?} in MH-Letter mode. @xref{Using This Manual}.
8013@c -------------------------
8014@cindex @samp{*MH-E Info*}
8015@cindex buffers, @samp{*MH-E Info*}
8016@item *MH-E Info*
8017This buffer contains the output of @kbd{M-x mh-version @key{RET}}.
8018@c -------------------------
8019@cindex @samp{*MH-E Log*}
8020@cindex buffers, @samp{*MH-E Log*}
8021@item *MH-E Log*
8022This buffer contains the last 100 lines of the output of the various
8023MH commands.
8024@c -------------------------
8025@cindex @samp{*MH-E Mail Delivery*}
8026@cindex buffers, @samp{*MH-E Mail Delivery*}
8027@item *MH-E Mail Delivery*
8028This buffer contains the transcript of a mail delivery. @xref{Sending
8029Message}.
8030@c -------------------------
8031@cindex @samp{*MH-E Recipients*}
8032@cindex buffers, @samp{*MH-E Recipients*}
8033@findex mh-check-whom
8034@item *MH-E Recipients*
8035@kindex C-c C-w
8036This buffer contains the output of @kbd{C-c C-w}
8037(@code{mh-check-whom}) and is killed when draft is sent.
8038@xref{Checking Recipients}.
8039@c -------------------------
8040@cindex @samp{*MH-E Sequences*}
8041@cindex buffers, @samp{*MH-E Sequences*}
8042@item *MH-E Sequences*
8043This buffer contains the output of @kbd{S l}
8044(@code{mh-list-sequences}). @xref{Sequences}.
8045@c -------------------------
8046@cindex @samp{*mh-temp*}
8047@cindex buffers, @samp{*mh-temp*}
8048@item *mh-temp*
8049This is a scratch, ephemeral, buffer used by MH-E functions. Note that
8050it is hidden because the first character in the name is a space.
8051You'll generally not have any need for this buffer.
8052@end table
8053
8054@node Scan Line Formats, Procmail, Miscellaneous, Top
8055@appendix Scan Line Formats
8056
8057@cindex scan line formats
8058
8059This appendix discusses how MH-E creates, parses, and manipulates scan
8060lines. If you have your own MH scan or inc format files, you
8061@strong{can} teach MH-E how to handle them, but it isn't easy as
8062you'll see.
8063
8064@cindex @samp{mh-scan-line-formats} customization group
8065@cindex customization group, @samp{mh-scan-line-formats}
8066
8067This table lists the options in the @samp{mh-scan-line-formats}
8068customization group.
8069
8070@vtable @code
8071@item mh-adaptive-cmd-note-flag
8072On means that the message number width is determined dynamically
8073(default: @samp{on}).
8074@c -------------------------
8075@item mh-scan-format-file
8076Specifies the format file to pass to the scan program (default:
8077@samp{Use MH-E scan Format}).
8078@c -------------------------
8079@item mh-scan-prog
8080Program used to scan messages (default: @code{"scan"}).
8081@end vtable
8082
8083@vindex mh-adaptive-cmd-note-flag
8084
8085There are a couple of caveats when creating your own scan format file.
8086First, MH-E will not work if your scan lines do not include message
8087numbers. It will work poorly if you don't dedicate a column for
aedac0f0 8088showing the current message and notations. It is also best to keep the
34f3247f
BW
8089first column empty to make room for the cursor and so that text isn't
8090obscured by the current message's overlay arrow when running in a
8091terminal. You won't be able to use the option
8092@code{mh-adaptive-cmd-note-flag} or the threading features
8093(@pxref{Threading}).
4009494e
GM
8094
8095@cindex message numbers
8096@findex mh-set-cmd-note
8097@vindex mh-adaptive-cmd-note-flag
8098@vindex mh-scan-format-file
8099
8100If you've created your own format to handle long message numbers,
8101you'll be pleased to know you no longer need it since MH-E adapts its
8102internal format based upon the largest message number if
8103@code{mh-adaptive-cmd-note-flag} is on (the default). If you prefer
8104fixed-width message numbers, turn off @code{mh-adaptive-cmd-note-flag}
8105and call @code{mh-set-cmd-note} with the width specified by your
8106format file (see @code{mh-scan-format-file}). For example, the default
8107width is 4, so you would use @samp{(mh-set-cmd-note 4)}.
8108
8109@vindex mh-adaptive-cmd-note-flag
8110@vindex mh-scan-format-file
8111@vindex mh-scan-format-mh
8112@vindex mh-scan-format-nmh
8113
8114The default setting for @code{mh-scan-format-file} is @samp{Use MH-E
8115scan Format}. This means that the format string will be taken from the
8116either @code{mh-scan-format-mh} or @code{mh-scan-format-nmh} depending
8c20bd92
BW
8117on whether MH or nmh (or GNU mailutils MH) is in use. This setting
8118also enables you to turn on the option
8119@code{mh-adaptive-cmd-note-flag}. You can also set this option to
8120@samp{Use Default scan Format} to get the same output as you would get
8121if you ran @command{scan} from the shell. If you have a format file
8122that you want MH-E to use but not MH, you can set this option to
8123@samp{Specify a scan Format File} and enter the name of your format
8124file.
4009494e
GM
8125
8126@vindex mh-scan-format-file
8127@vindex mh-scan-format-mh
8128@vindex mh-scan-format-nmh
8129
8130The scan format that MH-E uses when @code{mh-scan-format-file} is set
8131to its default of @samp{Use MH-E scan Format} is held in the variables
8132@code{mh-scan-format-nmh} and @code{mh-scan-format-mh} depending on
8c20bd92 8133whether you are using nmh (or GNU mailutils MH) or not. Typically, you
4009494e
GM
8134create your own format files rather than modifying these variables.
8135The value of @code{mh-scan-format-nmh} is:
8136
8137@smallexample
8138(concat
8139 "%4(msg)"
8140 "%<(cur)+%| %>"
8141 "%<@{replied@}-"
8142 "%?(nonnull(comp@{to@}))%<(mymbox@{to@})t%>"
8143 "%?(nonnull(comp@{cc@}))%<(mymbox@{cc@})c%>"
8144 "%?(nonnull(comp@{bcc@}))%<(mymbox@{bcc@})b%>"
8145 "%?(nonnull(comp@{newsgroups@}))n%>"
8146 "%<(zero) %>"
8147 "%02(mon@{date@})/%02(mday@{date@})%<@{date@} %|*%>"
8148 "%<(mymbox@{from@})%<@{to@}To:%14(decode(friendly@{to@}))%>%>"
8149 "%<(zero)%17(decode(friendly@{from@}))%> "
8150 "%(decode@{subject@})%<@{body@}<<%@{body@}%>")
8151@end smallexample
8152
8153@cindex decoding RFC 2047
8154@cindex RFC 2047, decoding
8155@vindex mh-scan-format-mh
8156
8157The setting for @code{mh-scan-format-mh} is similar, except that MH
8158doesn't have the function @code{decode} (which is used to decode RFC
81592047 encodings).
8160
8161@cindex notations, scan line
8162@cindex scan line notations
8163
8164These strings are passed to the @command{scan} program via the
8165@option{-format} argument. The formats are identical to the defaults
8166except that additional hints for fontification have been added to the
8167existing notations in the fifth column (remember that in Emacs, the
8168columns start at 0). The values of the fifth column, in priority
8169order, are: @samp{-} if the message has been replied to, @samp{t} if
8170an address in the @samp{To:} field matches one of the mailboxes of the
8171current user, @samp{c} if the @samp{Cc:} field matches, @samp{b} if
8172the @samp{Bcc:} field matches, and @samp{n} if a non-empty
8173@samp{Newsgroups:} field is present.
8174
8175@cindex @command{scan}
8176@cindex MH commands, @command{scan}
8177@vindex mh-progs
8178@vindex mh-scan-prog
8179
8180The name of the program that generates a listing of one line per
8181message is held in @code{mh-scan-prog} (default: @code{"scan"}).
8182Unless this variable contains an absolute pathname, it is assumed to
8183be in the @code{mh-progs} directory (@pxref{Getting Started}). You may
8184link another program to @command{scan} (see @samp{mh-profile}(5)) to
8185produce a different type of listing@footnote{See the section
8186@uref{@value{MH-BOOK-HOME}/faswsprs.html, Find and Specify with scan
8187pick Ranges Sequences} in the MH book.}.
8188
8189@cindex regular expressions, scan line formats
8190@findex mh-set-cmd-note
8191@findex setq
8192
8193If you change the format of the scan lines you'll need to tell MH-E
8194how to parse the new format. As you will see, quite a lot of variables
8195are involved to do that. Use @kbd{M-x apropos @key{RET}
8196mh-scan.*regexp @key{RET}} to obtain a list of these variables. You
8197will also have to call @code{mh-set-cmd-note} if your notations are
8198not in column 4 (columns in Emacs start with 0). Note that unlike most
8199of the user options described in this manual, these are variables and
8200must be set with @code{setq} instead of in a customization buffer. For
8201help with regular expressions, see
8202@ifnothtml
8203@ref{Regexps, , Syntax of Regular Expressions, emacs, The
8204GNU Emacs Manual}.
8205@end ifnothtml
8206@ifhtml
8207section
fc0c5af8 8208@uref{http://www.gnu.org/software/emacs/manual/html_node/emacs/Regexps.html,
4009494e
GM
8209Syntax of Regular Expressions} in @cite{The GNU Emacs Manual}.
8210@end ifhtml
8211
8212The first variable has to do with pruning out garbage.
8213
8214@vtable @code
8215@cindex @command{inc}
8216@cindex MH commands, @command{inc}
8217@cindex @command{scan}
8218@cindex MH commands, @command{scan}
8219@item mh-scan-valid-regexp
8220This regular expression describes a valid scan line. This is used to
8221eliminate error messages that are occasionally produced by
8222@command{inc}@footnote{See the section
8223@uref{@value{MH-BOOK-HOME}/reapre.html, Reading Mail: inc show next
8224prev} in the MH book.} or @command{scan} (default: @code{"^ *[0-9]"}).
8225@end vtable
8226
8227Next, many variables control how the scan lines are parsed.
8228
8229@vtable @code
8230@vindex mh-folder-body
8231@vindex mh-folder-font-lock-keywords
8232@item mh-scan-body-regexp
8233This regular expression matches the message body fragment. Note that
8234the default setting of @code{mh-folder-font-lock-keywords} expects
8235this expression to contain at least one parenthesized expression which
8236matches the body text as in the default of
8237@code{"\\(<<\\([^\n]+\\)?\\)"}. If this regular expression is not
8238correct, the body fragment will not be highlighted with the face
8239@code{mh-folder-body}.
8240@c -------------------------
8241@vindex mh-folder-cur-msg-number
8242@vindex mh-folder-font-lock-keywords
8243@vindex mh-note-cur
8244@item mh-scan-cur-msg-number-regexp
8245This regular expression matches the current message. It must match
8246from the beginning of the line. Note that the default setting of
8247@code{mh-folder-font-lock-keywords} expects this expression to contain
8248at least one parenthesized expression which matches the message number
8249as in the default of @w{@code{"^\\( *[0-9]+\\+\\).*"}}. This
8250expression includes the leading space and current message marker
8251@samp{+} within the parenthesis since it looks better to highlight
8252these items as well. The highlighting is done with the face
8253@code{mh-folder-cur-msg-number}. This regular expression should be
8254correct as it is needed by non-fontification functions. See also
8255@code{mh-note-cur}.
8256@c -------------------------
8257@vindex mh-folder-date
8258@vindex mh-folder-font-lock-keywords
8259@vindex mh-scan-sent-to-me-sender-regexp
8260@item mh-scan-date-regexp
8261This regular expression matches a valid date. It must @strong{not} be
8262anchored to the beginning or the end of the line. Note that the
8263default setting of @code{mh-folder-font-lock-keywords} expects this
8264expression to contain only one parenthesized expression which matches
8265the date field as in the default of
8266@code{"\\([0-9][0-9]/[0-9][0-9]\\)"}. If this regular expression is
8267not correct, the date will not be highlighted with the face
8268@code{mh-folder-date}.
8269@c -------------------------
8270@vindex mh-folder-deleted
8271@vindex mh-folder-font-lock-keywords
8272@vindex mh-note-deleted
8273@item mh-scan-deleted-msg-regexp
8274This regular expression matches deleted messages. It must match from
8275the beginning of the line. Note that the default setting of
8276@code{mh-folder-font-lock-keywords} expects this expression to contain
8277at least one parenthesized expression which matches the message number
8278as in the default of @code{"^\\( *[0-9]+\\)D"}. This expression
8279includes the leading space within the parenthesis since it looks
8280better to highlight it as well. The highlighting is done with the face
8281@code{mh-folder-deleted}. This regular expression should be correct as
8282it is needed by non-fontification functions. See also
8283@code{mh-note-deleted}.
8284@c -------------------------
8285@vindex mh-folder-font-lock-keywords
8286@vindex mh-folder-msg-number
8287@item mh-scan-good-msg-regexp
8288This regular expression matches ``good'' messages. It must match from
8289the beginning of the line. Note that the default setting of
8290@code{mh-folder-font-lock-keywords} expects this expression to contain
8291at least one parenthesized expression which matches the message number
8292as in the default of @w{@code{"^\\( *[0-9]+\\)[^D^0-9]"}}. This
8293expression includes the leading space within the parenthesis since it
8294looks better to highlight it as well. The highlighting is done with
8295the face @code{mh-folder-msg-number}. This regular expression should
8296be correct as it is needed by non-fontification functions.
8297@c -------------------------
8298@vindex mh-scan-format-file
8299@item mh-scan-msg-format-regexp
8300This regular expression finds the message number width in a scan
8301format. Note that the message number must be placed in a parenthesized
8302expression as in the default of @code{"%\\([0-9]*\\)(msg)"}. This
8303variable is only consulted if @code{mh-scan-format-file} is set to
8304@samp{Use MH-E scan Format}.
8305@c -------------------------
8306@vindex mh-scan-format-file
8307@item mh-scan-msg-format-string
8308This is a format string for the width of the message number in a scan
8309format. Use @samp{0%d} for zero-filled message numbers. This variable
8310is only consulted if @code{mh-scan-format-file} is set to @samp{Use
8311MH-E scan Format} (default: @code{"%d"}).
8312@c -------------------------
8313@item mh-scan-msg-number-regexp
8314This regular expression extracts the message number. It must match
8315from the beginning of the line. Note that the message number must be
8316placed in a parenthesized expression as in the default of @w{@code{"^
8317*\\([0-9]+\\)"}}.
8318@c -------------------------
8319@item mh-scan-msg-overflow-regexp
8320This regular expression matches overflowed message numbers (default:
8321@code{"^[?0-9][0-9]"}).
8322@c -------------------------
8323@item mh-scan-msg-search-regexp
8324This regular expression matches a particular message. It is a format
8325string; use @samp{%d} to represent the location of the message number
8326within the expression as in the default of @code{"^[^0-9]*%d[^0-9]"}.
8327@c -------------------------
8328@vindex mh-folder-address
8329@vindex mh-folder-font-lock-keywords
8330@vindex mh-folder-to
8331@item mh-scan-rcpt-regexp
8332This regular expression specifies the recipient in messages you sent.
8333Note that the default setting of @code{mh-folder-font-lock-keywords}
8334expects this expression to contain two parenthesized expressions. The
8335first is expected to match the @samp{To:} that the default scan format
8336file generates. The second is expected to match the recipient's name
8337as in the default of @code{"\\(To:\\)\\(..............\\)"}. If this
8338regular expression is not correct, the @samp{To:} string will not be
8339highlighted with the face @code{mh-folder-to} and the recipient will not be
8340highlighted with the face @code{mh-folder-address}.
8341@c -------------------------
8342@vindex mh-folder-font-lock-keywords
8343@vindex mh-folder-refiled
8344@vindex mh-note-refiled
8345@item mh-scan-refiled-msg-regexp
8346This regular expression matches refiled messages. It must match from
8347the beginning of the line. Note that the default setting of
8348@code{mh-folder-font-lock-keywords} expects this expression to contain
8349at least one parenthesized expression which matches the message number
8350as in the default of @w{@code{"^\\( *[0-9]+\\)\\^"}}. This expression
8351includes the leading space within the parenthesis since it looks
8352better to highlight it as well. The highlighting is done with the face
8353@code{mh-folder-refiled}. This regular expression should be correct as
8354it is needed by non-fontification functions. See also
8355@code{mh-note-refiled}.
8356@c -------------------------
8357@vindex mh-folder-font-lock-keywords
8358@vindex mh-folder-sent-to-me-sender
8359@vindex mh-mh-folder-sent-to-me-hint
8360@vindex mh-scan-format-nmh
8361@item mh-scan-sent-to-me-sender-regexp
8362This regular expression matches messages sent to us. Note that the
8363default setting of @code{mh-folder-font-lock-keywords} expects this
8364expression to contain at least two parenthesized expressions. The
8365first should match the fontification hint (see
8366@code{mh-scan-format-nmh}) and the second should match the user name
8367as in the default of
8368@w{@code{"^ *[0-9]+.\\([bct]\\).....[ ]*\\(..................\\)"}}.
8369If this regular expression is not correct, the notation hints will not
8370be highlighted with the face @code{mh-mh-folder-sent-to-me-hint} and
8371the sender will not be highlighted with the face
8372@code{mh-folder-sent-to-me-sender}.
8373@c -------------------------
8374@vindex mh-folder-followup
8375@vindex mh-folder-font-lock-keywords
8376@vindex mh-folder-subject
8377@item mh-scan-subject-regexp
8378This regular expression matches the subject. It must match from the
8379beginning of the line. Note that the default setting of
8380@samp{mh-folder-font-lock-keywords} expects this expression to contain
8381at least three parenthesized expressions. The first is expected to
8382match the @samp{Re:} string, if any, and is highlighted with the face
8383@code{mh-folder-followup}. The second matches an optional bracketed
8384number after @samp{Re:}, such as in @samp{Re[2]:} (and is thus a
8385sub-expression of the first expression). The third is expected to
8386match the subject line itself which is highlighted with the face
8387@code{mh-folder-subject}. For example, the default is
8388@w{@code{"^ *[0-9]+........[ ]*...................}}@*
8389@w{@code{\\([Rr][Ee]\\(\\[[0-9]+\\]\\)?:\\s-*\\)*\\([^<\n]*\\)"}}.
8390This regular expression should be correct as it is needed by
8391non-fontification functions. Note that this example is broken up on
8392two lines for readability, but is actually a single string.
8393@end vtable
8394
8395Finally, there are a slew of variables that control how MH-E annotates
8396the scan lines.
8397
8398@vtable @code
8399@findex mh-set-cmd-note
8400@vindex mh-adaptive-cmd-note-flag
8401@item mh-cmd-note
8402Column for notations (default: 4). This variable should be set with
8403the function @code{mh-set-cmd-note}. This variable may be updated
8404dynamically if @code{mh-adaptive-cmd-note-flag} is on. The following
8405variables contain the notational characters. Note that columns in
8406Emacs start with 0.
8407@c -------------------------
8408@item mh-note-copied
8409Messages that have been copied are marked by this character (default:
8410@code{?C}).
8411@c -------------------------
8412@vindex mh-scan-cur-msg-number-regexp
8413@item mh-note-cur
8414The current message (in MH, not in MH-E) is marked by this character
8415(default: @code{?+}). See also @code{mh-scan-cur-msg-number-regexp}.
8416@c -------------------------
8417@vindex mh-scan-deleted-msg-regexp
8418@item mh-note-deleted
8419Messages that have been deleted are marked by this character (default:
8420@code{?D}). See also @code{mh-scan-deleted-msg-regexp}.
8421@c -------------------------
8422@item mh-note-dist
8423Messages that have been redistributed are marked by this character
8424(default: @code{?R}).
8425@c -------------------------
8426@item mh-note-forw
8427Messages that have been forwarded are marked by this character
8428(default: @code{?F}).
8429@c -------------------------
8430@item mh-note-printed
8431Messages that have been printed are marked by this character (default:
8432@code{?P}).
8433@c -------------------------
8434@vindex mh-scan-refiled-msg-regexp
8435@item mh-note-refiled
8436Messages that have been refiled are marked by this character (default:
8437@code{?^}). See also @code{mh-scan-refiled-msg-regexp}.
8438@c -------------------------
8439@item mh-note-repl
8440Messages that have been replied to are marked by this character
8441(default: @code{?-}).
8442@c -------------------------
8443@item mh-note-seq
8444Messages in a user-defined sequence are marked by this character
8445(default: @code{?%}). Messages in the @samp{search} sequence are
8446marked by this character as well.
8447@end vtable
8448
8449For example, let's say I have the following in @file{scan.format}
8450which displays the sender, the subject, and the message number. This
8451format places a @samp{+} after the message number for the current
8452message according to MH; it also uses that column for notations.
8453
8454@smallexample
8455%20(decode(friendly@{from@})) %50(decode@{subject@}) %4(msg)%<(cur)+%| %>
8456@end smallexample
8457
8458@vindex mh-adaptive-cmd-note-flag
8459@vindex mh-scan-format-file
8460@vindex mh-scan-format-file, example
8461
8462The first thing you have to do is tell MH-E to use this file.
8463Customize @code{mh-scan-format-file} and set its value to @samp{Use
8464Default scan Format}. If you didn't get already turn off
8465@code{mh-adaptive-cmd-note-flag}, you'll need to do that first.
8466
8467Next, tell MH-E what a valid scan line looks like so that you can at
8468least display the output of scan in your MH-Folder buffer.
8469
8470@vindex mh-scan-valid-regexp, example
8471
8472@smalllisp
8473(setq mh-scan-valid-regexp "[0-9]+[+D^ ]$")
8474@end smalllisp
8475
8476Now, in order to get rid of the @samp{Cursor not pointing to message}
8477message, you need to tell MH-E how to access the message number. You
8478should also see why MH-E requires that you include a message number in
8479the first place.
8480
8481@vindex mh-scan-msg-number-regexp, example
8482@vindex mh-scan-msg-search-regexp, example
8483
8484@smalllisp
8485(setq mh-scan-msg-number-regexp "^.* \\([0-9]+\\)[+D^ ]$")
8486(setq mh-scan-msg-search-regexp " %d[+D^ ]$")
8487@end smalllisp
8488
8489In order to get the next and previous commands working, add this.
8490
8491@vindex mh-scan-good-msg-regexp, example
8492
8493@smalllisp
8494(setq mh-scan-good-msg-regexp "^.* \\([0-9]+\\)[+D^ ]$")
8495@end smalllisp
8496
8497Note that the current message isn't marked with a @samp{+} when moving
8498between the next and previous messages. Here is the code required to
8499get this working.
8500
8501@vindex set-mh-cmd-note, example
8502@vindex mh-scan-cur-msg-number-regexp, example
8503
8504@smalllisp
8505(set-mh-cmd-note 76)
8506(setq mh-scan-cur-msg-number-regexp "^.* \\([0-9]+\\)\\+$")
8507@end smalllisp
8508
8509Finally, add the following to delete and refile messages.
8510
8511@vindex mh-scan-deleted-msg-regexp, example
8512@vindex mh-scan-refiled-msg-regexp, example
8513
8514@smalllisp
8515(setq mh-scan-deleted-msg-regexp "^.* \\([0-9]+\\)D$")
8516(setq mh-scan-refiled-msg-regexp "^.* \\([0-9]+\\)\\^$")
8517@end smalllisp
8518
8519This is just a bare minimum; it's best to adjust all of the regular
8520expressions to ensure that MH-E and highlighting perform well.
8521
8522@node Procmail, Odds and Ends, Scan Line Formats, Top
8523@appendix Reading Mailing Lists Effectively
8524
8525@cindex @command{procmail}
8526@cindex @command{slocal}
8527@cindex Gnus
8528@cindex MH commands, @command{slocal}
8529@cindex Unix commands, @command{procmail}
8530@cindex mailing lists, reading
8531
8532This appendix explains how to use @uref{http://www.procmail.org/,
8533procmail} to file mail from mailing lists into folders which can then
8534be read easily with MH-E@footnote{The MH equivalent, @command{slocal},
8535can be used as well, but procmail is more flexible and more packages
8536exist for procmail than for slocal.}. Some mailing lists have such
8537high traffic that Gnus must be used and I discuss how to use Gnus
8538side-by-side with MH-E.
8539
8540@cindex @file{.procmailrc}
8541@cindex files, @file{.procmailrc}
8542
8543First, I'll describe how to put mail from your mailing lists directly
8544into an MH folder using @command{procmail}. First, add the following
8545to @file{~/.procmailrc}. While the logging variables aren't strictly
8546necessary, they are extremely useful.
8547
8548@smallexample
8549[1] # Update PATH so procmail can find myrcvstore, rcvstore and mhparam.
8550[2] PATH=$PATH:/usr/lib/mh:/usr/bin/mh:$HOME/bin
8551[3]
8552[4] # Point LOGFILE at the actual log file.
8553[5] LOGFILE=$HOME/.procmail.log
8554[6]
8555[7] # This setting provides just the right amount of information.
8556[8] LOGABSTRACT=all
8557[9]
8558[10] # Uncomment the following line to see how your patterns match.
8559[11] #VERBOSE=yes
8560[12]
8561[13] # Place mail sent to any MH-E mailing list in +mh-e.
8562[14] :0 w: mh-e$LOCKEXT
61d841dd 8563[15] * ^TO.*mh-e-.*@@.*sourceforge.net
4009494e
GM
8564[16] | myrcvstore -create +mh-e
8565@end smallexample
8566
8567@cindex @command{rcvstore}
8568@cindex MH commands, @command{rcvstore}
8569
8570Line 14 creates a lock file in your mail directory based upon the name
8571of the folder. This is done because @command{rcvstore} does not
8572perform locking. While this lock file will prevent @command{procmail}
8573from writing to a folder concurrently, there is a slight chance that
8574you might lose a message if you're performing operations on a folder
8575at the same time @command{rcvstore} is placing a message there. You
8576have been warned. Now that that disclaimer is out of the way, note
8577that I've been using this set-up for over a decade and haven't lost
8578anything to my knowledge@footnote{See
8579@uref{https://savannah.nongnu.org/bugs/?func=detailbug&bug_id=4361&group_id=2166,
8580Savannah issue #4361} to see if @command{rcvstore} locking is still an
8581issue.}.
8582
36a672f6
GM
8583@cindex @samp{Unseen-Sequence} MH profile component
8584@cindex MH profile component, @samp{Unseen-Sequence}
4009494e
GM
8585
8586Line 16 uses the following script, @code{myrcvstore}, to massage the
8587message as described in the comment and file the message in the given
8588folder@footnote{The @samp{-create} argument wasn't always the default
8589to @command{rcvstore}.}.
8590
8591@smallexample
8592#! /bin/sh
8593
8594# Accepts a message on standard input and passes it through rcvstore
8595# after first passing it through any filters. All arguments are passed
8596# on to rcvstore.
8597
8598# Force the "From user date" to become part of header. One reason this
8599# is done is because the presence of the From field confuses dist so
8600# that dist adds a new header, rather than using the existing header.
8601# Note that this should not be done for any message that goes into a
8602# Gnus incoming file (Gnus will thrown an error) nor should it be
8603# applied to any message that goes to the system mailbox because the
8604# entire mailbox will be incorporated as a single message.
8605formail -c -z -R 'From ' X-Envelope-From: |
8606rcvstore $@@
8607@end smallexample
8608
8609If your version of @command{rcvstore} doesn't add messages to the
8610@samp{unseen} sequence by default, add the following line to your MH
8611profile:
8612
8613@smallexample
8614Unseen-Sequence: unseen
8615@end smallexample
8616
8617Now view your new messages with the speedbar (@pxref{Speedbar}) or with
8618@kbd{F n} (@code{mh-index-new-messages}). @xref{Folders}.
8619
8620If you're on a mailing list that is so voluminous that it is
8621impossible to read every message, it usually better to read the
8622mailing list like a newsgroup in a news reader. Emacs has a built-in
8623newsreader called Gnus. The remainder of this appendix talks about how
8624to use Gnus with an MH message store. The version of Gnus that was
8625used to prepare this manual was 5.10. Versions 5.8 through 5.10 should
8626work but versions prior to 5.8 use different options.
8627
8628This table contains a list of Gnus options that you will have to
8629modify. Note that for them to become accessible, you'll have to load
8630@file{nnml.el} first. This can be done with @kbd{M-x load-library
8631@key{RET} nnml @key{RET}}.
8632
8633@vtable @code
8634@item gnus-secondary-select-methods
8635Select the @samp{nnml} value. This select method uses directories for
1df7defd 8636folders and individual files for messages, just like MH@. You do not
4009494e
GM
8637have to set an address.
8638@c -------------------------
8639@item mail-sources
8640Select the @samp{Several files in a directory} value, check the
8641@samp{Path} box and enter @file{~/Mail} to tell Gnus where to find
8642your mail.
8643@c -------------------------
8644@vindex mail-user-agent
8645@item message-mail-user-agent
8646In order to send mail within Gnus using MH-E, set this option to
8647@samp{mail-user-agent} and set the @code{mail-user-agent} option to
8648@samp{Emacs interface to MH}.
8649@c -------------------------
8650@item nnmail-keep-last-article
8651Since Gnus keeps track of which messages you have read, it would be
8652bad if Gnus expired the last message, for example, message 100, and
8653@command{rcvstore} gave the next new message number 1. Gnus would then
f99f1641 8654ignore it since it thinks that you've read messages 1--100. Turning on
4009494e
GM
8655this option ensures that the last message is never removed thereby
8656eliminating this problem.
8657@end vtable
8658
8659Next add the following to @file{~/.procmailrc}. If you don't subscribe
8660to the GnuCash mailing list, substitute one to which you are
8661subscribed.
8662
8663@smallexample
8664PATH=$PATH:/usr/bin/mh
8665MAILDIR=$HOME/`mhparam Path`
8666# Place mail sent to the GnuCash mailing list in gnucash.spool, where
8667# Gnus will pick it up.
8668:0:
61d841dd 8669* ^TO.*gnucash.*@@.*gnucash.org
4009494e
GM
8670gnucash.spool
8671@end smallexample
8672
8673Wait for some messages to appear in @file{gnucash.spool} and run Gnus
8674with @kbd{M-x gnus @key{RET}}. To view the folder created in the
8675example above, you would tell Gnus about it the first time only with
8676@kbd{G m gnucash @key{RET} nnml @key{RET}}. In MH-E, this folder is
8677known as @samp{+gnucash}.
8678
8679@node Odds and Ends, History, Procmail, Top
8680@appendix Odds and Ends
8681
8682This appendix covers a few topics that don't fit elsewhere. Here I
8683tell you how to report bugs and how to get on the MH-E mailing lists.
8684I also point out some additional sources of information.
8685
8686@menu
8687* Bug Reports::
8688* Mailing Lists::
8689* MH FAQ and Support::
8690* Getting MH-E::
8691@end menu
8692
8693@node Bug Reports, Mailing Lists, Odds and Ends, Odds and Ends
8694@appendixsec Bug Reports
8695
8696@cindex bugs
8697@cindex SourceForge
8698@kindex M-x mh-version
8699
8700Bug reports should be filed at
fc0c5af8
BW
8701@uref{https://sourceforge.net/p/mh-e/bugs/, SourceForge}. You need to
8702be a SourceForge user to submit bug reports, but this is easy enough
8703to do that it shouldn't be a restriction for you. Please include the
8704output of @kbd{M-x mh-version} (@pxref{Miscellaneous}) in any bug
8705report you send unless you're 110% positive we won't ask for it.
4009494e
GM
8706
8707@node Mailing Lists, MH FAQ and Support, Bug Reports, Odds and Ends
8708@appendixsec MH-E Mailing Lists
8709
8710@cindex SourceForge
8711@cindex mailing lists
8712
1df7defd 8713There are several mailing lists for MH-E@. They are @i{mh-e-users at
4009494e
GM
8714lists.sourceforge.net}, @i{mh-e-announce at lists.sourceforge.net},
8715and @i{mh-e-devel at lists.sourceforge.net}. You can subscribe or view
fc0c5af8 8716the archives at @uref{https://sourceforge.net/p/mh-e/mailman/,
4009494e
GM
8717SourceForge}. Do not report bugs on these lists; please submit them
8718via SourceForge (@pxref{Bug Reports}).
8719
8720@node MH FAQ and Support, Getting MH-E, Mailing Lists, Odds and Ends
8721@appendixsec MH FAQ and Support
8722
8723@cindex FAQ
8724@cindex MH FAQ
8725
8726The article @uref{http://www.newt.com/faq/mh.html, @cite{MH Frequently
8727Asked Questions (FAQ) with Answers}} appears monthly in the newsgroup
8728@samp{comp.mail.mh}. While very little is there that deals with MH-E
8729specifically, there is an incredible wealth of material about MH
8730itself which you will find useful.
8731
8732@cindex support
8733
fc0c5af8
BW
8734You can find FAQs on MH-E by searching for @i{labels:support} on the
8735@uref{https://sourceforge.net/p/mh-e/bugs/search/?q=labels%3Asupport,
8736Tickets} page on SourceForge. If you don't find the answer to your
8737question, file a ticket and your question will become a new FAQ!
4009494e
GM
8738
8739@node Getting MH-E, , MH FAQ and Support, Odds and Ends
8740@appendixsec Getting MH-E
8741
8742@cindex MH-E, obtaining
8743@cindex getting MH-E
8744@cindex obtaining MH-E
8745
8746Because MH-E is undergoing a phase of sustained growth, the version of
8747MH-E in your Emacs is likely to be out of date although it is most
8748likely to be more up to date than the copy that comes with the MH
8749distribution in @file{miscellany/mh-e}.
8750
8751@cindex change log
8752@cindex release notes
8753
8754New MH-E releases are always available for downloading at
fc0c5af8
BW
8755@uref{https://sourceforge.net/projects/mh-e/files/, SourceForge}
8756before they appear in an Emacs release. You can read the release notes
8757on that page to determine if the given release of MH-E is already
8758installed in your version of Emacs. You can also read the change log
8759to see if you are interested in what the given release of MH-E has to
8760offer (although we have no doubt that you will be extremely interested
8761in all new releases).
4009494e
GM
8762
8763@cindex Debian
8764
8765If you use Debian, you can install the Debian
8766@uref{http://packages.debian.org/unstable/mail/mh-e, mh-e package}
8767instead.
8768
8769@cindex files, @samp{MH-E-NEWS}
8770@cindex files, @samp{README}
8771@cindex news
8772@cindex @samp{MH-E-NEWS}
8773@cindex @samp{README}
8774@kindex M-x mh-version
8775
8776After you download and extract the MH-E tarball, read the
8777@file{README} file and @file{MH-E-NEWS}. These correspond to the
8778release notes and change log mentioned above. The file @file{README}
1df7defd 8779contains instructions on installing MH-E@. If you're already running
4009494e 8780Emacs, please quit that session and start again to load in the new
1df7defd 8781MH-E@. Check that you're running the new version with the command
4009494e
GM
8782@kbd{M-x mh-version}.
8783
8784@cindex contributed software
8785@cindex manual
8786@cindex documentation
8787
8788In addition to the mh-e package, the
fc0c5af8
BW
8789@uref{https://sourceforge.net/projects/mh-e/files/, SourceForge} site
8790also contains doc and contrib packages. The former is the latest
8791release of this manual, and the latter contains a few contributed
8792packages you might find useful.
4009494e
GM
8793
8794@node History, GFDL, Odds and Ends, Top
8795@appendix History of MH-E
8796
8797@cindex Bill Wohler
8798@cindex Brian Reid
8799@cindex Gildea, Stephen
8800@cindex Jim Larus
8801@cindex Larus, Jim
8802@cindex MH-E, versions
8803@cindex Reid, Brian
8804@cindex SourceForge
8805@cindex Stephen Gildea
8806@cindex Wohler, Bill
8807@cindex history of MH-E
8808@cindex versions of MH-E
8809
8810MH-E was originally written by Brian Reid in 1983 and has changed
8811hands several times since then. Jim Larus wanted to do something
8812similar for GNU Emacs, and ended up completely rewriting it that same
8813year. In 1989, Stephen Gildea picked it up and added many
8814improvements. Bill Wohler then took over in 2000 and moved its
8815development to @uref{http://sourceforge.net/, SourceForge} where it
8816lives today.
8817
8818@menu
8819* From Brian Reid::
8820* From Jim Larus::
8821* From Stephen Gildea::
8822* From Bill Wohler::
8823@end menu
8824
8825@node From Brian Reid, From Jim Larus, History, History
8826@appendixsec From Brian Reid
8827
8828@cindex Brian Reid
8829@cindex Reid, Brian
8830
8831One day in 1983 I got the flu and had to stay home from work for three
8832days with nothing to do. I used that time to write MHE@. The
8833fundamental idea behind MHE was that it was a ``puppeteer'' driving
8834the MH programs underneath it. MH had a model that the editor was
8835supposed to run as a sub-process of the mailer, which seemed to me at
8836the time to be the tail wagging the dog. So I turned it around and
8837made the editor drive the MH programs. I made sure that the UCI people
8838(who were maintaining MH at the time) took in my changes and made them
8839stick.
8840
8841Today, I still use my own version of MHE because I don't at all like
8842the way that GNU MH-E works and I've never gotten to be good enough at
8843hacking Emacs Lisp to make GNU MH-E do what I want. The Gosling-emacs
8844version of MHE and the GNU Emacs version of MH-E have almost nothing
8845in common except similar names. They work differently, have different
8846conceptual models, and have different key bindings@footnote{After
8847reading this article, I questioned Brian about his version of MHE, and
8848received some great ideas for improving MH-E such as a dired-like
8849method of selecting folders; and removing the prompting when sending
8850mail, filling in the blanks in the draft buffer instead. I passed them
8851on to Stephen Gildea, the current maintainer, and he was excited about
8852the ideas as well. Perhaps one day, MH-E will again resemble MHE
8853(draft form editing was introduced in version 7.4).}.
8854
8855Brian Reid, June 1994
8856
8857@node From Jim Larus, From Stephen Gildea, From Brian Reid, History
8858@appendixsec From Jim Larus
8859
8860@cindex Jim Larus
8861@cindex Larus, Jim
8862
8863Brian Reid, while at CMU or shortly after going to Stanford wrote a
8864mail reading program called MHE for Gosling Emacs. It had much the
8865same structure as MH-E (i.e., invoked MH programs), though it was
8866simpler and the commands were slightly different. Unfortunately, I no
8867longer have a copy so the differences are lost in the mists of time.
8868
f99f1641 8869In '82--83, I was working at BBN and wrote a lot of mlisp code in
4009494e
GM
8870Gosling Emacs to make it look more like Tennex Emacs. One of the
8871packages that I picked up and improved was Reid's mail system. In '83,
8872I went back to Berkeley. About that time, Stallman's first version of
8873GNU Emacs came out and people started to move to it from Gosling Emacs
8874(as I recall, the transition took a year or two). I decided to port
8875Reid's MHE and used the mlisp to Emacs Lisp translator that came with
8876GNU Emacs. It did a lousy job and the resulting code didn't work, so I
8877bit the bullet and rewrote the code by hand (it was a lot smaller and
8878simpler then, so it took only a day or two).
8879
8880Soon after that, MH-E became part of the standard Emacs distribution
8881and suggestions kept dribbling in for improvements. MH-E soon reached
8882sufficient functionality to keep me happy, but I kept on improving it
8883because I was a graduate student with plenty of time on my hands and
8884it was more fun than my dissertation. In retrospect, the one thing
8885that I regret is not writing any documentation, which seriously
8886limited the use and appeal of the package.
8887
8888@cindex @command{xmh}, in MH-E history
8889
8890In '89, I came to Wisconsin as a professor and decided not to work on
1df7defd 8891MH-E@. It was stable, except for minor bugs, and had enough
4009494e
GM
8892functionality, so I let it be for a few years. Stephen Gildea of BBN
8893began to pester me about the bugs, but I ignored them. In 1990, he
8894went off to the X Consortium, said good bye, and said that he would
8895now be using @command{xmh}. A few months later, he came back and said
8896that he couldn't stand @command{xmh} and could I put a few more bug fixes
1df7defd 8897into MH-E@. At that point, I had no interest in fixing MH-E, so I gave
4009494e
GM
8898the responsibility of maintenance to him and he has done a fine job
8899since then.
8900
8901Jim Larus, June 1994
8902
8903@node From Stephen Gildea, From Bill Wohler, From Jim Larus, History
8904@appendixsec From Stephen Gildea
8905
8906@cindex Gildea, Stephen
8907@cindex Stephen Gildea
8908
8909In 1987 I went to work for Bolt Beranek and Newman, as Jim had before
8910me. In my previous job, I had been using RMAIL, but as my folders tend
8911to run large, I was frustrated with the speed of RMAIL@. However, I
8912stuck with it because I wanted the GNU Emacs interface. I am very
8913familiar and comfortable with the Emacs interface (with just a few
8914modifications of my own) and dislike having to use applications with
8915embedded editors; they never live up to Emacs.
8916
8917MH is the mail reader of choice at BBN, so I converted to it. Since I
1df7defd 8918didn't want to give up using an Emacs interface, I started using MH-E@.
4009494e
GM
8919As is my wont, I started hacking on it almost immediately. I first
8920used version 3.4m. One of the first features I added was to treat the
8921folder buffer as a file-visiting buffer: you could lock it, save it,
8922and be warned of unsaved changes when killing it. I also worked to
8923bring its functionality a little closer to RMAIL@. Jim Larus was very
8924cooperative about merging in my changes, and my efforts first appeared
8925in version 3.6, distributed with Emacs 18.52 in 1988. Next I decided
8926MH-E was too slow and optimized it a lot. Version, 3.7, distributed
8927with Emacs 18.56 in 1990, was noticeably faster.
8928
8929When I moved to the X Consortium I became the first person there to
1df7defd 8930not use xmh. (There is now one other engineer there using MH-E@.) About
4009494e
GM
8931this point I took over maintenance of MH-E from Jim and was finally
8932able to add some features Jim hadn't accepted, such as the backward
8933searching undo. My first release was 3.8 (Emacs 18.58) in 1992.
8934
8935Now, in 1994, we see a flurry of releases, with both 4.0 and 5.0.
8936Version 4.0 added many new features, including background folder
8937collection and support for composing @sc{mime} messages. (Reading
8938@sc{mime} messages remains to be done, alas.) While writing this book,
8939Bill Wohler gave MH-E its closest examination ever, uncovering bugs
8940and inconsistencies that required a new major version to fix, and so
8941version 5 was released.
8942
8943Stephen Gildea, June 1994
8944
8945@node From Bill Wohler, , From Stephen Gildea, History
8946@appendixsec From Bill Wohler
8947
8948@cindex Wohler, Bill
8949@cindex Bill Wohler
8950
8951The preface originally included the following text which I use to
8952begin my story:
8953
8954@quotation
8955But it's important to note a brief history of MH-E.
8956
8957@w{Version 3} was prevalent through the @w{Emacs 18} and early
8958@w{Emacs 19} years. Then @w{Version 4} came out (@w{Emacs 19.23}),
8959which introduced several new and changed commands. Next, @w{Version
89605.0} was released, which fixed some bugs and incompatibilities, and
8961was incorporated into @w{Emacs 19.29}.
8962@end quotation
8963
8964After a long break, Stephen handed the reins over to me in 2000. I
8965moved the project to a new site called SourceForge and organized a
8966great team of developers. Our first release in late 2001 was version
89676. It appeared around the time of Emacs 21.2 and had menus and tool
8968bar buttons.
8969
8970Then, indexed searches, improved MIME handling, a speedbar, multiple
8971identities, alias completion, an index view of unseen messages, spam
8972software support, Face and X-Image-URL header field support, Fcc
8973completion, arbitrary range handling, and draft form editing were
8974introduced in the version 7 series around the time of Emacs 21.4
8975(2004). Still, Emacs itself contained version 5 of MH-E released back
8976in 1994.
8977
8978Version 8 development was mostly driven by the rewrite of the manual.
8c20bd92
BW
8979It also brought GNU mailutils MH support, S/MIME support, picon
8980support, and an improved interface for hiding header fields. The CVS
8981repository was migrated from SourceForge to Savannah (only for those
8982files that were already part of Emacs) and the software was completely
3cf38f97
BW
8983reorganized to push back two decades of entropy. Version 8 appeared in
8984Emacs 22.1 in 2006.
4009494e 8985
b523dc20
BW
8986Development was then quiet for a couple of years. Emacs 23.1, which is
8987due out in 2009, will contain version 8.1. This version includes a few
3cf38f97
BW
8988new features and several bug fixes.
8989
8990Bill Wohler, August 2008
4009494e 8991
2ecba534
BW
8992@node GFDL, GPL, History, Top
8993@appendix GNU Free Documentation License
6a359279 8994@include doclicense.texi
4009494e 8995
2ecba534
BW
8996@node GPL, Key Index, GFDL, Top
8997@appendix GNU General Public License
8998@include gpl.texi
8999
9000@node Key Index, Command Index, GPL, Top
4009494e
GM
9001@unnumbered Key (Character) Index
9002@printindex ky
9003
9004@node Command Index, Option Index, Key Index, Top
9005@unnumbered Command Index
9006@printindex fn
9007
9008@node Option Index, Concept Index, Command Index, Top
9009@unnumbered Option (Variable) Index
9010@printindex vr
9011
9012@node Concept Index, , Option Index, Top
9013@unnumbered Concept Index
9014@printindex cp
9015
9016@bye
9017
9018@c Ispell Helpers
9019@c
9020@c The following are words that ispell should ignore that would not
9021@c normally be in a dictionary (global or personal). Be careful not to
9022@c include words here that could potentially be typos of other words
9023@c (such as url, elisp, or MHE).
9024@c
9025@c LocalWords: CTRL ESC SPC f's
9026@c LocalWords: addr Aliasfile alist
9027@c LocalWords: Baushke Bcc BBN Beranek bogofilter bogofilter's
9028@c LocalWords: cmd CMU contrib cron
9029@c LocalWords: DesBrisay Dcc devel dir dired docstring filll forw
9030@c LocalWords: GECOS Gildea Gildea's Ginnean GnuCash goto gnuserv htm
9031@c LocalWords: ImageMagick inbox ispell keychain
9032@c LocalWords: Larus licensor LocalWords lookup lpr
9033@c LocalWords: makeinfo mairix mbox mh mhbuild mhl mhpath mlisp
9034@c LocalWords: MML msg multipart
9035@c LocalWords: Namazu NIS nenscript nnml num
9036@c LocalWords: packmbox passphrase pathname prev procmail prog repl
9037@c LocalWords: slocal sortm SpamAssassin spammers SpamProbe SpamProbe's
9038@c LocalWords: sublicense supercite speedbar
9039@c LocalWords: Tennex texi texinfo Thelen thelenm
9040@c LocalWords: UCI undeleted whatnow wohler xmh ypcat
9041@c
9042@c See http://www.oreilly.com/oreilly/author/stylesheet.html.
9043@c See http://en.wikipedia.org/.
9044@c
9045@c Note the lowercase mh which is needed to avoid hits in the
9046@c functions and variables. Occasionally, check for accidental
9047@c inclusion of mh in text by uncommenting the following and executing
9048@c it with C-x C-e. You want to see "Search failed"
9049@c (let ((case-fold-search nil))
9050@c (goto-char (point-min))
9051@c (search-forward-regexp "^mh\\( \\|$\\)"))
9052@c
9053@c An extremely useful setting for texinfo-mode-hook is:
9054@c (add-to-list
9055@c 'ispell-skip-region-alist
9056@c (list
9057@c (concat "\\(@\\(small\\)?\\(example\\|lisp\\)"
9058@c "\\(@\\([irw]\\|code\\|var\\){[^}]+}\\|"
9059@c "@[@{}.]\\|"
9060@c "[^@]\\|"
9061@c "@\\(end \\)?group\\|"
9062@c "@\\(end \\)?cartouche\\)+"
9063@c "@end \\(small\\)?\\(example\\|lisp\\)\\|"
9064@c "@\\(code\\|command\\|file\\|kbd\\|sc\\){[^}]+}\\|"
9065@c "^@end [a-z]+$\\|"
9066@c "^@\\([fv]\\|print\\)index .*$\\|"
9067@c "@uref{[^,]+,\\|"
9068@c "@[a-z]+\\|"
9069@c "/[a-z.]+[/}]\\)")))))
9070@c
9071@c Cross References
9072@c
9073@c See existing cross-references to the Emacs manual and the Emacs
9074@c Lisp manual (search for ``GNU Emacs Manual'' and ``GNU
9075@c Emacs Lisp Reference Manual'' respectively).
9076
9077@c @ftable Sorting
9078@c
9079@c As per index (sort of): Punctuation, keyboard characters (such as
9080@c RET and BS) upper and lowercase mixed (lower comes before
9081@c uppercase), control characters go with uppercase C, meta characters
9082@c go with uppercase M.
9083@c In some cases, the sort isn't strictly ASCII.
9084@c For example, SPC (mh-page-msg) reads better before BS
9085@c (mh-previous-page) and . (mh-show) is better before ,
9086@c (mh-header-display).
9087
9088@c @vtable Sorting
9089@c
9090@c Alphabetical, pull hooks into their own table.
9091
9092@c Local Variables:
9093@c sentence-end-double-space: nil
9094@c End: