Remove arch-tags from all files, since these are no longer needed.
[bpt/emacs.git] / lisp / gnus / message.el
CommitLineData
23f87bed 1;;; message.el --- composing mail and news messages
e84b4b86
TTN
2
3;; Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
114f9c96 4;; 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
eec82323 5
6748645f 6;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
eec82323
LMI
7;; Keywords: mail, news
8
9;; This file is part of GNU Emacs.
10
5e809f55 11;; GNU Emacs is free software: you can redistribute it and/or modify
eec82323 12;; it under the terms of the GNU General Public License as published by
5e809f55
GM
13;; the Free Software Foundation, either version 3 of the License, or
14;; (at your option) any later version.
eec82323
LMI
15
16;; GNU Emacs is distributed in the hope that it will be useful,
17;; but WITHOUT ANY WARRANTY; without even the implied warranty of
5e809f55 18;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
eec82323
LMI
19;; GNU General Public License for more details.
20
21;; You should have received a copy of the GNU General Public License
5e809f55 22;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
eec82323
LMI
23
24;;; Commentary:
25
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.
29
30;;; Code:
31
b43906b6
GM
32(eval-and-compile
33 (unless (fboundp 'declare-function) (defmacro declare-function (&rest r))))
16409b0b 34(eval-when-compile
9efa445f 35 (require 'cl))
b43906b6 36
eec82323 37(require 'mailheader)
18c06a99 38(require 'gmm-utils)
aa8f8277
GM
39(require 'mail-utils)
40;; Only for the trivial macros mail-header-from, mail-header-date
41;; mail-header-references, mail-header-subject, mail-header-id
42(eval-when-compile (require 'nnheader))
23f87bed
MB
43;; This is apparently necessary even though things are autoloaded.
44;; Because we dynamically bind mail-abbrev-mode-regexp, we'd better
45;; require mailabbrev here.
16409b0b 46(if (featurep 'xemacs)
23f87bed
MB
47 (require 'mail-abbrevs)
48 (require 'mailabbrev))
16409b0b
GM
49(require 'mail-parse)
50(require 'mml)
23f87bed 51(require 'rfc822)
01c52d31 52
2ea6167b
RS
53(autoload 'mailclient-send-it "mailclient") ;; Emacs 22 or contrib/
54
9efa445f
DN
55(defvar gnus-message-group-art)
56(defvar gnus-list-identifiers) ; gnus-sum is required where necessary
57(defvar rmail-enable-mime-composing)
eec82323
LMI
58
59(defgroup message '((user-mail-address custom-variable)
60 (user-full-name custom-variable))
61 "Mail and news message composing."
62 :link '(custom-manual "(message)Top")
63 :group 'mail
64 :group 'news)
65
66(put 'user-mail-address 'custom-type 'string)
67(put 'user-full-name 'custom-type 'string)
68
69(defgroup message-various nil
339ccc6a 70 "Various Message Variables."
eec82323
LMI
71 :link '(custom-manual "(message)Various Message Variables")
72 :group 'message)
73
74(defgroup message-buffers nil
339ccc6a 75 "Message Buffers."
eec82323
LMI
76 :link '(custom-manual "(message)Message Buffers")
77 :group 'message)
78
79(defgroup message-sending nil
339ccc6a 80 "Message Sending."
eec82323
LMI
81 :link '(custom-manual "(message)Sending Variables")
82 :group 'message)
83
84(defgroup message-interface nil
339ccc6a 85 "Message Interface."
eec82323
LMI
86 :link '(custom-manual "(message)Interface")
87 :group 'message)
88
89(defgroup message-forwarding nil
339ccc6a 90 "Message Forwarding."
eec82323
LMI
91 :link '(custom-manual "(message)Forwarding")
92 :group 'message-interface)
93
94(defgroup message-insertion nil
339ccc6a 95 "Message Insertion."
eec82323
LMI
96 :link '(custom-manual "(message)Insertion")
97 :group 'message)
98
99(defgroup message-headers nil
339ccc6a 100 "Message Headers."
eec82323
LMI
101 :link '(custom-manual "(message)Message Headers")
102 :group 'message)
103
104(defgroup message-news nil
339ccc6a 105 "Composing News Messages."
eec82323
LMI
106 :group 'message)
107
108(defgroup message-mail nil
339ccc6a 109 "Composing Mail Messages."
eec82323
LMI
110 :group 'message)
111
112(defgroup message-faces nil
113 "Faces used for message composing."
114 :group 'message
115 :group 'faces)
116
117(defcustom message-directory "~/Mail/"
118 "*Directory from which all other mail file variables are derived."
119 :group 'message-various
120 :type 'directory)
121
122(defcustom message-max-buffers 10
123 "*How many buffers to keep before starting to kill them off."
124 :group 'message-buffers
125 :type 'integer)
126
127(defcustom message-send-rename-function nil
128 "Function called to rename the buffer after sending it."
129 :group 'message-buffers
7d829636 130 :type '(choice function (const nil)))
eec82323
LMI
131
132(defcustom message-fcc-handler-function 'message-output
133 "*A function called to save outgoing articles.
134This function will be called with the name of the file to store the
135article in. The default function is `message-output' which saves in Unix
136mailbox format."
137 :type '(radio (function-item message-output)
138 (function :tag "Other"))
139 :group 'message-sending)
140
23f87bed
MB
141(defcustom message-fcc-externalize-attachments nil
142 "If non-nil, attachments are included as external parts in Fcc copies."
bf247b6e 143 :version "22.1"
23f87bed
MB
144 :type 'boolean
145 :group 'message-sending)
146
eec82323 147(defcustom message-courtesy-message
f129a4df 148 "The following message is a courtesy copy of an article\nthat has been posted to %s as well.\n\n"
eec82323
LMI
149 "*This is inserted at the start of a mailed copy of a posted message.
150If the string contains the format spec \"%s\", the Newsgroups
151the article has been posted to will be inserted there.
152If this variable is nil, no such courtesy message will be added."
153 :group 'message-sending
ad136a7c 154 :type '(radio string (const nil)))
eec82323 155
23f87bed
MB
156(defcustom message-ignored-bounced-headers
157 "^\\(Received\\|Return-Path\\|Delivered-To\\):"
eec82323
LMI
158 "*Regexp that matches headers to be removed in resent bounced mail."
159 :group 'message-interface
160 :type 'regexp)
161
937e60c8
KY
162(defcustom message-from-style mail-from-style
163;; Default to the value of `mail-from-style', available in all Emacsen
164;; that Gnus supports.
eec82323
LMI
165 "*Specifies how \"From\" headers look.
166
7d829636 167If nil, they contain just the return address like:
eec82323
LMI
168 king@grassland.com
169If `parens', they look like:
170 king@grassland.com (Elvis Parsley)
171If `angles', they look like:
172 Elvis Parsley <king@grassland.com>
173
174Otherwise, most addresses look like `angles', but they look like
175`parens' if `angles' would need quoting and `parens' would not."
937e60c8 176 :version "23.2"
eec82323
LMI
177 :type '(choice (const :tag "simple" nil)
178 (const parens)
179 (const angles)
180 (const default))
181 :group 'message-headers)
182
23f87bed
MB
183(defcustom message-insert-canlock t
184 "Whether to insert a Cancel-Lock header in news postings."
bf247b6e 185 :version "22.1"
23f87bed
MB
186 :group 'message-headers
187 :type 'boolean)
188
189(defcustom message-syntax-checks
190 (if message-insert-canlock '((sender . disabled)) nil)
16409b0b 191 ;; Guess this one shouldn't be easy to customize...
6748645f 192 "*Controls what syntax checks should not be performed on outgoing posts.
eec82323
LMI
193To disable checking of long signatures, for instance, add
194 `(signature . disabled)' to this list.
195
196Don't touch this variable unless you really know what you're doing.
197
437ce4be
MB
198Checks include `approved', `bogus-recipient', `continuation-headers',
199`control-chars', `empty', `existing-newsgroups', `from', `illegible-text',
f362b760
MB
200`invisible-text', `long-header-lines', `long-lines', `message-id',
201`multiple-headers', `new-text', `newsgroups', `quoting-style',
5cfd0f2e 202`repeated-newsgroups', `reply-to', `sender', `sendsys', `shoot',
f362b760
MB
203`shorten-followup-to', `signature', `size', `subject', `subject-cmsg'
204and `valid-newsgroups'."
16409b0b 205 :group 'message-news
7d829636 206 :type '(repeat sexp)) ; Fixme: improve this
eec82323 207
23f87bed
MB
208(defcustom message-required-headers '((optional . References)
209 From)
210 "*Headers to be generated or prompted for when sending a message.
211Also see `message-required-news-headers' and
212`message-required-mail-headers'."
bf247b6e 213 :version "22.1"
23f87bed
MB
214 :group 'message-news
215 :group 'message-headers
216 :link '(custom-manual "(message)Message Headers")
217 :type '(repeat sexp))
218
01c52d31 219(defcustom message-draft-headers '(References From Date)
23f87bed 220 "*Headers to be generated when saving a draft message."
bf247b6e 221 :version "22.1"
23f87bed
MB
222 :group 'message-news
223 :group 'message-headers
224 :link '(custom-manual "(message)Message Headers")
225 :type '(repeat sexp))
226
eec82323
LMI
227(defcustom message-required-news-headers
228 '(From Newsgroups Subject Date Message-ID
23f87bed 229 (optional . Organization)
16409b0b 230 (optional . User-Agent))
6748645f 231 "*Headers to be generated or prompted for when posting an article.
eec82323
LMI
232RFC977 and RFC1036 require From, Date, Newsgroups, Subject,
233Message-ID. Organization, Lines, In-Reply-To, Expires, and
815b81c8 234User-Agent are optional. If you don't want message to insert some
eec82323
LMI
235header, remove it from this list."
236 :group 'message-news
237 :group 'message-headers
23f87bed 238 :link '(custom-manual "(message)Message Headers")
eec82323
LMI
239 :type '(repeat sexp))
240
241(defcustom message-required-mail-headers
23f87bed 242 '(From Subject Date (optional . In-Reply-To) Message-ID
16409b0b 243 (optional . User-Agent))
6748645f 244 "*Headers to be generated or prompted for when mailing a message.
23f87bed
MB
245It is recommended that From, Date, To, Subject and Message-ID be
246included. Organization and User-Agent are optional."
eec82323
LMI
247 :group 'message-mail
248 :group 'message-headers
23f87bed 249 :link '(custom-manual "(message)Message Headers")
eec82323
LMI
250 :type '(repeat sexp))
251
2cdd366f
KY
252(defcustom message-prune-recipient-rules nil
253 "Rules for how to prune the list of recipients when doing wide replies.
254This is a list of regexps and regexp matches."
b0e30310 255 :version "24.1"
2cdd366f
KY
256 :group 'message-mail
257 :group 'message-headers
258 :link '(custom-manual "(message)Wide Reply")
259 :type '(repeat regexp))
260
eec82323
LMI
261(defcustom message-deletable-headers '(Message-ID Date Lines)
262 "Headers to be deleted if they already exist and were generated by message previously."
263 :group 'message-headers
23f87bed 264 :link '(custom-manual "(message)Message Headers")
eec82323
LMI
265 :type 'sexp)
266
267(defcustom message-ignored-news-headers
23f87bed 268 "^NNTP-Posting-Host:\\|^Xref:\\|^[BGF]cc:\\|^Resent-Fcc:\\|^X-Draft-From:\\|^X-Gnus-Agent-Meta-Information:"
eec82323
LMI
269 "*Regexp of headers to be removed unconditionally before posting."
270 :group 'message-news
271 :group 'message-headers
23f87bed 272 :link '(custom-manual "(message)Message Headers")
8903a9c8
MB
273 :type '(repeat :value-to-internal (lambda (widget value)
274 (custom-split-regexp-maybe value))
275 :match (lambda (widget value)
276 (or (stringp value)
277 (widget-editable-list-match widget value)))
278 regexp))
eec82323 279
23f87bed
MB
280(defcustom message-ignored-mail-headers
281 "^[GF]cc:\\|^Resent-Fcc:\\|^Xref:\\|^X-Draft-From:\\|^X-Gnus-Agent-Meta-Information:"
eec82323
LMI
282 "*Regexp of headers to be removed unconditionally before mailing."
283 :group 'message-mail
284 :group 'message-headers
23f87bed 285 :link '(custom-manual "(message)Mail Headers")
eec82323
LMI
286 :type 'regexp)
287
b890d447 288(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:"
eec82323
LMI
289 "*Header lines matching this regexp will be deleted before posting.
290It's best to delete old Path and Date headers before posting to avoid
291any confusion."
292 :group 'message-interface
23f87bed 293 :link '(custom-manual "(message)Superseding")
8903a9c8
MB
294 :type '(repeat :value-to-internal (lambda (widget value)
295 (custom-split-regexp-maybe value))
296 :match (lambda (widget value)
297 (or (stringp value)
298 (widget-editable-list-match widget value)))
299 regexp))
eec82323 300
23f87bed
MB
301(defcustom message-subject-re-regexp
302 "^[ \t]*\\([Rr][Ee]\\(\\[[0-9]*\\]\\)*:[ \t]*\\)*[ \t]*"
6748645f
LMI
303 "*Regexp matching \"Re: \" in the subject line."
304 :group 'message-various
23f87bed 305 :link '(custom-manual "(message)Message Headers")
6748645f
LMI
306 :type 'regexp)
307
23f87bed
MB
308;;; Start of variables adopted from `message-utils.el'.
309
310(defcustom message-subject-trailing-was-query 'ask
311 "*What to do with trailing \"(was: <old subject>)\" in subject lines.
312If nil, leave the subject unchanged. If it is the symbol `ask', query
313the user what do do. In this case, the subject is matched against
314`message-subject-trailing-was-ask-regexp'. If
315`message-subject-trailing-was-query' is t, always strip the trailing
316old subject. In this case, `message-subject-trailing-was-regexp' is
317used."
bf247b6e 318 :version "22.1"
23f87bed
MB
319 :type '(choice (const :tag "never" nil)
320 (const :tag "always strip" t)
01c52d31 321 (const ask))
23f87bed
MB
322 :link '(custom-manual "(message)Message Headers")
323 :group 'message-various)
324
325(defcustom message-subject-trailing-was-ask-regexp
326 "[ \t]*\\([[(]+[Ww][Aa][Ss][ \t]*.*[\])]+\\)"
327 "*Regexp matching \"(was: <old subject>)\" in the subject line.
328
329The function `message-strip-subject-trailing-was' uses this regexp if
330`message-subject-trailing-was-query' is set to the symbol `ask'. If
331the variable is t instead of `ask', use
332`message-subject-trailing-was-regexp' instead.
333
334It is okay to create some false positives here, as the user is asked."
bf247b6e 335 :version "22.1"
23f87bed
MB
336 :group 'message-various
337 :link '(custom-manual "(message)Message Headers")
338 :type 'regexp)
339
340(defcustom message-subject-trailing-was-regexp
341 "[ \t]*\\((*[Ww][Aa][Ss]:[ \t]*.*)\\)"
342 "*Regexp matching \"(was: <old subject>)\" in the subject line.
343
344If `message-subject-trailing-was-query' is set to t, the subject is
345matched against `message-subject-trailing-was-regexp' in
346`message-strip-subject-trailing-was'. You should use a regexp creating very
347few false positives here."
bf247b6e 348 :version "22.1"
23f87bed
MB
349 :group 'message-various
350 :link '(custom-manual "(message)Message Headers")
351 :type 'regexp)
352
23f87bed
MB
353;;; marking inserted text
354
23f87bed 355(defcustom message-mark-insert-begin
f129a4df 356 "--8<---------------cut here---------------start------------->8---\n"
23f87bed 357 "How to mark the beginning of some inserted text."
bf247b6e 358 :version "22.1"
23f87bed
MB
359 :type 'string
360 :link '(custom-manual "(message)Insertion Variables")
361 :group 'message-various)
362
23f87bed 363(defcustom message-mark-insert-end
f129a4df 364 "--8<---------------cut here---------------end--------------->8---\n"
23f87bed 365 "How to mark the end of some inserted text."
bf247b6e 366 :version "22.1"
23f87bed
MB
367 :type 'string
368 :link '(custom-manual "(message)Insertion Variables")
369 :group 'message-various)
370
f129a4df 371(defcustom message-archive-header "X-No-Archive: Yes\n"
23f87bed
MB
372 "Header to insert when you don't want your article to be archived.
373Archives \(such as groups.google.com\) respect this header."
bf247b6e 374 :version "22.1"
23f87bed
MB
375 :type 'string
376 :link '(custom-manual "(message)Header Commands")
377 :group 'message-various)
378
23f87bed
MB
379(defcustom message-archive-note
380 "X-No-Archive: Yes - save http://groups.google.com/"
381 "Note to insert why you wouldn't want this posting archived.
382If nil, don't insert any text in the body."
bf247b6e 383 :version "22.1"
ad136a7c 384 :type '(radio string (const nil))
23f87bed
MB
385 :link '(custom-manual "(message)Header Commands")
386 :group 'message-various)
387
388;;; Crossposts and Followups
389;; inspired by JoH-followup-to by Jochem Huhman <joh at gmx.de>
390;; new suggestions by R. Weikusat <rw at another.de>
391
392(defvar message-cross-post-old-target nil
393 "Old target for cross-posts or follow-ups.")
394(make-variable-buffer-local 'message-cross-post-old-target)
395
23f87bed
MB
396(defcustom message-cross-post-default t
397 "When non-nil `message-cross-post-followup-to' will perform a crosspost.
398If nil, `message-cross-post-followup-to' will only do a followup. Note that
399you can explicitly override this setting by calling
400`message-cross-post-followup-to' with a prefix."
bf247b6e 401 :version "22.1"
23f87bed
MB
402 :type 'boolean
403 :group 'message-various)
404
5f5475ac 405(defcustom message-cross-post-note "Crosspost & Followup-To: "
23f87bed 406 "Note to insert before signature to notify of cross-post and follow-up."
bf247b6e 407 :version "22.1"
23f87bed
MB
408 :type 'string
409 :group 'message-various)
410
5f5475ac 411(defcustom message-followup-to-note "Followup-To: "
23f87bed 412 "Note to insert before signature to notify of follow-up only."
bf247b6e 413 :version "22.1"
23f87bed
MB
414 :type 'string
415 :group 'message-various)
416
5f5475ac 417(defcustom message-cross-post-note-function 'message-cross-post-insert-note
23f87bed
MB
418 "Function to use to insert note about Crosspost or Followup-To.
419The function will be called with four arguments. The function should not only
420insert a note, but also ensure old notes are deleted. See the documentation
421for `message-cross-post-insert-note'."
bf247b6e 422 :version "22.1"
23f87bed
MB
423 :type 'function
424 :group 'message-various)
425
426;;; End of variables adopted from `message-utils.el'.
427
9b3ebcb6
MB
428(defcustom message-signature-separator "^-- $"
429 "Regexp matching the signature separator.
430This variable is used to strip off the signature from quoted text
431when `message-cite-function' is
432`message-cite-original-without-signature'. Most useful values
433are \"^-- $\" (strict) and \"^-- *$\" (loose; allow missing
434whitespace)."
435 :type '(choice (const :tag "strict" "^-- $")
436 (const :tag "loose" "^-- *$")
437 regexp)
d55fe5bb 438 :version "22.3" ;; Gnus 5.10.12 (changed default)
23f87bed 439 :link '(custom-manual "(message)Various Message Variables")
eec82323
LMI
440 :group 'message-various)
441
f129a4df 442(defcustom message-elide-ellipsis "\n[...]\n\n"
6748645f
LMI
443 "*The string which is inserted for elided text."
444 :type 'string
23f87bed 445 :link '(custom-manual "(message)Various Commands")
6748645f 446 :group 'message-various)
eec82323 447
937e60c8
KY
448(defcustom message-interactive mail-interactive
449;; Default to the value of `mail-interactive', available in all Emacsen
450;; that Gnus supports.
eec82323 451 "Non-nil means when sending a message wait for and display errors.
2b8f62e9 452A value of nil means let mailer mail back a message to report errors."
937e60c8 453 :version "23.2"
eec82323
LMI
454 :group 'message-sending
455 :group 'message-mail
23f87bed 456 :link '(custom-manual "(message)Sending Variables")
eec82323
LMI
457 :type 'boolean)
458
16dd13df 459(defcustom message-confirm-send nil
eef5ade7 460 "When non-nil, ask for confirmation when sending a message."
16dd13df
MB
461 :group 'message-sending
462 :group 'message-mail
4520e527 463 :version "23.1" ;; No Gnus
16dd13df
MB
464 :link '(custom-manual "(message)Sending Variables")
465 :type 'boolean)
466
16409b0b 467(defcustom message-generate-new-buffers 'unique
815b81c8
MB
468 "*Say whether to create a new message buffer to compose a message.
469Valid values include:
470
471nil
472 Generate the buffer name in the Message way (e.g., *mail*, *news*,
473 *mail to whom*, *news on group*, etc.) and continue editing in the
474 existing buffer of that name. If there is no such buffer, it will
475 be newly created.
476
477`unique' or t
478 Create the new buffer with the name generated in the Message way.
479
480`unsent'
481 Similar to `unique' but the buffer name begins with \"*unsent \".
482
483`standard'
484 Similar to nil but the buffer name is simpler like *mail message*.
485
486function
487 If this is a function, call that function with three parameters:
488 The type, the To address and the group name (any of these may be nil).
489 The function should return the new buffer name."
eec82323 490 :group 'message-buffers
23f87bed 491 :link '(custom-manual "(message)Message Buffers")
815b81c8
MB
492 :type '(choice (const nil)
493 (sexp :tag "unique" :format "unique\n" :value unique
494 :match (lambda (widget value) (memq value '(unique t))))
495 (const unsent)
496 (const standard)
497 (function :format "\n %{%t%}: %v")))
eec82323
LMI
498
499(defcustom message-kill-buffer-on-exit nil
500 "*Non-nil means that the message buffer will be killed after sending a message."
501 :group 'message-buffers
23f87bed 502 :link '(custom-manual "(message)Message Buffers")
eec82323
LMI
503 :type 'boolean)
504
01c52d31
MB
505(defcustom message-kill-buffer-query t
506 "*Non-nil means that killing a modified message buffer has to be confirmed.
507This is used by `message-kill-buffer'."
330f707b 508 :version "23.1" ;; No Gnus
01c52d31
MB
509 :group 'message-buffers
510 :type 'boolean)
511
9efa445f 512(defvar gnus-local-organization)
eec82323
LMI
513(defcustom message-user-organization
514 (or (and (boundp 'gnus-local-organization)
515 (stringp gnus-local-organization)
516 gnus-local-organization)
517 (getenv "ORGANIZATION")
518 t)
519 "*String to be used as an Organization header.
520If t, use `message-user-organization-file'."
521 :group 'message-headers
522 :type '(choice string
523 (const :tag "consult file" t)))
524
01c52d31
MB
525(defcustom message-user-organization-file
526 (let (orgfile)
527 (dolist (f (list "/etc/organization"
528 "/etc/news/organization"
529 "/usr/lib/news/organization"))
530 (when (file-readable-p f)
531 (setq orgfile f)))
532 orgfile)
eec82323
LMI
533 "*Local news organization file."
534 :type 'file
23f87bed 535 :link '(custom-manual "(message)News Headers")
eec82323
LMI
536 :group 'message-headers)
537
6748645f 538(defcustom message-make-forward-subject-function
23f87bed 539 #'message-forward-subject-name-subject
7d829636 540 "*List of functions called to generate subject headers for forwarded messages.
6748645f
LMI
541The subject generated by the previous function is passed into each
542successive function.
543
544The provided functions are:
545
23f87bed
MB
546* `message-forward-subject-author-subject' Source of article (author or
547 newsgroup), in brackets followed by the subject
548* `message-forward-subject-name-subject' Source of article (name of author
549 or newsgroup), in brackets followed by the subject
550* `message-forward-subject-fwd' Subject of article with 'Fwd:' prepended
6748645f 551 to it."
16409b0b 552 :group 'message-forwarding
23f87bed 553 :link '(custom-manual "(message)Forwarding")
16409b0b 554 :type '(radio (function-item message-forward-subject-author-subject)
7d829636 555 (function-item message-forward-subject-fwd)
23f87bed 556 (function-item message-forward-subject-name-subject)
7d829636 557 (repeat :tag "List of functions" function)))
16409b0b
GM
558
559(defcustom message-forward-as-mime t
23f87bed
MB
560 "*Non-nil means forward messages as an inline/rfc822 MIME section.
561Otherwise, directly inline the old message in the forwarded message."
2d447df6 562 :version "21.1"
16409b0b 563 :group 'message-forwarding
23f87bed 564 :link '(custom-manual "(message)Forwarding")
16409b0b
GM
565 :type 'boolean)
566
23f87bed
MB
567(defcustom message-forward-show-mml 'best
568 "*Non-nil means show forwarded messages as MML (decoded from MIME).
569Otherwise, forwarded messages are unchanged.
570Can also be the symbol `best' to indicate that MML should be
571used, except when it is a bad idea to use MML. One example where
572it is a bad idea is when forwarding a signed or encrypted
573message, because converting MIME to MML would invalidate the
574digital signature."
88818fbe 575 :version "21.1"
16409b0b 576 :group 'message-forwarding
23f87bed
MB
577 :type '(choice (const :tag "use MML" t)
578 (const :tag "don't use MML " nil)
579 (const :tag "use MML when appropriate" best)))
16409b0b
GM
580
581(defcustom message-forward-before-signature t
23f87bed 582 "*Non-nil means put forwarded message before signature, else after."
16409b0b
GM
583 :group 'message-forwarding
584 :type 'boolean)
6748645f
LMI
585
586(defcustom message-wash-forwarded-subjects nil
23f87bed
MB
587 "*Non-nil means try to remove as much cruft as possible from the subject.
588Done before generating the new subject of a forward."
6748645f 589 :group 'message-forwarding
23f87bed 590 :link '(custom-manual "(message)Forwarding")
6748645f
LMI
591 :type 'boolean)
592
dd58a686
SM
593(defcustom message-ignored-resent-headers
594 ;; `Delivered-To' needs to be removed because some mailers use it to
595 ;; detect loops, so if you resend a message to an address that ultimately
596 ;; comes back to you (e.g. a mailing-list to which you subscribe, in which
597 ;; case you may be removed from the list on the grounds that mail to you
598 ;; bounced with a "mailing loop" error).
599 "^Return-receipt\\|^X-Gnus\\|^Gnus-Warning:\\|^>?From \\|^Delivered-To:"
eec82323
LMI
600 "*All headers that match this regexp will be deleted when resending a message."
601 :group 'message-interface
23f87bed 602 :link '(custom-manual "(message)Resending")
8903a9c8
MB
603 :type '(repeat :value-to-internal (lambda (widget value)
604 (custom-split-regexp-maybe value))
605 :match (lambda (widget value)
606 (or (stringp value)
607 (widget-editable-list-match widget value)))
608 regexp))
eec82323 609
16409b0b
GM
610(defcustom message-forward-ignored-headers "^Content-Transfer-Encoding:\\|^X-Gnus"
611 "*All headers that match this regexp will be deleted when forwarding a message."
2d447df6 612 :version "21.1"
16409b0b 613 :group 'message-forwarding
8903a9c8
MB
614 :type '(repeat :value-to-internal (lambda (widget value)
615 (custom-split-regexp-maybe value))
616 :match (lambda (widget value)
617 (or (stringp value)
618 (widget-editable-list-match widget value)))
16409b0b
GM
619 regexp))
620
eec82323
LMI
621(defcustom message-ignored-cited-headers "."
622 "*Delete these headers from the messages you yank."
623 :group 'message-insertion
23f87bed
MB
624 :link '(custom-manual "(message)Insertion Variables")
625 :type 'regexp)
626
627(defcustom message-cite-prefix-regexp
937e60c8
KY
628 ;; Default to the value of `mail-citation-prefix-regexp' if available.
629 ;; Note: as for Emacs 21, XEmacs 21.4 and 21.5, it is unavailable
630 ;; unless sendmail.el is loaded.
631 (cond ((boundp 'mail-citation-prefix-regexp)
4332f3ec
CY
632 mail-citation-prefix-regexp)
633 ((string-match "[[:digit:]]" "1")
634 ;; Support POSIX? XEmacs 21.5.27 doesn't.
635 "\\([ \t]*[_.[:word:]]+>+\\|[ \t]*[]>|}]\\)+")
636 (t
637 ;; ?-, ?_ or ?. MUST NOT be in syntax entry w.
638 (let (non-word-constituents)
639 (with-syntax-table text-mode-syntax-table
640 (setq non-word-constituents
641 (concat
642 (if (string-match "\\w" "_") "" "_")
643 (if (string-match "\\w" ".") "" "."))))
644 (if (equal non-word-constituents "")
645 "\\([ \t]*\\(\\w\\)+>+\\|[ \t]*[]>|}]\\)+"
646 (concat "\\([ \t]*\\(\\w\\|["
647 non-word-constituents
648 "]\\)+>+\\|[ \t]*[]>|}]\\)+")))))
23f87bed 649 "*Regexp matching the longest possible citation prefix on a line."
937e60c8 650 :version "23.2"
23f87bed
MB
651 :group 'message-insertion
652 :link '(custom-manual "(message)Insertion Variables")
01c52d31
MB
653 :type 'regexp
654 :set (lambda (symbol value)
655 (prog1
656 (custom-set-default symbol value)
657 (if (boundp 'gnus-message-cite-prefix-regexp)
658 (setq gnus-message-cite-prefix-regexp
659 (concat "^\\(?:" value "\\)"))))))
eec82323 660
f129a4df 661(defcustom message-cancel-message "I am canceling my own article.\n"
eec82323
LMI
662 "Message to be inserted in the cancel message."
663 :group 'message-interface
23f87bed 664 :link '(custom-manual "(message)Canceling News")
eec82323
LMI
665 :type 'string)
666
2ea6167b
RS
667(defun message-send-mail-function ()
668 "Return suitable value for the variable `message-send-mail-function'."
b62a39c4
RS
669 (cond ((and (require 'sendmail)
670 (boundp 'sendmail-program)
671 sendmail-program
9e0a8576 672 (executable-find sendmail-program))
2ea6167b 673 'message-send-mail-with-sendmail)
9e0a8576 674 ((and (locate-library "smtpmail")
aa8f8277 675 (boundp 'smtpmail-default-smtp-server)
9e0a8576
RS
676 smtpmail-default-smtp-server)
677 'message-smtpmail-send-it)
678 ((locate-library "mailclient")
2ea6167b
RS
679 'message-send-mail-with-mailclient)
680 (t
aa8f8277 681 (error "Don't know how to send mail. Please customize `message-send-mail-function'"))))
2ea6167b 682
eec82323 683;; Useful to set in site-init.el
ac1af635
GM
684(defcustom message-send-mail-function
685 (cond ((eq send-mail-function 'smtpmail-send-it) 'message-smtpmail-send-it)
686 ((eq send-mail-function 'feedmail-send-it) 'feedmail-send-it)
687 ((eq send-mail-function 'mailclient-send-it)
688 'message-send-mail-with-mailclient)
689 (t (message-send-mail-function)))
eec82323
LMI
690 "Function to call to send the current buffer as mail.
691The headers should be delimited by a line whose contents match the
692variable `mail-header-separator'.
693
2ea6167b 694Valid values include `message-send-mail-with-sendmail'
7d829636 695`message-send-mail-with-mh', `message-send-mail-with-qmail',
2ea6167b
RS
696`message-smtpmail-send-it', `smtpmail-send-it',
697`feedmail-send-it' and `message-send-mail-with-mailclient'. The
8f7abae3
MB
698default is system dependent and determined by the function
699`message-send-mail-function'.
7d829636
DL
700
701See also `send-mail-function'."
eec82323
LMI
702 :type '(radio (function-item message-send-mail-with-sendmail)
703 (function-item message-send-mail-with-mh)
704 (function-item message-send-mail-with-qmail)
23f87bed 705 (function-item message-smtpmail-send-it)
6748645f 706 (function-item smtpmail-send-it)
7d829636 707 (function-item feedmail-send-it)
2ea6167b
RS
708 (function-item message-send-mail-with-mailclient
709 :tag "Use Mailclient package")
710 (function :tag "Other"))
eec82323 711 :group 'message-sending
ac1af635 712 :version "23.2"
2ea6167b 713 :initialize 'custom-initialize-default
23f87bed 714 :link '(custom-manual "(message)Mail Variables")
eec82323
LMI
715 :group 'message-mail)
716
717(defcustom message-send-news-function 'message-send-news
718 "Function to call to send the current buffer as news.
719The headers should be delimited by a line whose contents match the
720variable `mail-header-separator'."
721 :group 'message-sending
722 :group 'message-news
23f87bed 723 :link '(custom-manual "(message)News Variables")
eec82323
LMI
724 :type 'function)
725
726(defcustom message-reply-to-function nil
7d829636 727 "If non-nil, function that should return a list of headers.
eec82323
LMI
728This function should pick out addresses from the To, Cc, and From headers
729and respond with new To and Cc headers."
730 :group 'message-interface
23f87bed 731 :link '(custom-manual "(message)Reply")
7d829636 732 :type '(choice function (const nil)))
eec82323
LMI
733
734(defcustom message-wide-reply-to-function nil
7d829636 735 "If non-nil, function that should return a list of headers.
eec82323
LMI
736This function should pick out addresses from the To, Cc, and From headers
737and respond with new To and Cc headers."
738 :group 'message-interface
23f87bed 739 :link '(custom-manual "(message)Wide Reply")
7d829636 740 :type '(choice function (const nil)))
eec82323
LMI
741
742(defcustom message-followup-to-function nil
7d829636 743 "If non-nil, function that should return a list of headers.
eec82323
LMI
744This function should pick out addresses from the To, Cc, and From headers
745and respond with new To and Cc headers."
746 :group 'message-interface
23f87bed 747 :link '(custom-manual "(message)Followup")
7d829636 748 :type '(choice function (const nil)))
eec82323 749
01c52d31
MB
750(defcustom message-extra-wide-headers nil
751 "If non-nil, a list of additional address headers.
752These are used when composing a wide reply."
753 :group 'message-sending
754 :type '(repeat string))
755
eec82323
LMI
756(defcustom message-use-followup-to 'ask
757 "*Specifies what to do with Followup-To header.
758If nil, always ignore the header. If it is t, use its value, but
759query before using the \"poster\" value. If it is the symbol `ask',
760always query the user whether to use the value. If it is the symbol
761`use', always use the value."
762 :group 'message-interface
23f87bed 763 :link '(custom-manual "(message)Followup")
eec82323 764 :type '(choice (const :tag "ignore" nil)
23f87bed 765 (const :tag "use & query" t)
eec82323
LMI
766 (const use)
767 (const ask)))
768
23f87bed
MB
769(defcustom message-use-mail-followup-to 'use
770 "*Specifies what to do with Mail-Followup-To header.
771If nil, always ignore the header. If it is the symbol `ask', always
772query the user whether to use the value. If it is the symbol `use',
773always use the value."
bf247b6e 774 :version "22.1"
23f87bed
MB
775 :group 'message-interface
776 :link '(custom-manual "(message)Mailing Lists")
777 :type '(choice (const :tag "ignore" nil)
778 (const use)
779 (const ask)))
780
781(defcustom message-subscribed-address-functions nil
782 "*Specifies functions for determining list subscription.
783If nil, do not attempt to determine list subscription with functions.
784If non-nil, this variable contains a list of functions which return
785regular expressions to match lists. These functions can be used in
786conjunction with `message-subscribed-regexps' and
787`message-subscribed-addresses'."
bf247b6e 788 :version "22.1"
23f87bed
MB
789 :group 'message-interface
790 :link '(custom-manual "(message)Mailing Lists")
791 :type '(repeat sexp))
792
793(defcustom message-subscribed-address-file nil
794 "*A file containing addresses the user is subscribed to.
795If nil, do not look at any files to determine list subscriptions. If
796non-nil, each line of this file should be a mailing list address."
bf247b6e 797 :version "22.1"
23f87bed
MB
798 :group 'message-interface
799 :link '(custom-manual "(message)Mailing Lists")
ad136a7c 800 :type '(radio file (const nil)))
23f87bed
MB
801
802(defcustom message-subscribed-addresses nil
803 "*Specifies a list of addresses the user is subscribed to.
804If nil, do not use any predefined list subscriptions. This list of
805addresses can be used in conjunction with
806`message-subscribed-address-functions' and `message-subscribed-regexps'."
bf247b6e 807 :version "22.1"
23f87bed
MB
808 :group 'message-interface
809 :link '(custom-manual "(message)Mailing Lists")
810 :type '(repeat string))
811
812(defcustom message-subscribed-regexps nil
813 "*Specifies a list of addresses the user is subscribed to.
814If nil, do not use any predefined list subscriptions. This list of
815regular expressions can be used in conjunction with
816`message-subscribed-address-functions' and `message-subscribed-addresses'."
bf247b6e 817 :version "22.1"
23f87bed
MB
818 :group 'message-interface
819 :link '(custom-manual "(message)Mailing Lists")
820 :type '(repeat regexp))
821
822(defcustom message-allow-no-recipients 'ask
823 "Specifies what to do when there are no recipients other than Gcc/Fcc.
824If it is the symbol `always', the posting is allowed. If it is the
825symbol `never', the posting is not allowed. If it is the symbol
826`ask', you are prompted."
bf247b6e 827 :version "22.1"
23f87bed
MB
828 :group 'message-interface
829 :link '(custom-manual "(message)Message Headers")
830 :type '(choice (const always)
831 (const never)
832 (const ask)))
833
eec82323 834(defcustom message-sendmail-f-is-evil nil
7d829636 835 "*Non-nil means don't add \"-f username\" to the sendmail command line.
16409b0b 836Doing so would be even more evil than leaving it out."
eec82323 837 :group 'message-sending
23f87bed 838 :link '(custom-manual "(message)Mail Variables")
eec82323
LMI
839 :type 'boolean)
840
4332f3ec 841(defcustom message-sendmail-envelope-from
937e60c8
KY
842 ;; Default to the value of `mail-envelope-from' if available.
843 ;; Note: as for Emacsen that Gnus supports, except for SXEmacs, it is
844 ;; unavailable unless sendmail.el is loaded.
845 (if (boundp 'mail-envelope-from) mail-envelope-from)
23f87bed
MB
846 "*Envelope-from when sending mail with sendmail.
847If this is nil, use `user-mail-address'. If it is the symbol
848`header', use the From: header of the message."
937e60c8 849 :version "23.2"
23f87bed
MB
850 :type '(choice (string :tag "From name")
851 (const :tag "Use From: header from message" header)
852 (const :tag "Use `user-mail-address'" nil))
853 :link '(custom-manual "(message)Mail Variables")
854 :group 'message-sending)
855
01c52d31
MB
856(defcustom message-sendmail-extra-arguments nil
857 "Additional arguments to `sendmail-program'."
858 ;; E.g. '("-a" "account") for msmtp
330f707b 859 :version "23.1" ;; No Gnus
01c52d31
MB
860 :type '(repeat string)
861 ;; :link '(custom-manual "(message)Mail Variables")
862 :group 'message-sending)
863
eec82323
LMI
864;; qmail-related stuff
865(defcustom message-qmail-inject-program "/var/qmail/bin/qmail-inject"
866 "Location of the qmail-inject program."
867 :group 'message-sending
23f87bed 868 :link '(custom-manual "(message)Mail Variables")
eec82323
LMI
869 :type 'file)
870
871(defcustom message-qmail-inject-args nil
872 "Arguments passed to qmail-inject programs.
2b8f62e9
JB
873This should be a list of strings, one string for each argument.
874It may also be a function.
eec82323
LMI
875
876For e.g., if you wish to set the envelope sender address so that bounces
877go to the right place or to deal with listserv's usage of that address, you
878might set this variable to '(\"-f\" \"you@some.where\")."
879 :group 'message-sending
23f87bed
MB
880 :link '(custom-manual "(message)Mail Variables")
881 :type '(choice (function)
882 (repeat string)))
eec82323 883
9efa445f
DN
884(defvar gnus-post-method)
885(defvar gnus-select-method)
eec82323
LMI
886(defcustom message-post-method
887 (cond ((and (boundp 'gnus-post-method)
6748645f 888 (listp gnus-post-method)
eec82323
LMI
889 gnus-post-method)
890 gnus-post-method)
891 ((boundp 'gnus-select-method)
892 gnus-select-method)
893 (t '(nnspool "")))
6748645f
LMI
894 "*Method used to post news.
895Note that when posting from inside Gnus, for instance, this
896variable isn't used."
eec82323
LMI
897 :group 'message-news
898 :group 'message-sending
899 ;; This should be the `gnus-select-method' widget, but that might
900 ;; create a dependence to `gnus.el'.
901 :type 'sexp)
902
23f87bed
MB
903;; FIXME: This should be a temporary workaround until someone implements a
904;; proper solution. If a crash happens while replying, the auto-save file
905;; will *not* have a `References:' header if `message-generate-headers-first'
906;; is nil. See: http://article.gmane.org/gmane.emacs.gnus.general/51138
907(defcustom message-generate-headers-first '(references)
908 "Which headers should be generated before starting to compose a message.
f5d01350 909If t, generate all required headers. This can also be a list of headers to
23f87bed
MB
910generate. The variables `message-required-news-headers' and
911`message-required-mail-headers' specify which headers to generate.
912
913Note that the variable `message-deletable-headers' specifies headers which
914are to be deleted and then re-generated before sending, so this variable
915will not have a visible effect for those headers."
eec82323 916 :group 'message-headers
23f87bed
MB
917 :link '(custom-manual "(message)Message Headers")
918 :type '(choice (const :tag "None" nil)
01c52d31
MB
919 (const :tag "References" '(references))
920 (const :tag "All" t)
921 (repeat (sexp :tag "Header"))))
922
923(defcustom message-fill-column 72
924 "Column beyond which automatic line-wrapping should happen.
925Local value for message buffers. If non-nil, also turn on
926auto-fill in message buffers."
927 :group 'message-various
928 ;; :link '(custom-manual "(message)Message Headers")
929 :type '(choice (const :tag "Don't turn on auto fill" nil)
930 (integer)))
eec82323 931
4e14547f
CY
932(defcustom message-setup-hook nil
933 "Normal hook, run each time a new outgoing message is initialized.
934The function `message-setup' runs this hook."
935 :group 'message-various
936 :link '(custom-manual "(message)Various Message Variables")
937 :type 'hook)
eec82323 938
16409b0b
GM
939(defcustom message-cancel-hook nil
940 "Hook run when cancelling articles."
941 :group 'message-various
23f87bed 942 :link '(custom-manual "(message)Various Message Variables")
16409b0b
GM
943 :type 'hook)
944
eec82323
LMI
945(defcustom message-signature-setup-hook nil
946 "Normal hook, run each time a new outgoing message is initialized.
947It is run after the headers have been inserted and before
948the signature is inserted."
949 :group 'message-various
23f87bed 950 :link '(custom-manual "(message)Various Message Variables")
eec82323
LMI
951 :type 'hook)
952
953(defcustom message-mode-hook nil
954 "Hook run in message mode buffers."
955 :group 'message-various
956 :type 'hook)
957
958(defcustom message-header-hook nil
959 "Hook run in a message mode buffer narrowed to the headers."
960 :group 'message-various
961 :type 'hook)
962
963(defcustom message-header-setup-hook nil
6748645f 964 "Hook called narrowed to the headers when setting up a message buffer."
eec82323 965 :group 'message-various
23f87bed 966 :link '(custom-manual "(message)Various Message Variables")
eec82323
LMI
967 :type 'hook)
968
23f87bed
MB
969(defcustom message-minibuffer-local-map
970 (let ((map (make-sparse-keymap 'message-minibuffer-local-map)))
971 (set-keymap-parent map minibuffer-local-map)
972 map)
e2642250 973 "Keymap for `message-read-from-minibuffer'."
d0859c9a
MB
974 :version "22.1"
975 :group 'message-various)
23f87bed 976
eec82323 977(defcustom message-citation-line-function 'message-insert-citation-line
23f87bed
MB
978 "*Function called to insert the \"Whomever writes:\" line.
979
01c52d31 980Predefined functions include `message-insert-citation-line' and
4d8a28ec 981`message-insert-formatted-citation-line' (see the variable
01c52d31
MB
982`message-citation-line-format').
983
23f87bed
MB
984Note that Gnus provides a feature where the reader can click on
985`writes:' to hide the cited text. If you change this line too much,
986people who read your message will have to change their Gnus
987configuration. See the variable `gnus-cite-attribution-suffix'."
01c52d31
MB
988 :type '(choice
989 (function-item :tag "plain" message-insert-citation-line)
4d8a28ec 990 (function-item :tag "formatted" message-insert-formatted-citation-line)
01c52d31 991 (function :tag "Other"))
23f87bed 992 :link '(custom-manual "(message)Insertion Variables")
eec82323
LMI
993 :group 'message-insertion)
994
01c52d31
MB
995(defcustom message-citation-line-format "On %a, %b %d %Y, %N wrote:\n"
996 "Format of the \"Whomever writes:\" line.
997
998The string is formatted using `format-spec'. The following
999constructs are replaced:
1000
1001 %f The full From, e.g. \"John Doe <john.doe@example.invalid>\".
1002 %n The mail address, e.g. \"john.doe@example.invalid\".
1003 %N The real name if present, e.g.: \"John Doe\", else fall
1004 back to the mail address.
1005 %F The first name if present, e.g.: \"John\".
1006 %L The last name if present, e.g.: \"Doe\".
1007
1008All other format specifiers are passed to `format-time-string'
1009which is called using the date from the article your replying to.
1010Extracting the first (%F) and last name (%L) is done
1011heuristically, so you should always check it yourself.
1012
1013Please also read the note in the documentation of
1014`message-citation-line-function'."
1015 :type '(choice (const :tag "Plain" "%f writes:")
1016 (const :tag "Include date" "On %a, %b %d %Y, %n wrote:")
1017 string)
1018 :link '(custom-manual "(message)Insertion Variables")
330f707b 1019 :version "23.1" ;; No Gnus
01c52d31
MB
1020 :group 'message-insertion)
1021
937e60c8
KY
1022(defcustom message-yank-prefix
1023 ;; Default to the value of `mail-yank-prefix' if available.
1024 ;; Note: as for Emacs 21, it is unavailable unless sendmail.el is loaded.
1025 (if (boundp 'mail-yank-prefix) mail-yank-prefix "> ")
23f87bed
MB
1026 "*Prefix inserted on the lines of yanked messages.
1027Fix `message-cite-prefix-regexp' if it is set to an abnormal value.
01c52d31 1028See also `message-yank-cited-prefix' and `message-yank-empty-prefix'."
937e60c8 1029 :version "23.2"
23f87bed
MB
1030 :type 'string
1031 :link '(custom-manual "(message)Insertion Variables")
1032 :group 'message-insertion)
1033
1034(defcustom message-yank-cited-prefix ">"
01c52d31 1035 "*Prefix inserted on cited lines of yanked messages.
23f87bed 1036Fix `message-cite-prefix-regexp' if it is set to an abnormal value.
01c52d31
MB
1037See also `message-yank-prefix' and `message-yank-empty-prefix'."
1038 :version "22.1"
1039 :type 'string
1040 :link '(custom-manual "(message)Insertion Variables")
1041 :group 'message-insertion)
1042
1043(defcustom message-yank-empty-prefix ">"
1044 "*Prefix inserted on empty lines of yanked messages.
1045See also `message-yank-prefix' and `message-yank-cited-prefix'."
bf247b6e 1046 :version "22.1"
eec82323 1047 :type 'string
23f87bed 1048 :link '(custom-manual "(message)Insertion Variables")
eec82323
LMI
1049 :group 'message-insertion)
1050
4332f3ec 1051(defcustom message-indentation-spaces
937e60c8
KY
1052 ;; Default to the value of `mail-indentation-spaces' if available.
1053 ;; Note: as for Emacs 21, XEmacs 21.4 and 21.5, it is unavailable
1054 ;; unless sendmail.el is loaded.
1055 (if (boundp 'mail-indentation-spaces) mail-indentation-spaces 3)
eec82323
LMI
1056 "*Number of spaces to insert at the beginning of each cited line.
1057Used by `message-yank-original' via `message-yank-cite'."
937e60c8 1058 :version "23.2"
eec82323 1059 :group 'message-insertion
23f87bed 1060 :link '(custom-manual "(message)Insertion Variables")
eec82323
LMI
1061 :type 'integer)
1062
9b3ebcb6 1063(defcustom message-cite-function 'message-cite-original-without-signature
4a55f847
RS
1064 "*Function for citing an original message.
1065Predefined functions include `message-cite-original' and
1066`message-cite-original-without-signature'.
01c52d31 1067Note that these functions use `mail-citation-hook' if that is non-nil."
eec82323 1068 :type '(radio (function-item message-cite-original)
16409b0b 1069 (function-item message-cite-original-without-signature)
eec82323
LMI
1070 (function-item sc-cite-original)
1071 (function :tag "Other"))
23f87bed 1072 :link '(custom-manual "(message)Insertion Variables")
d55fe5bb 1073 :version "22.3" ;; Gnus 5.10.12 (changed default)
eec82323
LMI
1074 :group 'message-insertion)
1075
eec82323
LMI
1076(defcustom message-indent-citation-function 'message-indent-citation
1077 "*Function for modifying a citation just inserted in the mail buffer.
1078This can also be a list of functions. Each function can find the
1079citation between (point) and (mark t). And each function should leave
1080point and mark around the citation text as modified."
1081 :type 'function
23f87bed 1082 :link '(custom-manual "(message)Insertion Variables")
eec82323
LMI
1083 :group 'message-insertion)
1084
937e60c8
KY
1085(defcustom message-signature mail-signature
1086 ;; Default to the value of `mail-signature', available in all Emacsen
1087 ;; that Gnus supports.
eec82323
LMI
1088 "*String to be inserted at the end of the message buffer.
1089If t, the `message-signature-file' file will be inserted instead.
1090If a function, the result from the function will be used instead.
1091If a form, the result from the form will be used instead."
937e60c8 1092 :version "23.2"
eec82323 1093 :type 'sexp
23f87bed 1094 :link '(custom-manual "(message)Insertion Variables")
eec82323
LMI
1095 :group 'message-insertion)
1096
4332f3ec 1097(defcustom message-signature-file
937e60c8
KY
1098 ;; Default to the value of `mail-signature-file' if available.
1099 ;; Note: as for Emacs 21, XEmacs 21.4 and 21.5, it is unavailable
1100 ;; unless sendmail.el is loaded.
1101 (if (boundp 'mail-signature-file) mail-signature-file "~/.signature")
5449c317
DL
1102 "*Name of file containing the text inserted at end of message buffer.
1103Ignored if the named file doesn't exist.
01c52d31
MB
1104If nil, don't insert a signature.
1105If a path is specified, the value of `message-signature-directory' is ignored,
1106even if set."
937e60c8 1107 :version "23.2"
5449c317 1108 :type '(choice file (const :tags "None" nil))
23f87bed
MB
1109 :link '(custom-manual "(message)Insertion Variables")
1110 :group 'message-insertion)
1111
01c52d31
MB
1112(defcustom message-signature-directory nil
1113 "*Name of directory containing signature files.
1114Comes in handy if you have many such files, handled via posting styles for
1115instance.
1116If nil, `message-signature-file' is expected to specify the directory if
1117needed."
1118 :type '(choice string (const :tags "None" nil))
1119 :link '(custom-manual "(message)Insertion Variables")
1120 :group 'message-insertion)
1121
23f87bed
MB
1122(defcustom message-signature-insert-empty-line t
1123 "*If non-nil, insert an empty line before the signature separator."
bf247b6e 1124 :version "22.1"
23f87bed
MB
1125 :type 'boolean
1126 :link '(custom-manual "(message)Insertion Variables")
eec82323
LMI
1127 :group 'message-insertion)
1128
1129(defcustom message-distribution-function nil
1130 "*Function called to return a Distribution header."
1131 :group 'message-news
1132 :group 'message-headers
23f87bed 1133 :link '(custom-manual "(message)News Headers")
7d829636 1134 :type '(choice function (const nil)))
eec82323
LMI
1135
1136(defcustom message-expires 14
1137 "Number of days before your article expires."
1138 :group 'message-news
1139 :group 'message-headers
1140 :link '(custom-manual "(message)News Headers")
1141 :type 'integer)
1142
1143(defcustom message-user-path nil
1144 "If nil, use the NNTP server name in the Path header.
1145If stringp, use this; if non-nil, use no host name (user name only)."
1146 :group 'message-news
1147 :group 'message-headers
1148 :link '(custom-manual "(message)News Headers")
1149 :type '(choice (const :tag "nntp" nil)
1150 (string :tag "name")
1151 (sexp :tag "none" :format "%t" t)))
1152
b1ea3797
CY
1153;; This can be the name of a buffer, or a cons cell (FUNCTION . ARGS)
1154;; for yanking the original buffer.
eec82323 1155(defvar message-reply-buffer nil)
23f87bed
MB
1156(defvar message-reply-headers nil
1157 "The headers of the current replied article.
1158It is a vector of the following headers:
1159\[number subject from date id references chars lines xref extra].")
eec82323
LMI
1160(defvar message-newsreader nil)
1161(defvar message-mailer nil)
1162(defvar message-sent-message-via nil)
1163(defvar message-checksum nil)
1164(defvar message-send-actions nil
1165 "A list of actions to be performed upon successful sending of a message.")
1166(defvar message-exit-actions nil
1167 "A list of actions to be performed upon exiting after sending a message.")
1168(defvar message-kill-actions nil
1169 "A list of actions to be performed before killing a message buffer.")
1170(defvar message-postpone-actions nil
1171 "A list of actions to be performed after postponing a message.")
1172
6748645f
LMI
1173(define-widget 'message-header-lines 'text
1174 "All header lines must be LFD terminated."
3536d0c1 1175 :format "%{%t%}:%n%v"
6748645f
LMI
1176 :valid-regexp "^\\'"
1177 :error "All header lines must be newline terminated")
1178
481134fd 1179(defcustom message-default-headers ""
eec82323
LMI
1180 "*A string containing header lines to be inserted in outgoing messages.
1181It is inserted before you edit the message, so you can edit or delete
1182these lines."
937e60c8 1183 :version "23.2"
eec82323 1184 :group 'message-headers
23f87bed 1185 :link '(custom-manual "(message)Message Headers")
6748645f 1186 :type 'message-header-lines)
eec82323 1187
dc4d6273
GM
1188(defcustom message-default-mail-headers
1189 ;; Ease the transition from mail-mode to message-mode. See bugs#4431, 5555.
1190 (concat (if (and (boundp 'mail-default-reply-to)
1191 (stringp mail-default-reply-to))
481134fd 1192 (format "Reply-to: %s\n" mail-default-reply-to))
dc4d6273
GM
1193 (if (and (boundp 'mail-self-blind)
1194 mail-self-blind)
481134fd 1195 (format "BCC: %s\n" user-mail-address))
dc4d6273
GM
1196 (if (and (boundp 'mail-archive-file-name)
1197 (stringp mail-archive-file-name))
481134fd
CY
1198 (format "FCC: %s\n" mail-archive-file-name))
1199 ;; Use the value of `mail-default-headers' if available.
1200 ;; Note: as for Emacs 21, XEmacs 21.4 and 21.5, it is
1201 ;; unavailable unless sendmail.el is loaded.
1202 (if (boundp 'mail-default-headers)
1203 mail-default-headers))
eec82323 1204 "*A string of header lines to be inserted in outgoing mails."
dc4d6273 1205 :version "23.2"
eec82323
LMI
1206 :group 'message-headers
1207 :group 'message-mail
23f87bed 1208 :link '(custom-manual "(message)Mail Headers")
6748645f 1209 :type 'message-header-lines)
eec82323
LMI
1210
1211(defcustom message-default-news-headers ""
16409b0b 1212 "*A string of header lines to be inserted in outgoing news articles."
eec82323
LMI
1213 :group 'message-headers
1214 :group 'message-news
23f87bed 1215 :link '(custom-manual "(message)News Headers")
6748645f 1216 :type 'message-header-lines)
eec82323
LMI
1217
1218;; Note: could use /usr/ucb/mail instead of sendmail;
1219;; options -t, and -v if not interactive.
1220(defcustom message-mailer-swallows-blank-line
1221 (if (and (string-match "sparc-sun-sunos\\(\\'\\|[^5]\\)"
1222 system-configuration)
1223 (file-readable-p "/etc/sendmail.cf")
1224 (let ((buffer (get-buffer-create " *temp*")))
1225 (unwind-protect
82816ba1 1226 (with-current-buffer buffer
eec82323
LMI
1227 (insert-file-contents "/etc/sendmail.cf")
1228 (goto-char (point-min))
1229 (let ((case-fold-search nil))
1230 (re-search-forward "^OR\\>" nil t)))
1231 (kill-buffer buffer))))
1232 ;; According to RFC822, "The field-name must be composed of printable
1233 ;; ASCII characters (i. e., characters that have decimal values between
1234 ;; 33 and 126, except colon)", i. e., any chars except ctl chars,
1235 ;; space, or colon.
1236 '(looking-at "[ \t]\\|[][!\"#$%&'()*+,-./0-9;<=>?@A-Z\\\\^_`a-z{|}~]+:"))
6748645f 1237 "*Set this non-nil if the system's mailer runs the header and body together.
eec82323
LMI
1238\(This problem exists on Sunos 4 when sendmail is run in remote mode.)
1239The value should be an expression to test whether the problem will
1240actually occur."
1241 :group 'message-sending
23f87bed 1242 :link '(custom-manual "(message)Mail Variables")
eec82323
LMI
1243 :type 'sexp)
1244
961a48db 1245;;;###autoload
16409b0b
GM
1246(define-mail-user-agent 'message-user-agent
1247 'message-mail 'message-send-and-exit
1248 'message-kill-buffer 'message-send-hook)
eec82323
LMI
1249
1250(defvar message-mh-deletable-headers '(Message-ID Date Lines Sender)
1251 "If non-nil, delete the deletable headers before feeding to mh.")
1252
a8151ef7
LMI
1253(defvar message-send-method-alist
1254 '((news message-news-p message-send-via-news)
1255 (mail message-mail-p message-send-via-mail))
1256 "Alist of ways to send outgoing messages.
1257Each element has the form
1258
1259 \(TYPE PREDICATE FUNCTION)
1260
1261where TYPE is a symbol that names the method; PREDICATE is a function
1262called without any parameters to determine whether the message is
1263a message of type TYPE; and FUNCTION is a function to be called if
1264PREDICATE returns non-nil. FUNCTION is called with one parameter --
1265the prefix.")
1266
c541eb9a 1267(defcustom message-mail-alias-type 'abbrev
a8151ef7 1268 "*What alias expansion type to use in Message buffers.
01c52d31
MB
1269The default is `abbrev', which uses mailabbrev. `ecomplete' uses
1270an electric completion mode. nil switches mail aliases off.
1271This can also be a list of values."
c541eb9a
DL
1272 :group 'message
1273 :link '(custom-manual "(message)Mail Aliases")
1274 :type '(choice (const :tag "Use Mailabbrev" abbrev)
01c52d31 1275 (const :tag "Use ecomplete" ecomplete)
c541eb9a 1276 (const :tag "No expansion" nil)))
a8151ef7 1277
01c52d31
MB
1278(defcustom message-self-insert-commands '(self-insert-command)
1279 "List of `self-insert-command's used to trigger ecomplete.
1280When one of those commands is invoked to enter a character in To or Cc
1281header, ecomplete will suggest the candidates of recipients (see also
1282`message-mail-alias-type'). If you use some tool to enter non-ASCII
1283text and it replaces `self-insert-command' with the other command, e.g.
1284`egg-self-insert-command', you may want to add it to this list."
1285 :group 'message-various
1286 :type '(repeat function))
1287
6748645f 1288(defcustom message-auto-save-directory
aa8f8277 1289 (file-name-as-directory (expand-file-name "drafts" message-directory))
6748645f
LMI
1290 "*Directory where Message auto-saves buffers if Gnus isn't running.
1291If nil, Message won't auto-save."
1292 :group 'message-buffers
23f87bed 1293 :link '(custom-manual "(message)Various Message Variables")
7d829636 1294 :type '(choice directory (const :tag "Don't auto-save" nil)))
6748645f 1295
7d829636 1296(defcustom message-default-charset
83595c0c
DL
1297 (and (not (mm-multibyte-p)) 'iso-8859-1)
1298 "Default charset used in non-MULE Emacsen.
1299If nil, you might be asked to input the charset."
2d447df6 1300 :version "21.1"
16409b0b 1301 :group 'message
23f87bed 1302 :link '(custom-manual "(message)Various Message Variables")
16409b0b
GM
1303 :type 'symbol)
1304
7d829636 1305(defcustom message-dont-reply-to-names
16409b0b 1306 (and (boundp 'rmail-dont-reply-to-names) rmail-dont-reply-to-names)
01c52d31 1307 "*Addresses to prune when doing wide replies.
82816ba1 1308This can be a regexp or a list of regexps. Also, a value of nil means
01c52d31 1309exclude your own user name only."
2d447df6 1310 :version "21.1"
16409b0b 1311 :group 'message
23f87bed 1312 :link '(custom-manual "(message)Wide Reply")
16409b0b 1313 :type '(choice (const :tag "Yourself" nil)
01c52d31
MB
1314 regexp
1315 (repeat :tag "Regexp List" regexp)))
1316
1317(defsubst message-dont-reply-to-names ()
1318 (gmm-regexp-concat message-dont-reply-to-names))
16409b0b 1319
23f87bed
MB
1320(defvar message-shoot-gnksa-feet nil
1321 "*A list of GNKSA feet you are allowed to shoot.
1322Gnus gives you all the opportunity you could possibly want for
1323shooting yourself in the foot. Also, Gnus allows you to shoot the
1324feet of Good Net-Keeping Seal of Approval. The following are foot
1325candidates:
1326`empty-article' Allow you to post an empty article;
1327`quoted-text-only' Allow you to post quoted text only;
1328`multiple-copies' Allow you to post multiple copies;
1329`cancel-messages' Allow you to cancel or supersede messages from
01c52d31 1330 your other email addresses.")
23f87bed
MB
1331
1332(defsubst message-gnksa-enable-p (feature)
1333 (or (not (listp message-shoot-gnksa-feet))
1334 (memq feature message-shoot-gnksa-feet)))
1335
01c52d31
MB
1336(defcustom message-hidden-headers '("^References:" "^Face:" "^X-Face:"
1337 "^X-Draft-From:")
23f87bed
MB
1338 "Regexp of headers to be hidden when composing new messages.
1339This can also be a list of regexps to match headers. Or a list
1340starting with `not' and followed by regexps."
bf247b6e 1341 :version "22.1"
23f87bed
MB
1342 :group 'message
1343 :link '(custom-manual "(message)Message Headers")
01c52d31
MB
1344 :type '(choice
1345 :format "%{%t%}: %[Value Type%] %v"
1346 (regexp :menu-tag "regexp" :format "regexp\n%t: %v")
1347 (repeat :menu-tag "(regexp ...)" :format "(regexp ...)\n%v%i"
1348 (regexp :format "%t: %v"))
1349 (cons :menu-tag "(not regexp ...)" :format "(not regexp ...)\n%v"
1350 (const not)
1351 (repeat :format "%v%i"
1352 (regexp :format "%t: %v")))))
1353
1354(defcustom message-cite-articles-with-x-no-archive t
1355 "If non-nil, cite text from articles that has X-No-Archive set."
1356 :group 'message
1357 :type 'boolean)
23f87bed 1358
eec82323
LMI
1359;;; Internal variables.
1360;;; Well, not really internal.
1361
1362(defvar message-mode-syntax-table
1363 (let ((table (copy-syntax-table text-mode-syntax-table)))
1364 (modify-syntax-entry ?% ". " table)
16409b0b
GM
1365 (modify-syntax-entry ?> ". " table)
1366 (modify-syntax-entry ?< ". " table)
eec82323
LMI
1367 table)
1368 "Syntax table used while in Message mode.")
1369
0f49874b 1370(defface message-header-to
eec82323
LMI
1371 '((((class color)
1372 (background dark))
01c52d31 1373 (:foreground "DarkOliveGreen1" :bold t))
eec82323
LMI
1374 (((class color)
1375 (background light))
23f87bed 1376 (:foreground "MidnightBlue" :bold t))
eec82323 1377 (t
23f87bed 1378 (:bold t :italic t)))
eec82323
LMI
1379 "Face used for displaying From headers."
1380 :group 'message-faces)
0f49874b
MB
1381;; backward-compatibility alias
1382(put 'message-header-to-face 'face-alias 'message-header-to)
3d493bef 1383(put 'message-header-to-face 'obsolete-face "22.1")
eec82323 1384
0f49874b 1385(defface message-header-cc
eec82323
LMI
1386 '((((class color)
1387 (background dark))
01c52d31 1388 (:foreground "chartreuse1" :bold t))
eec82323
LMI
1389 (((class color)
1390 (background light))
1391 (:foreground "MidnightBlue"))
1392 (t
23f87bed 1393 (:bold t)))
eec82323
LMI
1394 "Face used for displaying Cc headers."
1395 :group 'message-faces)
0f49874b
MB
1396;; backward-compatibility alias
1397(put 'message-header-cc-face 'face-alias 'message-header-cc)
3d493bef 1398(put 'message-header-cc-face 'obsolete-face "22.1")
eec82323 1399
0f49874b 1400(defface message-header-subject
eec82323
LMI
1401 '((((class color)
1402 (background dark))
01c52d31 1403 (:foreground "OliveDrab1"))
eec82323
LMI
1404 (((class color)
1405 (background light))
23f87bed 1406 (:foreground "navy blue" :bold t))
eec82323 1407 (t
23f87bed 1408 (:bold t)))
eec82323
LMI
1409 "Face used for displaying subject headers."
1410 :group 'message-faces)
0f49874b
MB
1411;; backward-compatibility alias
1412(put 'message-header-subject-face 'face-alias 'message-header-subject)
3d493bef 1413(put 'message-header-subject-face 'obsolete-face "22.1")
eec82323 1414
0f49874b 1415(defface message-header-newsgroups
eec82323
LMI
1416 '((((class color)
1417 (background dark))
23f87bed 1418 (:foreground "yellow" :bold t :italic t))
eec82323
LMI
1419 (((class color)
1420 (background light))
23f87bed 1421 (:foreground "blue4" :bold t :italic t))
eec82323 1422 (t
23f87bed 1423 (:bold t :italic t)))
eec82323
LMI
1424 "Face used for displaying newsgroups headers."
1425 :group 'message-faces)
0f49874b
MB
1426;; backward-compatibility alias
1427(put 'message-header-newsgroups-face 'face-alias 'message-header-newsgroups)
3d493bef 1428(put 'message-header-newsgroups-face 'obsolete-face "22.1")
eec82323 1429
0f49874b 1430(defface message-header-other
eec82323
LMI
1431 '((((class color)
1432 (background dark))
01c52d31 1433 (:foreground "VioletRed1"))
eec82323
LMI
1434 (((class color)
1435 (background light))
1436 (:foreground "steel blue"))
1437 (t
23f87bed 1438 (:bold t :italic t)))
eec82323
LMI
1439 "Face used for displaying newsgroups headers."
1440 :group 'message-faces)
0f49874b
MB
1441;; backward-compatibility alias
1442(put 'message-header-other-face 'face-alias 'message-header-other)
3d493bef 1443(put 'message-header-other-face 'obsolete-face "22.1")
eec82323 1444
0f49874b 1445(defface message-header-name
eec82323
LMI
1446 '((((class color)
1447 (background dark))
01c52d31 1448 (:foreground "green"))
eec82323
LMI
1449 (((class color)
1450 (background light))
1451 (:foreground "cornflower blue"))
1452 (t
23f87bed 1453 (:bold t)))
eec82323
LMI
1454 "Face used for displaying header names."
1455 :group 'message-faces)
0f49874b
MB
1456;; backward-compatibility alias
1457(put 'message-header-name-face 'face-alias 'message-header-name)
3d493bef 1458(put 'message-header-name-face 'obsolete-face "22.1")
eec82323 1459
0f49874b 1460(defface message-header-xheader
eec82323
LMI
1461 '((((class color)
1462 (background dark))
01c52d31 1463 (:foreground "DeepSkyBlue1"))
eec82323
LMI
1464 (((class color)
1465 (background light))
1466 (:foreground "blue"))
1467 (t
23f87bed 1468 (:bold t)))
eec82323
LMI
1469 "Face used for displaying X-Header headers."
1470 :group 'message-faces)
0f49874b
MB
1471;; backward-compatibility alias
1472(put 'message-header-xheader-face 'face-alias 'message-header-xheader)
3d493bef 1473(put 'message-header-xheader-face 'obsolete-face "22.1")
eec82323 1474
0f49874b 1475(defface message-separator
eec82323
LMI
1476 '((((class color)
1477 (background dark))
01c52d31 1478 (:foreground "LightSkyBlue1"))
eec82323
LMI
1479 (((class color)
1480 (background light))
1481 (:foreground "brown"))
1482 (t
23f87bed 1483 (:bold t)))
eec82323
LMI
1484 "Face used for displaying the separator."
1485 :group 'message-faces)
0f49874b
MB
1486;; backward-compatibility alias
1487(put 'message-separator-face 'face-alias 'message-separator)
3d493bef 1488(put 'message-separator-face 'obsolete-face "22.1")
eec82323 1489
0f49874b 1490(defface message-cited-text
eec82323
LMI
1491 '((((class color)
1492 (background dark))
01c52d31 1493 (:foreground "LightPink1"))
eec82323
LMI
1494 (((class color)
1495 (background light))
1496 (:foreground "red"))
1497 (t
23f87bed 1498 (:bold t)))
eec82323
LMI
1499 "Face used for displaying cited text names."
1500 :group 'message-faces)
0f49874b
MB
1501;; backward-compatibility alias
1502(put 'message-cited-text-face 'face-alias 'message-cited-text)
3d493bef 1503(put 'message-cited-text-face 'obsolete-face "22.1")
eec82323 1504
0f49874b 1505(defface message-mml
16409b0b
GM
1506 '((((class color)
1507 (background dark))
01c52d31 1508 (:foreground "MediumSpringGreen"))
16409b0b
GM
1509 (((class color)
1510 (background light))
1511 (:foreground "ForestGreen"))
1512 (t
23f87bed 1513 (:bold t)))
16409b0b
GM
1514 "Face used for displaying MML."
1515 :group 'message-faces)
0f49874b
MB
1516;; backward-compatibility alias
1517(put 'message-mml-face 'face-alias 'message-mml)
3d493bef 1518(put 'message-mml-face 'obsolete-face "22.1")
16409b0b 1519
23f87bed
MB
1520(defun message-font-lock-make-header-matcher (regexp)
1521 (let ((form
1522 `(lambda (limit)
1523 (let ((start (point)))
1524 (save-restriction
1525 (widen)
1526 (goto-char (point-min))
1527 (if (re-search-forward
1528 (concat "^" (regexp-quote mail-header-separator) "$")
1529 nil t)
1530 (setq limit (min limit (match-beginning 0))))
1531 (goto-char start))
1532 (and (< start limit)
1533 (re-search-forward ,regexp limit t))))))
1534 (if (featurep 'bytecomp)
1535 (byte-compile form)
1536 form)))
1537
eec82323 1538(defvar message-font-lock-keywords
23f87bed
MB
1539 (let ((content "[ \t]*\\(.+\\(\n[ \t].*\\)*\\)\n?"))
1540 `((,(message-font-lock-make-header-matcher
1541 (concat "^\\([Tt]o:\\)" content))
0f49874b
MB
1542 (1 'message-header-name)
1543 (2 'message-header-to nil t))
23f87bed
MB
1544 (,(message-font-lock-make-header-matcher
1545 (concat "^\\(^[GBF]?[Cc][Cc]:\\|^[Rr]eply-[Tt]o:\\)" content))
0f49874b
MB
1546 (1 'message-header-name)
1547 (2 'message-header-cc nil t))
23f87bed
MB
1548 (,(message-font-lock-make-header-matcher
1549 (concat "^\\([Ss]ubject:\\)" content))
0f49874b
MB
1550 (1 'message-header-name)
1551 (2 'message-header-subject nil t))
23f87bed
MB
1552 (,(message-font-lock-make-header-matcher
1553 (concat "^\\([Nn]ewsgroups:\\|Followup-[Tt]o:\\)" content))
0f49874b
MB
1554 (1 'message-header-name)
1555 (2 'message-header-newsgroups nil t))
23f87bed 1556 (,(message-font-lock-make-header-matcher
01c52d31 1557 (concat "^\\(X-[A-Za-z0-9-]+:\\|In-Reply-To:\\)" content))
0f49874b 1558 (1 'message-header-name)
01c52d31 1559 (2 'message-header-xheader))
23f87bed 1560 (,(message-font-lock-make-header-matcher
01c52d31 1561 (concat "^\\([A-Z][^: \n\t]+:\\)" content))
0f49874b 1562 (1 'message-header-name)
01c52d31 1563 (2 'message-header-other nil t))
6748645f
LMI
1564 ,@(if (and mail-header-separator
1565 (not (equal mail-header-separator "")))
1566 `((,(concat "^\\(" (regexp-quote mail-header-separator) "\\)$")
0f49874b 1567 1 'message-separator))
6748645f 1568 nil)
23f87bed
MB
1569 ((lambda (limit)
1570 (re-search-forward (concat "^\\("
1571 message-cite-prefix-regexp
1572 "\\).*")
1573 limit t))
0f49874b 1574 (0 'message-cited-text))
23f87bed 1575 ("<#/?\\(multipart\\|part\\|external\\|mml\\|secure\\)[^>]*>"
0f49874b 1576 (0 'message-mml))))
eec82323
LMI
1577 "Additional expressions to highlight in Message mode.")
1578
23f87bed 1579
6748645f
LMI
1580;; XEmacs does it like this. For Emacs, we have to set the
1581;; `font-lock-defaults' buffer-local variable.
1582(put 'message-mode 'font-lock-defaults '(message-font-lock-keywords t))
1583
eec82323 1584(defvar message-face-alist
01c52d31 1585 '((bold . message-bold-region)
eec82323
LMI
1586 (underline . underline-region)
1587 (default . (lambda (b e)
01c52d31 1588 (message-unbold-region b e)
eec82323
LMI
1589 (ununderline-region b e))))
1590 "Alist of mail and news faces for facemenu.
8f688cb0 1591The cdr of each entry is a function for applying the face to a region.")
eec82323 1592
4e14547f
CY
1593(defcustom message-send-hook nil
1594 "Hook run before sending messages.
1595This hook is run quite early when sending."
1596 :group 'message-various
1597 :options '(ispell-message)
1598 :link '(custom-manual "(message)Various Message Variables")
1599 :type 'hook)
eec82323
LMI
1600
1601(defcustom message-send-mail-hook nil
23f87bed
MB
1602 "Hook run before sending mail messages.
1603This hook is run very late -- just before the message is sent as
1604mail."
eec82323 1605 :group 'message-various
23f87bed 1606 :link '(custom-manual "(message)Various Message Variables")
eec82323
LMI
1607 :type 'hook)
1608
1609(defcustom message-send-news-hook nil
23f87bed
MB
1610 "Hook run before sending news messages.
1611This hook is run very late -- just before the message is sent as
1612news."
eec82323 1613 :group 'message-various
23f87bed 1614 :link '(custom-manual "(message)Various Message Variables")
eec82323
LMI
1615 :type 'hook)
1616
1617(defcustom message-sent-hook nil
1618 "Hook run after sending messages."
1619 :group 'message-various
1620 :type 'hook)
1621
6748645f
LMI
1622(defvar message-send-coding-system 'binary
1623 "Coding system to encode outgoing mail.")
1624
16409b0b
GM
1625(defvar message-draft-coding-system
1626 mm-auto-save-coding-system
23f87bed
MB
1627 "*Coding system to compose mail.
1628If you'd like to make it possible to share draft files between XEmacs
1629and Emacs, you may use `iso-2022-7bit' for this value at your own risk.
1630Note that the coding-system `iso-2022-7bit' isn't suitable to all data.")
16409b0b 1631
8bff7c00 1632(defcustom message-send-mail-partially-limit nil
16409b0b 1633 "The limitation of messages sent as message/partial.
7d829636
DL
1634The lower bound of message size in characters, beyond which the message
1635should be sent in several parts. If it is nil, the size is unlimited."
1a10d421 1636 :version "24.1"
16409b0b 1637 :group 'message-buffers
23f87bed 1638 :link '(custom-manual "(message)Mail Variables")
16409b0b
GM
1639 :type '(choice (const :tag "unlimited" nil)
1640 (integer 1000000)))
1641
83595c0c 1642(defcustom message-alternative-emails nil
46e8fe3d
MB
1643 "*Regexp matching alternative email addresses.
1644The first address in the To, Cc or From headers of the original
1645article matching this variable is used as the From field of
1646outgoing messages.
1647
1648This variable has precedence over posting styles and anything that runs
1649off `message-setup-hook'."
83595c0c 1650 :group 'message-headers
23f87bed 1651 :link '(custom-manual "(message)Message Headers")
83595c0c
DL
1652 :type '(choice (const :tag "Always use primary" nil)
1653 regexp))
1654
23f87bed
MB
1655(defcustom message-hierarchical-addresses nil
1656 "A list of hierarchical mail address definitions.
1657
1658Inside each entry, the first address is the \"top\" address, and
1659subsequent addresses are subaddresses; this is used to indicate that
1660mail sent to the first address will automatically be delivered to the
1661subaddresses. So if the first address appears in the recipient list
1662for a message, the subaddresses will be removed (if present) before
1663the mail is sent. All addresses in this structure should be
1664downcased."
bf247b6e 1665 :version "22.1"
23f87bed
MB
1666 :group 'message-headers
1667 :type '(repeat (repeat string)))
1668
88818fbe
SZ
1669(defcustom message-mail-user-agent nil
1670 "Like `mail-user-agent'.
7d829636 1671Except if it is nil, use Gnus native MUA; if it is t, use
88818fbe 1672`mail-user-agent'."
bf247b6e 1673 :version "22.1"
88818fbe
SZ
1674 :type '(radio (const :tag "Gnus native"
1675 :format "%t\n"
1676 nil)
1677 (const :tag "`mail-user-agent'"
1678 :format "%t\n"
1679 t)
1680 (function-item :tag "Default Emacs mail"
1681 :format "%t\n"
1682 sendmail-user-agent)
1683 (function-item :tag "Emacs interface to MH"
1684 :format "%t\n"
1685 mh-e-user-agent)
1686 (function :tag "Other"))
1687 :version "21.1"
1688 :group 'message)
1689
23f87bed
MB
1690(defcustom message-wide-reply-confirm-recipients nil
1691 "Whether to confirm a wide reply to multiple email recipients.
1692If this variable is nil, don't ask whether to reply to all recipients.
1693If this variable is non-nil, pose the question \"Reply to all
1694recipients?\" before a wide reply to multiple recipients. If the user
1695answers yes, reply to all recipients as usual. If the user answers
1696no, only reply back to the author."
bf247b6e 1697 :version "22.1"
23f87bed
MB
1698 :group 'message-headers
1699 :link '(custom-manual "(message)Wide Reply")
1700 :type 'boolean)
1701
1702(defcustom message-user-fqdn nil
bcc7dd61 1703 "*Domain part of Message-Ids."
bf247b6e 1704 :version "22.1"
23f87bed
MB
1705 :group 'message-headers
1706 :link '(custom-manual "(message)News Headers")
1707 :type '(radio (const :format "%v " nil)
ad136a7c 1708 (string :format "FQDN: %v")))
23f87bed
MB
1709
1710(defcustom message-use-idna (and (condition-case nil (require 'idna)
1711 (file-error))
1712 (mm-coding-system-p 'utf-8)
1713 (executable-find idna-program)
a33704bb
MB
1714