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