(Finsert_string, Fml_if, Fml_provide_prefix_argument)
[bpt/emacs.git] / man / rmail.texi
index 1945545..19dd6b7 100644 (file)
@@ -1,5 +1,5 @@
 @c This is part of the Emacs manual.
-@c Copyright (C) 1985, 86, 87, 93, 94, 95, 1997 Free Software Foundation, Inc.
+@c Copyright (C) 1985,86,87,93,94,95,1997,2001 Free Software Foundation, Inc.
 @c See file emacs.texi for copying conditions.
 @node Rmail, Dired, Sending Mail, Top
 @chapter Reading Mail with Rmail
@@ -32,6 +32,7 @@ visiting a proper Rmail file.
 * Summary: Rmail Summary.    Summaries show brief info on many messages.
 * Sort: Rmail Sorting.       Sorting messages in Rmail.
 * Display: Rmail Display.    How Rmail displays a message; customization.
+* Coding: Rmail Coding.      How Rmail handles decoding character sets.
 * Editing: Rmail Editing.    Editing message text and headers in Rmail.
 * Digest: Rmail Digest.      Extracting the messages from a digest message.
 * Out of Rmail::            Converting an Rmail file to mailbox format.
@@ -68,13 +69,13 @@ message by specifying its message number with the @kbd{j} key
 (@pxref{Rmail Motion}).
 
 @kindex s @r{(Rmail)}
-@findex rmail-save
+@findex rmail-expunge-and-save
   Following the usual conventions of Emacs, changes in an Rmail file
 become permanent only when the file is saved.  You can save it with
-@kbd{s} (@code{rmail-save}), which also expunges deleted messages from
-the file first (@pxref{Rmail Deletion}).  To save the file without
-expunging, use @kbd{C-x C-s}.  Rmail also saves the Rmail file after
-merging new mail from an inbox file (@pxref{Rmail Inbox}).
+@kbd{s} (@code{rmail-expunge-and-save}), which also expunges deleted
+messages from the file first (@pxref{Rmail Deletion}).  To save the
+file without expunging, use @kbd{C-x C-s}.  Rmail also saves the Rmail
+file after merging new mail from an inbox file (@pxref{Rmail Inbox}).
 
 @kindex q @r{(Rmail)}
 @findex rmail-quit
@@ -82,7 +83,7 @@ merging new mail from an inbox file (@pxref{Rmail Inbox}).
 @findex rmail-bury
   You can exit Rmail with @kbd{q} (@code{rmail-quit}); this expunges and
 saves the Rmail file and then switches to another buffer.  But there is
