aboutsummaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorChong Yidong2010-03-27 23:41:34 -0400
committerChong Yidong2010-03-27 23:41:34 -0400
commite73c243459162509dcfc5f74ff9811fe024c93f9 (patch)
tree875e8748d3a9b14470cf7fa8c7cb6e37000763ac /doc
parent481134fd24fa0c452667483be3ce8a31f9cf572b (diff)
downloademacs-e73c243459162509dcfc5f74ff9811fe024c93f9.tar.gz
emacs-e73c243459162509dcfc5f74ff9811fe024c93f9.zip
Document Message mode as the default mail mode.
* sending.texi (Sending Mail): Document the fact that Message mode is now the default mail mode. (Mail Format, Mail Headers): Document mail-from-style changes. (Mail Commands): Rename from Mail mode. Document Message mode. (Mail Misc): Rename from Mail mode Misc. (Mail Sending, Header Editing, Mail Misc): Switch to Message mode command names and update keybindings. (Header Editing): Document message-tab. De-document mail-self-blind, mail-default-reply-to, and mail-archive-file-name in favor of mail-default-headers. Ad index entries for user-full-name and user-mail-address. (Citing Mail): Update changes in Message mode behavior. Document mail-yank-prefix. (Mail Signature): New node, moved from Mail Misc. (Mail Aliases): Mail abbrevs are the default with Message mode. (Mail Methods): Note that Message mode is now the default. * rmail.texi (Rmail Reply): * text.texi (Text Mode): * major.texi (Major Modes): * mule.texi (Output Coding): Refer to Message mode. * custom.texi (Init Examples): Add xref to Mail Header. * emacs.texi (Top): Fix xrefs.
Diffstat (limited to 'doc')
-rw-r--r--doc/emacs/ChangeLog29
-rw-r--r--doc/emacs/custom.texi5
-rw-r--r--doc/emacs/emacs.texi9
-rw-r--r--doc/emacs/major.texi2
-rw-r--r--doc/emacs/mule.texi19
-rw-r--r--doc/emacs/rmail.texi24
-rw-r--r--doc/emacs/sending.texi972
-rw-r--r--doc/emacs/text.texi8
8 files changed, 492 insertions, 576 deletions
diff --git a/doc/emacs/ChangeLog b/doc/emacs/ChangeLog
index ca70c699b72..056c970b0f3 100644
--- a/doc/emacs/ChangeLog
+++ b/doc/emacs/ChangeLog
@@ -1,3 +1,32 @@
12010-03-28 Chong Yidong <cyd@stupidchicken.com>
2
3 Document Message mode as the default mail mode.
4
5 * sending.texi (Sending Mail): Copyedits.
6 (Mail Format, Mail Headers): Document mail-from-style changes.
7 (Mail Commands): Rename from Mail mode. Document Message mode.
8 (Mail Misc): Rename from Mail mode Misc.
9 (Mail Sending, Header Editing, Mail Misc): Switch to Message mode
10 command names and update keybindings.
11 (Header Editing): Document message-tab. De-document
12 mail-self-blind, mail-default-reply-to, and mail-archive-file-name in
13 favor of mail-default-headers. Ad index entries for user-full-name and
14 user-mail-address.
15 (Citing Mail): Update changes in Message mode behavior. Document
16 mail-yank-prefix.
17 (Mail Signature): New node, moved from Mail Misc.
18 (Mail Aliases): Mail abbrevs are the default with Message mode.
19 (Mail Methods): Note that Message mode is now the default.
20
21 * rmail.texi (Rmail Reply):
22 * text.texi (Text Mode):
23 * major.texi (Major Modes):
24 * mule.texi (Output Coding): Refer to Message mode.
25
26 * custom.texi (Init Examples): Add xref to Mail Header.
27
28 * emacs.texi (Top): Fix xrefs.
29
12010-03-25 Chong Yidong <cyd@stupidchicken.com> 302010-03-25 Chong Yidong <cyd@stupidchicken.com>
2 31
3 * maintaining.texi (VC With A Merging VCS): C-x v v now creates a 32 * maintaining.texi (VC With A Merging VCS): C-x v v now creates a
diff --git a/doc/emacs/custom.texi b/doc/emacs/custom.texi
index 408de24ed6e..f0faec4d40c 100644
--- a/doc/emacs/custom.texi
+++ b/doc/emacs/custom.texi
@@ -2269,8 +2269,9 @@ Specify your own email address, if Emacs can't figure it out correctly.
2269(setq user-mail-address "cheney@@torture.gov") 2269(setq user-mail-address "cheney@@torture.gov")
2270@end example 2270@end example
2271 2271
2272Various Emacs packages that need your own email address use the value of 2272Various Emacs packages, such as Message mode, consult
2273@code{user-mail-address}. 2273@code{user-mail-address} when they need to know your email address.
2274@xref{Mail Headers}.
2274 2275
2275@item 2276@item
2276Make Text mode the default mode for new buffers. 2277Make Text mode the default mode for new buffers.
diff --git a/doc/emacs/emacs.texi b/doc/emacs/emacs.texi
index 450c5e3a684..e480f45ec4e 100644
--- a/doc/emacs/emacs.texi
+++ b/doc/emacs/emacs.texi
@@ -886,16 +886,17 @@ Sending Mail
886* Mail Format:: Format of the mail being composed. 886* Mail Format:: Format of the mail being composed.
887* Mail Headers:: Details of some standard mail header fields. 887* Mail Headers:: Details of some standard mail header fields.
888* Mail Aliases:: Abbreviating and grouping mail addresses. 888* Mail Aliases:: Abbreviating and grouping mail addresses.
889* Mail Mode:: Special commands for editing mail being composed. 889* Mail Commands:: Special commands for editing mail being composed.
890* Mail Signature:: Adding a signature to every message.
890* Mail Amusements:: Distracting the NSA; adding fortune messages. 891* Mail Amusements:: Distracting the NSA; adding fortune messages.
891* Mail Methods:: Using alternative mail-composition methods. 892* Mail Methods:: Using alternative mail-composition methods.
892 893
893Mail Mode 894Mail Commands
894 895
895* Mail Sending:: Commands to send the message. 896* Mail Sending:: Commands to send the message.
896* Header Editing:: Commands to move to header fields and edit them. 897* Header Editing:: Commands to move to header fields and edit them.
897* Citing Mail:: Copying all or part of a message you are replying to. 898* Citing Mail:: Quoting a message you are replying to.
898* Mail Mode Misc:: Spell checking, signatures, etc. 899* Mail Misc:: Attachments, spell checking, etc.
899 900
900Reading Mail with Rmail 901Reading Mail with Rmail
901 902
diff --git a/doc/emacs/major.texi b/doc/emacs/major.texi
index 19ab86f91dd..d67bc4a13dd 100644
--- a/doc/emacs/major.texi
+++ b/doc/emacs/major.texi
@@ -41,7 +41,7 @@ languages. These include Lisp mode (which has several variants), C
41mode, Fortran mode, and others. The remaining major modes are not 41mode, Fortran mode, and others. The remaining major modes are not
42intended for use on users' files; they are used in buffers created for 42intended for use on users' files; they are used in buffers created for
43specific purposes by Emacs, such as Dired mode for buffers made by 43specific purposes by Emacs, such as Dired mode for buffers made by
44Dired (@pxref{Dired}), Mail mode for buffers made by @kbd{C-x m} 44Dired (@pxref{Dired}), Message mode for buffers made by @kbd{C-x m}
45(@pxref{Sending Mail}), and Shell mode for buffers used for 45(@pxref{Sending Mail}), and Shell mode for buffers used for
46communicating with an inferior shell process (@pxref{Interactive 46communicating with an inferior shell process (@pxref{Interactive
47Shell}). 47Shell}).
diff --git a/doc/emacs/mule.texi b/doc/emacs/mule.texi
index 00aa9047aec..c00511b4dce 100644
--- a/doc/emacs/mule.texi
+++ b/doc/emacs/mule.texi
@@ -961,15 +961,16 @@ still use an unsuitable coding system if you type its name in response
961to the question.) 961to the question.)
962 962
963@vindex sendmail-coding-system 963@vindex sendmail-coding-system
964 When you send a message with Mail mode (@pxref{Sending Mail}), Emacs has 964 When you send a message with Message mode (@pxref{Sending Mail}),
965four different ways to determine the coding system to use for encoding 965Emacs has four different ways to determine the coding system to use
966the message text. It tries the buffer's own value of 966for encoding the message text. It tries the buffer's own value of
967@code{buffer-file-coding-system}, if that is non-@code{nil}. Otherwise, 967@code{buffer-file-coding-system}, if that is non-@code{nil}.
968it uses the value of @code{sendmail-coding-system}, if that is 968Otherwise, it uses the value of @code{sendmail-coding-system}, if that
969non-@code{nil}. The third way is to use the default coding system for 969is non-@code{nil}. The third way is to use the default coding system
970new files, which is controlled by your choice of language environment, 970for new files, which is controlled by your choice of language
971if that is non-@code{nil}. If all of these three values are @code{nil}, 971environment, if that is non-@code{nil}. If all of these three values
972Emacs encodes outgoing mail using the Latin-1 coding system. 972are @code{nil}, Emacs encodes outgoing mail using the Latin-1 coding
973system.
973 974
974@node Text Coding 975@node Text Coding
975@section Specifying a Coding System for File Text 976@section Specifying a Coding System for File Text
diff --git a/doc/emacs/rmail.texi b/doc/emacs/rmail.texi
index d5ea368dd3b..8a4ce492ee1 100644
--- a/doc/emacs/rmail.texi
+++ b/doc/emacs/rmail.texi
@@ -683,12 +683,12 @@ standard meaning.
683@node Rmail Reply 683@node Rmail Reply
684@section Sending Replies 684@section Sending Replies
685 685
686 Rmail has several commands that use Mail mode to send outgoing mail. 686 Rmail has several commands to send outgoing mail. @xref{Sending
687@xref{Sending Mail}, for information on using Mail mode, including 687Mail}, for information on using Message mode, including certain
688certain features meant to work with Rmail. What this section documents 688features meant to work with Rmail. What this section documents are
689are the special commands of Rmail for entering Mail mode. Note that the 689the special commands of Rmail for entering the mail buffer. Note that
690usual keys for sending mail---@kbd{C-x m}, @kbd{C-x 4 m}, and @kbd{C-x 5 690the usual keys for sending mail---@kbd{C-x m}, @kbd{C-x 4 m}, and
691m}---also work normally in Rmail mode. 691@kbd{C-x 5 m}---also work normally in Rmail mode.
692 692
693@table @kbd 693@table @kbd
694@item m 694@item m
@@ -735,12 +735,12 @@ the reply command with a numeric argument: @kbd{C-u r} or @kbd{1 r}.
735This means to reply only to the sender of the original message. 735This means to reply only to the sender of the original message.
736 736
737 Once the @samp{*mail*} buffer has been initialized, editing and 737 Once the @samp{*mail*} buffer has been initialized, editing and
738sending the mail goes as usual (@pxref{Sending Mail}). You can edit the 738sending the mail goes as usual (@pxref{Sending Mail}). You can edit
739presupplied header fields if they are not what you want. You can also 739the presupplied header fields if they are not what you want. You can
740use the commands of Mail mode (@pxref{Mail Mode}), including @kbd{C-c 740also use commands such as @kbd{C-c C-y}, which yanks in the message
741C-y} which yanks in the message that you are replying to. You can 741that you are replying to (@pxref{Mail Commands}). You can also switch
742also switch to the Rmail buffer, select a different message there, switch 742to the Rmail buffer, select a different message there, switch back,
743back, and yank the new current message. 743and yank the new current message.
744 744
745@kindex M-m @r{(Rmail)} 745@kindex M-m @r{(Rmail)}
746@findex rmail-retry-failure 746@findex rmail-retry-failure
diff --git a/doc/emacs/sending.texi b/doc/emacs/sending.texi
index 717c89936fc..3700e5c2e3b 100644
--- a/doc/emacs/sending.texi
+++ b/doc/emacs/sending.texi
@@ -6,120 +6,104 @@
6@chapter Sending Mail 6@chapter Sending Mail
7@cindex sending mail 7@cindex sending mail
8@cindex mail 8@cindex mail
9@cindex email
9@cindex message 10@cindex message
10 11
11 To send a message in Emacs, you start by typing a command (@kbd{C-x m}) 12@kindex C-x m
12to select and initialize the @samp{*mail*} buffer. Then you edit the text 13@findex compose-mail
13and headers of the message in this buffer, and type another command 14 To send an @dfn{e-mail} message in Emacs, type @kbd{C-x m}. This
14(@kbd{C-c C-s} or @kbd{C-c C-c}) to send the message. 15selects and initializes a buffer named @samp{*mail*}, where you can
16edit the text and headers of the message. Finally, type @kbd{C-c C-s}
17or @kbd{C-c C-c} to send the message.
15 18
16@table @kbd 19@table @kbd
17@item C-x m 20@item C-x m
18Begin composing a message to send (@code{compose-mail}). 21Begin composing mail (@code{compose-mail}).
19@item C-x 4 m 22@item C-x 4 m
20Likewise, but display the message in another window 23Likewise, in another window (@code{compose-mail-other-window}).
21(@code{compose-mail-other-window}).
22@item C-x 5 m 24@item C-x 5 m
23Likewise, but make a new frame (@code{compose-mail-other-frame}). 25Likewise, but in a new frame (@code{compose-mail-other-frame}).
24@item C-c C-s 26@item C-c C-s
25In Mail mode, send the message (@code{mail-send}). 27In the mail buffer, send the message (@code{message-send}).
26@item C-c C-c 28@item C-c C-c
27Send the message and bury the mail buffer (@code{mail-send-and-exit}). 29In the mail buffer, send the message and bury the buffer
30(@code{message-send-and-exit}).
28@end table 31@end table
29 32
30@kindex C-x m
31@findex compose-mail
32@kindex C-x 4 m 33@kindex C-x 4 m
33@findex compose-mail-other-window 34@findex compose-mail-other-window
34@kindex C-x 5 m 35@kindex C-x 5 m
35@findex compose-mail-other-frame 36@findex compose-mail-other-frame
36 The command @kbd{C-x m} (@code{compose-mail}) selects a buffer named 37@noindent
37@samp{*mail*} and initializes it with the skeleton of an outgoing 38The command @kbd{C-x 4 m} (@code{compose-mail-other-window}) does the
38message. @kbd{C-x 4 m} (@code{compose-mail-other-window}) selects the 39same as @kbd{C-x m}, except it displays the mail buffer in a different
39@samp{*mail*} buffer in a different window, leaving the previous current 40window. The command @kbd{C-x 5 m} (@code{compose-mail-other-frame})
40buffer visible. @kbd{C-x 5 m} (@code{compose-mail-other-frame}) creates 41creates a new frame for the mail buffer.
41a new frame to select the @samp{*mail*} buffer. 42
42 43 Because the mail buffer is an ordinary Emacs buffer, you can switch
43 Because the mail-composition buffer is an ordinary Emacs buffer, you can 44to other buffers while in the middle of composing mail, and switch
44switch to other buffers while in the middle of composing mail, and switch 45back later (or never). If you type @kbd{C-x m} again when you have
45back later (or never). If you use the @kbd{C-x m} command again when you 46been composing another message but have not sent it, Emacs asks for
46have been composing another message but have not sent it, you are asked to 47confirmation before erasing the old message. If you answer @kbd{n},
47confirm before the old message is erased. If you answer @kbd{n}, the 48Emacs selects the mail buffer with its old contents, so you can finish
48@samp{*mail*} buffer remains selected with its old contents, so you can 49the old message and send it. @kbd{C-u C-x m} is another way to do
49finish the old message and send it. @kbd{C-u C-x m} is another way to do 50this. Sending the message marks the mail buffer ``unmodified,'' which
50this. Sending the message marks the @samp{*mail*} buffer ``unmodified,'' 51avoids the need for confirmation when @kbd{C-x m} is next used.
51which avoids the need for confirmation when @kbd{C-x m} is next used. 52
52 53 If you want to send another message before finishing the current
53 If you are composing a message in the @samp{*mail*} buffer and want to 54message, use the command @kbd{M-x rename-uniquely} to rename the
54send another message before finishing the first, rename the 55current mail buffer (@pxref{Misc Buffer}). Then you can use @kbd{C-x
55@samp{*mail*} buffer using @kbd{M-x rename-uniquely} (@pxref{Misc 56m} to make a new mail buffer, and work with each mail buffer
56Buffer}). Then you can use @kbd{C-x m} or its variants described above 57independently.
57to make a new @samp{*mail*} buffer. Once you've done that, you can work
58with each mail buffer independently.
59
60@vindex mail-default-directory
61 The variable @code{mail-default-directory} controls the default
62directory for mail buffers, and also says where to put their auto-save
63files.
64
65@c Not mentioned: mail-bury-selects-summary. Really an Rmail feature.
66
67@ignore
68@c Commented out because it is not user-oriented;
69@c it doesn't say how to do some job. -- rms.
70@cindex directory servers
71@cindex LDAP
72@cindex PH/QI
73@cindex names and addresses
74There is an interface to directory servers using various protocols such
75as LDAP or the CCSO white pages directory system (PH/QI), described in a
76separate manual. It may be useful for looking up names and addresses.
77@xref{Top,,EUDC, eudc, EUDC Manual}.
78@end ignore
79 58
80@menu 59@menu
81* Format: Mail Format. Format of the mail being composed. 60* Format: Mail Format. Format of a mail message.
82* Headers: Mail Headers. Details of some standard mail header fields. 61* Headers: Mail Headers. Details of some standard mail header fields.
83* Aliases: Mail Aliases. Abbreviating and grouping mail addresses. 62* Aliases: Mail Aliases. Abbreviating and grouping mail addresses.
84* Mode: Mail Mode. Special commands for editing mail being composed. 63* Commands: Mail Commands. Special commands for editing mail being composed.
85* Amuse: Mail Amusements. Distracting the NSA; adding fortune messages. 64* Signature: Mail Signature. Adding a signature to every message.
86* Methods: Mail Methods. Using alternative mail-composition methods. 65* Amuse: Mail Amusements. Distracting the NSA; adding fortune messages.
66* Methods: Mail Methods. Using alternative mail-composition methods.
87@end menu 67@end menu
88 68
89@node Mail Format 69@node Mail Format
90@section The Format of the Mail Buffer 70@section The Format of the Mail Buffer
91 71
92 In addition to the @dfn{text} or @dfn{body}, a message has @dfn{header 72 An email message must contain certain pieces of information, called
93fields} which say who sent it, when, to whom, why, and so on. Some 73@dfn{headers}, which specify the message's sender, recipient(s), and
94header fields, such as @samp{Date} and @samp{Message-Id}, are created 74so on.
95automatically when you send the message. Others, such as the recipient
96names, must be specified by you in order to send the message properly.
97 75
98 In the mail buffer, you can insert and edit header fields using 76 At the top of the mail buffer is a set of @dfn{header fields}, where
99ordinary editing commands. Mail mode provides commands to help you 77you can enter this information. You can insert and edit header fields
100edit some header fields, and some are automatically preinitialized in 78using ordinary editing commands. @xref{Header Editing}, for commands
101the buffer, when appropriate. 79specific to editing header fields.
80
81 Some header fields are automatically pre-initialized in the buffer,
82when appropriate; other headers, such as @samp{Date} and
83@samp{Message-Id}, are normally omitted from the mail buffer and
84created automatically when the message is sent.
102 85
103@vindex mail-header-separator 86@vindex mail-header-separator
104 The line in the buffer that says 87 The line in the buffer that says
105 88
106@example 89@smallexample
107--text follows this line-- 90--text follows this line--
108@end example 91@end smallexample
109 92
110@noindent 93@noindent
111is a special delimiter that separates the headers you have specified from 94separates the header fields from the @dfn{body} (or @dfn{text}) of the
112the text. Whatever follows this line is the text of the message; the 95message. Everything above this line is treated as part of the
113headers precede it. The delimiter line itself does not appear in the 96headers; everything below it is treated as the body. The delimiter
114message actually sent. The text used for the delimiter line is controlled 97line itself does not appear in the message actually sent. The text
115by the variable @code{mail-header-separator}. 98used for the delimiter line is controlled by the variable
99@code{mail-header-separator}.
116 100
117 Here is an example of what the headers and text in the mail buffer 101 Here is an example of what the headers and text in the mail buffer
118might look like. 102might look like.
119 103
120@example 104@example
121To: gnu@@gnu.org 105To: gnu@@example.org
122CC: lungfish@@spam.org, byob@@spam.org 106CC: lungfish@@example.com, byob@@example.net
123Subject: The Emacs Manual 107Subject: The Emacs Manual
124--text follows this line-- 108--text follows this line--
125Please ignore this message. 109Please ignore this message.
@@ -134,85 +118,51 @@ beginning of a line, terminated by a colon. Upper and lower case are
134equivalent in field names (and in mailing addresses also). After the 118equivalent in field names (and in mailing addresses also). After the
135colon and optional whitespace comes the contents of the field. 119colon and optional whitespace comes the contents of the field.
136 120
137 You can use any name you like for a header field, but normally people 121 You can use any name you like for a header field, but normally
138use only standard field names with accepted meanings. Here is a table 122people use only standard field names with accepted meanings. Here is
139of fields commonly used in outgoing messages. Emacs preinitializes some 123a table of commonly-used fields. Emacs pre-initializes some of these,
140of these when you start to compose a mail, depending on various options 124depending on various options you can set. You can delete or alter any
141you can set. You can delete or alter any header field before you send 125header field before you send the message, if you wish.
142the message, if you wish.
143 126
144@table @samp 127@table @samp
128@item From
129@vindex user-mail-address
130The address of the sender (you). This should be a valid mailing
131address, as replies will normally go there. Emacs initializes this
132field using the variables @code{user-full-name} and
133@code{user-mail-address}; see below.
134
145@item To 135@item To
146This field contains the mailing addresses to which the message is 136The mailing address(es) to which the message is addressed. To list
147addressed. If you list more than one address, use commas, not spaces, 137more than one address, use commas (not spaces) to separate them.
148to separate them.
149 138
150@item Subject 139@item Subject
151The contents of the @samp{Subject} field should be a piece of text 140A piece of text saying what the message is about. Most mail-reading
152that says what the message is about. The reason @samp{Subject} fields 141programs can display a summary of messages, listing the subject of
153are useful is that most mail-reading programs can provide a summary of 142each message but not its text.
154messages, listing the subject of each message but not its text.
155 143
156@item CC 144@item CC
157This field contains additional mailing addresses to send the message to, 145Additional mailing address(es) to send the message to. This is like
158like @samp{To} except that these readers should not regard the message 146@samp{To}, except that these readers should not regard the message as
159as directed at them. 147directed at them.
160 148
161@item BCC 149@item BCC
162This field contains additional mailing addresses to send the message to, 150Additional mailing address(es) to send the message to, which should
163which should not appear in the header of the message actually sent. 151not appear in the header of the message actually sent. ``BCC'' stands
164Copies sent this way are called @dfn{blind carbon copies}. 152for @dfn{blind carbon copies}.
165
166@vindex mail-self-blind
167@cindex copy of every outgoing message
168To send a blind carbon copy of every outgoing message to yourself, set
169the variable @code{mail-self-blind} to @code{t}. To send a blind carbon
170copy of every message to some other @var{address}, set the variable
171@code{mail-default-headers} to @code{"Bcc: @var{address}\n"}.
172 153
173@item FCC 154@item FCC
174This field contains the name of one file and directs Emacs to append a 155The name of one file, to which a copy of the sent message should be
175copy of the message to that file when you send the message. Emacs 156appended. Emacs writes the message in mbox format, unless the file is
176writes the message in mbox format, unless the file is in Babyl format 157in Babyl format (used by Rmail before Emacs 23), in which case Emacs
177(used by Rmail before Emacs 23), in which case Emacs writes Babyl. If 158writes Babyl. If an Rmail buffer is visiting the file, Emacs updates
178an Rmail buffer is visiting the file, Emacs updates it accordingly. 159it accordingly. To specify more than one file, use several @samp{FCC}
179To specify more than one file, use several @samp{FCC} fields, with one 160fields, with one file name in each field.
180file name in each field.
181
182@vindex mail-archive-file-name
183To put a fixed file name in the @samp{FCC} field each time you start
184editing an outgoing message, set the variable
185@code{mail-archive-file-name} to that file name. Unless you remove the
186@samp{FCC} field before sending, the message will be written into that
187file when it is sent.
188
189@item From
190Use the @samp{From} field to say who you are. You might need to change
191this if the account you are using to send the mail is not your own. The
192contents of the @samp{From} field should be a valid mailing address,
193since replies will normally go there.
194
195@vindex mail-setup-with-from
196Emacs initializes this field (unless the variable
197@code{mail-setup-with-from} is @code{nil}) using
198@code{user-mail-address} as the default. If there is no @samp{From}
199field when you send a mail, Emacs adds one.
200 161
201@item Reply-to 162@item Reply-to
202Use this field to direct replies to a different address. Most 163An address to which replies should be sent, instead of @samp{From}.
203mail-reading programs (including Rmail) automatically send replies to 164You can use this header if, for some reason, your @samp{From} address
204the @samp{Reply-to} address in preference to the @samp{From} address. 165is unable to receive replies.
205By adding a @samp{Reply-to} field to your header, you can work around
206any problems your @samp{From} address may cause for replies.
207
208@cindex @env{REPLYTO} environment variable
209@vindex mail-default-reply-to
210To put a fixed @samp{Reply-to} address into every outgoing message, set
211the variable @code{mail-default-reply-to} to that address (as a string).
212Then Emacs initializes the message with a @samp{Reply-to} field as
213specified. When you first compose a mail, if
214@code{mail-default-reply-to} is @code{nil}, Emacs initializes it from the
215environment variable @env{REPLYTO}.
216 166
217@item Mail-reply-to 167@item Mail-reply-to
218 This field takes precedence over @samp{Reply-to}. It is used because 168 This field takes precedence over @samp{Reply-to}. It is used because
@@ -225,70 +175,88 @@ you reply to a message from a mailing list that you are subscribed to.
225It usually indicates that you want replies to go to the list, and that 175It usually indicates that you want replies to go to the list, and that
226you do not need an extra copy sent directly to you. 176you do not need an extra copy sent directly to you.
227 177
228@vindex mail-mailing-lists 178@c Message mode handles this differently...
229 The variable @code{mail-mailing-lists} holds a list of mailing list 179@c @vindex mail-mailing-lists
230addresses that you are subscribed to. If it is non-@code{nil}, Emacs 180@c The variable @code{mail-mailing-lists} holds a list of mailing list
231inserts an appropriate @samp{Mail-followup-to} header when sending mail 181@c addresses that you are subscribed to. If it is non-@code{nil}, Emacs
232to a mailing list. 182@c inserts an appropriate @samp{Mail-followup-to} header when sending mail
233 183@c to a mailing list.
234@c There is also "Sent-via", added by C-c C-v, but it does not seem
235@c particularly useful (?).
236 184
237@item In-reply-to 185@item In-reply-to
238This field contains a piece of text describing the message you are 186A piece of text describing the message you are replying to. Some mail
239replying to. Some mail systems can use this information to correlate 187systems can use this information to correlate related pieces of mail.
240related pieces of mail. Normally this field is filled in by Rmail 188Normally, you never need to think about this, because it is filled in
241when you reply to a message in Rmail, and you never need to 189automatically when you reply to a message in Rmail (or any other mail
242think about it (@pxref{Rmail}). 190program built into Emacs).
243 191
244@item References 192@item References
245This field lists the Message-Ids of related previous messages (a 193The Message-Ids of previous related messages (a Message-Id is a unique
246Message-Id is a unique identifier generated when a message is sent). 194identifier generated when a message is sent). Like
247Rmail sets up this field automatically when you reply to a message. 195@samp{In-reply-to}, this is normally set up automatically for you.
248@end table 196@end table
249 197
250 The @samp{To}, @samp{CC}, and @samp{BCC} header fields can appear 198@noindent
251any number of times, and each such header field can contain multiple 199The @samp{To}, @samp{CC}, and @samp{BCC} fields can appear any number
252addresses, separated by commas. This way, you can specify any number 200of times, and each such header field can contain multiple addresses,
253of places to send the message. These fields can also have 201separated by commas. This way, you can specify any number of places
254continuation lines: one or more lines starting with whitespace, 202to send the message. These fields can also have continuation lines:
255following the starting line of the field, are considered part of the 203one or more lines starting with whitespace, following the starting
256field. Here's an example of a @samp{To} field with a continuation 204line of the field, are considered part of the field. Here's an
257line: 205example of a @samp{To} field with a continuation line:
258 206
259@example 207@example
260@group 208@group
261To: foo@@here.net, this@@there.net, 209To: foo@@example.net, this@@example.net,
262 me@@gnu.cambridge.mass.usa.earth.spiral3281 210 bob@@example.com
263@end group 211@end group
264@end example 212@end example
265 213
214@vindex user-full-name
215@vindex user-mail-address
216 The default contents of the @samp{From} header field are computed
217from the variables @code{user-full-name} and @code{user-mail-address}.
218On some operating systems, Emacs initializes these two variables using
219environment variables (@pxref{General Variables}). If this
220information is unavailable or wrong, you can customize the variables
221yourself (@pxref{Easy Customization}).
222
266@vindex mail-from-style 223@vindex mail-from-style
267 When you send the message, if you didn't write a @samp{From} field 224 The value of the variable @code{mail-from-style} specifies how to
268yourself, Emacs puts in one for you, using @code{user-mail-address}. 225format the address in the @samp{From} field:
269The variable @code{mail-from-style} controls the format: 226
270 227@table @asis
271@table @code 228@item @code{nil}
272@item nil 229Use just the address, as in @samp{king@@grassland.com}.
273Use just the email address, as in @samp{king@@grassland.com}. 230@item @code{parens}
274@item parens 231Use both address and full name, as in:@*
275Use both email address and full name, as in:@*
276@samp{king@@grassland.com (Elvis Parsley)}. 232@samp{king@@grassland.com (Elvis Parsley)}.
277@item angles 233@item @code{angles}
278Use both email address and full name, as in:@* 234Use both address and full name, as in:@*
279@samp{Elvis Parsley <king@@grassland.com>}. 235@samp{Elvis Parsley <king@@grassland.com>}.
280@item system-default 236@item any other value
281Allow the system to insert the @samp{From} field. 237Use @code{angles} for most addresses. However, if the address must be
238``quoted'' to remain syntactically-valid under the @code{angles}
239format but not under the @code{parens} format, use @code{parens}
240instead. This is the default.
282@end table 241@end table
283 242
284@c There is also mail-specify-envelope-from and mail-envelope-from, but 243@c There is also mail-specify-envelope-from and mail-envelope-from, but
285@c these are probably not topics for the Emacs manual. 244@c these are probably not topics for the Emacs manual.
286 245
287@vindex mail-default-headers 246@vindex mail-default-headers
288 You can direct Emacs to insert certain default headers into the 247 You can direct Emacs to insert certain default headers into the mail
289outgoing message by setting the variable @code{mail-default-headers} 248buffer by setting the variable @code{mail-default-headers} to a
290to a string. Then @code{C-x m} inserts this string into the message 249string. Then @kbd{C-x m} inserts this string into the message
291headers. If the default header fields are not appropriate for a 250headers. For example, here is how to add a @samp{Reply-to} and
251@samp{FCC} header to each message:
252
253@smallexample
254(setq mail-default-headers
255 "Reply-to: foo@@example.com\nFCC: ~/Mail/sent")
256@end smallexample
257
258@noindent
259If the default header fields are not appropriate for a
292particular message, edit them as necessary before sending the message. 260particular message, edit them as necessary before sending the message.
293 261
294@node Mail Aliases 262@node Mail Aliases
@@ -296,29 +264,26 @@ particular message, edit them as necessary before sending the message.
296@cindex mail aliases 264@cindex mail aliases
297@cindex @file{.mailrc} file 265@cindex @file{.mailrc} file
298@cindex mailrc file 266@cindex mailrc file
267@vindex mail-personal-alias-file
299 268
300 You can define @dfn{mail aliases} in a file named @file{~/.mailrc}. 269 You can define @dfn{mail aliases}, which are short mnemonic names
301These are short mnemonic names which stand for mail addresses or groups of 270that stand for mail addresses or groups of mail addresses. By
302mail addresses. Like many other mail programs, Emacs expands aliases 271default, mail aliases are defined in the file @file{~/.mailrc}. You
303when they occur in the @samp{To}, @samp{From}, @samp{CC}, @samp{BCC}, and 272can specify a different file name to use, by setting the variable
304@samp{Reply-to} fields, plus their @samp{Resent-} variants. 273@code{mail-personal-alias-file}.
305@c The list is defined by mail-address-field-regexp.
306 274
307 To define an alias in @file{~/.mailrc}, write a line in the following 275 To define an alias in @file{.mailrc}, write a line in the following
308format: 276format:
309 277
310@example 278@example
311alias @var{shortaddress} @var{fulladdresses} 279alias @var{nick} @var{fulladdresses}
312@end example 280@end example
313 281
314@noindent 282@noindent
315Here @var{fulladdresses} stands for one or more mail addresses for 283This means that @var{nick} should expand into @var{fulladdresses},
316@var{shortaddress} to expand into. Separate multiple addresses with 284where @var{fulladdresses} can be either a single address, or multiple
317spaces; if an address contains a space, quote the whole address with a 285addresses separated with spaces. For instance, to make @code{maingnu}
318pair of double quotes. 286stand for @code{gnu@@gnu.org} plus a local address of your own, put in
319
320For instance, to make @code{maingnu} stand for
321@code{gnu@@gnu.org} plus a local address of your own, put in
322this line:@refill 287this line:@refill
323 288
324@example 289@example
@@ -326,329 +291,232 @@ alias maingnu gnu@@gnu.org local-gnu
326@end example 291@end example
327 292
328@noindent 293@noindent
329Addresses specified in this way should use double quotes around an 294If an address contains a space, quote the whole address with a pair of
330entire address when the address contains spaces. But you need not 295double quotes, like this:
331include double quotes around parts of the address, such as the person's
332full name. Emacs puts them in if they are needed. For example,
333 296
334@example 297@example
335alias jsmith "John Q. Smith <none@@example.com>" 298alias jsmith "John Q. Smith <none@@example.com>"
336@end example 299@end example
337 300
338@noindent 301@noindent
339is correct in @samp{.mailrc}. Emacs will insert the address as 302Note that you need not include double quotes around individual parts
303of the address, such as the person's full name. Emacs puts them in if
304they are needed. For instance, it inserts the above address as
340@samp{"John Q. Smith" <none@@example.com>}. 305@samp{"John Q. Smith" <none@@example.com>}.
341 306
342 Emacs also recognizes ``include'' commands in @samp{.mailrc} files. 307 Emacs also recognizes ``include'' commands in @file{.mailrc}. They
343They look like this: 308look like this:
344 309
345@example 310@example
346source @var{filename} 311source @var{filename}
347@end example 312@end example
348 313
349@noindent 314@noindent
350The file @file{~/.mailrc} is used primarily by other mail-reading 315The @file{.mailrc} file is not unique to Emacs; many other
351programs; it can contain various other commands. Emacs ignores 316mail-reading programs use it for mail aliases, and it can contain
352everything in it except for alias definitions and include commands. 317various other commands. However, Emacs ignores everything except
353 318alias definitions and include commands.
354@findex define-mail-alias
355 Another way to define a mail alias, within Emacs alone, is with the
356@code{define-mail-alias} command. It prompts for the alias and then the
357full address. You can use it to define aliases in your @file{.emacs}
358file, like this:
359
360@example
361(define-mail-alias "maingnu" "gnu@@gnu.org")
362@end example
363
364@vindex mail-aliases
365 @code{define-mail-alias} records aliases by adding them to a
366variable named @code{mail-aliases}. If you are comfortable with
367manipulating Lisp lists, you can set @code{mail-aliases} directly. The
368initial value of @code{mail-aliases} is @code{t}, which means that
369Emacs should read @file{.mailrc} to get the proper value.
370
371@vindex mail-personal-alias-file
372 You can specify a different file name to use instead of
373@file{~/.mailrc} by setting the variable
374@code{mail-personal-alias-file}.
375
376@c There is also mail-alias-file for the system aliases.
377 319
378@findex expand-mail-aliases
379 Normally, Emacs expands aliases when you send the message. You do not
380need to expand mail aliases before sending the message, but you can
381expand them if you want to see where the mail will actually go. To do
382this, use the command @kbd{M-x expand-mail-aliases}; it expands all mail
383aliases currently present in the mail headers that hold addresses.
384
385 If you like, you can have mail aliases expand as abbrevs, as soon as
386you type them in (@pxref{Abbrevs}). To enable this feature, execute the
387following:
388
389@example
390(add-hook 'mail-mode-hook 'mail-abbrevs-setup)
391@end example
392
393@noindent
394@findex define-mail-abbrev
395@vindex mail-abbrevs
396This can go in your @file{.emacs} file. @xref{Hooks}. If you use this
397feature, you must use @code{define-mail-abbrev} instead of
398@code{define-mail-alias}; the latter does not work with this package.
399Note that the mail abbreviation package uses the variable
400@code{mail-abbrevs} instead of @code{mail-aliases}, and that all alias
401names are converted to lower case.
402
403@kindex C-c C-a @r{(Mail mode)}
404@findex mail-abbrev-insert-alias 320@findex mail-abbrev-insert-alias
405 The mail abbreviation package also provides the @kbd{C-c C-a} 321 Mail aliases expand as abbrevs---that is to say, as soon as you type
406(@code{mail-abbrev-insert-alias}) command, which reads an alias 322a word-separator character after an alias (@pxref{Abbrevs}). This
407name (with completion) and inserts its definition at point. This is 323expansion takes place only within the @samp{To}, @samp{From},
408useful when editing the message text itself or a header field such as 324@samp{CC}, @samp{BCC}, and @samp{Reply-to} header fields (plus their
409@samp{Subject} in which Emacs does not normally expand aliases. 325@samp{Resent-} variants); it does not take place in other header
410 326fields, such as @samp{Subject}.
411 Note that abbrevs expand only if you insert a word-separator character 327
412afterward. However, you can rebind @kbd{C-n} and @kbd{M->} to cause 328 You can also insert an aliased address directly, using the command
413expansion as well. Here's how to do that: 329@kbd{M-x mail-abbrev-insert-alias}. This reads an alias name, with
414 330completion, and inserts its definition at point.
415@smallexample 331
416(add-hook 'mail-mode-hook 332@node Mail Commands
417 (lambda () 333@section Mail Commands
418 (define-key 334@cindex Message mode
419 mail-mode-map [remap next-line] 'mail-abbrev-next-line) 335@cindex mode, Message
420 (define-key 336
421 mail-mode-map [remap end-of-buffer] 'mail-abbrev-end-of-buffer))) 337 The default major mode for the @samp{*mail*} buffer is called
422@end smallexample 338Message mode. It behaves like Text mode in many ways, but provides
423 339several additional commands on the @kbd{C-c} prefix, which make
424@node Mail Mode 340editing a message more convenient.
425@section Mail Mode 341
426@cindex Mail mode 342 In this section, we will describe some of the most commonly-used
427@cindex mode, Mail 343commands available in Message mode.
428 344@ifnottex
429 The major mode used in the mail buffer is Mail mode, which is much 345Message mode also has its own manual, where its features are described
430like Text mode except that various special commands are provided on the 346in greater detail. @xref{Top,,Message, message, Message}.
431@kbd{C-c} prefix. These commands all have to do specifically with 347@end ifnottex
432editing or sending the message.
433
434 Mail mode is normally used in buffers set up automatically by the
435@code{mail} command and related commands. However, you can also switch
436to Mail mode in a file-visiting buffer. This is a useful thing to do if
437you have saved the text of a draft message in a file.
438 348
439@menu 349@menu
440* Mail Sending:: Commands to send the message. 350* Mail Sending:: Commands to send the message.
441* Header Editing:: Commands to move to header fields and edit them. 351* Header Editing:: Commands to move to header fields and edit them.
442* Citing Mail:: Copying all or part of a message you are replying to. 352* Citing Mail:: Quoting a message you are replying to.
443* Mail Mode Misc:: Spell checking, signatures, etc. 353* Mail Misc:: Attachments, spell checking, etc.
444@end menu 354@end menu
445 355
446@node Mail Sending 356@node Mail Sending
447@subsection Mail Sending 357@subsection Mail Sending
448 358
449 Mail mode has two commands for sending the message you have been 359 There are two commands to send a message you have been editing:
450editing:
451 360
452@table @kbd 361@table @kbd
453@item C-c C-s
454Send the message, and leave the mail buffer selected (@code{mail-send}).
455@item C-c C-c 362@item C-c C-c
456Send the message, and select some other buffer (@code{mail-send-and-exit}). 363Send the message, and deselect the mail buffer (@code{message-send-and-exit}).
364@item C-c C-s
365Send the message, and leave the mail buffer selected (@code{message-send}).
457@end table 366@end table
458 367
459@kindex C-c C-s @r{(Mail mode)} 368@kindex C-c C-s @r{(Message mode)}
460@kindex C-c C-c @r{(Mail mode)} 369@kindex C-c C-c @r{(Message mode)}
461@findex mail-send 370@findex message-send
462@findex mail-send-and-exit 371 If you want to send a message and be done with it, type @kbd{C-c
463@vindex mail-send-hook 372C-c} (@code{mail-send-and-exit}). This sends the message and then
464 @kbd{C-c C-s} (@code{mail-send}) sends the message and marks the mail 373either deletes the window or switches to another buffer. It also
465buffer unmodified, but leaves that buffer selected so that you can 374``buries'' the mail buffer, putting it at the lowest priority for
466modify the message (perhaps with new recipients) and send it again. 375reselection. This is the usual command for sending a message.
467@kbd{C-c C-c} (@code{mail-send-and-exit}) sends and then deletes the 376
468window or switches to another buffer. It puts the mail buffer at the 377@findex message-send-and-exit
469lowest priority for reselection by default, since you are finished with 378 The command @kbd{C-c C-s} (@code{message-send}) sends the message
470using it. This is the usual way to send the message. Sending a message 379and marks the mail buffer unmodified, but leaves the buffer selected.
471runs the hook @code{mail-send-hook}. 380Use this command if you want to modify the message (perhaps with new
472 381recipients) and send it again.
473@c Options not mentioned: mail-interactive, mail-use-dsn. 382
383@vindex message-send-hook
384 Sending a message runs the hook @code{message-send-hook}.
474 385
475 In a file-visiting buffer, sending the message does not clear the 386 In a file-visiting buffer, sending the message does not clear the
476modified flag, because only saving the file should do that. Also, you 387modified flag, because only saving the file should do that. Also, you
477don't get a warning if you try to send the same message twice. 388don't get a warning if you try to send the same message twice.
478 389
479@c This is indexed in mule.texi, node "Recognize Coding". 390@vindex sendmail-coding-system
480@c @vindex sendmail-coding-system 391 When you send a message containing non-@acronym{ASCII} characters,
481 When you send a message that contains non-@acronym{ASCII} characters, they need 392they need to be encoded with a coding system (@pxref{Coding Systems}).
482to be encoded with a coding system (@pxref{Coding Systems}). Usually 393Usually the coding system is specified automatically by your chosen
483the coding system is specified automatically by your chosen language 394language environment (@pxref{Language Environments}). You can
484environment (@pxref{Language Environments}). You can explicitly specify 395explicitly specify the coding system for outgoing mail by setting the
485the coding system for outgoing mail by setting the variable 396variable @code{sendmail-coding-system} (@pxref{Recognize Coding}). If
486@code{sendmail-coding-system} (@pxref{Recognize Coding}). 397the coding system thus determined does not handle the characters in a
487 398particular message, Emacs asks you to select the coding system to use,
488 If the coding system thus determined does not handle the characters in
489a particular message, Emacs asks you to select the coding system to use,
490showing a list of possible coding systems. 399showing a list of possible coding systems.
491 400
492@c Not mentioned: mail-send-nonascii.
493
494@cindex SMTP 401@cindex SMTP
495@cindex Feedmail 402@cindex Feedmail
496@cindex Sendmail 403@cindex Sendmail
497@cindex Mailclient 404@cindex Mailclient
498@vindex send-mail-function 405@vindex send-mail-function
499 The variable @code{send-mail-function} controls how the default mail 406 The variable @code{send-mail-function} controls how the default mail
500user agent sends mail. It should be set to a function. In most cases, 407user agent sends mail. It should be set to a function. In most
501the default is @code{sendmail-send-it}, which delivers mail using the 408cases, the default is @code{sendmail-send-it}, which delivers mail
502Sendmail installation on the local host. On Mac OS X and MS-Windows, 409using @command{sendmail} (or a @command{sendmail}-compatible program).
503however, the default is normally @code{mailclient-send-it}, which 410On Mac OS X and MS-Windows, however, the default is normally
504passes the mail buffer on to the system's designated mail client (see 411@code{mailclient-send-it}, which passes the mail buffer on to the
505@file{mailclient.el}). To send mail through an SMTP server, set 412system's designated mail client (see @file{mailclient.el}). To send
506@code{send-mail-function} to @code{smtpmail-send-it} and set up the 413mail through an SMTP server, set @code{send-mail-function} to
507Emacs SMTP library (@pxref{Top,,Emacs SMTP Library, smtpmail, Sending 414@code{smtpmail-send-it} and set up the Emacs SMTP library
508mail via SMTP}). Another option is @code{feedmail-send-it} (see the 415(@pxref{Top,,Emacs SMTP Library, smtpmail, Sending mail via SMTP}).
509commentary section of the @file{feedmail.el} package). 416Another option is @code{feedmail-send-it} (see the commentary section
417of the @file{feedmail.el} package).
510 418
511@node Header Editing 419@node Header Editing
512@subsection Mail Header Editing 420@subsection Mail Header Editing
513 421
514 Mail mode provides special commands to move to particular header 422 Message mode provides the following special commands to move to
515fields and to complete addresses in headers. 423particular header fields and to complete addresses in headers.
516 424
517@table @kbd 425@table @kbd
518@item C-c C-f C-t 426@item C-c C-f C-t
519Move to the @samp{To} header field, creating one if there is none 427Move to the @samp{To} header (@code{message-goto-to}).
520(@code{mail-to}).
521@item C-c C-f C-s 428@item C-c C-f C-s
522Move to the @samp{Subject} header field, creating one if there is 429Move to the @samp{Subject} header (@code{message-goto-subject}).
523none (@code{mail-subject}).
524@item C-c C-f C-c 430@item C-c C-f C-c
525Move to the @samp{CC} header field, creating one if there is none 431Move to the @samp{CC} header (@code{message-goto-cc}).
526(@code{mail-cc}).
527@item C-c C-f C-b 432@item C-c C-f C-b
528Move to the @samp{BCC} header field, creating one if there is none 433Move to the @samp{BCC} header (@code{message-goto-bcc}).
529(@code{mail-bcc}).
530@item C-c C-f C-r 434@item C-c C-f C-r
531Move to the @samp{Reply-To} header field, creating one if there is none 435Move to the @samp{Reply-To} header (@code{message-goto-reply-to}).
532(@code{mail-reply-to}).
533@item C-c C-f C-a
534Move to the @samp{Mail-Reply-To} header field, creating one if there is none
535(@code{mail-mail-reply-to}).
536@item C-c C-f C-l
537Move to the @samp{Mail-Followup-To} header field, creating one if there is none
538(@code{mail-mail-followup-to}).
539@item C-c C-f C-f 436@item C-c C-f C-f
437Move to the @samp{Mail-Followup-To} header field
438(@code{message-goto-followup-to}).
439@item C-c C-f C-w
540Add a new @samp{FCC} header field, with file-name completion 440Add a new @samp{FCC} header field, with file-name completion
541(@code{mail-fcc}). 441(@code{message-goto-fcc}).
542@c There is also C-c C-v, mail-sent-via, which adds one or more 442@item C-c C-b
543@c "Sent-via" headers, but I don't know what the point of that header is. 443Move to the start of the message body (@code{message-goto-body}).
544@item M-@key{TAB} 444@item @key{TAB}
545Complete a mailing address (@code{mail-complete}). 445Complete a mailing address (@code{message-tab}).
546@end table 446@end table
547 447
548@kindex C-c C-f C-t @r{(Mail mode)} 448@kindex C-c C-f C-t @r{(Message mode)}
549@findex mail-to 449@findex message-goto-to
550@kindex C-c C-f C-s @r{(Mail mode)} 450@kindex C-c C-f C-s @r{(Message mode)}
551@findex mail-subject 451@findex message-goto-subject
552@kindex C-c C-f C-c @r{(Mail mode)} 452@kindex C-c C-f C-c @r{(Message mode)}
553@findex mail-cc 453@findex message-goto-cc
554@kindex C-c C-f C-b @r{(Mail mode)} 454@kindex C-c C-f C-b @r{(Message mode)}
555@findex mail-bcc 455@findex message-goto-bcc
556@kindex C-c C-f C-r @r{(Mail mode)} 456@kindex C-c C-f C-r @r{(Message mode)}
557@findex mail-reply-to 457@findex goto-reply-to
558@kindex C-c C-f C-a @r{(Mail mode)} 458@kindex C-c C-f C-f @r{(Message mode)}
559@findex mail-mail-reply-to 459@findex goto-followup-to
560@kindex C-c C-f C-l @r{(Mail mode)} 460@kindex C-c C-f C-w @r{(Message mode)}
561@findex mail-mail-followup-to 461@findex message-goto-fcc
562@kindex C-c C-f C-f @r{(Mail mode)} 462 The commands to move point to particular header fields are all based
563@findex mail-fcc 463on the prefix @kbd{C-c C-f} (@samp{C-f} is for ``field''). If the
564 There are several commands to move point to particular header fields, 464field in question does not exist, the command creates one (the
565all based on the prefix @kbd{C-c C-f} (@samp{C-f} is for ``field''). 465exception is @code{mail-fcc}, which creates a new field each time).
566They are listed in the table above. If the field in question does not 466
567exist, these commands create one (the exception is @code{mail-fcc}, 467@kindex C-c C-b @r{(Message mode)}
568which creates a new field each time). We provide special motion 468@findex mail-text
569commands for these particular fields because they are the fields users 469 The command @kbd{C-c C-b} (@code{message-goto-body}) moves point to
570most often want to edit. 470just after the header separator line---that is, to the beginning of
571 471the body.
572@findex mail-complete 472
573@kindex M-TAB @r{(Mail mode)} 473@findex message-tab
574@c `mail-complete-alist' specifies the headers. 474@kindex TAB @r{(Message mode)}
575 While editing a header field that contains mailing addresses, such 475 While editing a header field that contains addresses, such as
576as @samp{To:}, @samp{CC:} and @samp{BCC:}, you can complete a mailing 476@samp{To:}, @samp{CC:} and @samp{BCC:}, you can complete an address by
577address by typing @kbd{M-@key{TAB}} (@code{mail-complete}). It 477typing @key{TAB} (@code{message-tab}). This attempts to insert the
578inserts the full name corresponding to the address, if it can 478full name corresponding to the address based on a couple of methods,
579determine the full name. The variable @code{mail-complete-style} 479including EUDC, a library that recognizes a number of directory server
580controls whether to insert the full name, and what style to use, as in 480protocols (@pxref{Top,,EUDC,eudc, The Emacs Unified Directory
581@code{mail-from-style} (@pxref{Mail Headers}). (If your window 481Client}). Failing that, it attempts to expand the address as a mail
582manager defines @kbd{M-@key{TAB}} to switch windows, you can type 482alias (@pxref{Mail Aliases}). If point is on a header field that does
583@kbd{@key{ESC} @key{TAB}} or @kbd{C-M-i}.) 483not take addresses, or if it is in the message body, then @key{TAB}
584 484just inserts a tab character.
585 For completion purposes, the valid mailing addresses are taken to be
586the local users' names plus your personal mail aliases (@pxref{Mail
587Aliases}). You can specify additional sources of valid addresses;
588browse the customization group @samp{mailalias} to see the variables for
589customizing this feature (@pxref{Customization Groups}).
590
591 If you type @kbd{M-@key{TAB}} in the body of the message, or on a
592unrecognized header, @code{mail-complete} invokes the function specified
593by @code{mail-complete-function}. By default, this is
594@code{ispell-complete-word}, as in Text mode.
595 485
596@node Citing Mail 486@node Citing Mail
597@subsection Citing Mail 487@subsection Citing Mail
598@cindex citing mail 488@cindex citing mail
599 489
600 Mail mode also has commands for yanking or @dfn{citing} all or part of
601a message that you are replying to. These commands are active only when
602you started sending a message using an Rmail command.
603
604@table @kbd 490@table @kbd
605@item C-c C-y 491@item C-c C-y
606Yank the selected message from Rmail (@code{mail-yank-original}). 492Yank the selected message from Rmail (@code{message-yank-original}).
607@item C-c C-r
608Yank the region from the Rmail buffer (@code{mail-yank-region}).
609@item C-c C-q 493@item C-c C-q
610Fill each paragraph cited from another message 494Fill each paragraph cited from another message
611(@code{mail-fill-yanked-message}). 495(@code{message-fill-yanked-message}).
612@c There is also mail-split-line, but it does not seem very useful.
613@end table 496@end table
614 497
615@kindex C-c C-y @r{(Mail mode)} 498@kindex C-c C-y @r{(Message mode)}
616@findex mail-yank-original 499@findex message-yank-original
617 When mail sending is invoked from the Rmail mail reader using an Rmail 500@findex message-yank-prefix
618command, @kbd{C-c C-y} can be used inside the mail buffer to insert the 501 You can use the command @kbd{C-c C-y} (@code{message-yank-original})
619text of the message you are replying to. Normally it indents each line 502to @dfn{cite} a message that you are replying to. This inserts the
620of that message three spaces and eliminates most header fields (as 503text of that message into the mail buffer. This command is active
621specified by the variable @code{mail-yank-ignored-headers}). A numeric 504only when the mail buffer is invoked from a mail program running in
622argument specifies the number of spaces to indent (the variable 505Emacs, such as Rmail.
623@code{mail-indentation-spaces} specifies the default number). An 506
624argument of just @kbd{C-u} says not to indent at all and not to 507 By default, Emacs inserts the string @samp{>} in front of each line
625eliminate anything. @kbd{C-c C-y} always uses the current message from 508of the cited text; this prefix string is specified by the variable
626the Rmail buffer, so you can insert several old messages by selecting 509@code{message-yank-prefix}. If you call @code{message-yank-original}
627one in Rmail, switching to @samp{*mail*} and yanking it, then switching 510with a prefix argument, the citation prefix is not inserted.
628back to Rmail to select another. 511
629 512@kindex C-c C-q @r{(Message mode)}
630@vindex mail-yank-prefix
631 You can specify the text for @kbd{C-c C-y} to insert at the beginning
632of each line: set @code{mail-yank-prefix} to the desired string. (A
633value of @code{nil} means to use indentation; this is the default.)
634However, @kbd{C-u C-c C-y} never adds anything at the beginning of the
635inserted lines, regardless of the value of @code{mail-yank-prefix}.
636
637@kindex C-c C-r @r{(Mail mode)}
638@findex mail-yank-region
639 To yank just a part of an incoming message, set the region in Rmail to
640the part you want; then go to the @samp{*Mail*} message and type
641@kbd{C-c C-r} (@code{mail-yank-region}). Each line that is copied is
642indented or prefixed according to @code{mail-yank-prefix}.
643
644@kindex C-c C-q @r{(Mail mode)}
645@findex mail-fill-yanked-message 513@findex mail-fill-yanked-message
646 After using @kbd{C-c C-y} or @kbd{C-c C-r}, you can type @kbd{C-c C-q} 514 After using @kbd{C-c C-y}, you can type @kbd{C-c C-q}
647(@code{mail-fill-yanked-message}) to fill the paragraphs of the yanked 515(@code{message-fill-yanked-message}) to fill the paragraphs of the
648old message or messages. One use of @kbd{C-c C-q} fills all such 516cited message. One use of @kbd{C-c C-q} fills all such paragraphs,
649paragraphs, each one individually. To fill a single paragraph of the 517each one individually. To fill a single paragraph of the quoted
650quoted message, use @kbd{M-q}. If filling does not automatically 518message, use @kbd{M-q}. If filling does not automatically handle the
651handle the type of citation prefix you use, try setting the fill prefix 519type of citation prefix you use, try setting the fill prefix
652explicitly. @xref{Filling}. 520explicitly. @xref{Filling}.
653 521
654@vindex mail-citation-hook 522@vindex mail-citation-hook
@@ -657,91 +525,103 @@ explicitly. @xref{Filling}.
657package, which provides more flexible citation 525package, which provides more flexible citation
658(@pxref{Introduction,,,sc, Supercite}). 526(@pxref{Introduction,,,sc, Supercite}).
659 527
660@c No need to mention: mail-citation-prefix-regexp. 528@node Mail Misc
529@subsection Mail Miscellany
661 530
662@node Mail Mode Misc 531@kindex C-c C-a @r{(Message mode)}
663@subsection Mail Mode Miscellany 532@findex mail-attach-file
664 533@cindex MIME
665@table @kbd 534@cindex Multipurpose Internet Mail Extensions
666@item C-c C-t 535 You can @dfn{attach} a file to an outgoing message by typing
667Move to the beginning of the message body text (@code{mail-text}). 536@kbd{C-c C-a} (@code{mml-attach-file}) in the mail buffer. Attaching
668@item C-c C-w 537is done using the MIME (Multipurpose Internet Mail Extensions)
669Insert a signature at the end of the message text (@code{mail-signature}). 538standard.
670@item C-c C-i @var{file} @key{RET} 539
671Insert the contents of @var{file} at the end of the message text 540 The @code{mml-attach-file} command prompts for the name of the file,
672(@code{mail-attach-file}). 541and for the attachment's @dfn{content type}, @dfn{description}, and
673@item M-x ispell-message 542@dfn{disposition}. The content type is normally detected
674Perform spelling correction on the message text, but not on citations from 543automatically; just type @key{RET} to accept the default. The
675other messages, or the message headers. 544description is a single line of text that the recipient will see next
676@end table 545to the attachment; you may also choose to leave this empty. The
546disposition is either @samp{inline} (the default), which means the
547recipient will see a link to the attachment within the message body,
548or @samp{attachment}, which means the link will be separate from the
549body.
550
551 The actual contents of the attached file are not inserted into the
552mail buffer. Instead, some placeholder text is inserted into the mail
553buffer, like this:
677 554
678@kindex C-c C-t @r{(Mail mode)} 555@smallexample
679@findex mail-text 556<#part type="text/plain" filename="~/foo.txt" disposition=inline>
680 @kbd{C-c C-t} (@code{mail-text}) moves point to just after the header 557<#/part>
681separator line---that is, to the beginning of the message body text. 558@end smallexample
682 559
683@kindex C-c C-w @r{(Mail mode)} 560@noindent
684@findex mail-signature 561When you type @kbd{C-c C-c} or @kbd{C-c C-s} to send the message, the
685@vindex mail-signature 562attached file will be delivered with it.
686 @kbd{C-c C-w} (@code{mail-signature}) adds a standard piece of text
687(your @dfn{mail signature}) at the end of the message to say more about who
688you are. For example, it may contain telephone numbers, or your
689physical location. The text comes from the variable
690@code{mail-signature}. It can be a fixed string, or a Lisp expression
691that returns a string. If it is @code{t} or @code{nil}, the function
692inserts the contents of the file @code{mail-signature-file}. By
693default, this is the file @file{~/.signature} in your home directory.
694
695 If the variable @code{mail-signature} has a non-@code{nil} value,
696starting a mail automatically inserts your signature. Otherwise, you
697must explicitly use the command @code{mail-signature}. If you want to
698omit your signature from a particular message, just delete it from the
699buffer before you send the message.
700
701 Convention says that the start of your signature should be marked by a
702line whose contents are @samp{-- }. If your signature comes from a
703file, this prefix is added for you, but in all other cases you must add
704it yourself. The remainder of your signature should be no more than
705four lines.
706 563
707@findex ispell-message 564@findex ispell-message
708 You can do spelling correction on the message text you have written 565 While composing a message, you can do spelling correction on the
709with the command @kbd{M-x ispell-message}. If you have yanked an 566message text by typing @kbd{M-x ispell-message}. If you have yanked
710incoming message into the outgoing draft, this command skips what was 567an incoming message into the outgoing draft, this command skips what
711yanked, but it checks the text that you yourself inserted. (It looks 568was yanked, but it checks the text that you yourself inserted (it
712for indentation or @code{mail-yank-prefix} to distinguish the cited 569looks for indentation or @code{mail-yank-prefix} to distinguish the
713lines from your input.) @xref{Spelling}. 570cited lines from your input). @xref{Spelling}.
714
715@kindex C-c C-i @r{(Mail mode)}
716@findex mail-attach-file
717 To include a file in the outgoing message, you can use @kbd{C-x i},
718the usual command to insert a file in the current buffer. But it is
719often more convenient to use a special command, @kbd{C-c C-i}
720(@code{mail-attach-file}). This command inserts the file contents at
721the end of the buffer, after your signature (if any), with a delimiter
722line that includes the file name. Note that this is not a MIME
723attachment.
724 571
725@vindex mail-mode-hook 572@vindex mail-mode-hook
726@vindex mail-setup-hook 573@vindex mail-setup-hook
727 Turning on Mail mode (which @kbd{C-x m} does automatically) runs the 574 Turning on Message mode (which @kbd{C-x m} does automatically) runs
728normal hooks @code{text-mode-hook} and @code{mail-mode-hook}. 575the normal hooks @code{text-mode-hook} and @code{message-mode-hook}.
729Initializing a new outgoing message runs the normal hook 576Initializing a new outgoing message runs the normal hook
730@code{mail-setup-hook}; if you want to add special fields to your mail 577@code{message-setup-hook}; you can use this hook if you want to make
731header or make other changes to the appearance of the mail buffer, use 578changes to the appearance of the mail buffer. @xref{Hooks}.
732that hook. @xref{Hooks}.
733 579
734 The main difference between these hooks is just when they are 580 The main difference between these hooks is just when they are
735invoked. Whenever you type @kbd{M-x mail}, @code{mail-mode-hook} runs 581invoked. Whenever you type @kbd{C-x m}, @code{message-mode-hook} runs
736as soon as the @samp{*mail*} buffer is created. Then the 582as soon as the mail buffer is created. Then the @code{message-setup}
737@code{mail-setup} function inserts the default contents of the buffer. 583function inserts the default contents of the buffer. After these
738After these default contents are inserted, @code{mail-setup-hook} runs. 584default contents are inserted, @code{message-setup-hook} runs.
739 585
740 If you use @kbd{M-x mail} to continue an existing composition, 586 If you use @kbd{C-x m} to continue an existing composition,
741@code{mail-mode-hook} runs immediately after switching to the 587@code{message-mode-hook} runs immediately after switching to the mail
742@samp{*mail*} buffer. If the buffer is unmodified, or if you decide to 588buffer. If the buffer is unmodified, or if you decide to erase it and
743erase it and start again, @code{mail-setup-hook} runs after the default 589start again, @code{message-setup-hook} runs after the default contents
744contents are inserted. 590are inserted.
591
592@node Mail Signature
593@section Mail Signature
594
595@cindex mail signature
596@vindex mail-signature-file
597@vindex mail-signature
598 You can add a standard piece of text---your @dfn{mail
599signature}---to the end of every message. This signature may contain
600information such as your telephone number or your physical location.
601The variable @code{mail-signature} determines how Emacs handles the
602mail signature.
603
604 The default value of @code{mail-signature} is @code{t}; this means
605to look for your mail signature in the file @file{~/.signature}. If
606this file exists, its contents are automatically inserted into the end
607of the mail buffer. You can change the signature file via the
608variable @code{mail-signature-file}.
609
610 If you change @code{mail-signature} to a string, that specifies the
611text of the signature directly.
612
613@kindex C-c C-w @r{(Message mode)}
614@findex message-insert-signature
615 If you change @code{mail-signature} to @code{nil}, Emacs will not
616insert your mail signature automatically. You can insert your mail
617signature by typing @kbd{C-c C-w} (@code{message-insert-signature}) in
618the mail buffer. Emacs will look for your signature in the signature
619file.
620
621 By convention, a mail signature should be marked by a line whose
622contents are @samp{-- }. If your signature lacks this prefix, it is
623added for you. The remainder of your signature should be no more than
624four lines.
745 625
746@node Mail Amusements 626@node Mail Amusements
747@section Mail Amusements 627@section Mail Amusements
@@ -778,28 +658,32 @@ using this.
778@node Mail Methods 658@node Mail Methods
779@section Mail-Composition Methods 659@section Mail-Composition Methods
780@cindex mail-composition methods 660@cindex mail-composition methods
661@cindex Mail mode
662@cindex mode, Mail
781 663
782@cindex MH mail interface 664@cindex MH mail interface
783@cindex Message mode for sending mail 665@cindex Message mode for sending mail
784 In this chapter we have described the usual Emacs mode for editing 666 In this chapter we have described the usual Emacs mode for editing
785and sending mail---Mail mode. Emacs has alternative facilities for 667and sending mail---Message mode. This is only one of several
786editing and sending mail, including 668available modes. Prior to Emacs 23.2, the default mode was Mail mode,
787MH-E and Message mode, not documented in this manual. 669which is similar to Message mode in many respects but lacks features
788@xref{Top,,MH-E,mh-e, The Emacs Interface to MH}. @xref{Top,,Message,message, 670such as MIME support. Another available mode is MH-E
789Message Manual}. You can choose any of them as your preferred method. 671(@pxref{Top,,MH-E,mh-e, The Emacs Interface to MH}).
790The commands @code{C-x m}, @code{C-x 4 m} and @code{C-x 5 m} use
791whichever agent you have specified, as do various other Emacs commands
792and facilities that send mail.
793 672
794@vindex mail-user-agent 673@vindex mail-user-agent
795 To specify your mail-composition method, customize the variable 674 You can choose any of these @dfn{mail user agents} as your preferred
796@code{mail-user-agent}. Currently legitimate values include 675method for editing and sending mail. The commands @code{C-x m},
797@code{sendmail-user-agent} (Mail mode), @code{mh-e-user-agent}, 676@code{C-x 4 m} and @code{C-x 5 m} use whichever agent you have
798@code{message-user-agent} and @code{gnus-user-agent}. 677specified; so do various other parts of Emacs that send mail, such as
678the bug reporter (@pxref{Bugs}). To specify a mail user agent,
679customize the variable @code{mail-user-agent}. Currently, legitimate
680values include @code{message-user-agent} (Message mode)
681@code{sendmail-user-agent} (Mail mode), @code{gnus-user-agent}, and
682@code{mh-e-user-agent}.
799 683
800 If you select a different mail-composition method, the information 684 If you select a different mail-composition method, the information
801in this chapter about the @samp{*mail*} buffer and Mail mode does not 685in this chapter about the mail buffer and Message mode does not apply;
802apply; the other methods use a different format of text in a different 686the other methods use a different format of text in a different
803buffer, and their commands are different as well. 687buffer, and their commands are different as well.
804 688
805@vindex read-mail-command 689@vindex read-mail-command
diff --git a/doc/emacs/text.texi b/doc/emacs/text.texi
index e94770313cc..c00410e047a 100644
--- a/doc/emacs/text.texi
+++ b/doc/emacs/text.texi
@@ -928,10 +928,10 @@ type @kbd{@key{ESC} @key{TAB}} or @kbd{C-M-i}.
928@vindex text-mode-hook 928@vindex text-mode-hook
929 Entering Text mode runs the hook @code{text-mode-hook}. Other major 929 Entering Text mode runs the hook @code{text-mode-hook}. Other major
930modes related to Text mode also run this hook, followed by hooks of 930modes related to Text mode also run this hook, followed by hooks of
931their own; this includes Paragraph-Indent Text mode, Nroff mode, @TeX{} 931their own; this includes Paragraph-Indent Text mode, Nroff mode,
932mode, Outline mode, and Mail mode. Hook functions on 932@TeX{} mode, Outline mode, and Message mode. Hook functions on
933@code{text-mode-hook} can look at the value of @code{major-mode} to see 933@code{text-mode-hook} can look at the value of @code{major-mode} to
934which of these modes is actually being entered. @xref{Hooks}. 934see which of these modes is actually being entered. @xref{Hooks}.
935 935
936@node Outline Mode 936@node Outline Mode
937@section Outline Mode 937@section Outline Mode