1 ;;; message.el --- composing mail and news messages
3 ;; Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
4 ;; 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
6 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
7 ;; Keywords: mail, news
9 ;; This file is part of GNU Emacs.
11 ;; GNU Emacs is free software: you can redistribute it and/or modify
12 ;; it under the terms of the GNU General Public License as published by
13 ;; the Free Software Foundation, either version 3 of the License, or
14 ;; (at your option) any later version.
16 ;; GNU Emacs is distributed in the hope that it will be useful,
17 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 ;; GNU General Public License for more details.
21 ;; You should have received a copy of the GNU General Public License
22 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
26 ;; This mode provides mail-sending facilities from within Emacs. It
27 ;; consists mainly of large chunks of code from the sendmail.el,
28 ;; gnus-msg.el and rnewspost.el files.
32 ;; For Emacs <22.2 and XEmacs.
34 (unless (fboundp 'declare-function) (defmacro declare-function (&rest r))))
41 ;; Only for the trivial macros mail-header-from, mail-header-date
42 ;; mail-header-references, mail-header-subject, mail-header-id
43 (eval-when-compile (require 'nnheader))
44 ;; This is apparently necessary even though things are autoloaded.
45 ;; Because we dynamically bind mail-abbrev-mode-regexp, we'd better
46 ;; require mailabbrev here.
47 (if (featurep 'xemacs)
48 (require 'mail-abbrevs)
49 (require 'mailabbrev))
54 (autoload 'mailclient-send-it "mailclient") ;; Emacs 22 or contrib/
56 (defvar gnus-message-group-art)
57 (defvar gnus-list-identifiers) ; gnus-sum is required where necessary
58 (defvar rmail-enable-mime-composing)
60 (defgroup message '((user-mail-address custom-variable)
61 (user-full-name custom-variable))
62 "Mail and news message composing."
63 :link '(custom-manual "(message)Top")
67 (put 'user-mail-address 'custom-type 'string)
68 (put 'user-full-name 'custom-type 'string)
70 (defgroup message-various nil
71 "Various Message Variables."
72 :link '(custom-manual "(message)Various Message Variables")
75 (defgroup message-buffers nil
77 :link '(custom-manual "(message)Message Buffers")
80 (defgroup message-sending nil
82 :link '(custom-manual "(message)Sending Variables")
85 (defgroup message-interface nil
87 :link '(custom-manual "(message)Interface")
90 (defgroup message-forwarding nil
92 :link '(custom-manual "(message)Forwarding")
93 :group 'message-interface)
95 (defgroup message-insertion nil
97 :link '(custom-manual "(message)Insertion")
100 (defgroup message-headers nil
102 :link '(custom-manual "(message)Message Headers")
105 (defgroup message-news nil
106 "Composing News Messages."
109 (defgroup message-mail nil
110 "Composing Mail Messages."
113 (defgroup message-faces nil
114 "Faces used for message composing."
118 (defcustom message-directory "~/Mail/"
119 "*Directory from which all other mail file variables are derived."
120 :group 'message-various
123 (defcustom message-max-buffers 10
124 "*How many buffers to keep before starting to kill them off."
125 :group 'message-buffers
128 (defcustom message-send-rename-function nil
129 "Function called to rename the buffer after sending it."
130 :group 'message-buffers
131 :type '(choice function (const nil)))
133 (defcustom message-fcc-handler-function 'message-output
134 "*A function called to save outgoing articles.
135 This function will be called with the name of the file to store the
136 article in. The default function is `message-output' which saves in Unix
138 :type '(radio (function-item message-output)
139 (function :tag "Other"))
140 :group 'message-sending)
142 (defcustom message-fcc-externalize-attachments nil
143 "If non-nil, attachments are included as external parts in Fcc copies."
146 :group 'message-sending)
148 (defcustom message-courtesy-message
149 "The following message is a courtesy copy of an article\nthat has been posted to %s as well.\n\n"
150 "*This is inserted at the start of a mailed copy of a posted message.
151 If the string contains the format spec \"%s\", the Newsgroups
152 the article has been posted to will be inserted there.
153 If this variable is nil, no such courtesy message will be added."
154 :group 'message-sending
155 :type '(radio string (const nil)))
157 (defcustom message-ignored-bounced-headers
158 "^\\(Received\\|Return-Path\\|Delivered-To\\):"
159 "*Regexp that matches headers to be removed in resent bounced mail."
160 :group 'message-interface
163 (defcustom message-from-style 'default
164 ;; In Emacs 24.1 this defaults to the value of `mail-from-style'
166 ;; `angles' in Emacs 22.1~23.1, XEmacs 21.4, 21.5, and SXEmacs 22.1;
167 ;; `default' in Emacs 23.2, and 24.1
168 "*Specifies how \"From\" headers look.
170 If nil, they contain just the return address like:
172 If `parens', they look like:
173 king@grassland.com (Elvis Parsley)
174 If `angles', they look like:
175 Elvis Parsley <king@grassland.com>
177 Otherwise, most addresses look like `angles', but they look like
178 `parens' if `angles' would need quoting and `parens' would not."
180 :type '(choice (const :tag "simple" nil)
184 :group 'message-headers)
186 (defcustom message-insert-canlock t
187 "Whether to insert a Cancel-Lock header in news postings."
189 :group 'message-headers
192 (defcustom message-syntax-checks
193 (if message-insert-canlock '((sender . disabled)) nil)
194 ;; Guess this one shouldn't be easy to customize...
195 "*Controls what syntax checks should not be performed on outgoing posts.
196 To disable checking of long signatures, for instance, add
197 `(signature . disabled)' to this list.
199 Don't touch this variable unless you really know what you're doing.
201 Checks include `approved', `bogus-recipient', `continuation-headers',
202 `control-chars', `empty', `existing-newsgroups', `from', `illegible-text',
203 `invisible-text', `long-header-lines', `long-lines', `message-id',
204 `multiple-headers', `new-text', `newsgroups', `quoting-style',
205 `repeated-newsgroups', `reply-to', `sender', `sendsys', `shoot',
206 `shorten-followup-to', `signature', `size', `subject', `subject-cmsg'
207 and `valid-newsgroups'."
209 :type '(repeat sexp)) ; Fixme: improve this
211 (defcustom message-required-headers '((optional . References)
213 "*Headers to be generated or prompted for when sending a message.
214 Also see `message-required-news-headers' and
215 `message-required-mail-headers'."
218 :group 'message-headers
219 :link '(custom-manual "(message)Message Headers")
220 :type '(repeat sexp))
222 (defcustom message-draft-headers '(References From Date)
223 "*Headers to be generated when saving a draft message."
226 :group 'message-headers
227 :link '(custom-manual "(message)Message Headers")
228 :type '(repeat sexp))
230 (defcustom message-required-news-headers
231 '(From Newsgroups Subject Date Message-ID
232 (optional . Organization)
233 (optional . User-Agent))
234 "*Headers to be generated or prompted for when posting an article.
235 RFC977 and RFC1036 require From, Date, Newsgroups, Subject,
236 Message-ID. Organization, Lines, In-Reply-To, Expires, and
237 User-Agent are optional. If you don't want message to insert some
238 header, remove it from this list."
240 :group 'message-headers
241 :link '(custom-manual "(message)Message Headers")
242 :type '(repeat sexp))
244 (defcustom message-required-mail-headers
245 '(From Subject Date (optional . In-Reply-To) Message-ID
246 (optional . User-Agent))
247 "*Headers to be generated or prompted for when mailing a message.
248 It is recommended that From, Date, To, Subject and Message-ID be
249 included. Organization and User-Agent are optional."
251 :group 'message-headers
252 :link '(custom-manual "(message)Message Headers")
253 :type '(repeat sexp))
255 (defcustom message-prune-recipient-rules nil
256 "Rules for how to prune the list of recipients when doing wide replies.
257 This is a list of regexps and regexp matches."
260 :group 'message-headers
261 :link '(custom-manual "(message)Wide Reply")
262 :type '(repeat regexp))
264 (defcustom message-deletable-headers '(Message-ID Date Lines)
265 "Headers to be deleted if they already exist and were generated by message previously."
266 :group 'message-headers
267 :link '(custom-manual "(message)Message Headers")
270 (defcustom message-ignored-news-headers
271 "^NNTP-Posting-Host:\\|^Xref:\\|^[BGF]cc:\\|^Resent-Fcc:\\|^X-Draft-From:\\|^X-Gnus-Agent-Meta-Information:"
272 "*Regexp of headers to be removed unconditionally before posting."
274 :group 'message-headers
275 :link '(custom-manual "(message)Message Headers")
276 :type '(repeat :value-to-internal (lambda (widget value)
277 (custom-split-regexp-maybe value))
278 :match (lambda (widget value)
280 (widget-editable-list-match widget value)))
283 (defcustom message-ignored-mail-headers
284 "^[GF]cc:\\|^Resent-Fcc:\\|^Xref:\\|^X-Draft-From:\\|^X-Gnus-Agent-Meta-Information:"
285 "*Regexp of headers to be removed unconditionally before mailing."
287 :group 'message-headers
288 :link '(custom-manual "(message)Mail Headers")
291 (defcustom message-ignored-supersedes-headers "^Path:\\|^Date\\|^NNTP-Posting-Host:\\|^Xref:\\|^Lines:\\|^Received:\\|^X-From-Line:\\|^X-Trace:\\|^X-ID:\\|^X-Complaints-To:\\|Return-Path:\\|^Supersedes:\\|^NNTP-Posting-Date:\\|^X-Trace:\\|^X-Complaints-To:\\|^Cancel-Lock:\\|^Cancel-Key:\\|^X-Hashcash:\\|^X-Payment:\\|^Approved:\\|^Injection-Date:\\|^Injection-Info:"
292 "*Header lines matching this regexp will be deleted before posting.
293 It's best to delete old Path and Date headers before posting to avoid
295 :group 'message-interface
296 :link '(custom-manual "(message)Superseding")
297 :type '(repeat :value-to-internal (lambda (widget value)
298 (custom-split-regexp-maybe value))
299 :match (lambda (widget value)
301 (widget-editable-list-match widget value)))
304 (defcustom message-subject-re-regexp
305 "^[ \t]*\\([Rr][Ee]\\(\\[[0-9]*\\]\\)*:[ \t]*\\)*[ \t]*"
306 "*Regexp matching \"Re: \" in the subject line."
307 :group 'message-various
308 :link '(custom-manual "(message)Message Headers")
311 ;;; Start of variables adopted from `message-utils.el'.
313 (defcustom message-subject-trailing-was-query 'ask
314 "*What to do with trailing \"(was: <old subject>)\" in subject lines.
315 If nil, leave the subject unchanged. If it is the symbol `ask', query
316 the user what do do. In this case, the subject is matched against
317 `message-subject-trailing-was-ask-regexp'. If
318 `message-subject-trailing-was-query' is t, always strip the trailing
319 old subject. In this case, `message-subject-trailing-was-regexp' is
322 :type '(choice (const :tag "never" nil)
323 (const :tag "always strip" t)
325 :link '(custom-manual "(message)Message Headers")
326 :group 'message-various)
328 (defcustom message-subject-trailing-was-ask-regexp
329 "[ \t]*\\([[(]+[Ww][Aa][Ss][ \t]*.*[\])]+\\)"
330 "*Regexp matching \"(was: <old subject>)\" in the subject line.
332 The function `message-strip-subject-trailing-was' uses this regexp if
333 `message-subject-trailing-was-query' is set to the symbol `ask'. If
334 the variable is t instead of `ask', use
335 `message-subject-trailing-was-regexp' instead.
337 It is okay to create some false positives here, as the user is asked."
339 :group 'message-various
340 :link '(custom-manual "(message)Message Headers")
343 (defcustom message-subject-trailing-was-regexp
344 "[ \t]*\\((*[Ww][Aa][Ss]:[ \t]*.*)\\)"
345 "*Regexp matching \"(was: <old subject>)\" in the subject line.
347 If `message-subject-trailing-was-query' is set to t, the subject is
348 matched against `message-subject-trailing-was-regexp' in
349 `message-strip-subject-trailing-was'. You should use a regexp creating very
350 few false positives here."
352 :group 'message-various
353 :link '(custom-manual "(message)Message Headers")
356 ;;; marking inserted text
358 (defcustom message-mark-insert-begin
359 "--8<---------------cut here---------------start------------->8---\n"
360 "How to mark the beginning of some inserted text."
363 :link '(custom-manual "(message)Insertion Variables")
364 :group 'message-various)
366 (defcustom message-mark-insert-end
367 "--8<---------------cut here---------------end--------------->8---\n"
368 "How to mark the end of some inserted text."
371 :link '(custom-manual "(message)Insertion Variables")
372 :group 'message-various)
374 (defcustom message-archive-header "X-No-Archive: Yes\n"
375 "Header to insert when you don't want your article to be archived.
376 Archives \(such as groups.google.com\) respect this header."
379 :link '(custom-manual "(message)Header Commands")
380 :group 'message-various)
382 (defcustom message-archive-note
383 "X-No-Archive: Yes - save http://groups.google.com/"
384 "Note to insert why you wouldn't want this posting archived.
385 If nil, don't insert any text in the body."
387 :type '(radio string (const nil))
388 :link '(custom-manual "(message)Header Commands")
389 :group 'message-various)
391 ;;; Crossposts and Followups
392 ;; inspired by JoH-followup-to by Jochem Huhman <joh at gmx.de>
393 ;; new suggestions by R. Weikusat <rw at another.de>
395 (defvar message-cross-post-old-target nil
396 "Old target for cross-posts or follow-ups.")
397 (make-variable-buffer-local 'message-cross-post-old-target)
399 (defcustom message-cross-post-default t
400 "When non-nil `message-cross-post-followup-to' will perform a crosspost.
401 If nil, `message-cross-post-followup-to' will only do a followup. Note that
402 you can explicitly override this setting by calling
403 `message-cross-post-followup-to' with a prefix."
406 :group 'message-various)
408 (defcustom message-cross-post-note "Crosspost & Followup-To: "
409 "Note to insert before signature to notify of cross-post and follow-up."
412 :group 'message-various)
414 (defcustom message-followup-to-note "Followup-To: "
415 "Note to insert before signature to notify of follow-up only."
418 :group 'message-various)
420 (defcustom message-cross-post-note-function 'message-cross-post-insert-note
421 "Function to use to insert note about Crosspost or Followup-To.
422 The function will be called with four arguments. The function should not only
423 insert a note, but also ensure old notes are deleted. See the documentation
424 for `message-cross-post-insert-note'."
427 :group 'message-various)
429 ;;; End of variables adopted from `message-utils.el'.
431 (defcustom message-signature-separator "^-- $"
432 "Regexp matching the signature separator.
433 This variable is used to strip off the signature from quoted text
434 when `message-cite-function' is
435 `message-cite-original-without-signature'. Most useful values
436 are \"^-- $\" (strict) and \"^-- *$\" (loose; allow missing
438 :type '(choice (const :tag "strict" "^-- $")
439 (const :tag "loose" "^-- *$")
441 :version "22.3" ;; Gnus 5.10.12 (changed default)
442 :link '(custom-manual "(message)Various Message Variables")
443 :group 'message-various)
445 (defcustom message-elide-ellipsis "\n[...]\n\n"
446 "*The string which is inserted for elided text."
448 :link '(custom-manual "(message)Various Commands")
449 :group 'message-various)
451 (defcustom message-interactive t
452 ;; In Emacs 24.1 this defaults to the value of `mail-interactive'
454 ;; `nil' in Emacs 22.1~22.3, XEmacs 21.4, 21.5, and SXEmacs 22.1;
455 ;; `t' in Emacs 23.1~24.1
456 "Non-nil means when sending a message wait for and display errors.
457 A value of nil means let mailer mail back a message to report errors."
459 :group 'message-sending
461 :link '(custom-manual "(message)Sending Variables")
464 (defcustom message-confirm-send nil
465 "When non-nil, ask for confirmation when sending a message."
466 :group 'message-sending
468 :version "23.1" ;; No Gnus
469 :link '(custom-manual "(message)Sending Variables")
472 (defcustom message-generate-new-buffers 'unsent
473 "*Say whether to create a new message buffer to compose a message.
474 Valid values include:
477 Generate the buffer name in the Message way (e.g., *mail*, *news*,
478 *mail to whom*, *news on group*, etc.) and continue editing in the
479 existing buffer of that name. If there is no such buffer, it will
483 Create the new buffer with the name generated in the Message way.
486 Similar to `unique' but the buffer name begins with \"*unsent \".
489 Similar to nil but the buffer name is simpler like *mail message*.
492 If this is a function, call that function with three parameters:
493 The type, the To address and the group name (any of these may be nil).
494 The function should return the new buffer name."
496 :group 'message-buffers
497 :link '(custom-manual "(message)Message Buffers")
498 :type '(choice (const nil)
499 (sexp :tag "unique" :format "unique\n" :value unique
500 :match (lambda (widget value) (memq value '(unique t))))
503 (function :format "\n %{%t%}: %v")))
505 (defcustom message-kill-buffer-on-exit nil
506 "*Non-nil means that the message buffer will be killed after sending a message."
507 :group 'message-buffers
508 :link '(custom-manual "(message)Message Buffers")
511 (defcustom message-kill-buffer-query t
512 "*Non-nil means that killing a modified message buffer has to be confirmed.
513 This is used by `message-kill-buffer'."
514 :version "23.1" ;; No Gnus
515 :group 'message-buffers
518 (defvar gnus-local-organization)
519 (defcustom message-user-organization
520 (or (and (boundp 'gnus-local-organization)
521 (stringp gnus-local-organization)
522 gnus-local-organization)
523 (getenv "ORGANIZATION")
525 "*String to be used as an Organization header.
526 If t, use `message-user-organization-file'."
527 :group 'message-headers
528 :type '(choice string
529 (const :tag "consult file" t)))
531 (defcustom message-user-organization-file
533 (dolist (f (list "/etc/organization"
534 "/etc/news/organization"
535 "/usr/lib/news/organization"))
536 (when (file-readable-p f)
539 "*Local news organization file."
541 :link '(custom-manual "(message)News Headers")
542 :group 'message-headers)
544 (defcustom message-make-forward-subject-function
545 #'message-forward-subject-name-subject
546 "*List of functions called to generate subject headers for forwarded messages.
547 The subject generated by the previous function is passed into each
550 The provided functions are:
552 * `message-forward-subject-author-subject' Source of article (author or
553 newsgroup), in brackets followed by the subject
554 * `message-forward-subject-name-subject' Source of article (name of author
555 or newsgroup), in brackets followed by the subject
556 * `message-forward-subject-fwd' Subject of article with 'Fwd:' prepended
558 :group 'message-forwarding
559 :link '(custom-manual "(message)Forwarding")
560 :type '(radio (function-item message-forward-subject-author-subject)
561 (function-item message-forward-subject-fwd)
562 (function-item message-forward-subject-name-subject)
563 (repeat :tag "List of functions" function)))
565 (defcustom message-forward-as-mime t
566 "*Non-nil means forward messages as an inline/rfc822 MIME section.
567 Otherwise, directly inline the old message in the forwarded message."
569 :group 'message-forwarding
570 :link '(custom-manual "(message)Forwarding")
573 (defcustom message-forward-show-mml 'best
574 "*Non-nil means show forwarded messages as MML (decoded from MIME).
575 Otherwise, forwarded messages are unchanged.
576 Can also be the symbol `best' to indicate that MML should be
577 used, except when it is a bad idea to use MML. One example where
578 it is a bad idea is when forwarding a signed or encrypted
579 message, because converting MIME to MML would invalidate the
582 :group 'message-forwarding
583 :type '(choice (const :tag "use MML" t)
584 (const :tag "don't use MML " nil)
585 (const :tag "use MML when appropriate" best)))
587 (defcustom message-forward-before-signature t
588 "*Non-nil means put forwarded message before signature, else after."
589 :group 'message-forwarding
592 (defcustom message-wash-forwarded-subjects nil
593 "*Non-nil means try to remove as much cruft as possible from the subject.
594 Done before generating the new subject of a forward."
595 :group 'message-forwarding
596 :link '(custom-manual "(message)Forwarding")
599 (defcustom message-ignored-resent-headers
600 ;; `Delivered-To' needs to be removed because some mailers use it to
601 ;; detect loops, so if you resend a message to an address that ultimately
602 ;; comes back to you (e.g. a mailing-list to which you subscribe, in which
603 ;; case you may be removed from the list on the grounds that mail to you
604 ;; bounced with a "mailing loop" error).
605 "^Return-receipt\\|^X-Gnus\\|^Gnus-Warning:\\|^>?From \\|^Delivered-To:"
606 "*All headers that match this regexp will be deleted when resending a message."
607 :group 'message-interface
608 :link '(custom-manual "(message)Resending")
609 :type '(repeat :value-to-internal (lambda (widget value)
610 (custom-split-regexp-maybe value))
611 :match (lambda (widget value)
613 (widget-editable-list-match widget value)))
616 (defcustom message-forward-ignored-headers "^Content-Transfer-Encoding:\\|^X-Gnus"
617 "*All headers that match this regexp will be deleted when forwarding a message."
619 :group 'message-forwarding
620 :type '(repeat :value-to-internal (lambda (widget value)
621 (custom-split-regexp-maybe value))
622 :match (lambda (widget value)
624 (widget-editable-list-match widget value)))
627 (defcustom message-ignored-cited-headers "."
628 "*Delete these headers from the messages you yank."
629 :group 'message-insertion
630 :link '(custom-manual "(message)Insertion Variables")
633 (defcustom message-cite-prefix-regexp
634 ;; In Emacs 24.1 this defaults to the value of
635 ;; `mail-citation-prefix-regexp'; the default value varies according
636 ;; to the Emacs version. In XEmacs 21.4 and 21.5, sendmail.el
638 (if (string-match "[[:digit:]]" "1")
639 ;; Support POSIX? XEmacs 21.5.27 doesn't.
640 "\\([ \t]*[_.[:word:]]+>+\\|[ \t]*[]>|]\\)+"
641 ;; ?-, ?_ or ?. MUST NOT be in syntax entry w.
642 (let (non-word-constituents)
643 (with-syntax-table text-mode-syntax-table
644 (setq non-word-constituents
646 (if (string-match "\\w" "_") "" "_")
647 (if (string-match "\\w" ".") "" "."))))
648 (if (equal non-word-constituents "")
649 "\\([ \t]*\\(\\w\\)+>+\\|[ \t]*[]>|]\\)+"
650 (concat "\\([ \t]*\\(\\w\\|["
651 non-word-constituents
652 "]\\)+>+\\|[ \t]*[]>|]\\)+"))))
653 "*Regexp matching the longest possible citation prefix on a line."
655 :group 'message-insertion
656 :link '(custom-manual "(message)Insertion Variables")
658 :set (lambda (symbol value)
660 (custom-set-default symbol value)
661 (if (boundp 'gnus-message-cite-prefix-regexp)
662 (setq gnus-message-cite-prefix-regexp
663 (concat "^\\(?:" value "\\)"))))))
665 (defcustom message-cancel-message "I am canceling my own article.\n"
666 "Message to be inserted in the cancel message."
667 :group 'message-interface
668 :link '(custom-manual "(message)Canceling News")
671 (defun message-send-mail-function ()
672 "Return suitable value for the variable `message-send-mail-function'."
673 (cond ((and (require 'sendmail)
674 (boundp 'sendmail-program)
676 (executable-find sendmail-program))
677 'message-send-mail-with-sendmail)
678 ((and (locate-library "smtpmail")
679 (boundp 'smtpmail-default-smtp-server)
680 smtpmail-default-smtp-server)
681 'message-smtpmail-send-it)
682 ((locate-library "mailclient")
683 'message-send-mail-with-mailclient)
685 (error "Don't know how to send mail. Please customize `message-send-mail-function'"))))
687 ;; Useful to set in site-init.el
688 (defcustom message-send-mail-function
689 (cond ((eq send-mail-function 'smtpmail-send-it) 'message-smtpmail-send-it)
690 ((eq send-mail-function 'feedmail-send-it) 'feedmail-send-it)
691 ((eq send-mail-function 'mailclient-send-it)
692 'message-send-mail-with-mailclient)
693 (t (message-send-mail-function)))
694 "Function to call to send the current buffer as mail.
695 The headers should be delimited by a line whose contents match the
696 variable `mail-header-separator'.
698 Valid values include `message-send-mail-with-sendmail'
699 `message-send-mail-with-mh', `message-send-mail-with-qmail',
700 `message-smtpmail-send-it', `smtpmail-send-it',
701 `feedmail-send-it' and `message-send-mail-with-mailclient'. The
702 default is system dependent and determined by the function
703 `message-send-mail-function'.
705 See also `send-mail-function'."
706 :type '(radio (function-item message-send-mail-with-sendmail)
707 (function-item message-send-mail-with-mh)
708 (function-item message-send-mail-with-qmail)
709 (function-item message-smtpmail-send-it)
710 (function-item smtpmail-send-it)
711 (function-item feedmail-send-it)
712 (function-item message-send-mail-with-mailclient
713 :tag "Use Mailclient package")
714 (function :tag "Other"))
715 :group 'message-sending
717 :initialize 'custom-initialize-default
718 :link '(custom-manual "(message)Mail Variables")
719 :group 'message-mail)
721 (defcustom message-send-news-function 'message-send-news
722 "Function to call to send the current buffer as news.
723 The headers should be delimited by a line whose contents match the
724 variable `mail-header-separator'."
725 :group 'message-sending
727 :link '(custom-manual "(message)News Variables")
730 (defcustom message-reply-to-function nil
731 "If non-nil, function that should return a list of headers.
732 This function should pick out addresses from the To, Cc, and From headers
733 and respond with new To and Cc headers."
734 :group 'message-interface
735 :link '(custom-manual "(message)Reply")
736 :type '(choice function (const nil)))
738 (defcustom message-wide-reply-to-function nil
739 "If non-nil, function that should return a list of headers.
740 This function should pick out addresses from the To, Cc, and From headers
741 and respond with new To and Cc headers."
742 :group 'message-interface
743 :link '(custom-manual "(message)Wide Reply")
744 :type '(choice function (const nil)))
746 (defcustom message-followup-to-function nil
747 "If non-nil, function that should return a list of headers.
748 This function should pick out addresses from the To, Cc, and From headers
749 and respond with new To and Cc headers."
750 :group 'message-interface
751 :link '(custom-manual "(message)Followup")
752 :type '(choice function (const nil)))
754 (defcustom message-extra-wide-headers nil
755 "If non-nil, a list of additional address headers.
756 These are used when composing a wide reply."
757 :group 'message-sending
758 :type '(repeat string))
760 (defcustom message-use-followup-to 'ask
761 "*Specifies what to do with Followup-To header.
762 If nil, always ignore the header. If it is t, use its value, but
763 query before using the \"poster\" value. If it is the symbol `ask',
764 always query the user whether to use the value. If it is the symbol
765 `use', always use the value."
766 :group 'message-interface
767 :link '(custom-manual "(message)Followup")
768 :type '(choice (const :tag "ignore" nil)
769 (const :tag "use & query" t)
773 (defcustom message-use-mail-followup-to 'use
774 "*Specifies what to do with Mail-Followup-To header.
775 If nil, always ignore the header. If it is the symbol `ask', always
776 query the user whether to use the value. If it is the symbol `use',
777 always use the value."
779 :group 'message-interface
780 :link '(custom-manual "(message)Mailing Lists")
781 :type '(choice (const :tag "ignore" nil)
785 (defcustom message-subscribed-address-functions nil
786 "*Specifies functions for determining list subscription.
787 If nil, do not attempt to determine list subscription with functions.
788 If non-nil, this variable contains a list of functions which return
789 regular expressions to match lists. These functions can be used in
790 conjunction with `message-subscribed-regexps' and
791 `message-subscribed-addresses'."
793 :group 'message-interface
794 :link '(custom-manual "(message)Mailing Lists")
795 :type '(repeat sexp))
797 (defcustom message-subscribed-address-file nil
798 "*A file containing addresses the user is subscribed to.
799 If nil, do not look at any files to determine list subscriptions. If
800 non-nil, each line of this file should be a mailing list address."
802 :group 'message-interface
803 :link '(custom-manual "(message)Mailing Lists")
804 :type '(radio file (const nil)))
806 (defcustom message-subscribed-addresses nil
807 "*Specifies a list of addresses the user is subscribed to.
808 If nil, do not use any predefined list subscriptions. This list of
809 addresses can be used in conjunction with
810 `message-subscribed-address-functions' and `message-subscribed-regexps'."
812 :group 'message-interface
813 :link '(custom-manual "(message)Mailing Lists")
814 :type '(repeat string))
816 (defcustom message-subscribed-regexps nil
817 "*Specifies a list of addresses the user is subscribed to.
818 If nil, do not use any predefined list subscriptions. This list of
819 regular expressions can be used in conjunction with
820 `message-subscribed-address-functions' and `message-subscribed-addresses'."
822 :group 'message-interface
823 :link '(custom-manual "(message)Mailing Lists")
824 :type '(repeat regexp))
826 (defcustom message-allow-no-recipients 'ask
827 "Specifies what to do when there are no recipients other than Gcc/Fcc.
828 If it is the symbol `always', the posting is allowed. If it is the
829 symbol `never', the posting is not allowed. If it is the symbol
830 `ask', you are prompted."
832 :group 'message-interface
833 :link '(custom-manual "(message)Message Headers")
834 :type '(choice (const always)
838 (defcustom message-sendmail-f-is-evil nil
839 "*Non-nil means don't add \"-f username\" to the sendmail command line.
840 Doing so would be even more evil than leaving it out."
841 :group 'message-sending
842 :link '(custom-manual "(message)Mail Variables")
845 (defcustom message-sendmail-envelope-from nil
846 ;; In Emacs 24.1 this defaults to the value of `mail-envelope-from'
847 ;; if it is available, or defaults to nil. sendmail.el provides it;
848 ;; the default value is nil in all (X)Emacsen that Gnus supports.
849 "*Envelope-from when sending mail with sendmail.
850 If this is nil, use `user-mail-address'. If it is the symbol
851 `header', use the From: header of the message."
853 :type '(choice (string :tag "From name")
854 (const :tag "Use From: header from message" header)
855 (const :tag "Use `user-mail-address'" nil))
856 :link '(custom-manual "(message)Mail Variables")
857 :group 'message-sending)
859 (defcustom message-sendmail-extra-arguments nil
860 "Additional arguments to `sendmail-program'."
861 ;; E.g. '("-a" "account") for msmtp
862 :version "23.1" ;; No Gnus
863 :type '(repeat string)
864 ;; :link '(custom-manual "(message)Mail Variables")
865 :group 'message-sending)
867 ;; qmail-related stuff
868 (defcustom message-qmail-inject-program "/var/qmail/bin/qmail-inject"
869 "Location of the qmail-inject program."
870 :group 'message-sending
871 :link '(custom-manual "(message)Mail Variables")
874 (defcustom message-qmail-inject-args nil
875 "Arguments passed to qmail-inject programs.
876 This should be a list of strings, one string for each argument.
877 It may also be a function.
879 For e.g., if you wish to set the envelope sender address so that bounces
880 go to the right place or to deal with listserv's usage of that address, you
881 might set this variable to '(\"-f\" \"you@some.where\")."
882 :group 'message-sending
883 :link '(custom-manual "(message)Mail Variables")
884 :type '(choice (function)
887 (defvar gnus-post-method)
888 (defvar gnus-select-method)
889 (defcustom message-post-method
890 (cond ((and (boundp 'gnus-post-method)
891 (listp gnus-post-method)
894 ((boundp 'gnus-select-method)
897 "*Method used to post news.
898 Note that when posting from inside Gnus, for instance, this
899 variable isn't used."
901 :group 'message-sending
902 ;; This should be the `gnus-select-method' widget, but that might
903 ;; create a dependence to `gnus.el'.
906 ;; FIXME: This should be a temporary workaround until someone implements a
907 ;; proper solution. If a crash happens while replying, the auto-save file
908 ;; will *not* have a `References:' header if `message-generate-headers-first'
909 ;; is nil. See: http://article.gmane.org/gmane.emacs.gnus.general/51138
910 (defcustom message-generate-headers-first '(references)
911 "Which headers should be generated before starting to compose a message.
912 If t, generate all required headers. This can also be a list of headers to
913 generate. The variables `message-required-news-headers' and
914 `message-required-mail-headers' specify which headers to generate.
916 Note that the variable `message-deletable-headers' specifies headers which
917 are to be deleted and then re-generated before sending, so this variable
918 will not have a visible effect for those headers."
919 :group 'message-headers
920 :link '(custom-manual "(message)Message Headers")
921 :type '(choice (const :tag "None" nil)
922 (const :tag "References" '(references))
924 (repeat (sexp :tag "Header"))))
926 (defcustom message-fill-column 72
927 "Column beyond which automatic line-wrapping should happen.
928 Local value for message buffers. If non-nil, also turn on
929 auto-fill in message buffers."
930 :group 'message-various
931 ;; :link '(custom-manual "(message)Message Headers")
932 :type '(choice (const :tag "Don't turn on auto fill" nil)
935 (defcustom message-setup-hook nil
936 "Normal hook, run each time a new outgoing message is initialized.
937 The function `message-setup' runs this hook."
938 :group 'message-various
939 :link '(custom-manual "(message)Various Message Variables")
942 (defcustom message-cancel-hook nil
943 "Hook run when cancelling articles."
944 :group 'message-various
945 :link '(custom-manual "(message)Various Message Variables")
948 (defcustom message-signature-setup-hook nil
949 "Normal hook, run each time a new outgoing message is initialized.
950 It is run after the headers have been inserted and before
951 the signature is inserted."
952 :group 'message-various
953 :link '(custom-manual "(message)Various Message Variables")
956 (defcustom message-mode-hook nil
957 "Hook run in message mode buffers."
958 :group 'message-various
961 (defcustom message-header-hook nil
962 "Hook run in a message mode buffer narrowed to the headers."
963 :group 'message-various
966 (defcustom message-header-setup-hook nil
967 "Hook called narrowed to the headers when setting up a message buffer."
968 :group 'message-various
969 :link '(custom-manual "(message)Various Message Variables")
972 (defcustom message-minibuffer-local-map
973 (let ((map (make-sparse-keymap 'message-minibuffer-local-map)))
974 (set-keymap-parent map minibuffer-local-map)
976 "Keymap for `message-read-from-minibuffer'."
978 :group 'message-various)
980 (defcustom message-citation-line-function 'message-insert-citation-line
981 "*Function called to insert the \"Whomever writes:\" line.
983 Predefined functions include `message-insert-citation-line' and
984 `message-insert-formatted-citation-line' (see the variable
985 `message-citation-line-format').
987 Note that Gnus provides a feature where the reader can click on
988 `writes:' to hide the cited text. If you change this line too much,
989 people who read your message will have to change their Gnus
990 configuration. See the variable `gnus-cite-attribution-suffix'."
992 (function-item :tag "plain" message-insert-citation-line)
993 (function-item :tag "formatted" message-insert-formatted-citation-line)
994 (function :tag "Other"))
995 :link '(custom-manual "(message)Insertion Variables")
996 :group 'message-insertion)
998 (defcustom message-citation-line-format "On %a, %b %d %Y, %N wrote:\n"
999 "Format of the \"Whomever writes:\" line.
1001 The string is formatted using `format-spec'. The following
1002 constructs are replaced:
1004 %f The full From, e.g. \"John Doe <john.doe@example.invalid>\".
1005 %n The mail address, e.g. \"john.doe@example.invalid\".
1006 %N The real name if present, e.g.: \"John Doe\", else fall
1007 back to the mail address.
1008 %F The first name if present, e.g.: \"John\".
1009 %L The last name if present, e.g.: \"Doe\".
1011 All other format specifiers are passed to `format-time-string'
1012 which is called using the date from the article your replying to.
1013 Extracting the first (%F) and last name (%L) is done
1014 heuristically, so you should always check it yourself.
1016 Please also read the note in the documentation of
1017 `message-citation-line-function'."
1018 :type '(choice (const :tag "Plain" "%f writes:")
1019 (const :tag "Include date" "On %a, %b %d %Y, %n wrote:")
1021 :link '(custom-manual "(message)Insertion Variables")
1022 :version "23.1" ;; No Gnus
1023 :group 'message-insertion)
1025 (defcustom message-yank-prefix "> "
1026 ;; In Emacs 24.1 this defaults to the value of `mail-yank-prefix'
1027 ;; that defaults to:
1028 ;; `nil' in Emacs 22.1~23.1;
1029 ;; "> " in Emacs 23.2, 24.1, XEmacs 21.4, 21.5, and SXEmacs 22.1
1030 "*Prefix inserted on the lines of yanked messages.
1031 Fix `message-cite-prefix-regexp' if it is set to an abnormal value.
1032 See also `message-yank-cited-prefix' and `message-yank-empty-prefix'."
1035 :link '(custom-manual "(message)Insertion Variables")
1036 :group 'message-insertion)
1038 (defcustom message-yank-cited-prefix ">"
1039 "*Prefix inserted on cited lines of yanked messages.
1040 Fix `message-cite-prefix-regexp' if it is set to an abnormal value.
1041 See also `message-yank-prefix' and `message-yank-empty-prefix'."
1044 :link '(custom-manual "(message)Insertion Variables")
1045 :group 'message-insertion)
1047 (defcustom message-yank-empty-prefix ">"
1048 "*Prefix inserted on empty lines of yanked messages.
1049 See also `message-yank-prefix' and `message-yank-cited-prefix'."
1052 :link '(custom-manual "(message)Insertion Variables")
1053 :group 'message-insertion)
1055 (defcustom message-indentation-spaces 3
1056 ;; In Emacs 24.1 this defaults to the value of
1057 ;; `mail-indentation-spaces' that defaults to `3' in Emacs 22.1~24.1,
1058 ;; and SXEmacs 22.1. In XEmacs 21.4 and 21.5, sendmail.el provides
1059 ;; it; the defalut value is `3'.
1060 "*Number of spaces to insert at the beginning of each cited line.
1061 Used by `message-yank-original' via `message-yank-cite'."
1063 :group 'message-insertion
1064 :link '(custom-manual "(message)Insertion Variables")
1067 (defcustom message-cite-function 'message-cite-original-without-signature
1068 "*Function for citing an original message.
1069 Predefined functions include `message-cite-original' and
1070 `message-cite-original-without-signature'.
1071 Note that these functions use `mail-citation-hook' if that is non-nil."
1072 :type '(radio (function-item message-cite-original)
1073 (function-item message-cite-original-without-signature)
1074 (function-item sc-cite-original)
1075 (function :tag "Other"))
1076 :link '(custom-manual "(message)Insertion Variables")
1077 :version "22.3" ;; Gnus 5.10.12 (changed default)
1078 :group 'message-insertion)
1080 (defcustom message-indent-citation-function 'message-indent-citation
1081 "*Function for modifying a citation just inserted in the mail buffer.
1082 This can also be a list of functions. Each function can find the
1083 citation between (point) and (mark t). And each function should leave
1084 point and mark around the citation text as modified."
1086 :link '(custom-manual "(message)Insertion Variables")
1087 :group 'message-insertion)
1089 (defcustom message-signature t
1090 ;; In Emacs 24.1 this defaults to the value of `mail-signature' that
1092 ;; `nil' in Emacs 22.1~23.1, XEmacs 21.4, 21.5, and SXEmacs 22.1;
1093 ;; `t' in Emacs 23.2, and 24.1
1094 "*String to be inserted at the end of the message buffer.
1095 If t, the `message-signature-file' file will be inserted instead.
1096 If a function, the result from the function will be used instead.
1097 If a form, the result from the form will be used instead."
1100 :link '(custom-manual "(message)Insertion Variables")
1101 :group 'message-insertion)
1103 (defcustom message-signature-file "~/.signature"
1104 ;; In Emacs 24.1 this defaults to the value of `mail-signature-file'
1105 ;; that defaults to "~/.signature" in Emacs 22.1~24.1, and SXEmacs
1106 ;; 22.1. In XEmacs 21.4 and 21.5, sendmail.el provides it;
1107 ;; the defalut value is "~/.signature".
1108 "*Name of file containing the text inserted at end of message buffer.
1109 Ignored if the named file doesn't exist.
1110 If nil, don't insert a signature.
1111 If a path is specified, the value of `message-signature-directory' is ignored,
1114 :type '(choice file (const :tags "None" nil))
1115 :link '(custom-manual "(message)Insertion Variables")
1116 :group 'message-insertion)
1118 (defcustom message-signature-directory nil
1119 "*Name of directory containing signature files.
1120 Comes in handy if you have many such files, handled via posting styles for
1122 If nil, `message-signature-file' is expected to specify the directory if
1124 :type '(choice string (const :tags "None" nil))
1125 :link '(custom-manual "(message)Insertion Variables")
1126 :group 'message-insertion)
1128 (defcustom message-signature-insert-empty-line t
1129 "*If non-nil, insert an empty line before the signature separator."
1132 :link '(custom-manual "(message)Insertion Variables")
1133 :group 'message-insertion)
1135 (defcustom message-distribution-function nil
1136 "*Function called to return a Distribution header."
1137 :group 'message-news
1138 :group 'message-headers
1139 :link '(custom-manual "(message)News Headers")
1140 :type '(choice function (const nil)))
1142 (defcustom message-expires 14
1143 "Number of days before your article expires."
1144 :group 'message-news
1145 :group 'message-headers
1146 :link '(custom-manual "(message)News Headers")
1149 (defcustom message-user-path nil
1150 "If nil, use the NNTP server name in the Path header.
1151 If stringp, use this; if non-nil, use no host name (user name only)."
1152 :group 'message-news
1153 :group 'message-headers
1154 :link '(custom-manual "(message)News Headers")
1155 :type '(choice (const :tag "nntp" nil)
1156 (string :tag "name")
1157 (sexp :tag "none" :format "%t" t)))
1159 ;; This can be the name of a buffer, or a cons cell (FUNCTION . ARGS)
1160 ;; for yanking the original buffer.
1161 (defvar message-reply-buffer nil)
1162 (defvar message-reply-headers nil
1163 "The headers of the current replied article.
1164 It is a vector of the following headers:
1165 \[number subject from date id references chars lines xref extra].")
1166 (defvar message-newsreader nil)
1167 (defvar message-mailer nil)
1168 (defvar message-sent-message-via nil)
1169 (defvar message-checksum nil)
1170 (defvar message-send-actions nil
1171 "A list of actions to be performed upon successful sending of a message.")
1172 (defvar message-exit-actions nil
1173 "A list of actions to be performed upon exiting after sending a message.")
1174 (defvar message-kill-actions nil
1175 "A list of actions to be performed before killing a message buffer.")
1176 (defvar message-postpone-actions nil
1177 "A list of actions to be performed after postponing a message.")
1179 (define-widget 'message-header-lines 'text
1180 "All header lines must be LFD terminated."
1181 :format "%{%t%}:%n%v"
1182 :valid-regexp "^\\'"
1183 :error "All header lines must be newline terminated")
1185 (defcustom message-default-headers ""
1186 "Header lines to be inserted in outgoing messages.
1187 This can be set to a string containing or a function returning
1188 header lines to be inserted before you edit the message, so you
1189 can edit or delete these lines. If set to a function, it is
1190 called and its result is inserted."
1192 :group 'message-headers
1193 :link '(custom-manual "(message)Message Headers")
1195 (message-header-lines :tag "String")
1196 (function :tag "Function")))
1198 (defcustom message-default-mail-headers
1199 ;; Ease the transition from mail-mode to message-mode. See bugs#4431, 5555.
1200 (concat (if (and (boundp 'mail-default-reply-to)
1201 (stringp mail-default-reply-to))
1202 (format "Reply-to: %s\n" mail-default-reply-to))
1203 (if (and (boundp 'mail-self-blind)
1205 (format "BCC: %s\n" user-mail-address))
1206 (if (and (boundp 'mail-archive-file-name)
1207 (stringp mail-archive-file-name))
1208 (format "FCC: %s\n" mail-archive-file-name))
1209 ;; Use the value of `mail-default-headers' if available.
1210 ;; Note: as for XEmacs 21.4 and 21.5, it is unavailable
1211 ;; unless sendmail.el is loaded.
1212 (if (boundp 'mail-default-headers)
1213 mail-default-headers))
1214 "*A string of header lines to be inserted in outgoing mails."
1216 :group 'message-headers
1217 :group 'message-mail
1218 :link '(custom-manual "(message)Mail Headers")
1219 :type 'message-header-lines)
1221 (defcustom message-default-news-headers ""
1222 "*A string of header lines to be inserted in outgoing news articles."
1223 :group 'message-headers
1224 :group 'message-news
1225 :link '(custom-manual "(message)News Headers")
1226 :type 'message-header-lines)
1228 ;; Note: could use /usr/ucb/mail instead of sendmail;
1229 ;; options -t, and -v if not interactive.
1230 (defcustom message-mailer-swallows-blank-line
1231 (if (and (string-match "sparc-sun-sunos\\(\\'\\|[^5]\\)"
1232 system-configuration)
1233 (file-readable-p "/etc/sendmail.cf")
1234 (let ((buffer (get-buffer-create " *temp*")))
1236 (with-current-buffer buffer
1237 (insert-file-contents "/etc/sendmail.cf")
1238 (goto-char (point-min))
1239 (let ((case-fold-search nil))
1240 (re-search-forward "^OR\\>" nil t)))
1241 (kill-buffer buffer))))
1242 ;; According to RFC822, "The field-name must be composed of printable
1243 ;; ASCII characters (i. e., characters that have decimal values between
1244 ;; 33 and 126, except colon)", i. e., any chars except ctl chars,
1246 '(looking-at "[ \t]\\|[][!\"#$%&'()*+,-./0-9;<=>?@A-Z\\\\^_`a-z{|}~]+:"))
1247 "*Set this non-nil if the system's mailer runs the header and body together.
1248 \(This problem exists on Sunos 4 when sendmail is run in remote mode.)
1249 The value should be an expression to test whether the problem will
1251 :group 'message-sending
1252 :link '(custom-manual "(message)Mail Variables")
1256 (define-mail-user-agent 'message-user-agent
1257 'message-mail 'message-send-and-exit
1258 'message-kill-buffer 'message-send-hook)
1260 (defvar message-mh-deletable-headers '(Message-ID Date Lines Sender)
1261 "If non-nil, delete the deletable headers before feeding to mh.")
1263 (defvar message-send-method-alist
1264 '((news message-news-p message-send-via-news)
1265 (mail message-mail-p message-send-via-mail))
1266 "Alist of ways to send outgoing messages.
1267 Each element has the form
1269 \(TYPE PREDICATE FUNCTION)
1271 where TYPE is a symbol that names the method; PREDICATE is a function
1272 called without any parameters to determine whether the message is
1273 a message of type TYPE; and FUNCTION is a function to be called if
1274 PREDICATE returns non-nil. FUNCTION is called with one parameter --
1277 (defcustom message-mail-alias-type 'abbrev
1278 "*What alias expansion type to use in Message buffers.
1279 The default is `abbrev', which uses mailabbrev. `ecomplete' uses
1280 an electric completion mode. nil switches mail aliases off.
1281 This can also be a list of values."
1283 :link '(custom-manual "(message)Mail Aliases")
1284 :type '(choice (const :tag "Use Mailabbrev" abbrev)
1285 (const :tag "Use ecomplete" ecomplete)
1286 (const :tag "No expansion" nil)))
1288 (defcustom message-self-insert-commands '(self-insert-command)
1289 "List of `self-insert-command's used to trigger ecomplete.
1290 When one of those commands is invoked to enter a character in To or Cc
1291 header, ecomplete will suggest the candidates of recipients (see also
1292 `message-mail-alias-type'). If you use some tool to enter non-ASCII
1293 text and it replaces `self-insert-command' with the other command, e.g.
1294 `egg-self-insert-command', you may want to add it to this list."
1295 :group 'message-various
1296 :type '(repeat function))
1298 (defcustom message-auto-save-directory
1299 (file-name-as-directory (expand-file-name "drafts" message-directory))
1300 "*Directory where Message auto-saves buffers if Gnus isn't running.
1301 If nil, Message won't auto-save."
1302 :group 'message-buffers
1303 :link '(custom-manual "(message)Various Message Variables")
1304 :type '(choice directory (const :tag "Don't auto-save" nil)))
1306 (defcustom message-default-charset
1307 (and (not (mm-multibyte-p)) 'iso-8859-1)
1308 "Default charset used in non-MULE Emacsen.
1309 If nil, you might be asked to input the charset."
1312 :link '(custom-manual "(message)Various Message Variables")
1315 (defcustom message-dont-reply-to-names
1316 (and (boundp 'rmail-dont-reply-to-names) rmail-dont-reply-to-names)
1317 "*Addresses to prune when doing wide replies.
1318 This can be a regexp or a list of regexps. Also, a value of nil means
1319 exclude your own user name only."
1322 :link '(custom-manual "(message)Wide Reply")
1323 :type '(choice (const :tag "Yourself" nil)
1325 (repeat :tag "Regexp List" regexp)))
1327 (defsubst message-dont-reply-to-names ()
1328 (gmm-regexp-concat message-dont-reply-to-names))
1330 (defvar message-shoot-gnksa-feet nil
1331 "*A list of GNKSA feet you are allowed to shoot.
1332 Gnus gives you all the opportunity you could possibly want for
1333 shooting yourself in the foot. Also, Gnus allows you to shoot the
1334 feet of Good Net-Keeping Seal of Approval. The following are foot
1336 `empty-article' Allow you to post an empty article;
1337 `quoted-text-only' Allow you to post quoted text only;
1338 `multiple-copies' Allow you to post multiple copies;
1339 `cancel-messages' Allow you to cancel or supersede messages from
1340 your other email addresses.")
1342 (defsubst message-gnksa-enable-p (feature)
1343 (or (not (listp message-shoot-gnksa-feet))
1344 (memq feature message-shoot-gnksa-feet)))
1346 (defcustom message-hidden-headers '("^References:" "^Face:" "^X-Face:"
1348 "Regexp of headers to be hidden when composing new messages.
1349 This can also be a list of regexps to match headers. Or a list
1350 starting with `not' and followed by regexps."
1353 :link '(custom-manual "(message)Message Headers")
1355 :format "%{%t%}: %[Value Type%] %v"
1356 (regexp :menu-tag "regexp" :format "regexp\n%t: %v")
1357 (repeat :menu-tag "(regexp ...)" :format "(regexp ...)\n%v%i"
1358 (regexp :format "%t: %v"))
1359 (cons :menu-tag "(not regexp ...)" :format "(not regexp ...)\n%v"
1361 (repeat :format "%v%i"
1362 (regexp :format "%t: %v")))))
1364 (defcustom message-cite-articles-with-x-no-archive t
1365 "If non-nil, cite text from articles that has X-No-Archive set."
1369 ;;; Internal variables.
1370 ;;; Well, not really internal.
1372 (defvar message-mode-syntax-table
1373 (let ((table (copy-syntax-table text-mode-syntax-table)))
1374 (modify-syntax-entry ?% ". " table)
1375 (modify-syntax-entry ?> ". " table)
1376 (modify-syntax-entry ?< ". " table)
1378 "Syntax table used while in Message mode.")
1380 (defface message-header-to
1383 (:foreground "DarkOliveGreen1" :bold t))
1386 (:foreground "MidnightBlue" :bold t))
1388 (:bold t :italic t)))
1389 "Face used for displaying From headers."
1390 :group 'message-faces)
1391 ;; backward-compatibility alias
1392 (put 'message-header-to-face 'face-alias 'message-header-to)
1393 (put 'message-header-to-face 'obsolete-face "22.1")
1395 (defface message-header-cc
1398 (:foreground "chartreuse1" :bold t))
1401 (:foreground "MidnightBlue"))
1404 "Face used for displaying Cc headers."
1405 :group 'message-faces)
1406 ;; backward-compatibility alias
1407 (put 'message-header-cc-face 'face-alias 'message-header-cc)
1408 (put 'message-header-cc-face 'obsolete-face "22.1")
1410 (defface message-header-subject
1413 (:foreground "OliveDrab1"))
1416 (:foreground "navy blue" :bold t))
1419 "Face used for displaying subject headers."
1420 :group 'message-faces)
1421 ;; backward-compatibility alias
1422 (put 'message-header-subject-face 'face-alias 'message-header-subject)
1423 (put 'message-header-subject-face 'obsolete-face "22.1")
1425 (defface message-header-newsgroups
1428 (:foreground "yellow" :bold t :italic t))
1431 (:foreground "blue4" :bold t :italic t))
1433 (:bold t :italic t)))
1434 "Face used for displaying newsgroups headers."
1435 :group 'message-faces)
1436 ;; backward-compatibility alias
1437 (put 'message-header-newsgroups-face 'face-alias 'message-header-newsgroups)
1438 (put 'message-header-newsgroups-face 'obsolete-face "22.1")
1440 (defface message-header-other
1443 (:foreground "VioletRed1"))
1446 (:foreground "steel blue"))
1448 (:bold t :italic t)))
1449 "Face used for displaying newsgroups headers."
1450 :group 'message-faces)
1451 ;; backward-compatibility alias
1452 (put 'message-header-other-face 'face-alias 'message-header-other)
1453 (put 'message-header-other-face 'obsolete-face "22.1")
1455 (defface message-header-name
1458 (:foreground "green"))
1461 (:foreground "cornflower blue"))
1464 "Face used for displaying header names."
1465 :group 'message-faces)
1466 ;; backward-compatibility alias
1467 (put 'message-header-name-face 'face-alias 'message-header-name)
1468 (put 'message-header-name-face 'obsolete-face "22.1")
1470 (defface message-header-xheader
1473 (:foreground "DeepSkyBlue1"))
1476 (:foreground "blue"))
1479 "Face used for displaying X-Header headers."
1480 :group 'message-faces)
1481 ;; backward-compatibility alias
1482 (put 'message-header-xheader-face 'face-alias 'message-header-xheader)
1483 (put 'message-header-xheader-face 'obsolete-face "22.1")
1485 (defface message-separator
1488 (:foreground "LightSkyBlue1"))
1491 (:foreground "brown"))
1494 "Face used for displaying the separator."
1495 :group 'message-faces)
1496 ;; backward-compatibility alias
1497 (put 'message-separator-face 'face-alias 'message-separator)
1498 (put 'message-separator-face 'obsolete-face "22.1")
1500 (defface message-cited-text
1503 (:foreground "LightPink1"))
1506 (:foreground "red"))
1509 "Face used for displaying cited text names."
1510 :group 'message-faces)
1511 ;; backward-compatibility alias
1512 (put 'message-cited-text-face 'face-alias 'message-cited-text)
1513 (put 'message-cited-text-face 'obsolete-face "22.1")
1515 (defface message-mml
1518 (:foreground "MediumSpringGreen"))
1521 (:foreground "ForestGreen"))
1524 "Face used for displaying MML."
1525 :group 'message-faces)