(Reading Mail)
[bpt/emacs.git] / doc / misc / mh-e.texi
CommitLineData
4009494e
GM
1\input texinfo @c -*-texinfo-*-
2@c
3@c Note: This document requires makeinfo version 4.6 or greater to build.
4@c
5@c %**start of header
db78a8cb 6@setfilename ../../info/mh-e
4009494e
GM
7@settitle The MH-E Manual
8@c %**end of header
9
10@c Version of the software and manual.
567b9191 11@set VERSION 8.0.3+CVS
4009494e
GM
12@c Edition of the manual. It is either empty for the first edition or
13@c has the form ", nth Edition" (without the quotes).
14@set EDITION
2940c053
BW
15@set UPDATED 2008-03-16
16@set UPDATE-MONTH March, 2008
4009494e
GM
17
18@c Other variables.
19@set MH-BOOK-HOME http://rand-mh.sourceforge.net/book/mh
20@set MH-E-HOME http://mh-e.sourceforge.net/
21
22@c Copyright
23@copying
24This is version @value{VERSION}@value{EDITION} of @cite{The MH-E
25Manual}, last updated @value{UPDATED}.
26
6a359279
GM
27Copyright @copyright{} 1995, 2001, 2002, 2003, 2005, 2006, 2007, 2008
28Free Software Foundation, Inc.
4009494e
GM
29
30@quotation
6a359279
GM
31Permission is granted to copy, distribute and/or modify this document
32under the terms of the GNU Free Documentation License, Version 1.2 or
33any later version published by the Free Software Foundation; with no
34Invariant Sections, with the Front-Cover texts being ``A GNU Manual,''
35and with the Back-Cover Texts as in (a) below. A copy of the license
36is included in the section entitled ``GNU Free Documentation License.''
37
38(a) The FSF's Back-Cover Text is: ``You have the freedom to copy and
39modify this GNU manual. Buying copies from the FSF supports it in
40developing GNU and promoting software freedom.''
4009494e
GM
41@end quotation
42@end copying
43
44@c Info Directory Entry
45@dircategory Emacs
46@direntry
47* MH-E: (mh-e). Emacs interface to the MH mail system.
48@end direntry
49
50@c Title Page
51@setchapternewpage odd
52@titlepage
53@title The MH-E Manual
54@subtitle Version @value{VERSION}@value{EDITION}
55@subtitle @value{UPDATE-MONTH}
56@author Bill Wohler
57
58@c Copyright Page
59@page
60@vskip 0pt plus 1filll
61@insertcopying
62@end titlepage
63
64@ifnottex
65@html
66<!--
67@end html
68@node Top, Preface, (dir), (dir)
69@top The MH-E Manual
70@html
71-->
72@end html
73@insertcopying
74@end ifnottex
75
76@c Table of Contents
77@contents
78
79@html
80<!--
81@end html
82
83@menu
84* Preface:: Preface
85* Conventions:: GNU Emacs Terms and Conventions
86* Getting Started:: Getting Started
87* Tour Through MH-E:: Tour Through MH-E
88* Using This Manual:: Using This Manual
89* Incorporating Mail:: Incorporating Mail
90* Reading Mail:: Reading Mail
91* Folders:: Organizing Your Mail with Folders
92* Sending Mail:: Sending Mail
93* Editing Drafts:: Editing a Draft
94* Aliases:: Aliases
95* Identities:: Identities
96* Speedbar:: The Speedbar
97* Menu Bar:: The Menu Bar
98* Tool Bar:: The Tool Bar
99* Searching:: Searching Through Messages
100* Threading:: Viewing Message Threads
101* Limits:: Limiting Display
102* Sequences:: Using Sequences
103* Junk:: Dealing With Junk Mail
104* Miscellaneous:: Miscellaneous Commands, Variables, and Buffers
105* Scan Line Formats:: Scan Line Formats
106* Procmail:: Reading Mailing Lists Effectively
107* Odds and Ends:: Odds and Ends
108* History:: History of MH-E
109* GFDL:: GNU Free Documentation License
4009494e
GM
110* Key Index:: Key (Character) Index
111* Command Index:: Command Index
112* Option Index:: Option (Variable) Index
113* Concept Index:: Concept Index
114
115@detailmenu
116 --- The Detailed Node Listing ---
117
118Tour Through MH-E
119
120* Sending Mail Tour::
121* Reading Mail Tour::
122* Processing Mail Tour::
123* Leaving MH-E::
124* More About MH-E::
125
126Using This Manual
127
128* Options::
129* Ranges::
130* Folder Selection::
131
132Reading Your Mail
133
134* Viewing::
135* Viewing Attachments::
136* HTML::
137* Digests::
138* Reading PGP::
139* Printing::
140* Files and Pipes::
141* Navigating::
142* Miscellaneous Commands and Options::
143
144Sending Mail
145
146* Composing::
147* Replying::
148* Forwarding::
149* Redistributing::
150* Editing Again::
151
152Editing a Draft
153
154* Editing Message::
155* Inserting Letter::
156* Inserting Messages::
157* Signature::
158* Picture::
159* Adding Attachments::
160* Sending PGP::
161* Checking Recipients::
162* Sending Message::
163* Killing Draft::
164
165Odds and Ends
166
167* Bug Reports::
168* Mailing Lists::
169* MH FAQ and Support::
170* Getting MH-E::
171
172History of MH-E
173
174* From Brian Reid::
175* From Jim Larus::
176* From Stephen Gildea::
177* From Bill Wohler::
178
179@end detailmenu
180@end menu
181
182@html
183-->
184@end html
185
186@node Preface, Conventions, Top, Top
187@unnumbered Preface
188
189@cindex Emacs
190@cindex Unix commands, Emacs
191@cindex preface
192
193This manual introduces another interface to the MH mail system that is
194accessible through the GNU Emacs editor, namely, @emph{MH-E}. MH-E is
195easy to use. I don't assume that you know GNU Emacs or even MH at this
196point, since I didn't know either of them when I discovered MH-E.
197However, MH-E was the tip of the iceberg, and I discovered more and
198more niceties about GNU Emacs and MH@. Now I'm fully hooked on both of
199them.
200
201The MH-E package is distributed with GNU Emacs@footnote{Version
202@value{VERSION} of MH-E will appear in GNU Emacs 22.1. It is supported
203in GNU Emacs 21, as well as XEmacs 21 (except for versions
20421.5.9-21.5.16). It is compatible with MH versions 6.8.4 and higher,
205all versions of nmh, and GNU mailutils 1.0 and higher.}, so you
30864d5f
BW
206shouldn't have to do anything special to use it. Gnus is also
207required; version 5.10 or higher is recommended. This manual covers
4009494e
GM
208MH-E version @value{VERSION}. To help you decide which version you
209have, see @ref{Getting Started}.
210
211@findex help-with-tutorial
212@kindex C-h t
213
214If you don't already use GNU Emacs but want to learn more, you can
215read an online tutorial by starting GNU Emacs and typing @kbd{C-h t}
216(@code{help-with-tutorial}). (To learn about this notation, see
217@ref{Conventions}.) If you want to take the plunge, consult the
218@iftex
219@cite{GNU Emacs Manual},
220@end iftex
221@ifinfo
222@ref{top, , GNU Emacs Manual, emacs, GNU Emacs Manual},
223@end ifinfo
224@ifhtml
225@uref{http://www.gnu.org/software/emacs/manual/html_node/,
226@cite{GNU Emacs Manual}},
227@end ifhtml
228from the Free Software Foundation.
229
230If more information is needed, you can go to the Unix manual pages of
231the individual MH commands. When the name is not obvious, I'll guide
232you to a relevant MH manual page that describes the action more fully.
233
234@cindex @cite{MH & nmh: Email for Users & Programmers}
235@cindex MH book
236@cindex info
237@kindex C-h i
238
239This manual is available in both Info and online formats. The Info
240version is distributed with Emacs and can be accessed with the
241@command{info} command (@samp{info mh-e}) or within Emacs (@kbd{C-h i
242m mh-e @key{RET}}). The online version is available at
243@uref{http://mh-e.sourceforge.net/manual/, SourceForge}. Another great
244online resource is the book @uref{http://www.ics.uci.edu/~mh/book/,
245@cite{MH & nmh: Email for Users & Programmers}} (also known as
246@dfn{the MH book}).
247
248I hope you enjoy this manual! If you have any comments, or suggestions
249for this document, please let me know.
250
251@cindex Bill Wohler
252@cindex Wohler, Bill
253
254@noindent
255Bill Wohler <@i{wohler at newt.com}>@*
2568 February 1995@*
25724 February 2006
258
259@node Conventions, Getting Started, Preface, Top
260@chapter GNU Emacs Terms and Conventions
261
262@cindex Emacs
263@cindex Emacs, conventions
264@cindex Emacs, terms
265@cindex Unix commands, Emacs
266@cindex conventions, Emacs
267@cindex terms, Emacs
268
269If you're an experienced Emacs user, you can skip the following
270conventions and definition of terms and go directly to the next
271section (@pxref{Getting Started}).
272
273@cindex Emacs commands
274@cindex MH commands
275@cindex Unix commands
276@cindex commands
277@cindex commands, MH
278@cindex commands, Unix
279@cindex commands, shell
280@cindex functions
281@cindex shell commands
282
283In general, @dfn{functions} in this text refer to Emacs Lisp functions
284that one would call from within Emacs Lisp programs (for example,
285@code{(mh-inc-folder)}). On the other hand, @dfn{commands} are those
286things that are run by the user, such as @kbd{i} or @kbd{M-x
287mh-inc-folder}. Programs outside of Emacs are specifically called MH
288commands, shell commands, or Unix commands.
289
290@cindex conventions, key names
291@cindex key names
292
293The conventions for key names are as follows:
294
295@table @kbd
296@item C-x
297Hold down the @key{CTRL} (Control) key and press the @kbd{x} key.
298@c -------------------------
299@item M-x
300Hold down the @key{META} or @key{ALT} key and press the @kbd{x} key.
301
302Since some keyboards don't have a @key{META} key, you can generate
303@kbd{M-x}, for example, by pressing @key{ESC} (Escape),
304@emph{releasing it}, and then pressing the @kbd{x} key.
305@c -------------------------
306@item @key{RET}
307Press the @key{RETURN} or @key{ENTER} key. This is normally used to
308complete a command.
309@c -------------------------
310@item @key{SPC}
311Press the space bar.
312@c -------------------------
313@item @key{TAB}
314Press the @key{TAB} key.
315@c -------------------------
316@item @key{DEL}
317Press the @key{DELETE} key.
318@c -------------------------
319@item @key{BS}
320Press the @key{BACKSPACE} key@footnote{If you are using Version 20 or
321earlier of Emacs, you will need to use the @key{DEL} key.}.
322@end table
323
324@cindex Emacs, prefix argument
325@cindex prefix argument
326@kindex C-u
327
328A @dfn{prefix argument} allows you to pass an argument to any Emacs
329function. To pass an argument, type @kbd{C-u} before the Emacs command
330or keystroke. Numeric arguments can be passed as well. For example, to
331insert five f's, use @kbd{C-u 5 f}. There is a default of four when
332using @kbd{C-u}, and you can use multiple prefix arguments to provide
333arguments of powers of four. To continue our example, you could insert
334four f's with @kbd{C-u f}, 16 f's with @kbd{C-u C-u f}, 64 f's with
335@kbd{C-u C-u C-u f}, and so on. Numeric and valueless negative
336arguments can also be inserted with the @key{META} key. Examples
337include @kbd{M-5} to specify an argument of 5, or @kbd{M--} which
338specifies a negative argument with no particular value.
339
340@sp 1
341@center @strong{NOTE}
342
343@quotation
344The prefix @kbd{C-u} or @kbd{M-} is not necessary in MH-E's MH-Folder
345mode (@pxref{Reading Mail Tour}). In this mode, simply enter the
346numerical argument before entering the command.
347@end quotation
348@sp 1
349
350@cindex @file{.emacs}
351@cindex Emacs, variables
352@cindex files, @file{.emacs}
353@cindex variables
354@findex setq
355
356Emacs uses @dfn{variables} to hold values. These can be changed via
357calls to the function @code{setq} in @file{~/.emacs}.
358
359@cindex Emacs, options
360@cindex options
361@findex customize-group
362@findex customize-option
363
364Variables in MH-E that are normally modified by the user are called
365@dfn{options} and are modified through the customize functions (such
366as @kbd{M-x customize-option} or @kbd{M-x customize-group}).
367@ifnothtml
368@xref{Easy Customization,,,emacs,The GNU Emacs Manual}, in @cite{The
369GNU Emacs Manual}.
370@end ifnothtml
371@ifhtml
372See section
373@uref{http://www.gnu.org/software/emacs/manual/html_node/Easy-Customization.html,
374Easy Customization} in @cite{The GNU Emacs Manual}.
375@end ifhtml
376@xref{Options}.
377
378@cindex Emacs, faces
379@cindex faces
380@cindex highlighting
381@findex customize-face
382
383You can specify various styles for displaying text using @dfn{faces}.
384MH-E provides a set of faces that you can use to personalize the look
385of your MH-E buffers. Use the command @kbd{M-x customize-face} to do
386this.
387@ifnothtml
388@xref{Face Customization,,,emacs,The GNU Emacs Manual}, in @cite{The
389GNU Emacs Manual}.
390@end ifnothtml
391@ifhtml
392See section
393@uref{http://www.gnu.org/software/emacs/manual/html_node/Face-Customization.html,
394Face Customization} in @cite{The GNU Emacs Manual}.
395@end ifhtml
396
397@cindex abnormal hooks
398@cindex hooks
399@cindex normal hooks
400@findex add-hook
401@findex customize-option
402
403Commands often offer @dfn{hooks} which enable you to extend or modify
404the way a command works.
405@ifnothtml
406@ref{Hooks, , Hooks, emacs, The GNU Emacs Manual}, in @cite{The GNU
407Emacs Manual}
408@end ifnothtml
409@ifhtml
410See section
411@uref{http://www.gnu.org/software/emacs/manual/html_node/Hooks.html,
412Hooks} in @cite{The GNU Emacs Manual}
413@end ifhtml
414for a description about @dfn{normal hooks} and @dfn{abnormal hooks}.
415MH-E uses normal hooks in nearly all cases, so you can assume that we
416are talking about normal hooks unless we explicitly mention that a
417hook is abnormal. We also follow the conventions described in that
418section: the name of the abnormal hooks end in @code{-hooks} and all
419the rest of the MH-E hooks end in @code{-hook}. You can add hooks with
420either @code{customize-option} or @code{add-hook}.
421
422@cindex Emacs, mark
423@cindex Emacs, point
424@cindex Emacs, region
425@cindex mark
426@cindex point
427@cindex region
428@kindex C-@@
429@kindex C-@key{SPC}
430
431There are several other terms that are used in Emacs that you should
432know. The @dfn{point} is where the cursor currently is. You can save
433your current place in the file by setting a @dfn{mark}. This operation
434is useful in several ways. The mark can be later used when defining a
435@dfn{region}, which is the text between the point and mark. Many
436commands operate on regions, such as those for deleting text or
437filling paragraphs. A mark can be set with @kbd{C-@@} (or
438@kbd{C-@key{SPC}}).
439
440@cindex completion
441@cindex Emacs, completion
442@cindex Emacs, file completion
443@cindex Emacs, folder completion
444@cindex Emacs, minibuffer
445@cindex file completion
446@cindex folder completion
447@cindex minibuffer
448@kindex SPC
449@kindex TAB
450
451The @dfn{minibuffer} is the bottom line of the Emacs window, where all
452prompting and multiple-character input is directed. You can use
453@dfn{completion} to enter values such as folders. Completion means
454that Emacs fills in text for you when you type @key{SPC} or @key{TAB}.
455A second @key{SPC} or @key{TAB} will list all possibilities at that
456point.
457@ifnothtml
458@xref{Completion, , Completion, emacs, The GNU Emacs Manual}.
459@end ifnothtml
460@ifhtml
461See the section
462@uref{http://www.gnu.org/software/emacs/manual/html_node/Completion.html,
463Completion} in @cite{The GNU Emacs Manual}.
464@end ifhtml
465Note that @key{SPC} cannot be used for completing filenames and
466folders.
467
468@findex help-with-tutorial
469@kindex C-h t
470@kindex M-x
471
472The minibuffer is also where you enter Emacs function names after
473typing @kbd{M-x}. For example, in the preface, I mentioned that you
474could obtain help with @kbd{C-h t} (@code{help-with-tutorial}). What
475this means is that you can get a tutorial by typing either @kbd{C-h t}
476or @kbd{M-x help-with-tutorial}. In the latter case, you are prompted
477for @samp{help-with-tutorial} in the minibuffer after typing
478@kbd{M-x}.
479
480@cindex ~
481
482The @samp{~} notation in filenames represents your home directory.
483This notation is used by many shells including @command{bash},
484@code{tcsh}, and @command{csh}. It is analogous to the environment
485variable @samp{$HOME}. For example, @file{~/.emacs} can be written
486@file{$HOME/.emacs} or using the absolute path as in
487@file{/home/wohler/.emacs} instead.
488
489@cindex Emacs, interrupting
490@cindex Emacs, quitting
491@cindex interrupting
492@cindex quitting
493
494@i{In case of trouble:} Emacs can be interrupted at any time with
495@kbd{C-g}. For example, if you've started a command that requests that
496you enter something in the minibuffer, but then you change your mind,
497type @kbd{C-g} and you'll be back where you started. If you want to
498exit Emacs entirely, use @kbd{C-x C-c}.
499
500@node Getting Started, Tour Through MH-E, Conventions, Top
501@chapter Getting Started
502
503@cindex MH-E, versions
504@cindex history
505@cindex versions of MH-E
506
507Because there are many old versions of MH-E out there, it is important
508to know which version you have. I'll be talking about @w{Version 8}
509which is pretty close to @w{Version 6} and @w{Version 7}. It differs
510from @w{Version 4} and @w{Version 5} and is vastly different from
511@w{Version 3}. @xref{History}.
512
513@findex mh-version
514
515To determine which version of MH-E that you have, enter @kbd{M-x
516mh-version @key{RET}}. Hopefully it says that you're running
517@w{Version @value{VERSION}} which is the latest version as of this
518printing.
519
520If your version is much older than this, please consider upgrading.
521You can have your system administrator upgrade the system-wide
522version, or you can install your own personal version. It's really
523quite easy. @xref{Getting MH-E}, for instructions for getting and
524installing MH-E.
525
526If the @code{mh-version} command displays @samp{No MH variant
527detected}@footnote{In very old versions of MH-E, you may get the error
528message, @samp{Cannot find the commands `inc' and `mhl' and the file
529`components'} if MH-E can't find MH. In this case, you need to update
530MH-E, and you may need to install MH too. However, newer versions of
531MH-E are better at finding MH if it is on your system.}, then you need
532to install MH or tell MH-E where to find MH.
533
534@cindex Debian
535@cindex nmh
536@cindex GNU mailutils
537
538If you don't have MH on your system already, you must install a
539variant of MH. The Debian mh-e package does this for you automatically
540(@pxref{Getting MH-E}). Most people use
541@uref{http://www.nongnu.org/nmh/, nmh}, but you may be interested in
542trying out @uref{http://www.gnu.org/software/mailutils/, GNU
543mailutils}, which supports IMAP. Your GNU/Linux distribution probably
544has packages for both of these.
545
546@cindex @command{install-mh}
547@cindex MH commands, @command{install-mh}
548@cindex MH book
549
550If you've never run MH before, you need to run @command{install-mh}
551from the shell before you continue. This sets up your personal MH
552environment@footnote{See the section
553@uref{@value{MH-BOOK-HOME}/../overall/setup.html, Setting Up MH} in the
554MH book.}. If you don't, you'll be greeted with the error message:
555@samp{Install MH and run install-mh before running MH-E}. This is all
556you need to know about MH to use MH-E, but the more you know about MH,
557the more you can leverage its power. See the
558@uref{@value{MH-BOOK-HOME}/../, MH book} to learn more about MH.
559
560@cindex @samp{Path:} MH profile component
561@cindex MH profile
562@cindex MH profile component
563@cindex MH profile component, @samp{Path:}
564
565Your MH environment includes your @dfn{MH profile} which is found in
566the file @file{~/.mh_profile}. This file contains a number of @dfn{MH
567profile components}. For example, the @samp{Path:} MH profile
568component contains the path to your mail directory, which is
569@file{~/Mail} by default.
570
571@cindex @command{mhparam}
572@cindex MH commands, @command{mhparam}
573@vindex exec-path
574@vindex mh-path
575@vindex mh-sys-path
576@vindex mh-variant
577@vindex mh-variant-in-use
578
579There are several options MH-E uses to interact with your MH
580installation. The option @code{mh-variant} specifies the variant used
581by MH-E (@pxref{Options}). The default setting of this option is
582@samp{Auto-detect} which means that MH-E will automatically choose the
583first of nmh, MH, or GNU mailutils that it finds in the directories
584listed in @code{mh-path} (which you can customize),
585@code{mh-sys-path}, and @code{exec-path}. If MH-E can't find MH at
586all, you may have to customize @code{mh-path} and add the directory in
587which the command @command{mhparam} is located. If, on the other hand,
588you have both nmh and mailutils installed (for example) and
589@code{mh-variant-in-use} was initialized to nmh but you want to use
590mailutils, then you can set @code{mh-variant} to @samp{mailutils}.
591
592@vindex mh-flists-present-flag
593@vindex mh-lib
594@vindex mh-lib-progs
595@vindex mh-progs
596
597When @code{mh-variant} is changed, MH-E resets @code{mh-progs},
598@code{mh-lib}, @code{mh-lib-progs}, @code{mh-flists-present-flag}, and
599@code{mh-variant-in-use} accordingly.
600
601@cindex @file{.emacs}
602@cindex files, @file{.emacs}
603
604@sp 1
605@center @strong{NOTE}
606
607@quotation
608Prior to version 8, it was often necessary to set some of these
609variables in @file{~/.emacs}; now it is no longer necessary and can
610actually cause problems.
611@end quotation
612@sp 1
613
614@cindex MH profile component, @samp{Draft-Folder:}
615@cindex MH profile component, @samp{Path:}
616@cindex MH profile component, @samp{Previous-Sequence:}
617@cindex MH profile component, @samp{Unseen-Sequence:}
618@cindex @samp{Draft-Folder:} MH profile component
619@cindex @samp{Path:} MH profile component
620@cindex @samp{Previous-Sequence:} MH profile component
621@cindex @samp{Unseen-Sequence:} MH profile component
622@findex mh-find-path
623@vindex mh-draft-folder
624@vindex mh-find-path-hook
625@vindex mh-inbox
626@vindex mh-previous-seq
627@vindex mh-unseen-seq
628@vindex mh-user-path
629
630In addition to setting variables that point to MH itself, MH-E also
631sets a handful of variables that point to where you keep your mail.
632During initialization, the function @code{mh-find-path} sets
633@code{mh-user-path} from your @samp{Path:} MH profile component (but
634defaults to @samp{Mail} if one isn't present), @code{mh-draft-folder}
635from @samp{Draft-Folder:}, @code{mh-unseen-seq} from
636@samp{Unseen-Sequence:}, @code{mh-previous-seq} from
637@samp{Previous-Sequence:}, and @code{mh-inbox} from @samp{Inbox:}
638(defaults to @samp{+inbox}). The hook @code{mh-find-path-hook} is run
639after these variables have been set. This hook can be used the change
640the value of these variables if you need to run with different values
641between MH and MH-E.
642
643@node Tour Through MH-E, Using This Manual, Getting Started, Top
644@chapter Tour Through MH-E
645
646@cindex introduction
647@cindex tour
648@cindex tutorial
649
650This chapter introduces some of the terms you'll need to know and then
651takes you on a tour of MH-E@footnote{The keys mentioned in these
652chapters refer to the default key bindings. If you've changed the
653bindings, refer to the command summaries at the beginning of each
654chapter for a mapping between default key bindings and function
655names.}. When you're done, you'll be able to send, read, and file
656mail, which is all that a lot of people ever do. But if you're the
657curious or adventurous type, read the rest of the manual to be able to
658use all the features of MH-E. I suggest you read this chapter first to
659get the big picture, and then you can read the manual as you wish.
660
661@menu
662* Sending Mail Tour::
663* Reading Mail Tour::
664* Processing Mail Tour::
665* Leaving MH-E::
666* More About MH-E::
667@end menu
668
669@node Sending Mail Tour, Reading Mail Tour, Tour Through MH-E, Tour Through MH-E
670@section Sending Mail
671
672@cindex MH-Letter mode
673@cindex mode
674@cindex modes, MH-Letter
675@cindex sending mail
676@findex mh-smail
677@kindex M-x mh-smail
678
679Let's start our tour by sending ourselves a message which we can later
680read and process. Enter @kbd{M-x mh-smail} to invoke the MH-E program
681to send messages. Your message appears in an Emacs buffer whose
682mode@footnote{A @dfn{mode} changes Emacs to make it easier to edit a
683particular type of text.} is MH-Letter.
684
685Enter your login name in the @samp{To:} header field. Press the
686@key{TAB} twice to move the cursor past the @samp{Cc:} field, since no
687carbon copies are to be sent, and on to the @samp{Subject:} field.
688Enter @kbd{Test} or anything else that comes to mind.
689
690Press @key{TAB} again to move the cursor to the body of the message.
691Enter some text, using normal Emacs commands. You should now have
692something like this@footnote{If you're running Emacs under the X
693Window System, then you would also see a menu bar and a tool bar. I've
694left out the menu bar and tool bar in all of the example screens.}:
695
696@cartouche
697@smallexample
698
699
700
701
702
703
704--:-- *scratch* All L1 (Lisp Interaction)-------------------------
705To: wohler
706cc:
707Subject: Test
708X-Mailer: MH-E 8.0; nmh 1.1; GNU Emacs 22.1
709--------
710This is a test message to get the wheels churning...#
711
712
713--:** @{draft@} All L5 (MH-Letter)----------------------------------
714Type C-c C-c to send message, C-C ? for help
715@end smallexample
716@end cartouche
717@i{MH-E message composition window}
718
719Note the line of dashes that separates the header and the body of the
720message. It is essential that these dashes (or a blank line) are
721present or the body of your message will be considered to be part of
722the header.
723
724@cindex help
725@findex describe-mode
726@kindex C-c ?
727@kindex C-c C-c
728@kindex C-h m
729
730There are several commands specific to MH-Letter mode@footnote{You can
731get quick help for the commands used most often with @kbd{C-c ?} or
732more complete help with the @kbd{C-h m} (@code{describe-mode})
733command.}, but at this time we'll only use @kbd{C-c C-c} to send your
734message. Type @kbd{C-c C-c} now. That's all there is to it!
735
736@node Reading Mail Tour, Processing Mail Tour, Sending Mail Tour, Tour Through MH-E
737@section Receiving Mail
738
739@cindex @command{inc}
740@cindex @command{scan}
741@cindex MH commands, @command{inc}
742@cindex MH commands, @command{scan}
743@cindex MH-Folder mode
744@cindex modes, MH-Folder
745@cindex reading mail
746@findex mh-rmail
747@kindex M-x mh-rmail
748
749To read the mail you've just sent yourself, enter @kbd{M-x mh-rmail}.
750This incorporates the new mail and puts the output from
751@command{inc}@footnote{See the section
752@uref{@value{MH-BOOK-HOME}/reapre.html, Reading Mail: inc show next
753prev} in the MH book.} (called @dfn{scan lines} after the MH program
754@command{scan}@footnote{See the section
755@uref{@value{MH-BOOK-HOME}/faswsprs.html, Find and Specify with scan
756pick Ranges Sequences} in the MH book.} which prints a one-line
757summary of each message) into a buffer called @samp{+inbox} whose
758major mode is MH-Folder.
759
760@findex mh-rmail
761@kindex F r
762@kindex M-x mh-rmail
763
764@sp 1
765@center @strong{NOTE}
766
767@quotation
768
769The @kbd{M-x mh-rmail} command will show you only new mail, not mail
770you have already read. If you were to run this tour again, you would
771use @kbd{F r} to pull all your messages into MH-E.
772@end quotation
773@sp 1
774
775@kindex @key{RET}
776@kindex n
777@kindex p
778
779You should see the scan line for your message, and perhaps others. Use
780@kbd{n} or @kbd{p} to move the cursor to your test message and type
781@key{RET} to read your message. You should see something like:
782
783@cartouche
784@smallexample
785 3 t08/24 root received fax files on Wed Aug 24 11:00:13 PDT 1
786# 4+t08/24 To:wohler Test<<This is a test message to get the wheels
787
788-:%% @{+inbox/select@} 4 msgs (1-4) Bot L4 (MH-Folder Show)---------
789To: wohler
790Subject: Test
791X-Mailer: MH-E 8.0; nmh 1.1; GNU Emacs 22.1
792Date: Fri, 17 Mar 2006 10:49:11 -0800
793From: Bill Wohler <wohler@@stop.mail-abuse.org>
794
795This is a test message to get the wheels churning...
796
797
798
799--:-- @{show-+inbox@} 4 All L1 (MH-Show)----------------------------
800
801@end smallexample
802@end cartouche
803@i{After incorporating new messages}
804
805@kindex @key{DEL}
806@kindex @key{SPC}
807
808If you typed a long message, you can view subsequent pages with
809@key{SPC} and previous pages with @key{DEL}.
810
811@node Processing Mail Tour, Leaving MH-E, Reading Mail Tour, Tour Through MH-E
812@section Processing Mail
813
814@cindex processing mail
815@kindex @key{RET}
816@kindex r
817
818The first thing we want to do is reply to the message that we sent
819ourselves. Ensure that the cursor is still on the same line as your
820test message and type @kbd{r}. You are prompted in the minibuffer with
821@samp{Reply to whom:}. Here MH-E is asking whether you'd like to reply
822to the original sender only, to the sender and primary recipients, or
823to the sender and all recipients. You can press @key{TAB} to see these
824choices. If you simply press @key{RET}, you'll reply only to the
825sender. Press @key{RET} now.
826
827You'll find yourself in an Emacs buffer similar to that when you were
828sending the original message, like this:
829
830@cartouche
831@smallexample
832To:
833cc:
834Subject: Re: Test
835In-reply-to: <31054.1142621351@@stop.mail-abuse.org>
836References: <31054.1142621351@@stop.mail-abuse.org>
837Comments: In-reply-to Bill Wohler <wohler@@stop.mail-abuse.org>
838 message dated "Fri, 17 Mar 2006 10:49:11 -0800."
839X-Mailer: MH-E 8.0; nmh 1.1; GNU Emacs 22.1
840--------
841#
842
843--:-- @{draft@} All L10 (MH-Letter)----------------------------------
844To: wohler
845Subject: Test
846X-Mailer: MH-E 8.0; nmh 1.1; GNU Emacs 22.1
847Date: Fri, 17 Mar 2006 10:49:11 -0800
848From: Bill Wohler <wohler@@stop.mail-abuse.org>
849
850This is a test message to get the wheels churning...
851
852--:-- @{show-+inbox@} 4 All L1 (MH-Show)----------------------------
853Type C-c C-c to send message, C-c ? for help
854@end smallexample
855@end cartouche
856@i{Composition window during reply}
857
858@findex backward-char
859@findex forward-char
860@findex next-line
861@findex previous-line
862@kindex C-b
863@kindex C-c C-c
864@kindex C-c C-f C-t
865@kindex C-f
866@kindex C-n
867@kindex C-p
868@kindex @key{BS}
869
870By default, MH will not add you to the address list of your replies,
871so if you find that the @samp{To:} header field is missing, don't
872worry. In this case, type @kbd{C-c C-f C-t} to create and go to the
873@samp{To:} field, where you can type your login name again. You can
874move around with the arrow keys or with @kbd{C-p}
875(@code{previous-line}), @kbd{C-n} (@code{next-line}), @kbd{C-b}
876(@code{backward-char}), and @kbd{C-f} (@code{forward-char}) and can
877delete the previous character with @key{BS}. When you're finished
878editing your message, send it with @kbd{C-c C-c} as before.
879
880@cindex @command{refile}
881@cindex MH commands, @command{refile}
882@cindex folders
883@kindex @key{SPC}
884@kindex o
885
886You'll often want to save messages that were sent to you in an
887organized fashion. This is done with @dfn{folders}. You can use
888folders to keep messages from your friends, or messages related to a
889particular topic. With your cursor in the MH-Folder buffer and
890positioned on the message you sent to yourself, type @kbd{o} to output
891(@command{refile} in MH parlance) that message to a folder. Enter
892@kbd{test} at the @samp{Destination folder:} prompt and type @kbd{y}
893(or @key{SPC}) when MH-E asks to create the folder @samp{+test}. Note
894that a @samp{^} (caret) appears next to the message number, which
895means that the message has been marked for refiling but has not yet
896been refiled. We'll talk about how the refile is actually carried out
897in a moment.
898
899@cindex MH-Folder mode
900@cindex modes, MH-Folder
901@kindex d
902@kindex i
903@kindex @key{RET}
904@kindex n
905@kindex p
906@kindex x
907
908Your previous reply is now waiting in the system mailbox. You
909incorporate this mail into your MH-Folder buffer named @samp{+inbox}
910with the @kbd{i} command. Do this now. After the mail is incorporated,
911use @kbd{n} or @kbd{p} to move the cursor to the new message, and read
912it with @key{RET}. Let's delete this message by typing @kbd{d}. Note
913that a @samp{D} appears next to the message number. This means that
914the message is marked for deletion but is not yet deleted. To perform
915the deletion (and the refile we did previously), use the @kbd{x}
916command.
917
918@findex mh-smail
919@kindex m
920@kindex M-x mh-smail
921
922If you want to send another message you can use @kbd{m} instead of
923@kbd{M-x mh-smail}. So go ahead, send some mail to your friends!
924
925@cindex help
926@cindex prefix characters
927@findex describe-mode
928@kindex ?
929@kindex C-h m
930@kindex F ?
931
932You can get a quick reminder about these commands by typing @kbd{?}.
933This lists several @dfn{prefix characters}. To list the commands
934available via the prefix characters, type the prefix character
935followed by a @kbd{?}, for example, @kbd{F ?}. More complete help is
936available with the @kbd{C-h m} (@code{describe-mode}) command.
937
938@node Leaving MH-E, More About MH-E, Processing Mail Tour, Tour Through MH-E
939@section Leaving MH-E
940
941@cindex Emacs, quitting
942@cindex quitting
943@kindex C-x C-c
944@kindex x
945
946You may now wish to exit @command{emacs} entirely. Use @kbd{C-x C-c}
947to exit @command{emacs}. If you exited without running @kbd{x} in the
948@samp{+inbox} buffer, Emacs will offer to save it for you. Type
949@kbd{y} or @key{SPC} to save @samp{+inbox} changes, which means to
950perform any refiles and deletes that you did there.
951
952@findex mh-rmail
953@kindex C-x b
954@kindex C-x k
955@kindex M-x mh-rmail
956@kindex q
957
958If you don't want to leave Emacs, you can type @kbd{q} to bury (hide)
959the MH-E folder or delete it entirely with @kbd{C-x k}. You can then
960later recall it with @kbd{C-x b} or @kbd{M-x mh-rmail}.
961
962@cindex @command{packf}
963@cindex MH commands, @command{packf}
964@cindex exporting folders
965@cindex folders, exporting
966@cindex mbox-style folder
967
968On the other hand, if you no longer want to use MH and MH-E, you can
969take your mail with you. You can copy all of your mail into a single
970file, mbox-style, by using the MH command @command{packf}. For
971example, to create a file called @file{msgbox} with the messages in
972your @samp{+inbox} folder, use @samp{packf +inbox}. The
973@command{packf} command will append the messages to the file if it
974already exists, so you can use @samp{folders -recurse -fast} in a
975script to copy all of your messages into a single file, or using the
976@samp{-file} argument, a file for each folder.
977
978@node More About MH-E, , Leaving MH-E, Tour Through MH-E
979@section More About MH-E
980
981These are the basic commands to get you going, but there are plenty
982more. If you think that MH-E is for you, read the rest of the manual
983to find out how you can:
984
985@itemize @bullet
986@item
987Print your messages (@pxref{Printing}).
988@c -------------------------
989@item
990Edit messages and include your signature (@pxref{Editing Drafts}).
991@c -------------------------
992@item
993Forward messages (@pxref{Forwarding}).
994@c -------------------------
995@item
996Read digests (@pxref{Digests}).
997@c -------------------------
998@item
999Edit bounced messages (@pxref{Editing Again}).
1000@c -------------------------
1001@item
1002Send multimedia messages (@pxref{Adding Attachments}).
1003@c -------------------------
1004@item
1005Read HTML messages (@pxref{HTML}).
1006@c -------------------------
1007@item
1008Use aliases and identities (see @ref{Aliases}, @pxref{Identities}).
1009@c -------------------------
1010@item
1011Create different views of your mail (see @ref{Threading}, @pxref{Limits}).
1012@c -------------------------
1013@item
1014Deal with junk mail (@pxref{Junk}).
1015@c -------------------------
1016@item
1017Handle signed and encrypted messages (see @ref{Reading PGP},
1018@pxref{Sending PGP}).
1019@c -------------------------
1020@item
1021Process mail that was sent with @command{shar} or @command{uuencode}
1022(@pxref{Files and Pipes}).
1023@c -------------------------
1024@item
1025Use sequences conveniently (@pxref{Sequences}).
1026@c -------------------------
1027@item
1028Use the speedbar, tool bar, and menu bar (see @ref{Speedbar}, see @ref{Tool
1029Bar}, @pxref{Menu Bar}).
1030@c -------------------------
1031@item
1032Show header fields in different fonts (@pxref{Reading Mail}).
1033@c -------------------------
1034@item
1035Find previously refiled messages (@pxref{Searching}).
1036@c -------------------------
1037@item
1038Place messages in a file (@pxref{Files and Pipes}).
1039@end itemize
1040
1041Remember that you can also use MH commands when you're not running
1042MH-E (and when you are!).
1043
1044@node Using This Manual, Incorporating Mail, Tour Through MH-E, Top
1045@chapter Using This Manual
1046
1047This chapter begins the meat of the manual which goes into more detail
1048about every MH-E command and option.
1049
1050@cindex Emacs, info
1051@cindex Emacs, online help
1052@cindex info
1053@cindex online help
1054@findex describe-mode
1055@findex mh-help
1056@kindex ?
1057@kindex C-c ?
1058@kindex C-h C-h
1059@kindex C-h C-k i
1060@kindex C-h i
1061@kindex C-h m
1062
1063There are many commands, but don't get intimidated. There are command
1064summaries at the beginning of each chapter. In case you have or would
1065like to rebind the keys, the command summaries also list the
1066associated Emacs Lisp function. Furthermore, even if you're stranded
1067on a desert island with a laptop and are without your manuals, you can
1068get a summary of all these commands with GNU Emacs online help: use
1069@kbd{C-h m} (@code{describe-mode}) for a brief summary of commands,
1070@kbd{?} (@code{mh-help}) for an even briefer summary@footnote{This
1071help appears in a buffer called @samp{*MH-E Help*}
1072(@pxref{Miscellaneous}).} (@kbd{C-c ?} in MH-Letter mode), or @kbd{C-h
1073i} to read this manual via Info. The online help is quite good; try
1074running @kbd{C-h C-h}. This brings up a list of available help topics,
1075one of which displays the documentation for a given key (like @kbd{C-h
1076k C-n}). Another useful help feature is to view the manual section
1077that describes a given key (such as @kbd{C-h K i}). In addition,
1078review @ref{Conventions}, if any of the GNU Emacs conventions are
1079strange to you.
1080
1081In addition to all of the commands, it is also possible to reconfigure
1082MH-E to fit the needs of even the most demanding user. The following
1083chapters also describe all of the options, show the defaults, and make
1084recommendations for customization.
1085
1086However, when customizing your mail environment, first try to change
1087what you want in MH, and only change MH-E if changing MH is not
1088possible. That way you will get the same behavior inside and outside
1089GNU Emacs. Note that MH-E does not provide hooks for customizations
1090that can be done in MH; this omission is intentional.
1091
1092@cindex Emacs Lisp Manual
1093@cindex Emacs, Emacs Lisp Manual
1094@cindex Emacs, info
1095@cindex Emacs, online help
1096@cindex info
1097@cindex online help
1098
1099I hope I've included enough examples here to get you well on your way.
1100If you want to explore Emacs Lisp further, a programming manual does
1101exist,
1102@c Yes, some of the stuff in the following sections is redundant, but
1103@c TeX barfs if the @ifs are inside the @footnote.
1104@iftex
1105@footnote{The @cite{GNU Emacs Lisp Reference Manual} may be available
1106online in the Info system by typing @kbd{C-h i m Emacs Lisp
1107@key{RET}}. It is also available online at @*
1108@uref{http://www.gnu.org/software/emacs/elisp-manual/html_node/}. You
1109can also order a printed manual, which has the desirable side-effect
1110of helping to support the Free Software Foundation which made all this
1111great software available. You can find an order form by running
1112@kbd{C-h C-d}, or you can request an order form from @i{gnu at
1113gnu.org}.}
1114@end iftex
1115@ifinfo
1116@footnote{@xref{Top, The GNU Emacs Lisp Reference Manual, , elisp, GNU
1117Emacs Lisp Reference Manual}, which may be available online in the
1118Info system. It is also available online at
1119@uref{http://www.gnu.org/software/emacs/elisp-manual/html_node/}. You
1120can also order a printed manual, which has the desirable side-effect
1121of helping to support the Free Software Foundation which made all this
1122great software available. You can find an order form by running
1123@kbd{C-h C-d}, or you can request an order form from @i{gnu at
1124gnu.org}.}
1125@end ifinfo
1126@ifhtml
1127@footnote{The
1128@uref{http://www.gnu.org/software/emacs/elisp-manual/html_node/,
1129The GNU Emacs Lisp Reference Manual} may also be available online in
1130the Info system by typing @kbd{C-h i m Emacs Lisp @key{RET}}. You can
1131also order a printed manual, which has the desirable side-effect of
1132helping to support the Free Software Foundation which made all this
1133great software available. You can find an order form by running
1134@kbd{C-h C-d}, or you can request an order form from @i{gnu at
1135gnu.org}.}
1136@end ifhtml
1137and you can look at the code itself for examples. Look in the Emacs
1138Lisp directory on your system (such as
1139@file{/usr/local/lib/emacs/lisp/mh-e}) and find all the @file{mh-*.el}
1140files there. When calling MH-E and other Emacs Lisp functions directly
1141from Emacs Lisp code, you'll need to know the correct arguments. Use
1142the online help for this. For example, try @kbd{C-h f
1143mh-execute-commands @key{RET}}. If you write your own functions,
1144please do not prefix your symbols (variables and functions) with
1145@samp{mh-}. This prefix is reserved for the MH-E package. To avoid
1146conflicts with existing MH-E symbols, use a prefix like @samp{my-} or
1147your initials. (Unless, of course, your initials happen to be @emph{mh}!)
1148
1149@menu
1150* Options::
1151* Ranges::
1152* Folder Selection::
1153@end menu
1154
1155@node Options, Ranges, Using This Manual, Using This Manual
1156@section Options
1157
1158@cindex Emacs, customizing
1159@cindex Emacs, setting options
1160@cindex customizing MH-E
1161@cindex setting options
1162@findex customize-option
1163@vindex mh-lpr-command-format, example
1164
1165Many string or integer options are easy to modify using @kbd{M-x
1166customize-option}. For example, to modify the option that controls
1167printing, you would run @kbd{M-x customize-option @key{RET}
1168mh-lpr-command-format @key{RET}}. In the buffer that appears, modify
1169the string to the right of the variable. For example, you may change
1170the @command{lpr} command with @samp{nenscript -G -r -2 -i'%s'}. Then
1171use the @samp{State} combo box and select @samp{Save for Future
1172Sessions}. To read more about @code{mh-lpr-command-format}, see
1173@ref{Printing}.
1174
1175@cindex nil
1176@cindex off, option
1177@cindex on, option
1178@cindex option, turning on and off
1179@cindex t
1180@findex customize-option
1181@vindex mh-bury-show-buffer-flag, example
1182
1183Options can also hold boolean values. In Emacs Lisp, the boolean
1184values are @code{nil}, which means false, and @code{t}, which means
1185true. The @code{customize-option} function makes it easy to change
1186boolean values; simply click on the toggle button in the customize
1187buffer to switch between @samp{on} (@code{t}) and @samp{off}
1188(@code{nil}). For example, try setting @code{mh-bury-show-buffer-flag}
1189to @samp{off} to keep the MH-Show buffer at the top of the buffer
1190stack. Use the @samp{State} combo box and choose @samp{Set for Current
1191Session} to see how the option affects the show buffer. Then choose
1192the @samp{Erase Customization} menu item to reset the option to the
1193default, which places the MH-Show buffer at the bottom of the buffer
1194stack.
1195
1196@vindex mh-mhl-format-file, example
1197
1198The text usually says to turn on an option by setting it to a
1199@emph{non-@code{nil}} value, because sometimes values other than
1200@samp{on} are meaningful. An example of this is the variable
1201@code{mh-mhl-format-file} (@pxref{Viewing}). Other options, such as
1202hooks, involve a little more Emacs Lisp programming expertise.
1203
1204@cindex customization group, @samp{mh}
1205@cindex @samp{mh} customization group
1206@findex customize-group
1207@findex mh-customize
1208
1209You can browse all of the MH-E options with the @code{customize-group}
1210function. Try entering @kbd{M-x customize-group @key{RET} mh
1211@key{RET}} to view the top-level options as well as buttons for all of
1212the MH-E customization groups. Another way to view the MH-E
1213customization group is to use @kbd{M-x mh-customize @key{RET}}.
1214
1215@node Ranges, Folder Selection, Options, Using This Manual
1216@section Ranges
1217
1218@c Sync with mh-folder-mode docstring.
1219
1220@cindex message abbreviations
1221@cindex message ranges
1222@cindex ranges
1223
1224Many commands that operate on individual messages, such as
1225@code{mh-forward} or @code{mh-refile-msg} take a @code{RANGE}
1226argument. This argument can be used in several ways.
1227
1228@kindex C-u, with ranges
1229
1230If you provide the prefix argument @kbd{C-u} to these commands, then
1231you will be prompted for the message range. This can be any valid MH
1232range which can include messages, sequences (@pxref{Sequences}), and
1233the abbreviations (described in the @command{mh}(1) man page):
1234
1235@table @samp
1236@item <num1>-<num2>
1237Indicates all messages in the range <num1> to <num2>, inclusive. The
1238range must be nonempty.
1239@c -------------------------
1240@item <num>:N
1241@itemx <num>:+N
1242@itemx <num>:-N
1243Up to N messages beginning with (or ending with) message num. Num may
1244be any of the predefined symbols: first, prev, cur, next or last.
1245@c -------------------------
1246@item first:N
1247@itemx prev:N
1248@itemx next:N
1249@itemx last:N
1250The first, previous, next or last messages, if they exist.
1251@c -------------------------
1252@item all
1253All of the messages.
1254@end table
1255
1256For example, a range that shows all of these things is @samp{1 2 3
12575-10 last:5 unseen}.
1258
1259@vindex transient-mark-mode
1260
1261If the option @code{transient-mark-mode} is turned on and you set a
1262region in the MH-Folder buffer, then the MH-E command will perform the
1263operation on all messages in that region.
1264
1265@cindex @samp{mh-range} customization group
1266@cindex customization group, @samp{mh-range}
1267
1268The @samp{mh-range} customization group contains a single option which
1269affects how ranges are interpreted.
1270
1271@vtable @code
1272@item mh-interpret-number-as-range-flag
1273On means interpret a number as a range (default: @samp{on}).
1274@end vtable
1275
1276@vindex mh-interpret-number-as-range-flag
1277
1278Since one of the most frequent ranges used is @samp{last:N}, MH-E will
1279interpret input such as @samp{200} as @samp{last:200} if the
1280@code{mh-interpret-number-as-range-flag} option is on (which is the
1281default). If you need to scan just the message 200, then use the range
1282@samp{200:1} or @samp{200-200}.
1283
1284@node Folder Selection, , Ranges, Using This Manual
1285@section Folder Selection
1286
1287@cindex completion, folders
1288@cindex folders, completion
1289@cindex folders, selecting
1290
1291When you choose a folder in MH-E via a command such as @kbd{o}
1292(@code{mh-refile-msg}), completion is used to enter the folder
1293@ifnothtml
1294(@pxref{Completion, , , emacs, The GNU Emacs Manual}).
1295@end ifnothtml
1296@ifhtml
1297(see the section
1298@uref{http://www.gnu.org/software/emacs/manual/html_node/Completion.html,
1299Completion} in @cite{The GNU Emacs Manual}).
1300@end ifhtml
1301In addition, MH-E has several ways of choosing a suitable default so
1302that the folder can often be selected with a single @key{RET} key.
1303
1304@cindex customization group, @samp{mh-folder-selection}
1305@cindex @samp{mh-folder-selection} customization group
1306
1307The @samp{mh-folder-selection} customization group contains some
1308options which are used to help with this.
1309
1310@vtable @code
1311@item mh-default-folder-for-message-function
1312Function to select a default folder for refiling or @samp{Fcc:}
1313(default: @code{nil}).
1314@c -------------------------
1315@item mh-default-folder-list
1316List of addresses and folders (default: @code{nil}).
1317@c -------------------------
1318@item mh-default-folder-must-exist-flag
1319On means guessed folder name must exist to be used (default:
1320@samp{on}).
1321@c -------------------------
1322@item mh-default-folder-prefix
1323Prefix used for folder names generated from aliases (default: @code{""}).
1324@end vtable
1325
1326@vindex mh-default-folder-for-message-function
1327
1328You can set the option @code{mh-default-folder-for-message-function}
1329to a function that provides a default folder for the message to be
1330refiled. When this function is called, the current buffer contains the
1331message being refiled and point is at the start of the message. This
1332function should return the default folder as a string with a leading
1333@samp{+} sign. It can also return @code{nil} so that the last folder
1334name is used as the default, or an empty string to suppress the
1335default entirely.
1336
1337Otherwise, the name of the destination folder is derived from the
1338sender as follows:
1339
1340@enumerate
1341@vindex mh-default-folder-list
1342@item
1343The folder name associated with the first address found in the list
1344@code{mh-default-folder-list} is used. Each element in this list
1345contains a @samp{Check Recipient} item. If this item is turned on,
1346then the address is checked against the recipient instead of the
1347sender. This is useful for mailing lists.
1348@c -------------------------
1349@vindex mh-default-folder-prefix
1350@item
1351An alias prefixed by @code{mh-default-folder-prefix} corresponding to
1352the address is used. The prefix is used to prevent clutter in your
1353mail directory. @xref{Aliases}.
1354@end enumerate
1355
1356@vindex mh-default-folder-must-exist-flag
1357
1358If the derived folder does not exist, and
1359@code{mh-default-folder-must-exist-flag} is @code{t}, then the last
1360folder name used is suggested. This is useful if you get mail from
1361various people for whom you have an alias, but file them all in the
1362same project folder.
1363
1364@node Incorporating Mail, Reading Mail, Using This Manual, Top
1365@chapter Incorporating Your Mail
1366
1367@cindex @samp{Folder} menu
1368@cindex incorporating
1369@cindex menu, @samp{Folder}
1370
1371This chapter talks about getting mail from your system mailbox into
1372your MH @samp{+inbox} folder. The following command accomplishes that
1373and is found in the @samp{Folder} menu.
1374
1375@table @kbd
1376@cindex @samp{Folder > Incorporate New Mail} menu item
1377@cindex menu item, @samp{Folder > Incorporate New Mail}
1378@findex mh-inc-folder
1379@kindex i
1380@item i
1381Incorporate new mail into a folder (@code{mh-inc-folder}).
1382@end table
1383
1384@cindex @samp{mh-inc} customization group
1385@cindex customization group, @samp{mh-inc}
1386
1387The following options in the @samp{mh-inc} customization group are
1388used.
1389
1390@vtable @code
1391@item mh-inc-prog
1392Program to incorporate mail (default: @code{"inc"}).
1393@c -------------------------
1394@item mh-inc-spool-list
1395Alternate spool files (default: @code{nil}).
1396@end vtable
1397
1398The following hook is available.
1399
1400@vtable @code
1401@findex mh-inc-folder
1402@item mh-inc-folder-hook
1403Hook run by @code{mh-inc-folder} after incorporating mail into a
1404folder (default: @code{nil}).
1405@end vtable
1406
1407@cindex @samp{+inbox}
1408@findex mh-inc-folder
1409@kindex i
1410
1411If at any time you receive new mail, incorporate the new mail into
1412your @samp{+inbox} buffer with @kbd{i} (@code{mh-inc-folder}). Note
1413that @kbd{i} will display the @samp{+inbox} buffer, even if there
1414isn't any new mail. You can incorporate mail from any file into the
1415current folder by specifying a prefix argument; you'll be prompted for
1416the name of the file to use as well as the destination folder (for
1417example, @kbd{C-u i ~/mbox @key{RET} +tmp @key{RET}}).
1418
1419@cindex @file{.emacs}
1420@cindex Emacs, notification of new mail
1421@cindex files, @file{.emacs}
1422@cindex new mail
1423@cindex notification of new mail
1424
1425Emacs can notify you when you have new mail by displaying @samp{Mail}
1426in the mode line. To enable this behavior, and to have a clock in the
1427mode line as well, add the following to @file{~/.emacs}:
1428
1429@findex display-time
1430
1431@smalllisp
1432(display-time)
1433@end smalllisp
1434
1435@cindex @command{inc}
1436@cindex incorporating
1437@cindex MH commands, @command{inc}
1438@vindex mh-inc-prog
1439@vindex mh-progs
1440
1441The name of the program that incorporates new mail is stored in
1442@code{mh-inc-prog}; it is @code{"inc"} by default. This program
1443generates a one-line summary for each of the new messages. Unless it
1444is an absolute pathname, the file is assumed to be in the
1445@code{mh-progs} directory (@pxref{Getting Started}). You may also link
1446a file to @command{inc} that uses a different format (see
1447@samp{mh-profile}(5), and sections
1448@uref{@value{MH-BOOK-HOME}/reapre.html, Reading Mail: inc show next
1449prev} and @uref{@value{MH-BOOK-HOME}/mhstr.html, MH Format Strings} in
1450the MH book). You'll then need to modify several variables
1451appropriately (@pxref{Scan Line Formats}).
1452
1453@vindex mh-inc-spool-list
1454
1455You can use the @code{mh-inc-spool-list} variable to direct MH-E to
1456retrieve mail from arbitrary spool files other than your system
1457mailbox, file it in folders other than your @samp{+inbox}, and assign
1458key bindings to incorporate this mail.
1459
1460@cindex @command{procmail}
1461@cindex @file{.procmailrc}
1462@cindex Unix commands, @command{procmail}
1463@cindex files, @file{.procmailrc}
1464
1465Suppose you are subscribed to the @i{mh-e-devel} mailing list and you
1466use @command{procmail} to filter this mail into @file{~/mail/mh-e}
1467with the following recipe in @file{.procmailrc}:
1468
1469@smallexample
1470PATH=$PATH:/usr/bin/mh
1471MAILDIR=$HOME/`mhparam Path`
1472:0:
1473* ^From mh-e-devel-admin@@stop.mail-abuse.org
1474mh-e
1475@end smallexample
1476
1477@findex mh-inc-spool-*
1478@kindex I *
1479
1480In order to incorporate @file{~/mail/mh-e} into @samp{+mh-e} with an
1481@kbd{I m} (@code{mh-inc-spool-mh-e}) command, customize this option,
1482and click on the @samp{INS} button. Enter a @samp{Spool File} of
1483@samp{~/mail/mh-e}, a @samp{Folder} of @samp{mh-e}, and a @samp{Key
1484Binding} of @samp{m}.
1485
1486@cindex @command{emacsclient}
1487@cindex @command{gnuclient}
1488@cindex @command{xbuffy}
1489@cindex @samp{gnuserv}
1490@cindex Unix commands, @command{emacsclient}
1491@cindex Unix commands, @command{gnuclient}
1492@cindex Unix commands, @command{xbuffy}
1493
1494You can use @command{xbuffy} to automate the incorporation of this
1495mail using the Emacs 22 command @command{emacsclient} as follows:
1496
1497@smallexample
1498box ~/mail/mh-e
1499 title mh-e
1500 origMode
1501 polltime 10
1502 headertime 0
1503 command emacsclient --eval '(mh-inc-spool-mh-e)'
1504@end smallexample
1505
1506In XEmacs, the command @command{gnuclient} is used in a similar
1507fashion.
1508
1509@findex mh-inc-folder
1510@kindex i
1511@vindex mh-inc-folder-hook
1512
1513You can set the hook @code{mh-inc-folder-hook}, which is called after
1514new mail is incorporated by the @kbd{i} (@code{mh-inc-folder})
1515command. A good use of this hook is to rescan the whole folder either
1516after running @kbd{M-x mh-rmail} the first time or when you've changed
1517the message numbers from outside of MH-E.
1518
1519@findex mh-execute-commands
1520@findex mh-rescan-folder, example
1521@findex mh-show, example
1522@vindex mh-inc-folder-hook, example
1523
1524@smalllisp
1525@group
1526(defun my-mh-inc-folder-hook ()
1527 "Hook to rescan folder after incorporating mail."
1528 (if (buffer-modified-p) ; @r{if outstanding refiles and deletes,}
1529 (mh-execute-commands)) ; @r{carry them out}
1530 (mh-rescan-folder) ; @r{synchronize with +inbox}
1531 (mh-show)) ; @r{show the current message}
1532
1533(add-hook 'mh-inc-folder-hook 'my-mh-inc-folder-hook)
1534
1535@i{Rescan folder after incorporating new mail via mh-inc-folder-hook}
1536
1537@end group
1538@end smalllisp
1539
1540@node Reading Mail, Folders, Incorporating Mail, Top
1541@chapter Reading Your Mail
1542
1543@cindex @samp{+inbox}
1544@cindex MH-Folder mode
1545@cindex MH-Show mode
1546@cindex modes, MH-Folder
1547@cindex modes, MH-Show
1548@cindex reading mail
1549@findex mh-rmail
1550@kindex F r
1551@kindex F v
1552@kindex M-x mh-rmail
1553
1554The MH-E entry point for reading mail is @kbd{M-x mh-rmail}. This
1555command incorporates your mail and creates a buffer called
1556@samp{+inbox} in MH-Folder mode. The command @kbd{M-x mh-rmail} shows
1557you only new mail, not mail you have already read@footnote{If you want
1558to see your old mail as well, use @kbd{F r} to pull all your messages
1559into MH-E. Or, give a prefix argument to @code{mh-rmail} so it will
1560prompt you for folder to visit like @kbd{F v} (for example, @kbd{C-u
1561M-x mh-rmail @key{RET} bob @key{RET}}). @xref{Folders}.}.
1562
1563@findex display-time
1564@vindex read-mail-command
1565
1566There are some commands that need to read mail, such as @kbd{Mouse-2}
1567over the @samp{Mail} button that @code{display-time} adds to the mode
1568line. You can configure Emacs to have these commands use MH-E by
1569setting the option @code{read-mail-command} to @samp{mh-rmail}.
1570
1571@cindex @command{scan}
1572@cindex @samp{Message} menu
1573@cindex MH commands, @command{scan}
1574@cindex menu, @samp{Message}
1575@cindex scan lines
1576
1577The @samp{+inbox} buffer contains @dfn{scan lines}, which are one-line
1578summaries of each incorporated message. You can perform most MH
1579commands on these messages via one- or two-letter commands in either
1580the MH-Folder or MH-Show buffers or by using the @samp{Message} menu.
1581See @command{scan}(1) for a description of the contents of the scan
1582lines, and see the Figure in @ref{Reading Mail Tour}, for an example.
1583
1584@table @kbd
1585@kindex ?
1586@findex mh-help
1587@item ?
1588Display cheat sheet for the MH-E commands (@code{mh-help}).
1589@c -------------------------
1590@cindex @samp{Message > Show Message} menu item
1591@cindex menu item, @samp{Message > Show Message}
1592@kindex @key{RET}
1593@findex mh-show
1594@item @key{RET}
1595Display message (@code{mh-show}).
1596@c -------------------------
1597@cindex @samp{Message > Show Message with Header} menu item
1598@cindex menu item, @samp{Message > Show Message with Header}
1599@kindex , (comma)
1600@findex mh-header-display
1601@item , (comma)
1602Display message with all header fields (@code{mh-header-display}).
1603@c -------------------------
bfe16263
BW
1604@cindex @samp{Message > Show Message with Preferred Alternative} menu item
1605@cindex menu item, @samp{Message > Show Message with Preferred Alternative}
1606@kindex : (colon)
1607@findex mh-show-preferred-alternative
1608@item : (colon)
1609Display message with the default preferred alternative
1610(@code{mh-show-preferred-alternative}).
1611@c -------------------------
4009494e
GM
1612@kindex ; (semicolon)
1613@findex mh-toggle-mh-decode-mime-flag
1614@item ; (semicolon)
1615Toggle the value of @code{mh-decode-mime-flag}
1616(@code{mh-toggle-mh-decode-mime-flag}).
1617@c -------------------------
1618@kindex @key{SPC}
1619@findex mh-page-msg
1620@item @key{SPC}
1621Display next page in message (@code{mh-page-msg}).
1622@c -------------------------
1623@kindex @key{BS}
1624@findex mh-previous-page
1625@item @key{BS}
1626Display previous page in message (@code{mh-previous-page}).
1627@c -------------------------
1628@cindex @samp{Message > Write Message to File...} menu item
1629@cindex menu item, @samp{Message > Write Message to File...}
1630@kindex >
1631@findex mh-write-msg-to-file
1632@item >
1633Append message to end of file (@code{mh-write-msg-to-file}).
1634@c -------------------------
1635@cindex @samp{Message > Pipe Message to Command...} menu item
1636@cindex menu item, @samp{Message > Pipe Message to Command...}
1637@kindex |
1638@findex mh-pipe-msg
1639@item |
1640Pipe message through shell command (@code{mh-pipe-msg}).
1641@c -------------------------
1642@kindex C-d
1643@findex mh-delete-msg-no-motion
1644@item C-d
1645Delete range, don't move to next message
1646(@code{mh-delete-msg-no-motion}).
1647@c -------------------------
1648@cindex @samp{Message > Delete Message} menu item
1649@cindex menu item, @samp{Message > Delete Message}
1650@kindex d
1651@findex mh-delete-msg
1652@item d
1653Delete range (@code{mh-delete-msg}).
1654@c -------------------------
1655@kindex D ?
1656@findex mh-prefix-help
1657@item D ?
1658Display cheat sheet for the commands of the current prefix in
1659minibuffer (@code{mh-prefix-help}).
1660@c -------------------------
1661@kindex D @key{SPC}
1662@findex mh-page-digest
1663@item D @key{SPC}
1664Display next message in digest (@code{mh-page-digest}).
1665@c -------------------------
1666@kindex D @key{BS}
1667@findex mh-page-digest-backwards
1668@item D @key{BS}
1669Display previous message in digest (@code{mh-page-digest-backwards}).
1670@c -------------------------
1671@cindex @samp{Message > Burst Digest Message} menu item
1672@cindex menu item, @samp{Message > Burst Digest Message}
1673@kindex D b
1674@findex mh-burst-digest
1675@item D b
1676Break up digest into separate messages (@code{mh-burst-digest}).
1677@c -------------------------
1678@cindex @samp{Message > Go to Message by Number...} menu item
1679@cindex menu item, @samp{Message > Go to Message by Number...}
1680@kindex g
1681@findex mh-goto-msg
1682@item g
1683Go to a message (@code{mh-goto-msg}).
1684@c -------------------------
1685@kindex k
1686@findex mh-delete-subject-or-thread
1687@item k
1688Delete messages with same subject or thread
1689(@code{mh-delete-subject-or-thread}).
1690@c -------------------------
1691@kindex K ?
1692@findex mh-prefix-help
1693@item K ?
1694Display cheat sheet for the commands of the current prefix in
1695minibuffer (@code{mh-prefix-help}).
1696@c -------------------------
1697@kindex K @key{TAB}
1698@findex mh-next-button
1699@item K @key{TAB}
1700Go to the next button (@code{mh-next-button}).
1701@c -------------------------
1702@kindex K S-@key{TAB}
1703@findex mh-prev-button
1704@item K S-@key{TAB}
1705Go to the previous button (@code{mh-prev-button}).
1706@c -------------------------
1707@kindex K a
1708@findex mh-mime-save-parts
1709@item K a
1710Save attachments (@code{mh-mime-save-parts}).
1711@c -------------------------
1712@kindex K e
1713@findex mh-display-with-external-viewer
1714@item K e
1715View attachment externally (@code{mh-display-with-external-viewer}).
1716@c -------------------------
1717@kindex K i
1718@findex mh-folder-inline-mime-part
1719@item K i
1720Show attachment verbatim (@code{mh-folder-inline-mime-part}).
1721@c -------------------------
1722@kindex K o
1723@findex mh-folder-save-mime-part
1724@item K o
1725Save (output) attachment (@code{mh-folder-save-mime-part}).
1726@c -------------------------
1727@kindex K t
1728@findex mh-toggle-mime-buttons
1729@item K t
1730Toggle option @code{mh-display-buttons-for-inline-parts-flag}
1731(@code{mh-toggle-mime-buttons}).
1732@c -------------------------
1733@kindex K v
1734@findex mh-folder-toggle-mime-part
1735@item K v
1736View attachment (@code{mh-folder-toggle-mime-part}).
1737@c -------------------------
1738@cindex @samp{Message > Modify Message} menu item
1739@cindex menu item, @samp{Message > Modify Message}
1740@kindex M
1741@findex mh-modify
1742@item M
1743Edit message (@code{mh-modify}).
1744@c -------------------------
1745@cindex @samp{Message > Go to First Message} menu item
1746@cindex menu item, @samp{Message > Go to First Message}
1747@kindex M-<
1748@findex mh-first-msg
1749@item M-<
1750Display first message (@code{mh-first-msg}).
1751@c -------------------------
1752@cindex @samp{Message > Go to Last Message} menu item
1753@cindex menu item, @samp{Message > Go to Last Message}
1754@kindex M->
1755@findex mh-last-msg
1756@item M->
1757Display last message (@code{mh-last-msg}).
1758@c -------------------------
1759@kindex M-n
1760@findex mh-next-unread-msg
1761@item M-n
1762Display next unread message (@code{mh-next-unread-msg}).
1763@c -------------------------
1764@kindex M-p
1765@findex mh-previous-unread-msg
1766@item M-p
1767Display previous unread message (@code{mh-previous-unread-msg}).
1768@c -------------------------
1769@cindex @samp{Message > Next Message} menu item
1770@cindex menu item, @samp{Message > Next Message}
1771@kindex n
1772@findex mh-next-undeleted-msg
1773@item n
1774Display next message (@code{mh-next-undeleted-msg}).
1775@c -------------------------
1776@cindex @samp{Message > Previous Message} menu item
1777@cindex menu item, @samp{Message > Previous Message}
1778@kindex p
1779@findex mh-previous-undeleted-msg
1780@item p
1781Display previous message (@code{mh-previous-undeleted-msg}).
1782@c -------------------------
1783@kindex P ?
1784@findex mh-prefix-help
1785@item P ?
1786Display cheat sheet for the commands of the current prefix in
1787minibuffer (@code{mh-prefix-help}).
1788@c -------------------------
1789@kindex P C
1790@findex mh-ps-print-toggle-color
1791@item P C
1792Toggle whether color is used in printing messages
1793(@code{mh-ps-print-toggle-color}).
1794@c -------------------------
1795@kindex P F
1796@findex mh-ps-print-toggle-faces
1797@item P F
1798Toggle whether printing is done with faces or not
1799(@code{mh-ps-print-toggle-faces}).
1800@c -------------------------
1801@kindex P f
1802@findex mh-ps-print-msg-file
1803@item P f
1804Print range to file (@code{mh-ps-print-msg-file}).
1805@c -------------------------
1806@cindex @samp{Message > Print Message} menu item
1807@cindex menu item, @samp{Message > Print Message}
1808@kindex P l
1809@findex mh-print-msg
1810@item P l
1811Print range the old fashioned way
1812(@code{mh-print-msg}).
1813@c -------------------------
1814@kindex P p
1815@findex mh-ps-print-msg
1816@item P p
1817Print range (@code{mh-ps-print-msg}).
1818@c -------------------------
1819@kindex X ?
1820@findex mh-prefix-help
1821@item X ?
1822Display cheat sheet for the commands of the current prefix in
1823minibuffer (@code{mh-prefix-help}).
1824@c -------------------------
1825@cindex @samp{Message > Unpack Uuencoded Message...} menu item
1826@cindex menu item, @samp{Message > Unpack Uuencoded Message...}
1827@kindex X s
1828@kindex X u
1829@findex mh-store-msg
1830@item X s
1831@itemx X u
1832Unpack message created with @command{uudecode} or @command{shar}
1833(@code{mh-store-msg}).
1834@c -------------------------
1835@kindex Mouse-2
1836@findex mh-show-mouse
1837@item Mouse-2
1838Move point to mouse event and show message (@code{mh-show-mouse}).
1839@end table
1840
1841Within the MH-Show buffer, the following command is defined.
1842
1843@table @kbd
1844@kindex @key{RET}
1845@kindex Mouse-1
1846@kindex Mouse-2
1847@findex mh-press-button
1848@item @key{RET}
1849@itemx Mouse-1
1850@itemx Mouse-2
1851View contents of button (@code{mh-press-button}).
1852@end table
1853
1854@cindex @samp{mh-show} customization group
1855@cindex customization group, @samp{mh-show}
1856
1857The following table lists options in the @samp{mh-show} customization
1858group that are used while reading mail.
1859
1860@vtable @code
1861@item mh-bury-show-buffer-flag
1862On means show buffer is buried (default: @samp{on}).
1863@c -------------------------
1864@item mh-clean-message-header-flag
1865On means remove extraneous header fields (default: @samp{on}).
1866@c -------------------------
1867@item mh-decode-mime-flag
1868On means attachments are handled (default: @samp{on} if the Gnus
1869@samp{mm-decode} package is present).
1870@c -------------------------
1871@item mh-display-buttons-for-alternatives-flag
1872On means display buttons for all alternative attachments (default:
1873@samp{off}).
1874@c -------------------------
1875@item mh-display-buttons-for-inline-parts-flag
1876On means display buttons for all inline attachments (default:
1877@samp{off}).
1878@c -------------------------
1879@item mh-do-not-confirm-flag
1880On means non-reversible commands do not prompt for confirmation
1881(default: @samp{off}).
1882@c -------------------------
1883@item mh-fetch-x-image-url
1884Control fetching of @samp{X-Image-URL:} header field image (default:
1885@samp{Never Fetch}).
1886@c -------------------------
1887@item mh-graphical-smileys-flag
1888On means graphical smileys are displayed (default: @samp{on}).
1889@c -------------------------
1890@item mh-graphical-emphasis-flag
1891On means graphical emphasis is displayed (default: @samp{on}).
1892@c -------------------------
1893@item mh-highlight-citation-style
1894Style for highlighting citations (default: @samp{Multicolor}).
1895@c -------------------------
1896@item mh-invisible-header-fields-default
1897List of hidden header fields (default: a checklist too long to list
1898here).
1899@c -------------------------
1900@item mh-invisible-header-fields
1901Additional header fields to hide (default: @code{nil}).
1902@c -------------------------
1903@item mh-lpr-command-format
1904Command used to print (default: @code{"lpr -J '%s'"}).
1905@c -------------------------
1906@item mh-max-inline-image-height
1907Maximum inline image height if @samp{Content-Disposition:} is not
1908present (default: 0).
1909@c -------------------------
1910@item mh-max-inline-image-width
1911Maximum inline image width if @samp{Content-Disposition:} is not
1912present(default: 0).
1913@c -------------------------
1914@item mh-mhl-format-file
1915Specifies the format file to pass to the @command{mhl} program
1916(default: @samp{Use Default mhl Format (Printing Only)}).
1917@c -------------------------
1918@item mh-mime-save-parts-default-directory
1919Default directory to use for @kbd{K a}.
1920@c -------------------------
1921@item mh-print-background-flag
1922On means messages should be printed in the background (default:
1923@samp{off}).
1924@c -------------------------
1925@item mh-show-buffer-mode-line-buffer-id
1926Format string to produce @code{mode-line-buffer-identification} for
1927show buffers (default: @code{" @{show-%s@} %d"}).
1928@c -------------------------
1929@item mh-show-maximum-size
1930Maximum size of message (in bytes) to display automatically (default:
19310).
1932@c -------------------------
1933@item mh-show-use-xface-flag
1934On means display face images in MH-Show buffers (default: @samp{on}).
1935@c -------------------------
1936@item mh-store-default-directory
1937Default directory for @kbd{X s} (default: @samp{Current}).
1938@c -------------------------
1939@item mh-summary-height
1940Number of lines in MH-Folder buffer (including the mode line)
1941(default: depends on size of frame).
1942@end vtable
1943
1944The following hooks are available.
1945
1946@vtable @code
1947@item mh-delete-msg-hook
1948Hook run after marking each message for deletion (default: @code{nil}).
1949@c -------------------------
1950@item mh-show-hook
1951Hook run after @key{RET} shows a message (default: @code{nil}).
1952@c -------------------------
1953@item mh-show-mode-hook
1954Hook run upon entry to @code{mh-show-mode} (default: @code{nil}).
1955@end vtable
1956
1957The following faces are available.
1958
1959@vtable @code
1960@item mh-show-cc
1961Face used to highlight @samp{cc:} header fields.
1962@c -------------------------
1963@item mh-show-date
1964Face used to highlight @samp{Date:} header fields.
1965@c -------------------------
1966@item mh-show-from
1967Face used to highlight @samp{From:} header fields.
1968@c -------------------------
1969@item mh-show-header
1970Face used to deemphasize less interesting header fields.
1971@c -------------------------
1972@item mh-show-pgg-bad
1973Bad PGG signature face.
1974@c -------------------------
1975@item mh-show-pgg-good
1976Good PGG signature face.
1977@c -------------------------
1978@item mh-show-pgg-unknown
1979Unknown or untrusted PGG signature face.
1980@c -------------------------
1981@item mh-show-signature
1982Signature face.
1983@c -------------------------
1984@item mh-show-subject
1985Face used to highlight @samp{Subject:} header fields.
1986@c -------------------------
1987@item mh-show-to
1988Face used to highlight @samp{To:} header fields.
1989@c -------------------------
1990@item mh-show-xface
1991X-Face image face.
1992@end vtable
1993
1994The functions and variables introduced here are explained in more
1995detail in the following sections.
1996
1997@menu
1998* Viewing::
1999* Viewing Attachments::
2000* HTML::
2001* Digests::
2002* Reading PGP::
2003* Printing::
2004* Files and Pipes::
2005* Navigating::
2006* Miscellaneous Commands and Options::
2007@end menu
2008
2009@node Viewing, Viewing Attachments, Reading Mail, Reading Mail
2010@section Viewing Your Mail
2011
2012@findex mh-header-display
2013@findex mh-page-msg
2014@findex mh-previous-page
2015@findex mh-show
2016@findex mh-show-mouse
2017@kindex , (comma)
2018@kindex . (period)
2019@kindex @key{BS}
2020@kindex @key{RET}
2021@kindex @key{SPC}
2022@kindex Mouse-2
2023
2024The command @key{RET} (@code{mh-show}) displays the message that the
2025cursor is on while @kbd{Mouse-2} (@code{mh-show-mouse}) displays the
2026message that the mouse cursor is on. If the message is already
2027displayed, it scrolls to the beginning of the message. Use @key{SPC}
2028(@code{mh-page-msg}) and @key{BS} (@code{mh-previous-page}) to move
2029forwards and backwards one page at a time through the message. You can
2030give either of these commands a prefix argument that specifies the
2031number of lines to scroll (such as @kbd{10 @key{SPC}}). The @key{SPC}
2032command will also show the next undeleted message if it is used at the
2033bottom of a message. MH-E normally hides a lot of the superfluous
2034header fields that mailers add to a message, but if you wish to see
2035all of them, use the command @kbd{,} (comma;
2036@code{mh-header-display}).
2037
2038@vindex mh-show-maximum-size
2039
2040The option @code{mh-show-maximum-size} provides an opportunity to skip
2041over large messages which may be slow to load. The default value of 0
2042means that all message are shown regardless of size.
2043
2044A litany of options control what displayed messages look like.
2045
2046@vindex mh-show-cc
2047@vindex mh-show-date
2048@vindex mh-show-from
2049@vindex mh-show-header
2050@vindex mh-show-subject
2051@vindex mh-show-to
2052
2053First, the appearance of the header fields can be modified by
2054customizing the associated face: @code{mh-show-to}, @code{mh-show-cc},
2055@code{mh-show-from}, @code{mh-show-date}, and @code{mh-show-subject}.
2056The face @code{mh-show-header} is used to deemphasize the other, less
2057interesting, header fields.
2058
2059@cindex regular expressions, @code{mh-invisible-header-fields}
2060@vindex mh-clean-message-header-flag
2061@vindex mh-invisible-header-fields
2062@vindex mh-invisible-header-fields-default
2063
2064Normally messages are delivered with a handful of uninteresting header
2065fields. These are hidden by turning on the option
2066@code{mh-clean-message-header-flag} (which it is by default). The
2067header fields listed in the option
2068@code{mh-invisible-header-fields-default} are hidden, although you can
2069check off any field that you would like to see. Header fields that you
2070would like to hide that aren't listed can be added to the option
2071@code{mh-invisible-header-fields} with a couple of caveats. Regular
2072expressions are not allowed. Unique fields should have a @samp{:}
2073suffix; otherwise, the element can be used to render invisible an
2074entire class of fields that start with the same prefix. If you think a
2940c053
BW
2075header field should be generally ignored, please update
2076@uref{https://sourceforge.net/tracker/index.php?func=detail&aid=1916032&group_id=13357&atid=113357,
2077SF #1916032}.
4009494e
GM
2078
2079@cindex header field, @samp{Face:}
2080@cindex header field, @samp{X-Face:}
2081@cindex header field, @samp{X-Image-URL:}
2082@cindex @samp{Face:} header field
2083@cindex @samp{X-Face:} header field
2084@cindex @samp{X-Image-URL:} header field
2085@vindex mh-show-use-xface-flag
2086
2087MH-E can display the content of @samp{Face:}, @samp{X-Face:}, and
2088@samp{X-Image-URL:} header fields. If any of these fields occur in the
2089header of your message, the sender's face will appear in the
2090@samp{From:} header field. If more than one of these fields appear,
2091then the first field found in the order @samp{Face:}, @samp{X-Face:},
2092and @samp{X-Image-URL:} will be used. The option
2093@code{mh-show-use-xface-flag} is used to turn this feature on and off.
2094This feature will be turned on by default if your system supports it.
2095
2096The first header field used, if present, is the Gnus-specific
2097@samp{Face:} field@footnote{The @samp{Face:} field appeared in GNU
2098Emacs 21 and XEmacs. For more information, see
2099@uref{http://quimby.gnus.org/circus/face/}.}.
2100
2101@cindex @command{uncompface}
2102@cindex Emacs, packages, x-face
2103@cindex Unix commands, @command{uncompface}
2104@cindex x-face package
2105@vindex mh-show-xface
2106
2107Next is the traditional @samp{X-Face:} header field@footnote{The
2108display of this field requires the
2109@uref{ftp://ftp.cs.indiana.edu/pub/faces/compface/compface.tar.Z,
2110@command{uncompface} program}. Recent versions of XEmacs have internal
2111support for @samp{X-Face:} images. If your version of XEmacs does not,
2112then you'll need both @command{uncompface} and the
2113@uref{ftp://ftp.jpl.org/pub/elisp/, @samp{x-face} package}.}. MH-E
2114renders the foreground and background of the image using the
2115associated attributes of the face @code{mh-show-xface}.
2116
2117@cindex @command{convert}
2118@cindex @command{wget}
2119@cindex ImageMagick
2120@cindex Unix commands, @command{convert}
2121@cindex Unix commands, @command{wget}
2122@vindex mh-fetch-x-image-url
2123
2124Finally, MH-E will display images referenced by the
2125@samp{X-Image-URL:} header field if neither the @samp{Face:} nor the
2126@samp{X-Face:} fields are present@footnote{The display of the images
2127requires the @uref{http://www.gnu.org/software/wget/wget.html,
2128@command{wget} program} to fetch the image and the @command{convert}
2129program from the @uref{http://www.imagemagick.org/, ImageMagick
2130suite}.}. Of the three header fields this is the most efficient in
2131terms of network usage since the image doesn't need to be transmitted
2132with every single mail. The option @code{mh-fetch-x-image-url}
2133controls the fetching of the @samp{X-Image-URL:} header field image
2134with the following values:
2135
2136@table @samp
2137@item Ask Before Fetching
2138You are prompted before the image is fetched. MH-E will remember your
2139reply and will either use the already fetched image the next time the
2140same URL is encountered or silently skip it if you didn't fetch it the
2141first time. This is a good setting.
2142@c -------------------------
2143@item Never Fetch
2144Images are never fetched and only displayed if they are already
2145present in the cache. This is the default.
2146@end table
2147
2148There isn't a value of @samp{Always Fetch} for privacy and DOS (denial
2149of service) reasons. For example, fetching a URL can tip off a spammer
2150that you've read his email (which is why you shouldn't blindly answer
2151yes if you've set this option to @samp{Ask Before Fetching}). Someone
2152may also flood your network and fill your disk drive by sending a
2153torrent of messages, each specifying a unique URL to a very large
2154file.
2155
2156@cindex @file{.mhe-x-image-cache}
2157@cindex files, @file{.mhe-x-image-cache}
2158
2159The cache of images is found in the directory
2160@file{.mhe-x-image-cache} within your MH directory. You can add your
2161own face to the @samp{From:} field too. @xref{Picture}.
2162
2163@cindex @command{mhl}
2164@cindex MH commands, @command{mhl}
2165@vindex mh-mhl-format-file
2166
2167Normally MH-E takes care of displaying messages itself (rather than
2168calling an MH program to do the work). If you'd rather have
2169@command{mhl} display the message (within MH-E), change the option
2170@code{mh-mhl-format-file} from its default value of @samp{Use Default
2171mhl Format (Printing Only)}. You can set this option to @samp{Use
2172Default mhl Format} to get the same output as you would get if you ran
2173@command{mhl} from the shell. If you have a format file that you want
2174MH-E to use, you can set this option to @samp{Specify an mhl Format
2175File} and enter the name of your format file (@command{mhl}(1) or
2176section @uref{@value{MH-BOOK-HOME}/shomes.html#Usisho, Using mhl} in
2177the MH book tells you how to write one). Your format file should
2178specify a non-zero value for @samp{overflowoffset} to allow MH-E to
2179parse the header. Note that @command{mhl} is always used for printing
2180and forwarding; in this case, the value of @code{mh-mhl-format-file}
2181is consulted if you have specified a format file.
2182
2183@cindex citations, highlighting
2184@cindex highlighting citations
2185@vindex mh-highlight-citation-style
2186
2187If the sender of the message has cited other messages in his message,
2188then MH-E will highlight these citations to emphasize the sender's
2189actual response. The option @code{mh-highlight-citation-style} can be
2190customized to change the highlighting style. The @samp{Multicolor}
2191method uses a different color for each indentation while the
2192@samp{Monotone} method highlights all citations in red. To disable
2193highlighting of citations entirely, choose @samp{None}.
2194
2195@cindex URLs, highlighting
2196@cindex email addresses, highlighting
2197@cindex highlighting URLs
2198@cindex highlighting email addresses
2199@cindex links, following
2200@findex goto-address-at-point
2201@kindex C-c @key{RET}
2202@kindex Mouse-2
2203@vindex goto-address-highlight-p
2204
2205Email addresses and URLs in the message are highlighted if the option
2206@code{goto-address-highlight-p} is on, which it is by default. To view
2207the web page for a highlighted URL or to send a message using a
2208highlighted email address, use @kbd{Mouse-2} or @kbd{C-c @key{RET}}
2209(@code{goto-address-at-point}). @xref{Sending Mail}, to see how to
2210configure Emacs to send the message using MH-E.
2211
2212@cindex boldface, showing
2213@cindex emphasis
2214@cindex italics, showing
2215@cindex smileys
2216@cindex typesetting
2217@cindex underline, showing
2218@vindex gnus-emphasis-alist
2219@vindex mh-decode-mime-flag
2220@vindex mh-graphical-emphasis-flag
2221@vindex mh-graphical-smileys-flag
2222
2223It is a long standing custom to inject body language using a
2224cornucopia of punctuation, also known as the @dfn{smileys}. MH-E can
2225render these as graphical widgets if the option
2226@code{mh-graphical-smileys-flag} is turned on, which it is by default.
2227Smileys include patterns such as :-) and ;-). Similarly, a few
2228typesetting features are indicated in ASCII text with certain
2229characters. If your terminal supports it, MH-E can render these
2230typesetting directives naturally if the option
2231@code{mh-graphical-emphasis-flag} is turned on, which it is by
2232default. For example, _underline_ will be
2233@ifhtml
2234@html
2235<u>underlined</u>,
2236@end html
2237@end ifhtml
2238@ifnothtml
2239underlined,
2240@end ifnothtml
2241*bold* will appear in @b{bold}, /italics/ will appear in @i{italics},
2242and so on. See the option @code{gnus-emphasis-alist} for the whole
2243list. Both of these options are disabled if the option
2244@code{mh-decode-mime-flag} is turned off. @xref{Viewing Attachments}.
2245
2246@cindex signature separator
2247@cindex vCard
2248@vindex mh-show-signature
2249
2250MH-E normally renders signatures and vCards in italics so that the
2251body of the message stands out more. MH-E depends on the presence of
2252the @dfn{signature separator} (@code{"-- "}) to do this. You can also
2253customize the face @code{mh-show-signature} so the appearance of the
2254signature block is more to your liking.
2255
2256@vindex mh-show-hook
2257@vindex mh-show-mode-hook
2258
2259Two hooks can be used to control how messages are displayed. The first
2260hook, @code{mh-show-mode-hook}, is called early on in the process of
2261the message display. It is usually used to perform some action on the
2262message's content. The second hook, @code{mh-show-hook}, is the last
2263thing called after messages are displayed. It's used to affect the
2264behavior of MH-E in general or when @code{mh-show-mode-hook} is too
2265early.
2266
2267@cindex MH-Show mode
2268@cindex modes, MH-Show
2269@vindex mh-show-buffer-mode-line-buffer-id
2270
2271For those who like to modify their mode lines, use
2272@code{mh-show-buffer-mode-line-buffer-id} to modify the mode line in
2273the MH-Show buffers. Place the two escape strings @samp{%s} and
2274@samp{%d}, which will display the folder name and the message number,
2275respectively, somewhere in the string in that order. The default value
2276of @code{"@{show-%s@} %d"} yields a mode line of
2277
2278@smallexample
2279-----@{show-+inbox@} 4 (MH-Show)--Bot--------------------------------
2280@end smallexample
2281
2282@node Viewing Attachments, HTML, Viewing, Reading Mail
2283@section Viewing Attachments
2284
2285@cindex attachments
2286@cindex body parts
2287@cindex @command{mhshow}
2288@cindex @command{show}
2289@cindex MH commands, @command{mhshow}
2290@cindex MH commands, @command{show}
2291@cindex MIME
2292@cindex multimedia mail
2293
2294MH has the ability to display @dfn{@sc{mime}} (Multipurpose Internet
2295Mail Extensions) messages which are simply messages with additional
2296@dfn{body parts} or @dfn{attachments}. You can use the MH commands
2297@command{show}@footnote{See the section
2298@uref{@value{MH-BOOK-HOME}/reapre.html, Reading Mail: inc show next
2299prev} in the MH book.} or @command{mhshow}@footnote{See the section
2300@uref{@value{MH-BOOK-HOME}/usimim.html#ReMIMa, Reading MIME Mail} in
2301the MH book.} from the shell to read @sc{mime} messages@footnote{You
2302can call them directly from Emacs if you're running the X Window
2303System: type @kbd{M-! xterm -e mhshow @var{message-number}}. You can
2304leave out the @samp{xterm -e} if you use @command{mhlist} or
2305@command{mhstore}.}.
2306
2307@cindex Emacs, packages, mm-decode
2308@cindex mm-decode package
2309@findex mh-toggle-mh-decode-mime-flag
2310@kindex ; (semicolon)
2311@vindex mh-decode-mime-flag
2312
2313MH-E can handle attachments as well if the Gnus @samp{mm-decode}
2314package is present. If so, the option @code{mh-decode-mime-flag} will
2315be on. Otherwise, you'll see the @sc{mime} body parts rather than text
2316or attachments. There isn't much point in turning off the option
2317@code{mh-decode-mime-flag}; however, you can inspect it if it appears
2318that the body parts are not being interpreted correctly or toggle it
2319with the command @kbd{;} (semicolon;
2320@code{mh-toggle-mh-decode-mime-flag}) to view the raw message. This
2321option also controls the display of quoted-printable messages and
2322other graphical widgets. @xref{Viewing}.
2323
2324@cindex buttons
2325
2326Attachments in MH-E are indicated by @dfn{buttons} like this:
2327
2328@smallexample
2329[1. image/jpeg; foo.jpg]...
2330@end smallexample
2331
2332@findex mh-next-button
2333@findex mh-press-button
2334@findex mh-prev-button
2335@kindex @key{RET}
2336@kindex K @key{TAB}
2337@kindex K S-@key{TAB}
2338@kindex Mouse-1
2339@kindex Mouse-2
2340
2341To view the contents of the button, use either @kbd{Mouse-1} or
2342@kbd{Mouse-2} on the button or @key{RET} (@code{mh-press-button}) when
2343the cursor is over the button. This command is a toggle so if you use
2344it again on the same attachment, it is hidden. If Emacs does not know
2345how to display the attachment, then Emacs offers to save the
2346attachment in a file. To move the cursor to the next button, use the
2347command @kbd{K @key{TAB}} (@code{mh-next-button}). If the end of the
2348buffer is reached then the search wraps over to the start of the
2349buffer. To move the cursor to the previous button, use the command
2350@kbd{K S-@key{TAB}} (@code{mh-prev-button}). If the beginning of the
2351buffer is reached then the search wraps over to the end of the buffer.
2352
2353@cindex attachments, viewing
2354@cindex viewing attachments
2355@findex mh-folder-toggle-mime-part
2356@kindex K v
2357
2358Another way to view the contents of a button is to use the command
2359@kbd{K v} (@code{mh-folder-toggle-mime-part}). This command displays
2360(or hides) the attachment associated with the button under the cursor.
2361If the cursor is not located over a button, then the cursor first
2362moves to the next button, wrapping to the beginning of the message if
2363necessary. This command has the advantage over the previous commands
2364of working from the MH-Folder buffer. You can also provide a numeric
2365prefix argument (as in @kbd{4 K v}) to view the attachment labeled
2366with that number. If Emacs does not know how to display the
2367attachment, then Emacs offers to save the attachment in a file.
2368
2369@cindex @file{/etc/mailcap}
2370@cindex files, @file{/etc/mailcap}
2371@findex mailcap-mime-info
2372@findex mh-display-with-external-viewer
2373@kindex K e
2374
2375If Emacs does not know how to view an attachment, you could save it
2376into a file and then run some program to open it. It is easier,
2377however, to launch the program directly from MH-E with the command
2378@kbd{K e} (@code{mh-display-with-external-viewer}). While you'll most
2379likely use this to view spreadsheets and documents, it is also useful
2380to use your browser to view HTML attachments with higher fidelity than
2381what Emacs can provide. This command displays the attachment
2382associated with the button under the cursor. If the cursor is not
2383located over a button, then the cursor first moves to the next button,
2384wrapping to the beginning of the message if necessary. You can provide
2385a numeric prefix argument (as in @kbd{4 K e}) to view the attachment
2386labeled with that number. This command tries to provide a reasonable
2387default for the viewer by calling the Emacs function
2388@code{mailcap-mime-info}. This function usually reads the file
2389@file{/etc/mailcap}.
2390
2391@cindex attachments, saving
2392@cindex saving attachments
2393@findex mh-folder-save-mime-part
2394@kindex K o
2395
2396Use the command @kbd{K o} (@code{mh-folder-save-mime-part}) to save
2397attachments (the mnemonic is ``output''). This command saves the
2398attachment associated with the button under the cursor. If the cursor
2399is not located over a button, then the cursor first moves to the next
2400button, wrapping to the beginning of the message if necessary. You can
2401also provide a numeric prefix argument (as in @kbd{3 K o}) to save the
2402attachment labeled with that number. This command prompts you for a
2403filename and suggests a specific name if it is available.
2404
2405@cindex @command{mhn}
2406@cindex @command{mhstore}
2407@cindex MH commands, @command{mhn}
2408@cindex MH commands, @command{mhstore}
2409@findex mh-mime-save-parts
2410@kindex K a
2411@vindex mh-mime-save-parts-default-directory
2412
2413You can save all of the attachments at once with the command @kbd{K a}
2414(@code{mh-mime-save-parts}). The attachments are saved in the
2415directory specified by the option
2416@code{mh-mime-save-parts-default-directory} unless you use a prefix
2417argument (as in @kbd{C-u K a}) in which case you are prompted for the
2418directory. These directories may be superseded by MH profile
2419components, since this function calls on @command{mhstore}
2420(@command{mhn}) to do the work.
2421
2422@vindex mh-mime-save-parts-default-directory
2423
2424The default value for the option
2425@code{mh-mime-save-parts-default-directory} is @samp{Prompt Always} so
2426that you are always prompted for the directory in which to save the
2427attachments. However, if you usually use the same directory within a
2428session, then you can set this option to @samp{Prompt the First Time}
2429to avoid the prompt each time. you can make this directory permanent
2430by choosing @samp{Directory} and entering the directory's name.
2431
2432@cindex attachments, inline
2433@cindex inline attachments
2434@findex mh-toggle-mime-buttons
2435@kindex K t
2436@vindex mh-display-buttons-for-inline-parts-flag
2437
2438The sender can request that attachments should be viewed inline so
2439that they do not really appear like an attachment at all to the
2440reader. Most of the time, this is desirable, so by default MH-E
2441suppresses the buttons for inline attachments. On the other hand, you
2442may receive code or HTML which the sender has added to his message as
2443inline attachments so that you can read them in MH-E. In this case, it
2444is useful to see the buttons so that you know you don't have to cut
2445and paste the code into a file; you can simply save the attachment. If
2446you want to make the buttons visible for inline attachments, you can
2447use the command @kbd{K t} (@code{mh-toggle-mime-buttons}) to toggle
2448the visibility of these buttons. You can turn on these buttons
2449permanently by turning on the option
2450@code{mh-display-buttons-for-inline-parts-flag}.
2451
2452MH-E cannot display all attachments inline however. It can display
2453text (including @sc{html}) and images.
2454
2455@cindex header field, @samp{Content-Disposition:}
2456@cindex inline images
2457@cindex @samp{Content-Disposition:} header field
2458@vindex mh-max-inline-image-height
2459@vindex mh-max-inline-image-width
2460
2461Some older mail programs do not insert the needed
2462plumbing@footnote{This plumbing is the @samp{Content-Disposition:}
2463header field.} to tell MH-E whether to display the attachments inline
2464or not. If this is the case, MH-E will display these images inline if
2465they are smaller than the window. However, you might want to allow
2466larger images to be displayed inline. To do this, you can change the
2467options @code{mh-max-inline-image-width} and
2468@code{mh-max-inline-image-height} from their default value of zero to
2469a large number. The size of your screen is a good choice for these
2470numbers.
2471
2472@cindex alternatives
2473@cindex attachments, alternatives
2474@vindex mh-display-buttons-for-alternatives-flag
2475
2476Sometimes, a mail program will produce multiple alternatives of an
2477attachment in increasing degree of faithfulness to the original
2478content. By default, only the preferred alternative is displayed. If
2479the option @code{mh-display-buttons-for-alternatives-flag} is on, then
2480the preferred part is shown inline and buttons are shown for each of
2481the other alternatives.
2482
2483@vindex mm-discouraged-alternatives
2484
2485Many people prefer to see the @samp{text/plain} alternative rather
2486than the @samp{text/html} alternative. To do this in MH-E, customize
2487the option @code{mm-discouraged-alternatives}, and add
2488@samp{text/html}. The next best alternative, if any, will be shown.
2489
bfe16263
BW
2490@findex mh-show-preferred-alternative
2491@kindex : (colon)
2492
2493Occasionally, though, you might want to see the preferred alternative.
2494The command @kbd{:} (@code{mh-show-preferred-alternative}) displays
2495the message with the default preferred alternative. This is as if
2496@code{mm-discouraged-alternatives} is set to @samp{nil}. Use the
2497command @key{RET} (@code{mh-show}) to show the message normally again.
2498
4009494e
GM
2499@kindex K i
2500@findex mh-folder-inline-mime-part
2501
2502You can view the raw contents of an attachment with the command @kbd{K
2503i} (@code{mh-folder-inline-mime-part}). This command displays (or
2504hides) the contents of the attachment associated with the button under
2505the cursor verbatim. If the cursor is not located over a button, then
2506the cursor first moves to the next button, wrapping to the beginning
2507of the message if necessary. You can also provide a numeric prefix
2508argument (as in @kbd{4 K i}) to view the attachment labeled with that
2509number.
2510
2511For additional information on buttons, see
2512@ifinfo
2513@ref{Article Buttons,,,gnus}, and @ref{MIME Commands,,,gnus}.
2514@end ifinfo
2515@ifnotinfo
2516the chapters @uref{http://www.gnus.org/manual/gnus_101.html#SEC101,
2517Article Buttons} and
2518@uref{http://www.gnus.org/manual/gnus_108.html#SEC108, MIME Commands}
2519in the @cite{The Gnus Manual}.
2520@end ifnotinfo
2521
2522@node HTML, Digests, Viewing Attachments, Reading Mail
2523@section HTML
2524
2525@cindex HTML
2526@cindex Gnus
2527
2528MH-E can display messages that have been sent in HTML@footnote{This
2529feature depends on a version of Gnus that is at least 5.10.}. The
2530content of the message will appear in the MH-Show buffer as you would
2531expect if the entire message is HTML, or there is an inline HTML body
2532part. However, if there is an HTML body part that is an attachment,
2533then you'll see a button like this:
2534
2535@smallexample
2536[1. text/html; foo.html]...
2537@end smallexample
2538
2539To see how to read the contents of this body part, see @ref{Viewing
2540Attachments}.
2541
2542@vindex mm-text-html-renderer
2543
2544The browser that MH-E uses is determined by the option
2545@code{mm-text-html-renderer}. The default setting is set automatically
2546based upon the presence of a known browser on your system. If you wish
2547to use a different browser, then set this option accordingly. See the
2548documentation for the browser you use for additional information on
2549how to use it. In particular, find and disable the option to render
2550images as this can tip off spammers that the email address they have
2551used is valid.
2552
2553@vindex mm-text-html-renderer
2554
2555If you're confused about which @code{mm-text-html-renderer} to use,
2556here's a brief description of each, sorted by popularity, that
2557includes the results of a quick poll of MH-E users from 2005-12-23.
2558
2559@table @asis
2560@cindex browser, @samp{w3m}
2561@cindex @samp{w3m}
2562@kindex Mouse-2
4009494e
GM
2563@item @samp{w3m} 7
2564The @samp{w3m} browser requires an external program. It's quick,
2565produces pretty nice output, and best of all, it's the only browser
2566that highlights links. These can be clicked with @kbd{Mouse-2} to view
567b9191
BW
2567the content of the link in @samp{w3m}. The @samp{w3m} browser handles
2568tables well and actually respects the table's width parameter (which
2569can cause text to wrap if the author didn't anticipate that the page
2570would be viewed in Emacs).
4009494e
GM
2571@c -------------------------
2572@cindex browser, @samp{w3m-standalone}
2573@cindex @samp{w3m-standalone}
2574@item @samp{w3m-standalone} 3
2575This browser, along with @samp{nil} for the external browser, are the
2576only choices that work without having to download a separate lisp
2577package or external program. This browser is quick, but does not show
2578links. It handles simple tables but some tables get rendered much
2579wider than the Emacs frame. This browser was the only one not to
2580handle the escape @samp{&ndash;} (it printed a @samp{?}), but it did
2581render @samp{&reg;}.
2582@c -------------------------
2583@cindex browser, @samp{links}
2584@cindex @samp{links}
2585@item @samp{links} 1
2586The @samp{links} browser requires an external program. It's quick, and
2587produces nicer output than @samp{lynx} on single column mails in
2588tables. However, it doesn't show links and it doesn't do as nice a job
2589on multi-column tables as some lines wrap. At least it fits in 80
2590columns and thus seems better than @samp{w3} and
2591@samp{w3m-standalone}. Converts escapes such as @samp{&reg;} to (R).
2592@c -------------------------
2593@cindex browser, @samp{lynx}
2594@cindex @samp{lynx}
2595@item @samp{lynx} 1
2596The @samp{lynx} browser requires an external program. It's quick and
2597produces pretty decent output but it doesn't show links. It doesn't
2598seem to do multi-column tables which makes output much cleaner. It
2599centers the output and wraps long lines more than most. Handles
2600@samp{&reg;}.
2601@c -------------------------
2602@item @samp{nil} 1
2603This choice obviously requires an external browser. Like
2604@samp{w3m-standalone}, it works out of the box. With this setting,
2605HTML messages have a button for the body part which you can view with
2606@kbd{K v} (@code{mh-folder-toggle-mime-part}).
2607@c -------------------------
2608@cindex browser, @samp{w3}
2609@cindex @samp{w3}
2610@item @samp{w3} 0
2611This choice does not require an external program as all of the
2612rendering is done in lisp. You do need to get the package separately.
2613This browser is @strong{slow}, and doesn't appear to have been updated
2614since 2001 and the author hasn't responded to my emails. It displays
2615unknown tags instead of hiding them, so you get to see all the
2616Microsoft crap in certain messages. Tends to make multi-column tables
2617wider than even a full-screen Emacs can handle. Like @samp{w3m}, you
2618can follow links, but you have to find them first as they are not
2619highlighted. Performs well on single-column tables and handles escapes
2620such as @samp{&reg;}.
2621@c -------------------------
2622@cindex browser, @samp{html2text}
2623@cindex @samp{html2text}
2624@item @samp{html2text} 0
2625The @samp{html2text} browser requires an external program. I noticed
2626that it can do some nasty things with simple HTML mails (like filling
2627the entire message as if it were one paragraph, including signature).
2628On another message, it displayed half of the HTML tags for some
2629reason.
2630@end table
2631
2632@vindex mm-text-html-renderer
2633
2634For a couple more sources of information about
2635@code{mm-text-html-renderer},
2636@ifinfo
2637@xref{Display Customization,,,emacs-mime}, and the documentation for
2638the Gnus command @kbd{W h} (@pxref{Article Washing,,,gnus},).
2639@end ifinfo
2640@ifnotinfo
2641see section @uref{http://www.gnus.org/manual/emacs-mime_6.html,
2642Display Customization} in the @cite{The Emacs MIME Manual} and the
2643documentation for the Gnus command @kbd{W h} (see section
2644@uref{http://www.gnus.org/manual/gnus_99.html, Article Washing} in the
2645@cite{The Gnus Manual}).
2646@end ifnotinfo
2647
567b9191
BW
2648@cindex @file{.emacs}
2649@cindex files, @file{.emacs}
2650@findex browse-url-at-mouse
2651@kindex S-Mouse-2
2652
2653A useful key binding that you can add to to @file{~/.emacs} is the
2654following which displays an HTML link or textual URL in an external
2655browser when clicked with @kbd{S-mouse-2}. This binding works in any
2656buffer, including HTML buffers.
2657
2658@smalllisp
2659(global-set-key [S-mouse-2] 'browse-url-at-mouse)
2660@end smalllisp
2661
4009494e
GM
2662@node Digests, Reading PGP, HTML, Reading Mail
2663@section Digests
2664
2665@cindex digests
2666@findex mh-page-digest
2667@findex mh-page-digest-backwards
2668@kindex D @key{BS}
2669@kindex D @key{SPC}
2670@kindex @key{BS}
2671@kindex @key{SPC}
2672
2673A digest is a message that contains other messages. Special MH-E
2674commands let you read digests conveniently. You can use @key{SPC} and
2675@key{BS} to page through the digest as if it were a normal message,
2676but if you wish to skip to the next message in the digest, use
2677@kbd{D @key{SPC}} (@code{mh-page-digest}). To return to a previous message,
2678use @kbd{D @key{BS}} (@code{mh-page-digest-backwards}).
2679
2680@cindex @command{burst}
2681@cindex MH commands, @command{burst}
2682@cindex MH-Folder Show mode
2683@cindex modes, MH-Folder Show
2684@findex mh-burst-digest
2685@kindex d
2686@kindex D b
2687@kindex t
2688
2689Another handy command is @kbd{D b} (@code{mh-burst-digest}). This
2690command uses the MH command @command{burst}@footnote{See the section
2691@uref{@value{MH-BOOK-HOME}/burdig.html, Bursting Messages} in the MH
2692book.} to break out each message in the digest into its own message.
2693Using this command, you can quickly delete unwanted messages, like
2694this: Once the digest is split up, toggle out of MH-Folder Show mode
2695with @kbd{t} (@pxref{Folders}) so that the scan lines fill the screen
2696and messages aren't displayed. Then use @kbd{d} (@pxref{Reading Mail})
2697to quickly delete messages that you don't want to read (based on the
2698@samp{Subject:} header field). You can also burst the digest to reply
2699directly to the people who posted the messages in the digest. One
2700problem you may encounter is that the @samp{From:} header fields are
2701preceded with a @samp{>} so that your reply can't create the
2702@samp{To:} field correctly. In this case, you must correct the
2703@samp{To:} field yourself. This is described later (@pxref{Editing
2704Drafts}).
2705
2706@node Reading PGP, Printing, Digests, Reading Mail
2707@section Signed and Encrypted Messages
2708
2709@cindex GPG
2710@cindex GnuPG
2711@cindex Gnus
2712@cindex OpenPGP
2713@cindex PGP
2714@cindex RFC 3156
2715@cindex encrypted messages
2716@cindex security
2717@cindex signed messages
2718
2719You can read encrypted or signed PGP or GPG messages with
2720MH-E@footnote{This feature depends on post-5.10 versions of Gnus.
2721@cite{MIME Security with OpenPGP} is documented in
2722@uref{http://www.rfc-editor.org/rfc/rfc3156.txt, RFC 3156}. However,
2723MH-E can also decrypt old-style PGP messages that are not in MIME
2724format.}. This section assumes that you already have a good
2725understanding of GPG and have set up your keys appropriately.
2726
2727If someone sends you a signed message, here is what you'll see:
2728
2729@smallexample
2730@group
2731[[PGP Signed Part:Bill Wohler <wohler@@stop.mail-abuse.org>]]
2732This is a signed message.
2733
2734[[End of PGP Signed Part]]
2735@end group
2736@end smallexample
2737
2738@cindex keychain
2739@cindex key server
2740@cindex signed messages
2741
2742If the key for the given signature is not in your keychain, you'll be
2743given the opportunity to fetch the key from a key server and verify
2744the key. If the message is really large, the verification process can
2745take a long time. You can press @kbd{C-g} at any time to
2746cancel@footnote{Unfortunately in the current version, the validation
2747process doesn't display a message so it appears that MH-E has hung. We
2748hope that this will be fixed in the future.}.
2749
2750If the signature doesn't check out, you might see something like this:
2751
2752@smallexample
2753@group
2754[[PGP Signed Part:Failed]]
2755This is a signed message.
2756This is garbage added after the signature was made.
2757
2758[[End of PGP Signed Part]]
2759@end group
2760@end smallexample
2761
2762@cindex decrypting messages
2763
2764If someone sends you an encrypted message, MH-E will ask for your
2765passphrase to decrypt the message. You should see something like this:
2766
2767@smallexample
2768@group
2769[[PGP Encrypted Part:OK]]
2770
2771[[PGP Signed Part:Bill Wohler <wohler@@stop.mail-abuse.org>]]
2772This is the secret message.
2773
2774[[End of PGP Signed Part]]
2775
2776[[End of PGP Encrypted Part]]
2777@end group
2778@end smallexample
2779
2780If there is a problem decrypting the message, the button will say:
2781
2782@smallexample
2783[[PGP Encrypted Part:Failed]]
2784@end smallexample
2785
2786You can read the contents of this button using the methods described in
2787@ref{Viewing Attachments}. If the message were corrupted, you'd see
2788this:
2789
2790@smallexample
2791[[PGP Encrypted Part:Failed]
2792Invalid base64 data]
2793@end smallexample
2794
2795If your passphrase were incorrect, you'd see something like this:
2796
2797@smallexample
2798[GNUPG:] ENC_TO CD9C88BB610BD9AD 1 0
2799[GNUPG:] USERID_HINT CD9C88BB610BD9AD Bill Wohler <wohler@@stop.mail-abuse.org>
2800[GNUPG:] NEED_PASSPHRASE CD9C88BB610BD9AD CD9C88BB610BD9AD 1 0
2801[GNUPG:] BAD_PASSPHRASE CD9C88BB610BD9AD
2802gpg: encrypted with 1024-bit RSA key, ID 610BD9AD, created 1997-09-09
2803 "Bill Wohler <wohler@@stop.mail-abuse.org>"
2804gpg: public key decryption failed: bad passphrase
2805[GNUPG:] BEGIN_DECRYPTION
2806[GNUPG:] DECRYPTION_FAILED
2807gpg: decryption failed: secret key not available
2808[GNUPG:] END_DECRYPTION
2809
2810gpg exited abnormally: '2'
2811@end smallexample
2812
2813@vindex mh-show-pgg-bad
2814@vindex mh-show-pgg-good
2815@vindex mh-show-pgg-unknown
2816
2817The appearance of the buttons is controlled by the faces
2818@code{mh-show-pgg-good}, @code{mh-show-pgg-bad}, and
2819@code{mh-show-pgg-unknown} depending on the validity of the signature.
2820The latter is used whether the signature is unknown or untrusted.
2821
2822@cindex @samp{pgg} customization group
2823@cindex PGG
2824@cindex customization group, @samp{pgg}
2825
2826The @samp{pgg} customization group may have some settings which may
2827interest you.
2828@iftex
2829See @cite{The PGG Manual}.
2830@end iftex
2831@ifinfo
2832@xref{Top, , The PGG Manual, pgg, The PGG Manual}.
2833@end ifinfo
2834@ifhtml
2835See
2836@uref{http://www.dk.xemacs.org/Documentation/packages/html/pgg.html,
2837@cite{The PGG Manual}}.
2838@end ifhtml
2839
2840@node Printing, Files and Pipes, Reading PGP, Reading Mail
2841@section Printing Your Mail
2842
2843@cindex printing
2844@findex mh-ps-print-msg
2845@findex mh-ps-print-msg-file
2846@kindex P f
2847@kindex P p
2848@vindex mh-lpr-command-format
2849@vindex mh-print-background-flag
2850
2851To print messages in MH-E, use the command @kbd{P p}
2852(@code{mh-ps-print-msg}). You can print all the messages in a range
2853(as in @kbd{C-u P p 1 3 5-7 last:5 frombob @key{RET}},
2854@pxref{Ranges}). You can also send the output to a file with @kbd{P f}
2855(@code{mh-ps-print-msg-file}). This command will print inline text
2856attachments but will not decrypt messages. However, when a message is
2857displayed in an MH-Show buffer, then that buffer is used verbatim for
2858printing with the caveat that only text attachments, if opened inline,
2859are printed. Therefore, encrypted messages can be printed by showing
2860and decrypting them first. The commands @kbd{P p} and @kbd{P f} do not
2861use the options @code{mh-lpr-command-format} or
2862@code{mh-print-background-flag}, described below.
2863
2864@findex mh-ps-print-toggle-color
2865@kindex P C
2866@vindex ps-print-color-p
2867
2868Colors are emulated on black-and-white printers with shades of gray.
2869This might produce illegible output, even if your screen colors only
2870use shades of gray. If this is the case, try using the command @kbd{P
2871C} (@code{mh-ps-print-toggle-color}) to toggle between color, no
2872color, and a black and white representation of the colors and see
2873which works best. You change this setting permanently by customizing
2874the option @code{ps-print-color-p}.
2875
2876@findex mh-ps-print-toggle-faces
2877@kindex P F
2878
2879Another related function is the command @kbd{P F}
2880(@code{mh-ps-print-toggle-faces}). This command toggles between using
2881faces and not. When faces are enabled, the printed message will look
2882very similar to the message in the MH-Show buffer.
2883
2884@cindex ps-print package
2885@cindex Emacs, packages, ps-print
2886
2887MH-E uses the @samp{ps-print} package to do the printing, so you can
2888customize the printing further by going to the @samp{ps-print}
2889customization group.
2890
2891@cindex @command{lpr}
2892@cindex @command{mhl}
2893@cindex MH commands, @command{mhl}
2894@cindex Unix commands, @command{lpr}
2895@findex mh-print-msg
2896@kindex P l
2897
2898An alternative to using the @samp{ps-print} package is the command
2899@kbd{P l} (@code{mh-print-msg}) (the @i{l} is for @i{l}ine printer or
2900@i{l}pr). You can print all the messages in a range. The message is
2901formatted with @command{mhl}@footnote{See the section
2902@uref{@value{MH-BOOK-HOME}/shomes.html#Usisho, Using mhl} in the MH
2903book.} and printed with the @command{lpr} command.
2904
2905@kindex P f
2906@kindex P l
2907@kindex P p
2908@vindex mh-lpr-command-format
2909@vindex mh-print-background-flag
2910
2911The command @kbd{P l} uses two options. The option
2912@code{mh-lpr-command-format} contains the Unix command line which
2913performs the actual printing. The string can contain one escape,
2914@samp{%s}, which is replaced by the name of the folder and the message
2915number and is useful for print job names. The default setting is
2916@code{"lpr -J '%s'"}. I use @code{"mpage -h'%s' -b Letter -H1of -mlrtb
2917-P"} which produces a nice header and adds a bit of margin so the text
2918fits within my printer's margins. Normally messages are printed in the
2919foreground. If this is slow on your system, you may elect to turn on
2920the option @code{mh-print-background-flag} to print in the background.
2921If you do this, do not delete the message until it is printed or else
2922the output may be truncated. These options are not used by the
2923commands @kbd{P p} or @kbd{P f}.
2924
2925@node Files and Pipes, Navigating, Printing, Reading Mail
2926@section Files and Pipes
2927
2928@cindex files
2929@cindex pipes
2930@findex mh-refile-or-write-again
2931@findex mh-write-msg-to-file
2932@kindex >
2933@kindex !
2934
2935MH-E does offer a couple of commands that are not a part of MH@. The
2936first one, @kbd{>} (@code{mh-write-msg-to-file}), writes a message to
2937a file. You are prompted for the filename. If the file already exists,
2938the message is appended to it. You can also write the message to the
2939file without the header by specifying a prefix argument (such as
2940@kbd{C-u > /tmp/foobar @key{RET}}). Subsequent writes to the same file
2941can be made with the command @kbd{!}
2942(@code{mh-refile-or-write-again}).
2943
2944@findex mh-pipe-msg
2945@kindex |
2946@kindex l
2947
2948You can also pipe the message through a Unix shell command with the
2949command @kbd{|} (@code{mh-pipe-msg}). You are prompted for the Unix
2950command through which you wish to run your message. If you give a
2951prefix argument to this command, the message header is included in the
2952text passed to the command (the contrived example @kbd{C-u | lpr}
2953would be done with the @kbd{l} command instead).
2954
2955@cindex @command{shar}
2956@cindex @command{uuencode}
2957@cindex Unix commands, @command{shar}
2958@cindex Unix commands, @command{uuencode}
2959@findex mh-store-msg
2960@kindex X s
2961@vindex mh-store-default-directory
2962
2963If the message is a shell archive @command{shar} or has been run
2964through @command{uuencode} use @kbd{X s} (@code{mh-store-msg}) to
2965extract the body of the message. The default directory for extraction
2966is the current directory; however, you have a chance to specify a
2967different extraction directory. The next time you use this command,
2968the default directory is the last directory you used. If you would
2969like to change the initial default directory, customize the option
2970@code{mh-store-default-directory}, change the value from
2971@samp{Current} to @samp{Directory}, and then enter the name of the
2972directory for storing the content of these messages.
2973
2974@findex mh-store-buffer
2975@kindex @key{RET}
2976@kindex X s
2977
2978By the way, @kbd{X s} calls the Emacs Lisp function
2979@code{mh-store-buffer}. I mention this because you can use it directly
2980if you're editing a buffer that contains a file that has been run
2981through @command{uuencode} or @command{shar}. For example, you can
2982extract the contents of the current buffer in your home directory by
2983typing @kbd{M-x mh-store-buffer @key{RET} ~ @key{RET}}.
2984
2985@node Navigating, Miscellaneous Commands and Options, Files and Pipes, Reading Mail
2986@section Navigating
2987
2988@cindex moving between messages
2989@cindex navigation
2990@findex mh-first-msg
2991@findex mh-goto-msg
2992@findex mh-last-msg
2993@findex mh-next-undeleted-msg
2994@findex mh-next-unread-msg
2995@findex mh-previous-undeleted-msg
2996@findex mh-previous-unread-msg
2997@kindex g
2998@kindex M-<
2999@kindex M->
3000@kindex M-n
3001@kindex M-p
3002@kindex n
3003@kindex p
3004
3005To move on to the next message, use the command @kbd{n}
3006(@code{mh-next-undeleted-msg}); use @kbd{p}
3007(@code{mh-previous-undeleted-msg}) to read the previous message. To
3008move to the next unread message, use @kbd{M-n}
3009(@code{mh-next-unread-msg}); use @kbd{M-p}
3010(@code{mh-previous-unread-msg}) to move to the previous unread
3011message. These commands can be given a prefix argument to specify how
3012many messages to skip (for example, @kbd{5 n}). You can also move to a
3013specific message with @kbd{g} (@code{mh-goto-msg}). You can enter the
3014message number either before or after typing @kbd{g}. In the latter
3015case, Emacs prompts you. Finally, you can go to the first or last
3016message with @kbd{M-<} (@code{mh-first-msg}) and @kbd{M->}
3017(@code{mh-last-msg}) respectively.
3018
3019@cindex MH-Folder mode
3020@cindex modes, MH-Folder
3021@findex next-line
3022@findex previous-line
3023@kindex C-n
3024@kindex C-p
3025@kindex @key{RET}
3026
3027You can also use the Emacs commands @kbd{C-p} (@code{previous-line})
3028and @kbd{C-n} (@code{next-line}) to move up and down the scan lines in
3029the MH-Folder window. These commands can be used in conjunction with
3030@key{RET} to look at deleted or refiled messages.
3031
3032@cindex deleting messages
3033@findex mh-delete-msg
3034@kindex d
3035@kindex n
3036@kindex p
3037
3038To mark a message for deletion, use the command @kbd{d}
3039(@code{mh-delete-msg}). A @samp{D} is placed by the message in the
3040scan window, and the next undeleted message is displayed. If the
3041previous command had been @kbd{p}, then the next message displayed is
3042the first undeleted message previous to the message just deleted. Use
3043@kbd{n} to force subsequent @kbd{d} commands to move forward to the
3044next undeleted message after deleting the message under the cursor.
3045You may also specify a range (for example, @kbd{C-u d 1 3 5-7 last:5
3046frombob @key{RET}}, @pxref{Ranges}).
3047
3048@findex mh-delete-msg-no-motion
3049@kindex C-d
3050
3051The command @kbd{C-d} (@code{mh-delete-msg-no-motion}) marks the
3052message (or messages in range) for deletion but leaves the cursor at
3053the current message in case you wish to perform other operations on
3054the message.
3055
3056@findex mh-delete-subject
3057@findex mh-delete-subject-or-thread
3058@findex mh-thread-delete
3059@findex mh-undo
3060@kindex k
3061@kindex T d
3062@kindex u
3063
3064And to delete more messages faster, you can use @kbd{k}
3065(@code{mh-delete-subject-or-thread}) to delete all the messages with
3066the same subject as the current message. This command puts these
3067messages in a sequence named @samp{subject}. You can undo this action
3068by using @kbd{u} (@code{mh-undo}) with a prefix argument and then
3069specifying the @samp{subject} sequence. However, if the buffer is
3070displaying a threaded view of the folder then @kbd{k} behaves like
3071@kbd{T d} (@code{mh-thread-delete}). @xref{Threading}.
3072
3073@findex mh-execute-commands
3074@kindex x
3075
3076However you mark a message for deletion, the command @kbd{x}
3077(@code{mh-execute-commands}) actually carries out the deletion
3078(@pxref{Folders}).
3079
3080@vindex mh-delete-msg-hook
3081
3082The hook @code{mh-delete-msg-hook} is called after you mark a message
3083for deletion. For example, a past maintainer of MH-E used this once
3084when he kept statistics on his mail usage.
3085
3086@node Miscellaneous Commands and Options, , Navigating, Reading Mail
3087@section Miscellaneous Commands and Options
3088
3089This section contains a few more miscellaneous commands and options.
3090
3091@cindex editing message
3092@findex mh-modify
3093@kindex M
3094
3095There are times when you need to edit a message. For example, you may
3096need to fix a broken Content-Type header field. You can do this with
3097the command @kbd{M} (@code{mh-modify}). It displays the raw message in
3098an editable buffer. When you are done editing, save and kill the
3099buffer as you would any other.
3100
3101@findex mh-kill-folder
3102@findex mh-pack-folder
3103@vindex mh-do-not-confirm-flag
3104
3105Commands such as @code{mh-pack-folder} prompt to confirm whether to
3106process outstanding moves and deletes or not before continuing.
3107Turning on the option @code{mh-do-not-confirm-flag} means that these
3108actions will be performed---which is usually desired but cannot be
3109retracted---without question@footnote{In previous versions of MH-E,
3110this option suppressed the confirmation in @code{mh-kill-folder}.
3111Since this kept most users from setting this option,
3112@code{mh-kill-folder} was modified in version 6.0 to always ask for
3113confirmation subject to @code{mh-kill-folder-suppress-prompt-hook}.
3114@xref{Folders}.}.
3115
3116@cindex MH-Folder mode
3117@cindex modes, MH-Folder
3118@vindex mh-summary-height
3119
3120The option @code{mh-summary-height} controls the number of scan lines
3121displayed in the MH-Folder window, including the mode line. The
3122default value of this option is @samp{Automatic} which means that the
3123MH-Folder buffer will maintain the same proportional size if the frame
3124is resized. If you'd prefer a fixed height, then choose the
3125@samp{Fixed Size} option and enter the number of lines you'd like to
3126see.
3127
3128@vindex mh-bury-show-buffer-flag
3129
3130Normally the buffer for displaying messages is buried at the bottom at
3131the buffer stack. You may wish to disable this feature by turning off
3132the option @code{mh-bury-show-buffer-flag}. One advantage of not
3133burying the show buffer is that one can delete the show buffer more
3134easily in an electric buffer list because of its proximity to its
3135associated MH-Folder buffer. Try running @kbd{M-x
3136electric-buffer-list} to see what I mean.
3137
3138@cindex @file{.emacs}
3139@cindex files, @file{.emacs}
3140@cindex reading mail
3141
3142Before we leave this section, I'll include a function that I use as a
3143front end to MH-E@footnote{Stephen Gildea's favorite binding is
3144@kbd{(global-set-key "\C-cr" 'mh-rmail)}.}. It toggles between your
3145working window configuration, which may be quite involved---windows
3146filled with source, compilation output, man pages, and other
3147documentation---and your MH-E window configuration. Like the rest of
3148the customization described in this section, simply add the following
3149code to @file{~/.emacs}.
3150
3151@iftex
3152@filbreak
3153@end iftex
3154
3155@findex mh-rmail, example
3156
3157@smalllisp
3158@group
3159(defvar my-mh-screen-saved nil
3160 "Set to non-@code{nil} when MH-E window configuration shown.")
3161(defvar my-normal-screen nil "Normal window configuration.")
3162(defvar my-mh-screen nil "MH-E window configuration.")
3163
3164(defun my-mh-rmail (&optional arg)
3165 "Toggle between MH-E and normal screen configurations.
3166With non-@code{nil} or prefix argument, @i{inc} mailbox as well
3167when going into mail."
3168 (interactive "P") ; @r{user callable function, P=prefix arg}
3169 (setq my-mh-screen-saved ; @r{save state}
3170 (cond
3171 ;; @r{Bring up MH-E screen if arg or normal window configuration.}
3172 ;; @r{If arg or +inbox buffer doesn't exist, run mh-rmail.}
3173 ((or arg (null my-mh-screen-saved))
3174 (setq my-normal-screen (current-window-configuration))
3175 (if (or arg (null (get-buffer "+inbox")))
3176 (mh-rmail)
3177 (set-window-configuration my-mh-screen))
3178 t) ; @r{set my-mh-screen-saved to @code{t}}
3179 ;; @r{Otherwise, save MH-E screen and restore normal screen.}
3180 (t
3181 (setq my-mh-screen (current-window-configuration))
3182 (set-window-configuration my-normal-screen)
3183 nil)))) ; @r{set my-mh-screen-saved to nil}
3184
3185(global-set-key "\C-x\r" 'my-mh-rmail) ;@r{ call with C-x @key{RET}}
3186
3187@i{Starting MH-E}
3188
3189@end group
3190@end smalllisp
3191
3192If you type an argument (@kbd{C-u}) or if @code{my-mh-screen-saved} is
3193@code{nil} (meaning a non-MH-E window configuration), the current
3194window configuration is saved, either the @samp{+inbox} buffer is
3195displayed or @code{mh-rmail} is run, and the MH-E window configuration
3196is shown. Otherwise, the MH-E window configuration is saved and the
3197original configuration is displayed.
3198
3199@node Folders, Sending Mail, Reading Mail, Top
3200@chapter Organizing Your Mail with Folders
3201
3202@cindex @samp{Folder} menu
3203@cindex @samp{Message} menu
3204@cindex folders
3205@cindex menu, @samp{Folder}
3206@cindex menu, @samp{Message}
3207@cindex using folders
3208
3209This chapter discusses the things you can do with folders within MH-E.
3210The commands in this chapter are also found in the @samp{Folder} and
3211@samp{Message} menus.
3212
3213@table @kbd
3214@kindex ?
3215@findex mh-help
3216@item ?
3217Display cheat sheet for the MH-E commands (@code{mh-help}).
3218@c -------------------------
3219@kindex !
3220@findex mh-refile-or-write-again
3221@item !
3222Repeat last output command (@code{mh-refile-or-write-again}).
3223@c -------------------------
3224@cindex @samp{Message > Copy Message to Folder...} menu item
3225@cindex menu item, @samp{Message > Copy Message to Folder...}
3226@kindex c
3227@findex mh-copy-msg
3228@item c
3229Copy range to folder (@code{mh-copy-msg}).
3230@c -------------------------
3231@kindex F ?
3232@findex mh-prefix-help
3233@item F ?
3234Display cheat sheet for the commands of the current prefix in
3235minibuffer (@code{mh-prefix-help}).
3236@c -------------------------
3237@kindex F '
3238@findex mh-index-ticked-messages
3239@item F '
3240Display ticked messages (@code{mh-index-ticked-messages}).
3241@c -------------------------
3242@kindex F c
3243@findex mh-catchup
3244@item F c
3245Delete range from the @samp{unseen} sequence (@code{mh-catchup}).
3246@c -------------------------
3247@kindex F k
3248@findex mh-kill-folder
3249@item F k
3250Remove folder (@code{mh-kill-folder}).
3251@c -------------------------
3252@cindex @samp{Folder > List Folders} menu item
3253@cindex menu item, @samp{Folder > List Folders}
3254@kindex F l
3255@findex mh-list-folders
3256@item F l
3257List all folders (@code{mh-list-folders}).
3258@c -------------------------
3259@cindex @samp{Folder > View New Messages} menu item
3260@cindex menu item, @samp{Folder > View New Messages}
3261@kindex F n
3262@findex mh-index-new-messages
3263@item F n
3264Display unseen messages (@code{mh-index-new-messages}).
3265@c -------------------------
3266@cindex @samp{Folder > Pack Folder} menu item
3267@cindex menu item, @samp{Folder > Pack Folder}
3268@kindex F p
3269@findex mh-pack-folder
3270@item F p
3271Pack folder (@code{mh-pack-folder}).
3272@c -------------------------
3273@kindex F q
3274@findex mh-index-sequenced-messages
3275@item F q
3276Display messages in any sequence (@code{mh-index-sequenced-messages}).
3277@c -------------------------
3278@cindex @samp{Folder > Rescan Folder} menu item
3279@cindex menu item, @samp{Folder > Rescan Folder}
3280@kindex F r
3281@findex mh-rescan-folder
3282@item F r
3283Rescan folder (@code{mh-rescan-folder}).
3284@c -------------------------
3285@cindex @samp{Folder > Search...} menu item
3286@cindex menu item, @samp{Folder > Search...}
3287@kindex F s
3288@findex mh-search
3289@item F s
3290Search your MH mail (@code{mh-search}).
3291@c -------------------------
3292@cindex @samp{Folder > Sort Folder} menu item
3293@cindex menu item, @samp{Folder > Sort Folder}
3294@kindex F S
3295@findex mh-sort-folder
3296@item F S
3297Sort folder (@code{mh-sort-folder}).
3298@c -------------------------
3299@kindex F u
3300@findex mh-undo-folder
3301@item F u
3302Undo all refiles and deletes in the current folder (@code{mh-undo-folder}).
3303@c -------------------------
3304@cindex @samp{Folder > Visit a Folder...} menu item
3305@cindex menu item, @samp{Folder > Visit a Folder...}
3306@kindex F v
3307@findex mh-visit-folder
3308@item F v
3309Visit folder (@code{mh-visit-folder}).
3310@c -------------------------
3311@cindex @samp{Message > Refile Message} menu item
3312@cindex menu item, @samp{Message > Refile Message}
3313@kindex o
3314@findex mh-refile-msg
3315@item o
3316Refile (output) range into folder (@code{mh-refile-msg}).
3317@c -------------------------
3318@cindex @samp{Folder > Quit MH-E} menu item
3319@cindex menu item, @samp{Folder > Quit MH-E}
3320@kindex q
3321@findex mh-quit
3322@item q
3323Quit the current MH-E folder (@code{mh-quit}).
3324@c -------------------------
3325@cindex @samp{Folder > Toggle Show/Folder} menu item
3326@cindex menu item, @samp{Folder > Toggle Show/Folder}
3327@kindex t
3328@findex mh-toggle-showing
3329@item t
3330Toggle between MH-Folder and MH-Folder Show modes
3331(@code{mh-toggle-showing}).
3332@c -------------------------
3333@cindex @samp{Message > Undo Delete/Refile} menu item
3334@cindex menu item, @samp{Message > Undo Delete/Refile}
3335@kindex u
3336@findex mh-undo
3337@item u
3338Undo pending deletes or refiles in range (@code{mh-undo}).
3339@c -------------------------
3340@cindex @samp{Message > Execute Delete/Refile} menu item
3341@cindex menu item, @samp{Message > Execute Delete/Refile}
3342@kindex x
3343@findex mh-execute-commands
3344@item x
3345Process outstanding delete and refile requests
3346(@code{mh-execute-commands}).
3347@end table
3348
3349@cindex @samp{mh-folder} customization group
3350@cindex customization group, @samp{mh-folder}
3351
3352The @samp{mh-folder} customization group is used to tune these
3353commands.
3354
3355@vtable @code
3356@item mh-new-messages-folders
3357Folders searched for the @samp{unseen} sequence (default:
3358@code{Inbox}).
3359@c -------------------------
3360@item mh-ticked-messages-folders
3361Folders searched for @code{mh-tick-seq} (default: @code{t}).
3362@c -------------------------
3363@item mh-large-folder
3364The number of messages that indicates a large folder (default: 200).
3365@c -------------------------
3366@item mh-recenter-summary-flag
3367On means to recenter the summary window (default: @samp{off}).
3368@c -------------------------
3369@item mh-recursive-folders-flag
3370On means that commands which operate on folders do so recursively
3371(default: @samp{off}).
3372@c -------------------------
3373@item mh-sortm-args
3374Additional arguments for @command{sortm} (default: @code{nil}).
3375@end vtable
3376
3377The following hooks are available.
3378
3379@vtable @code
3380@item mh-after-commands-processed-hook
3381Hook run by @kbd{x} after performing outstanding refile and delete
3382requests (default: @code{nil}).
3383@c -------------------------
3384@item mh-before-commands-processed-hook
3385Hook run by @kbd{x} before performing outstanding refile and delete
3386requests (default: @code{nil}).
3387@c -------------------------
3388@item mh-before-quit-hook
3389Hook run by q before quitting MH-E (default: @code{nil}).
3390@c -------------------------
3391@item mh-folder-mode-hook
3392Hook run by @code{mh-folder-mode} when visiting a new folder (default:
3393@code{nil}).
3394@c -------------------------
3395@item mh-kill-folder-suppress-prompt-hook
3396Abnormal hook run at the beginning of @code{mh-kill-folder} (default:
3397@code{'mh-search-p}).
3398@c -------------------------
3399@item mh-quit-hook
3400Hook run by q after quitting MH-E (default: @code{nil}).
3401@c -------------------------
3402@item mh-refile-msg-hook
3403Hook run by o after marking each message for refiling (default:
3404@code{nil}).
3405@end vtable
3406
3407The following faces are available for customizing the appearance of
3408the MH-Folder buffer. @xref{Scan Line Formats}.
3409
3410@vtable @code
3411@item mh-folder-address
3412Recipient face.
3413@c -------------------------
3414@item mh-folder-body
3415Body text face.
3416@c -------------------------
3417@item mh-folder-cur-msg-number
3418Current message number face.
3419@c -------------------------
3420@item mh-folder-date
3421Date face.
3422@c -------------------------
3423@item mh-folder-deleted
3424Deleted message face.
3425@c -------------------------
3426@item mh-folder-followup
3427@samp{Re:} face.
3428@c -------------------------
3429@item mh-folder-msg-number
3430Message number face.
3431@c -------------------------
3432@item mh-folder-refiled
3433Refiled message face.
3434@c -------------------------
3435@vindex mh-scan-format-nmh
3436@vindex mh-scan-sent-to-me-sender-regexp
3437@item mh-folder-sent-to-me-hint
3438Fontification hint face in messages sent directly to us. The detection
3439of messages sent to us is governed by the scan format
3440@code{mh-scan-format-nmh} and regular expression
3441@code{mh-scan-sent-to-me-sender-regexp}.
3442@c -------------------------
3443@vindex mh-scan-format-nmh
3444@vindex mh-scan-sent-to-me-sender-regexp
3445@item mh-folder-scan-format
3446Sender face in messages sent directly to us. The detection of messages
3447sent to us is governed by the scan format @code{mh-scan-format-nmh}
3448and regular expression @code{mh-scan-sent-to-me-sender-regexp}.
3449@c -------------------------
3450@item mh-folder-subject
3451Subject face.
3452@c -------------------------
3453@item mh-folder-tick
3454Ticked message face.
3455@c -------------------------
3456@item mh-folder-to
3457@samp{To:} face.
3458@end vtable
3459
3460@vindex mh-folder-mode-hook
3461
3462The hook @code{mh-folder-mode-hook} is called when visiting a new
3463folder in MH-Folder mode. This could be used to set your own key
3464bindings, for example:
3465
3466@vindex mh-folder-mode-hook, example
3467
3468@smalllisp
3469@group
3470(defvar my-mh-init-done nil
3471 "Non-@code{nil} when one-time MH-E settings made.")
3472
3473(defun my-mh-folder-mode-hook ()
3474 "Hook to set key bindings in MH-Folder mode."
3475 (if (not my-mh-init-done) ; @r{only need to bind the keys once }
3476 (progn
3477 (local-set-key "//" 'my-search-msg)
3478 (local-set-key "b" 'mh-burst-digest) ; @r{better use of @kbd{b}}
3479 (setq my-mh-init-done t))))
3480
3481(add-hook 'mh-folder-mode-hook 'my-mh-folder-mode-hook)
3482
3483(defun my-search-msg ()
3484 "Search for a regexp in the current message."
3485 (interactive) ; @r{user function}
3486 (save-window-excursion
3487 (other-window 1) ; @r{go to next window}
3488 (isearch-forward-regexp))) ; @r{string search; hit return}
3489 ; @r{ when done}
3490
3491@i{Create additional key bindings via mh-folder-mode-hook}
3492
3493@end group
3494@end smalllisp
3495
3496@cindex @command{folder}
3497@cindex @command{refile}
3498@cindex MH commands, @command{folder}
3499@cindex MH commands, @command{refile}
3500@findex mh-refile-msg
3501@kindex o
3502@vindex mh-refile-msg-hook
3503
3504MH-E has analogies for each of the MH @command{folder} and
3505@command{refile} commands@footnote{See the sections
3506@uref{@value{MH-BOOK-HOME}/fol.html#Youfol, Your Current Folder:
3507folder} and @uref{@value{MH-BOOK-HOME}/fol.html#Movref, Moving and
3508Linking Messages: refile} in the MH book.}. To refile a message in
3509another folder, use the command @kbd{o} (@code{mh-refile-msg})
3510(mnemonic: ``output''). You are prompted for the folder name
3511(@pxref{Folder Selection}). Note that this command can also be used to
3512create folders. If you specify a folder that does not exist, you will
3513be prompted to create it. The hook @code{mh-refile-msg-hook} is called
3514after a message is marked to be refiled.
3515
3516@findex mh-write-msg-to-file
3517@kindex !
3518
3519If you are refiling several messages into the same folder, you can use
3520the command @kbd{!} (@code{mh-refile-or-write-again}) to repeat the
3521last refile or write (for the description of @kbd{>}
3522(@code{mh-write-msg-to-file}), @pxref{Files and Pipes}). You can use a
3523range in either case (for example, @kbd{C-u o 1 3 5-7 last:5 frombob
3524@key{RET}}, @pxref{Ranges}).
3525
3526@cindex expunging refiles and deletes
3527@cindex undoing refiles and deletes
3528@findex mh-undo
3529@kindex u
3530
3531If you've deleted a message or refiled it, but changed your mind, you
3532can cancel the action before you've executed it. Use @kbd{u}
3533(@code{mh-undo}) to undo a refile on or deletion of a single message.
3534You can also undo refiles and deletes for messages that are found in a
3535given range (@pxref{Ranges}).
3536
3537@findex mh-undo-folder
3538@kindex F u
3539
3540Alternatively, you can use @kbd{F u} (@code{mh-undo-folder}) to undo
3541all refiles and deletes in the current folder.
3542
3543@findex mh-execute-commands
3544@kindex x
3545
3546If you've marked messages to be deleted or refiled and you want to go
3547ahead and delete or refile the messages, use @kbd{x}
3548(@code{mh-execute-commands}). Many MH-E commands that may affect the
3549numbering of the messages (such as @kbd{F r} or @kbd{F p}) will ask if
3550you want to process refiles or deletes first and then either run
3551@kbd{x} for you or undo the pending refiles and deletes.
3552
3553@kindex x
3554@vindex mh-after-commands-processed-hook
3555@vindex mh-before-commands-processed-hook
bfe16263 3556@vindex mh-current-folder
4009494e
GM
3557
3558The command @kbd{x} runs @code{mh-before-commands-processed-hook}
3559before the commands are processed and
3560@code{mh-after-commands-processed-hook} after the commands are
3561processed. Variables that are useful with the former hook include
3562@code{mh-delete-list} and @code{mh-refile-list} which can be used to
3563see which changes will be made to the current folder,
3564@code{mh-current-folder}. Variables that are useful with the latter
3565hook include @code{mh-folders-changed}, which lists which folders were
3566affected by deletes and refiles. This list will always include the
3567current folder @code{mh-current-folder}.
3568
3569@findex mh-copy-msg
3570@kindex c
3571@kindex o
3572
3573If you wish to copy a message to another folder, you can use the
3574command @kbd{c} (@code{mh-copy-msg}) (see the @option{-link} argument
3575to @command{refile}(1)). Like the command @kbd{o}, this command
3576prompts you for the name of the target folder and you can specify a
3577range (@pxref{Ranges}). Note that unlike the command @kbd{o}, the copy
3578takes place immediately. The original copy remains in the current
3579folder.
3580
3581@cindex junk mail
3582@cindex MH-Folder mode
3583@cindex MH-Folder Show mode
3584@cindex modes, MH-Folder
3585@cindex modes, MH-Folder Show
3586@cindex spam
3587@findex mh-toggle-showing
3588@kindex t
3589
3590The command @kbd{t} (@code{mh-toggle-showing}) switches between
3591MH-Folder mode and MH-Folder Show mode@footnote{For you Emacs wizards,
3592this is implemented as an Emacs minor mode.}. MH-Folder mode turns off
3593the associated show buffer so that you can perform operations on the
3594messages quickly without reading them. This is an excellent way to
3595prune out your junk mail or to refile a group of messages to another
3596folder for later examination.
3597
3598@cindex MH-Folder mode
3599@cindex MH-Show mode
3600@cindex modes, MH-Folder
3601@cindex modes, MH-Show
3602@cindex moving between messages
3603@kindex t
3604@vindex mh-recenter-summary-flag
3605
3606When you use @kbd{t} to toggle from MH-Folder Show mode to MH-Folder
3607mode, the MH-Show buffer is hidden and the MH-Folder buffer is left
3608alone. Setting @code{mh-recenter-summary-flag} to a non-@code{nil}
3609value causes the toggle to display as many scan lines as possible,
3610with the cursor at the middle. The effect of
3611@code{mh-recenter-summary-flag} is rather useful, but it can be
3612annoying on a slow network connection.
3613
3614@findex mh-visit-folder
3615@kindex F v
3616@vindex mh-large-folder
3617
3618When you want to read the messages that you have refiled into folders,
3619use the command @kbd{F v} (@code{mh-visit-folder}) to visit the
3620folder. You are prompted for the folder name. The folder buffer will
3621show just unseen messages if there are any; otherwise, it will show
3622all the messages in the buffer as long there are fewer than
3623@code{mh-large-folder} messages. If there are more, then you are
3624prompted for a range of messages to scan. You can provide a prefix
3625argument in order to specify a range of messages to show when you
3626visit the folder (@pxref{Ranges}). In this case, regions are not used
3627to specify the range and @code{mh-large-folder} is ignored. Note that
3628this command can also be used to create folders. If you specify a
3629folder that does not exist, you will be prompted to create it.
3630
3631@findex mh-search
3632@kindex F s
3633
3634If you forget where you've refiled your messages, you can find them
3635using @kbd{F s} (@code{mh-search}). @xref{Searching}.
3636
3637@cindex @command{procmail}
3638@cindex @samp{unseen} sequence
3639@cindex sequence, @samp{unseen}
3640@cindex Unix commands, @command{procmail}
3641@cindex unseen messages, viewing
3642@findex mh-index-new-messages
3643@kindex F n
3644@vindex mh-new-messages-folders
3645
3646If you use a program such as @command{procmail} to file your incoming
3647mail automatically, you can display new, unseen, messages using the
3648command @kbd{F n} (@code{mh-index-new-messages}). All messages in the
3649@samp{unseen} sequence from the folders in
3650@code{mh-new-messages-folders} are listed. However, this list of
3651folders can be overridden with a prefix argument: with a prefix
3652argument, enter a space-separated list of folders, or nothing to
3653search all folders.
3654
3655@cindex @samp{tick} sequence
3656@cindex sequence, @samp{tick}
3657@cindex ticked messages, viewing
3658@findex mh-index-ticked-messages
3659@kindex F '
3660@vindex mh-ticked-messages-folders
3661
3662If you have ticked messages (@pxref{Sequences}), you can display them
3663using the command @kbd{F '} (@code{mh-index-ticked-messages}). All
3664messages in the @samp{tick} sequence from the folders in
3665@code{mh-ticked-messages-folders} are listed. With a prefix argument,
3666enter a space-separated list of folders, or nothing to search all
3667folders.
3668
3669@findex mh-index-sequenced-messages
3670@kindex F q
3671@vindex mh-new-messages-folders
3672
3673You can display messages in any sequence with the command @kbd{F q}
3674(@code{mh-index-sequenced-messages}). All messages from the folders in
3675@code{mh-new-messages-folders} in the sequence you provide are listed.
3676With a prefix argument, enter a space-separated list of folders at the
3677prompt, or nothing to search all folders.
3678
3679@vindex mh-new-messages-folders
3680@vindex mh-recursive-folders-flag
3681@vindex mh-ticked-messages-folders
3682
3683Set the options @code{mh-new-messages-folders} and
3684@code{mh-ticked-messages-folders} to @samp{Inbox} to search the
3685@samp{+inbox} folder or @samp{All} to search all of the top level
3686folders. Otherwise, list the folders that should be searched with the
3687@samp{Choose Folders} menu item. See @code{mh-recursive-folders-flag}.
3688
3689@cindex buffers, @samp{*MH-E Folders*}
3690@cindex @samp{*MH-E Folders*}
3691@findex mh-kill-folder
3692@findex mh-list-folders
3693@findex mh-pack-folder
3694@findex mh-rescan-folder
3695@findex mh-sort-folder
3696@kindex F k
3697@kindex F l
3698@kindex F p
3699@kindex F r
3700@kindex F S
3701
3702Other commands you can perform on folders include: @kbd{F l}
3703(@code{mh-list-folders}), to place a listing of all the folders in
3704your mail directory in a buffer called @samp{*MH-E Folders*}
3705(@pxref{Miscellaneous}); @kbd{F k} (@code{mh-kill-folder}), to remove
3706a folder; @kbd{F S} (@code{mh-sort-folder}), to sort the messages by
3707date (see @command{sortm}(1) to see how to sort by other criteria);
3708@kbd{F p} (@code{mh-pack-folder}), to pack a folder, removing gaps
3709from the numbering sequence; and @kbd{F r} (@code{mh-rescan-folder}),
3710to rescan the folder, which is useful to grab all messages in your
3711@samp{+inbox} after processing your new mail for the first time. If
3712you don't want to rescan the entire folder, the commands @kbd{F r} or
3713@kbd{F p} will accept a range (@pxref{Ranges}).
3714
3715@kindex @key{TAB}
3716@vindex mh-recursive-folders-flag
3717
3718By default, operations on folders work only one level at a time. Set
3719@code{mh-recursive-folders-flag} to non-@code{nil} to operate on all
3720folders. This mostly means that you'll be able to see all your folders
3721when you press @key{TAB} when prompted for a folder name.
3722
3723@findex mh-search-p
3724@kindex k
3725@vindex mh-kill-folder-suppress-prompt-hooks
3726
3727The hook @code{mh-kill-folder-suppress-prompt-hooks} is an abnormal
3728hook run at the beginning of the command @kbd{k}. The hook functions
3729are called with no arguments and should return a non-nil value to
3730suppress the normal prompt when you remove a folder. This is useful
3731for folders that are easily regenerated. The default value of
3732@code{mh-search-p} suppresses the prompt on folders generated by
3733searching.
3734
3735@sp 1
3736@center @strong{NOTE}
3737
3738@quotation
3739Use this hook with care. If there is a bug in your hook which returns
3740@code{t} on @samp{+inbox} and you press @kbd{k} by accident in the
3741@code{+inbox} folder, you will not be happy.
3742@end quotation
3743@sp 1
3744
3745@cindex @command{sortm}
3746@cindex @file{.mh_profile}
3747@cindex files, @file{.mh_profile}
3748@cindex MH commands, @command{sortm}
3749@cindex MH profile component, @samp{sortm:}
3750@cindex @samp{sortm:} MH profile component
3751@kindex F S
3752@vindex mh-sortm-args
3753
3754The option @code{mh-sortm-args} holds extra arguments to pass on to
3755the command @command{sortm}@footnote{See the section
3756@uref{@value{MH-BOOK-HOME}/sorsor.html, Sorting Messages: sortm} in the
3757MH book.} when a prefix argument is used with @kbd{F S}. Normally
3758default arguments to @command{sortm} are specified in the MH profile.
3759This option may be used to provide an alternate view. For example,
3760@samp{'(\"-nolimit\" \"-textfield\" \"subject\")} is a useful setting.
3761
3762@cindex exiting
3763@cindex quitting
3764@findex mh-quit
3765@kindex q
3766
3767When you want to quit using MH-E and go back to editing, you can use
3768the @kbd{q} (@code{mh-quit}) command. This buries the buffers of the
3769current MH-E folder and restores the buffers that were present when
3770you first ran @kbd{M-x mh-rmail}. It also removes any MH-E working
3771buffers whose name begins with @samp{ *mh-} or @samp{*MH-E }
3772(@pxref{Miscellaneous}). You can later restore your MH-E session by
3773selecting the @samp{+inbox} buffer or by running @kbd{M-x mh-rmail}
3774again.
3775
3776@findex mh-execute-commands
3777@kindex q
3778@vindex mh-before-quit-hook
3779@vindex mh-before-quit-hook, example
3780@vindex mh-quit-hook
3781@vindex mh-quit-hook, example
3782
3783The two hooks @code{mh-before-quit-hook} and @code{mh-quit-hook} are
3784called by @kbd{q}. The former one is called before the quit occurs, so
3785you might use it to perform any MH-E operations; you could perform
3786some query and abort the quit or call @code{mh-execute-commands}, for
3787example. The latter is not run in an MH-E context, so you might use it
3788to modify the window setup. If you find that @kbd{q} buries a lot of
3789buffers that you would rather remove, you can use both
3790@code{mh-before-quit-hook} and @code{mh-quit-hook} to accomplish that.
3791
3792@smalllisp
3793@group
3794(defvar my-mh-folder-buffer-to-delete nil
3795 "Folder buffer that is being quit.")
3796
3797(defun my-mh-before-quit-hook ()
3798 "Save folder buffer that is to be deleted."
3799 (setq my-mh-folder-buffer-to-delete (current-buffer)))
3800
3801(defun my-mh-quit-hook ()
3802 "Kill folder buffer rather than just bury it."
3803 (set-buffer my-mh-folder-buffer-to-delete)
3804 (if (get-buffer mh-show-buffer)
3805 (kill-buffer mh-show-buffer))
3806 (kill-buffer (current-buffer)))
3807
3808@i{Kill MH-Folder buffer instead of burying it}
3809@end group
3810@end smalllisp
3811
3812@cindex folders, renaming
3813@cindex renaming folders
3814@findex dired
3815@findex dired-do-rename
3816
3817You can use dired to manipulate the folders themselves. For example, I
3818renamed my @samp{+out} folder to the more common @samp{+outbox} by
3819running dired on my mail directory (@kbd{M-x dired RET ~/Mail RET}),
3820moving my cursor to @samp{out} and using the command @kbd{R}
3821(@code{dired-do-rename}).
3822
3823@node Sending Mail, Editing Drafts, Folders, Top
3824@chapter Sending Mail
3825
3826@cindex sending mail
3827@findex mh-smail
3828@kindex M-x mh-smail
3829
3830You can send a mail message in several ways. You can call @kbd{M-x
3831mh-smail} directly, or from the command line like this:
3832
3833@cindex starting from command line
3834
3835@smallexample
3836$ @kbd{emacs -f mh-smail}
3837@end smallexample
3838
3839@findex goto-address-at-point
3840@vindex mail-user-agent
3841
3842There are some commands that need to send a mail message, such as
3843@code{goto-address-at-point}. You can configure Emacs to have these
3844commands use MH-E by setting the option @code{mail-user-agent} to
3845@samp{Emacs interface to MH}.
3846
3847@cindex @samp{Message} menu
3848@cindex menu, @samp{Message}
3849
3850From within MH-E's MH-Folder mode, other methods of sending mail are
3851available as well. These can also be found in the @samp{Message} menu.
3852
3853@table @kbd
3854@cindex @samp{Message > Edit Message Again} menu item
3855@cindex menu item, @samp{Message > Edit Message Again}
3856@kindex e
3857@findex mh-edit-again
3858@item e
3859Edit a message to send it again (@code{mh-edit-again}).
3860@c -------------------------
3861@cindex @samp{Message > Re-edit a Bounced Message} menu item
3862@cindex menu item, @samp{Message > Re-edit a Bounced Message}
3863@kindex E
3864@findex mh-extract-rejected-mail
3865@item E
3866Edit a message that was returned by the mail system
3867(@code{mh-extract-rejected-mail}).
3868@c -------------------------
3869@cindex @samp{Message > Forward Message...} menu item
3870@cindex menu item, @samp{Message > Forward Message...}
3871@kindex f
3872@findex mh-forward
3873@item f
3874Forward message (@code{mh-forward}).
3875@c -------------------------
3876@cindex @samp{Message > Reply to Message...} menu item
3877@cindex menu item, @samp{Message > Reply to Message...}
3878@kindex r
3879@findex mh-reply
3880@item r
3881Reply to a message (@code{mh-reply}).
3882@c -------------------------
3883@cindex @samp{Message > Compose a New Message} menu item
3884@cindex menu item, @samp{Message > Compose a New Message}
3885@kindex s
3886@findex mh-send
3887@item s
3888Compose a message (@code{mh-send}).
3889@c -------------------------
3890@cindex @samp{Message > Redistribute Message...} menu item
3891@cindex menu item, @samp{Message > Redistribute Message...}
3892@kindex M-d
3893@findex mh-redistribute
3894@item M-d
3895Redistribute a message (@code{mh-redistribute}).
3896@c -------------------------
3897@findex mh-smail
3898@item M-x mh-smail
3899Compose a message with the MH mail system.
3900@c -------------------------
3901@findex mh-smail-other-window
3902@item M-x mh-smail-other-window
3903Compose a message with the MH mail system in other window.
3904@end table
3905
3906@cindex @samp{mh-sending-mail} customization group
3907@cindex customization group, @samp{mh-sending-mail}
3908
3909In addition, several options from the @samp{mh-sending-mail}
3910customization group are useful when sending mail or replying to mail.
3911They are summarized in the following table.
3912
3913@vtable @code
3914@item mh-compose-forward-as-mime-flag
3915On means that messages are forwarded as attachments (default:
3916@samp{on}).
3917@c -------------------------
3918@item mh-compose-letter-function
3919Hook run when starting a new draft (default: @code{nil}).
3920@c -------------------------
3921@item mh-compose-prompt-flag
3922On means prompt for header fields when composing a new draft (default:
3923@samp{off}).
3924@c -------------------------
3925@item mh-forward-subject-format
3926Format string for forwarded message subject (default: @code{"%s:
3927%s"}).
3928@c -------------------------
3929@item mh-insert-x-mailer-flag
3930On means append an @samp{X-Mailer:} header field to the header
3931(default: @samp{on}).
3932@c -------------------------
3933@item mh-redist-full-contents-flag
3934On means the @command{dist} command needs entire letter for
3935redistribution (default: @samp{off}).
3936@c -------------------------
3937@item mh-reply-default-reply-to
3938Sets the person or persons to whom a reply will be sent (default:
3939@samp{Prompt}).
3940@c -------------------------
3941@item mh-reply-show-message-flag
3942On means the MH-Show buffer is displayed using @kbd{r}
3943(@code{mh-reply}) (default: @samp{on}).
3944@end vtable
3945
3946The following hooks are available.
3947
3948@vtable @code
bfe16263
BW
3949@item mh-annotate-msg-hook
3950Hook run by @code{mh-annotate-msg} after annotation (default:
3951@code{nil}).
3952@c -------------------------
4009494e
GM
3953@item mh-forward-hook
3954Hook run by @code{mh-forward} on a forwarded letter (default:
3955@code{nil}).
3956@c -------------------------
3957@item mh-letter-mode-hook
3958Hook run by @code{mh-letter-mode} on a new letter (default:
3959@code{nil}).
3960@end vtable
3961
bfe16263
BW
3962@findex mh-annotate-msg
3963@vindex mh-annotate-list
3964@vindex mh-annotate-msg-hook
3965@vindex mh-current-folder
3966
3967A hook that is called whenever a message is sent and after the scan
3968lines and message are annotated is @code{mh-annotate-msg-hook}. Hook
3969functions can access the current folder name with
3970@code{mh-current-folder} and obtain the message numbers of the
3971annotated messages with @code{mh-annotate-list}.
3972
3973The rest of the functions and options introduced here are explained in
3974more detail in the following sections.
4009494e
GM
3975
3976@menu
3977* Composing::
3978* Replying::
3979* Forwarding::
3980* Redistributing::
3981* Editing Again::
3982@end menu
3983
3984@node Composing, Replying, Sending Mail, Sending Mail
3985@section Composing
3986
3987@cindex @file{.emacs}
3988@cindex MH-Folder mode
3989@cindex composing mail
3990@cindex draft
3991@cindex files, @file{.emacs}
3992@cindex modes, MH-Folder
3993@cindex sending mail
3994@findex mh-smail
3995@findex mh-smail-other-window
3996@kindex M-x mh-smail
3997@kindex M-x mh-smail-other-window
3998
3999Outside of an MH-Folder buffer, you must call either @kbd{M-x
4000mh-smail} or @kbd{M-x mh-smail-other-window} to compose a new message.
4001The former command always creates a two-window layout with the current
4002buffer on top and the draft on the bottom. Use the latter command if
4003you would rather preserve the window layout. You may find adding the
4004following key bindings to @file{~/.emacs} useful:
4005
4006@smalllisp
4007(global-set-key "\C-xm" 'mh-smail)
4008(global-set-key "\C-x4m" 'mh-smail-other-window)
4009@end smalllisp
4010
4011@cindex draft folder
4012@cindex MH-Letter mode
4013@cindex modes, MH-Letter
4014@findex mh-send
4015@kindex m
4016
4017From within a MH-Folder buffer, you can simply use the command @kbd{m}
4018(@code{mh-send}). However you invoke @code{mh-send}, your letter
4019appears in an Emacs buffer whose mode is MH-Letter (to see what the
4020buffer looks like, @pxref{Sending Mail Tour}). MH-Letter mode allows
4021you to edit your message, to check the validity of the recipients, to
4022insert attachments and other messages into your message, and to send
4023the message. We'll go more into depth about editing a
4024@dfn{draft}@footnote{I highly recommend that you use a @dfn{draft
4025folder} so that you can edit several drafts in parallel. To do so,
4026create a folder named @samp{+drafts} for example, and add the profile
4027component @samp{Draft-Folder: drafts} (see @code{mh-profile}(5)).} (a
4028message you're composing) in just a moment (@pxref{Editing Drafts}).
4029
4030@vindex mh-compose-prompt-flag
4031
4032If you prefer to be prompted for the recipient and subject fields
4033before the MH-Letter buffer appears, turn on the option
4034@code{mh-compose-prompt-flag}.
4035
4036@cindex header field, @samp{X-Mailer:}
4037@cindex @samp{X-Mailer:} header field
4038@vindex mh-insert-x-mailer-flag
4039
4040MH-E adds an @samp{X-Mailer:} header field to the header that includes
4041the version of MH-E and Emacs that you are using. If you don't want to
4042participate in our marketing, you can turn off the option
4043@code{mh-insert-x-mailer-flag}.
4044
4045@cindex @command{repl}
4046@cindex @file{components}
4047@cindex MH commands, @command{repl}
4048@cindex MH-Letter mode
4049@cindex Mail mode
4050@cindex files, @file{components}
4051@cindex modes, MH-Letter
4052@cindex modes, Mail
4053@vindex mail-mode-hook
4054@vindex mh-letter-mode-hook
4055@vindex text-mode-hook
4056
4057Two hooks are provided to run commands on your freshly created draft.
4058The first hook, @code{mh-letter-mode-hook}, allows you to do some
4059processing before editing a letter@footnote{Actually, because
4060MH-Letter mode inherits from Mail mode, the hooks
4061@code{text-mode-hook} and @code{mail-mode-hook} are run (in that
4062order) before @code{mh-letter-mode-hook}.}. For example, you may wish
4063to modify the header after @command{repl} has done its work, or you
4064may have a complicated @file{components} file and need to tell MH-E
4065where the cursor should go. Here's an example of how you would use
4066this hook.
4067
4068@findex mh-insert-signature, example
4069
4070@smalllisp
4071@group
4072(defvar letter-mode-init-done-flag nil
4073 "Non-nil means one-time MH-E settings have been made.")
4074
4075(defun my-mh-letter-mode-hook ()
4076 "Prepare letter for editing."
4077 (when (not letter-mode-init-done) ; @r{only need to bind the keys once}
4078 (local-set-key "\C-ctb" 'add-enriched-text)
4079 (local-set-key "\C-cti" 'add-enriched-text)
4080 (local-set-key "\C-ctf" 'add-enriched-text)
4081 (local-set-key "\C-cts" 'add-enriched-text)
4082 (local-set-key "\C-ctB" 'add-enriched-text)
4083 (local-set-key "\C-ctu" 'add-enriched-text)
4084 (local-set-key "\C-ctc" 'add-enriched-text)
4085 (setq letter-mode-init-done t))
4086 (save-excursion
4087 (goto-char (point-max)) ; @r{go to end of message to}
4088 (mh-insert-signature))) ; @r{insert signature}
4089
4090@i{Prepare draft for editing via mh-letter-mode-hook}
4091
4092@end group
4093@end smalllisp
4094
4095The function, @code{add-enriched-text} is defined in the example in
4096@ref{Adding Attachments}.
4097
4098@vindex mh-compose-letter-function
4099@vindex mh-letter-mode-hook
4100
4101The second hook, a function really, is
4102@code{mh-compose-letter-function}. Like @code{mh-letter-mode-hook}, it
4103is called just before editing a new message; however, it is the last
4104function called before you edit your message. The consequence of this
4105is that you can write a function to write and send the message for
4106you. This function is passed three arguments: the contents of the
4107@samp{To:}, @samp{Subject:}, and @samp{Cc:} header fields.
4108
4109@node Replying, Forwarding, Composing, Sending Mail
4110@section Replying to Mail
4111
4112@cindex @command{mhl}
4113@cindex @file{mhl.reply}
4114@cindex MH commands, @command{mhl}
4115@cindex files, @file{mhl.reply}
4116@cindex replying
4117@findex mh-reply
4118@kindex r
4119
4120To compose a reply to a message, use the @kbd{r} (@code{mh-reply})
4121command.
4122
4123When you reply to a message, you are first prompted with @samp{Reply
4124to whom?}. You have several choices here.
4125
4126@quotation
4127@multitable @columnfractions .20 .80
4128@c @headitem Response @tab Reply Goes To
4129@c XXX @headitem not yet supported by SourceForge's texi2pdf.
4130@item @b{Response} @tab @b{Reply Goes To}
4131@c -------------------------
4132@item @kbd{from}
4133@tab
4134The person who sent the message. This is the default, so @key{RET} is
4135sufficient.
4136@c -------------------------
4137@item @kbd{to}
4138@tab
4139Replies to the sender, plus all recipients in the @samp{To:} header field.
4140@c -------------------------
4141@item @kbd{cc}@*@kbd{all}
4142@tab
4143Forms a reply to the addresses in the @samp{Mail-Followup-To:} header
4144field if one exists; otherwise forms a reply to the sender, plus all
4145recipients.
4146@end multitable
4147@end quotation
4148
4149@cindex @command{repl}
4150@cindex MH commands, @command{repl}
4151@vindex mh-reply-default-reply-to
4152
4153Depending on your answer, @command{repl}@footnote{See the section
4154@uref{@value{MH-BOOK-HOME}/reprep.html, Replying to Messages: repl} in
4155the MH book.} is given a different argument to form your reply.
4156Specifically, a choice of @kbd{from} or none at all runs @samp{repl
4157-nocc all}, and a choice of @kbd{to} runs @samp{repl -cc to}. Finally,
4158either @kbd{cc} or @kbd{all} runs @samp{repl -cc all -nocc me}. If you
4159find that most of the time you specify one of these choices when you
4160reply to a message, you can change the option
4161@code{mh-reply-default-reply-to} from its default value of
4162@samp{Prompt} to one of the choices listed above. You can always edit
4163the recipients in the draft.
4164
4165@cindex @samp{repl:} MH profile component
4166@cindex MH profile component, @samp{repl:}
4167@cindex MH-Letter mode
4168@cindex MH-Show mode
4169@cindex draft
4170@cindex modes, MH-Letter
4171@cindex modes, MH-Show
4172
4173Two windows are then created. One window contains the message to which
4174you are replying in an MH-Show buffer. Your draft, in MH-Letter mode
4175(@pxref{Editing Drafts}), is in the other window. If the reply draft
4176was not one that you expected, check the things that affect the
4177behavior of @command{repl} which include the @samp{repl:} profile
4178component and the @file{replcomps} and @file{replgroupcomps} files.
4179
4180If you supply a prefix argument (as in @kbd{C-u r}), the message you
4181are replying to is inserted in your reply after having first been run
4182through @command{mhl} with the format file @file{mhl.reply}. See
4183@command{mhl}(1) or the section
4184@uref{@value{MH-BOOK-HOME}/shomes.html#Usisho, Using mhl} in the MH
4185book to see how you can modify the default @file{mhl.reply} file.
4186
4187@vindex mh-yank-behavior
4188
4189Alternatively, you can customize the option @code{mh-yank-behavior}
4190and choose one of its @samp{Automatically} variants to do the same
4191thing. @xref{Inserting Letter}. If you do so, the prefix argument has
4192no effect.
4193
4194Another way to include the message automatically in your draft is to
4195use @samp{repl: -filter repl.filter} in your MH profile.
4196
4197@vindex mh-reply-show-message-flag
4198
4199If you include the message automatically, you can hide the MH-Show
4200buffer by turning off the option @code{mh-reply-show-message-flag}.
4201
4202If you wish to customize the header or other parts of the reply draft,
4203please see @command{repl}(1) and @code{mh-format}(5).
4204
4205@node Forwarding, Redistributing, Replying, Sending Mail
4206@section Forwarding Mail
4207
4208@cindex @command{forw}
4209@cindex draft
4210@cindex forwarding
4211@cindex MH commands, @command{forw}
4212@findex mh-forward
4213@kindex f
4214@vindex mh-forward-hook
4215
4216To forward a message, use the @kbd{f} (@code{mh-forward}) command. You
4217are prompted for the @samp{To:} and @samp{cc:} recipients. You are
4218given a draft to edit that looks like it would if you had run the MH
4219command @command{forw}@footnote{See the section
4220@uref{@value{MH-BOOK-HOME}/forfor.html, Forwarding Messages: forw} in
4221the MH book.}. You can then add some text (@pxref{Editing Drafts}).
4222You can forward several messages by using a range (@pxref{Ranges}).
4223All of the messages in the range are inserted into your draft. The
4224hook @code{mh-forward-hook} is called on the draft.
4225
4226@cindex @file{.mh_profile}
4227@cindex files, @file{.mh_profile}
4228@cindex MH profile component, @samp{forw:}
4229@cindex @samp{forw:} MH profile component
4230@vindex mh-compose-forward-as-mime-flag
4231
4232By default, the option @code{mh-compose-forward-as-mime-flag} is on
4233which means that the forwarded messages are included as attachments.
30864d5f
BW
4234These are inline attachments so the forwarded message should appear in
4235the body of your recipient's mail program. If you would prefer to
4236forward your messages verbatim (as text, inline), then turn off this
4237option. Forwarding messages verbatim works well for short, textual
4238messages, but your recipient won't be able to view any non-textual
4239attachments that were in the forwarded message. Be aware that if you
4240have @samp{forw: -mime} in your MH profile, then forwarded messages
4241will always be included as attachments regardless of the settings of
4242@code{mh-compose-forward-as-mime-flag}.
4009494e
GM
4243
4244@vindex mh-forward-subject-format
4245
4246The format of the @samp{Subject:} header field for forwarded messages
4247is controlled by the option @code{mh-forward-subject-format}. This
4248option is a string which includes two escapes (@samp{%s}). The first
4249@samp{%s} is replaced with the sender of the original message, and the
4250second one is replaced with the original @samp{Subject:}. The default
4251value of @code{"%s: %s"} takes a message with the header:
4252
4253@smallexample
4254@group
4255To: Bill Wohler <wohler@@stop.mail-abuse.org>
4256Subject: Re: 49er football
4257From: Greg DesBrisay <gd@@stop.mail-abuse.org>
4258@end group
4259@end smallexample
4260
4261and creates a subject header field of:
4262
4263@smallexample
4264Subject: Greg DesBrisay: Re: 49er football
4265@end smallexample
4266
4267@node Redistributing, Editing Again, Forwarding, Sending Mail
4268@section Redistributing Your Mail
4269
4270@cindex @command{dist}
4271@cindex MH commands, @command{dist}
4272@cindex redistributing
4273@findex mh-redistribute
4274@kindex M-d
4275
4276The command @kbd{M-d} (@code{mh-redistribute}) is similar in function
4277to forwarding mail, but it does not allow you to edit the message, nor
4278does it add your name to the @samp{From:} header field. It appears to
4279the recipient as if the message had come from the original sender.
4280When you run this command, you are prompted for the recipients.
4281
4282@findex mh-edit-again
4283@kindex e
4284
4285For more information on redistributing messages, see
4286@command{dist}(1). Also investigate the command @kbd{e}
4287(@code{mh-edit-again}) for another way to redistribute messages
4288(@pxref{Editing Again}).
4289
4290@cindex @command{send}
4291@cindex MH commands, @command{send}
4292@vindex mh-redist-full-contents-flag
4293
4294The option @code{mh-redist-full-contents-flag} must be turned on if
4295@command{dist}@footnote{See the section
4296@uref{@value{MH-BOOK-HOME}/disdis.html, Distributing Messages with
4297dist} in the MH book.} requires the whole letter for redistribution,
4298which is the case if @command{send}@footnote{See the section
4299@uref{@value{MH-BOOK-HOME}/sensen.html, Sending Some Mail: comp send}
4300in the MH book.} is compiled with the @sc{berk} option (which many
4301people abhor). If you find that MH will not allow you to redistribute
4302a message that has been redistributed before, turn off this option.
4303
bfe16263
BW
4304The hook @code{mh-annotate-msg-hook} is run after annotating the
4305message and scan line (@pxref{Sending Mail}).
4306
4009494e
GM
4307@node Editing Again, , Redistributing, Sending Mail
4308@section Editing Old Drafts and Bounced Messages
4309
4310@cindex @file{draft}
4311@cindex files, @file{draft}
4312@cindex re-editing drafts
4313@findex mh-edit-again
4314@kindex F v drafts
4315@kindex e
4316@kindex n
4317
4318If you don't complete a draft for one reason or another, and if the
4319draft buffer is no longer available, you can pick your draft up again
4320with @kbd{e} (@code{mh-edit-again}). If you don't use a draft
4321folder, your last @file{draft} file will be used. If you use draft
4322folders, you'll need to visit the draft folder with @kbd{F v drafts
4323@key{RET}}, use @kbd{n} to move to the appropriate message, and then
4324use @kbd{e} to prepare the message for editing.
4325
4326@kindex e
4327
4328The @kbd{e} command can also be used to take messages that were sent
4329to you and to send them to more people.
4330
4331@cindex Mailer-Daemon
4332@findex mh-extract-rejected-mail
4333@kindex C-c C-c
4334@kindex E
4335
4336Don't use @kbd{e} to re-edit a message from a @i{Mailer-Daemon} who
4337complained that your mail wasn't posted for some reason or another. In
4338this case, use @kbd{E} (@code{mh-extract-rejected-mail}) to prepare
4339the message for editing by removing the @i{Mailer-Daemon} envelope and
4340unneeded header fields. Fix whatever addressing problem you had, and
4341send the message again with @kbd{C-c C-c}.
4342
4343@node Editing Drafts, Aliases, Sending Mail, Top
4344@chapter Editing a Draft
4345
4346@cindex @samp{Letter} menu
4347@cindex MH-Letter mode
4348@cindex draft
4349@cindex editing draft
4350@cindex menu, @samp{Letter}
4351@cindex modes, MH-Letter
4352
4353When you edit a message that you want to send (called a @dfn{draft} in
4354this case), the mode used is MH-Letter. This mode provides several
4355commands in addition to the normal Emacs editing commands to help you
4356edit your draft. These can also be found in the @samp{Letter} menu.
4357
4358@table @kbd
4359@kindex @key{SPC}
4360@findex mh-letter-complete-or-space
4361@item @key{SPC}
4362Perform completion or insert space (@code{mh-letter-complete-or-space}).
4363@c -------------------------
4364@kindex M-@key{TAB}
4365@findex mh-letter-complete
4366@item M-@key{TAB}
4367Perform completion on header field or word preceding point
4368(@code{mh-letter-complete}).
4369@c -------------------------
4370@kindex , (comma)
4371@findex mh-letter-confirm-address
4372@item , (comma)
4373Flash alias expansion (@code{mh-letter-confirm-address}).
4374@c -------------------------
4375@kindex @key{TAB}
4376@findex mh-letter-next-header-field-or-indent
4377@item @key{TAB}
4378Cycle to next field (@code{mh-letter-next-header-field-or-indent}).
4379@c -------------------------
4380@kindex S-@key{TAB}
4381@findex mh-letter-previous-header-field
4382@item S-@key{TAB}
4383Cycle to the previous header field
4384(@code{mh-letter-previous-header-field}).
4385@c -------------------------
4386@kindex C-c ?
4387@findex mh-help
4388@item C-c ?
4389Display cheat sheet for the MH-E commands (@code{mh-help}).
4390@c -------------------------
4391@cindex @samp{Letter > Send This Draft} menu item
4392@cindex menu item, @samp{Letter > Send This Draft}
4393@kindex C-c C-c
4394@findex mh-send-letter
4395@item C-c C-c
4396Save draft and send message (@code{mh-send-letter}).
4397@c -------------------------
4398@kindex C-c C-d
4399@findex mh-insert-identity
4400@item C-c C-d
4401Insert fields specified by the given identity
4402(@code{mh-insert-identity}). @xref{Identities}.
4403@c -------------------------
4404@cindex @samp{Letter > Pull in All Compositions (MH)} menu item
4405@cindex menu item, @samp{Letter > Pull in All Compositions (MH)}
4406@kindex C-c C-e
4407@findex mh-mh-to-mime
4408@item C-c C-e
4409Compose @sc{mime} message from MH-style directives
4410(@code{mh-mh-to-mime}).
4411@c -------------------------
4412@kindex C-c C-f C-a
4413@kindex C-c C-f a
4414@findex mh-to-field
4415@item C-c C-f C-a
4416@itemx C-c C-f a
4417Move to @samp{Mail-Reply-To:} header field (@code{mh-to-field}).
4418@c -------------------------
4419@kindex C-c C-f C-b
4420@kindex C-c C-f b
4421@item C-c C-f C-b
4422@itemx C-c C-f b
4423Move to @samp{Bcc:} header field (@code{mh-to-field}).
4424@c -------------------------
4425@kindex C-c C-f C-c
4426@kindex C-c C-f c
4427@item C-c C-f C-c
4428@itemx C-c C-f c
4429Move to @samp{Cc:} header field (@code{mh-to-field}).
4430@c -------------------------
4431@kindex C-c C-f C-d
4432@kindex C-c C-f d
4433@item C-c C-f C-d
4434@itemx C-c C-f d
4435Move to @samp{Dcc:} header field (@code{mh-to-field}).
4436@c -------------------------
4437@kindex C-c C-f C-f
4438@kindex C-c C-f f
4439@findex mh-to-fcc
4440@item C-c C-f C-f
4441@itemx C-c C-f f
4442Move to @samp{Fcc:} header field (@code{mh-to-fcc}).
4443@c -------------------------
4444@kindex C-c C-f C-l
4445@kindex C-c C-f l
4446@item C-c C-f C-l
4447@itemx C-c C-f l
4448Move to @samp{Mail-Followup-To:} header field (@code{mh-to-field}).
4449@c -------------------------
4450@kindex C-c C-f C-m
4451@kindex C-c C-f m
4452@item C-c C-f C-m
4453@itemx C-c C-f m
4454Move to @samp{From:} header field (@code{mh-to-field}).
4455@c -------------------------
4456@kindex C-c C-f C-r
4457@kindex C-c C-f r
4458@item C-c C-f C-r
4459@itemx C-c C-f r
4460Move to @samp{Reply-To:} header field (@code{mh-to-field}).
4461@c -------------------------
4462@kindex C-c C-f C-s
4463@kindex C-c C-f s
4464@item C-c C-f C-s
4465@itemx C-c C-f s
4466Move to @samp{Subject:} header field (@code{mh-to-field}).
4467@c -------------------------
4468@kindex C-c C-f C-t
4469@kindex C-c C-f t
4470@item C-c C-f C-t
4471@itemx C-c C-f t
4472Move to @samp{To:} header field (@code{mh-to-field}).
4473@c -------------------------
4474@cindex @samp{Letter > Insert a Message...} menu item
4475@cindex menu item, @samp{Letter > Insert a Message...}
4476@kindex C-c C-i
4477@findex mh-insert-letter
4478@item C-c C-i
4479Insert a message (@code{mh-insert-letter}).
4480@c -------------------------
4481@kindex C-c C-m C-e
4482@findex mh-mml-secure-message-encrypt
4483@item C-c C-m C-e
4484Add tag to encrypt the message (@code{mh-mml-secure-message-encrypt}).
4485@c -------------------------
4486@cindex @samp{Letter > Compose Forward...} menu item
4487@cindex menu item, @samp{Letter > Compose Forward...}
4488@kindex C-c C-m C-f
4489@kindex C-c C-m f
4490@findex mh-compose-forward
4491@item C-c C-m C-f
4492@itemx C-c C-m f
4493Add tag to forward a message (@code{mh-compose-forward}).
4494@c -------------------------
4495@cindex @samp{Letter > Compose Get File (MH)...} menu item
4496@cindex menu item, @samp{Letter > Compose Get File (MH)...}
4497@kindex C-c C-m C-g
4498@kindex C-c C-m g
4499@findex mh-mh-compose-anon-ftp
4500@item C-c C-m C-g
4501@itemx C-c C-m g
4502Add tag to include anonymous ftp reference to a file
4503(@code{mh-mh-compose-anon-ftp}).
4504@c -------------------------
4505@cindex @samp{Letter > Compose Insertion...} menu item
4506@cindex menu item, @samp{Letter > Compose Insertion...}
4507@kindex C-c C-m C-i
4508@kindex C-c C-m i
4509@findex mh-compose-insertion
4510@item C-c C-m C-i
4511@itemx C-c C-m i
4512Add tag to include a file such as an image or sound
4513(@code{mh-compose-insertion}).
4514@c -------------------------
4515@cindex @samp{Letter > Pull in All Compositions (MML)} menu item
4516@cindex menu item, @samp{Letter > Pull in All Compositions (MML)}
4517@kindex C-c C-m C-m
4518@kindex C-c C-m m
4519@findex mh-mml-to-mime
4520@item C-c C-m C-m
4521@itemx C-c C-m m
4522Compose @sc{mime} message from MML tags (@code{mh-mml-to-mime}).
4523@c -------------------------
4524@kindex C-c C-m C-n
4525@kindex C-c C-m n
4526@findex mh-mml-unsecure-message
4527@item C-c C-m C-n
4528@itemx C-c C-m n
4529Remove any secure message tags (@code{mh-mml-unsecure-message}).
4530@c -------------------------
4531@kindex C-c C-m C-s
4532@findex mh-mml-secure-message-sign
4533@item C-c C-m C-s
4534Add tag to sign the message (@code{mh-mml-secure-message-sign}).
4535@c -------------------------
4536@cindex @samp{Letter > Compose Compressed tar (MH)...} menu item
4537@cindex menu item, @samp{Letter > Compose Compressed tar (MH)...}
4538@kindex C-c C-m C-t
4539@kindex C-c C-m t
4540@findex mh-mh-compose-external-compressed-tar
4541@item C-c C-m C-t
4542@itemx C-c C-m t
4543Add tag to include anonymous ftp reference to a compressed tar file
4544(@code{mh-mh-compose-external-compressed-tar}).
4545@c -------------------------
4546@cindex @samp{Letter > Revert to Non-MIME Edit (MH)} menu item
4547@cindex menu item, @samp{Letter > Revert to Non-MIME Edit (MH)}
4548@kindex C-c C-m C-u
4549@kindex C-c C-m u
4550@findex mh-mh-to-mime-undo
4551@item C-c C-m C-u
4552@itemx C-c C-m u
4553Undo effects of @kbd{C-c C-e} (@code{mh-mh-to-mime-undo}).
4554@c -------------------------
4555@kindex C-c C-m C-x
4556@kindex C-c C-m x
4557@findex mh-mh-compose-external-type
4558@item C-c C-m C-x
4559@itemx C-c C-m x
4560Add tag to refer to a remote file
4561(@code{mh-mh-compose-external-type}).
4562@c -------------------------
4563@kindex C-c C-m e e
4564@findex mh-mml-secure-message-encrypt
4565@item C-c C-m e e
4566Add tag to encrypt the message (@code{mh-mml-secure-message-encrypt}).
4567@c -------------------------
4568@kindex C-c C-m e s
4569@findex mh-mml-secure-message-signencrypt
4570@item C-c C-m e s
4571Add tag to encrypt and sign the message@*
4572(@code{mh-mml-secure-message-signencrypt}).
4573@c -------------------------
4574@kindex C-c C-m s e
4575@findex mh-mml-secure-message-signencrypt
4576@item C-c C-m s e
4577Add tag to encrypt and sign the message@*
4578(@code{mh-mml-secure-message-signencrypt}).
4579@c -------------------------
4580@kindex C-c C-m s s
4581@findex mh-mml-secure-message-sign
4582@item C-c C-m s s
4583Add tag to sign the message (@code{mh-mml-secure-message-sign}).
4584@c -------------------------
4585@cindex @samp{Letter > Split Current Line} menu item
4586@cindex menu item, @samp{Letter > Split Current Line}
4587@kindex C-c C-o
4588@findex mh-open-line
4589@item C-c C-o
4590Insert a newline and leave point before it (@code{mh-open-line}).
4591@c -------------------------
4592@cindex @samp{Letter > Kill This Draft} menu item
4593@cindex menu item, @samp{Letter > Kill This Draft}
4594@kindex C-c C-q
4595@findex mh-fully-kill-draft
4596@item C-c C-q
4597Quit editing and delete draft message (@code{mh-fully-kill-draft}).
4598@c -------------------------
4599@cindex @samp{Letter > Insert Signature} menu item
4600@cindex menu item, @samp{Letter > Insert Signature}
4601@kindex C-c C-s
4602@findex mh-insert-signature
4603@item C-c C-s
4604Insert signature in message (@code{mh-insert-signature}).
4605@c -------------------------
4606@kindex C-c C-t
4607@findex mh-letter-toggle-header-field-display
4608@item C-c C-t
4609Toggle display of header field at point
4610(@code{mh-letter-toggle-header-field-display}).
4611@c -------------------------
4612@cindex @samp{Letter > Check Recipient} menu item
4613@cindex menu item, @samp{Letter > Check Recipient}
4614@kindex C-c C-w
4615@findex mh-check-whom
4616@item C-c C-w
4617Verify recipients, showing expansion of any aliases
4618(@code{mh-check-whom}).
4619@c -------------------------
4620@cindex @samp{Letter > Yank Current Message} menu item
4621@cindex menu item, @samp{Letter > Yank Current Message}
4622@kindex C-c C-y
4623@findex mh-yank-cur-msg
4624@item C-c C-y
4625Insert the current message into the draft buffer
4626(@code{mh-yank-cur-msg}).
4627@c -------------------------
4628@kindex C-c M-d
4629@findex mh-insert-auto-fields
4630@item C-c M-d
4631Insert custom fields if recipient is found in
4632@code{mh-auto-fields-list} (@code{mh-insert-auto-fields}).
4633@xref{Identities}.
4634@end table
4635
4636@cindex @samp{mh-letter} customization group
4637@cindex customization group, @samp{mh-letter}
4638
4639Several options from the @samp{mh-letter} customization group are used
4640while editing a draft.
4641
4642@vtable @code
4643@item mh-compose-insertion
4644Type of @sc{mime} message tags in messages (default: @samp{MML} if
4645available; otherwise @samp{MH}).
4646@c -------------------------
4647@item mh-compose-skipped-header-fields
4648List of header fields to skip over when navigating in draft (default:
4649@code{'("From"} @code{"Organization"} @code{"References"}
4650@code{"In-Reply-To"} @code{"X-Face"} @code{"Face"}
4651@code{"X-Image-URL"} @code{"X-Mailer")}.
4652@c -------------------------
4653@item mh-compose-space-does-completion-flag
4654On means @key{SPC} does completion in message header (default:
4655@samp{off}).
4656@c -------------------------
4657@item mh-delete-yanked-msg-window-flag
4658On means delete any window displaying the message (default: @samp{off}).
4659@c -------------------------
4660@item mh-extract-from-attribution-verb
4661Verb to use for attribution when a message is yanked by @kbd{C-c C-y}
4662(default: @code{"wrote:"}).
4663@c -------------------------
4664@item mh-ins-buf-prefix
4665String to put before each line of a yanked or inserted message
4666(default: @code{"> "}).
4667@c -------------------------
4668@item mh-letter-complete-function
4669Function to call when completing outside of address or folder fields
4670(default: @code{ispell-complete-word}).
4671@c -------------------------
4672@item mh-letter-fill-column
4673Fill column to use in MH-Letter mode (default: 72).
4674@c -------------------------
4675@item mh-mml-method-default
4676Default method to use in security tags (default: @samp{PGP (MIME)} if
4677support for it is available; otherwise @samp{None}).
4678@c -------------------------
4679@item mh-signature-file-name
4680Source of user's signature (default: @code{"~/.signature"}).
4681@c -------------------------
4682@item mh-signature-separator-flag
4683On means a signature separator should be inserted (default:
4684@samp{on}).
4685@c -------------------------
4686@item mh-x-face-file
4687File containing X-Face or Face header field to insert in outgoing mail.
4688(default: @code{"~/.face"}).
4689@c -------------------------
4690@item mh-yank-behavior
4691Controls which part of a message is yanked by @kbd{C-c C-y} (default:
4692@samp{Body With Attribution}).
4693@end vtable
4694
4695The following hooks are available.
4696
4697@vtable @code
4698@item mail-citation-hook
4699Hook for modifying a citation just inserted in the mail buffer
4700(default: @code{nil}).
4701@c -------------------------
4702@item mh-before-send-letter-hook
4703Hook run at the beginning of the @kbd{C-c C-c} command (default:
4704@samp{nil}).
4705@c -------------------------
4706@item mh-mh-to-mime-hook
4707Hook run on the formatted letter by @kbd{C-c C-e} (default:
4708@samp{nil}).
4709@c -------------------------
4710@item mh-insert-signature-hook
4711Hook run by @kbd{C-c C-s} after signature has been inserted (default:
4712@code{nil}).
4713@end vtable
4714
4715The following face is available.
4716
4717@vtable @code
4718@item mh-letter-header-field
4719Editable header field value face in draft buffers.
4720@end vtable
4721
4722The commands and options introduced here are explained in more
4723detail in the following sections.
4724
4725@menu
4726* Editing Message::
4727* Inserting Letter::
4728* Inserting Messages::
4729* Signature::
4730* Picture::
4731* Adding Attachments::
4732* Sending PGP::
4733* Checking Recipients::
4734* Sending Message::
4735* Killing Draft::
4736@end menu
4737
4738@node Editing Message, Inserting Letter, Editing Drafts, Editing Drafts
4739@section Editing the Message
4740
4741@cindex @samp{Bcc:} header field
4742@cindex @samp{Cc:} header field
4743@cindex @samp{Dcc:} header field
4744@cindex @samp{From:} header field
4745@cindex @samp{Mail-Followup-To:} header field
4746@cindex @samp{Mail-Reply-To:} header field
4747@cindex @samp{Reply-To:} header field
4748@cindex @samp{Subject:} header field
4749@cindex @samp{To:} header field
4750@cindex editing header
4751@cindex header field, @samp{Bcc:}
4752@cindex header field, @samp{Cc:}
4753@cindex header field, @samp{Dcc:}
4754@cindex header field, @samp{From:}
4755@cindex header field, @samp{Mail-Followup-To:}
4756@cindex header field, @samp{Mail-Reply-To:}
4757@cindex header field, @samp{Reply-To:}
4758@cindex header field, @samp{Subject:}
4759@cindex header field, @samp{To:}
4760@findex mh-to-field
4761@kindex C-c C-f C-t
4762@kindex C-c C-f t
4763
4764Because the header is part of the message, you can edit the header
4765fields as you wish. However, several convenience commands exist to
4766help you create and edit them. For example, the command @kbd{C-c C-f
4767C-t} (@code{mh-to-field}; alternatively, @kbd{C-c C-f t}) moves the
4768cursor to the @samp{To:} header field, creating it if necessary. The
4769commands for moving to the @samp{Cc:}, @samp{Subject:}, @samp{From:},
4770@samp{Reply-To:}, @samp{Mail-Reply-To:}, @samp{Mail-Followup-To},
4771@samp{Bcc:}, and @samp{Dcc:} header fields are similar.
4772
4773@findex mh-to-fcc
4774@kindex C-c C-f C-f
4775@kindex C-c C-f f
4776
4777One command behaves differently from the others, namely, @kbd{C-c C-f
4778C-f} (@code{mh-to-fcc}; alternatively, @kbd{C-c C-f f}). This command
4779will prompt you for the folder name in which to file a copy of the
4780draft. @xref{Folder Selection}.
4781
4782@findex indent-relative
4783@findex mh-letter-next-header-field-or-indent
4784@findex mh-letter-previous-header-field
4785@kindex @key{TAB}
4786@kindex S-@key{TAB}
4787@vindex mh-compose-skipped-header-fields
4788@vindex mh-letter-header-field
4789
4790Within the header of the message, the command@* @key{TAB}
4791(@code{mh-letter-next-header-field-or-indent}) moves between fields
4792that are highlighted with the face @code{mh-letter-header-field},
4793skipping those fields listed in
4794@code{mh-compose-skipped-header-fields}. After the last field, this
4795command then moves point to the message body before cycling back to
4796the first field. If point is already past the first line of the
4797message body, then this command indents by calling
4798@code{indent-relative} with the given prefix argument. The command
4799@kbd{S-@key{TAB}} (@code{mh-letter-previous-header-field}) moves
4800backwards between the fields and cycles to the body of the message
4801after the first field. Unlike the command @key{TAB}, it will always
4802take point to the last field from anywhere in the body.
4803
4804@cindex alias completion
4805@cindex completion
4806@cindex spell check
4807@findex ispell-complete-word
4808@findex mh-letter-complete
4809@findex mh-letter-complete-or-space
4810@findex mh-letter-confirm-address
4811@kindex , (comma)
4812@kindex @key{SPC}
4813@kindex M-@key{TAB}
4814@vindex mh-alias-flash-on-comma
4815@vindex mh-compose-space-does-completion-flag
4816@vindex mh-letter-complete-function
4817
4818If the field contains addresses (for example, @samp{To:} or
4819@samp{Cc:}) or folders (for example, @samp{Fcc:}) then the command
4820@kbd{M-@key{TAB}} (@code{mh-letter-complete}) will provide alias
4821completion (@pxref{Aliases}). In the body of the message,
4822@kbd{M-@key{TAB}} runs @code{mh-letter-complete-function} instead,
4823which is set to @samp{'ispell-complete-word} by default. The command
4824@kbd{M-@key{TAB}} (@code{mh-letter-complete}) takes a prefix argument
4825that is passed to the @code{mh-letter-complete-function}. In addition,
4826turn on the option @code{mh-compose-space-does-completion-flag} to use
4827the command @key{SPC} (@code{mh-letter-complete-or-space}) to perform
4828completion in the header as well; use a prefix argument to specify
4829more than one space. Addresses are separated by a comma; when you
4830press the comma, the command @code{mh-letter-confirm-address} flashes
4831the alias expansion in the minibuffer if
4832@code{mh-alias-flash-on-comma} is turned on.
4833
4834@c XXX Document the replacement for the inaccessible 'long argument.
4835
4836@findex mh-letter-toggle-header-field-display
4837@kindex C-c C-t
4838
4839Use the command @kbd{C-c C-t}
4840@code{mh-letter-toggle-header-field-display} to display truncated
4841header fields. This command is a toggle so entering it again will hide
4842the field. This command takes a prefix argument: if negative then the
4843field is hidden, if positive then the field is displayed (for example,
4844@kbd{C-u C-c C-t}).
4845
4846Be sure to leave a row of dashes or a blank line between the header
4847and the body of the message.
4848
4849@vindex mh-letter-fill-column
4850
4851The body of the message is edited as you would edit any Emacs buffer
4852although there are a few commands and options to assist you. You can
4853change the fill column in MH-Letter mode with the option
4854@code{mh-letter-fill-column}. By default, this option is 72 to allow
4855others to quote your message without line wrapping.
4856
4857@cindex filling paragraphs
4858@cindex paragraphs, filling
4859@findex fill-paragraph
4860@kindex M-q
4861@vindex mh-ins-buf-prefix
4862
4863You'll often include messages that were sent from user agents that
4864haven't yet realized that paragraphs consist of more than a single
4865line. This makes for long lines that wrap in an ugly fashion. You'll
4866find that @kbd{M-q} (@code{fill-paragraph}) works well even on these
4867quoted messages, even if they are nested, just as long as all of the
4868quotes match the value of @code{mh-ins-buf-prefix} (@pxref{Inserting
4869Letter}). For example, let's assume you have the following in your
4870draft:
4871
4872@smallexample
4873@group
4874> Hopefully this gives you an idea of what I'm currently doing. I'm \
4875not sure yet whether I'm completely satisfied with my setup, but \
4876it's worked okay for me so far.
4877@end group
4878@end smallexample
4879
4880Running @kbd{M-q} on this paragraph produces:
4881
4882@smallexample
4883@group
4884> Hopefully this gives you an idea of what I'm currently doing. I'm not
4885> sure yet whether I'm completely satisfied with my setup, but it's
4886> worked okay for me so far.
4887@end group
4888@end smallexample
4889
4890@findex mh-open-line
4891@findex open-line
4892@kindex C-c C-o
4893@kindex C-o
4894
4895The command @kbd{C-c C-o} (@code{mh-open-line}) is similar to the
4896command @kbd{C-o} (@code{open-line}) in that it inserts a newline
4897after point. It differs in that it also inserts the right number of
4898quoting characters and spaces so that the next line begins in the same
4899column as it was. This is useful when breaking up paragraphs in
4900replies. For example, if this command was used when point was after
4901the first period in the paragraph above, the result would be this:
4902
4903@smallexample
4904@group
4905> Hopefully this gives you an idea of what I'm currently doing.
4906
4907> I'm not
4908> sure yet whether I'm completely satisfied with my setup, but it's
4909> worked okay for me so far.
4910@end group
4911@end smallexample
4912
4913@node Inserting Letter, Inserting Messages, Editing Message, Editing Drafts
4914@section Inserting Letter to Which You're Replying
4915
4916@cindex inserting messages
4917@cindex replying to messages
4918@cindex yanking messages
4919@findex mh-yank-cur-msg
4920@kindex C-c C-y
4921@vindex mh-ins-buf-prefix
4922
4923It is often useful to insert a snippet of text from a letter that
4924someone mailed to provide some context for your reply. The command
4925@kbd{C-c C-y} (@code{mh-yank-cur-msg}) does this by adding an
4926attribution, yanking a portion of text from the message to which
4927you're replying, and inserting @code{mh-ins-buf-prefix} (@samp{> })
4928before each line.
4929
4930@smallexample
4931@group
4932Michael W Thelen <thelenm@@stop.mail-abuse.org> wrote:
4933
4934> Hopefully this gives you an idea of what I'm currently doing. I'm not
4935> sure yet whether I'm completely satisfied with my setup, but it's
4936> worked okay for me so far.
4937@end group
4938@end smallexample
4939
4940@vindex mh-extract-from-attribution-verb
4941
4942The attribution consists of the sender's name and email address
4943followed by the content of the option
4944@code{mh-extract-from-attribution-verb}. This option can be set to
4945