\input texinfo @c -*-texinfo-*- @c @c Note: This document requires makeinfo version 4.6 or greater to build. @c @c %**start of header @setfilename ../info/mh-e @settitle The MH-E Manual @c %**end of header @c Version of the software and manual. @set VERSION 8.0.3 @c Edition of the manual. It is either empty for the first edition or @c has the form ", nth Edition" (without the quotes). @set EDITION @set UPDATED 2006-11-12 @set UPDATE-MONTH November, 2006 @c Other variables. @set MH-BOOK-HOME http://rand-mh.sourceforge.net/book/mh @set MH-E-HOME http://mh-e.sourceforge.net/ @c Copyright @copying This is version @value{VERSION}@value{EDITION} of @cite{The MH-E Manual}, last updated @value{UPDATED}. Copyright @copyright{} 1995, 2001, 2002, 2003, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. @quotation The MH-E manual is free documentation; you can redistribute it and/or modify it under the terms of either: @enumerate a @item the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. @item the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. @end enumerate The MH-E manual is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License or GNU Free Documentation License for more details. The GNU General Public License and the GNU Free Documentation License appear as appendices to this document. You may also request copies by writing to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. @end quotation @end copying @c Info Directory Entry @dircategory Emacs @direntry * MH-E: (mh-e). Emacs interface to the MH mail system. @end direntry @c Title Page @setchapternewpage odd @titlepage @title The MH-E Manual @subtitle Version @value{VERSION}@value{EDITION} @subtitle @value{UPDATE-MONTH} @author Bill Wohler @c Copyright Page @page @vskip 0pt plus 1filll @insertcopying @end titlepage @ifnottex @html @end html @insertcopying @end ifnottex @c Table of Contents @contents @html @end html @node Preface, Conventions, Top, Top @unnumbered Preface @cindex Emacs @cindex Unix commands, Emacs @cindex preface This manual introduces another interface to the MH mail system that is accessible through the GNU Emacs editor, namely, @emph{MH-E}. MH-E is easy to use. I don't assume that you know GNU Emacs or even MH at this point, since I didn't know either of them when I discovered MH-E. However, MH-E was the tip of the iceberg, and I discovered more and more niceties about GNU Emacs and MH@. Now I'm fully hooked on both of them. The MH-E package is distributed with GNU Emacs@footnote{Version @value{VERSION} of MH-E will appear in GNU Emacs 22.1. It is supported in GNU Emacs 21, as well as XEmacs 21 (except for versions 21.5.9-21.5.16). It is compatible with MH versions 6.8.4 and higher, all versions of nmh, and GNU mailutils 1.0 and higher.}, so you shouldn't have to do anything special to use it. This manual covers MH-E version @value{VERSION}. To help you decide which version you have, see @ref{Getting Started}. @findex help-with-tutorial @kindex C-h t If you don't already use GNU Emacs but want to learn more, you can read an online tutorial by starting GNU Emacs and typing @kbd{C-h t} (@code{help-with-tutorial}). (To learn about this notation, see @ref{Conventions}.) If you want to take the plunge, consult the @iftex @cite{GNU Emacs Manual}, @end iftex @ifinfo @ref{top, , GNU Emacs Manual, emacs, GNU Emacs Manual}, @end ifinfo @ifhtml @uref{http://www.gnu.org/software/emacs/manual/html_node/, @cite{GNU Emacs Manual}}, @end ifhtml from the Free Software Foundation. If more information is needed, you can go to the Unix manual pages of the individual MH commands. When the name is not obvious, I'll guide you to a relevant MH manual page that describes the action more fully. @cindex @cite{MH & nmh: Email for Users & Programmers} @cindex MH book @cindex info @kindex C-h i This manual is available in both Info and online formats. The Info version is distributed with Emacs and can be accessed with the @command{info} command (@samp{info mh-e}) or within Emacs (@kbd{C-h i m mh-e @key{RET}}). The online version is available at @uref{http://mh-e.sourceforge.net/manual/, SourceForge}. Another great online resource is the book @uref{http://www.ics.uci.edu/~mh/book/, @cite{MH & nmh: Email for Users & Programmers}} (also known as @dfn{the MH book}). I hope you enjoy this manual! If you have any comments, or suggestions for this document, please let me know. @cindex Bill Wohler @cindex Wohler, Bill @noindent Bill Wohler <@i{wohler at newt.com}>@* 8 February 1995@* 24 February 2006 @node Conventions, Getting Started, Preface, Top @chapter GNU Emacs Terms and Conventions @cindex Emacs @cindex Emacs, conventions @cindex Emacs, terms @cindex Unix commands, Emacs @cindex conventions, Emacs @cindex terms, Emacs If you're an experienced Emacs user, you can skip the following conventions and definition of terms and go directly to the next section (@pxref{Getting Started}). @cindex Emacs commands @cindex MH commands @cindex Unix commands @cindex commands @cindex commands, MH @cindex commands, Unix @cindex commands, shell @cindex functions @cindex shell commands In general, @dfn{functions} in this text refer to Emacs Lisp functions that one would call from within Emacs Lisp programs (for example, @code{(mh-inc-folder)}). On the other hand, @dfn{commands} are those things that are run by the user, such as @kbd{i} or @kbd{M-x mh-inc-folder}. Programs outside of Emacs are specifically called MH commands, shell commands, or Unix commands. @cindex conventions, key names @cindex key names The conventions for key names are as follows: @table @kbd @item C-x Hold down the @key{CTRL} (Control) key and press the @kbd{x} key. @c ------------------------- @item M-x Hold down the @key{META} or @key{ALT} key and press the @kbd{x} key. Since some keyboards don't have a @key{META} key, you can generate @kbd{M-x}, for example, by pressing @key{ESC} (Escape), @emph{releasing it}, and then pressing the @kbd{x} key. @c ------------------------- @item @key{RET} Press the @key{RETURN} or @key{ENTER} key. This is normally used to complete a command. @c ------------------------- @item @key{SPC} Press the space bar. @c ------------------------- @item @key{TAB} Press the @key{TAB} key. @c ------------------------- @item @key{DEL} Press the @key{DELETE} key. @c ------------------------- @item @key{BS} Press the @key{BACKSPACE} key@footnote{If you are using Version 20 or earlier of Emacs, you will need to use the @key{DEL} key.}. @end table @cindex Emacs, prefix argument @cindex prefix argument @kindex C-u A @dfn{prefix argument} allows you to pass an argument to any Emacs function. To pass an argument, type @kbd{C-u} before the Emacs command or keystroke. Numeric arguments can be passed as well. For example, to insert five f's, use @kbd{C-u 5 f}. There is a default of four when using @kbd{C-u}, and you can use multiple prefix arguments to provide arguments of powers of four. To continue our example, you could insert four f's with @kbd{C-u f}, 16 f's with @kbd{C-u C-u f}, 64 f's with @kbd{C-u C-u C-u f}, and so on. Numeric and valueless negative arguments can also be inserted with the @key{META} key. Examples include @kbd{M-5} to specify an argument of 5, or @kbd{M--} which specifies a negative argument with no particular value. @sp 1 @center @strong{NOTE} @quotation The prefix @kbd{C-u} or @kbd{M-} is not necessary in MH-E's MH-Folder mode (@pxref{Reading Mail Tour}). In this mode, simply enter the numerical argument before entering the command. @end quotation @sp 1 @cindex @file{.emacs} @cindex Emacs, variables @cindex files, @file{.emacs} @cindex variables @findex setq Emacs uses @dfn{variables} to hold values. These can be changed via calls to the function @code{setq} in @file{~/.emacs}. @cindex Emacs, options @cindex options @findex customize-group @findex customize-option Variables in MH-E that are normally modified by the user are called @dfn{options} and are modified through the customize functions (such as @kbd{M-x customize-option} or @kbd{M-x customize-group}). @ifnothtml @xref{Easy Customization,,,emacs,The GNU Emacs Manual}, in @cite{The GNU Emacs Manual}. @end ifnothtml @ifhtml See section @uref{http://www.gnu.org/software/emacs/manual/html_node/Easy-Customization.html, Easy Customization} in @cite{The GNU Emacs Manual}. @end ifhtml @xref{Options}. @cindex Emacs, faces @cindex faces @cindex highlighting @findex customize-face You can specify various styles for displaying text using @dfn{faces}. MH-E provides a set of faces that you can use to personalize the look of your MH-E buffers. Use the command @kbd{M-x customize-face} to do this. @ifnothtml @xref{Face Customization,,,emacs,The GNU Emacs Manual}, in @cite{The GNU Emacs Manual}. @end ifnothtml @ifhtml See section @uref{http://www.gnu.org/software/emacs/manual/html_node/Face-Customization.html, Face Customization} in @cite{The GNU Emacs Manual}. @end ifhtml @cindex abnormal hooks @cindex hooks @cindex normal hooks @findex add-hook @findex customize-option Commands often offer @dfn{hooks} which enable you to extend or modify the way a command works. @ifnothtml @ref{Hooks, , Hooks, emacs, The GNU Emacs Manual}, in @cite{The GNU Emacs Manual} @end ifnothtml @ifhtml See section @uref{http://www.gnu.org/software/emacs/manual/html_node/Hooks.html, Hooks} in @cite{The GNU Emacs Manual} @end ifhtml for a description about @dfn{normal hooks} and @dfn{abnormal hooks}. MH-E uses normal hooks in nearly all cases, so you can assume that we are talking about normal hooks unless we explicitly mention that a hook is abnormal. We also follow the conventions described in that section: the name of the abnormal hooks end in @code{-hooks} and all the rest of the MH-E hooks end in @code{-hook}. You can add hooks with either @code{customize-option} or @code{add-hook}. @cindex Emacs, mark @cindex Emacs, point @cindex Emacs, region @cindex mark @cindex point @cindex region @kindex C-@@ @kindex C-@key{SPC} There are several other terms that are used in Emacs that you should know. The @dfn{point} is where the cursor currently is. You can save your current place in the file by setting a @dfn{mark}. This operation is useful in several ways. The mark can be later used when defining a @dfn{region}, which is the text between the point and mark. Many commands operate on regions, such as those for deleting text or filling paragraphs. A mark can be set with @kbd{C-@@} (or @kbd{C-@key{SPC}}). @cindex completion @cindex Emacs, completion @cindex Emacs, file completion @cindex Emacs, folder completion @cindex Emacs, minibuffer @cindex file completion @cindex folder completion @cindex minibuffer @kindex SPC @kindex TAB The @dfn{minibuffer} is the bottom line of the Emacs window, where all prompting and multiple-character input is directed. You can use @dfn{completion} to enter values such as folders. Completion means that Emacs fills in text for you when you type @key{SPC} or @key{TAB}. A second @key{SPC} or @key{TAB} will list all possibilities at that point. @ifnothtml @xref{Completion, , Completion, emacs, The GNU Emacs Manual}. @end ifnothtml @ifhtml See the section @uref{http://www.gnu.org/software/emacs/manual/html_node/Completion.html, Completion} in @cite{The GNU Emacs Manual}. @end ifhtml Note that @key{SPC} cannot be used for completing filenames and folders. @findex help-with-tutorial @kindex C-h t @kindex M-x The minibuffer is also where you enter Emacs function names after typing @kbd{M-x}. For example, in the preface, I mentioned that you could obtain help with @kbd{C-h t} (@code{help-with-tutorial}). What this means is that you can get a tutorial by typing either @kbd{C-h t} or @kbd{M-x help-with-tutorial}. In the latter case, you are prompted for @samp{help-with-tutorial} in the minibuffer after typing @kbd{M-x}. @cindex ~ The @samp{~} notation in filenames represents your home directory. This notation is used by many shells including @command{bash}, @code{tcsh}, and @command{csh}. It is analogous to the environment variable @samp{$HOME}. For example, @file{~/.emacs} can be written @file{$HOME/.emacs} or using the absolute path as in @file{/home/wohler/.emacs} instead. @cindex Emacs, interrupting @cindex Emacs, quitting @cindex interrupting @cindex quitting @i{In case of trouble:} Emacs can be interrupted at any time with @kbd{C-g}. For example, if you've started a command that requests that you enter something in the minibuffer, but then you change your mind, type @kbd{C-g} and you'll be back where you started. If you want to exit Emacs entirely, use @kbd{C-x C-c}. @node Getting Started, Tour Through MH-E, Conventions, Top @chapter Getting Started @cindex MH-E, versions @cindex history @cindex versions of MH-E Because there are many old versions of MH-E out there, it is important to know which version you have. I'll be talking about @w{Version 8} which is pretty close to @w{Version 6} and @w{Version 7}. It differs from @w{Version 4} and @w{Version 5} and is vastly different from @w{Version 3}. @xref{History}. @findex mh-version To determine which version of MH-E that you have, enter @kbd{M-x mh-version @key{RET}}. Hopefully it says that you're running @w{Version @value{VERSION}} which is the latest version as of this printing. If your version is much older than this, please consider upgrading. You can have your system administrator upgrade the system-wide version, or you can install your own personal version. It's really quite easy. @xref{Getting MH-E}, for instructions for getting and installing MH-E. If the @code{mh-version} command displays @samp{No MH variant detected}@footnote{In very old versions of MH-E, you may get the error message, @samp{Cannot find the commands `inc' and `mhl' and the file `components'} if MH-E can't find MH. In this case, you need to update MH-E, and you may need to install MH too. However, newer versions of MH-E are better at finding MH if it is on your system.}, then you need to install MH or tell MH-E where to find MH. @cindex Debian @cindex nmh @cindex GNU mailutils If you don't have MH on your system already, you must install a variant of MH. The Debian mh-e package does this for you automatically (@pxref{Getting MH-E}). Most people use @uref{http://www.nongnu.org/nmh/, nmh}, but you may be interested in trying out @uref{http://www.gnu.org/software/mailutils/, GNU mailutils}, which supports IMAP. Your GNU/Linux distribution probably has packages for both of these. @cindex @command{install-mh} @cindex MH commands, @command{install-mh} @cindex MH book If you've never run MH before, you need to run @command{install-mh} from the shell before you continue. This sets up your personal MH environment@footnote{See the section @uref{@value{MH-BOOK-HOME}/../overall/setup.html, Setting Up MH} in the MH book.}. If you don't, you'll be greeted with the error message: @samp{Install MH and run install-mh before running MH-E}. This is all you need to know about MH to use MH-E, but the more you know about MH, the more you can leverage its power. See the @uref{@value{MH-BOOK-HOME}/../, MH book} to learn more about MH. @cindex @samp{Path:} MH profile component @cindex MH profile @cindex MH profile component @cindex MH profile component, @samp{Path:} Your MH environment includes your @dfn{MH profile} which is found in the file @file{~/.mh_profile}. This file contains a number of @dfn{MH profile components}. For example, the @samp{Path:} MH profile component contains the path to your mail directory, which is @file{~/Mail} by default. @cindex @command{mhparam} @cindex MH commands, @command{mhparam} @vindex exec-path @vindex mh-path @vindex mh-sys-path @vindex mh-variant @vindex mh-variant-in-use There are several options MH-E uses to interact with your MH installation. The option @code{mh-variant} specifies the variant used by MH-E (@pxref{Options}). The default setting of this option is @samp{Auto-detect} which means that MH-E will automatically choose the first of nmh, MH, or GNU mailutils that it finds in the directories listed in @code{mh-path} (which you can customize), @code{mh-sys-path}, and @code{exec-path}. If MH-E can't find MH at all, you may have to customize @code{mh-path} and add the directory in which the command @command{mhparam} is located. If, on the other hand, you have both nmh and mailutils installed (for example) and @code{mh-variant-in-use} was initialized to nmh but you want to use mailutils, then you can set @code{mh-variant} to @samp{mailutils}. @vindex mh-flists-present-flag @vindex mh-lib @vindex mh-lib-progs @vindex mh-progs When @code{mh-variant} is changed, MH-E resets @code{mh-progs}, @code{mh-lib}, @code{mh-lib-progs}, @code{mh-flists-present-flag}, and @code{mh-variant-in-use} accordingly. @cindex @file{.emacs} @cindex files, @file{.emacs} @sp 1 @center @strong{NOTE} @quotation Prior to version 8, it was often necessary to set some of these variables in @file{~/.emacs}; now it is no longer necessary and can actually cause problems. @end quotation @sp 1 @cindex MH profile component, @samp{Draft-Folder:} @cindex MH profile component, @samp{Path:} @cindex MH profile component, @samp{Previous-Sequence:} @cindex MH profile component, @samp{Unseen-Sequence:} @cindex @samp{Draft-Folder:} MH profile component @cindex @samp{Path:} MH profile component @cindex @samp{Previous-Sequence:} MH profile component @cindex @samp{Unseen-Sequence:} MH profile component @findex mh-find-path @vindex mh-draft-folder @vindex mh-find-path-hook @vindex mh-inbox @vindex mh-previous-seq @vindex mh-unseen-seq @vindex mh-user-path In addition to setting variables that point to MH itself, MH-E also sets a handful of variables that point to where you keep your mail. During initialization, the function @code{mh-find-path} sets @code{mh-user-path} from your @samp{Path:} MH profile component (but defaults to @samp{Mail} if one isn't present), @code{mh-draft-folder} from @samp{Draft-Folder:}, @code{mh-unseen-seq} from @samp{Unseen-Sequence:}, @code{mh-previous-seq} from @samp{Previous-Sequence:}, and @code{mh-inbox} from @samp{Inbox:} (defaults to @samp{+inbox}). The hook @code{mh-find-path-hook} is run after these variables have been set. This hook can be used the change the value of these variables if you need to run with different values between MH and MH-E. @node Tour Through MH-E, Using This Manual, Getting Started, Top @chapter Tour Through MH-E @cindex introduction @cindex tour @cindex tutorial This chapter introduces some of the terms you'll need to know and then takes you on a tour of MH-E@footnote{The keys mentioned in these chapters refer to the default key bindings. If you've changed the bindings, refer to the command summaries at the beginning of each chapter for a mapping between default key bindings and function names.}. When you're done, you'll be able to send, read, and file mail, which is all that a lot of people ever do. But if you're the curious or adventurous type, read the rest of the manual to be able to use all the features of MH-E. I suggest you read this chapter first to get the big picture, and then you can read the manual as you wish. @menu * Sending Mail Tour:: * Reading Mail Tour:: * Processing Mail Tour:: * Leaving MH-E:: * More About MH-E:: @end menu @node Sending Mail Tour, Reading Mail Tour, Tour Through MH-E, Tour Through MH-E @section Sending Mail @cindex MH-Letter mode @cindex mode @cindex modes, MH-Letter @cindex sending mail @findex mh-smail @kindex M-x mh-smail Let's start our tour by sending ourselves a message which we can later read and process. Enter @kbd{M-x mh-smail} to invoke the MH-E program to send messages. Your message appears in an Emacs buffer whose mode@footnote{A @dfn{mode} changes Emacs to make it easier to edit a particular type of text.} is MH-Letter. Enter your login name in the @samp{To:} header field. Press the @key{TAB} twice to move the cursor past the @samp{Cc:} field, since no carbon copies are to be sent, and on to the @samp{Subject:} field. Enter @kbd{Test} or anything else that comes to mind. Press @key{TAB} again to move the cursor to the body of the message. Enter some text, using normal Emacs commands. You should now have something like this@footnote{If you're running Emacs under the X Window System, then you would also see a menu bar and a tool bar. I've left out the menu bar and tool bar in all of the example screens.}: @cartouche @smallexample --:-- *scratch* All L1 (Lisp Interaction)------------------------- To: wohler cc: Subject: Test X-Mailer: MH-E 8.0; nmh 1.1; GNU Emacs 22.1 -------- This is a test message to get the wheels churning...# --:** @{draft@} All L5 (MH-Letter)---------------------------------- Type C-c C-c to send message, C-C ? for help @end smallexample @end cartouche @i{MH-E message composition window} Note the line of dashes that separates the header and the body of the message. It is essential that these dashes (or a blank line) are present or the body of your message will be considered to be part of the header. @cindex help @findex describe-mode @kindex C-c ? @kindex C-c C-c @kindex C-h m There are several commands specific to MH-Letter mode@footnote{You can get quick help for the commands used most often with @kbd{C-c ?} or more complete help with the @kbd{C-h m} (@code{describe-mode}) command.}, but at this time we'll only use @kbd{C-c C-c} to send your message. Type @kbd{C-c C-c} now. That's all there is to it! @node Reading Mail Tour, Processing Mail Tour, Sending Mail Tour, Tour Through MH-E @section Receiving Mail @cindex @command{inc} @cindex @command{scan} @cindex MH commands, @command{inc} @cindex MH commands, @command{scan} @cindex MH-Folder mode @cindex modes, MH-Folder @cindex reading mail @findex mh-rmail @kindex M-x mh-rmail To read the mail you've just sent yourself, enter @kbd{M-x mh-rmail}. This incorporates the new mail and puts the output from @command{inc}@footnote{See the section @uref{@value{MH-BOOK-HOME}/reapre.html, Reading Mail: inc show next prev} in the MH book.} (called @dfn{scan lines} after the MH program @command{scan}@footnote{See the section @uref{@value{MH-BOOK-HOME}/faswsprs.html, Find and Specify with scan pick Ranges Sequences} in the MH book.} which prints a one-line summary of each message) into a buffer called @samp{+inbox} whose major mode is MH-Folder. @findex mh-rmail @kindex F r @kindex M-x mh-rmail @sp 1 @center @strong{NOTE} @quotation The @kbd{M-x mh-rmail} command will show you only new mail, not mail you have already read. If you were to run this tour again, you would use @kbd{F r} to pull all your messages into MH-E. @end quotation @sp 1 @kindex @key{RET} @kindex n @kindex p You should see the scan line for your message, and perhaps others. Use @kbd{n} or @kbd{p} to move the cursor to your test message and type @key{RET} to read your message. You should see something like: @cartouche @smallexample 3 t08/24 root received fax files on Wed Aug 24 11:00:13 PDT 1 # 4+t08/24 To:wohler Test< This is a test message to get the wheels churning... --:-- @{show-+inbox@} 4 All L1 (MH-Show)---------------------------- @end smallexample @end cartouche @i{After incorporating new messages} @kindex @key{DEL} @kindex @key{SPC} If you typed a long message, you can view subsequent pages with @key{SPC} and previous pages with @key{DEL}. @node Processing Mail Tour, Leaving MH-E, Reading Mail Tour, Tour Through MH-E @section Processing Mail @cindex processing mail @kindex @key{RET} @kindex r The first thing we want to do is reply to the message that we sent ourselves. Ensure that the cursor is still on the same line as your test message and type @kbd{r}. You are prompted in the minibuffer with @samp{Reply to whom:}. Here MH-E is asking whether you'd like to reply to the original sender only, to the sender and primary recipients, or to the sender and all recipients. You can press @key{TAB} to see these choices. If you simply press @key{RET}, you'll reply only to the sender. Press @key{RET} now. You'll find yourself in an Emacs buffer similar to that when you were sending the original message, like this: @cartouche @smallexample To: cc: Subject: Re: Test In-reply-to: <31054.1142621351@@stop.mail-abuse.org> References: <31054.1142621351@@stop.mail-abuse.org> Comments: In-reply-to Bill Wohler message dated "Fri, 17 Mar 2006 10:49:11 -0800." X-Mailer: MH-E 8.0; nmh 1.1; GNU Emacs 22.1 -------- # --:-- @{draft@} All L10 (MH-Letter)---------------------------------- To: wohler Subject: Test X-Mailer: MH-E 8.0; nmh 1.1; GNU Emacs 22.1 Date: Fri, 17 Mar 2006 10:49:11 -0800 From: Bill Wohler This is a test message to get the wheels churning... --:-- @{show-+inbox@} 4 All L1 (MH-Show)---------------------------- Type C-c C-c to send message, C-c ? for help @end smallexample @end cartouche @i{Composition window during reply} @findex backward-char @findex forward-char @findex next-line @findex previous-line @kindex C-b @kindex C-c C-c @kindex C-c C-f C-t @kindex C-f @kindex C-n @kindex C-p @kindex @key{BS} By default, MH will not add you to the address list of your replies, so if you find that the @samp{To:} header field is missing, don't worry. In this case, type @kbd{C-c C-f C-t} to create and go to the @samp{To:} field, where you can type your login name again. You can move around with the arrow keys or with @kbd{C-p} (@code{previous-line}), @kbd{C-n} (@code{next-line}), @kbd{C-b} (@code{backward-char}), and @kbd{C-f} (@code{forward-char}) and can delete the previous character with @key{BS}. When you're finished editing your message, send it with @kbd{C-c C-c} as before. @cindex @command{refile} @cindex MH commands, @command{refile} @cindex folders @kindex @key{SPC} @kindex o You'll often want to save messages that were sent to you in an organized fashion. This is done with @dfn{folders}. You can use folders to keep messages from your friends, or messages related to a particular topic. With your cursor in the MH-Folder buffer and positioned on the message you sent to yourself, type @kbd{o} to output (@command{refile} in MH parlance) that message to a folder. Enter @kbd{test} at the @samp{Destination folder:} prompt and type @kbd{y} (or @key{SPC}) when MH-E asks to create the folder @samp{+test}. Note that a @samp{^} (caret) appears next to the message number, which means that the message has been marked for refiling but has not yet been refiled. We'll talk about how the refile is actually carried out in a moment. @cindex MH-Folder mode @cindex modes, MH-Folder @kindex d @kindex i @kindex @key{RET} @kindex n @kindex p @kindex x Your previous reply is now waiting in the system mailbox. You incorporate this mail into your MH-Folder buffer named @samp{+inbox} with the @kbd{i} command. Do this now. After the mail is incorporated, use @kbd{n} or @kbd{p} to move the cursor to the new message, and read it with @key{RET}. Let's delete this message by typing @kbd{d}. Note that a @samp{D} appears next to the message number. This means that the message is marked for deletion but is not yet deleted. To perform the deletion (and the refile we did previously), use the @kbd{x} command. @findex mh-smail @kindex m @kindex M-x mh-smail If you want to send another message you can use @kbd{m} instead of @kbd{M-x mh-smail}. So go ahead, send some mail to your friends! @cindex help @cindex prefix characters @findex describe-mode @kindex ? @kindex C-h m @kindex F ? You can get a quick reminder about these commands by typing @kbd{?}. This lists several @dfn{prefix characters}. To list the commands available via the prefix characters, type the prefix character followed by a @kbd{?}, for example, @kbd{F ?}. More complete help is available with the @kbd{C-h m} (@code{describe-mode}) command. @node Leaving MH-E, More About MH-E, Processing Mail Tour, Tour Through MH-E @section Leaving MH-E @cindex Emacs, quitting @cindex quitting @kindex C-x C-c @kindex x You may now wish to exit @command{emacs} entirely. Use @kbd{C-x C-c} to exit @command{emacs}. If you exited without running @kbd{x} in the @samp{+inbox} buffer, Emacs will offer to save it for you. Type @kbd{y} or @key{SPC} to save @samp{+inbox} changes, which means to perform any refiles and deletes that you did there. @findex mh-rmail @kindex C-x b @kindex C-x k @kindex M-x mh-rmail @kindex q If you don't want to leave Emacs, you can type @kbd{q} to bury (hide) the MH-E folder or delete it entirely with @kbd{C-x k}. You can then later recall it with @kbd{C-x b} or @kbd{M-x mh-rmail}. @cindex @command{packf} @cindex MH commands, @command{packf} @cindex exporting folders @cindex folders, exporting @cindex mbox-style folder On the other hand, if you no longer want to use MH and MH-E, you can take your mail with you. You can copy all of your mail into a single file, mbox-style, by using the MH command @command{packf}. For example, to create a file called @file{msgbox} with the messages in your @samp{+inbox} folder, use @samp{packf +inbox}. The @command{packf} command will append the messages to the file if it already exists, so you can use @samp{folders -recurse -fast} in a script to copy all of your messages into a single file, or using the @samp{-file} argument, a file for each folder. @node More About MH-E, , Leaving MH-E, Tour Through MH-E @section More About MH-E These are the basic commands to get you going, but there are plenty more. If you think that MH-E is for you, read the rest of the manual to find out how you can: @itemize @bullet @item Print your messages (@pxref{Printing}). @c ------------------------- @item Edit messages and include your signature (@pxref{Editing Drafts}). @c ------------------------- @item Forward messages (@pxref{Forwarding}). @c ------------------------- @item Read digests (@pxref{Digests}). @c ------------------------- @item Edit bounced messages (@pxref{Editing Again}). @c ------------------------- @item Send multimedia messages (@pxref{Adding Attachments}). @c ------------------------- @item Read HTML messages (@pxref{HTML}). @c ------------------------- @item Use aliases and identities (see @ref{Aliases}, @pxref{Identities}). @c ------------------------- @item Create different views of your mail (see @ref{Threading}, @pxref{Limits}). @c ------------------------- @item Deal with junk mail (@pxref{Junk}). @c ------------------------- @item Handle signed and encrypted messages (see @ref{Reading PGP}, @pxref{Sending PGP}). @c ------------------------- @item Process mail that was sent with @command{shar} or @command{uuencode} (@pxref{Files and Pipes}). @c ------------------------- @item Use sequences conveniently (@pxref{Sequences}). @c ------------------------- @item Use the speedbar, tool bar, and menu bar (see @ref{Speedbar}, see @ref{Tool Bar}, @pxref{Menu Bar}). @c ------------------------- @item Show header fields in different fonts (@pxref{Reading Mail}). @c ------------------------- @item Find previously refiled messages (@pxref{Searching}). @c ------------------------- @item Place messages in a file (@pxref{Files and Pipes}). @end itemize Remember that you can also use MH commands when you're not running MH-E (and when you are!). @node Using This Manual, Incorporating Mail, Tour Through MH-E, Top @chapter Using This Manual This chapter begins the meat of the manual which goes into more detail about every MH-E command and option. @cindex Emacs, info @cindex Emacs, online help @cindex info @cindex online help @findex describe-mode @findex mh-help @kindex ? @kindex C-c ? @kindex C-h C-h @kindex C-h C-k i @kindex C-h i @kindex C-h m There are many commands, but don't get intimidated. There are command summaries at the beginning of each chapter. In case you have or would like to rebind the keys, the command summaries also list the associated Emacs Lisp function. Furthermore, even if you're stranded on a desert island with a laptop and are without your manuals, you can get a summary of all these commands with GNU Emacs online help: use @kbd{C-h m} (@code{describe-mode}) for a brief summary of commands, @kbd{?} (@code{mh-help}) for an even briefer summary@footnote{This help appears in a buffer called @samp{*MH-E Help*} (@pxref{Miscellaneous}).} (@kbd{C-c ?} in MH-Letter mode), or @kbd{C-h i} to read this manual via Info. The online help is quite good; try running @kbd{C-h C-h}. This brings up a list of available help topics, one of which displays the documentation for a given key (like @kbd{C-h k C-n}). Another useful help feature is to view the manual section that describes a given key (such as @kbd{C-h K i}). In addition, review @ref{Conventions}, if any of the GNU Emacs conventions are strange to you. In addition to all of the commands, it is also possible to reconfigure MH-E to fit the needs of even the most demanding user. The following chapters also describe all of the options, show the defaults, and make recommendations for customization. However, when customizing your mail environment, first try to change what you want in MH, and only change MH-E if changing MH is not possible. That way you will get the same behavior inside and outside GNU Emacs. Note that MH-E does not provide hooks for customizations that can be done in MH; this omission is intentional. @cindex Emacs Lisp Manual @cindex Emacs, Emacs Lisp Manual @cindex Emacs, info @cindex Emacs, online help @cindex info @cindex online help I hope I've included enough examples here to get you well on your way. If you want to explore Emacs Lisp further, a programming manual does exist, @c Yes, some of the stuff in the following sections is redundant, but @c TeX barfs if the @ifs are inside the @footnote. @iftex @footnote{The @cite{GNU Emacs Lisp Reference Manual} may be available online in the Info system by typing @kbd{C-h i m Emacs Lisp @key{RET}}. It is also available online at @* @uref{http://www.gnu.org/software/emacs/elisp-manual/html_node/}. You can also order a printed manual, which has the desirable side-effect of helping to support the Free Software Foundation which made all this great software available. You can find an order form by running @kbd{C-h C-d}, or you can request an order form from @i{gnu at gnu.org}.} @end iftex @ifinfo @footnote{@xref{Top, The GNU Emacs Lisp Reference Manual, , elisp, GNU Emacs Lisp Reference Manual}, which may be available online in the Info system. It is also available online at @uref{http://www.gnu.org/software/emacs/elisp-manual/html_node/}. You can also order a printed manual, which has the desirable side-effect of helping to support the Free Software Foundation which made all this great software available. You can find an order form by running @kbd{C-h C-d}, or you can request an order form from @i{gnu at gnu.org}.} @end ifinfo @ifhtml @footnote{The @uref{http://www.gnu.org/software/emacs/elisp-manual/html_node/, The GNU Emacs Lisp Reference Manual} may also be available online in the Info system by typing @kbd{C-h i m Emacs Lisp @key{RET}}. You can also order a printed manual, which has the desirable side-effect of helping to support the Free Software Foundation which made all this great software available. You can find an order form by running @kbd{C-h C-d}, or you can request an order form from @i{gnu at gnu.org}.} @end ifhtml and you can look at the code itself for examples. Look in the Emacs Lisp directory on your system (such as @file{/usr/local/lib/emacs/lisp/mh-e}) and find all the @file{mh-*.el} files there. When calling MH-E and other Emacs Lisp functions directly from Emacs Lisp code, you'll need to know the correct arguments. Use the online help for this. For example, try @kbd{C-h f mh-execute-commands @key{RET}}. If you write your own functions, please do not prefix your symbols (variables and functions) with @samp{mh-}. This prefix is reserved for the MH-E package. To avoid conflicts with existing MH-E symbols, use a prefix like @samp{my-} or your initials. (Unless, of course, your initials happen to be @emph{mh}!) @menu * Options:: * Ranges:: * Folder Selection:: @end menu @node Options, Ranges, Using This Manual, Using This Manual @section Options @cindex Emacs, customizing @cindex Emacs, setting options @cindex customizing MH-E @cindex setting options @findex customize-option @vindex mh-lpr-command-format, example Many string or integer options are easy to modify using @kbd{M-x customize-option}. For example, to modify the option that controls printing, you would run @kbd{M-x customize-option @key{RET} mh-lpr-command-format @key{RET}}. In the buffer that appears, modify the string to the right of the variable. For example, you may change the @command{lpr} command with @samp{nenscript -G -r -2 -i'%s'}. Then use the @samp{State} combo box and select @samp{Save for Future Sessions}. To read more about @code{mh-lpr-command-format}, see @ref{Printing}. @cindex nil @cindex off, option @cindex on, option @cindex option, turning on and off @cindex t @findex customize-option @vindex mh-bury-show-buffer-flag, example Options can also hold boolean values. In Emacs Lisp, the boolean values are @code{nil}, which means false, and @code{t}, which means true. The @code{customize-option} function makes it easy to change boolean values; simply click on the toggle button in the customize buffer to switch between @samp{on} (@code{t}) and @samp{off} (@code{nil}). For example, try setting @code{mh-bury-show-buffer-flag} to @samp{off} to keep the MH-Show buffer at the top of the buffer stack. Use the @samp{State} combo box and choose @samp{Set for Current Session} to see how the option affects the show buffer. Then choose the @samp{Erase Customization} menu item to reset the option to the default, which places the MH-Show buffer at the bottom of the buffer stack. @vindex mh-mhl-format-file, example The text usually says to turn on an option by setting it to a @emph{non-@code{nil}} value, because sometimes values other than @samp{on} are meaningful. An example of this is the variable @code{mh-mhl-format-file} (@pxref{Viewing}). Other options, such as hooks, involve a little more Emacs Lisp programming expertise. @cindex customization group, @samp{mh} @cindex @samp{mh} customization group @findex customize-group @findex mh-customize You can browse all of the MH-E options with the @code{customize-group} function. Try entering @kbd{M-x customize-group @key{RET} mh @key{RET}} to view the top-level options as well as buttons for all of the MH-E customization groups. Another way to view the MH-E customization group is to use @kbd{M-x mh-customize @key{RET}}. @node Ranges, Folder Selection, Options, Using This Manual @section Ranges @c Sync with mh-folder-mode docstring. @cindex message abbreviations @cindex message ranges @cindex ranges Many commands that operate on individual messages, such as @code{mh-forward} or @code{mh-refile-msg} take a @code{RANGE} argument. This argument can be used in several ways. @kindex C-u, with ranges If you provide the prefix argument @kbd{C-u} to these commands, then you will be prompted for the message range. This can be any valid MH range which can include messages, sequences (@pxref{Sequences}), and the abbreviations (described in the @command{mh}(1) man page): @table @samp @item - Indicates all messages in the range to , inclusive. The range must be nonempty. @c ------------------------- @item :N @itemx :+N @itemx :-N Up to N messages beginning with (or ending with) message num. Num may be any of the predefined symbols: first, prev, cur, next or last. @c ------------------------- @item first:N @itemx prev:N @itemx next:N @itemx last:N The first, previous, next or last messages, if they exist. @c ------------------------- @item all All of the messages. @end table For example, a range that shows all of these things is @samp{1 2 3 5-10 last:5 unseen}. @vindex transient-mark-mode If the option @code{transient-mark-mode} is turned on and you set a region in the MH-Folder buffer, then the MH-E command will perform the operation on all messages in that region. @cindex @samp{mh-range} customization group @cindex customization group, @samp{mh-range} The @samp{mh-range} customization group contains a single option which affects how ranges are interpreted. @vtable @code @item mh-interpret-number-as-range-flag On means interpret a number as a range (default: @samp{on}). @end vtable @vindex mh-interpret-number-as-range-flag Since one of the most frequent ranges used is @samp{last:N}, MH-E will interpret input such as @samp{200} as @samp{last:200} if the @code{mh-interpret-number-as-range-flag} option is on (which is the default). If you need to scan just the message 200, then use the range @samp{200:1} or @samp{200-200}. @node Folder Selection, , Ranges, Using This Manual @section Folder Selection @cindex completion, folders @cindex folders, completion @cindex folders, selecting When you choose a folder in MH-E via a command such as @kbd{o} (@code{mh-refile-msg}), completion is used to enter the folder @ifnothtml (@pxref{Completion, , , emacs, The GNU Emacs Manual}). @end ifnothtml @ifhtml (see the section @uref{http://www.gnu.org/software/emacs/manual/html_node/Completion.html, Completion} in @cite{The GNU Emacs Manual}). @end ifhtml In addition, MH-E has several ways of choosing a suitable default so that the folder can often be selected with a single @key{RET} key. @cindex customization group, @samp{mh-folder-selection} @cindex @samp{mh-folder-selection} customization group The @samp{mh-folder-selection} customization group contains some options which are used to help with this. @vtable @code @item mh-default-folder-for-message-function Function to select a default folder for refiling or @samp{Fcc:} (default: @code{nil}). @c ------------------------- @item mh-default-folder-list List of addresses and folders (default: @code{nil}). @c ------------------------- @item mh-default-folder-must-exist-flag On means guessed folder name must exist to be used (default: @samp{on}). @c ------------------------- @item mh-default-folder-prefix Prefix used for folder names generated from aliases (default: @code{""}). @end vtable @vindex mh-default-folder-for-message-function You can set the option @code{mh-default-folder-for-message-function} to a function that provides a default folder for the message to be refiled. When this function is called, the current buffer contains the message being refiled and point is at the start of the message. This function should return the default folder as a string with a leading @samp{+} sign. It can also return @code{nil} so that the last folder name is used as the default, or an empty string to suppress the default entirely. Otherwise, the name of the destination folder is derived from the sender as follows: @enumerate @vindex mh-default-folder-list @item The folder name associated with the first address found in the list @code{mh-default-folder-list} is used. Each element in this list contains a @samp{Check Recipient} item. If this item is turned on, then the address is checked against the recipient instead of the sender. This is useful for mailing lists. @c ------------------------- @vindex mh-default-folder-prefix @item An alias prefixed by @code{mh-default-folder-prefix} corresponding to the address is used. The prefix is used to prevent clutter in your mail directory. @xref{Aliases}. @end enumerate @vindex mh-default-folder-must-exist-flag If the derived folder does not exist, and @code{mh-default-folder-must-exist-flag} is @code{t}, then the last folder name used is suggested. This is useful if you get mail from various people for whom you have an alias, but file them all in the same project folder. @node Incorporating Mail, Reading Mail, Using This Manual, Top @chapter Incorporating Your Mail @cindex @samp{Folder} menu @cindex incorporating @cindex menu, @samp{Folder} This chapter talks about getting mail from your system mailbox into your MH @samp{+inbox} folder. The following command accomplishes that and is found in the @samp{Folder} menu. @table @kbd @cindex @samp{Folder > Incorporate New Mail} menu item @cindex menu item, @samp{Folder > Incorporate New Mail} @findex mh-inc-folder @kindex i @item i Incorporate new mail into a folder (@code{mh-inc-folder}). @end table @cindex @samp{mh-inc} customization group @cindex customization group, @samp{mh-inc} The following options in the @samp{mh-inc} customization group are used. @vtable @code @item mh-inc-prog Program to incorporate mail (default: @code{"inc"}). @c ------------------------- @item mh-inc-spool-list Alternate spool files (default: @code{nil}). @end vtable The following hook is available. @vtable @code @findex mh-inc-folder @item mh-inc-folder-hook Hook run by @code{mh-inc-folder} after incorporating mail into a folder (default: @code{nil}). @end vtable @cindex @samp{+inbox} @findex mh-inc-folder @kindex i If at any time you receive new mail, incorporate the new mail into your @samp{+inbox} buffer with @kbd{i} (@code{mh-inc-folder}). Note that @kbd{i} will display the @samp{+inbox} buffer, even if there isn't any new mail. You can incorporate mail from any file into the current folder by specifying a prefix argument; you'll be prompted for the name of the file to use as well as the destination folder (for example, @kbd{C-u i ~/mbox @key{RET} +tmp @key{RET}}). @cindex @file{.emacs} @cindex Emacs, notification of new mail @cindex files, @file{.emacs} @cindex new mail @cindex notification of new mail Emacs can notify you when you have new mail by displaying @samp{Mail} in the mode line. To enable this behavior, and to have a clock in the mode line as well, add the following to @file{~/.emacs}: @findex display-time @smalllisp (display-time) @end smalllisp @cindex @command{inc} @cindex incorporating @cindex MH commands, @command{inc} @vindex mh-inc-prog @vindex mh-progs The name of the program that incorporates new mail is stored in @code{mh-inc-prog}; it is @code{"inc"} by default. This program generates a one-line summary for each of the new messages. Unless it is an absolute pathname, the file is assumed to be in the @code{mh-progs} directory (@pxref{Getting Started}). You may also link a file to @command{inc} that uses a different format (see @samp{mh-profile}(5), and sections @uref{@value{MH-BOOK-HOME}/reapre.html, Reading Mail: inc show next prev} and @uref{@value{MH-BOOK-HOME}/mhstr.html, MH Format Strings} in the MH book). You'll then need to modify several variables appropriately (@pxref{Scan Line Formats}). @vindex mh-inc-spool-list You can use the @code{mh-inc-spool-list} variable to direct MH-E to retrieve mail from arbitrary spool files other than your system mailbox, file it in folders other than your @samp{+inbox}, and assign key bindings to incorporate this mail. @cindex @command{procmail} @cindex @file{.procmailrc} @cindex Unix commands, @command{procmail} @cindex files, @file{.procmailrc} Suppose you are subscribed to the @i{mh-e-devel} mailing list and you use @command{procmail} to filter this mail into @file{~/mail/mh-e} with the following recipe in @file{.procmailrc}: @smallexample PATH=$PATH:/usr/bin/mh MAILDIR=$HOME/`mhparam Path` :0: * ^From mh-e-devel-admin@@stop.mail-abuse.org mh-e @end smallexample @findex mh-inc-spool-* @kindex I * In order to incorporate @file{~/mail/mh-e} into @samp{+mh-e} with an @kbd{I m} (@code{mh-inc-spool-mh-e}) command, customize this option, and click on the @samp{INS} button. Enter a @samp{Spool File} of @samp{~/mail/mh-e}, a @samp{Folder} of @samp{mh-e}, and a @samp{Key Binding} of @samp{m}. @cindex @command{emacsclient} @cindex @command{gnuclient} @cindex @command{xbuffy} @cindex @samp{gnuserv} @cindex Unix commands, @command{emacsclient} @cindex Unix commands, @command{gnuclient} @cindex Unix commands, @command{xbuffy} You can use @command{xbuffy} to automate the incorporation of this mail using the Emacs 22 command @command{emacsclient} as follows: @smallexample box ~/mail/mh-e title mh-e origMode polltime 10 headertime 0 command emacsclient --eval '(mh-inc-spool-mh-e)' @end smallexample In XEmacs, the command @command{gnuclient} is used in a similar fashion. @findex mh-inc-folder @kindex i @vindex mh-inc-folder-hook You can set the hook @code{mh-inc-folder-hook}, which is called after new mail is incorporated by the @kbd{i} (@code{mh-inc-folder}) command. A good use of this hook is to rescan the whole folder either after running @kbd{M-x mh-rmail} the first time or when you've changed the message numbers from outside of MH-E. @findex mh-execute-commands @findex mh-rescan-folder, example @findex mh-show, example @vindex mh-inc-folder-hook, example @smalllisp @group (defun my-mh-inc-folder-hook () "Hook to rescan folder after incorporating mail." (if (buffer-modified-p) ; @r{if outstanding refiles and deletes,} (mh-execute-commands)) ; @r{carry them out} (mh-rescan-folder) ; @r{synchronize with +inbox} (mh-show)) ; @r{show the current message} (add-hook 'mh-inc-folder-hook 'my-mh-inc-folder-hook) @i{Rescan folder after incorporating new mail via mh-inc-folder-hook} @end group @end smalllisp @node Reading Mail, Folders, Incorporating Mail, Top @chapter Reading Your Mail @cindex @samp{+inbox} @cindex MH-Folder mode @cindex MH-Show mode @cindex modes, MH-Folder @cindex modes, MH-Show @cindex reading mail @findex mh-rmail @kindex F r @kindex F v @kindex M-x mh-rmail The MH-E entry point for reading mail is @kbd{M-x mh-rmail}. This command incorporates your mail and creates a buffer called @samp{+inbox} in MH-Folder mode. The command @kbd{M-x mh-rmail} shows you only new mail, not mail you have already read@footnote{If you want to see your old mail as well, use @kbd{F r} to pull all your messages into MH-E. Or, give a prefix argument to @code{mh-rmail} so it will prompt you for folder to visit like @kbd{F v} (for example, @kbd{C-u M-x mh-rmail @key{RET} bob @key{RET}}). @xref{Folders}.}. @findex display-time @vindex read-mail-command There are some commands that need to read mail, such as @kbd{Mouse-2} over the @samp{Mail} button that @code{display-time} adds to the mode line. You can configure Emacs to have these commands use MH-E by setting the option @code{read-mail-command} to @samp{mh-rmail}. @cindex @command{scan} @cindex @samp{Message} menu @cindex MH commands, @command{scan} @cindex menu, @samp{Message} @cindex scan lines The @samp{+inbox} buffer contains @dfn{scan lines}, which are one-line summaries of each incorporated message. You can perform most MH commands on these messages via one- or two-letter commands in either the MH-Folder or MH-Show buffers or by using the @samp{Message} menu. See @command{scan}(1) for a description of the contents of the scan lines, and see the Figure in @ref{Reading Mail Tour}, for an example. @table @kbd @kindex ? @findex mh-help @item ? Display cheat sheet for the MH-E commands (@code{mh-help}). @c ------------------------- @cindex @samp{Message > Show Message} menu item @cindex menu item, @samp{Message > Show Message} @kindex @key{RET} @findex mh-show @item @key{RET} Display message (@code{mh-show}). @c ------------------------- @cindex @samp{Message > Show Message with Header} menu item @cindex menu item, @samp{Message > Show Message with Header} @kindex , (comma) @findex mh-header-display @item , (comma) Display message with all header fields (@code{mh-header-display}). @c ------------------------- @kindex ; (semicolon) @findex mh-toggle-mh-decode-mime-flag @item ; (semicolon) Toggle the value of @code{mh-decode-mime-flag} (@code{mh-toggle-mh-decode-mime-flag}). @c ------------------------- @kindex @key{SPC} @findex mh-page-msg @item @key{SPC} Display next page in message (@code{mh-page-msg}). @c ------------------------- @kindex @key{BS} @findex mh-previous-page @item @key{BS} Display previous page in message (@code{mh-previous-page}). @c ------------------------- @cindex @samp{Message > Write Message to File...} menu item @cindex menu item, @samp{Message > Write Message to File...} @kindex > @findex mh-write-msg-to-file @item > Append message to end of file (@code{mh-write-msg-to-file}). @c ------------------------- @cindex @samp{Message > Pipe Message to Command...} menu item @cindex menu item, @samp{Message > Pipe Message to Command...} @kindex | @findex mh-pipe-msg @item | Pipe message through shell command (@code{mh-pipe-msg}). @c ------------------------- @kindex C-d @findex mh-delete-msg-no-motion @item C-d Delete range, don't move to next message (@code{mh-delete-msg-no-motion}). @c ------------------------- @cindex @samp{Message > Delete Message} menu item @cindex menu item, @samp{Message > Delete Message} @kindex d @findex mh-delete-msg @item d Delete range (@code{mh-delete-msg}). @c ------------------------- @kindex D ? @findex mh-prefix-help @item D ? Display cheat sheet for the commands of the current prefix in minibuffer (@code{mh-prefix-help}). @c ------------------------- @kindex D @key{SPC} @findex mh-page-digest @item D @key{SPC} Display next message in digest (@code{mh-page-digest}). @c ------------------------- @kindex D @key{BS} @findex mh-page-digest-backwards @item D @key{BS} Display previous message in digest (@code{mh-page-digest-backwards}). @c ------------------------- @cindex @samp{Message > Burst Digest Message} menu item @cindex menu item, @samp{Message > Burst Digest Message} @kindex D b @findex mh-burst-digest @item D b Break up digest into separate messages (@code{mh-burst-digest}). @c ------------------------- @cindex @samp{Message > Go to Message by Number...} menu item @cindex menu item, @samp{Message > Go to Message by Number...} @kindex g @findex mh-goto-msg @item g Go to a message (@code{mh-goto-msg}). @c ------------------------- @kindex k @findex mh-delete-subject-or-thread @item k Delete messages with same subject or thread (@code{mh-delete-subject-or-thread}). @c ------------------------- @kindex K ? @findex mh-prefix-help @item K ? Display cheat sheet for the commands of the current prefix in minibuffer (@code{mh-prefix-help}). @c ------------------------- @kindex K @key{TAB} @findex mh-next-button @item K @key{TAB} Go to the next button (@code{mh-next-button}). @c ------------------------- @kindex K S-@key{TAB} @findex mh-prev-button @item K S-@key{TAB} Go to the previous button (@code{mh-prev-button}). @c ------------------------- @kindex K a @findex mh-mime-save-parts @item K a Save attachments (@code{mh-mime-save-parts}). @c ------------------------- @kindex K e @findex mh-display-with-external-viewer @item K e View attachment externally (@code{mh-display-with-external-viewer}). @c ------------------------- @kindex K i @findex mh-folder-inline-mime-part @item K i Show attachment verbatim (@code{mh-folder-inline-mime-part}). @c ------------------------- @kindex K o @findex mh-folder-save-mime-part @item K o Save (output) attachment (@code{mh-folder-save-mime-part}). @c ------------------------- @kindex K t @findex mh-toggle-mime-buttons @item K t Toggle option @code{mh-display-buttons-for-inline-parts-flag} (@code{mh-toggle-mime-buttons}). @c ------------------------- @kindex K v @findex mh-folder-toggle-mime-part @item K v View attachment (@code{mh-folder-toggle-mime-part}). @c ------------------------- @cindex @samp{Message > Modify Message} menu item @cindex menu item, @samp{Message > Modify Message} @kindex M @findex mh-modify @item M Edit message (@code{mh-modify}). @c ------------------------- @cindex @samp{Message > Go to First Message} menu item @cindex menu item, @samp{Message > Go to First Message} @kindex M-< @findex mh-first-msg @item M-< Display first message (@code{mh-first-msg}). @c ------------------------- @cindex @samp{Message > Go to Last Message} menu item @cindex menu item, @samp{Message > Go to Last Message} @kindex M-> @findex mh-last-msg @item M-> Display last message (@code{mh-last-msg}). @c ------------------------- @kindex M-n @findex mh-next-unread-msg @item M-n Display next unread message (@code{mh-next-unread-msg}). @c ------------------------- @kindex M-p @findex mh-previous-unread-msg @item M-p Display previous unread message (@code{mh-previous-unread-msg}). @c ------------------------- @cindex @samp{Message > Next Message} menu item @cindex menu item, @samp{Message > Next Message} @kindex n @findex mh-next-undeleted-msg @item n Display next message (@code{mh-next-undeleted-msg}). @c ------------------------- @cindex @samp{Message > Previous Message} menu item @cindex menu item, @samp{Message > Previous Message} @kindex p @findex mh-previous-undeleted-msg @item p Display previous message (@code{mh-previous-undeleted-msg}). @c ------------------------- @kindex P ? @findex mh-prefix-help @item P ? Display cheat sheet for the commands of the current prefix in minibuffer (@code{mh-prefix-help}). @c ------------------------- @kindex P C @findex mh-ps-print-toggle-color @item P C Toggle whether color is used in printing messages (@code{mh-ps-print-toggle-color}). @c ------------------------- @kindex P F @findex mh-ps-print-toggle-faces @item P F Toggle whether printing is done with faces or not (@code{mh-ps-print-toggle-faces}). @c ------------------------- @kindex P f @findex mh-ps-print-msg-file @item P f Print range to file (@code{mh-ps-print-msg-file}). @c ------------------------- @cindex @samp{Message > Print Message} menu item @cindex menu item, @samp{Message > Print Message} @kindex P l @findex mh-print-msg @item P l Print range the old fashioned way (@code{mh-print-msg}). @c ------------------------- @kindex P p @findex mh-ps-print-msg @item P p Print range (@code{mh-ps-print-msg}). @c ------------------------- @kindex X ? @findex mh-prefix-help @item X ? Display cheat sheet for the commands of the current prefix in minibuffer (@code{mh-prefix-help}). @c ------------------------- @cindex @samp{Message > Unpack Uuencoded Message...} menu item @cindex menu item, @samp{Message > Unpack Uuencoded Message...} @kindex X s @kindex X u @findex mh-store-msg @item X s @itemx X u Unpack message created with @command{uudecode} or @command{shar} (@code{mh-store-msg}). @c ------------------------- @kindex Mouse-2 @findex mh-show-mouse @item Mouse-2 Move point to mouse event and show message (@code{mh-show-mouse}). @end table Within the MH-Show buffer, the following command is defined. @table @kbd @kindex @key{RET} @kindex Mouse-1 @kindex Mouse-2 @findex mh-press-button @item @key{RET} @itemx Mouse-1 @itemx Mouse-2 View contents of button (@code{mh-press-button}). @end table @cindex @samp{mh-show} customization group @cindex customization group, @samp{mh-show} The following table lists options in the @samp{mh-show} customization group that are used while reading mail. @vtable @code @item mh-bury-show-buffer-flag On means show buffer is buried (default: @samp{on}). @c ------------------------- @item mh-clean-message-header-flag On means remove extraneous header fields (default: @samp{on}). @c ------------------------- @item mh-decode-mime-flag On means attachments are handled (default: @samp{on} if the Gnus @samp{mm-decode} package is present). @c ------------------------- @item mh-display-buttons-for-alternatives-flag On means display buttons for all alternative attachments (default: @samp{off}). @c ------------------------- @item mh-display-buttons-for-inline-parts-flag On means display buttons for all inline attachments (default: @samp{off}). @c ------------------------- @item mh-do-not-confirm-flag On means non-reversible commands do not prompt for confirmation (default: @samp{off}). @c ------------------------- @item mh-fetch-x-image-url Control fetching of @samp{X-Image-URL:} header field image (default: @samp{Never Fetch}). @c ------------------------- @item mh-graphical-smileys-flag On means graphical smileys are displayed (default: @samp{on}). @c ------------------------- @item mh-graphical-emphasis-flag On means graphical emphasis is displayed (default: @samp{on}). @c ------------------------- @item mh-highlight-citation-style Style for highlighting citations (default: @samp{Multicolor}). @c ------------------------- @item mh-invisible-header-fields-default List of hidden header fields (default: a checklist too long to list here). @c ------------------------- @item mh-invisible-header-fields Additional header fields to hide (default: @code{nil}). @c ------------------------- @item mh-lpr-command-format Command used to print (default: @code{"lpr -J '%s'"}). @c ------------------------- @item mh-max-inline-image-height Maximum inline image height if @samp{Content-Disposition:} is not present (default: 0). @c ------------------------- @item mh-max-inline-image-width Maximum inline image width if @samp{Content-Disposition:} is not present(default: 0). @c ------------------------- @item mh-mhl-format-file Specifies the format file to pass to the @command{mhl} program (default: @samp{Use Default mhl Format (Printing Only)}). @c ------------------------- @item mh-mime-save-parts-default-directory Default directory to use for @kbd{K a}. @c ------------------------- @item mh-print-background-flag On means messages should be printed in the background (default: @samp{off}). @c ------------------------- @item mh-show-buffer-mode-line-buffer-id Format string to produce @code{mode-line-buffer-identification} for show buffers (default: @code{" @{show-%s@} %d"}). @c ------------------------- @item mh-show-maximum-size Maximum size of message (in bytes) to display automatically (default: 0). @c ------------------------- @item mh-show-use-xface-flag On means display face images in MH-Show buffers (default: @samp{on}). @c ------------------------- @item mh-store-default-directory Default directory for @kbd{X s} (default: @samp{Current}). @c ------------------------- @item mh-summary-height Number of lines in MH-Folder buffer (including the mode line) (default: depends on size of frame). @end vtable The following hooks are available. @vtable @code @item mh-delete-msg-hook Hook run after marking each message for deletion (default: @code{nil}). @c ------------------------- @item mh-show-hook Hook run after @key{RET} shows a message (default: @code{nil}). @c ------------------------- @item mh-show-mode-hook Hook run upon entry to @code{mh-show-mode} (default: @code{nil}). @end vtable The following faces are available. @vtable @code @item mh-show-cc Face used to highlight @samp{cc:} header fields. @c ------------------------- @item mh-show-date Face used to highlight @samp{Date:} header fields. @c ------------------------- @item mh-show-from Face used to highlight @samp{From:} header fields. @c ------------------------- @item mh-show-header Face used to deemphasize less interesting header fields. @c ------------------------- @item mh-show-pgg-bad Bad PGG signature face. @c ------------------------- @item mh-show-pgg-good Good PGG signature face. @c ------------------------- @item mh-show-pgg-unknown Unknown or untrusted PGG signature face. @c ------------------------- @item mh-show-signature Signature face. @c ------------------------- @item mh-show-subject Face used to highlight @samp{Subject:} header fields. @c ------------------------- @item mh-show-to Face used to highlight @samp{To:} header fields. @c ------------------------- @item mh-show-xface X-Face image face. @end vtable The functions and variables introduced here are explained in more detail in the following sections. @menu * Viewing:: * Viewing Attachments:: * HTML:: * Digests:: * Reading PGP:: * Printing:: * Files and Pipes:: * Navigating:: * Miscellaneous Commands and Options:: @end menu @node Viewing, Viewing Attachments, Reading Mail, Reading Mail @section Viewing Your Mail @findex mh-header-display @findex mh-page-msg @findex mh-previous-page @findex mh-show @findex mh-show-mouse @kindex , (comma) @kindex . (period) @kindex @key{BS} @kindex @key{RET} @kindex @key{SPC} @kindex Mouse-2 The command @key{RET} (@code{mh-show}) displays the message that the cursor is on while @kbd{Mouse-2} (@code{mh-show-mouse}) displays the message that the mouse cursor is on. If the message is already displayed, it scrolls to the beginning of the message. Use @key{SPC} (@code{mh-page-msg}) and @key{BS} (@code{mh-previous-page}) to move forwards and backwards one page at a time through the message. You can give either of these commands a prefix argument that specifies the number of lines to scroll (such as @kbd{10 @key{SPC}}). The @key{SPC} command will also show the next undeleted message if it is used at the bottom of a message. MH-E normally hides a lot of the superfluous header fields that mailers add to a message, but if you wish to see all of them, use the command @kbd{,} (comma; @code{mh-header-display}). @vindex mh-show-maximum-size The option @code{mh-show-maximum-size} provides an opportunity to skip over large messages which may be slow to load. The default value of 0 means that all message are shown regardless of size. A litany of options control what displayed messages look like. @vindex mh-show-cc @vindex mh-show-date @vindex mh-show-from @vindex mh-show-header @vindex mh-show-subject @vindex mh-show-to First, the appearance of the header fields can be modified by customizing the associated face: @code{mh-show-to}, @code{mh-show-cc}, @code{mh-show-from}, @code{mh-show-date}, and @code{mh-show-subject}. The face @code{mh-show-header} is used to deemphasize the other, less interesting, header fields. @cindex regular expressions, @code{mh-invisible-header-fields} @vindex mh-clean-message-header-flag @vindex mh-invisible-header-fields @vindex mh-invisible-header-fields-default Normally messages are delivered with a handful of uninteresting header fields. These are hidden by turning on the option @code{mh-clean-message-header-flag} (which it is by default). The header fields listed in the option @code{mh-invisible-header-fields-default} are hidden, although you can check off any field that you would like to see. Header fields that you would like to hide that aren't listed can be added to the option @code{mh-invisible-header-fields} with a couple of caveats. Regular expressions are not allowed. Unique fields should have a @samp{:} suffix; otherwise, the element can be used to render invisible an entire class of fields that start with the same prefix. If you think a header field should be generally ignored, report a bug (@pxref{Bug Reports}). @cindex header field, @samp{Face:} @cindex header field, @samp{X-Face:} @cindex header field, @samp{X-Image-URL:} @cindex @samp{Face:} header field @cindex @samp{X-Face:} header field @cindex @samp{X-Image-URL:} header field @vindex mh-show-use-xface-flag MH-E can display the content of @samp{Face:}, @samp{X-Face:}, and @samp{X-Image-URL:} header fields. If any of these fields occur in the header of your message, the sender's face will appear in the @samp{From:} header field. If more than one of these fields appear, then the first field found in the order @samp{Face:}, @samp{X-Face:}, and @samp{X-Image-URL:} will be used. The option @code{mh-show-use-xface-flag} is used to turn this feature on and off. This feature will be turned on by default if your system supports it. The first header field used, if present, is the Gnus-specific @samp{Face:} field@footnote{The @samp{Face:} field appeared in GNU Emacs 21 and XEmacs. For more information, see @uref{http://quimby.gnus.org/circus/face/}.}. @cindex @command{uncompface} @cindex Emacs, packages, x-face @cindex Unix commands, @command{uncompface} @cindex x-face package @vindex mh-show-xface Next is the traditional @samp{X-Face:} header field@footnote{The display of this field requires the @uref{ftp://ftp.cs.indiana.edu/pub/faces/compface/compface.tar.Z, @command{uncompface} program}. Recent versions of XEmacs have internal support for @samp{X-Face:} images. If your version of XEmacs does not, then you'll need both @command{uncompface} and the @uref{ftp://ftp.jpl.org/pub/elisp/, @samp{x-face} package}.}. MH-E renders the foreground and background of the image using the associated attributes of the face @code{mh-show-xface}. @cindex @command{convert} @cindex @command{wget} @cindex ImageMagick @cindex Unix commands, @command{convert} @cindex Unix commands, @command{wget} @vindex mh-fetch-x-image-url Finally, MH-E will display images referenced by the @samp{X-Image-URL:} header field if neither the @samp{Face:} nor the @samp{X-Face:} fields are present@footnote{The display of the images requires the @uref{http://www.gnu.org/software/wget/wget.html, @command{wget} program} to fetch the image and the @command{convert} program from the @uref{http://www.imagemagick.org/, ImageMagick suite}.}. Of the three header fields this is the most efficient in terms of network usage since the image doesn't need to be transmitted with every single mail. The option @code{mh-fetch-x-image-url} controls the fetching of the @samp{X-Image-URL:} header field image with the following values: @table @samp @item Ask Before Fetching You are prompted before the image is fetched. MH-E will remember your reply and will either use the already fetched image the next time the same URL is encountered or silently skip it if you didn't fetch it the first time. This is a good setting. @c ------------------------- @item Never Fetch Images are never fetched and only displayed if they are already present in the cache. This is the default. @end table There isn't a value of @samp{Always Fetch} for privacy and DOS (denial of service) reasons. For example, fetching a URL can tip off a spammer that you've read his email (which is why you shouldn't blindly answer yes if you've set this option to @samp{Ask Before Fetching}). Someone may also flood your network and fill your disk drive by sending a torrent of messages, each specifying a unique URL to a very large file. @cindex @file{.mhe-x-image-cache} @cindex files, @file{.mhe-x-image-cache} The cache of images is found in the directory @file{.mhe-x-image-cache} within your MH directory. You can add your own face to the @samp{From:} field too. @xref{Picture}. @cindex @command{mhl} @cindex MH commands, @command{mhl} @vindex mh-mhl-format-file Normally MH-E takes care of displaying messages itself (rather than calling an MH program to do the work). If you'd rather have @command{mhl} display the message (within MH-E), change the option @code{mh-mhl-format-file} from its default value of @samp{Use Default mhl Format (Printing Only)}. You can set this option to @samp{Use Default mhl Format} to get the same output as you would get if you ran @command{mhl} from the shell. If you have a format file that you want MH-E to use, you can set this option to @samp{Specify an mhl Format File} and enter the name of your format file (@command{mhl}(1) or section @uref{@value{MH-BOOK-HOME}/shomes.html#Usisho, Using mhl} in the MH book tells you how to write one). Your format file should specify a non-zero value for @samp{overflowoffset} to allow MH-E to parse the header. Note that @command{mhl} is always used for printing and forwarding; in this case, the value of @code{mh-mhl-format-file} is consulted if you have specified a format file. @cindex citations, highlighting @cindex highlighting citations @vindex mh-highlight-citation-style If the sender of the message has cited other messages in his message, then MH-E will highlight these citations to emphasize the sender's actual response. The option @code{mh-highlight-citation-style} can be customized to change the highlighting style. The @samp{Multicolor} method uses a different color for each indentation while the @samp{Monotone} method highlights all citations in red. To disable highlighting of citations entirely, choose @samp{None}. @cindex URLs, highlighting @cindex email addresses, highlighting @cindex highlighting URLs @cindex highlighting email addresses @cindex links, following @findex goto-address-at-point @kindex C-c @key{RET} @kindex Mouse-2 @vindex goto-address-highlight-p Email addresses and URLs in the message are highlighted if the option @code{goto-address-highlight-p} is on, which it is by default. To view the web page for a highlighted URL or to send a message using a highlighted email address, use @kbd{Mouse-2} or @kbd{C-c @key{RET}} (@code{goto-address-at-point}). @xref{Sending Mail}, to see how to configure Emacs to send the message using MH-E. @cindex boldface, showing @cindex emphasis @cindex italics, showing @cindex smileys @cindex typesetting @cindex underline, showing @vindex gnus-emphasis-alist @vindex mh-decode-mime-flag @vindex mh-graphical-emphasis-flag @vindex mh-graphical-smileys-flag It is a long standing custom to inject body language using a cornucopia of punctuation, also known as the @dfn{smileys}. MH-E can render these as graphical widgets if the option @code{mh-graphical-smileys-flag} is turned on, which it is by default. Smileys include patterns such as :-) and ;-). Similarly, a few typesetting features are indicated in ASCII text with certain characters. If your terminal supports it, MH-E can render these typesetting directives naturally if the option @code{mh-graphical-emphasis-flag} is turned on, which it is by default. For example, _underline_ will be @ifhtml @html underlined, @end html @end ifhtml @ifnothtml underlined, @end ifnothtml *bold* will appear in @b{bold}, /italics/ will appear in @i{italics}, and so on. See the option @code{gnus-emphasis-alist} for the whole list. Both of these options are disabled if the option @code{mh-decode-mime-flag} is turned off. @xref{Viewing Attachments}. @cindex signature separator @cindex vCard @vindex mh-show-signature MH-E normally renders signatures and vCards in italics so that the body of the message stands out more. MH-E depends on the presence of the @dfn{signature separator} (@code{"-- "}) to do this. You can also customize the face @code{mh-show-signature} so the appearance of the signature block is more to your liking. @vindex mh-show-hook @vindex mh-show-mode-hook Two hooks can be used to control how messages are displayed. The first hook, @code{mh-show-mode-hook}, is called early on in the process of the message display. It is usually used to perform some action on the message's content. The second hook, @code{mh-show-hook}, is the last thing called after messages are displayed. It's used to affect the behavior of MH-E in general or when @code{mh-show-mode-hook} is too early. @cindex MH-Show mode @cindex modes, MH-Show @vindex mh-show-buffer-mode-line-buffer-id For those who like to modify their mode lines, use @code{mh-show-buffer-mode-line-buffer-id} to modify the mode line in the MH-Show buffers. Place the two escape strings @samp{%s} and @samp{%d}, which will display the folder name and the message number, respectively, somewhere in the string in that order. The default value of @code{"@{show-%s@} %d"} yields a mode line of @smallexample -----@{show-+inbox@} 4 (MH-Show)--Bot-------------------------------- @end smallexample @node Viewing Attachments, HTML, Viewing, Reading Mail @section Viewing Attachments @cindex attachments @cindex body parts @cindex @command{mhshow} @cindex @command{show} @cindex MH commands, @command{mhshow} @cindex MH commands, @command{show} @cindex MIME @cindex multimedia mail MH has the ability to display @dfn{@sc{mime}} (Multipurpose Internet Mail Extensions) messages which are simply messages with additional @dfn{body parts} or @dfn{attachments}. You can use the MH commands @command{show}@footnote{See the section @uref{@value{MH-BOOK-HOME}/reapre.html, Reading Mail: inc show next prev} in the MH book.} or @command{mhshow}@footnote{See the section @uref{@value{MH-BOOK-HOME}/usimim.html#ReMIMa, Reading MIME Mail} in the MH book.} from the shell to read @sc{mime} messages@footnote{You can call them directly from Emacs if you're running the X Window System: type @kbd{M-! xterm -e mhshow @var{message-number}}. You can leave out the @samp{xterm -e} if you use @command{mhlist} or @command{mhstore}.}. @cindex Emacs, packages, mm-decode @cindex mm-decode package @findex mh-toggle-mh-decode-mime-flag @kindex ; (semicolon) @vindex mh-decode-mime-flag MH-E can handle attachments as well if the Gnus @samp{mm-decode} package is present. If so, the option @code{mh-decode-mime-flag} will be on. Otherwise, you'll see the @sc{mime} body parts rather than text or attachments. There isn't much point in turning off the option @code{mh-decode-mime-flag}; however, you can inspect it if it appears that the body parts are not being interpreted correctly or toggle it with the command @kbd{;} (semicolon; @code{mh-toggle-mh-decode-mime-flag}) to view the raw message. This option also controls the display of quoted-printable messages and other graphical widgets. @xref{Viewing}. @cindex buttons Attachments in MH-E are indicated by @dfn{buttons} like this: @smallexample [1. image/jpeg; foo.jpg]... @end smallexample @findex mh-next-button @findex mh-press-button @findex mh-prev-button @kindex @key{RET} @kindex K @key{TAB} @kindex K S-@key{TAB} @kindex Mouse-1 @kindex Mouse-2 To view the contents of the button, use either @kbd{Mouse-1} or @kbd{Mouse-2} on the button or @key{RET} (@code{mh-press-button}) when the cursor is over the button. This command is a toggle so if you use it again on the same attachment, it is hidden. If Emacs does not know how to display the attachment, then Emacs offers to save the attachment in a file. To move the cursor to the next button, use the command @kbd{K @key{TAB}} (@code{mh-next-button}). If the end of the buffer is reached then the search wraps over to the start of the buffer. To move the cursor to the previous button, use the command @kbd{K S-@key{TAB}} (@code{mh-prev-button}). If the beginning of the buffer is reached then the search wraps over to the end of the buffer. @cindex attachments, viewing @cindex viewing attachments @findex mh-folder-toggle-mime-part @kindex K v Another way to view the contents of a button is to use the command @kbd{K v} (@code{mh-folder-toggle-mime-part}). This command displays (or hides) the attachment associated with the button under the cursor. If the cursor is not located over a button, then the cursor first moves to the next button, wrapping to the beginning of the message if necessary. This command has the advantage over the previous commands of working from the MH-Folder buffer. You can also provide a numeric prefix argument (as in @kbd{4 K v}) to view the attachment labeled with that number. If Emacs does not know how to display the attachment, then Emacs offers to save the attachment in a file. @cindex @file{/etc/mailcap} @cindex files, @file{/etc/mailcap} @findex mailcap-mime-info @findex mh-display-with-external-viewer @kindex K e If Emacs does not know how to view an attachment, you could save it into a file and then run some program to open it. It is easier, however, to launch the program directly from MH-E with the command @kbd{K e} (@code{mh-display-with-external-viewer}). While you'll most likely use this to view spreadsheets and documents, it is also useful to use your browser to view HTML attachments with higher fidelity than what Emacs can provide. This command displays the attachment associated with the button under the cursor. If the cursor is not located over a button, then the cursor first moves to the next button, wrapping to the beginning of the message if necessary. You can provide a numeric prefix argument (as in @kbd{4 K e}) to view the attachment labeled with that number. This command tries to provide a reasonable default for the viewer by calling the Emacs function @code{mailcap-mime-info}. This function usually reads the file @file{/etc/mailcap}. @cindex attachments, saving @cindex saving attachments @findex mh-folder-save-mime-part @kindex K o Use the command @kbd{K o} (@code{mh-folder-save-mime-part}) to save attachments (the mnemonic is ``output''). This command saves the attachment associated with the button under the cursor. If the cursor is not located over a button, then the cursor first moves to the next button, wrapping to the beginning of the message if necessary. You can also provide a numeric prefix argument (as in @kbd{3 K o}) to save the attachment labeled with that number. This command prompts you for a filename and suggests a specific name if it is available. @cindex @command{mhn} @cindex @command{mhstore} @cindex MH commands, @command{mhn} @cindex MH commands, @command{mhstore} @findex mh-mime-save-parts @kindex K a @vindex mh-mime-save-parts-default-directory You can save all of the attachments at once with the command @kbd{K a} (@code{mh-mime-save-parts}). The attachments are saved in the directory specified by the option @code{mh-mime-save-parts-default-directory} unless you use a prefix argument (as in @kbd{C-u K a}) in which case you are prompted for the directory. These directories may be superseded by MH profile components, since this function calls on @command{mhstore} (@command{mhn}) to do the work. @vindex mh-mime-save-parts-default-directory The default value for the option @code{mh-mime-save-parts-default-directory} is @samp{Prompt Always} so that you are always prompted for the directory in which to save the attachments. However, if you usually use the same directory within a session, then you can set this option to @samp{Prompt the First Time} to avoid the prompt each time. you can make this directory permanent by choosing @samp{Directory} and entering the directory's name. @cindex attachments, inline @cindex inline attachments @findex mh-toggle-mime-buttons @kindex K t @vindex mh-display-buttons-for-inline-parts-flag The sender can request that attachments should be viewed inline so that they do not really appear like an attachment at all to the reader. Most of the time, this is desirable, so by default MH-E suppresses the buttons for inline attachments. On the other hand, you may receive code or HTML which the sender has added to his message as inline attachments so that you can read them in MH-E. In this case, it is useful to see the buttons so that you know you don't have to cut and paste the code into a file; you can simply save the attachment. If you want to make the buttons visible for inline attachments, you can use the command @kbd{K t} (@code{mh-toggle-mime-buttons}) to toggle the visibility of these buttons. You can turn on these buttons permanently by turning on the option @code{mh-display-buttons-for-inline-parts-flag}. MH-E cannot display all attachments inline however. It can display text (including @sc{html}) and images. @cindex header field, @samp{Content-Disposition:} @cindex inline images @cindex @samp{Content-Disposition:} header field @vindex mh-max-inline-image-height @vindex mh-max-inline-image-width Some older mail programs do not insert the needed plumbing@footnote{This plumbing is the @samp{Content-Disposition:} header field.} to tell MH-E whether to display the attachments inline or not. If this is the case, MH-E will display these images inline if they are smaller than the window. However, you might want to allow larger images to be displayed inline. To do this, you can change the options @code{mh-max-inline-image-width} and @code{mh-max-inline-image-height} from their default value of zero to a large number. The size of your screen is a good choice for these numbers. @cindex alternatives @cindex attachments, alternatives @vindex mh-display-buttons-for-alternatives-flag Sometimes, a mail program will produce multiple alternatives of an attachment in increasing degree of faithfulness to the original content. By default, only the preferred alternative is displayed. If the option @code{mh-display-buttons-for-alternatives-flag} is on, then the preferred part is shown inline and buttons are shown for each of the other alternatives. @vindex mm-discouraged-alternatives Many people prefer to see the @samp{text/plain} alternative rather than the @samp{text/html} alternative. To do this in MH-E, customize the option @code{mm-discouraged-alternatives}, and add @samp{text/html}. The next best alternative, if any, will be shown. @kindex K i @findex mh-folder-inline-mime-part You can view the raw contents of an attachment with the command @kbd{K i} (@code{mh-folder-inline-mime-part}). This command displays (or hides) the contents of the attachment associated with the button under the cursor verbatim. If the cursor is not located over a button, then the cursor first moves to the next button, wrapping to the beginning of the message if necessary. You can also provide a numeric prefix argument (as in @kbd{4 K i}) to view the attachment labeled with that number. For additional information on buttons, see @ifinfo @ref{Article Buttons,,,gnus}, and @ref{MIME Commands,,,gnus}. @end ifinfo @ifnotinfo the chapters @uref{http://www.gnus.org/manual/gnus_101.html#SEC101, Article Buttons} and @uref{http://www.gnus.org/manual/gnus_108.html#SEC108, MIME Commands} in the @cite{The Gnus Manual}. @end ifnotinfo @node HTML, Digests, Viewing Attachments, Reading Mail @section HTML @cindex HTML @cindex Gnus MH-E can display messages that have been sent in HTML@footnote{This feature depends on a version of Gnus that is at least 5.10.}. The content of the message will appear in the MH-Show buffer as you would expect if the entire message is HTML, or there is an inline HTML body part. However, if there is an HTML body part that is an attachment, then you'll see a button like this: @smallexample [1. text/html; foo.html]... @end smallexample To see how to read the contents of this body part, see @ref{Viewing Attachments}. @vindex mm-text-html-renderer The browser that MH-E uses is determined by the option @code{mm-text-html-renderer}. The default setting is set automatically based upon the presence of a known browser on your system. If you wish to use a different browser, then set this option accordingly. See the documentation for the browser you use for additional information on how to use it. In particular, find and disable the option to render images as this can tip off spammers that the email address they have used is valid. @vindex mm-text-html-renderer If you're confused about which @code{mm-text-html-renderer} to use, here's a brief description of each, sorted by popularity, that includes the results of a quick poll of MH-E users from 2005-12-23. @table @asis @cindex browser, @samp{w3m} @cindex @samp{w3m} @kindex Mouse-2 @kindex S-Mouse-2 @item @samp{w3m} 7 The @samp{w3m} browser requires an external program. It's quick, produces pretty nice output, and best of all, it's the only browser that highlights links. These can be clicked with @kbd{Mouse-2} to view the content of the link in @samp{w3m} or with @kbd{S-Mouse-2} to view the content of the link in an external browser. The @samp{w3m} browser handles tables well and actually respects the table's width parameter (which can cause text to wrap if the author didn't anticipate that the page would be viewed in Emacs). @c ------------------------- @cindex browser, @samp{w3m-standalone} @cindex @samp{w3m-standalone} @item @samp{w3m-standalone} 3 This browser, along with @samp{nil} for the external browser, are the only choices that work without having to download a separate lisp package or external program. This browser is quick, but does not show links. It handles simple tables but some tables get rendered much wider than the Emacs frame. This browser was the only one not to handle the escape @samp{–} (it printed a @samp{?}), but it did render @samp{®}. @c ------------------------- @cindex browser, @samp{links} @cindex @samp{links} @item @samp{links} 1 The @samp{links} browser requires an external program. It's quick, and produces nicer output than @samp{lynx} on single column mails in tables. However, it doesn't show links and it doesn't do as nice a job on multi-column tables as some lines wrap. At least it fits in 80 columns and thus seems better than @samp{w3} and @samp{w3m-standalone}. Converts escapes such as @samp{®} to (R). @c ------------------------- @cindex browser, @samp{lynx} @cindex @samp{lynx} @item @samp{lynx} 1 The @samp{lynx} browser requires an external program. It's quick and produces pretty decent output but it doesn't show links. It doesn't seem to do multi-column tables which makes output much cleaner. It centers the output and wraps long lines more than most. Handles @samp{®}. @c ------------------------- @item @samp{nil} 1 This choice obviously requires an external browser. Like @samp{w3m-standalone}, it works out of the box. With this setting, HTML messages have a button for the body part which you can view with @kbd{K v} (@code{mh-folder-toggle-mime-part}). @c ------------------------- @cindex browser, @samp{w3} @cindex @samp{w3} @item @samp{w3} 0 This choice does not require an external program as all of the rendering is done in lisp. You do need to get the package separately. This browser is @strong{slow}, and doesn't appear to have been updated since 2001 and the author hasn't responded to my emails. It displays unknown tags instead of hiding them, so you get to see all the Microsoft crap in certain messages. Tends to make multi-column tables wider than even a full-screen Emacs can handle. Like @samp{w3m}, you can follow links, but you have to find them first as they are not highlighted. Performs well on single-column tables and handles escapes such as @samp{®}. @c ------------------------- @cindex browser, @samp{html2text} @cindex @samp{html2text} @item @samp{html2text} 0 The @samp{html2text} browser requires an external program. I noticed that it can do some nasty things with simple HTML mails (like filling the entire message as if it were one paragraph, including signature). On another message, it displayed half of the HTML tags for some reason. @end table @vindex mm-text-html-renderer For a couple more sources of information about @code{mm-text-html-renderer}, @ifinfo @xref{Display Customization,,,emacs-mime}, and the documentation for the Gnus command @kbd{W h} (@pxref{Article Washing,,,gnus},). @end ifinfo @ifnotinfo see section @uref{http://www.gnus.org/manual/emacs-mime_6.html, Display Customization} in the @cite{The Emacs MIME Manual} and the documentation for the Gnus command @kbd{W h} (see section @uref{http://www.gnus.org/manual/gnus_99.html, Article Washing} in the @cite{The Gnus Manual}). @end ifnotinfo @node Digests, Reading PGP, HTML, Reading Mail @section Digests @cindex digests @findex mh-page-digest @findex mh-page-digest-backwards @kindex D @key{BS} @kindex D @key{SPC} @kindex @key{BS} @kindex @key{SPC} A digest is a message that contains other messages. Special MH-E commands let you read digests conveniently. You can use @key{SPC} and @key{BS} to page through the digest as if it were a normal message, but if you wish to skip to the next message in the digest, use @kbd{D @key{SPC}} (@code{mh-page-digest}). To return to a previous message, use @kbd{D @key{BS}} (@code{mh-page-digest-backwards}). @cindex @command{burst} @cindex MH commands, @command{burst} @cindex MH-Folder Show mode @cindex modes, MH-Folder Show @findex mh-burst-digest @kindex d @kindex D b @kindex t Another handy command is @kbd{D b} (@code{mh-burst-digest}). This command uses the MH command @command{burst}@footnote{See the section @uref{@value{MH-BOOK-HOME}/burdig.html, Bursting Messages} in the MH book.} to break out each message in the digest into its own message. Using this command, you can quickly delete unwanted messages, like this: Once the digest is split up, toggle out of MH-Folder Show mode with @kbd{t} (@pxref{Folders}) so that the scan lines fill the screen and messages aren't displayed. Then use @kbd{d} (@pxref{Reading Mail}) to quickly delete messages that you don't want to read (based on the @samp{Subject:} header field). You can also burst the digest to reply directly to the people who posted the messages in the digest. One problem you may encounter is that the @samp{From:} header fields are preceded with a @samp{>} so that your reply can't create the @samp{To:} field correctly. In this case, you must correct the @samp{To:} field yourself. This is described later (@pxref{Editing Drafts}). @node Reading PGP, Printing, Digests, Reading Mail @section Signed and Encrypted Messages @cindex GPG @cindex GnuPG @cindex Gnus @cindex OpenPGP @cindex PGP @cindex RFC 3156 @cindex encrypted messages @cindex security @cindex signed messages You can read encrypted or signed PGP or GPG messages with MH-E@footnote{This feature depends on post-5.10 versions of Gnus. @cite{MIME Security with OpenPGP} is documented in @uref{http://www.rfc-editor.org/rfc/rfc3156.txt, RFC 3156}. However, MH-E can also decrypt old-style PGP messages that are not in MIME format.}. This section assumes that you already have a good understanding of GPG and have set up your keys appropriately. If someone sends you a signed message, here is what you'll see: @smallexample @group [[PGP Signed Part:Bill Wohler ]] This is a signed message. [[End of PGP Signed Part]] @end group @end smallexample @cindex keychain @cindex key server @cindex signed messages If the key for the given signature is not in your keychain, you'll be given the opportunity to fetch the key from a key server and verify the key. If the message is really large, the verification process can take a long time. You can press @kbd{C-g} at any time to cancel@footnote{Unfortunately in the current version, the validation process doesn't display a message so it appears that MH-E has hung. We hope that this will be fixed in the future.}. If the signature doesn't check out, you might see something like this: @smallexample @group [[PGP Signed Part:Failed]] This is a signed message. This is garbage added after the signature was made. [[End of PGP Signed Part]] @end group @end smallexample @cindex decrypting messages If someone sends you an encrypted message, MH-E will ask for your passphrase to decrypt the message. You should see something like this: @smallexample @group [[PGP Encrypted Part:OK]] [[PGP Signed Part:Bill Wohler ]] This is the secret message. [[End of PGP Signed Part]] [[End of PGP Encrypted Part]] @end group @end smallexample If there is a problem decrypting the message, the button will say: @smallexample [[PGP Encrypted Part:Failed]] @end smallexample You can read the contents of this button using the methods described in @ref{Viewing Attachments}. If the message were corrupted, you'd see this: @smallexample [[PGP Encrypted Part:Failed] Invalid base64 data] @end smallexample If your passphrase were incorrect, you'd see something like this: @smallexample [GNUPG:] ENC_TO CD9C88BB610BD9AD 1 0 [GNUPG:] USERID_HINT CD9C88BB610BD9AD Bill Wohler [GNUPG:] NEED_PASSPHRASE CD9C88BB610BD9AD CD9C88BB610BD9AD 1 0 [GNUPG:] BAD_PASSPHRASE CD9C88BB610BD9AD gpg: encrypted with 1024-bit RSA key, ID 610BD9AD, created 1997-09-09 "Bill Wohler " gpg: public key decryption failed: bad passphrase [GNUPG:] BEGIN_DECRYPTION [GNUPG:] DECRYPTION_FAILED gpg: decryption failed: secret key not available [GNUPG:] END_DECRYPTION gpg exited abnormally: '2' @end smallexample @vindex mh-show-pgg-bad @vindex mh-show-pgg-good @vindex mh-show-pgg-unknown The appearance of the buttons is controlled by the faces @code{mh-show-pgg-good}, @code{mh-show-pgg-bad}, and @code{mh-show-pgg-unknown} depending on the validity of the signature. The latter is used whether the signature is unknown or untrusted. @cindex @samp{pgg} customization group @cindex PGG @cindex customization group, @samp{pgg} The @samp{pgg} customization group may have some settings which may interest you. @iftex See @cite{The PGG Manual}. @end iftex @ifinfo @xref{Top, , The PGG Manual, pgg, The PGG Manual}. @end ifinfo @ifhtml See @uref{http://www.dk.xemacs.org/Documentation/packages/html/pgg.html, @cite{The PGG Manual}}. @end ifhtml @node Printing, Files and Pipes, Reading PGP, Reading Mail @section Printing Your Mail @cindex printing @findex mh-ps-print-msg @findex mh-ps-print-msg-file @kindex P f @kindex P p @vindex mh-lpr-command-format @vindex mh-print-background-flag To print messages in MH-E, use the command @kbd{P p} (@code{mh-ps-print-msg}). You can print all the messages in a range (as in @kbd{C-u P p 1 3 5-7 last:5 frombob @key{RET}}, @pxref{Ranges}). You can also send the output to a file with @kbd{P f} (@code{mh-ps-print-msg-file}). This command will print inline text attachments but will not decrypt messages. However, when a message is displayed in an MH-Show buffer, then that buffer is used verbatim for printing with the caveat that only text attachments, if opened inline, are printed. Therefore, encrypted messages can be printed by showing and decrypting them first. The commands @kbd{P p} and @kbd{P f} do not use the options @code{mh-lpr-command-format} or @code{mh-print-background-flag}, described below. @findex mh-ps-print-toggle-color @kindex P C @vindex ps-print-color-p Colors are emulated on black-and-white printers with shades of gray. This might produce illegible output, even if your screen colors only use shades of gray. If this is the case, try using the command @kbd{P C} (@code{mh-ps-print-toggle-color}) to toggle between color, no color, and a black and white representation of the colors and see which works best. You change this setting permanently by customizing the option @code{ps-print-color-p}. @findex mh-ps-print-toggle-faces @kindex P F Another related function is the command @kbd{P F} (@code{mh-ps-print-toggle-faces}). This command toggles between using faces and not. When faces are enabled, the printed message will look very similar to the message in the MH-Show buffer. @cindex ps-print package @cindex Emacs, packages, ps-print MH-E uses the @samp{ps-print} package to do the printing, so you can customize the printing further by going to the @samp{ps-print} customization group. @cindex @command{lpr} @cindex @command{mhl} @cindex MH commands, @command{mhl} @cindex Unix commands, @command{lpr} @findex mh-print-msg @kindex P l An alternative to using the @samp{ps-print} package is the command @kbd{P l} (@code{mh-print-msg}) (the @i{l} is for @i{l}ine printer or @i{l}pr). You can print all the messages in a range. The message is formatted with @command{mhl}@footnote{See the section @uref{@value{MH-BOOK-HOME}/shomes.html#Usisho, Using mhl} in the MH book.} and printed with the @command{lpr} command. @kindex P f @kindex P l @kindex P p @vindex mh-lpr-command-format @vindex mh-print-background-flag The command @kbd{P l} uses two options. The option @code{mh-lpr-command-format} contains the Unix command line which performs the actual printing. The string can contain one escape, @samp{%s}, which is replaced by the name of the folder and the message number and is useful for print job names. The default setting is @code{"lpr -J '%s'"}. I use @code{"mpage -h'%s' -b Letter -H1of -mlrtb -P"} which produces a nice header and adds a bit of margin so the text fits within my printer's margins. Normally messages are printed in the foreground. If this is slow on your system, you may elect to turn on the option @code{mh-print-background-flag} to print in the background. If you do this, do not delete the message until it is printed or else the output may be truncated. These options are not used by the commands @kbd{P p} or @kbd{P f}. @node Files and Pipes, Navigating, Printing, Reading Mail @section Files and Pipes @cindex files @cindex pipes @findex mh-refile-or-write-again @findex mh-write-msg-to-file @kindex > @kindex ! MH-E does offer a couple of commands that are not a part of MH@. The first one, @kbd{>} (@code{mh-write-msg-to-file}), writes a message to a file. You are prompted for the filename. If the file already exists, the message is appended to it. You can also write the message to the file without the header by specifying a prefix argument (such as @kbd{C-u > /tmp/foobar @key{RET}}). Subsequent writes to the same file can be made with the command @kbd{!} (@code{mh-refile-or-write-again}). @findex mh-pipe-msg @kindex | @kindex l You can also pipe the message through a Unix shell command with the command @kbd{|} (@code{mh-pipe-msg}). You are prompted for the Unix command through which you wish to run your message. If you give a prefix argument to this command, the message header is included in the text passed to the command (the contrived example @kbd{C-u | lpr} would be done with the @kbd{l} command instead). @cindex @command{shar} @cindex @command{uuencode} @cindex Unix commands, @command{shar} @cindex Unix commands, @command{uuencode} @findex mh-store-msg @kindex X s @vindex mh-store-default-directory If the message is a shell archive @command{shar} or has been run through @command{uuencode} use @kbd{X s} (@code{mh-store-msg}) to extract the body of the message. The default directory for extraction is the current directory; however, you have a chance to specify a different extraction directory. The next time you use this command, the default directory is the last directory you used. If you would like to change the initial default directory, customize the option @code{mh-store-default-directory}, change the value from @samp{Current} to @samp{Directory}, and then enter the name of the directory for storing the content of these messages. @findex mh-store-buffer @kindex @key{RET} @kindex X s By the way, @kbd{X s} calls the Emacs Lisp function @code{mh-store-buffer}. I mention this because you can use it directly if you're editing a buffer that contains a file that has been run through @command{uuencode} or @command{shar}. For example, you can extract the contents of the current buffer in your home directory by typing @kbd{M-x mh-store-buffer @key{RET} ~ @key{RET}}. @node Navigating, Miscellaneous Commands and Options, Files and Pipes, Reading Mail @section Navigating @cindex moving between messages @cindex navigation @findex mh-first-msg @findex mh-goto-msg @findex mh-last-msg @findex mh-next-undeleted-msg @findex mh-next-unread-msg @findex mh-previous-undeleted-msg @findex mh-previous-unread-msg @kindex g @kindex M-< @kindex M-> @kindex M-n @kindex M-p @kindex n @kindex p To move on to the next message, use the command @kbd{n} (@code{mh-next-undeleted-msg}); use @kbd{p} (@code{mh-previous-undeleted-msg}) to read the previous message. To move to the next unread message, use @kbd{M-n} (@code{mh-next-unread-msg}); use @kbd{M-p} (@code{mh-previous-unread-msg}) to move to the previous unread message. These commands can be given a prefix argument to specify how many messages to skip (for example, @kbd{5 n}). You can also move to a specific message with @kbd{g} (@code{mh-goto-msg}). You can enter the message number either before or after typing @kbd{g}. In the latter case, Emacs prompts you. Finally, you can go to the first or last message with @kbd{M-<} (@code{mh-first-msg}) and @kbd{M->} (@code{mh-last-msg}) respectively. @cindex MH-Folder mode @cindex modes, MH-Folder @findex next-line @findex previous-line @kindex C-n @kindex C-p @kindex @key{RET} You can also use the Emacs commands @kbd{C-p} (@code{previous-line}) and @kbd{C-n} (@code{next-line}) to move up and down the scan lines in the MH-Folder window. These commands can be used in conjunction with @key{RET} to look at deleted or refiled messages. @cindex deleting messages @findex mh-delete-msg @kindex d @kindex n @kindex p To mark a message for deletion, use the command @kbd{d} (@code{mh-delete-msg}). A @samp{D} is placed by the message in the scan window, and the next undeleted message is displayed. If the previous command had been @kbd{p}, then the next message displayed is the first undeleted message previous to the message just deleted. Use @kbd{n} to force subsequent @kbd{d} commands to move forward to the next undeleted message after deleting the message under the cursor. You may also specify a range (for example, @kbd{C-u d 1 3 5-7 last:5 frombob @key{RET}}, @pxref{Ranges}). @findex mh-delete-msg-no-motion @kindex C-d The command @kbd{C-d} (@code{mh-delete-msg-no-motion}) marks the message (or messages in range) for deletion but leaves the cursor at the current message in case you wish to perform other operations on the message. @findex mh-delete-subject @findex mh-delete-subject-or-thread @findex mh-thread-delete @findex mh-undo @kindex k @kindex T d @kindex u And to delete more messages faster, you can use @kbd{k} (@code{mh-delete-subject-or-thread}) to delete all the messages with the same subject as the current message. This command puts these messages in a sequence named @samp{subject}. You can undo this action by using @kbd{u} (@code{mh-undo}) with a prefix argument and then specifying the @samp{subject} sequence. However, if the buffer is displaying a threaded view of the folder then @kbd{k} behaves like @kbd{T d} (@code{mh-thread-delete}). @xref{Threading}. @findex mh-execute-commands @kindex x However you mark a message for deletion, the command @kbd{x} (@code{mh-execute-commands}) actually carries out the deletion (@pxref{Folders}). @vindex mh-delete-msg-hook The hook @code{mh-delete-msg-hook} is called after you mark a message for deletion. For example, a past maintainer of MH-E used this once when he kept statistics on his mail usage. @node Miscellaneous Commands and Options, , Navigating, Reading Mail @section Miscellaneous Commands and Options This section contains a few more miscellaneous commands and options. @cindex editing message @findex mh-modify @kindex M There are times when you need to edit a message. For example, you may need to fix a broken Content-Type header field. You can do this with the command @kbd{M} (@code{mh-modify}). It displays the raw message in an editable buffer. When you are done editing, save and kill the buffer as you would any other. @findex mh-kill-folder @findex mh-pack-folder @vindex mh-do-not-confirm-flag Commands such as @code{mh-pack-folder} prompt to confirm whether to process outstanding moves and deletes or not before continuing. Turning on the option @code{mh-do-not-confirm-flag} means that these actions will be performed---which is usually desired but cannot be retracted---without question@footnote{In previous versions of MH-E, this option suppressed the confirmation in @code{mh-kill-folder}. Since this kept most users from setting this option, @code{mh-kill-folder} was modified in version 6.0 to always ask for confirmation subject to @code{mh-kill-folder-suppress-prompt-hook}. @xref{Folders}.}. @cindex MH-Folder mode @cindex modes, MH-Folder @vindex mh-summary-height The option @code{mh-summary-height} controls the number of scan lines displayed in the MH-Folder window, including the mode line. The default value of this option is @samp{Automatic} which means that the MH-Folder buffer will maintain the same proportional size if the frame is resized. If you'd prefer a fixed height, then choose the @samp{Fixed Size} option and enter the number of lines you'd like to see. @vindex mh-bury-show-buffer-flag Normally the buffer for displaying messages is buried at the bottom at the buffer stack. You may wish to disable this feature by turning off the option @code{mh-bury-show-buffer-flag}. One advantage of not burying the show buffer is that one can delete the show buffer more easily in an electric buffer list because of its proximity to its associated MH-Folder buffer. Try running @kbd{M-x electric-buffer-list} to see what I mean. @cindex @file{.emacs} @cindex files, @file{.emacs} @cindex reading mail Before we leave this section, I'll include a function that I use as a front end to MH-E@footnote{Stephen Gildea's favorite binding is @kbd{(global-set-key "\C-cr" 'mh-rmail)}.}. It toggles between your working window configuration, which may be quite involved---windows filled with source, compilation output, man pages, and other documentation---and your MH-E window configuration. Like the rest of the customization described in this section, simply add the following code to @file{~/.emacs}. @iftex @filbreak @end iftex @findex mh-rmail, example @smalllisp @group (defvar my-mh-screen-saved nil "Set to non-@code{nil} when MH-E window configuration shown.") (defvar my-normal-screen nil "Normal window configuration.") (defvar my-mh-screen nil "MH-E window configuration.") (defun my-mh-rmail (&optional arg) "Toggle between MH-E and normal screen configurations. With non-@code{nil} or prefix argument, @i{inc} mailbox as well when going into mail." (interactive "P") ; @r{user callable function, P=prefix arg} (setq my-mh-screen-saved ; @r{save state} (cond ;; @r{Bring up MH-E screen if arg or normal window configuration.} ;; @r{If arg or +inbox buffer doesn't exist, run mh-rmail.} ((or arg (null my-mh-screen-saved)) (setq my-normal-screen (current-window-configuration)) (if (or arg (null (get-buffer "+inbox"))) (mh-rmail) (set-window-configuration my-mh-screen)) t) ; @r{set my-mh-screen-saved to @code{t}} ;; @r{Otherwise, save MH-E screen and restore normal screen.} (t (setq my-mh-screen (current-window-configuration)) (set-window-configuration my-normal-screen) nil)))) ; @r{set my-mh-screen-saved to nil} (global-set-key "\C-x\r" 'my-mh-rmail) ;@r{ call with C-x @key{RET}} @i{Starting MH-E} @end group @end smalllisp If you type an argument (@kbd{C-u}) or if @code{my-mh-screen-saved} is @code{nil} (meaning a non-MH-E window configuration), the current window configuration is saved, either the @samp{+inbox} buffer is displayed or @code{mh-rmail} is run, and the MH-E window configuration is shown. Otherwise, the MH-E window configuration is saved and the original configuration is displayed. @node Folders, Sending Mail, Reading Mail, Top @chapter Organizing Your Mail with Folders @cindex @samp{Folder} menu @cindex @samp{Message} menu @cindex folders @cindex menu, @samp{Folder} @cindex menu, @samp{Message} @cindex using folders This chapter discusses the things you can do with folders within MH-E. The commands in this chapter are also found in the @samp{Folder} and @samp{Message} menus. @table @kbd @kindex ? @findex mh-help @item ? Display cheat sheet for the MH-E commands (@code{mh-help}). @c ------------------------- @kindex ! @findex mh-refile-or-write-again @item ! Repeat last output command (@code{mh-refile-or-write-again}). @c ------------------------- @cindex @samp{Message > Copy Message to Folder...} menu item @cindex menu item, @samp{Message > Copy Message to Folder...} @kindex c @findex mh-copy-msg @item c Copy range to folder (@code{mh-copy-msg}). @c ------------------------- @kindex F ? @findex mh-prefix-help @item F ? Display cheat sheet for the commands of the current prefix in minibuffer (@code{mh-prefix-help}). @c ------------------------- @kindex F ' @findex mh-index-ticked-messages @item F ' Display ticked messages (@code{mh-index-ticked-messages}). @c ------------------------- @kindex F c @findex mh-catchup @item F c Delete range from the @samp{unseen} sequence (@code{mh-catchup}). @c ------------------------- @kindex F k @findex mh-kill-folder @item F k Remove folder (@code{mh-kill-folder}). @c ------------------------- @cindex @samp{Folder > List Folders} menu item @cindex menu item, @samp{Folder > List Folders} @kindex F l @findex mh-list-folders @item F l List all folders (@code{mh-list-folders}). @c ------------------------- @cindex @samp{Folder > View New Messages} menu item @cindex menu item, @samp{Folder > View New Messages} @kindex F n @findex mh-index-new-messages @item F n Display unseen messages (@code{mh-index-new-messages}). @c ------------------------- @cindex @samp{Folder > Pack Folder} menu item @cindex menu item, @samp{Folder > Pack Folder} @kindex F p @findex mh-pack-folder @item F p Pack folder (@code{mh-pack-folder}). @c ------------------------- @kindex F q @findex mh-index-sequenced-messages @item F q Display messages in any sequence (@code{mh-index-sequenced-messages}). @c ------------------------- @cindex @samp{Folder > Rescan Folder} menu item @cindex menu item, @samp{Folder > Rescan Folder} @kindex F r @findex mh-rescan-folder @item F r Rescan folder (@code{mh-rescan-folder}). @c ------------------------- @cindex @samp{Folder > Search...} menu item @cindex menu item, @samp{Folder > Search...} @kindex F s @findex mh-search @item F s Search your MH mail (@code{mh-search}). @c ------------------------- @cindex @samp{Folder > Sort Folder} menu item @cindex menu item, @samp{Folder > Sort Folder} @kindex F S @findex mh-sort-folder @item F S Sort folder (@code{mh-sort-folder}). @c ------------------------- @kindex F u @findex mh-undo-folder @item F u Undo all refiles and deletes in the current folder (@code{mh-undo-folder}). @c ------------------------- @cindex @samp{Folder > Visit a Folder...} menu item @cindex menu item, @samp{Folder > Visit a Folder...} @kindex F v @findex mh-visit-folder @item F v Visit folder (@code{mh-visit-folder}). @c ------------------------- @cindex @samp{Message > Refile Message} menu item @cindex menu item, @samp{Message > Refile Message} @kindex o @findex mh-refile-msg @item o Refile (output) range into folder (@code{mh-refile-msg}). @c ------------------------- @cindex @samp{Folder > Quit MH-E} menu item @cindex menu item, @samp{Folder > Quit MH-E} @kindex q @findex mh-quit @item q Quit the current MH-E folder (@code{mh-quit}). @c ------------------------- @cindex @samp{Folder > Toggle Show/Folder} menu item @cindex menu item, @samp{Folder > Toggle Show/Folder} @kindex t @findex mh-toggle-showing @item t Toggle between MH-Folder and MH-Folder Show modes (@code{mh-toggle-showing}). @c ------------------------- @cindex @samp{Message > Undo Delete/Refile} menu item @cindex menu item, @samp{Message > Undo Delete/Refile} @kindex u @findex mh-undo @item u Undo pending deletes or refiles in range (@code{mh-undo}). @c ------------------------- @cindex @samp{Message > Execute Delete/Refile} menu item @cindex menu item, @samp{Message > Execute Delete/Refile} @kindex x @findex mh-execute-commands @item x Process outstanding delete and refile requests (@code{mh-execute-commands}). @end table @cindex @samp{mh-folder} customization group @cindex customization group, @samp{mh-folder} The @samp{mh-folder} customization group is used to tune these commands. @vtable @code @item mh-new-messages-folders Folders searched for the @samp{unseen} sequence (default: @code{Inbox}). @c ------------------------- @item mh-ticked-messages-folders Folders searched for @code{mh-tick-seq} (default: @code{t}). @c ------------------------- @item mh-large-folder The number of messages that indicates a large folder (default: 200). @c ------------------------- @item mh-recenter-summary-flag On means to recenter the summary window (default: @samp{off}). @c ------------------------- @item mh-recursive-folders-flag On means that commands which operate on folders do so recursively (default: @samp{off}). @c ------------------------- @item mh-sortm-args Additional arguments for @command{sortm} (default: @code{nil}). @end vtable The following hooks are available. @vtable @code @item mh-after-commands-processed-hook Hook run by @kbd{x} after performing outstanding refile and delete requests (default: @code{nil}). @c ------------------------- @item mh-before-commands-processed-hook Hook run by @kbd{x} before performing outstanding refile and delete requests (default: @code{nil}). @c ------------------------- @item mh-before-quit-hook Hook run by q before quitting MH-E (default: @code{nil}). @c ------------------------- @item mh-folder-mode-hook Hook run by @code{mh-folder-mode} when visiting a new folder (default: @code{nil}). @c ------------------------- @item mh-kill-folder-suppress-prompt-hook Abnormal hook run at the beginning of @code{mh-kill-folder} (default: @code{'mh-search-p}). @c ------------------------- @item mh-quit-hook Hook run by q after quitting MH-E (default: @code{nil}). @c ------------------------- @item mh-refile-msg-hook Hook run by o after marking each message for refiling (default: @code{nil}). @end vtable The following faces are available for customizing the appearance of the MH-Folder buffer. @xref{Scan Line Formats}. @vtable @code @item mh-folder-address Recipient face. @c ------------------------- @item mh-folder-body Body text face. @c ------------------------- @item mh-folder-cur-msg-number Current message number face. @c ------------------------- @item mh-folder-date Date face. @c ------------------------- @item mh-folder-deleted Deleted message face. @c ------------------------- @item mh-folder-followup @samp{Re:} face. @c ------------------------- @item mh-folder-msg-number Message number face. @c ------------------------- @item mh-folder-refiled Refiled message face. @c ------------------------- @vindex mh-scan-format-nmh @vindex mh-scan-sent-to-me-sender-regexp @item mh-folder-sent-to-me-hint Fontification hint face in messages sent directly to us. The detection of messages sent to us is governed by the scan format @code{mh-scan-format-nmh} and regular expression @code{mh-scan-sent-to-me-sender-regexp}. @c ------------------------- @vindex mh-scan-format-nmh @vindex mh-scan-sent-to-me-sender-regexp @item mh-folder-scan-format Sender face in messages sent directly to us. The detection of messages sent to us is governed by the scan format @code{mh-scan-format-nmh} and regular expression @code{mh-scan-sent-to-me-sender-regexp}. @c ------------------------- @item mh-folder-subject Subject face. @c ------------------------- @item mh-folder-tick Ticked message face. @c ------------------------- @item mh-folder-to @samp{To:} face. @end vtable @vindex mh-folder-mode-hook The hook @code{mh-folder-mode-hook} is called when visiting a new folder in MH-Folder mode. This could be used to set your own key bindings, for example: @vindex mh-folder-mode-hook, example @smalllisp @group (defvar my-mh-init-done nil "Non-@code{nil} when one-time MH-E settings made.") (defun my-mh-folder-mode-hook () "Hook to set key bindings in MH-Folder mode." (if (not my-mh-init-done) ; @r{only need to bind the keys once } (progn (local-set-key "//" 'my-search-msg) (local-set-key "b" 'mh-burst-digest) ; @r{better use of @kbd{b}} (setq my-mh-init-done t)))) (add-hook 'mh-folder-mode-hook 'my-mh-folder-mode-hook) (defun my-search-msg () "Search for a regexp in the current message." (interactive) ; @r{user function} (save-window-excursion (other-window 1) ; @r{go to next window} (isearch-forward-regexp))) ; @r{string search; hit return} ; @r{ when done} @i{Create additional key bindings via mh-folder-mode-hook} @end group @end smalllisp @cindex @command{folder} @cindex @command{refile} @cindex MH commands, @command{folder} @cindex MH commands, @command{refile} @findex mh-refile-msg @kindex o @vindex mh-refile-msg-hook MH-E has analogies for each of the MH @command{folder} and @command{refile} commands@footnote{See the sections @uref{@value{MH-BOOK-HOME}/fol.html#Youfol, Your Current Folder: folder} and @uref{@value{MH-BOOK-HOME}/fol.html#Movref, Moving and Linking Messages: refile} in the MH book.}. To refile a message in another folder, use the command @kbd{o} (@code{mh-refile-msg}) (mnemonic: ``output''). You are prompted for the folder name (@pxref{Folder Selection}). Note that this command can also be used to create folders. If you specify a folder that does not exist, you will be prompted to create it. The hook @code{mh-refile-msg-hook} is called after a message is marked to be refiled. @findex mh-write-msg-to-file @kindex ! If you are refiling several messages into the same folder, you can use the command @kbd{!} (@code{mh-refile-or-write-again}) to repeat the last refile or write (for the description of @kbd{>} (@code{mh-write-msg-to-file}), @pxref{Files and Pipes}). You can use a range in either case (for example, @kbd{C-u o 1 3 5-7 last:5 frombob @key{RET}}, @pxref{Ranges}). @cindex expunging refiles and deletes @cindex undoing refiles and deletes @findex mh-undo @kindex u If you've deleted a message or refiled it, but changed your mind, you can cancel the action before you've executed it. Use @kbd{u} (@code{mh-undo}) to undo a refile on or deletion of a single message. You can also undo refiles and deletes for messages that are found in a given range (@pxref{Ranges}). @findex mh-undo-folder @kindex F u Alternatively, you can use @kbd{F u} (@code{mh-undo-folder}) to undo all refiles and deletes in the current folder. @findex mh-execute-commands @kindex x If you've marked messages to be deleted or refiled and you want to go ahead and delete or refile the messages, use @kbd{x} (@code{mh-execute-commands}). Many MH-E commands that may affect the numbering of the messages (such as @kbd{F r} or @kbd{F p}) will ask if you want to process refiles or deletes first and then either run @kbd{x} for you or undo the pending refiles and deletes. @kindex x @vindex mh-after-commands-processed-hook @vindex mh-before-commands-processed-hook The command @kbd{x} runs @code{mh-before-commands-processed-hook} before the commands are processed and @code{mh-after-commands-processed-hook} after the commands are processed. Variables that are useful with the former hook include @code{mh-delete-list} and @code{mh-refile-list} which can be used to see which changes will be made to the current folder, @code{mh-current-folder}. Variables that are useful with the latter hook include @code{mh-folders-changed}, which lists which folders were affected by deletes and refiles. This list will always include the current folder @code{mh-current-folder}. @findex mh-copy-msg @kindex c @kindex o If you wish to copy a message to another folder, you can use the command @kbd{c} (@code{mh-copy-msg}) (see the @option{-link} argument to @command{refile}(1)). Like the command @kbd{o}, this command prompts you for the name of the target folder and you can specify a range (@pxref{Ranges}). Note that unlike the command @kbd{o}, the copy takes place immediately. The original copy remains in the current folder. @cindex junk mail @cindex MH-Folder mode @cindex MH-Folder Show mode @cindex modes, MH-Folder @cindex modes, MH-Folder Show @cindex spam @findex mh-toggle-showing @kindex t The command @kbd{t} (@code{mh-toggle-showing}) switches between MH-Folder mode and MH-Folder Show mode@footnote{For you Emacs wizards, this is implemented as an Emacs minor mode.}. MH-Folder mode turns off the associated show buffer so that you can perform operations on the messages quickly without reading them. This is an excellent way to prune out your junk mail or to refile a group of messages to another folder for later examination. @cindex MH-Folder mode @cindex MH-Show mode @cindex modes, MH-Folder @cindex modes, MH-Show @cindex moving between messages @kindex t @vindex mh-recenter-summary-flag When you use @kbd{t} to toggle from MH-Folder Show mode to MH-Folder mode, the MH-Show buffer is hidden and the MH-Folder buffer is left alone. Setting @code{mh-recenter-summary-flag} to a non-@code{nil} value causes the toggle to display as many scan lines as possible, with the cursor at the middle. The effect of @code{mh-recenter-summary-flag} is rather useful, but it can be annoying on a slow network connection. @findex mh-visit-folder @kindex F v @vindex mh-large-folder When you want to read the messages that you have refiled into folders, use the command @kbd{F v} (@code{mh-visit-folder}) to visit the folder. You are prompted for the folder name. The folder buffer will show just unseen messages if there are any; otherwise, it will show all the messages in the buffer as long there are fewer than @code{mh-large-folder} messages. If there are more, then you are prompted for a range of messages to scan. You can provide a prefix argument in order to specify a range of messages to show when you visit the folder (@pxref{Ranges}). In this case, regions are not used to specify the range and @code{mh-large-folder} is ignored. Note that this command can also be used to create folders. If you specify a folder that does not exist, you will be prompted to create it. @findex mh-search @kindex F s If you forget where you've refiled your messages, you can find them using @kbd{F s} (@code{mh-search}). @xref{Searching}. @cindex @command{procmail} @cindex @samp{unseen} sequence @cindex sequence, @samp{unseen} @cindex Unix commands, @command{procmail} @cindex unseen messages, viewing @findex mh-index-new-messages @kindex F n @vindex mh-new-messages-folders If you use a program such as @command{procmail} to file your incoming mail automatically, you can display new, unseen, messages using the command @kbd{F n} (@code{mh-index-new-messages}). All messages in the @samp{unseen} sequence from the folders in @code{mh-new-messages-folders} are listed. However, this list of folders can be overridden with a prefix argument: with a prefix argument, enter a space-separated list of folders, or nothing to search all folders. @cindex @samp{tick} sequence @cindex sequence, @samp{tick} @cindex ticked messages, viewing @findex mh-index-ticked-messages @kindex F ' @vindex mh-ticked-messages-folders If you have ticked messages (@pxref{Sequences}), you can display them using the command @kbd{F '} (@code{mh-index-ticked-messages}). All messages in the @samp{tick} sequence from the folders in @code{mh-ticked-messages-folders} are listed. With a prefix argument, enter a space-separated list of folders, or nothing to search all folders. @findex mh-index-sequenced-messages @kindex F q @vindex mh-new-messages-folders You can display messages in any sequence with the command @kbd{F q} (@code{mh-index-sequenced-messages}). All messages from the folders in @code{mh-new-messages-folders} in the sequence you provide are listed. With a prefix argument, enter a space-separated list of folders at the prompt, or nothing to search all folders. @vindex mh-new-messages-folders @vindex mh-recursive-folders-flag @vindex mh-ticked-messages-folders Set the options @code{mh-new-messages-folders} and @code{mh-ticked-messages-folders} to @samp{Inbox} to search the @samp{+inbox} folder or @samp{All} to search all of the top level folders. Otherwise, list the folders that should be searched with the @samp{Choose Folders} menu item. See @code{mh-recursive-folders-flag}. @cindex buffers, @samp{*MH-E Folders*} @cindex @samp{*MH-E Folders*} @findex mh-kill-folder @findex mh-list-folders @findex mh-pack-folder @findex mh-rescan-folder @findex mh-sort-folder @kindex F k @kindex F l @kindex F p @kindex F r @kindex F S Other commands you can perform on folders include: @kbd{F l} (@code{mh-list-folders}), to place a listing of all the folders in your mail directory in a buffer called @samp{*MH-E Folders*} (@pxref{Miscellaneous}); @kbd{F k} (@code{mh-kill-folder}), to remove a folder; @kbd{F S} (@code{mh-sort-folder}), to sort the messages by date (see @c