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