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