-no need to `exit' formally.  If you switch from Rmail to editing in
+no need to ``exit'' formally.  If you switch from Rmail to editing in
 other buffers, and never happen to switch back, you have exited.  (The
 Rmail command @kbd{b}, @code{rmail-bury}, does this for you.)  Just make
 sure to save the Rmail file eventually (like any other file you have
@@ -128,7 +129,7 @@ to move sequentially through the file, since this is the order of
 receipt of messages.  When you enter Rmail, you are positioned at the
 first message that you have not yet made current (that is, the first one
 that has the @samp{unseen} attribute; @pxref{Rmail Attributes}).  Move
-forward to see the other new messages; move backward to reexamine old
+forward to see the other new messages; move backward to re-examine old
 messages.
 
 @table @kbd
@@ -255,7 +256,7 @@ deleted remains current.  A numeric argument to either command reverses
 the direction of motion after deletion.
 
 @vindex rmail-delete-message-hook
-  Whenever Rmail deletes a message, it invokes the function(s) listed in
+  Whenever Rmail deletes a message, it runs the hook
 @code{rmail-delete-message-hook}.  When the hook functions are invoked,
 the message has been marked deleted, but it is still the current message
 in the Rmail buffer.
@@ -441,11 +442,6 @@ specified file.  This file may be an Rmail file or it may be in system
 inbox format; the output commands ascertain the file's format and write
 the copied message in that format.
 
-  When copying a message to a file in Unix mail file format, these
-commands include whichever header fields are currently visible.  Use the
-@kbd{t} command first, if you wish, to specify which headers to show
-(and copy).
-
   The @kbd{o} and @kbd{C-o} commands differ in two ways: each has its
 own separate default file name, and each specifies a choice of format to
 use when the file does not already exist.  The @kbd{o} command uses
@@ -687,8 +683,7 @@ the same as the first time.  Alternatively, you can edit the text or
 headers and then send it.  The variable
 @code{rmail-retry-ignored-headers}, in the same format as
 @code{rmail-ignored-headers} (@pxref{Rmail Display}), controls which
-headers are stripped from the failed message when retrying it; it
-defaults to @code{nil}.
+headers are stripped from the failed message when retrying it.
 
 @kindex f @r{(Rmail)}
 @findex rmail-forward
@@ -717,7 +712,7 @@ current one.
   @dfn{Resending} is an alternative similar to forwarding; the
 difference is that resending sends a message that is ``from'' the
 original sender, just as it reached you---with a few added header fields
-@samp{Resent-from} and @samp{Resent-to} to indicate that it came via
+@samp{Resent-From} and @samp{Resent-To} to indicate that it came via
 you.  To resend a message in Rmail, use @kbd{C-u f}.  (@kbd{f} runs
 @code{rmail-forward}, which is programmed to invoke @code{rmail-resend}
 if you provide a numeric argument.)
@@ -741,7 +736,7 @@ already composing, or to alter a message you have sent.@refill
   If you set the variable @code{rmail-mail-new-frame} to a
 non-@code{nil} value, then all the Rmail commands to start sending a
 message create a new frame to edit it in.  This frame is deleted when
-you send the message, or when you use the @samp{Don't Send} item in the
+you send the message, or when you use the @samp{Cancel} item in the
 @samp{Mail} menu.
 
   All the Rmail commands to send a message use the mail-composition
@@ -753,10 +748,11 @@ method that you have chosen (@pxref{Mail Methods}).
 
   A @dfn{summary} is a buffer containing one line per message to give
 you an overview of the mail in an Rmail file.  Each line shows the
-message number, the sender, the labels, and the subject.  Almost all
-Rmail commands are valid in the summary buffer also; these apply to the
-message described by the current line of the summary.  Moving point in
-the summary buffer selects messages as you move to their summary lines.
+message number and date, the sender, the line count, the labels, and
+the subject.  Moving point in the summary buffer selects messages as
+you move to their summary lines.  Almost all Rmail commands are valid
+in the summary buffer also; when used there, they apply to the message
+described by the current line of the summary.
 
   A summary buffer applies to a single Rmail file only; if you are
 editing multiple Rmail files, each one can have its own summary buffer.
@@ -791,6 +787,10 @@ Summarize messages that have one or more of the specified recipients
 @item C-M-t @var{topic} @key{RET}
 Summarize messages that have a match for the specified regexp
 @var{topic} in their subjects (@code{rmail-summary-by-topic}).
+@item C-M-s @var{regexp}
+Summarize messages whose headers and the subject line match the
+specified regular expression @var{regexp}
+(@code{rmail-summary-by-regexp}).
 @end table
 
 @kindex h @r{(Rmail)}
@@ -820,6 +820,13 @@ addresses separated by commas.@refill
 makes a partial summary mentioning only the messages whose subjects have
 a match for the regular expression @var{topic}.
 
+@kindex C-M-s @r{(Rmail)}
+@findex rmail-summary-by-regexp
+  @kbd{C-M-s @var{regexp} @key{RET}} (@code{rmail-summary-by-regexp})
+makes a partial summary which mentions only the messages whose headers
+(including the date and the subject lines) match the regular
+expression @var{regexp}.
+
   Note that there is only one summary buffer for any Rmail file; making one
 kind of summary discards any previously made summary.
 
@@ -976,64 +983,71 @@ means to show the reformatted header, and a zero or negative argument
 means to show the full header.
 
 @vindex rmail-highlighted-headers
-  When used with a terminal that supports multiple fonts or colors, Rmail
+  When the terminal supports multiple fonts or colors, Rmail
 highlights certain header fields that are especially interesting---by
 default, the @samp{From} and @samp{Subject} fields.  The variable
 @code{rmail-highlighted-headers} holds a regular expression that
-specifies the header fields to highlight; if it matches the beginning of
-a header field, that whole field is highlighted.
-
-  If you specify unusual colors for your text foreground and background,
-the colors used for highlighting may not go well with them.  If so,
-specify different colors for the @code{highlight} face.  That is worth
-doing because the @code{highlight} face is used for other kinds of
-highlighting as well.  @xref{Faces}, for how to do this.
-
-  To turn off highlighting entirely in Rmail, set
+specifies the header fields to highlight; if it matches the beginning
+of a header field, that whole field is highlighted.
+
+  If you specify unusual colors for your text foreground and
+background, the colors used for highlighting may not go well with
+them.  If so, specify different colors for the face
+@code{rmail-highlight-face}.  @xref{Faces}, for how to do this.  To
+turn off highlighting entirely in Rmail, set
 @code{rmail-highlighted-headers} to @code{nil}.
 
-@findex goto-addr
-  URLs in messages may be highlighted and activated for following with the
-mouse or keyboard by customizing the hook @code{rmail-show-message-hook}
-to add @code{goto-addr}.
+  You can highlight and activate URLs in incoming messages by adding
+the function @code{goto-address} to the hook
+@code{rmail-show-message-hook}.  Then you can browse these URLs by
+clicking on them with @kbd{Mouse-2} or by moving to one and typing
+@kbd{C-c @key{RET}}.  @xref{Goto-address, Activating URLs, Activating URLs}.
+
+@node Rmail Coding
+@section Rmail and Coding Systems
 
 @cindex decoding mail messages (Rmail)
-  Rmail automatically decodes messages which contain non-@sc{ascii}
-characters, like it does with visited files and output from
-subprocesses.  Rmail uses the standard ``charset=@var{encoding}''
-header in the message to find out how was the message encoded by the
-sender.  It then maps @var{encoding} into the corresponding coding
+  Rmail automatically decodes messages which contain non-ASCII
+characters, just as Emacs does with files you visit and with subprocess
+output.  Rmail uses the standard @samp{charset=@var{charset}} header in
+the message, if any, to determine how the message was encoded by the
+sender.  It maps @var{charset} into the corresponding Emacs coding
 system (@pxref{Coding Systems}), and uses that coding system to decode
-message text.  If the message header doesn't have the charset
-specification, or if the @var{encoding} it specifies is not recognized
-by Emacs, Rmail attempts to detect the encoding by applying the usual
-heuristics and defaults (@pxref{Recognize Coding}).
+message text.  If the message header doesn't have the @samp{charset}
+specification, or if @var{charset} is not recognized,
+Rmail chooses the coding system with the usual Emacs heuristics and
+defaults (@pxref{Recognize Coding}).
 
-@findex rmail-redecode-body
 @cindex fixing incorrectly decoded mail messages
-  Occasionally, a message might be decoded incorrectly, either because
-Emacs failed to guess the encoding in the absence of the ``charset''
-specification, or because the ``charset'' specification was wrong.
-For example, a misconfigured mailer could send a message with a
-``charset=iso-8859-1'' header whereas the mssage is encoded in koi8-r.
-Whenever you see a message text garbled or some of its characters
-displayed as empty boxes, you can try to fix that by decoding the
-message again using a specific coding system.  (This requires that you
-guess the correct encoding, or talk to the sender and ask them.)  To
-that end, invoke the @code{rmail-redecode-body} command.  It prompts
-for a name of a coding system and then redecodes the message body
-using that coding system.
-
-  Redecoding the message body is a lossless operation with most
-encodings, in particular with 8-bit encodings such as iso-8859 or
+  Occasionally, a message is decoded incorrectly, either because Emacs
+guessed the wrong coding system in the absence of the @samp{charset}
+specification, or because the specification was inaccurate.  For
+example, a misconfigured mailer could send a message with a
+@samp{charset=iso-8859-1} header when the message is actually encoded
+in @code{koi8-r}.  When you see the message text garbled, or some of
+its characters displayed as empty boxes, this may have happened.
+
+@findex rmail-redecode-body
+  You can correct the problem by decoding the message again using the
+right coding system, if you can figure out or guess which one is
+right.  To do this, invoke the @kbd{M-x rmail-redecode-body} command.
+It reads the name of a coding system, encodes the message body using
+whichever coding system was used to decode it before, then redecodes
+it using the coding system you specified.  If you specified the right
+coding system, the result should be readable.
+
+  Decoding and encoding using the wrong coding system is lossless for
+most encodings, in particular with 8-bit encodings such as iso-8859 or
 koi8.  So, if the initial attempt to redecode the message didn't
-result in a legible text, you could try other possible encodings,
-until you succeed.
+result in a legible text, you can try other coding systems until you
+succeed.
 
-  With some encodings, notably those from the iso-2022 family,
-@code{rmail-redecode-body} might fail to recover the original form of
-the message.  However, such encodings rarely cause the kind of trouble
-for which @code{rmail-redecode-body} is intended to be used.
+  With some coding systems, notably those from the iso-2022 family,
+information can be lost in decoding, so that encoding the message
+again won't bring back the original incoming text.  In such a case,
+@code{rmail-redecode-body} cannot work.  However, the problems that
+call for use of @code{rmail-redecode-body} rarely occur with those
+coding systems.  So in practice the command works when you need it.
 
 @node Rmail Editing
 @section Editing Within a Message
@@ -1066,7 +1080,7 @@ editing that you have done, by typing @kbd{C-c C-]}.
 runs the hook @code{rmail-edit-mode-hook} (@pxref{Hooks}).  It adds the
 attribute @samp{edited} to the message.  It also displays the full
 headers of the message, so that you can edit the headers as well as the
-body of the message, and your changes in the the headers will be
+body of the message, and your changes in the headers will be
 permanent.
 
 @node Rmail Digest
@@ -1095,13 +1109,33 @@ message itself is flagged as deleted.
 
 @node Out of Rmail
 @section Converting an Rmail File to Inbox Format
+@cindex Babyl format to Inbox format
+@cindex converting Rmail file to mailbox format
 
 @findex unrmail
   The command @kbd{M-x unrmail} converts a file in Rmail format to inbox
-format (also known as the system mailbox format), so that you can use it
-with other mail-editing tools.  You must specify two arguments, the name
-of the Rmail file and the name to use for the converted file.  @kbd{M-x
-unrmail} does not alter the Rmail file itself.
+format (also known as the system mailbox, or mbox, format), so that
+you can use it with other mail-editing tools.  You must specify two
+arguments, the name of the Rmail file and the name to use for the
+converted file.  @kbd{M-x unrmail} does not alter the Rmail file itself.
+
+@pindex b2m
+  @kbd{M-x unrmail} is useful if you can run Emacs on the machine
+where the Rmail file resides, or can access the Rmail file remotely
+(@pxref{Remote Files}) from a machine where Emacs is installed.  If
+accessing Rmail files from Emacs is impossible, you can use the
+@command{b2m} program instead.  @command{b2m} is part of the Emacs
+distribution, it is installed into the same directory where all the
+other auxiliary programs (@command{etags} etc.) are installed, and its
+source is available in the Emacs source distribution, so that you
+could copy the source to the target machine and compile it there.
+
+  To convert a file @file{@var{babyl-file}} into @file{@var{mbox-file}},
+invoke @command{b2m} like this:
+
+@example
+ b2m < @var{babyl-file} > @var{mbox-file}
+@end example
 
 @node Rmail Rot13
 @section Reading Rot13 Messages
@@ -1191,7 +1225,7 @@ supported, it is used by default whenever you attempt to retrieve
 POP mail when @code{rmail-pop-password} and
 @code{rmail-pop-password-required} are unset.
 
-@cindex POP inboxes in reverse order
+@cindex reverse order in POP inboxes
   Some POP servers store messages in reverse order.  If your server does
 this, and you would rather read your mail in the order in which it was
 received, you can tell @code{movemail} to reverse the order of