*** empty log message ***
[gnus] / texi / message.texi
1 \input texinfo                  @c -*-texinfo-*-
2
3 @setfilename message
4 @settitle Message Manual
5 @synindex fn cp
6 @synindex vr cp
7 @synindex pg cp
8 @iftex
9 @finalout
10 @end iftex
11 @setchapternewpage odd
12
13 @ifinfo
14
15 This file documents Messa, the Emacs message composition mode.
16
17 Copyright (C) 1996 Free Software Foundation, Inc.
18
19 Permission is granted to make and distribute verbatim copies of
20 this manual provided the copyright notice and this permission notice
21 are preserved on all copies.
22
23 @ignore
24 Permission is granted to process this file through Tex and print the
25 results, provided the printed document carries copying permission
26 notice identical to this one except for the removal of this paragraph
27 (this paragraph not being relevant to the printed manual).
28
29 @end ignore
30 Permission is granted to copy and distribute modified versions of this
31 manual under the conditions for verbatim copying, provided also that the
32 entire resulting derived work is distributed under the terms of a
33 permission notice identical to this one.
34
35 Permission is granted to copy and distribute translations of this manual
36 into another language, under the above conditions for modified versions.
37 @end ifinfo
38
39 @tex
40
41 @titlepage
42 @title Message Manual
43
44 @author by Lars Magne Ingebrigtsen
45 @page
46
47 @vskip 0pt plus 1filll
48 Copyright @copyright{} 1996 Free Software Foundation, Inc. 
49
50 Permission is granted to make and distribute verbatim copies of
51 this manual provided the copyright notice and this permission notice
52 are preserved on all copies.
53
54 Permission is granted to copy and distribute modified versions of this
55 manual under the conditions for verbatim copying, provided that the
56 entire resulting derived work is distributed under the terms of a
57 permission notice identical to this one.
58
59 Permission is granted to copy and distribute translations of this manual
60 into another language, under the above conditions for modified versions.
61
62 @end titlepage
63 @page
64
65 @end tex
66
67 @node Top
68 @top Message
69
70 All message composition (both mail and news) takes place in Message mode
71 buffers.
72
73 @menu
74 * Interface::         Setting up message buffers.
75 * Commands::          Commands you can execute in message mode buffers.
76 * Variables::         Customizing the message buffers.
77 * Compatibility::     Making Message backwards compatible.
78 * Index::             Variable, function and concept index.
79 * Key Index::         List of Message mode keys.
80 @end menu
81
82
83 @node Interface
84 @chapter Interface
85
86 When a program (or a person) wants to respond to a message -- reply,
87 follow up, forward, cancel -- the program (or person) should just put
88 point in the buffer where the message is and call the required command.
89 @code{Message} will then pop up a new @code{message} mode buffer with
90 appropriate headers filled out, and the user can edit the message before
91 sending it.
92
93 @menu
94 * New Mail Message::     Editing a brand new mail message.
95 * New News Message::     Editing a brand new news message.
96 * Reply::                Replying via mail.
97 * Wide Reply::           Responding to all people via mail.
98 * Followup::             Following up via news.
99 * Canceling News::       Canceling a news article.
100 * Superseding::          Superseding a message.
101 * Forwarding::           Forwarding a message via news or mail.
102 * Resending::            Resending a mail message.
103 * Bouncing::             Bouncing a mail message.
104 @end menu
105
106
107 @node New Mail Message
108 @section New Mail Message
109
110 @findex message-mail
111 The @code{message-mail} command pops up a new message buffer.  
112
113 Two optional parameters are accepted: The first will be used as the
114 @code{To} header and the second as the @code{Subject} header.  If these
115 aren't present, those two headers will be empty.
116
117
118 @node New News Message
119 @section New News Message
120
121 @findex message-news
122 The @code{message-news} command pops up a new message buffer.  
123
124 This function accepts two optional parameters.  The first will be used
125 as the @code{Newsgroups} header and the second as the @code{Subject}
126 header.  If these aren't present, those two headers will be empty.
127
128
129 @node Reply
130 @section Reply
131
132 @findex message-reply
133 The @code{message-reply} function pops up a message buffer that's a
134 reply to the message in the current buffer.
135
136 @vindex message-reply-to-function
137 Message uses the normal methods to determine where replies are to go,
138 but you can change the behavior to suit your needs by fiddling with the
139 @code{message-reply-to-function} variable.
140
141 If you want the replies to go to the @code{Sender} instead of the
142 @code{From}, you could do something like this:
143
144 @lisp
145 (setq message-reply-to-function
146       (lambda ()
147        (cond ((equal (mail-fetch-field "from") "somebody")
148                (mail-fetch-field "sender"))     
149              (t 
150               nil))))
151 @end lisp
152
153 This function will be called narrowed to the head of the article that is
154 being replied to.
155
156 As you can see, this function should return a string if it has an
157 opinion as to what the To header should be.  If it does not, it should
158 just return @code{nil}, and the normal methods for determining the To
159 header will be used.
160
161 This function can also return a list.  In that case, each list element
162 should be a cons, where the car should be the name of an header
163 (eg. @code{Cc}) and the cdr should be the header value
164 (eg. @samp{larsi@@ifi.uio.no}).  All these headers will be inserted into
165 the head of the outgoing mail. 
166
167
168 @node Wide Reply
169 @section Wide Reply
170
171 @findex message-wide-reply
172 The @code{message-wide-reply} pops up a message buffer that's a wide
173 reply to the message in the current buffer.  A @dfn{wide reply} is a
174 reply that goes out to all people listed in the @code{To}, @code{From}
175 and @code{Cc} headers.
176
177 @vindex message-wide-reply-to-function
178 Message uses the normal methods to determine where wide replies are to go,
179 but you can change the behavior to suit your needs by fiddling with the
180 @code{message-wide-reply-to-function}.  It is used in the same way as
181 @code{message-reply-to-function} (@pxref{Reply}). 
182
183 @findex rmail-dont-reply-to-names
184 Addresses that match the @code{rmail-dont-reply-to-names} regular
185 expression will be removed from the @code{Cc} header.
186
187
188 @node Followup
189 @section Followup
190
191 @findex message-followup
192 The @code{message-followup} command pops up a message buffer that's a
193 followup to the message in the current buffer.
194
195 @vindex message-followup-to-function
196 Message uses the normal methods to determine where followups are to go,
197 but you can change the behavior to suit your needs by fiddling with the
198 @code{message-followup-to-function}.  It is used in the same way as
199 @code{message-reply-to-function} (@pxref{Reply}).
200
201 @vindex message-use-followup-to
202 The @code{message-use-followup-to} variable says what to do about
203 @code{Followup-To} headers.  If it is @code{use}, always use the value.
204 If it is @code{ask} (which is the default), ask whether to use the
205 value.  If it is @code{t}, use the value unless it is @samp{poster}.  If
206 it is @code{nil}, don't use the value.
207
208
209 @node Canceling News
210 @section Canceling News
211
212 @findex message-cancel-news
213 The @code{message-cancel-news} command cancels the article in the
214 current buffer.
215
216
217 @node Superseding
218 @section Superseding
219
220 @findex message-supersede
221 The @code{message-supersede} command pops up a message buffer that will
222 supersede the message in the current buffer.
223
224 @vindex message-ignored-supersedes-headers
225 Headers matching the @code{message-ignored-supersedes-headers} are
226 removed before popping up the new message buffer.  The default is@*
227 @samp{^Path:\\|^Date\\|^NNTP-Posting-Host:\\|^Xref:\\|^Lines:\\|@*
228 ^Received:\\|^X-From-Line:\\|Return-Path:}.
229
230
231
232 @node Forwarding
233 @section Forwarding
234
235 @findex message-forward
236 The @code{message-forward} command pops up a message buffer to forward
237 the message in the current buffer.  If given a prefix, forward using
238 news.
239
240 @table @code
241 @item message-forward-start-separator
242 @vindex message-forward-start-separator
243 Delimiter inserted before forwarded messages.  The default is@*
244 @samp{------- Start of forwarded message -------\n}. 
245
246 @vindex message-forward-end-separator
247 @item message-forward-end-separator
248 @vindex message-forward-end-separator
249 Delimiter inserted after forwarded messages.  The default is@*
250 @samp{------- End of forwarded message -------\n}. 
251
252 @item message-signature-before-forwarded-message
253 @vindex message-signature-before-forwarded-message
254 If this variable is @code{t}, which it is by default, your personal
255 signature will be inserted before the forwarded message.  If not, the
256 forwarded message will be inserted first in the new mail.
257
258 @item message-included-forward-headers
259 @vindex message-included-forward-headers
260 Regexp matching header lines to be included in forwarded messages.  
261
262 @end table
263
264
265 @node Resending
266 @section Resending
267
268 @findex message-resend
269 The @code{message-resend} command will prompt the user for an address
270 and resend the message in the current buffer to that address.
271
272 @vindex message-ignored-resent-headers
273 Headers that match the @code{message-ignored-resent-headers} regexp will
274 be removed before sending the message.  The default is
275 @samp{^Return-receipt}. 
276
277
278 @node Bouncing
279 @section Bouncing
280
281 @findex message-bounce
282 The @code{message-bounce} command will, if the current buffer contains a
283 bounced mail message, pop up a message buffer stripped of the bounce
284 information.  A @dfn{bounced message} is typically a mail you've sent
285 out that has been returned by some @code{mailer-daemon} as
286 undeliverable. 
287
288 @vindex message-ignored-bounced-headers
289 Headers that match the @code{message-ignored-bounced-headers} regexp
290 will be removed before popping up the buffer.  The default is
291 @samp{^Received:}. 
292
293
294 @node Commands
295 @chapter Commands
296
297 @menu
298 * Header Commands::     Commands for moving to headers.
299 * Movement::            Moving around in message buffers.
300 * Insertion::           Inserting things into message buffers.
301 * Various Commands::    Various things.
302 * Sending::             Actually sending the message.
303 * Mail Aliases::        How to use mail aliases.
304 @end menu
305
306
307 @node Header Commands
308 @section Header Commands
309
310 All these commands move to the header in question.  If it doesn't exist,
311 it will be inserted.
312
313 @table @kbd
314
315 @item C-c ?
316 @kindex C-c ?
317 @findex message-goto-to
318 Describe the message mode.
319
320 @item C-c C-f C-t
321 @kindex C-c C-f C-t 
322 @findex message-goto-to
323 Go to the @code{To} header (@code{message-goto-to}).
324
325 @item C-c C-f C-b
326 @kindex C-c C-f C-b 
327 @findex message-goto-bcc
328 Go to the @code{Bcc} header (@code{message-goto-bcc}).
329
330 @item C-c C-f C-f
331 @kindex C-c C-f C-f 
332 @findex message-goto-fcc
333 Go to the @code{Fcc} header (@code{message-goto-fcc}).
334
335 @item C-c C-f C-c
336 @kindex C-c C-f C-c 
337 @findex message-goto-cc
338 Go to the @code{Cc} header (@code{message-goto-cc}).
339
340 @item C-c C-f C-s
341 @kindex C-c C-f C-s 
342 @findex message-goto-subject
343 Go to the @code{Subject} header (@code{message-goto-subject}).
344
345 @item C-c C-f C-r
346 @kindex C-c C-f C-r 
347 @findex message-goto-reply-to
348 Go to the @code{Reply-To} header (@code{message-goto-reply-to}).
349
350 @item C-c C-f C-n
351 @kindex C-c C-f C-n 
352 @findex message-goto-newsgroups
353 Go to the @code{Newsgroups} header (@code{message-goto-newsgroups}).
354
355 @item C-c C-f C-d
356 @kindex C-c C-f C-d 
357 @findex message-goto-distribution
358 Go to the @code{Distribution} header (@code{message-goto-distribution}).
359
360 @item C-c C-f C-o
361 @kindex C-c C-f C-o 
362 @findex message-goto-followup-to
363 Go to the @code{Followup-To} header (@code{message-goto-followup-to}).
364
365 @item C-c C-f C-k
366 @kindex C-c C-f C-k 
367 @findex message-goto-keywords
368 Go to the @code{Keywords} header (@code{message-goto-keywords}).
369
370 @item C-c C-f C-u
371 @kindex C-c C-f C-u 
372 @findex message-goto-summary
373 Go to the @code{Summary} header (@code{message-goto-summary}).
374
375 @end table
376
377
378 @node Movement
379 @section Movement
380
381 @table @kbd
382 @item C-c C-b
383 @kindex C-c C-b 
384 @findex message-goto-body
385 Move to the beginning of the body of the message
386 (@code{message-goto-body}). 
387
388 @item C-c C-i
389 @kindex C-c C-i 
390 @findex message-goto-signature
391 Move to the signature of the message (@code{message-goto-signature}).
392
393 @end table
394
395
396 @node Insertion
397 @section Insertion
398
399 @table @kbd
400
401 @item C-c C-y
402 @kindex C-c C-y 
403 @findex message-yank-original
404 Yank the message that's being replied to into the message buffer
405 (@code{message-yank-original}). 
406
407 @item C-c C-q
408 @kindex C-c C-q 
409 @findex message-fill-yanked-message
410 Fill the yanked message (@code{message-fill-yanked-message}). 
411
412 @item C-c C-w
413 @kindex C-c C-w 
414 @findex message-insert-signature
415 Insert a signature at the end of the buffer
416 (@code{message-insert-signature}).  
417
418 @end table
419
420 @table @code
421 @item message-ignored-cited-headers
422 @vindex message-ignored-cited-headers
423 All headers that match this regexp will be removed from yanked
424 messages.  The default is @samp{.}, which means that all headers will be
425 removed.
426
427 @item message-citation-line-function
428 @vindex message-citation-line-function
429 Function called to insert the citation line.  The default is
430 @code{message-insert-citation-line}. 
431
432 @item message-yank-prefix
433 @vindex message-yank-prefix
434 @cindex yanking
435 @cindex quoting
436 When you are replying to or following up an article, you normally want
437 to quote the person you are answering.  Inserting quoted text is done by
438 @dfn{yanking}, and each quoted line you yank will have
439 @code{message-yank-prefix} prepended to it.  The default is @samp{> }.
440 If it is @code{nil}, just indent the message.
441
442 @item message-indentation-spaces
443 @vindex message-indentation-spaces
444 Number of spaces to indent yanked messages.
445
446 @item message-cite-function
447 @vindex message-cite-function
448 @findex message-cite-original
449 @findex sc-cite-original
450 @cindex Supercite
451 Function for citing an original message.  The default is
452 @code{message-cite-original}.  You can also set it to
453 @code{sc-cite-original} to use Supercite.
454
455 @item message-indent-citation-function
456 @vindex message-indent-citation-function
457 Function for modifying a citation just inserted in the mail buffer.
458 This can also be a list of functions.  Each function can find the
459 citation between @code{(point)} and @code{(mark t)}.  And each function
460 should leave point and mark around the citation text as modified.
461
462 @item message-signature
463 @vindex message-signature
464 String to be inserted at the end of the message buffer.  If @code{t}
465 (which is the default), the @code{message-signature-file} file will be
466 inserted instead.  If a function, the result from the function will be
467 used instead.  If a form, the result from the form will be used instead.
468 If this variable is @code{nil}, no signature will be inserted at all.
469
470 @item message-signature-file
471 @vindex message-signature-file
472 File containing the signature to be inserted at the end of the buffer.
473 The default is @samp{~/.signature}.
474
475 @end table
476
477 Note that RFC1036 says that a signature should be preceded by the three
478 characters @samp{-- } on a line by themselves.  This is to make it
479 easier for the recipient to automatically recognize and process the
480 signature.  So don't remove those characters, even though you might feel
481 that they ruin your beautiful design, like, totally.
482
483 Also note that no signature should be more than four lines long.
484 Including ASCII graphics is an efficient way to get everybody to believe
485 that you are silly and have nothing important to say.
486
487
488
489 @node Various Commands
490 @section Various Commands
491
492 @table @kbd
493
494 @item C-c C-r
495 @kindex C-c C-r 
496 @findex message-caesar-buffer-body
497 Caesar rotate (aka. rot13) the current message
498 (@code{message-caesar-buffer-body}).  If narrowing is in effect, just
499 rotate the visible portion of the buffer.  A numerical prefix says how
500 many places to rotate the text.  The default is 13.
501
502 @item C-c C-e
503 @kindex C-c C-e
504 @findex message-elide-region
505 Elide the text between point and mark (@code{message-elide-region}).
506 The text is killed and an ellipsis (@samp{[...]}) will be inserted in
507 its place.
508
509 @item C-c C-t
510 @kindex C-c C-t 
511 @findex message-insert-to
512 Insert a @code{To} header that contains the @code{Reply-To} or
513 @code{From} header of the message you're following up
514 (@code{message-insert-to}). 
515
516 @item C-c C-n
517 @kindex C-c C-n 
518 @findex message-insert-newsgroups
519 Insert a @code{Newsgroups} header that reflects the @code{Followup-To}
520 or @code{Newsgroups} header of the article you're replying to
521 (@code{message-insert-newsgroups}).
522
523 @item C-c M-r
524 @kindex C-c M-r
525 @findex message-rename-buffer
526 Rename the buffer (@code{message-rename-buffer}).  If given a prefix,
527 prompt for a new buffer name.
528
529 @end table
530
531
532 @node Sending
533 @section Sending
534
535 @table @kbd
536 @item C-c C-c
537 @kindex C-c C-c 
538 @findex message-send-and-exit
539 Send the message and bury the current buffer
540 (@code{message-send-and-exit}). 
541
542 @item C-c C-s
543 @kindex C-c C-s 
544 @findex message-send
545 Send the message (@code{message-send}). 
546
547 @item C-c C-d
548 @kindex C-c C-d
549 @findex message-dont-send
550 Bury the message buffer and exit (@code{message-dont-send}).
551
552 @item C-c C-k
553 @kindex C-c C-k
554 @findex message-kill-buffer
555 Kill the message buffer and exit (@code{message-kill-buffer}).
556
557 @end table
558
559
560
561 @node Mail Aliases
562 @section Mail Aliases
563 @cindex mail aliases
564 @cindex aliases
565
566 Message uses @code{mailabbrev} to handle mail aliases.  
567 @code{mailabbrev} works by parsing the @file{/etc/mailrc} and
568 @file{~/.mailrc} files.  These files look like:
569
570 @example
571 alias lmi "Lars Magne Ingebrigtsen <larsi@@ifi.uio.no>"
572 alias ding "ding@@ifi.uio.no (ding mailing list)"
573 @end example
574
575 After adding lines like this to your @file{~/.mailrc} file, you should
576 be able to just write @samp{lmi} in the @code{To} or @code{Cc} (and so
577 on) headers and press @kbd{SPC} to expand the alias.
578
579 No expansion will be performed upon sending of the message---all
580 expansions have to be done explicitly.
581
582
583
584 @node Variables
585 @chapter Variables
586
587 @menu
588 * Message Headers::             General message header stuff.
589 * Mail Headers::                Customizing mail headers.
590 * Mail Variables::              Other mail variables.
591 * News Headers::                Customizing news headers.
592 * News Variables::              Other news variables.
593 * Various Message Variables::   Other message variables.
594 * Sending Variables::           Variables for sending.
595 * Message Buffers::             How Message names its buffers.
596 * Message Actions::             Actions to be performed when exiting.
597 @end menu
598
599
600 @node Message Headers
601 @section Message Headers
602
603 Message is quite aggressive on the message generation front.  It has
604 to be -- it's a combined news and mail agent.  To be able to send
605 combined messages, it has to generate all headers itself to ensure that
606 mail and news copies of messages look sufficiently similar.
607
608 @table @code
609
610 @item message-generate-headers-first
611 @vindex message-generate-headers-first
612 If non-@code{nil}, generate all headers before starting to compose the
613 message.  
614
615 @item message-from-style
616 @vindex message-from-style
617 Specifies how @code{From} headers should look.  There are four legal
618 values:
619
620 @table @code
621 @item nil
622 Just the address -- @samp{king@@grassland.com}.
623
624 @item parens
625 @samp{king@@grassland.com (Elvis Parsley)}.
626
627 @item angles
628 @samp{Elvis Parsley <king@@grassland.com>}.
629
630 @item default
631 Look like @code{angles} if that doesn't require quoting, and
632 @code{parens} if it does.  If even @code{parens} requires quoting, use
633 @code{angles} anyway.
634
635 @end table
636
637 @item message-deletable-headers
638 @vindex message-deletable-headers
639 Headers in this list that were previously generated by Message will be
640 deleted before posting.  Let's say you post an article.  Then you decide
641 to post it again to some other group, you naughty boy, so you jump back
642 to the @code{*post-buf*} buffer, edit the @code{Newsgroups} line, and
643 ship it off again.  By default, this variable makes sure that the old
644 generated @code{Message-ID} is deleted, and a new one generated.  If
645 this isn't done, the entire empire would probably crumble, anarchy would
646 prevail, and cats would start walking on two legs and rule the world.
647 Allegedly.  
648
649 @item message-default-headers
650 @vindex message-default-headers
651 This string is inserted at the end of the headers in all message
652 buffers.
653
654 @end table
655
656
657 @node Mail Headers
658 @section Mail Headers
659
660 @table @code
661 @item message-required-mail-headers
662 @vindex message-required-mail-headers
663 @xref{News Headers}, for the syntax of this variable.  It is
664 @code{(From Date Subject (optional . In-Reply-To) Message-ID Lines
665 (optional . X-Mailer))} by default.
666
667 @item message-ignored-mail-headers
668 @vindex message-ignored-mail-headers
669 Regexp of headers to be removed before mailing.  The default is
670 @samp{^Gcc:\\|^Fcc:}. 
671
672 @item message-default-mail-headers
673 @vindex message-default-mail-headers
674 This string is inserted at the end of the headers in all message
675 buffers that are initialized as mail.
676
677 @end table
678
679
680 @node Mail Variables
681 @section Mail Variables 
682
683 @table @code
684 @item message-send-mail-function
685 @vindex message-send-mail-function
686 Function used to send the current buffer as mail.  The default is
687 @code{message-send-mail-with-sendmail}.   If you prefer using MH
688 instead, set this variable to @code{message-send-mail-with-mh}.
689
690 @item message-mh-deletable-headers
691 @vindex message-mh-deletable-headers
692 Most versions of MH doesn't like being fed messages that contain the
693 headers in this variable.  If this variable is non-@code{nil} (which is
694 the default), these headers will be removed before mailing.  Set it to
695 @code{nil} if your MH can handle these headers.
696
697 @end table
698
699
700 @node News Headers
701 @section News Headers
702
703 @vindex message-required-news-headers
704 @code{message-required-news-headers} a list of header symbols.  These
705 headers will either be automatically generated, or, if that's
706 impossible, they will be prompted for.  The following symbols are legal:
707
708 @table @code
709
710 @item From
711 @cindex From
712 @findex user-full-name
713 @findex user-mail-address
714 This required header will be filled out with the result of the
715 @code{message-make-from} function, which depends on the
716 @code{message-from-style}, @code{user-full-name},
717 @code{user-mail-address} variables.
718
719 @item Subject
720 @cindex Subject
721 This required header will be prompted for if not present already. 
722
723 @item Newsgroups
724 @cindex Newsgroups
725 This required header says which newsgroups the article is to be posted
726 to.  If it isn't present already, it will be prompted for.
727
728 @item Organization
729 @cindex organization
730 This optional header will be filled out depending on the
731 @code{message-user-organization} variable.
732 @code{message-user-organization-file} will be used if this variable is
733 @code{t}.  This variable can also be a string (in which case this string
734 will be used), or it can be a function (which will be called with no
735 parameters and should return a string to be used).
736
737 @item Lines
738 @cindex Lines
739 This optional header will be computed by Message.
740
741 @item Message-ID
742 @cindex Message-ID
743 @vindex mail-host-address
744 @findex system-name
745 @cindex Sun
746 This required header will be generated by Message.  A unique ID will be
747 created based on the date, time, user name and system name.  Message will
748 use @code{mail-host-address} as the fully qualified domain name (FQDN)
749 of the machine if that variable is defined.  If not, it will use
750 @code{system-name}, which doesn't report a FQDN on some machines --
751 notably Suns.
752
753 @item X-Newsreader
754 @cindex X-Newsreader
755 This optional header will be filled out according to the
756 @code{message-newsreader} local variable.
757
758 @item X-Mailer
759 This optional header will be filled out according to the
760 @code{message-mailer} local variable, unless there already is an
761 @code{X-Newsreader} header present.
762
763 @item In-Reply-To
764 This optional header is filled out using the @code{Date} and @code{From}
765 header of the article being replied to.
766
767 @item Expires
768 @cindex Expires
769 This extremely optional header will be inserted according to the
770 @code{message-expires} variable.  It is highly deprecated and shouldn't
771 be used unless you know what you're doing.
772
773 @item Distribution
774 @cindex Distribution
775 This optional header is filled out according to the
776 @code{message-distribution-function} variable.  It is a deprecated and
777 much misunderstood header.
778
779 @item Path
780 @cindex path
781 This extremely optional header should probably never be used.
782 However, some @emph{very} old servers require that this header is
783 present.  @code{message-user-path} further controls how this
784 @code{Path} header is to look.  If it is @code{nil}, use the server name
785 as the leaf node.  If it is a string, use the string.  If it is neither
786 a string nor @code{nil}, use the user name only.  However, it is highly
787 unlikely that you should need to fiddle with this variable at all.
788 @end table
789
790 @findex yow
791 @cindex Mime-Version
792 In addition, you can enter conses into this list.  The car of this cons
793 should be a symbol.  This symbol's name is the name of the header, and
794 the cdr can either be a string to be entered verbatim as the value of
795 this header, or it can be a function to be called.  This function should
796 return a string to be inserted.  For instance, if you want to insert
797 @code{Mime-Version: 1.0}, you should enter @code{(Mime-Version . "1.0")}
798 into the list.  If you want to insert a funny quote, you could enter
799 something like @code{(X-Yow . yow)} into the list.  The function
800 @code{yow} will then be called without any arguments.
801
802 If the list contains a cons where the car of the cons is
803 @code{optional}, the cdr of this cons will only be inserted if it is
804 non-@code{nil}.
805
806 Other variables for customizing outgoing news articles:
807
808 @table @code
809
810 @item message-syntax-checks
811 @vindex message-syntax-checks
812 If non-@code{nil}, Message will attempt to check the legality of the
813 headers, as well as some other stuff, before posting.  You can control
814 the granularity of the check by adding or removing elements from this
815 list.  Legal elements are:
816
817 @table @code
818 @item subject-cmsg 
819 Check the subject for commands.
820 @item sender
821 @cindex Sender
822 Insert a new @code{Sender} header if the @code{From} header looks odd. 
823 @item multiple-headers 
824 Check for the existence of multiple equal headers.
825 @item sendsys 
826 @cindex sendsys
827 Check for the existence of version and sendsys commands.
828 @item message-id
829 Check whether the @code{Message-ID} looks ok.
830 @item from
831 Check whether the @code{From} header seems nice.
832 @item long-lines 
833 @cindex long lines
834 Check for too long lines.
835 @item control-chars
836 Check for illegal characters.
837 @item size
838 Check for excessive size.
839 @item new-text
840 Check whether there is any new text in the messages.
841 @item signature
842 Check the length of the signature.
843 @item approved
844 @cindex approved
845 Check whether the article has an @code{Approved} header, which is
846 something only moderators should include.
847 @item empty
848 Check whether the article is empty.
849 @item empty-headers
850 Check whether any of the headers are empty.
851 @item existing-newsgroups
852 Check whether the newsgroups mentioned in the @code{Newsgroups} and 
853 @code{Followup-To} headers exist.
854 @item valid-newsgroups
855 Check whether the @code{Newsgroups} and @code{Followup-to} headers
856 are valid syntactically.
857 @item shorten-followup-to
858 Check whether to add a @code{Followup-to} header to shorten the number
859 of groups to post to.
860 @end table
861
862 All these conditions are checked by default.
863
864 @item message-ignored-news-headers
865 @vindex message-ignored-news-headers
866 Regexp of headers to be removed before posting.  The default is@*
867 @samp{^NNTP-Posting-Host:\\|^Xref:\\|^Bcc:\\|^Gcc:\\|^Fcc:}.
868
869 @item message-default-news-headers
870 @vindex message-default-news-headers
871 This string is inserted at the end of the headers in all message
872 buffers that are initialized as news.
873
874 @end table
875
876
877 @node News Variables
878 @section News Variables
879
880 @table @code
881 @item message-send-news-function
882 @vindex message-send-news-function
883 Function used to send the current buffer as news.  The default is
884 @code{message-send-news}. 
885
886 @item message-post-method
887 @vindex message-post-method
888 Method used for posting a prepared news message.
889
890 @end table
891
892
893 @node Various Message Variables
894 @section Various Message Variables
895
896 @table @code
897 @item message-signature-separator
898 @vindex message-signature-separator
899 Regexp matching the signature separator.  It is @samp{^-- *$} by
900 default. 
901
902 @item mail-header-separator
903 @vindex mail-header-separator
904 String used to separate the headers from the body.  It is @samp{--text
905 follows this line--} by default.
906
907 @item message-directory
908 @vindex message-directory
909 Directory used by many mailey things.  The default is @file{~/Mail/}. 
910
911 @item message-autosave-directory
912 @vindex message-autosave-directory
913 Directory where message buffers will be autosaved to.
914
915 @item message-signature-setup-hook
916 @vindex message-signature-setup-hook
917 Hook run when initializing the message buffer.  It is run after the
918 headers have been inserted but before the signature has been inserted. 
919
920 @item message-setup-hook
921 @vindex message-setup-hook
922 Hook run as the last thing when the message buffer has been initialized.
923
924 @item message-header-setup-hook
925 @vindex message-header-setup-hook
926 Hook called narrowed to the headers after initializing the headers. 
927
928 For instance, if you're running Gnus and wish to insert a
929 @samp{Mail-Copies-To} header in all your news articles and all messages
930 you send to mailing lists, you could do something like the following:
931
932 @lisp
933 (defun my-message-header-setup-hook ()
934   (let ((group (or gnus-newsgroup-name "")))
935     (when (or (message-fetch-field "newsgroups")
936               (gnus-group-find-parameter group 'to-address)
937               (gnus-group-find-parameter group 'to-list))
938       (insert "Mail-Copies-To: never\n"))))
939
940 (add-hook 'message-header-setup-hook 'my-message-header-setup-hook)
941 @end lisp
942
943 @item message-send-hook
944 @vindex message-send-hook
945 Hook run before sending messages.
946
947 @item message-send-mail-hook
948 @vindex message-send-mail-hook
949 Hook run before sending mail messages.
950
951 @item message-send-news-hook
952 @vindex message-send-news-hook
953 Hook run before sending news messages.
954
955 @item message-sent-hook
956 @vindex message-sent-hook
957 Hook run after sending messages.
958
959 @item message-mode-syntax-table
960 @vindex message-mode-syntax-table
961 Syntax table used in message mode buffers.
962
963 @end table
964
965
966
967 @node Sending Variables
968 @section Sending Variables
969
970 @table @code
971
972 @item message-fcc-handler-function 
973 @vindex message-fcc-handler-function 
974 A function called to save outgoing articles.  This function will be
975 called with the name of the file to store the article in. The default
976 function is @code{rmail-output} which saves in Unix mailbox format.
977
978 @item message-courtesy-message
979 @vindex message-courtesy-message
980 When sending combined messages, this string is inserted at the start of
981 the mailed copy.  If the string contains the format spec @samp{%s}, the
982 newsgroups the article has been posted to will be inserted there.  If
983 this variable is @code{nil}, no such courtesy message will be added.
984 The default value is @samp{"The following message is a courtesy copy of
985 an article\nthat has been posted to %s as well.\n\n"}. 
986
987 @end table
988
989
990 @node Message Buffers
991 @section Message Buffers
992
993 Message will generate new buffers with unique buffer names when you
994 request a message buffer.  When you send the message, the buffer isn't
995 normally killed off.  Its name is changed and a certain number of old
996 message buffers are kept alive.
997
998 @table @code
999 @item message-generate-new-buffers
1000 @vindex message-generate-new-buffers
1001 If non-@code{nil}, generate new buffers.  The default is @code{t}.  If
1002 this is a function, call that function with three parameters: The type,
1003 the to address and the group name.  (Any of these may be @code{nil}.)
1004 The function should return the new buffer name.
1005
1006 @item message-max-buffers
1007 @vindex message-max-buffers
1008 This variable says how many old message buffers to keep.  If there are
1009 more message buffers than this, the oldest buffer will be killed.  The
1010 default is 10.  If this variable is @code{nil}, no old message buffers
1011 will ever be killed.
1012
1013 @item message-send-rename-function
1014 @vindex message-send-rename-function
1015 After sending a message, the buffer is renamed from, for instance,
1016 @samp{*reply to Lars*} to @samp{*sent reply to Lars*}.  If you don't
1017 like this, set this variable to a function that renames the buffer in a
1018 manner you like.  If you don't want to rename the buffer at all, you can
1019 say:
1020
1021 @lisp
1022 (setq message-send-rename-function 'ignore)
1023 @end lisp
1024
1025 @item message-kill-buffer-on-exit
1026 @findex message-kill-buffer-on-exit
1027 If non-@code{nil}, kill the buffer immediately on exit.
1028
1029 @end table
1030
1031
1032 @node Message Actions
1033 @section Message Actions
1034
1035 When Message is being used from a news/mail reader, the reader is likely
1036 to want to perform some task after the message has been sent.  Perhaps
1037 return to the previous window configuration or mark an article as
1038 replied.  
1039
1040 @vindex message-kill-actions
1041 @vindex message-postpone-actions
1042 @vindex message-exit-actions
1043 @vindex message-send-actions
1044 The user may exit from the message buffer in various ways.  The most
1045 common is @kbd{C-c C-c}, which sends the message and exits.  Other
1046 possibilities are @kbd{C-c C-s} which just sends the message, @kbd{C-c
1047 C-d} which postpones the message editing and buries the message buffer,
1048 and @kbd{C-c C-k} which kills the message buffer.  Each of these actions
1049 have lists associated with them that contains actions to be executed:
1050 @code{message-send-actions}, @code{message-exit-actions},
1051 @code{message-postpone-actions}, and @code{message-kill-actions}.  
1052
1053 Message provides a function to interface with these lists:
1054 @code{message-add-action}.  The first parameter is the action to be
1055 added, and the rest of the arguments are which lists to add this action
1056 to.  Here's an example from Gnus:
1057
1058 @lisp
1059   (message-add-action
1060    `(set-window-configuration ,(current-window-configuration))
1061    'exit 'postpone 'kill)
1062 @end lisp
1063
1064 This restores the Gnus window configuration when the message buffer is
1065 killed, postponed or exited.
1066
1067 An @dfn{action} can be either: a normal function, or a list where the
1068 @code{car} is a function and the @code{cdr} is the list of arguments, or
1069 a form to be @code{eval}ed.
1070
1071
1072 @node Compatibility
1073 @chapter Compatibility
1074 @cindex compatibility
1075
1076 Message uses virtually only its own variables---older @code{mail-}
1077 variables aren't consulted.  To force Message to take those variables
1078 into account, you can put the following in your @code{.emacs} file:
1079
1080 @lisp
1081 (require 'messcompat)
1082 @end lisp
1083
1084 This will initialize many Message variables from the values in the
1085 corresponding mail variables.
1086
1087
1088
1089 @node Index
1090 @chapter Index
1091 @printindex cp
1092
1093 @node Key Index
1094 @chapter Key Index
1095 @printindex ky
1096
1097 @summarycontents
1098 @contents
1099 @bye
1100
1101 @c End: