\subsection{MH Alternatives: {\sl Mh-rmail} and {\sl RMAIL}}

GNU Emacs, in its near infinite diversity, contains not one, but two
mail reading subsystems: {\sl RMAIL} and {\sl Mh-rmail}.  Both have
similar user interfaces (single keystroke commands, etc), but use
radically different formats for storing mail.

\subsubsection{Mh-Rmail}

Mh-rmail is a ``front-end'' for MH, the standard Project Athena mail
reading system.  This section assumes that you are familiar with MH, at
least at the level of {\bf Essential Mail}, as well as familiar enough
with GNU Emacs to be able to use multiple buffers.

The advantage of using {\sl Mh-rmail} is that you don't have to wait for
an editor to start up (like {\tt comp}); the editor is there already!
And the commands are familiar to most people who are used to MH.

\paragraph{Starting {\sl Mh-rmail}:}

{\sl Mh-rmail} exists only inside GNU Emacs; in Emacs, type the command
{\tt M-x} {\sl mh-rmail}.  You should first see the message {\sl Loading
mh-e...done}, and then {\sl inc +inbox...done}.  You are now in an ``mh
folder buffer'', called {\sl +inbox} showing the summary lines for the
new messages (not coincidentally, the output from the {\sl inc} command).
The folder initially only contains the new summary lines.  If you wish
to see all the mail you have in the folder, use {\tt M-r} to
``rescan'' the folder.  If you get new mail while in a folder buffer,
use the {\tt M-i} command to ``inc'' new mail.

% this binding was changed recently in the experimental version
% of MH-E I'm running....

\paragraph{Commands for reading your mail}

There are two main states of {\sl Mh-rmail}: one-window summary mode,
and two-window mail-reading mode.  To switch between them, use the {\sl
t} (for ``toggle'') command.  When you do this from one-window summary
mode, the screen splits into two windows.  The window on the top
contains the folder buffer, and the window on the bottom contains a {\sl
mh-show} buffer, containing the text of the message.  The cursor remains
in the top window, on the summary line of the current message.  If it
gets out of agreement with the show buffer (for example, if you use {\sl
{\tt C-c}n} and {\sl {\tt C-c}p} instead of {\sl n} and {\sl p} to move
through it), just hit {\sl .} to synchronize the two windows.

You can use {\sl SPACE\/} to page the message up a screenfull, {\sl DEL\/} to
page down a screenfull.

\subparagraph{Reading other messages} 

You can look at other messages using the {\sl n} and {\sl p} commands to
go forward and back one message; like most other commands, these accept
a repeat count with {\sl {\tt C-c}u}.

You can get a hard copy of a message using the {\sl l} command.  This
prints it on the default printer.  You may change the default printer by
changing {\it lpr-switches} as described above.

\subparagraph{Deleting and refiling messages}

{\sl Mh-rmail} works on a ``batch'' principle for alterations to the
state of a folder; you do a number of commands in the folder buffer to
mark messages for deletion or refiling in other folders, and then you
type the {\sl x} command to actually process the commands.

{\sl d} marks a message for deletion, and {\sl \^{ }} (up-arrow) marks
it for refiling (you will be prompted for the name of a folder to refile
it in).  {\sl !} refiles the current message in the same folder as the
last refile.  {\sl u} undoes any action which was marked for the line.

To actually execute all of the commands, use the {\sl x} command.  You
should do this before exiting Emacs, as marked deletions don't actually
occur until you do the {\sl x}.

\paragraph{Sending mail}
There are several ways to send mail.  All initially ask a few questions,
then give you a window with a partial draft to play with.
The simplest is the {\sl s} command (which is like the shell command
{\tt comp}).  Another way to get at this command from outside of {\sl
Mh-rmail} is with {\tt M-x} {\sl mh-smail}.  It first prompts for the ``To:'',
``Cc:'' and ``Subject:'' lines for the new message, and then gives you a
draft with those lines filled in.  {\sl A} (answer) is related; it asks
whether you want to reply to the sender (``from''), the sender and the
people on the To: list (``to''), or the sender and all recipients
(``cc''); it fills out the draft appropriately and sets the subject to
be ``Re:'' plus the old subject.  {\sl F} is used to forward mail to
other parties; it prompts for ``To:'' and ``Cc:'', and sets the subject
to be ``[Original Sender: Original Subject]''.  The most bizarre one
(and possibly most useful) is {\tt M-e} (Extract rejected mail),
which allows you to extract the original message from a message bounced
from MAILER-DAEMON.  You can type
{\sl {\tt C-c} {\tt C-c}} to send the draft when you're done with it.

