25829
|
1 @c This is part of the Emacs manual.
|
27209
|
2 @c Copyright (C) 1985, 86, 87, 93-95, 97, 2000 Free Software Foundation, Inc.
|
25829
|
3 @c See file emacs.texi for copying conditions.
|
|
4 @node Sending Mail, Rmail, Picture, Top
|
|
5 @chapter Sending Mail
|
|
6 @cindex sending mail
|
|
7 @cindex mail
|
|
8 @cindex message
|
|
9
|
|
10 To send a message in Emacs, you start by typing a command (@kbd{C-x m})
|
|
11 to select and initialize the @samp{*mail*} buffer. Then you edit the text
|
|
12 and headers of the message in this buffer, and type another command
|
|
13 (@kbd{C-c C-s} or @kbd{C-c C-c}) to send the message.
|
|
14
|
|
15 @table @kbd
|
|
16 @item C-x m
|
|
17 Begin composing a message to send (@code{compose-mail}).
|
|
18 @item C-x 4 m
|
|
19 Likewise, but display the message in another window
|
|
20 (@code{compose-mail-other-window}).
|
|
21 @item C-x 5 m
|
|
22 Likewise, but make a new frame (@code{compose-mail-other-frame}).
|
|
23 @item C-c C-s
|
|
24 In Mail mode, send the message (@code{mail-send}).
|
|
25 @item C-c C-c
|
|
26 Send the message and bury the mail buffer (@code{mail-send-and-exit}).
|
|
27 @end table
|
|
28
|
|
29 @kindex C-x m
|
|
30 @findex compose-mail
|
|
31 @kindex C-x 4 m
|
|
32 @findex compose-mail-other-window
|
|
33 @kindex C-x 5 m
|
|
34 @findex compose-mail-other-frame
|
|
35 The command @kbd{C-x m} (@code{compose-mail}) selects a buffer named
|
|
36 @samp{*mail*} and initializes it with the skeleton of an outgoing
|
|
37 message. @kbd{C-x 4 m} (@code{compose-mail-other-window}) selects the
|
|
38 @samp{*mail*} buffer in a different window, leaving the previous current
|
|
39 buffer visible. @kbd{C-x 5 m} (@code{compose-mail-other-frame}) creates
|
|
40 a new frame to select the @samp{*mail*} buffer.
|
|
41
|
|
42 Because the mail-composition buffer is an ordinary Emacs buffer, you can
|
|
43 switch to other buffers while in the middle of composing mail, and switch
|
|
44 back later (or never). If you use the @kbd{C-x m} command again when you
|
|
45 have been composing another message but have not sent it, you are asked to
|
|
46 confirm before the old message is erased. If you answer @kbd{n}, the
|
|
47 @samp{*mail*} buffer is left selected with its old contents, so you can
|
|
48 finish the old message and send it. @kbd{C-u C-x m} is another way to do
|
|
49 this. Sending the message marks the @samp{*mail*} buffer ``unmodified,''
|
|
50 which avoids the need for confirmation when @kbd{C-x m} is next used.
|
|
51
|
|
52 If you are composing a message in the @samp{*mail*} buffer and want to
|
|
53 send another message before finishing the first, rename the
|
|
54 @samp{*mail*} buffer using @kbd{M-x rename-uniquely} (@pxref{Misc
|
|
55 Buffer}). Then you can use @kbd{C-x m} or its variants described above
|
|
56 to make a new @samp{*mail*} buffer. Once you've done that, you can work
|
|
57 with each mail buffer independently.
|
|
58
|
|
59 @menu
|
|
60 * Format: Mail Format. Format of the mail being composed.
|
|
61 * Headers: Mail Headers. Details of permitted mail header fields.
|
|
62 * Aliases: Mail Aliases. Abbreviating and grouping mail addresses.
|
|
63 * Mode: Mail Mode. Special commands for editing mail being composed.
|
|
64 * Spook: Distracting NSA. How to distract the NSA's attention.
|
27209
|
65 * Fortune:: `Fortune' items in signatures.
|
|
66 * Footnotes: Mail Footnotes. Making footnotes in messages.
|
25829
|
67 * Mail Methods:: Using alternative mail-composition methods.
|
|
68 @end menu
|
|
69
|
|
70 @node Mail Format
|
|
71 @section The Format of the Mail Buffer
|
|
72
|
|
73 In addition to the @dfn{text} or @dfn{body}, a message has @dfn{header
|
|
74 fields} which say who sent it, when, to whom, why, and so on. Some
|
|
75 header fields, such as @samp{Date} and @samp{Sender}, are created
|
|
76 automatically when you send the message. Others, such as the recipient
|
|
77 names, must be specified by you in order to send the message properly.
|
|
78
|
|
79 Mail mode provides a few commands to help you edit some header fields,
|
|
80 and some are preinitialized in the buffer automatically at times. You can
|
|
81 insert and edit header fields using ordinary editing commands.
|
|
82
|
|
83 The line in the buffer that says
|
|
84
|
|
85 @example
|
|
86 --text follows this line--
|
|
87 @end example
|
|
88
|
|
89 @noindent
|
|
90 is a special delimiter that separates the headers you have specified from
|
|
91 the text. Whatever follows this line is the text of the message; the
|
|
92 headers precede it. The delimiter line itself does not appear in the
|
|
93 message actually sent. The text used for the delimiter line is controlled
|
|
94 by the variable @code{mail-header-separator}.
|
|
95
|
|
96 Here is an example of what the headers and text in the mail buffer
|
|
97 might look like.
|
|
98
|
|
99 @example
|
|
100 To: gnu@@gnu.org
|
|
101 CC: lungfish@@spam.org, byob@@spam.org
|
|
102 Subject: The Emacs Manual
|
|
103 --Text follows this line--
|
|
104 Please ignore this message.
|
|
105 @end example
|
|
106
|
|
107 @node Mail Headers
|
|
108 @section Mail Header Fields
|
|
109 @cindex headers (of mail message)
|
|
110
|
|
111 A header field in the mail buffer starts with a field name at the
|
|
112 beginning of a line, terminated by a colon. Upper and lower case are
|
|
113 equivalent in field names (and in mailing addresses also). After the
|
|
114 colon and optional whitespace comes the contents of the field.
|
|
115
|
|
116 You can use any name you like for a header field, but normally people
|
|
117 use only standard field names with accepted meanings. Here is a table
|
|
118 of fields commonly used in outgoing messages.
|
|
119
|
|
120 @table @samp
|
|
121 @item To
|
|
122 This field contains the mailing addresses to which the message is
|
|
123 addressed. If you list more than one address, use commas, not spaces,
|
|
124 to separate them.
|
|
125
|
|
126 @item Subject
|
|
127 The contents of the @samp{Subject} field should be a piece of text
|
|
128 that says what the message is about. The reason @samp{Subject} fields
|
|
129 are useful is that most mail-reading programs can provide a summary of
|
|
130 messages, listing the subject of each message but not its text.
|
|
131
|
|
132 @item CC
|
|
133 This field contains additional mailing addresses to send the message to,
|
|
134 like @samp{To} except that these readers should not regard the message
|
|
135 as directed at them.
|
|
136
|
|
137 @item BCC
|
|
138 This field contains additional mailing addresses to send the message to,
|
|
139 which should not appear in the header of the message actually sent.
|
|
140 Copies sent this way are called @dfn{blind carbon copies}.
|
|
141
|
|
142 @vindex mail-self-blind
|
|
143 To send a blind carbon copy of every outgoing message to yourself, set
|
|
144 the variable @code{mail-self-blind} to @code{t}.
|
|
145
|
|
146 @item FCC
|
|
147 This field contains the name of one file and directs Emacs to append a
|
|
148 copy of the message to that file when you send the message. If the file
|
|
149 is in Rmail format, Emacs writes the message in Rmail format; otherwise,
|
|
150 Emacs writes the message in system mail file format.
|
|
151
|
|
152 @vindex mail-archive-file-name
|
|
153 To put a fixed file name in the @samp{FCC} field each time you start
|
|
154 editing an outgoing message, set the variable
|
|
155 @code{mail-archive-file-name} to that file name. Unless you remove the
|
|
156 @samp{FCC} field before sending, the message will be written into that
|
|
157 file when it is sent.
|
|
158
|
|
159 @item From
|
|
160 Use the @samp{From} field to say who you are, when the account you are
|
|
161 using to send the mail is not your own. The contents of the @samp{From}
|
|
162 field should be a valid mailing address, since replies will normally go
|
|
163 there. If you don't specify the @samp{From} field yourself, Emacs uses
|
|
164 the value of @code{user-mail-address} as the default.
|
|
165
|
|
166 @item Reply-to
|
|
167 Use this field to direct replies to a different address. Most
|
|
168 mail-reading programs (including Rmail) automatically send replies to
|
|
169 the @samp{Reply-to} address in preference to the @samp{From} address.
|
|
170 By adding a @samp{Reply-to} field to your header, you can work around
|
|
171 any problems your @samp{From} address may cause for replies.
|
|
172
|
|
173 @cindex @code{REPLYTO} environment variable
|
|
174 @vindex mail-default-reply-to
|
|
175 To put a fixed @samp{Reply-to} address into every outgoing message, set
|
|
176 the variable @code{mail-default-reply-to} to that address (as a string).
|
|
177 Then @code{mail} initializes the message with a @samp{Reply-to} field as
|
|
178 specified. You can delete or alter that header field before you send
|
|
179 the message, if you wish. When Emacs starts up, if the environment
|
|
180 variable @code{REPLYTO} is set, @code{mail-default-reply-to} is
|
|
181 initialized from that environment variable.
|
|
182
|
|
183 @item In-reply-to
|
|
184 This field contains a piece of text describing a message you are
|
|
185 replying to. Some mail systems can use this information to correlate
|
|
186 related pieces of mail. Normally this field is filled in by Rmail
|
|
187 when you reply to a message in Rmail, and you never need to
|
|
188 think about it (@pxref{Rmail}).
|
|
189
|
|
190 @item References
|
|
191 This field lists the message IDs of related previous messages. Rmail
|
|
192 sets up this field automatically when you reply to a message.
|
|
193 @end table
|
|
194
|
|
195 The @samp{To}, @samp{CC}, @samp{BCC} and @samp{FCC} header fields can
|
|
196 appear any number of times, and each such header field can contain
|
|
197 multiple addresses, separated by commas. This way, you can specify any
|
|
198 number of places to send the message. A @samp{To}, @samp{CC}, or
|
|
199 @samp{BCC} field can also have continuation lines: one or more lines
|
|
200 starting with whitespace, following the starting line of the field, are
|
|
201 considered part of the field. Here's an example of a @samp{To} field
|
|
202 with a continuation line:@refill
|
|
203
|
|
204 @example
|
|
205 @group
|
|
206 To: foo@@here.net, this@@there.net,
|
|
207 me@@gnu.cambridge.mass.usa.earth.spiral3281
|
|
208 @end group
|
|
209 @end example
|
|
210
|
|
211 @vindex mail-from-style
|
|
212 When you send the message, if you didn't write a @samp{From} field
|
|
213 yourself, Emacs puts in one for you. The variable
|
|
214 @code{mail-from-style} controls the format:
|
|
215
|
|
216 @table @code
|
|
217 @item nil
|
|
218 Use just the email address, as in @samp{king@@grassland.com}.
|
|
219 @item parens
|
|
220 Use both email address and full name, as in @samp{king@@grassland.com (Elvis
|
|
221 Parsley)}.
|
|
222 @item angles
|
|
223 Use both email address and full name, as in @samp{Elvis Parsley
|
|
224 <king@@grassland.com>}.
|
|
225 @item system-default
|
|
226 Allow the system to insert the @samp{From} field.
|
|
227 @end table
|
|
228
|
|
229 @node Mail Aliases
|
|
230 @section Mail Aliases
|
|
231 @cindex mail aliases
|
|
232 @cindex @file{.mailrc} file
|
|
233 @cindex mailrc file
|
|
234
|
|
235 You can define @dfn{mail aliases} in a file named @file{~/.mailrc}.
|
|
236 These are short mnemonic names which stand for mail addresses or groups of
|
|
237 mail addresses. Like many other mail programs, Emacs expands aliases
|
|
238 when they occur in the @samp{To}, @samp{From}, @samp{CC}, @samp{BCC}, and
|
|
239 @samp{Reply-to} fields, plus their @samp{Resent-} variants.
|
|
240
|
|
241 To define an alias in @file{~/.mailrc}, write a line in the following
|
|
242 format:
|
|
243
|
|
244 @example
|
|
245 alias @var{shortaddress} @var{fulladdresses}
|
|
246 @end example
|
|
247
|
|
248 @noindent
|
|
249 Here @var{fulladdresses} stands for one or more mail addresses for
|
|
250 @var{shortaddress} to expand into. Separate multiple addresses with
|
|
251 spaces; if an address contains a space, quote the whole address with a
|
|
252 pair of double-quotes.
|
|
253
|
|
254 For instance, to make @code{maingnu} stand for
|
|
255 @code{gnu@@gnu.org} plus a local address of your own, put in
|
|
256 this line:@refill
|
|
257
|
|
258 @example
|
|
259 alias maingnu gnu@@gnu.org local-gnu
|
|
260 @end example
|
|
261
|
|
262 Emacs also recognizes include commands in @samp{.mailrc} files.
|
|
263 They look like this:
|
|
264
|
|
265 @example
|
|
266 source @var{filename}
|
|
267 @end example
|
|
268
|
|
269 @noindent
|
|
270 The file @file{~/.mailrc} is used primarily by other mail-reading
|
|
271 programs; it can contain various other commands. Emacs ignores
|
|
272 everything in it except for alias definitions and include commands.
|
|
273
|
|
274 @findex define-mail-alias
|
|
275 Another way to define a mail alias, within Emacs alone, is with the
|
|
276 @code{define-mail-alias} command. It prompts for the alias and then the
|
|
277 full address. You can use it to define aliases in your @file{.emacs}
|
|
278 file, like this:
|
|
279
|
|
280 @example
|
|
281 (define-mail-alias "maingnu" "gnu@@gnu.org")
|
|
282 @end example
|
|
283
|
|
284 @vindex mail-aliases
|
|
285 @code{define-mail-alias} records aliases by adding them to a
|
|
286 variable named @code{mail-aliases}. If you are comfortable with
|
|
287 manipulating Lisp lists, you can set @code{mail-aliases} directly. The
|
|
288 initial value of @code{mail-aliases} is @code{t}, which means that
|
|
289 Emacs should read @file{.mailrc} to get the proper value.
|
|
290
|
|
291 @vindex mail-personal-alias-file
|
|
292 You can specify a different file name to use instead of
|
|
293 @file{~/.mailrc} by setting the variable
|
|
294 @code{mail-personal-alias-file}.
|
|
295
|
|
296 @findex expand-mail-aliases
|
|
297 Normally, Emacs expands aliases when you send the message. You do not
|
|
298 need to expand mail aliases before sending the message, but you can
|
|
299 expand them if you want to see where the mail will actually go. To do
|
|
300 this, use the command @kbd{M-x expand-mail-aliases}; it expands all mail
|
|
301 aliases currently present in the mail headers that hold addresses.
|
|
302
|
|
303 If you like, you can have mail aliases expand as abbrevs, as soon as
|
|
304 you type them in (@pxref{Abbrevs}). To enable this feature, execute the
|
|
305 following:
|
|
306
|
|
307 @example
|
|
308 (add-hook 'mail-setup-hook 'mail-abbrevs-setup)
|
|
309 @end example
|
|
310
|
|
311 @noindent
|
|
312 @findex define-mail-abbrev
|
|
313 @vindex mail-abbrevs
|
|
314 This can go in your @file{.emacs} file. @xref{Hooks}. If you use this
|
|
315 feature, you must use @code{define-mail-abbrev} instead of
|
|
316 @code{define-mail-alias}; the latter does not work with this package.
|
|
317 Note that the mail abbreviation package uses the variable
|
|
318 @code{mail-abbrevs} instead of @code{mail-aliases}, and that all alias
|
|
319 names are converted to lower case.
|
|
320
|
|
321 @kindex C-c C-a @r{(Mail mode)}
|
|
322 @findex mail-interactive-insert-alias
|
|
323 The mail abbreviation package also provides the @kbd{C-c C-a}
|
|
324 (@code{mail-interactive-insert-alias}) command, which reads an alias
|
|
325 name (with completion) and inserts its definition at point. This is
|
|
326 useful when editing the message text itself or a header field such as
|
|
327 @samp{Subject} in which Emacs does not normally expand aliases.
|
|
328
|
|
329 Note that abbrevs expand only if you insert a word-separator character
|
|
330 afterward. However, you can rebind @kbd{C-n} and @kbd{M->} to cause
|
|
331 expansion as well. Here's how to do that:
|
|
332
|
|
333 @smallexample
|
|
334 (add-hook 'mail-setup-hook
|
|
335 '(lambda ()
|
|
336 (substitute-key-definition
|
|
337 'next-line 'mail-abbrev-next-line
|
|
338 mail-mode-map global-map)
|
|
339 (substitute-key-definition
|
|
340 'end-of-buffer 'mail-abbrev-end-of-buffer
|
|
341 mail-mode-map global-map)))
|
|
342 @end smallexample
|
|
343
|
|
344 @node Mail Mode
|
|
345 @section Mail Mode
|
|
346 @cindex Mail mode
|
|
347 @cindex mode, Mail
|
|
348
|
|
349 The major mode used in the mail buffer is Mail mode, which is much
|
|
350 like Text mode except that various special commands are provided on the
|
|
351 @kbd{C-c} prefix. These commands all have to do specifically with
|
|
352 editing or sending the message. In addition, Mail mode defines the
|
|
353 character @samp{%} as a word separator; this is helpful for using the
|
|
354 word commands to edit mail addresses.
|
|
355
|
|
356 Mail mode is normally used in buffers set up automatically by the
|
|
357 @code{mail} command and related commands. However, you can also switch
|
|
358 to Mail mode in a file-visiting buffer. That is a useful thing to do if
|
|
359 you have saved draft message text in a file.
|
|
360
|
|
361 @menu
|
|
362 * Mail Sending:: Commands to send the message.
|
|
363 * Header Editing:: Commands to move to header fields and edit them.
|
|
364 * Citing Mail:: Copying all or part of a message you are replying to.
|
|
365 * Mail Mode Misc:: Spell checking, signatures, etc.
|
|
366 @end menu
|
|
367
|
|
368 @node Mail Sending
|
|
369 @subsection Mail Sending
|
|
370
|
|
371 Mail mode has two commands for sending the message you have been
|
|
372 editing:
|
|
373
|
|
374 @table @kbd
|
|
375 @item C-c C-s
|
|
376 Send the message, and leave the mail buffer selected (@code{mail-send}).
|
|
377 @item C-c C-c
|
|
378 Send the message, and select some other buffer (@code{mail-send-and-exit}).
|
|
379 @end table
|
|
380
|
|
381 @kindex C-c C-s @r{(Mail mode)}
|
|
382 @kindex C-c C-c @r{(Mail mode)}
|
|
383 @findex mail-send
|
|
384 @findex mail-send-and-exit
|
|
385 @kbd{C-c C-s} (@code{mail-send}) sends the message and marks the mail
|
|
386 buffer unmodified, but leaves that buffer selected so that you can
|
|
387 modify the message (perhaps with new recipients) and send it again.
|
|
388 @kbd{C-c C-c} (@code{mail-send-and-exit}) sends and then deletes the
|
|
389 window or switches to another buffer. It puts the mail buffer at the
|
|
390 lowest priority for reselection by default, since you are finished with
|
|
391 using it. This is the usual way to send the message.
|
|
392
|
|
393 In a file-visiting buffer, sending the message does not clear the
|
|
394 modified flag, because only saving the file should do that. As a
|
|
395 result, you don't get a warning if you try to send the same message
|
|
396 twice.
|
|
397
|
|
398 @vindex sendmail-coding-system
|
|
399 When you send a message that contains non-ASCII characters, they need
|
|
400 to be encoded with a coding system (@pxref{Coding Systems}). Usually
|
|
401 the coding system is specified automatically by your chosen language
|
|
402 environment (@pxref{Language Environments}). You can explicitly specify
|
|
403 the coding system for outgoing mail by setting the variable
|
|
404 @code{sendmail-coding-system}.
|
|
405
|
|
406 If the coding system thus determined does not handle the characters in
|
|
407 a particular message, Emacs asks you to select the coding system to use,
|
|
408 showing a list of possible coding systems.
|
|
409
|
|
410 @node Header Editing
|
|
411 @subsection Mail Header Editing
|
|
412
|
|
413 Mail mode provides special commands to move to particular header
|
|
414 fields and to complete addresses in headers.
|
|
415
|
|
416 @table @kbd
|
|
417 @item C-c C-f C-t
|
|
418 Move to the @samp{To} header field, creating one if there is none
|
|
419 (@code{mail-to}).
|
|
420 @item C-c C-f C-s
|
|
421 Move to the @samp{Subject} header field, creating one if there is
|
|
422 none (@code{mail-subject}).
|
|
423 @item C-c C-f C-c
|
|
424 Move to the @samp{CC} header field, creating one if there is none
|
|
425 (@code{mail-cc}).
|
|
426 @item C-c C-f C-b
|
|
427 Move to the @samp{BCC} header field, creating one if there is none
|
|
428 (@code{mail-bcc}).
|
|
429 @item C-c C-f C-f
|
|
430 Move to the @samp{FCC} header field, creating one if there is none
|
|
431 (@code{mail-fcc}).
|
|
432 @item M-@key{TAB}
|
|
433 Complete a mailing address (@code{mail-complete}).
|
|
434 @end table
|
|
435
|
|
436 @kindex C-c C-f C-t @r{(Mail mode)}
|
|
437 @findex mail-to
|
|
438 @kindex C-c C-f C-s @r{(Mail mode)}
|
|
439 @findex mail-subject
|
|
440 @kindex C-c C-f C-c @r{(Mail mode)}
|
|
441 @findex mail-cc
|
|
442 @kindex C-c C-f C-b @r{(Mail mode)}
|
|
443 @findex mail-bcc
|
|
444 @kindex C-c C-f C-f @r{(Mail mode)}
|
|
445 @findex mail-fcc
|
|
446 There are five commands to move point to particular header fields, all
|
|
447 based on the prefix @kbd{C-c C-f} (@samp{C-f} is for ``field''). They
|
|
448 are listed in the table above. If the field in question does not exist,
|
|
449 these commands create one. We provide special motion commands for these
|
|
450 particular fields because they are the fields users most often want to
|
|
451 edit.
|
|
452
|
|
453 @findex mail-complete
|
|
454 @kindex M-TAB @r{(Mail mode)}
|
|
455 While editing a header field that contains mailing addresses, such as
|
|
456 @samp{To:}, @samp{CC:} and @samp{BCC:}, you can complete a mailing
|
|
457 address by typing @kbd{M-@key{TAB}} (@code{mail-complete}). It inserts
|
|
458 the full name corresponding to the address, if it can determine the full
|
|
459 name. The variable @code{mail-complete-style} controls whether to insert
|
|
460 the full name, and what style to use, as in @code{mail-from-style}
|
|
461 (@pxref{Mail Headers}).
|
|
462
|
|
463 For completion purposes, the valid mailing addresses are taken to be
|
|
464 the local users' names plus your personal mail aliases. You can specify
|
|
465 additional sources of valid addresses; use the customization buffer
|
|
466 to see the options for this.
|
|
467
|
|
468 If you type @kbd{M-@key{TAB}} in the body of the message, it invokes
|
|
469 @code{ispell-complete-word}, as in Text mode.
|
|
470
|
|
471 @node Citing Mail
|
|
472 @subsection Citing Mail
|
|
473 @cindex citing mail
|
|
474
|
|
475 Mail mode also has commands for yanking or @dfn{citing} all or part of
|
|
476 a message that you are replying to. These commands are active only when
|
|
477 you started sending a message using an Rmail command.
|
|
478
|
|
479 @table @kbd
|
|
480 @item C-c C-y
|
|
481 Yank the selected message from Rmail (@code{mail-yank-original}).
|
|
482 @item C-c C-r
|
|
483 Yank the region from the Rmail buffer (@code{mail-yank-region}).
|
|
484 @item C-c C-q
|
|
485 Fill each paragraph cited from another message
|
|
486 (@code{mail-fill-yanked-message}).
|
|
487 @end table
|
|
488
|
|
489 @kindex C-c C-y @r{(Mail mode)}
|
|
490 @findex mail-yank-original
|
|
491 When mail sending is invoked from the Rmail mail reader using an Rmail
|
|
492 command, @kbd{C-c C-y} can be used inside the mail buffer to insert
|
|
493 the text of the message you are replying to. Normally it indents each line
|
|
494 of that message three spaces and eliminates most header fields. A numeric
|
|
495 argument specifies the number of spaces to indent. An argument of just
|
|
496 @kbd{C-u} says not to indent at all and not to eliminate anything.
|
|
497 @kbd{C-c C-y} always uses the current message from the Rmail buffer,
|
|
498 so you can insert several old messages by selecting one in Rmail,
|
|
499 switching to @samp{*mail*} and yanking it, then switching back to
|
|
500 Rmail to select another.
|
|
501
|
|
502 @vindex mail-yank-prefix
|
|
503 You can specify the text for @kbd{C-c C-y} to insert at the beginning
|
|
504 of each line: set @code{mail-yank-prefix} to the desired string. (A
|
|
505 value of @code{nil} means to use indentation; this is the default.)
|
|
506 However, @kbd{C-u C-c C-y} never adds anything at the beginning of the
|
|
507 inserted lines, regardless of the value of @code{mail-yank-prefix}.
|
|
508
|
|
509 @kindex C-c C-r @r{(Mail mode)}
|
|
510 @findex mail-yank-region
|
|
511 To yank just a part of an incoming message, set the region in Rmail to
|
|
512 the part you want; then go to the @samp{*Mail*} message and type
|
|
513 @kbd{C-c C-r} (@code{mail-yank-region}). Each line that is copied is
|
|
514 indented or prefixed according to @code{mail-yank-prefix}.
|
|
515
|
|
516 @kindex C-c C-q @r{(Mail mode)}
|
|
517 @findex mail-fill-yanked-message
|
|
518 After using @kbd{C-c C-y} or @kbd{C-c C-r}, you can type @kbd{C-c C-q}
|
|
519 (@code{mail-fill-yanked-message}) to fill the paragraphs of the yanked
|
|
520 old message or messages. One use of @kbd{C-c C-q} fills all such
|
|
521 paragraphs, each one individually. To fill a single paragraph of the
|
|
522 quoted message, use @kbd{M-q}. If filling does not automatically
|
|
523 handle the type of citation prefix you use, try setting the fill prefix
|
|
524 explicitly. @xref{Filling}.
|
|
525
|
|
526 @node Mail Mode Misc
|
|
527 @subsection Mail Mode Miscellany
|
|
528
|
|
529 @table @kbd
|
|
530 @item C-c C-t
|
|
531 Move to the beginning of the message body text (@code{mail-text}).
|
|
532 @item C-c C-w
|
|
533 Insert the file @file{~/.signature} at the end of the message text
|
|
534 (@code{mail-signature}).
|
|
535 @item C-c C-i @var{file} @key{RET}
|
|
536 Insert the contents of @var{file} at the end of the outgoing message
|
|
537 (@code{mail-attach-file}).
|
|
538 @item M-x ispell-message
|
|
539 Do spelling correction on the message text, but not on citations from
|
|
540 other messages.
|
|
541 @end table
|
|
542
|
|
543 @kindex C-c C-t @r{(Mail mode)}
|
|
544 @findex mail-text
|
|
545 @kbd{C-c C-t} (@code{mail-text}) moves point to just after the header
|
|
546 separator line---that is, to the beginning of the message body text.
|
|
547
|
|
548 @kindex C-c C-w @r{(Mail mode)}
|
|
549 @findex mail-signature
|
|
550 @vindex mail-signature
|
|
551 @kbd{C-c C-w} (@code{mail-signature}) adds a standard piece of text at
|
|
552 the end of the message to say more about who you are. The text comes
|
|
553 from the file @file{~/.signature} in your home directory. To insert
|
|
554 your signature automatically, set the variable @code{mail-signature} to
|
|
555 @code{t}; then starting a mail message automatically inserts the
|
|
556 contents of your @file{~/.signature} file. If you want to omit your
|
|
557 signature from a particular message, delete it from the buffer before
|
|
558 you send the message.
|
|
559
|
|
560 You can also set @code{mail-signature} to a string; then that string
|
|
561 is inserted automatically as your signature when you start editing a
|
|
562 message to send. If you set it to some other Lisp expression, the
|
|
563 expression is evaluated each time, and its value (which should be a
|
|
564 string) specifies the signature.
|
|
565
|
|
566 @findex ispell-message
|
|
567 You can do spelling correction on the message text you have written
|
|
568 with the command @kbd{M-x ispell-message}. If you have yanked an
|
|
569 incoming message into the outgoing draft, this command skips what was
|
|
570 yanked, but it checks the text that you yourself inserted. (It looks
|
|
571 for indentation or @code{mail-yank-prefix} to distinguish the cited
|
|
572 lines from your input.) @xref{Spelling}.
|
|
573
|
|
574 @kindex C-c C-i @r{(Mail mode)}
|
|
575 @findex mail-attach-file
|
|
576 To include a file in the outgoing message, you can use @kbd{C-x i},
|
|
577 the usual command to insert a file in the current buffer. But it is
|
|
578 often more convenient to use a special command, @kbd{C-c C-i}
|
|
579 (@code{mail-attach-file}). This command inserts the file contents at
|
|
580 the end of the buffer, after your signature if any, with a delimiter
|
|
581 line that includes the file name.
|
|
582
|
|
583 @vindex mail-mode-hook
|
|
584 @vindex mail-setup-hook
|
|
585 Turning on Mail mode (which @kbd{C-x m} does automatically) runs the
|
|
586 normal hooks @code{text-mode-hook} and @code{mail-mode-hook}.
|
|
587 Initializing a new outgoing message runs the normal hook
|
|
588 @code{mail-setup-hook}; if you want to add special fields to your mail
|
|
589 header or make other changes to the appearance of the mail buffer, use
|
|
590 that hook. @xref{Hooks}.
|
|
591
|
|
592 The main difference between these hooks is just when they are
|
|
593 invoked. Whenever you type @kbd{M-x mail}, @code{mail-mode-hook} runs
|
|
594 as soon as the @samp{*mail*} buffer is created. Then the
|
|
595 @code{mail-setup} function puts in the default contents of the buffer.
|
|
596 After these default contents are inserted, @code{mail-setup-hook} runs.
|
|
597
|
|
598 @node Distracting NSA
|
|
599 @section Distracting the NSA
|
|
600
|
|
601 @findex spook
|
|
602 @cindex NSA
|
|
603 @kbd{M-x spook} adds a line of randomly chosen keywords to an outgoing
|
|
604 mail message. The keywords are chosen from a list of words that suggest
|
|
605 you are discussing something subversive.
|
|
606
|
|
607 The idea behind this feature is the suspicion that the NSA snoops on
|
|
608 all electronic mail messages that contain keywords suggesting they might
|
|
609 find them interesting. (The NSA says they don't, but that's what they
|
|
610 @emph{would} say.) The idea is that if lots of people add suspicious
|
|
611 words to their messages, the NSA will get so busy with spurious input
|
|
612 that they will have to give up reading it all.
|
|
613
|
|
614 Here's how to insert spook keywords automatically whenever you start
|
|
615 entering an outgoing message:
|
|
616
|
|
617 @example
|
|
618 (add-hook 'mail-setup-hook 'spook)
|
|
619 @end example
|
|
620
|
|
621 Whether or not this confuses the NSA, it at least amuses people.
|
|
622
|
27209
|
623 @node Fortune
|
|
624 @section Putting @code{fortune} Items in Signatures
|
|
625
|
|
626 @pindex fortune
|
|
627 @findex fortune-to-signature
|
|
628 @findex fortune-from-region
|
|
629 @cindex signatures, mail/news
|
|
630 @cindex fortune cookies
|
|
631 The Fortune package uses the @code{fortune} program to create signatures
|
|
632 for mail or network news messages. (@code{fortune} prints a
|
|
633 random---with luck, interesting---adage, originally inspired by `fortune
|
|
634 cookie' messages.) It also allows you automatically to cut regions to a
|
|
635 Fortune file with @kbd{M-x fortune-from-region} and compile your own
|
|
636 Fortune database. To generate signatures, add
|
|
637 @code{fortune-to-signature} to @code{mail-setup-hook} and/or
|
|
638 @code{message-setup-hook} as appropriate.
|
|
639
|
|
640 @node Mail Footnotes
|
|
641 @section Making Footnotes
|
|
642 @cindex footnotes
|
|
643
|
|
644 @findex footnote-mode
|
|
645 @kbd{M-x footnote-mode} toggles a minor mode for making footnotes in
|
|
646 mail or network news messages. It is intended for use specifically with
|
|
647 Message mode but is not specific to that. It provides commands and
|
|
648 keybindings to insert footnotes, go to a given note, delete a note and
|
|
649 renumber notes. See the group @code{footnote} for customization and the
|
|
650 mode's documentation for keybindings. To set up Footnote mode for all
|
|
651 messages, add @code{footnote-mode} to @code{mail-mode-hook} and/or
|
|
652 @code{message-mode-hook} as appropriate.
|
|
653
|
25829
|
654 @node Mail Methods
|
|
655 @section Mail-Composition Methods
|
|
656 @cindex mail-composition methods
|
|
657
|
|
658 This chapter describes the usual Emacs mode for editing and sending
|
|
659 mail---Mail mode. Emacs has alternative facilities for editing and
|
|
660 sending mail, including MH-E and Message mode, not documented in this
|
|
661 manual. You can choose any of them as your preferred method. The
|
|
662 commands @code{C-x m}, @code{C-x 4 m} and @code{C-x 5 m} use whichever
|
|
663 agent you have specified. So do various other Emacs commands and
|
|
664 facilities that send mail.
|
|
665
|
|
666 @vindex mail-user-agent
|
|
667 To specify your mail-composition method, set the variable
|
|
668 @code{mail-user-agent}. Currently legitimate values include
|
|
669 @code{sendmail-user-agent}, @code{mh-e-user-agent}, and
|
|
670 @code{message-user-agent}.
|
|
671
|
|
672 If you select a different mail-composition method, the information in
|
|
673 this chapter about the @samp{*mail*} buffer and Mail mode does not
|
|
674 apply; other methods may use completely different commands with a
|
|
675 different format in a differently named buffer.
|
|
676
|