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