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