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