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