\subparagraph{Draft mode commands} 

There are a large number of commands available in mh-letter-mode; most
importantly, {\sl {\tt C-c} {\tt C-c}} (already mentioned) sends the current
draft.

{\sl {\tt C-c} t, {\tt C-c} c, {\tt C-c} s, {\tt C-c} b,} and {\sl {\tt C-c} f\/} move the
cursor to the end of the current To:, Cc:, Subject:, Bcc:, and Fcc:
lines, respectively, in the draft.  If a line with the appropriate
header does not exist, it is inserted.

{\sl {\tt C-c} {\tt C-y}} inserts a message from a folder into the
draft.  It is useful if you want to quote someone else's message.

{\sl {\tt C-c} y} is similar to {\sl {\tt C-c} {\tt C-y}}, except that
it doesn't prompt for the folder and letter to insert (it inserts the
message that you are replying to).

{\sl {\tt C-c} q} deletes the draft, and returns you back to where you were.

{\sl {\tt C-c} w} lists the people receiving the the draft in another buffer
(this runs the MH {\tt whom} program to find out the recipients.

\subparagraph{Other commands}

\ {\tt M-p} can be used to renumber the folder so that all messages left
in it start with ``1'' and go on up from there; this may take a while if
you have a large folder.

{\tt M-l} (meta-ell) lists all your folders in a temporary window.  {\tt M-f}
lets you choose a range of another folder to bring up in a new folder
buffer; you can then use {\sl {\tt C-X} b} to switch between them.

{\tt M-k} allows you to delete a folder.  This can be dangerous.

\paragraph{Variables which can be set.}

These variables can be set as described above in the Emacs section.
\begin{description}
\item[{\sl mh-clean-message-header}] If set to {\sl t} (true), it cleans
out most of the garbage headers (like ``Received:'' and ``Message-Id:'')
out of the message; this takes a little more time every time you look at
a message, and so is set to {\sl nil} (false) by default.

\item[{\sl mh-lpr-command-format}] sets the format used for the {\sl l}
command, to print a message.

\item[{\sl mh-summary-height}] sets the height in lines of the summary
window, including the mode line.  By default, it is set to 4.

\item[{\sl mh-ins-buf-prefix}] sets the prefix inserted before each line
of messages which are ``yanked'' into a draft.  By default, it is set to
{\sl ``$>>$''}
\end{description}

\subsubsection{Rmail}

{\sl Rmail} is the standard GNU Emacs mail reader.  It has, along with
{\sl Mh-rmail}, the advantages of reading mail {\em inside} an
editor---namely, not having to wait for an editor to start up if you
wish to compose or edit mail.  It is invoked by {\tt M-x} {\sl rmail}
from within emacs; or {\tt emacs -e rmail} \footnote {This simply
brings up emacs and starts {\sl rmail} initially} from the shell.  Its
syntax is fairly simple.  It uses the {\it .mailrc} file, for things
like aliasing in the format as {\tt Mail} (read the manual page on
{\tt Mail} by running {\tt man mail} for a description of this
format).  Its major disadvantage is that the format {\sl rmail} uses
to store mail is rather strange compared to most, using control
characters and so forth\footnote{It is almost exactly the Babyl mail
format used on some other computer systems at MIT {\Large or is it
exactly?}}.  Files can be archived in the standard Unix format, but
this is not the default.

Commands in RMAIL are typically single-character commands, for quick and
easy use (this can be dangerous, if you are unsure of your typing
ability).

\paragraph {Starting {\sl rmail}}
	After invoking {\sl rmail}, emacs will report on its status
(e.g loading rmail, getting mail from post office...) in the mini-buffer.
Following this, you will begin in one of three
places.  If you got new mail, you start with the RMAIL buffer
displaying the first screen of the first new message you received.  If
you didn't receive any new mail, but do have old mail still in your
RMAIL file, the RMAIL buffer will dislplay the first screen of the
last message still filed along with displaying the message {\sl (No
new mail has arrived)} in the mini-buffer.  However, if you have no
new mail and there is no old mail still in your RMAIL file, you will
see the following message in your RMAIL buffer along with the no new
mail indication in the mini-buffer:

\begin{verbatim}
BABYL OPTIONS:
Version: 5
Labels:
Note:   This is the header of an rmail file.
Note:   If you are seeing it in rmail,
Note:    it means the file has no messages in it.

\end{verbatim}

\paragraph{Reading mail}
Emacs stores the mail you receive while using {\sl rmail} in an RMAIL
file (by default this is \~/RMAIL).  When you start {\sl rmail} emacs
simply loads in the RMAIL file and changes to a special mode for {\sl rmail}.
In this mode, you can move forward and backward within a mail message by
using {\sl SPACE} and {\sl DEL} respectively.  Scrolling through mail messages
is effected by using {\sl p} for previous message and {\sl n} for next message.
It is also possible to specify explicitly which message to visit; this
is accomplished by typing a number representing the relative position of
the message you wish to visit in the RMAIL file and then typing {\sl j}.
Typing {\sl .} or {\sl M-$<$} will move you immediately to the first message
in the RMAIL file; similarly, {\sl $>$} will move you to the last message.

\paragraph {Deleting...the concept} 
The current mail message (the one displayed in the RMAIL buffer) will
be deleted if you type {\sl d}; as long as there are following
messages in the file Alternately, you can use {\sl C-d}; when this is
used after deleting the message {\sl rmail} attempts to visit the
previous message.  However, as long as you haven't expunged the
deleted messages, the deletion isn't permanent.  Typing {\sl u} will
attempt to undelete the current message; if it is not successful (i.e.
the current message wasn't deleted), it will try earlier messages
until it finds a deleted message to undelete.  You may wonder, how a
deleted message could be the current message.  There are several ways
for this to happen.  {\sl M-n} and {\sl M-p} behave like {\sl n} and
{\sl p} except they will even visit deleted messages.  Also, {\sl j}
will jump to a message regardless of whether or not it has been
deleted.  The deletions will be made permenant when you expunge the
RMAIL file using {\sl e}; this is also automatically done when you
exit {\sl rmail} or save the RMAIL file.

\paragraph{Taking inventory}
It is possible to see exactly what messages you have in your RMAIL
file by using {\sl C-M-h} or {\sl h}.  This will split your emacs buffer into
two buffers.  The summary buffer will show a single line listing
for every message (even the deleted ones) in your RMAIL file.  This lists
message number, followed by a {\tt D} if the message has been deleted,
date, sender, and subject for each message.  A similar summary can be
generated for particular recipient(s) using {\sl C-M-r}; you will be
prompted in the mini-buffer for the recipients to include.
It is possible to scroll through the summary buffer using normal
emacs control keys (e.g. {\sl C-p}, {\sl C-n}, {\sl C-v}, {\sl M-v},...).

\subparagraph {Ackphtpp!...there are multiple buffers displayed in my
emacs}
	{\sl C-M-h}  as well as several other {\sl rmail} commands will
split your emacs window/screen into two separate emacs buffers.  It is
possible to switch which of these is active by typing {\sl C-x o}.  It
is also possible to make one of the buffers go away, thus returning you
to single buffer mode in emacs by typing {\sl C-x 1} in the buffer
you want to keep.  Don't Panic if you do this in the {\it wrong} buffer
as you can always change buffers using {\sl C-x b}.  The {\sl rmail} buffer
is called RMAIL.

\paragraph {Sending mail}
Inside rmail, you can send a mail message simply by typing {\sl m}.
This will simply create a *mail* buffer with fields for To: and
Subject: to be filled in and an appropriate text separator.  Simply
fill in these fields and add your text after the separator using
normal emacs editing commands.  To send the message, use {\sl C-c
C-c}.  By typing {\sl r} in {\sl rmail} you can reply to the current
message.  This behaves much like {\sl m} except the header lines are
already filled in appropriately according to the message you are
replying to.  Similarly, typing {\sl f} allows you to forward the
current message.  This starts a new message to be sent like {\sl m}
with the subject line filled in and the message you were visiting in
the text section of the outgoing message below a line delimiting the
start of the forwarded message.  You should fill in the To: field and
then whatever text you deem appropriate (including editing the
forwarded message if you desire).  Sending both replies and forwards
is accomplished just as with {\sl m} by using {\sl C-c C-c}.  If you
stop working on an outgoing mail message to do something else (e.g.
look at some of your mail), you can get back to the buffer where your
editing outgoing mail by typing {\sl c}.

\subparagraph{sending mail without invoking {\sl rmail}}
From emacs it is possible to send mail without invoking {\sl rmail}.
This is done simply by typing {\sl C-x m} or {\sl C-x 4 m} ({\sl C-x 4 m}
puts you in two window mode as well as starting outgoing mail; if
you happen to already be in two window mode {\sl C-x 4 m} will use
the window you are not currently in to compose the mail message).  Again
mail is sent using {\sl C-c C-c}.

\paragraph {Filing mail}
Yes, there are things to do with mail other than delete it.  Typing
{\sl o} will prompt you for a file to write the current message out
to.  It will then append the current message to this file in Babyl
format \footnote {Babyl is somewhat obscure and useful only to {\sl
rmail}} (creating it if it doesn't already exits).  You can then type
{\sl i} to view files written out in this manner; {\sl rmail} will
prompt you for the filename and load the file in RMAIL mode so that
you can view them in the same way as when you originally received them
and they were in your RMAIL file.

You can also write mail out into a somewhat more readable form,
particularly Unix-format mail (that is {\bf all} the headers and the
message) by typing {\sl C-o}.  Like {\sl o}, {\sl rmail} will prompt
you for a file to write the message out to and then append the current
message to that file.  {\sl Rmail} provides no explicit way to load
files stored in this format back into {\sl rmail}.

\paragraph {Saving mail}
	Typing {\sl C-x C-s} will save the RMAIL file without first 
attempting to expunge it.  Using {\sl s} saves the RMAIL file after
expunging it.

\paragraph {Exiting {\sl rmail}}
	The normal way to exit {\sl rmail} rmail is to type {\sl q}.
This expunges deleted messages, saves the RMAIL file, and switches to
the buffer you were in when you invoked {\sl rmail} (or *scratch* if
you started with {\tt emacs -e rmail}).

\paragraph {More mail?}
	If you receive new mail while in {\sl Rmail} or simply want to check if
you have more mail, type {\sl g} to attempt to get new mail.  If there
is new mail, it will be added to the RMAIL file land you can proceed
accordingly.  If there is no new mail, the message {\sl (No new mail has arrived)} will be displayed in the min-buffer.

\paragraph {Aliasing in {\sl rmail}}
	Aliases can be used to give yourself a shorter or more
appropriate name for someone you send mail to or to create a personal
mailing list.  Aliasing in {\sl rmail} is accomplished by specifying
the aliases in the file {\it \~/.mailrc}.  Aliases are of the form: 
{\tt alias} alias\_name name1 [name2 [name3 .....]].  That is,
for each alias, you should have a line in your .mailrc file that
starts with {\tt alias} and is followed by the alias you are defining set off
by one or more spaces; the remainder of the line is a {\sl SPACE} separated 
list of actual email addresses to be bound to the alias being defined.
Here is a sample .mailrc file:

\begin{verbatim}
alias quux root@deep-thought
alias foo beeblebrox@zaphod.caltech.edu
alias bar ford@eddie.mit.edu
alias baz arthur
alias frobble foo bar baz eddie!siesmo!fribble
\end{verbatim}

Here, quux, foo, bar, and baz are simply aliased to the respective strings
following them.  Whenever any of these is used in the To:, Cc:, or Bcc:
field of a letter sent from {\sl rmail}, the appropriate string will
be substituted when the mail is actually sent.  When frobble is specified
as the recipient of a message, the message will be sent to 
beeblebrox@zaphod.caltech.edu, ford@eddie.mit.edu, arthur, and 
eddie!siesmo!fribble \footnote {Yes, {\sl rmail} does expand recursive
aliases like this}.

\paragraph {Other random things...}
If you ever have a desire to edit a message you receive, simply type
{\sl w}. {\sl C-c C-c} will return you to {\sl rmail}. {\sl C-c C-]}
will return you to {\sl rmail} without making the changes you just
made to the mail message.

Typing {\sl M-s} will cause {\sl rmail} to prompt you for a string,
search for the string, and show the message in which it is found.

You may notice that {\sl rmail} does not display every header you may
have seen using other mail interfaces.  To toggle between seeing all the
headers and just the subset {\sl rmail} uses, type {\sl t}.

This description doesn't include {\bf everything} that can be done in {\sl rmail}.  To get a list of all the editing commands useable in RMAIL mode, type
{\sl C-h m} or {\sl ?}.

%% I decided not to bother mumbling about labels

% Local Variables:
% mode: TeX
% version-control: t
% make-backup-files: t
% End:
