Use file-accessible-directory-p in some more places
[bpt/emacs.git] / lisp / mh-e / mh-e.el
CommitLineData
c26cf6c8
RS
1;;; mh-e.el --- GNU Emacs interface to the MH mail system
2
1d75432d
GM
3;; Copyright (C) 1985-1988, 1990, 1992-1995, 1997, 1999-2014
4;; Free Software Foundation, Inc.
c26cf6c8 5
a1b4049d 6;; Author: Bill Wohler <wohler@newt.com>
6e65a812 7;; Maintainer: Bill Wohler <wohler@newt.com>
61fc6e60 8;; Version: 8.5+bzr
c26cf6c8
RS
9;; Keywords: mail
10
60370d40 11;; This file is part of GNU Emacs.
9b7bc076 12
5e809f55 13;; GNU Emacs is free software: you can redistribute it and/or modify
c26cf6c8 14;; it under the terms of the GNU General Public License as published by
5e809f55
GM
15;; the Free Software Foundation, either version 3 of the License, or
16;; (at your option) any later version.
c26cf6c8 17
9b7bc076 18;; GNU Emacs is distributed in the hope that it will be useful,
c26cf6c8
RS
19;; but WITHOUT ANY WARRANTY; without even the implied warranty of
20;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21;; GNU General Public License for more details.
22
23;; You should have received a copy of the GNU General Public License
5e809f55 24;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
c26cf6c8
RS
25
26;;; Commentary:
27
d2f8ce2f
BW
28;; MH-E is an Emacs interface to the MH mail system.
29
35fe9c60 30;; MH-E is supported in GNU Emacs 21 and higher, as well as XEmacs 21
d2f8ce2f
BW
31;; (except for versions 21.5.9-21.5.16). It is compatible with MH
32;; versions 6.8.4 and higher, all versions of nmh, and GNU mailutils
9e6f5938
BW
33;; 1.0 and higher. Gnus is also required; version 5.10 or higher is
34;; recommended.
d2f8ce2f
BW
35
36;; MH (Message Handler) is a powerful mail reader. See
37;; http://rand-mh.sourceforge.net/.
38
39;; N.B. MH must have been compiled with the MHE compiler flag or several
40;; features necessary for MH-E will be missing from MH commands, specifically
41;; the -build switch to repl and forw.
42
dda00b2c 43;; How to use:
a1b4049d
BW
44;; M-x mh-rmail to read mail. Type C-h m there for a list of commands.
45;; C-u M-x mh-rmail to visit any folder.
dda00b2c 46;; M-x mh-smail to send mail. From within the mail reader, "s" works, too.
b578f267 47
a1b4049d
BW
48;; Your .emacs might benefit from these bindings:
49;; (global-set-key "\C-cr" 'mh-rmail)
50;; (global-set-key "\C-xm" 'mh-smail)
51;; (global-set-key "\C-x4m" 'mh-smail-other-window)
b578f267 52
dda00b2c
BW
53;; If Emacs can't find mh-rmail or mh-smail, add the following to ~/.emacs:
54;; (require 'mh-autoloads)
55
56;; If you want to customize MH-E before explicitly loading it, add this:
57;; (require 'mh-cus-load)
58
a1b4049d
BW
59;; Mailing Lists:
60;; mh-e-users@lists.sourceforge.net
61;; mh-e-announce@lists.sourceforge.net
62;; mh-e-devel@lists.sourceforge.net
dda00b2c 63
a1b4049d
BW
64;; Subscribe by sending a "subscribe" message to
65;; <list>-request@lists.sourceforge.net, or by using the web interface at
66;; https://sourceforge.net/mail/?group_id=13357
67
68;; Bug Reports:
69;; https://sourceforge.net/tracker/?group_id=13357&atid=113357
dda00b2c
BW
70;; Include the output of M-x mh-version in the bug report unless
71;; you're 110% sure we won't ask for it.
a1b4049d
BW
72
73;; Feature Requests:
dda00b2c 74;; https://sourceforge.net/tracker/?group_id=13357&atid=363357
a1b4049d
BW
75
76;; Support:
77;; https://sourceforge.net/tracker/?group_id=13357&atid=213357
b578f267 78
717e06e5 79;;; Change Log:
b578f267
EN
80
81;; Original version for Gosling emacs by Brian Reid, Stanford, 1982.
82;; Modified by James Larus, BBN, July 1984 and UCB, 1984 & 1985.
f0d73c14
BW
83;; Rewritten for GNU Emacs, James Larus, 1985.
84;; Modified by Stephen Gildea, 1988.
85;; Maintenance picked up by Bill Wohler and the
86;; SourceForge Crew <http://mh-e.sourceforge.net/>, 2001.
a1b4049d 87
c26cf6c8
RS
88;;; Code:
89
dda00b2c
BW
90;; Provide functions to the rest of MH-E. However, mh-e.el must not
91;; use any definitions in files that require mh-e from mh-loaddefs,
92;; for if it does it will introduce a require loop.
92ec073e 93(require 'mh-loaddefs)
c3d9274a 94
f0d73c14 95(mh-require-cl)
a1b4049d 96
ebb4d60b
BW
97(require 'mh-buffers)
98(require 'mh-compat)
99
dda00b2c
BW
100(mh-do-in-xemacs
101 (require 'mh-xemacs))
102
30545916
BW
103(mh-font-lock-add-keywords
104 'emacs-lisp-mode
105 (eval-when-compile
106 `((,(concat "(\\("
107 ;; Function declarations (use font-lock-function-name-face).
c90c4cf1 108 "\\(def\\(un\\|macro\\)-mh\\)\\|"
30545916 109 ;; Variable declarations (use font-lock-variable-name-face).
c90c4cf1 110 "\\(def\\(custom\\|face\\)-mh\\)\\|"
30545916 111 ;; Group declarations (use font-lock-type-face).
c90c4cf1 112 "\\(defgroup-mh\\)"
30545916
BW
113 "\\)\\>"
114 ;; Any whitespace and defined object.
115 "[ \t'\(]*"
116 "\\(setf[ \t]+\\sw+)\\|\\sw+\\)?")
117 (1 font-lock-keyword-face)
118 (7 (cond ((match-beginning 2) font-lock-function-name-face)
119 ((match-beginning 4) font-lock-variable-name-face)
120 (t font-lock-type-face))
121 nil t)))))
122
dda00b2c 123\f
c26cf6c8 124
dda00b2c 125;;; Global Variables
a1b4049d 126
dda00b2c
BW
127;; Try to keep variables local to a single file. Provide accessors if
128;; variables are shared. Use this section as a last resort.
cee9f5c6 129
61fc6e60 130(defconst mh-version "8.5+bzr" "Version number of MH-E.")
a1b4049d 131
dda00b2c 132;; Variants
c3d9274a 133
dda00b2c
BW
134(defvar mh-sys-path
135 '("/usr/local/nmh/bin" ; nmh default
136 "/usr/local/bin/mh/"
137 "/usr/local/mh/"
138 "/usr/bin/mh/" ; Ultrix 4.2, Linux
139 "/usr/new/mh/" ; Ultrix < 4.2
140 "/usr/contrib/mh/bin/" ; BSDI
141 "/usr/pkg/bin/" ; NetBSD
142 "/usr/local/bin/"
efa47761
BW
143 "/usr/local/bin/mu-mh/" ; GNU mailutils MH - default
144 "/usr/bin/mu-mh/") ; GNU mailutils MH - packaged
dda00b2c
BW
145 "List of directories to search for variants of the MH variant.
146The list `exec-path' is searched in addition to this list.
147There's no need for users to modify this list. Instead add extra
148directories to the customizable variable `mh-path'.")
a1b4049d 149
dda00b2c
BW
150(defvar mh-variants nil
151 "List describing known MH variants.
152Do not access this variable directly as it may not have yet been initialized.
153Use the function `mh-variants' instead.")
bdcfe844 154
dda00b2c
BW
155(defvar mh-variant-in-use nil
156 "The MH variant currently in use; a string with variant and version number.
157This differs from `mh-variant' when the latter is set to
158\"autodetect\".")
bdcfe844 159
dda00b2c
BW
160(defvar mh-progs nil
161 "Directory containing MH commands, such as inc, repl, and rmm.")
162
163;;;###autoload
164(put 'mh-progs 'risky-local-variable t)
165
166(defvar mh-lib nil
167 "Directory containing the MH library.
168This directory contains, among other things, the components file.")
169
170;;;###autoload
171(put 'mh-lib 'risky-local-variable t)
172
173(defvar mh-lib-progs nil
174 "Directory containing MH helper programs.
175This directory contains, among other things, the mhl program.")
176
177;;;###autoload
178(put 'mh-lib-progs 'risky-local-variable t)
c26cf6c8 179
dda00b2c 180;; Profile Components
c26cf6c8 181
dda00b2c
BW
182(defvar mh-draft-folder nil
183 "Cached value of the \"Draft-Folder:\" MH profile component.
184Name of folder containing draft messages.
1b7916fb 185Do not use a draft folder if nil.")
d1699462 186
dda00b2c
BW
187(defvar mh-inbox nil
188 "Cached value of the \"Inbox:\" MH profile component.
189Set to \"+inbox\" if no such component.
190Name of the Inbox folder.")
d1699462 191
dda00b2c
BW
192(defvar mh-user-path nil
193 "Cached value of the \"Path:\" MH profile component.
194User's mail folder directory.")
195
196;; Maps declared here so that they can be used in docstrings.
c26cf6c8
RS
197
198(defvar mh-folder-mode-map (make-keymap)
dda00b2c
BW
199 "Keymap for MH-Folder mode.")
200
201(defvar mh-folder-seq-tool-bar-map nil
202 "Keymap for MH-Folder tool bar.")
203
204(defvar mh-folder-tool-bar-map nil
205 "Keymap for MH-Folder tool bar.")
206
207(defvar mh-inc-spool-map (make-sparse-keymap)
208 "Keymap for MH-E's mh-inc-spool commands.")
209
210(defvar mh-letter-mode-map (copy-keymap text-mode-map)
211 "Keymap for MH-Letter mode.")
212
213(defvar mh-letter-tool-bar-map nil
214 "Keymap for MH-Letter tool bar.")
215
216(defvar mh-search-mode-map (make-sparse-keymap)
217 "Keymap for MH-Search mode.")
218
219(defvar mh-show-mode-map (make-sparse-keymap)
220 "Keymap MH-Show mode.")
221
222(defvar mh-show-seq-tool-bar-map nil
223 "Keymap for MH-Show tool bar.")
224
225(defvar mh-show-tool-bar-map nil
226 "Keymap for MH-Show tool bar.")
227
228;; MH-Folder Locals (alphabetical)
c26cf6c8 229
d1699462
BW
230(defvar mh-arrow-marker nil
231 "Marker for arrow display in fringe.")
232
41b97610
BW
233(defvar mh-blacklist nil
234 "List of messages to use to train the junk filter.
235This variable can be used by
236`mh-before-commands-processed-hook'.")
237
dda00b2c
BW
238(defvar mh-colors-available-flag nil
239 "Non-nil means colors are available.")
240
241(defvar mh-current-folder nil
242 "Name of current folder, a string.")
243
d1699462
BW
244(defvar mh-delete-list nil
245 "List of message numbers to delete.
2dcf34f9
BW
246This variable can be used by
247`mh-before-commands-processed-hook'.")
3d7ca223 248
dda00b2c
BW
249(defvar mh-folder-view-stack nil
250 "Stack of previous folder views.")
251
252(defvar mh-index-data nil
253 "Info about index search results.")
254
255(defvar mh-index-previous-search nil)
256
257(defvar mh-index-msg-checksum-map nil)
258
259(defvar mh-index-checksum-origin-map nil)
260
261(defvar mh-index-sequence-search-flag nil)
262
263(defvar mh-mode-line-annotation nil
264 "Message range displayed in buffer.")
265
266(defvar mh-next-direction 'forward
267 "Direction to move to next message.")
268
269(defvar mh-previous-window-config nil
270 "Window configuration before MH-E command.")
271
d1699462
BW
272(defvar mh-refile-list nil
273 "List of folder names in `mh-seq-list'.
2dcf34f9
BW
274This variable can be used by
275`mh-before-commands-processed-hook'.")
c26cf6c8 276
dda00b2c
BW
277(defvar mh-seen-list nil
278 "List of displayed messages to be removed from the \"Unseen\" sequence.")
c26cf6c8 279
dda00b2c
BW
280(defvar mh-seq-list nil
281 "Alist of this folder's sequences.
282Elements have the form (SEQUENCE . MESSAGES).")
283
284(defvar mh-sequence-notation-history nil
285 "Remember original notation that is overwritten by `mh-note-seq'.")
286
287(defvar mh-show-buffer nil
288 "Buffer that displays message for this folder.")
2953de8c 289
56eb0904
SM
290(define-minor-mode mh-showing-mode
291 "Minor mode to show the message in a separate window."
292 ;; FIXME: maybe this should be moved to mh-show.el.
293 :lighter " Show")
dda00b2c
BW
294
295(defvar mh-view-ops nil
d1699462
BW
296 "Stack of operations that change the folder view.
297These operations include narrowing or threading.")
c26cf6c8 298
41b97610
BW
299(defvar mh-whitelist nil
300 "List of messages to use to train the junk filter.
301This variable can be used by
302`mh-before-commands-processed-hook'.")
303
dda00b2c 304;; MH-Show Locals (alphabetical)
d1699462 305
dda00b2c
BW
306(defvar mh-globals-hash (make-hash-table)
307 "Keeps track of MIME data on a per buffer basis.")
c26cf6c8 308
dda00b2c
BW
309(defvar mh-show-folder-buffer nil
310 "Keeps track of folder whose message is being displayed.")
c3d9274a 311
dda00b2c 312;; MH-Letter Locals
c26cf6c8 313
dda00b2c
BW
314(defvar mh-folders-changed nil
315 "Lists which folders were affected by deletes and refiles.
316This list will always include the current folder
317`mh-current-folder'. This variable can be used by
318`mh-after-commands-processed-hook'.")
c26cf6c8 319
dda00b2c
BW
320(defvar mh-mail-header-separator "--------"
321 "*Line used by MH to separate headers from text in messages being composed.
c26cf6c8 322
dda00b2c
BW
323This variable should not be used directly in programs. Programs
324should use `mail-header-separator' instead.
325`mail-header-separator' is initialized to
326`mh-mail-header-separator' in `mh-letter-mode'; in other
327contexts, you may have to perform this initialization yourself.
a66894d8 328
dda00b2c
BW
329Do not make this a regular expression as it may be the argument
330to `insert' and it is passed through `regexp-quote' before being
331used by functions like `re-search-forward'.")
f0d73c14 332
dda00b2c
BW
333(defvar mh-sent-from-folder nil
334 "Folder of msg assoc with this letter.")
cee9f5c6 335
dda00b2c
BW
336(defvar mh-sent-from-msg nil
337 "Number of msg assoc with this letter.")
a1b4049d 338
dda00b2c 339;; Sequences
c26cf6c8 340
dda00b2c
BW
341(defvar mh-unseen-seq nil
342 "Cached value of the \"Unseen-Sequence:\" MH profile component.
343Name of the Unseen sequence.")
c26cf6c8 344
dda00b2c
BW
345(defvar mh-previous-seq nil
346 "Cached value of the \"Previous-Sequence:\" MH profile component.
347Name of the Previous sequence.")
2dcf34f9 348
dda00b2c 349;; Etc. (alphabetical)
c26cf6c8 350
dda00b2c
BW
351(defvar mh-flists-present-flag nil
352 "Non-nil means that we have \"flists\".")
2dcf34f9 353
dda00b2c 354(defvar mh-index-data-file ".mhe_index"
9858f6c3 355 "MH-E specific file where index search info is stored.")
c26cf6c8 356
dda00b2c 357(defvar mh-letter-header-field-regexp "^\\([A-Za-z][A-Za-z0-9-]*\\):")
c26cf6c8 358
dda00b2c
BW
359(defvar mh-page-to-next-msg-flag nil
360 "Non-nil means next SPC or whatever goes to next undeleted message.")
c26cf6c8 361
dda00b2c
BW
362(defvar mh-pgp-support-flag (not (not (locate-library "mml2015")))
363 "Non-nil means PGP support is available.")
553fb735 364
dda00b2c
BW
365(defvar mh-signature-separator "-- \n"
366 "Text of a signature separator.
bdcfe844 367
dda00b2c
BW
368A signature separator is used to separate the body of a message
369from the signature. This can be used by user agents such as MH-E
370to render the signature differently or to suppress the inclusion
371of the signature in a reply. Use `mh-signature-separator-regexp'
372when searching for a separator.")
553fb735 373
dda00b2c
BW
374(defvar mh-signature-separator-regexp "^-- $"
375 "This regular expression matches the signature separator.
376See `mh-signature-separator'.")
553fb735 377
dda00b2c
BW
378(defvar mh-thread-scan-line-map nil
379 "Map of message index to various parts of the scan line.")
380(make-variable-buffer-local 'mh-thread-scan-line-map)
bdcfe844 381
dda00b2c
BW
382(defvar mh-thread-scan-line-map-stack nil
383 "Old map of message index to various parts of the scan line.
384This is the original map that is stored when the folder is
385narrowed.")
386(make-variable-buffer-local 'mh-thread-scan-line-map-stack)
553fb735 387
dda00b2c
BW
388(defvar mh-x-mailer-string nil
389 "*String containing the contents of the X-Mailer header field.
390If nil, this variable is initialized to show the version of MH-E,
391Emacs, and MH the first time a message is composed.")
553fb735 392
dda00b2c 393\f
553fb735 394
dda00b2c 395;;; MH-E Entry Points
c3d9274a
BW
396
397(eval-when-compile (require 'gnus))
398
399(defmacro mh-macro-expansion-time-gnus-version ()
400 "Return Gnus version available at macro expansion time.
2dcf34f9
BW
401The macro evaluates the Gnus version at macro expansion time. If
402MH-E was compiled then macro expansion happens at compile time."
403gnus-version)
c3d9274a
BW
404
405(defun mh-run-time-gnus-version ()
406 "Return Gnus version available at run time."
407 (require 'gnus)
408 gnus-version)
409
847b8219 410;;;###autoload
c26cf6c8 411(defun mh-version ()
bdcfe844 412 "Display version information about MH-E and the MH mail handling system."
c26cf6c8 413 (interactive)
3d7ca223 414 (set-buffer (get-buffer-create mh-info-buffer))
c26cf6c8 415 (erase-buffer)
c3d9274a
BW
416 ;; MH-E version.
417 (insert "MH-E " mh-version "\n\n")
418 ;; MH-E compilation details.
419 (insert "MH-E compilation details:\n")
420 (let* ((compiled-mhe (byte-code-function-p (symbol-function 'mh-version)))
421 (gnus-compiled-version (if compiled-mhe
422 (mh-macro-expansion-time-gnus-version)
423 "N/A")))
424 (insert " Byte compiled:\t\t" (if compiled-mhe "yes" "no") "\n"
425 " Gnus (compile-time):\t" gnus-compiled-version "\n"
426 " Gnus (run-time):\t" (mh-run-time-gnus-version) "\n\n"))
427 ;; Emacs version.
428 (insert (emacs-version) "\n\n")
a1b4049d 429 ;; MH version.
f0d73c14
BW
430 (if mh-variant-in-use
431 (insert mh-variant-in-use "\n"
432 " mh-progs:\t" mh-progs "\n"
433 " mh-lib:\t" mh-lib "\n"
434 " mh-lib-progs:\t" mh-lib-progs "\n\n")
435 (insert "No MH variant detected\n"))
a1b4049d
BW
436 ;; Linux version.
437 (condition-case ()
438 (call-process "uname" nil t nil "-a")
439 (file-error))
440 (goto-char (point-min))
3d7ca223 441 (display-buffer mh-info-buffer))
c26cf6c8 442
dda00b2c
BW
443\f
444
445;;; Support Routines
446
447(defun mh-list-to-string (l)
448 "Flatten the list L and make every element of the new list into a string."
449 (nreverse (mh-list-to-string-1 l)))
450
451(defun mh-list-to-string-1 (l)
452 "Flatten the list L and make every element of the new list into a string."
8d1ada53
BW
453 (let (new-list)
454 (dolist (element l)
455 (cond ((null element))
456 ((symbolp element)
457 (push (symbol-name element) new-list))
458 ((numberp element)
459 (push (int-to-string element) new-list))
460 ((equal element ""))
461 ((stringp element)
462 (push element new-list))
463 ((listp element)
464 (setq new-list (nconc (mh-list-to-string-1 element) new-list)))
465 (t
466 (error "Bad element: %s" element))))
dda00b2c 467 new-list))
847b8219 468
c26cf6c8
RS
469\f
470
dda00b2c
BW
471;;; MH-E Process Support
472
473(defvar mh-index-max-cmdline-args 500
474 "Maximum number of command line args.")
c26cf6c8 475
dda00b2c
BW
476(defun mh-xargs (cmd &rest args)
477 "Partial imitation of xargs.
478The current buffer contains a list of strings, one on each line.
479The function will execute CMD with ARGS and pass the first
480`mh-index-max-cmdline-args' strings to it. This is repeated till
481all the strings have been used."
482 (goto-char (point-min))
483 (let ((current-buffer (current-buffer)))
484 (with-temp-buffer
485 (let ((out (current-buffer)))
486 (set-buffer current-buffer)
487 (while (not (eobp))
488 (let ((arg-list (reverse args))
489 (count 0))
490 (while (and (not (eobp)) (< count mh-index-max-cmdline-args))
d5dc8c56
BW
491 (push (buffer-substring-no-properties (point)
492 (mh-line-end-position))
dda00b2c
BW
493 arg-list)
494 (incf count)
495 (forward-line))
496 (apply #'call-process cmd nil (list out nil) nil
497 (nreverse arg-list))))
498 (erase-buffer)
499 (insert-buffer-substring out)))))
500
501;; XXX This should be applied anywhere MH-E calls out to /bin/sh.
502(defun mh-quote-for-shell (string)
503 "Quote STRING for /bin/sh.
504Adds double-quotes around entire string and quotes the characters
505\\, `, and $ with a backslash."
506 (concat "\""
507 (loop for x across string
508 concat (format (if (memq x '(?\\ ?` ?$)) "\\%c" "%c") x))
509 "\""))
510
511(defun mh-exec-cmd (command &rest args)
512 "Execute mh-command COMMAND with ARGS.
513The side effects are what is desired. Any output is assumed to be
514an error and is shown to the user. The output is not read or
515parsed by MH-E."
b5553d47 516 (with-current-buffer (get-buffer-create mh-log-buffer)
dda00b2c
BW
517 (let* ((initial-size (mh-truncate-log-buffer))
518 (start (point))
519 (args (mh-list-to-string args)))
520 (apply 'call-process (expand-file-name command mh-progs) nil t nil args)
521 (when (> (buffer-size) initial-size)
522 (save-excursion
523 (goto-char start)
524 (insert "Errors when executing: " command)
525 (loop for arg in args do (insert " " arg))
526 (insert "\n"))
527 (save-window-excursion
528 (switch-to-buffer-other-window mh-log-buffer)
529 (sit-for 5))))))
530
531(defun mh-exec-cmd-error (env command &rest args)
532 "In environment ENV, execute mh-command COMMAND with ARGS.
533ENV is nil or a string of space-separated \"var=value\" elements.
534Signals an error if process does not complete successfully."
b5553d47 535 (with-current-buffer (get-buffer-create mh-temp-buffer)
dda00b2c
BW
536 (erase-buffer)
537 (let ((process-environment process-environment))
538 ;; XXX: We should purge the list that split-string returns of empty
539 ;; strings. This can happen in XEmacs if leading or trailing spaces
540 ;; are present.
541 (dolist (elem (if (stringp env) (split-string env " ") ()))
542 (push elem process-environment))
543 (mh-handle-process-error
544 command (apply #'call-process (expand-file-name command mh-progs)
545 nil t nil (mh-list-to-string args))))))
546
547(defun mh-exec-cmd-daemon (command filter &rest args)
548 "Execute MH command COMMAND in the background.
549
550If FILTER is non-nil then it is used to process the output
551otherwise the default filter `mh-process-daemon' is used. See
552`set-process-filter' for more details of FILTER.
553
554ARGS are passed to COMMAND as command line arguments."
b5553d47 555 (with-current-buffer (get-buffer-create mh-log-buffer)
dda00b2c
BW
556 (mh-truncate-log-buffer))
557 (let* ((process-connection-type nil)
558 (process (apply 'start-process
559 command nil
560 (expand-file-name command mh-progs)
561 (mh-list-to-string args))))
562 (set-process-filter process (or filter 'mh-process-daemon))
563 process))
564
565(defun mh-exec-cmd-env-daemon (env command filter &rest args)
c76608f0 566 "In environment ENV, execute mh-command COMMAND in the background.
dda00b2c
BW
567
568ENV is nil or a string of space-separated \"var=value\" elements.
569Signals an error if process does not complete successfully.
570
571If FILTER is non-nil then it is used to process the output
572otherwise the default filter `mh-process-daemon' is used. See
573`set-process-filter' for more details of FILTER.
574
575ARGS are passed to COMMAND as command line arguments."
576 (let ((process-environment process-environment))
577 (dolist (elem (if (stringp env) (split-string env " ") ()))
578 (push elem process-environment))
579 (apply #'mh-exec-cmd-daemon command filter args)))
580
581(defun mh-process-daemon (process output)
582 "PROCESS daemon that puts OUTPUT into a temporary buffer.
583Any output from the process is displayed in an asynchronous
584pop-up window."
585 (with-current-buffer (get-buffer-create mh-log-buffer)
586 (insert-before-markers output)
587 (display-buffer mh-log-buffer)))
588
589(defun mh-exec-cmd-quiet (raise-error command &rest args)
590 "Signal RAISE-ERROR if COMMAND with ARGS fails.
591Execute MH command COMMAND with ARGS. ARGS is a list of strings.
592Return at start of mh-temp buffer, where output can be parsed and
593used.
594Returns value of `call-process', which is 0 for success, unless
595RAISE-ERROR is non-nil, in which case an error is signaled if
596`call-process' returns non-0."
597 (set-buffer (get-buffer-create mh-temp-buffer))
598 (erase-buffer)
599 (let ((value
600 (apply 'call-process
601 (expand-file-name command mh-progs) nil t nil
602 args)))
603 (goto-char (point-min))
604 (if raise-error
605 (mh-handle-process-error command value)
606 value)))
607
608(defun mh-exec-cmd-output (command display &rest args)
609 "Execute MH command COMMAND with DISPLAY flag and ARGS.
610Put the output into buffer after point.
611Set mark after inserted text.
612Output is expected to be shown to user, not parsed by MH-E."
613 (push-mark (point) t)
614 (apply 'call-process
615 (expand-file-name command mh-progs) nil t display
616 (mh-list-to-string args))
617
618 ;; The following is used instead of 'exchange-point-and-mark because the
619 ;; latter activates the current region (between point and mark), which
620 ;; turns on highlighting. So prior to this bug fix, doing "inc" would
621 ;; highlight a region containing the new messages, which is undesirable.
622 ;; The bug wasn't seen in emacs21 but still occurred in XEmacs21.4.
623 (mh-exchange-point-and-mark-preserving-active-mark))
624
625;; Shush compiler.
54a5db74
BW
626(mh-do-in-xemacs
627 (defvar mark-active))
dda00b2c
BW
628
629(defun mh-exchange-point-and-mark-preserving-active-mark ()
630 "Put the mark where point is now, and point where the mark is now.
631This command works even when the mark is not active, and
632preserves whether the mark is active or not."
633 (interactive nil)
634 (let ((is-active (and (boundp 'mark-active) mark-active)))
635 (let ((omark (mark t)))
636 (if (null omark)
637 (error "No mark set in this buffer"))
638 (set-mark (point))
639 (goto-char omark)
640 (if (boundp 'mark-active)
641 (setq mark-active is-active))
642 nil)))
643
644(defun mh-exec-lib-cmd-output (command &rest args)
645 "Execute MH library command COMMAND with ARGS.
646Put the output into buffer after point.
647Set mark after inserted text."
648 (apply 'mh-exec-cmd-output (expand-file-name command mh-lib-progs) nil args))
649
650(defun mh-handle-process-error (command status)
651 "Raise error if COMMAND returned non-zero STATUS, otherwise return STATUS."
652 (if (equal status 0)
653 status
654 (goto-char (point-min))
655 (insert (if (integerp status)
656 (format "%s: exit code %d\n" command status)
657 (format "%s: %s\n" command status)))
b5553d47
SM
658 (let ((error-message (buffer-substring (point-min) (point-max))))
659 (with-current-buffer (get-buffer-create mh-log-buffer)
dda00b2c
BW
660 (mh-truncate-log-buffer)
661 (insert error-message)))
662 (error "%s failed, check buffer %s for error message"
663 command mh-log-buffer)))
664
665\f
666
fde155f4
BW
667;;; MH-E Customization Support Routines
668
669;; Shush compiler (Emacs 21 and XEmacs).
670(defvar customize-package-emacs-version-alist)
671
672;; Temporary function and data structure used customization.
673;; These will be unbound after the options are defined.
674(defmacro mh-strip-package-version (args)
675 "Strip :package-version keyword and its value from ARGS.
676In Emacs versions that support the :package-version keyword,
677ARGS is returned unchanged."
678 `(if (boundp 'customize-package-emacs-version-alist)
679 ,args
680 (let (seen)
681 (loop for keyword in ,args
682 if (cond ((eq keyword ':package-version) (setq seen t) nil)
683 (seen (setq seen nil) nil)
684 (t t))
685 collect keyword))))
686
c90c4cf1 687(defmacro defgroup-mh (symbol members doc &rest args)
fde155f4
BW
688 "Declare SYMBOL as a customization group containing MEMBERS.
689See documentation for `defgroup' for a description of the arguments
690SYMBOL, MEMBERS, DOC and ARGS.
691This macro is used by Emacs versions that lack the :package-version
692keyword, introduced in Emacs 22."
693 (declare (doc-string 3))
694 `(defgroup ,symbol ,members ,doc ,@(mh-strip-package-version args)))
c90c4cf1 695(put 'defgroup-mh 'lisp-indent-function 'defun)
fde155f4 696
c90c4cf1 697(defmacro defcustom-mh (symbol value doc &rest args)
fde155f4
BW
698 "Declare SYMBOL as a customizable variable that defaults to VALUE.
699See documentation for `defcustom' for a description of the arguments
700SYMBOL, VALUE, DOC and ARGS.
701This macro is used by Emacs versions that lack the :package-version
702keyword, introduced in Emacs 22."
703 (declare (doc-string 3))
704 `(defcustom ,symbol ,value ,doc ,@(mh-strip-package-version args)))
c90c4cf1 705(put 'defcustom-mh 'lisp-indent-function 'defun)
fde155f4 706
c90c4cf1 707(defmacro defface-mh (face spec doc &rest args)
fde155f4
BW
708 "Declare FACE as a customizable face that defaults to SPEC.
709See documentation for `defface' for a description of the arguments
710FACE, SPEC, DOC and ARGS.
711This macro is used by Emacs versions that lack the :package-version
712keyword, introduced in Emacs 22."
713 (declare (doc-string 3))
714 `(defface ,face ,spec ,doc ,@(mh-strip-package-version args)))
c90c4cf1 715(put 'defface-mh 'lisp-indent-function 'defun)
fde155f4
BW
716
717\f
718
dda00b2c
BW
719;;; Variant Support
720
c90c4cf1 721(defcustom-mh mh-path nil
dda00b2c
BW
722 "*Additional list of directories to search for MH.
723See `mh-variant'."
724 :group 'mh-e
fde155f4 725 :type '(repeat (directory))
7bf0295e 726 :package-version '(MH-E . "8.0"))
dda00b2c
BW
727
728(defun mh-variants ()
729 "Return a list of installed variants of MH on the system.
730This function looks for MH in `mh-sys-path', `mh-path' and
731`exec-path'. The format of the list of variants that is returned
732is described by the variable `mh-variants'."
733 (if mh-variants
734 mh-variants
735 (let ((list-unique))
736 ;; Make a unique list of directories, keeping the given order.
737 ;; We don't want the same MH variant to be listed multiple times.
738 (loop for dir in (append mh-path mh-sys-path exec-path) do
739 (setq dir (file-chase-links (directory-file-name dir)))
740 (add-to-list 'list-unique dir))
741 (loop for dir in (nreverse list-unique) do
1d75432d 742 (when (and dir (file-accessible-directory-p dir))
dda00b2c
BW
743 (let ((variant (mh-variant-info dir)))
744 (if variant
745 (add-to-list 'mh-variants variant)))))
746 mh-variants)))
747
748(defun mh-variant-info (dir)
749 "Return MH variant found in DIR, or nil if none present."
b5553d47
SM
750 (let ((tmp-buffer (get-buffer-create mh-temp-buffer)))
751 (with-current-buffer tmp-buffer
dda00b2c
BW
752 (cond
753 ((mh-variant-mh-info dir))
754 ((mh-variant-nmh-info dir))
efa47761 755 ((mh-variant-gnu-mh-info dir))))))
dda00b2c
BW
756
757(defun mh-variant-mh-info (dir)
efa47761 758 "Return info for MH variant in DIR assuming a temporary buffer is set up."
dda00b2c
BW
759 ;; MH does not have the -version option.
760 ;; Its version number is included in the output of "-help" as:
761 ;;
762 ;; version: MH 6.8.4 #2[UCI] (burrito) of Fri Jan 15 20:01:39 EST 1999
763 ;; options: [ATHENA] [BIND] [DUMB] [LIBLOCKFILE] [LOCALE] [MAILGROUP] [MHE]
764 ;; [MHRC] [MIME] [MORE='"/usr/bin/sensible-pager"'] [NLINK_HACK]
765 ;; [NORUSERPASS] [OVERHEAD] [POP] [POPSERVICE='"pop-3"'] [RENAME]
766 ;; [RFC1342] [RPATHS] [RPOP] [SENDMTS] [SMTP] [SOCKETS]
767 ;; [SPRINTFTYPE=int] [SVR4] [SYS5] [SYS5DIR] [TERMINFO]
768 ;; [TYPESIG=void] [UNISTD] [UTK] [VSPRINTF]
769 (let ((mhparam (expand-file-name "mhparam" dir)))
770 (when (mh-file-command-p mhparam)
771 (erase-buffer)
772 (call-process mhparam nil '(t nil) nil "-help")
773 (goto-char (point-min))
774 (when (search-forward-regexp "version: MH \\(\\S +\\)" nil t)
775 (let ((version (format "MH %s" (match-string 1))))
776 (erase-buffer)
777 (call-process mhparam nil '(t nil) nil "libdir")
778 (goto-char (point-min))
779 (when (search-forward-regexp "^.*$" nil t)
780 (let ((libdir (match-string 0)))
781 `(,version
782 (variant mh)
783 (mh-lib-progs ,libdir)
784 (mh-lib ,libdir)
785 (mh-progs ,dir)
786 (flists nil)))))))))
787
efa47761
BW
788(defun mh-variant-gnu-mh-info (dir)
789 "Return info for GNU mailutils MH variant in DIR.
790This assumes that a temporary buffer is set up."
dda00b2c
BW
791 ;; 'mhparam -version' output:
792 ;; mhparam (GNU mailutils 0.3.2)
793 (let ((mhparam (expand-file-name "mhparam" dir)))
794 (when (mh-file-command-p mhparam)
795 (erase-buffer)
796 (call-process mhparam nil '(t nil) nil "-version")
797 (goto-char (point-min))
798 (when (search-forward-regexp "mhparam (\\(GNU [Mm]ailutils \\S +\\))"
799 nil t)
800 (let ((version (match-string 1))
801 (mh-progs dir))
802 `(,version
efa47761 803 (variant gnu-mh)
dda00b2c
BW
804 (mh-lib-progs ,(mh-profile-component "libdir"))
805 (mh-lib ,(mh-profile-component "etcdir"))
806 (mh-progs ,dir)
807 (flists ,(file-exists-p
808 (expand-file-name "flists" dir)))))))))
809
810(defun mh-variant-nmh-info (dir)
efa47761 811 "Return info for nmh variant in DIR assuming a temporary buffer is set up."
dda00b2c
BW
812 ;; `mhparam -version' outputs:
813 ;; mhparam -- nmh-1.1-RC1 [compiled on chaak at Fri Jun 20 11:03:28 PDT 2003]
814 (let ((mhparam (expand-file-name "mhparam" dir)))
815 (when (mh-file-command-p mhparam)
816 (erase-buffer)
817 (call-process mhparam nil '(t nil) nil "-version")
818 (goto-char (point-min))
819 (when (search-forward-regexp "mhparam -- nmh-\\(\\S +\\)" nil t)
820 (let ((version (format "nmh %s" (match-string 1)))
821 (mh-progs dir))
822 `(,version
823 (variant nmh)
824 (mh-lib-progs ,(mh-profile-component "libdir"))
825 (mh-lib ,(mh-profile-component "etcdir"))
826 (mh-progs ,dir)
827 (flists ,(file-exists-p
828 (expand-file-name "flists" dir)))))))))
829
830(defun mh-file-command-p (file)
831 "Return t if file FILE is the name of a executable regular file."
832 (and (file-regular-p file) (file-executable-p file)))
833
834(defun mh-variant-set-variant (variant)
efa47761 835 "Set up the system variables for the MH variant named VARIANT.
dda00b2c
BW
836If VARIANT is a string, use that key in the alist returned by the
837function `mh-variants'.
838If VARIANT is a symbol, select the first entry that matches that
839variant."
840 (cond
841 ((stringp variant) ;e.g. "nmh 1.1-RC1"
842 (when (assoc variant (mh-variants))
843 (let* ((alist (cdr (assoc variant (mh-variants))))
844 (lib-progs (cadr (assoc 'mh-lib-progs alist)))
845 (lib (cadr (assoc 'mh-lib alist)))
846 (progs (cadr (assoc 'mh-progs alist)))
847 (flists (cadr (assoc 'flists alist))))
848 ;;(set-default mh-variant variant)
849 (setq mh-x-mailer-string nil
850 mh-flists-present-flag flists
851 mh-lib-progs lib-progs
852 mh-lib lib
853 mh-progs progs
854 mh-variant-in-use variant))))
855 ((symbolp variant) ;e.g. 'nmh (pick the first match)
856 (loop for variant-list in (mh-variants)
857 when (eq variant (cadr (assoc 'variant (cdr variant-list))))
858 return (let* ((version (car variant-list))
859 (alist (cdr variant-list))
860 (lib-progs (cadr (assoc 'mh-lib-progs alist)))
861 (lib (cadr (assoc 'mh-lib alist)))
862 (progs (cadr (assoc 'mh-progs alist)))
863 (flists (cadr (assoc 'flists alist))))
864 ;;(set-default mh-variant flavor)
865 (setq mh-x-mailer-string nil
866 mh-flists-present-flag flists
867 mh-lib-progs lib-progs
868 mh-lib lib
869 mh-progs progs
870 mh-variant-in-use version)
871 t)))))
872
873(defun mh-variant-p (&rest variants)
874 "Return t if variant is any of VARIANTS.
efa47761 875Currently known variants are 'MH, 'nmh, and 'gnu-mh."
dda00b2c
BW
876 (let ((variant-in-use
877 (cadr (assoc 'variant (assoc mh-variant-in-use (mh-variants))))))
878 (not (null (member variant-in-use variants)))))
879
880(defun mh-profile-component (component)
881 "Return COMPONENT value from mhparam, or nil if unset."
882 (save-excursion
efa47761
BW
883 ;; MH and nmh use -components, GNU mailutils MH uses -component.
884 ;; Since MH and nmh work with an unambiguous prefix, the `s' is
885 ;; dropped here.
0c32f8c6 886 (mh-exec-cmd-quiet nil "mhparam" "-component" component)
dda00b2c
BW
887 (mh-profile-component-value component)))
888
889(defun mh-profile-component-value (component)
890 "Find and return the value of COMPONENT in the current buffer.
891Returns nil if the component is not in the buffer."
892 (let ((case-fold-search t))
893 (goto-char (point-min))
894 (cond ((not (re-search-forward (format "^%s:" component) nil t)) nil)
895 ((looking-at "[\t ]*$") nil)
3d7ca223 896 (t
dda00b2c
BW
897 (re-search-forward "[\t ]*\\([^\t \n].*\\)$" nil t)
898 (let ((start (match-beginning 1)))
899 (end-of-line)
900 (buffer-substring start (point)))))))
901
902(defun mh-variant-set (variant)
903 "Set the MH variant to VARIANT.
904Sets `mh-progs', `mh-lib', `mh-lib-progs' and
905`mh-flists-present-flag'.
906If the VARIANT is \"autodetect\", then first try nmh, then MH and
efa47761 907finally GNU mailutils MH."
dda00b2c
BW
908 (interactive
909 (list (completing-read
910 "MH variant: "
911 (mapcar (lambda (x) (list (car x))) (mh-variants))
912 nil t)))
efa47761
BW
913
914 ;; TODO Remove mu-mh backwards compatibility in 9.0.
915 (when (and (stringp variant)
916 (string-match "^mu-mh" variant))
917 (message
6807fdff 918 (format "%s\n%s; %s" "The variant name mu-mh has been renamed to gnu-mh"
efa47761
BW
919 "and will be removed in MH-E 9.0"
920 "try M-x customize-option mh-variant"))
921 (sit-for 5)
922 (setq variant (concat "gnu-mh" (substring variant (match-end 0)))))
923
dda00b2c
BW
924 (let ((valid-list (mapcar (lambda (x) (car x)) (mh-variants))))
925 (cond
926 ((eq variant 'none))
927 ((eq variant 'autodetect)
928 (cond
929 ((mh-variant-set-variant 'nmh)
930 (message "%s installed as MH variant" mh-variant-in-use))
931 ((mh-variant-set-variant 'mh)
932 (message "%s installed as MH variant" mh-variant-in-use))
efa47761 933 ((mh-variant-set-variant 'gnu-mh)
dda00b2c
BW
934 (message "%s installed as MH variant" mh-variant-in-use))
935 (t
936 (message "No MH variant found on the system"))))
937 ((member variant valid-list)
938 (when (not (mh-variant-set-variant variant))
939 (message "Warning: %s variant not found. Autodetecting..." variant)
940 (mh-variant-set 'autodetect)))
941 (t
efa47761
BW
942 (message "Unknown variant %s; use %s"
943 variant
4f91a816 944 (mapconcat (lambda (x) (format "%s" (car x)))
dda00b2c
BW
945 (mh-variants) " or "))))))
946
c90c4cf1 947(defcustom-mh mh-variant 'autodetect
dda00b2c
BW
948 "*Specifies the variant used by MH-E.
949
950The default setting of this option is \"Auto-detect\" which means
951that MH-E will automatically choose the first of nmh, MH, or GNU
efa47761 952mailutils MH that it finds in the directories listed in
dda00b2c 953`mh-path' (which you can customize), `mh-sys-path', and
bc4c8031
BW
954`exec-path'. If MH-E can't find MH at all, you may have to
955customize `mh-path' and add the directory in which the command
956\"mhparam\" is located. If, on the other hand, you have both nmh
efa47761
BW
957and GNU mailutils MH installed (for example) and
958`mh-variant-in-use' was initialized to nmh but you want to use
959GNU mailutils MH, then you can set this option to \"gnu-mh\".
dda00b2c
BW
960
961When this variable is changed, MH-E resets `mh-progs', `mh-lib',
962`mh-lib-progs', `mh-flists-present-flag', and `mh-variant-in-use'
bc4c8031
BW
963accordingly. Prior to version 8, it was often necessary to set
964some of these variables in \"~/.emacs\"; now it is no longer
965necessary and can actually cause problems."
dda00b2c
BW
966 :type `(radio
967 (const :tag "Auto-detect" autodetect)
968 ,@(mapcar (lambda (x) `(const ,(car x))) (mh-variants)))
969 :set (lambda (symbol value)
970 (set-default symbol value) ;Done in mh-variant-set-variant!
971 (mh-variant-set value))
fde155f4 972 :group 'mh-e
7bf0295e 973 :package-version '(MH-E . "8.0"))
23347d76 974
23347d76
BW
975\f
976
dda00b2c 977;;; MH-E Customization
c26cf6c8 978
dda00b2c
BW
979;; All of the defgroups, defcustoms, and deffaces in MH-E are found
980;; here. This makes it possible to customize modules that aren't
981;; loaded yet. It also makes it easier to organize the customization
982;; groups.
a66894d8 983
dda00b2c
BW
984;; This section contains the following sub-sections:
985
986;; 1. MH-E Customization Groups
987
988;; These are the customization group definitions. Every group has a
989;; associated manual node. The ordering is alphabetical, except for
990;; the groups mh-faces and mh-hooks which are last .
991
992;; 2. MH-E Customization
993
994;; These are the actual customization variables. There is a
995;; sub-section for each group in the MH-E Customization Groups
996;; section, in the same order, separated by page breaks. Within
997;; each section, variables are sorted alphabetically.
998
999;; 3. Hooks
1000
1001;; All hooks must be placed in the mh-hook group; in addition, add
1002;; the group associated with the manual node in which the hook is
1003;; described. Since the mh-hook group appears near the end of this
1004;; section, the hooks will appear at the end of these other groups.
1005
1006;; 4. Faces
1007
1008;; All faces must be placed in the mh-faces group; in addition, add
1009;; the group associated with the manual node in which the face is
1010;; described. Since the mh-faces group appears near the end of this
1011;; section, the faces will appear at the end of these other groups.
1012
1013(defun mh-customize (&optional delete-other-windows-flag)
1014 "Customize MH-E variables.
1015If optional argument DELETE-OTHER-WINDOWS-FLAG is non-nil, other
1016windows in the frame are removed."
1017 (interactive "P")
1018 (customize-group 'mh-e)
1019 (when delete-other-windows-flag
1020 (delete-other-windows)))
c26cf6c8 1021
e5bbaf41 1022;; FIXME: Maybe out of date? --xfq
23347d76
BW
1023(if (boundp 'customize-package-emacs-version-alist)
1024 (add-to-list 'customize-package-emacs-version-alist
70a1d47e
BW
1025 '(MH-E ("6.0" . "22.1") ("6.1" . "22.1") ("7.0" . "22.1")
1026 ("7.1" . "22.1") ("7.2" . "22.1") ("7.3" . "22.1")
1027 ("7.4" . "22.1") ("8.0" . "22.1"))))
23347d76 1028
bdcfe844
BW
1029\f
1030
dda00b2c
BW
1031;;; MH-E Customization Groups
1032
c90c4cf1 1033(defgroup-mh mh-e nil
dda00b2c
BW
1034 "Emacs interface to the MH mail system.
1035MH is the Rand Mail Handler. Other implementations include nmh
1036and GNU mailutils."
1037 :link '(custom-manual "(mh-e)Top")
23347d76 1038 :group 'mail
70a1d47e 1039 :package-version '(MH-E . "8.0"))
dda00b2c 1040
c90c4cf1 1041(defgroup-mh mh-alias nil
dda00b2c
BW
1042 "Aliases."
1043 :link '(custom-manual "(mh-e)Aliases")
1044 :prefix "mh-alias-"
23347d76 1045 :group 'mh-e
70a1d47e 1046 :package-version '(MH-E . "7.1"))
dda00b2c 1047
c90c4cf1 1048(defgroup-mh mh-folder nil
dda00b2c
BW
1049 "Organizing your mail with folders."
1050 :prefix "mh-"
1051 :link '(custom-manual "(mh-e)Folders")
23347d76 1052 :group 'mh-e
70a1d47e 1053 :package-version '(MH-E . "7.1"))
dda00b2c 1054
c90c4cf1 1055(defgroup-mh mh-folder-selection nil
dda00b2c
BW
1056 "Folder selection."
1057 :prefix "mh-"
1058 :link '(custom-manual "(mh-e)Folder Selection")
23347d76 1059 :group 'mh-e
70a1d47e 1060 :package-version '(MH-E . "8.0"))
dda00b2c 1061
c90c4cf1 1062(defgroup-mh mh-identity nil
dda00b2c
BW
1063 "Identities."
1064 :link '(custom-manual "(mh-e)Identities")
1065 :prefix "mh-identity-"
23347d76 1066 :group 'mh-e
70a1d47e 1067 :package-version '(MH-E . "7.1"))
dda00b2c 1068
c90c4cf1 1069(defgroup-mh mh-inc nil
dda00b2c
BW
1070 "Incorporating your mail."
1071 :prefix "mh-inc-"
1072 :link '(custom-manual "(mh-e)Incorporating Mail")
23347d76 1073 :group 'mh-e
70a1d47e 1074 :package-version '(MH-E . "8.0"))
dda00b2c 1075
c90c4cf1 1076(defgroup-mh mh-junk nil
dda00b2c
BW
1077 "Dealing with junk mail."
1078 :link '(custom-manual "(mh-e)Junk")
1079 :prefix "mh-junk-"
23347d76 1080 :group 'mh-e
70a1d47e 1081 :package-version '(MH-E . "7.3"))
dda00b2c 1082
c90c4cf1 1083(defgroup-mh mh-letter nil
dda00b2c
BW
1084 "Editing a draft."
1085 :prefix "mh-"
1086 :link '(custom-manual "(mh-e)Editing Drafts")
23347d76 1087 :group 'mh-e
70a1d47e 1088 :package-version '(MH-E . "7.1"))
dda00b2c 1089
c90c4cf1 1090(defgroup-mh mh-ranges nil
dda00b2c
BW
1091 "Ranges."
1092 :prefix "mh-"
1093 :link '(custom-manual "(mh-e)Ranges")
23347d76 1094 :group 'mh-e
70a1d47e 1095 :package-version '(MH-E . "8.0"))
dda00b2c 1096
c90c4cf1 1097(defgroup-mh mh-scan-line-formats nil
dda00b2c
BW
1098 "Scan line formats."
1099 :link '(custom-manual "(mh-e)Scan Line Formats")
1100 :prefix "mh-"
23347d76 1101 :group 'mh-e
70a1d47e 1102 :package-version '(MH-E . "8.0"))
dda00b2c 1103
c90c4cf1 1104(defgroup-mh mh-search nil
dda00b2c
BW
1105 "Searching."
1106 :link '(custom-manual "(mh-e)Searching")
1107 :prefix "mh-search-"
23347d76 1108 :group 'mh-e
70a1d47e 1109 :package-version '(MH-E . "8.0"))
dda00b2c 1110
c90c4cf1 1111(defgroup-mh mh-sending-mail nil
dda00b2c
BW
1112 "Sending mail."
1113 :prefix "mh-"
1114 :link '(custom-manual "(mh-e)Sending Mail")
23347d76 1115 :group 'mh-e
70a1d47e 1116 :package-version '(MH-E . "8.0"))
dda00b2c 1117
c90c4cf1 1118(defgroup-mh mh-sequences nil
dda00b2c
BW
1119 "Sequences."
1120 :prefix "mh-"
1121 :link '(custom-manual "(mh-e)Sequences")
23347d76 1122 :group 'mh-e
70a1d47e 1123 :package-version '(MH-E . "8.0"))
dda00b2c 1124
c90c4cf1 1125(defgroup-mh mh-show nil
dda00b2c
BW
1126 "Reading your mail."
1127 :prefix "mh-"
1128 :link '(custom-manual "(mh-e)Reading Mail")
23347d76 1129 :group 'mh-e
70a1d47e 1130 :package-version '(MH-E . "7.1"))
dda00b2c 1131
c90c4cf1 1132(defgroup-mh mh-speedbar nil
dda00b2c
BW
1133 "The speedbar."
1134 :prefix "mh-speed-"
1135 :link '(custom-manual "(mh-e)Speedbar")
23347d76 1136 :group 'mh-e
70a1d47e 1137 :package-version '(MH-E . "8.0"))
dda00b2c 1138
c90c4cf1 1139(defgroup-mh mh-thread nil
dda00b2c
BW
1140 "Threading."
1141 :prefix "mh-thread-"
1142 :link '(custom-manual "(mh-e)Threading")
23347d76 1143 :group 'mh-e
70a1d47e 1144 :package-version '(MH-E . "8.0"))
dda00b2c 1145
c90c4cf1 1146(defgroup-mh mh-tool-bar nil
dda00b2c
BW
1147 "The tool bar"
1148 :link '(custom-manual "(mh-e)Tool Bar")
1149 :prefix "mh-"
23347d76 1150 :group 'mh-e
70a1d47e 1151 :package-version '(MH-E . "8.0"))
dda00b2c 1152
c90c4cf1 1153(defgroup-mh mh-hooks nil
dda00b2c
BW
1154 "MH-E hooks."
1155 :link '(custom-manual "(mh-e)Top")
1156 :prefix "mh-"
23347d76 1157 :group 'mh-e
70a1d47e 1158 :package-version '(MH-E . "7.1"))
dda00b2c 1159
c90c4cf1 1160(defgroup-mh mh-faces nil
dda00b2c
BW
1161 "Faces used in MH-E."
1162 :link '(custom-manual "(mh-e)Top")
1163 :prefix "mh-"
1164 :group 'faces
23347d76 1165 :group 'mh-e
70a1d47e 1166 :package-version '(MH-E . "7.1"))
bdcfe844
BW
1167
1168\f
1169
23347d76 1170;;; MH-E Customization
dda00b2c 1171
23347d76 1172;; See Variant Support, above, for mh-e group.
dda00b2c
BW
1173
1174;;; Aliases (:group 'mh-alias)
1175
c90c4cf1 1176(defcustom-mh mh-alias-completion-ignore-case-flag t
dda00b2c
BW
1177 "*Non-nil means don't consider case significant in MH alias completion.
1178
1179As MH ignores case in the aliases, so too does MH-E. However, you
1180may turn off this option to make case significant which can be
1181used to segregate completion of your aliases. You might use
1182lowercase for mailing lists and uppercase for people."
1183 :type 'boolean
23347d76 1184 :group 'mh-alias
70a1d47e 1185 :package-version '(MH-E . "7.1"))
dda00b2c 1186
c90c4cf1 1187(defcustom-mh mh-alias-expand-aliases-flag nil
dda00b2c
BW
1188 "*Non-nil means to expand aliases entered in the minibuffer.
1189
1190In other words, aliases entered in the minibuffer will be
d1bb6623 1191expanded to the full address in the message draft. By default,
dda00b2c
BW
1192this expansion is not performed."
1193 :type 'boolean
23347d76 1194 :group 'mh-alias
70a1d47e 1195 :package-version '(MH-E . "7.1"))
dda00b2c 1196
c90c4cf1 1197(defcustom-mh mh-alias-flash-on-comma t
dda00b2c
BW
1198 "*Specify whether to flash address or warn on translation.
1199
1200This option controls the behavior when a [comma] is pressed while
1201entering aliases or addresses. The default setting flashes the
1202address associated with an address in the minibuffer briefly, but
1203does not display a warning if the alias is not found."
1204 :type '(choice (const :tag "Flash but Don't Warn If No Alias" t)
1205 (const :tag "Flash and Warn If No Alias" 1)
1206 (const :tag "Don't Flash Nor Warn If No Alias" nil))
23347d76 1207 :group 'mh-alias
70a1d47e 1208 :package-version '(MH-E . "7.1"))
dda00b2c 1209
c90c4cf1 1210(defcustom-mh mh-alias-insert-file nil
dda00b2c
BW
1211 "*Filename used to store a new MH-E alias.
1212
1213The default setting of this option is \"Use Aliasfile Profile
1214Component\". This option can also hold the name of a file or a
1215list a file names. If this option is set to a list of file names,
1216or the \"Aliasfile:\" profile component contains more than one file
1217name, MH-E will prompt for one of them when MH-E adds an alias."
1218 :type '(choice (const :tag "Use Aliasfile Profile Component" nil)
1219 (file :tag "Alias File")
1220 (repeat :tag "List of Alias Files" file))
23347d76 1221 :group 'mh-alias
70a1d47e 1222 :package-version '(MH-E . "7.1"))
dda00b2c 1223
c90c4cf1 1224(defcustom-mh mh-alias-insertion-location 'sorted
dda00b2c
BW
1225 "Specifies where new aliases are entered in alias files.
1226
1227This option is set to \"Alphabetical\" by default. If you organize
1228your alias file in other ways, then adding aliases to the \"Top\"
1229or \"Bottom\" of your alias file might be more appropriate."
1230 :type '(choice (const :tag "Alphabetical" sorted)
1231 (const :tag "Top" top)
1232 (const :tag "Bottom" bottom))
23347d76 1233 :group 'mh-alias
70a1d47e 1234 :package-version '(MH-E . "7.1"))
dda00b2c 1235
c90c4cf1 1236(defcustom-mh mh-alias-local-users t
1a9aa7df 1237 "*Non-nil means local users are added to alias completion.
dda00b2c
BW
1238
1239Aliases are created from \"/etc/passwd\" entries with a user ID
1240larger than a magical number, typically 200. This can be a handy
1241tool on a machine where you and co-workers exchange messages.
1242These aliases have the form \"local.first.last\" if a real name is
1243present in the password file. Otherwise, the alias will have the
1244form \"local.login\".
1245
1246If you're on a system with thousands of users you don't know, and
1247the loading of local aliases slows MH-E down noticeably, then
1248turn this option off.
1249
1250This option also takes a string which is executed to generate the
1251password file. For example, use \"ypcat passwd\" to obtain the
1252NIS password file."
1253 :type '(choice (boolean) (string))
23347d76 1254 :group 'mh-alias
70a1d47e 1255 :package-version '(MH-E . "7.1"))
dda00b2c 1256
c90c4cf1 1257(defcustom-mh mh-alias-local-users-prefix "local."
dda00b2c
BW
1258 "*String prefixed to the real names of users from the password file.
1259This option can also be set to \"Use Login\".
1260
1261For example, consider the following password file entry:
1262
1263 psg:x:1000:1000:Peter S Galbraith,,,:/home/psg:/bin/tcsh
1264
1265The following settings of this option will produce the associated
1266aliases:
1267
1268 \"local.\" local.peter.galbraith
1269 \"\" peter.galbraith
1270 Use Login psg
1271
1272This option has no effect if variable `mh-alias-local-users' is
1273turned off."
1274 :type '(choice (const :tag "Use Login" nil)
1275 (string))
23347d76 1276 :group 'mh-alias
70a1d47e 1277 :package-version '(MH-E . "7.4"))
dda00b2c 1278
c90c4cf1 1279(defcustom-mh mh-alias-passwd-gecos-comma-separator-flag t
dda00b2c
BW
1280 "*Non-nil means the gecos field in the password file uses a comma separator.
1281
1282In the example in `mh-alias-local-users-prefix', commas are used
1283to separate different values within the so-called gecos field.
1284This is a fairly common usage. However, in the rare case that the
1285gecos field in your password file is not separated by commas and
1286whose contents may contain commas, you can turn this option off."
1287 :type 'boolean
23347d76 1288 :group 'mh-alias
70a1d47e 1289 :package-version '(MH-E . "7.4"))
7094eefe 1290
dda00b2c
BW
1291;;; Organizing Your Mail with Folders (:group 'mh-folder)
1292
c90c4cf1 1293(defcustom-mh mh-new-messages-folders t
dda00b2c
BW
1294 "Folders searched for the \"unseen\" sequence.
1295
1296Set this option to \"Inbox\" to search the \"+inbox\" folder or
1297\"All\" to search all of the top level folders. Otherwise, list
1298the folders that should be searched with the \"Choose Folders\"
1299menu item.
1300
1301See also `mh-recursive-folders-flag'."
1302 :type '(choice (const :tag "Inbox" t)
1303 (const :tag "All" nil)
1304 (repeat :tag "Choose Folders" (string :tag "Folder")))
23347d76 1305 :group 'mh-folder
70a1d47e 1306 :package-version '(MH-E . "8.0"))
dda00b2c 1307
c90c4cf1 1308(defcustom-mh mh-ticked-messages-folders t
dda00b2c
BW
1309 "Folders searched for `mh-tick-seq'.
1310
1311Set this option to \"Inbox\" to search the \"+inbox\" folder or
1312\"All\" to search all of the top level folders. Otherwise, list
1313the folders that should be searched with the \"Choose Folders\"
1314menu item.
1315
1316See also `mh-recursive-folders-flag'."
1317 :type '(choice (const :tag "Inbox" t)
1318 (const :tag "All" nil)
1319 (repeat :tag "Choose Folders" (string :tag "Folder")))
23347d76 1320 :group 'mh-folder
70a1d47e 1321 :package-version '(MH-E . "8.0"))
dda00b2c 1322
c90c4cf1 1323(defcustom-mh mh-large-folder 200
dda00b2c
BW
1324 "The number of messages that indicates a large folder.
1325
1326If a folder is deemed to be large, that is the number of messages
1327in it exceed this value, then confirmation is needed when it is
1328visited. Even when `mh-show-threads-flag' is non-nil, the folder
1329is not automatically threaded, if it is large. If set to nil all
1330folders are treated as if they are small."
1331 :type '(choice (const :tag "No Limit") integer)
23347d76 1332 :group 'mh-folder
70a1d47e 1333 :package-version '(MH-E . "7.0"))
dda00b2c 1334
c90c4cf1 1335(defcustom-mh mh-recenter-summary-flag nil
dda00b2c
BW
1336 "*Non-nil means to recenter the summary window.
1337
1338If this option is turned on, recenter the summary window when the
1339show window is toggled off."
1340 :type 'boolean
23347d76 1341 :group 'mh-folder
70a1d47e 1342 :package-version '(MH-E . "7.0"))
dda00b2c 1343
c90c4cf1 1344(defcustom-mh mh-recursive-folders-flag nil
dda00b2c
BW
1345 "*Non-nil means that commands which operate on folders do so recursively."
1346 :type 'boolean
23347d76 1347 :group 'mh-folder
70a1d47e 1348 :package-version '(MH-E . "7.0"))
dda00b2c 1349
c90c4cf1 1350(defcustom-mh mh-sortm-args nil
dda00b2c
BW
1351 "*Additional arguments for \"sortm\"\\<mh-folder-mode-map>.
1352
1353This option is consulted when a prefix argument is used with
1354\\[mh-sort-folder]. Normally default arguments to \"sortm\" are
1355specified in the MH profile. This option may be used to provide
1356an alternate view. For example, \"'(\"-nolimit\" \"-textfield\"
1357\"subject\")\" is a useful setting."
a931698a 1358 :type '(repeat string)
23347d76 1359 :group 'mh-folder
70a1d47e 1360 :package-version '(MH-E . "8.0"))
dda00b2c
BW
1361
1362;;; Folder Selection (:group 'mh-folder-selection)
1363
c90c4cf1 1364(defcustom-mh mh-default-folder-for-message-function nil
dda00b2c
BW
1365 "Function to select a default folder for refiling or \"Fcc:\".
1366
bc4c8031
BW
1367When this function is called, the current buffer contains the message
1368being refiled and point is at the start of the message. This function
1369should return the default folder as a string with a leading \"+\"
1370sign. It can also return nil so that the last folder name is used as
1371the default, or an empty string to suppress the default entirely."
a931698a 1372 :type '(choice (const nil) function)
23347d76 1373 :group 'mh-folder-selection
70a1d47e 1374 :package-version '(MH-E . "8.0"))
dda00b2c 1375
c90c4cf1 1376(defcustom-mh mh-default-folder-list nil
dda00b2c
BW
1377 "*List of addresses and folders.
1378
1379The folder name associated with the first address found in this
1380list is used as the default for `mh-refile-msg' and similar
1381functions. Each element in this list contains a \"Check Recipient\"
1382item. If this item is turned on, then the address is checked
1383against the recipient instead of the sender. This is useful for
1384mailing lists.
1385
1386See `mh-prompt-for-refile-folder' and `mh-folder-from-address'
1387for more information."
1388 :type '(repeat (list (regexp :tag "Address")
1389 (string :tag "Folder")
1390 (boolean :tag "Check Recipient")))
23347d76 1391 :group 'mh-folder-selection
70a1d47e 1392 :package-version '(MH-E . "7.2"))
dda00b2c 1393
c90c4cf1 1394(defcustom-mh mh-default-folder-must-exist-flag t
dda00b2c
BW
1395 "*Non-nil means guessed folder name must exist to be used.
1396
1397If the derived folder does not exist, and this option is on, then
1398the last folder name used is suggested. This is useful if you get
1399mail from various people for whom you have an alias, but file
1400them all in the same project folder.
1401
1402See `mh-prompt-for-refile-folder' and `mh-folder-from-address'
1403for more information."
1404 :type 'boolean
23347d76 1405 :group 'mh-folder-selection
70a1d47e 1406 :package-version '(MH-E . "7.2"))
dda00b2c 1407
c90c4cf1 1408(defcustom-mh mh-default-folder-prefix ""
dda00b2c
BW
1409 "*Prefix used for folder names generated from aliases.
1410The prefix is used to prevent clutter in your mail directory.
1411
1412See `mh-prompt-for-refile-folder' and `mh-folder-from-address'
1413for more information."
1414 :type 'string
23347d76 1415 :group 'mh-folder-selection
70a1d47e 1416 :package-version '(MH-E . "7.2"))
c26cf6c8 1417
dda00b2c
BW
1418;;; Identities (:group 'mh-identity)
1419
1420(eval-and-compile
1421 (unless (fboundp 'mh-identity-make-menu-no-autoload)
1422 (defun mh-identity-make-menu-no-autoload ()
1423 "Temporary definition.
1424Real definition will take effect when mh-identity is loaded."
1425 nil)))
1426
c90c4cf1 1427(defcustom-mh mh-identity-list nil
dda00b2c
BW
1428 "*List of identities.
1429
1430To customize this option, click on the \"INS\" button and enter a label
1431such as \"Home\" or \"Work\". Then click on the \"INS\" button with the
1432label \"Add at least one item below\". Then choose one of the items in
1433the \"Value Menu\".
1434
1435You can specify an alternate \"From:\" header field using the \"From
1436Field\" menu item. You must include a valid email address. A standard
1437format is \"First Last <login@@host.domain>\". If you use an initial
1438with a period, then you must quote your name as in '\"First I. Last\"
1439<login@@host.domain>'. People usually list the name of the company
1440where they work using the \"Organization Field\" menu item. Set any
1441arbitrary header field and value in the \"Other Field\" menu item.
1442Unless the header field is a standard one, precede the name of your
1443field's label with \"X-\", as in \"X-Fruit-of-the-Day:\". The value of
1444\"Attribution Verb\" overrides the setting of
1445`mh-extract-from-attribution-verb'. Set your signature with the
1446\"Signature\" menu item. You can specify the contents of
1447`mh-signature-file-name', a file, or a function. Specify a different
1448key to sign or encrypt messages with the \"GPG Key ID\" menu item.
1449
1450You can select the identities you have added via the menu called
1451\"Identity\" in the MH-Letter buffer. You can also use
1452\\[mh-insert-identity]. To clear the fields and signature added by the
1453identity, select the \"None\" identity.
1454
1455The \"Identity\" menu contains two other items to save you from having
1456to set the identity on every message. The menu item \"Set Default for
1457Session\" can be used to set the default identity to the current
1458identity until you exit Emacs. The menu item \"Save as Default\" sets
1459the option `mh-identity-default' to the current identity setting. You
1460can also customize the `mh-identity-default' option in the usual
1461fashion."
1462 :type '(repeat (list :tag ""
1463 (string :tag "Label")
1464 (repeat :tag "Add at least one item below"
1465 (choice
1466 (cons :tag "From Field"
1467 (const "From")
1468 (string :tag "Value"))
1469 (cons :tag "Organization Field"
1470 (const "Organization")
1471 (string :tag "Value"))
1472 (cons :tag "Other Field"
1473 (string :tag "Field")
1474 (string :tag "Value"))
1475 (cons :tag "Attribution Verb"
1476 (const ":attribution-verb")
1477 (string :tag "Value"))
1478 (cons :tag "Signature"
1479 (const :tag "Signature"
1480 ":signature")
1481 (choice
1482 (const :tag "mh-signature-file-name"
1483 nil)
1484 (file)
1485 (function)))
1486 (cons :tag "GPG Key ID"
1487 (const :tag "GPG Key ID"
1488 ":pgg-default-user-id")
1489 (string :tag "Value"))))))
1490 :set (lambda (symbol value)
1491 (set-default symbol value)
1492 (mh-identity-make-menu-no-autoload))
23347d76 1493 :group 'mh-identity
70a1d47e 1494 :package-version '(MH-E . "7.1"))
dda00b2c 1495
c90c4cf1 1496(defcustom-mh mh-auto-fields-list nil
dda00b2c
BW
1497 "List of recipients for which header lines are automatically inserted.
1498
1499This option can be used to set the identity depending on the
1500recipient. To customize this option, click on the \"INS\" button and
1501enter a regular expression for the recipient's address. Click on the
1502\"INS\" button with the \"Add at least one item below\" label. Then choose
1503one of the items in the \"Value Menu\".
1504
1505The \"Identity\" menu item is used to select an identity from those
1506configured in `mh-identity-list'. All of the information for that
1507identity will be added if the recipient matches. The \"Fcc Field\" menu
1508item is used to select a folder that is used in the \"Fcc:\" header.
1509When you send the message, MH will put a copy of your message in this
1510folder. The \"Mail-Followup-To Field\" menu item is used to insert an
1511\"Mail-Followup-To:\" header field with the recipients you provide. If
1512the recipient's mail user agent supports this header field (as nmh
1513does), then their replies will go to the addresses listed. This is
1514useful if their replies go both to the list and to you and you don't
1515have a mechanism to suppress duplicates. If you reply to someone not
1516on the list, you must either remove the \"Mail-Followup-To:\" field, or
1517ensure the recipient is also listed there so that he receives replies
1518to your reply. Other header fields may be added using the \"Other
1519Field\" menu item.
1520
1521These fields can only be added after the recipient is known. Once the
1522header contains one or more recipients, run the
1523\\[mh-insert-auto-fields] command or choose the \"Identity -> Insert
1524Auto Fields\" menu item to insert these fields manually. However, you
1525can just send the message and the fields will be added automatically.
1526You are given a chance to see these fields and to confirm them before
1527the message is actually sent. You can do away with this confirmation
1528by turning off the option `mh-auto-fields-prompt-flag'.
1529
1530You should avoid using the same header field in `mh-auto-fields-list'
1531and `mh-identity-list' definitions that may apply to the same message
1532as the result is undefined."
1533 :type `(repeat
1534 (list :tag ""
1535 (string :tag "Recipient")
1536 (repeat :tag "Add at least one item below"
1537 (choice
1538 (cons :tag "Identity"
1539 (const ":identity")
1540 ,(append
1541 '(radio)
1542 (mapcar
1543 (function (lambda (arg) `(const ,arg)))
1544 (mapcar 'car mh-identity-list))))
1545 (cons :tag "Fcc Field"
1546 (const "fcc")
1547 (string :tag "Value"))
1548 (cons :tag "Mail-Followup-To Field"
1549 (const "Mail-Followup-To")
1550 (string :tag "Value"))
1551 (cons :tag "Other Field"
1552 (string :tag "Field")
1553 (string :tag "Value"))))))
23347d76 1554 :group 'mh-identity
70a1d47e 1555 :package-version '(MH-E . "7.3"))
dda00b2c 1556
c90c4cf1 1557(defcustom-mh mh-auto-fields-prompt-flag t
dda00b2c
BW
1558 "*Non-nil means to prompt before sending if fields inserted.
1559See `mh-auto-fields-list'."
1560 :type 'boolean
23347d76 1561 :group 'mh-identity
70a1d47e 1562 :package-version '(MH-E . "8.0"))
dda00b2c 1563
c90c4cf1 1564(defcustom-mh mh-identity-default nil
dda00b2c
BW
1565 "Default identity to use when `mh-letter-mode' is called.
1566See `mh-identity-list'."
1567 :type (append
1568 '(radio)
1569 (cons '(const :tag "None" nil)
1570 (mapcar (function (lambda (arg) `(const ,arg)))
1571 (mapcar 'car mh-identity-list))))
23347d76 1572 :group 'mh-identity
70a1d47e 1573 :package-version '(MH-E . "7.1"))
dda00b2c 1574
c90c4cf1 1575(defcustom-mh mh-identity-handlers
dda00b2c
BW
1576 '(("From" . mh-identity-handler-top)
1577 (":default" . mh-identity-handler-bottom)
1578 (":attribution-verb" . mh-identity-handler-attribution-verb)
1579 (":signature" . mh-identity-handler-signature)
1580 (":pgg-default-user-id" . mh-identity-handler-gpg-identity))
1581 "Handler functions for fields in `mh-identity-list'.
1582
1583This option is used to change the way that fields, signatures,
1584and attributions in `mh-identity-list' are added. To customize
1585`mh-identity-handlers', replace the name of an existing handler
1586function associated with the field you want to change with the
1587name of a function you have written. You can also click on an
1588\"INS\" button and insert a field of your choice and the name of
1589the function you have written to handle it.
1590
1591The \"Field\" field can be any field that you've used in your
1592`mh-identity-list'. The special fields \":attribution-verb\",
1593\":signature\", or \":pgg-default-user-id\" are used for the
1594`mh-identity-list' choices \"Attribution Verb\", \"Signature\", and
1595\"GPG Key ID\" respectively.
1596
1597The handler associated with the \":default\" field is used when no
1598other field matches.
1599
1600The handler functions are passed two or three arguments: the
1601FIELD itself (for example, \"From\"), or one of the special
1602fields (for example, \":signature\"), and the ACTION 'remove or
1603'add. If the action is 'add, an additional argument
1604containing the VALUE for the field is given."
1605 :type '(repeat (cons (string :tag "Field") function))
23347d76 1606 :group 'mh-identity
70a1d47e 1607 :package-version '(MH-E . "8.0"))
dda00b2c
BW
1608
1609;;; Incorporating Your Mail (:group 'mh-inc)
1610
c90c4cf1 1611(defcustom-mh mh-inc-prog "inc"
dda00b2c
BW
1612 "*Program to incorporate new mail into a folder.
1613
1614This program generates a one-line summary for each of the new
1615messages. Unless it is an absolute pathname, the file is assumed
1616to be in the `mh-progs' directory. You may also link a file to
1617\"inc\" that uses a different format. You'll then need to modify
1618several scan line format variables appropriately."
1619 :type 'string
23347d76 1620 :group 'mh-inc
70a1d47e 1621 :package-version '(MH-E . "6.0"))
dda00b2c
BW
1622
1623(eval-and-compile
1624 (unless (fboundp 'mh-inc-spool-make-no-autoload)
1625 (defun mh-inc-spool-make-no-autoload ()
1626 "Temporary definition.
1627Real definition will take effect when mh-inc is loaded."
1628 nil)))
1629
c90c4cf1 1630(defcustom-mh mh-inc-spool-list nil
dda00b2c
BW
1631 "*Alternate spool files.
1632
1633You can use the `mh-inc-spool-list' variable to direct MH-E to
1634retrieve mail from arbitrary spool files other than your system
1635mailbox, file it in folders other than your \"+inbox\", and assign
1636key bindings to incorporate this mail.
1637
1638Suppose you are subscribed to the \"mh-e-devel\" mailing list and
1639you use \"procmail\" to filter this mail into \"~/mail/mh-e\" with
1640the following recipe in \".procmailrc\":
1641
1642 MAILDIR=$HOME/mail
1643 :0:
1644 * ^From mh-e-devel-admin@stop.mail-abuse.org
1645 mh-e
1646
1647In order to incorporate \"~/mail/mh-e\" into \"+mh-e\" with an
1648\"I m\" (mh-inc-spool-mh-e) command, customize this option, and click
1649on the \"INS\" button. Enter a \"Spool File\" of \"~/mail/mh-e\", a
1650\"Folder\" of \"mh-e\", and a \"Key Binding\" of \"m\".
1651
1652You can use \"xbuffy\" to automate the incorporation of this mail
dc4d94d5 1653using the Emacs 22 command \"emacsclient\" as follows:
dda00b2c
BW
1654
1655 box ~/mail/mh-e
1656 title mh-e
1657 origMode
1658 polltime 10
1659 headertime 0
dc4d94d5
BW
1660 command emacsclient --eval '(mh-inc-spool-mh-e)'
1661
1662In XEmacs, the command \"gnuclient\" is used in a similar
1663fashion."
dda00b2c
BW
1664 :type '(repeat (list (file :tag "Spool File")
1665 (string :tag "Folder")
1666 (character :tag "Key Binding")))
1667 :set (lambda (symbol value)
1668 (set-default symbol value)
1669 (mh-inc-spool-make-no-autoload))
23347d76 1670 :group 'mh-inc
70a1d47e 1671 :package-version '(MH-E . "7.3"))
dda00b2c
BW
1672
1673;;; Dealing with Junk Mail (:group 'mh-junk)
1674
1675(defvar mh-junk-choice nil
1676 "Chosen spam fighting program.")
1677
1678;; Available spam filter interfaces
1679(defvar mh-junk-function-alist
1680 '((spamassassin mh-spamassassin-blacklist mh-spamassassin-whitelist)
1681 (bogofilter mh-bogofilter-blacklist mh-bogofilter-whitelist)
1682 (spamprobe mh-spamprobe-blacklist mh-spamprobe-whitelist))
1683 "Available choices of spam programs to use.
1684
1685This is an alist. For each element there are functions that
1686blacklist a message as spam and whitelist a message incorrectly
1687classified as spam.")
1688
1689(defun mh-junk-choose (symbol value)
1690 "Choose spam program to use.
1691
1692The function is always called with SYMBOL bound to
1693`mh-junk-program' and VALUE bound to the new value of
1694`mh-junk-program'. The function sets the variable
1695`mh-junk-choice' in addition to `mh-junk-program'."
1696 (set symbol value) ;XXX shouldn't this be set-default?
1697 (setq mh-junk-choice
1698 (or value
1699 (loop for element in mh-junk-function-alist
1700 until (executable-find (symbol-name (car element)))
1701 finally return (car element)))))
1702
c90c4cf1 1703(defcustom-mh mh-junk-background nil
dda00b2c
BW
1704 "If on, spam programs are run in background.
1705
1706By default, the programs are run in the foreground, but this can
1707be slow when junking large numbers of messages. If you have
1708enough memory or don't junk that many messages at the same time,
1a9aa7df
BW
1709you might try turning on this option.
1710
1711Note that this option is used as the \"display\" argument in the
1712call to `call-process'. Therefore, turning on this option means
1713setting its value to \"0\". You can also set its value to t to
1714direct the programs' output to the \"*MH-E Log*\" buffer; this
1715may be useful for debugging."
dda00b2c
BW
1716 :type '(choice (const :tag "Off" nil)
1717 (const :tag "On" 0))
23347d76 1718 :group 'mh-junk
70a1d47e 1719 :package-version '(MH-E . "8.0"))
dda00b2c 1720
c90c4cf1 1721(defcustom-mh mh-junk-disposition nil
dda00b2c
BW
1722 "Disposition of junk mail."
1723 :type '(choice (const :tag "Delete Spam" nil)
1724 (string :tag "Spam Folder"))
23347d76 1725 :group 'mh-junk
70a1d47e 1726 :package-version '(MH-E . "8.0"))
dda00b2c 1727
c90c4cf1 1728(defcustom-mh mh-junk-program nil
dda00b2c
BW
1729 "Spam program that MH-E should use.
1730
1731The default setting of this option is \"Auto-detect\" which means
1732that MH-E will automatically choose one of SpamAssassin,
1733bogofilter, or SpamProbe in that order. If, for example, you have
1734both SpamAssassin and bogofilter installed and you want to use
1735bogofilter, then you can set this option to \"Bogofilter\"."
1736 :type '(choice (const :tag "Auto-detect" nil)
1737 (const :tag "SpamAssassin" spamassassin)
1738 (const :tag "Bogofilter" bogofilter)
1739 (const :tag "SpamProbe" spamprobe))
1740 :set 'mh-junk-choose
23347d76 1741 :group 'mh-junk
70a1d47e 1742 :package-version '(MH-E . "7.3"))
dda00b2c
BW
1743
1744;;; Editing a Draft (:group 'mh-letter)
1745
c90c4cf1 1746(defcustom-mh mh-compose-insertion (if (locate-library "mml") 'mml 'mh)
dda00b2c
BW
1747 "Type of tags used when composing MIME messages.
1748
1749In addition to MH-style directives, MH-E also supports MML (MIME
1750Meta Language) tags. (see Info node `(emacs-mime)Composing').
1751This option can be used to choose between them. By default, this
1752option is set to \"MML\" if it is supported since it provides a
1753lot more functionality. This option can also be set to \"MH\" if
1754MH-style directives are preferred."
1755 :type '(choice (const :tag "MML" mml)
1756 (const :tag "MH" mh))
23347d76 1757 :group 'mh-letter
70a1d47e 1758 :package-version '(MH-E . "7.0"))
dda00b2c 1759
c90c4cf1 1760(defcustom-mh mh-compose-skipped-header-fields
dda00b2c
BW
1761 '("From" "Organization" "References" "In-Reply-To"
1762 "X-Face" "Face" "X-Image-URL" "X-Mailer")
1763 "List of header fields to skip over when navigating in draft."
1764 :type '(repeat (string :tag "Field"))
23347d76 1765 :group 'mh-letter
70a1d47e 1766 :package-version '(MH-E . "7.4"))
dda00b2c 1767
c90c4cf1 1768(defcustom-mh mh-compose-space-does-completion-flag nil
dda00b2c
BW
1769 "*Non-nil means \\<mh-letter-mode-map>\\[mh-letter-complete-or-space] does completion in message header."
1770 :type 'boolean
23347d76 1771 :group 'mh-letter
70a1d47e 1772 :package-version '(MH-E . "7.4"))
dda00b2c 1773
c90c4cf1 1774(defcustom-mh mh-delete-yanked-msg-window-flag nil
dda00b2c
BW
1775 "*Non-nil means delete any window displaying the message.
1776
1777This deletes the window containing the original message after
1778yanking it with \\<mh-letter-mode-map>\\[mh-yank-cur-msg] to make
1779more room on your screen for your reply."
1780 :type 'boolean
23347d76 1781 :group 'mh-letter
70a1d47e 1782 :package-version '(MH-E . "7.0"))
dda00b2c 1783
c90c4cf1 1784(defcustom-mh mh-extract-from-attribution-verb "wrote:"
dda00b2c
BW
1785 "*Verb to use for attribution when a message is yanked by \\<mh-letter-mode-map>\\[mh-yank-cur-msg].
1786
1787The attribution consists of the sender's name and email address
1788followed by the content of this option. This option can be set to
1789\"wrote:\", \"a écrit:\", and \"schrieb:\". You can also use the
1790\"Custom String\" menu item to enter your own verb."
1791 :type '(choice (const "wrote:")
1792 (const "a écrit:")
1793 (const "schrieb:")
1794 (string :tag "Custom String"))
23347d76 1795 :group 'mh-letter
70a1d47e 1796 :package-version '(MH-E . "7.0"))
dda00b2c 1797
c90c4cf1 1798(defcustom-mh mh-ins-buf-prefix "> "
dda00b2c
BW
1799 "*String to put before each line of a yanked or inserted message.
1800
1801The prefix \"> \" is the default setting of this option. I
1802suggest that you not modify this option since it is used by many
1803mailers and news readers: messages are far easier to read if
1804several included messages have all been indented by the same
1805string.
1806
1807This prefix is not inserted if you use one of the supercite
1808flavors of `mh-yank-behavior' or you have added a
1809`mail-citation-hook'."
1810 :type 'string
23347d76 1811 :group 'mh-letter
70a1d47e 1812 :package-version '(MH-E . "6.0"))
dda00b2c 1813
c90c4cf1 1814(defcustom-mh mh-letter-complete-function 'ispell-complete-word
dda00b2c
BW
1815 "*Function to call when completing outside of address or folder fields.
1816
1817In the body of the message,
1818\\<mh-letter-mode-map>\\[mh-letter-complete] runs this function,
1819which is set to \"ispell-complete-word\" by default."
1820 :type '(choice function (const nil))
23347d76 1821 :group 'mh-letter
70a1d47e 1822 :package-version '(MH-E . "7.1"))
dda00b2c 1823
c90c4cf1 1824(defcustom-mh mh-letter-fill-column 72
dda00b2c
BW
1825 "*Fill column to use in MH Letter mode.
1826
1827By default, this option is 72 to allow others to quote your
1828message without line wrapping."
1829 :type 'integer
23347d76 1830 :group 'mh-letter
70a1d47e 1831 :package-version '(MH-E . "6.0"))
dda00b2c 1832
c90c4cf1 1833(defcustom-mh mh-mml-method-default (if mh-pgp-support-flag "pgpmime" "none")
dda00b2c
BW
1834 "Default method to use in security tags.
1835
1836This option is used to select between a variety of mail security
1837mechanisms. The default is \"PGP (MIME)\" if it is supported\;
1838otherwise, the default is \"None\". Other mechanisms include
1839vanilla \"PGP\" and \"S/MIME\".
1840
1841The `pgg' customization group may have some settings which may
1842interest you (see Info node `(pgg)').
1843
1844In particular, I turn on the option `pgg-encrypt-for-me' so that
1845all messages I encrypt are encrypted with my public key as well.
1846If you keep a copy of all of your outgoing mail with a \"Fcc:\"
1847header field, this setting is vital so that you can read the mail
1848you write!"
1849 :type '(choice (const :tag "PGP (MIME)" "pgpmime")
1850 (const :tag "PGP" "pgp")
1851 (const :tag "S/MIME" "smime")
1852 (const :tag "None" "none"))
23347d76 1853 :group 'mh-letter
70a1d47e 1854 :package-version '(MH-E . "8.0"))
dda00b2c 1855
c90c4cf1 1856(defcustom-mh mh-signature-file-name "~/.signature"
dda00b2c
BW
1857 "*Source of user's signature.
1858
1859By default, the text of your signature is taken from the file
1860\"~/.signature\". You can read from other sources by changing this
1861option. This file may contain a vCard in which case an attachment is
1862added with the vCard.
1863
1864This option may also be a symbol, in which case that function is
1865called. You may not want a signature separator to be added for you;
1866instead you may want to insert one yourself. Options that you may find
1867useful to do this include `mh-signature-separator' (when inserting a
1868signature separator) and `mh-signature-separator-regexp' (for finding
1869said separator). The function `mh-signature-separator-p', which
1870reports t if the buffer contains a separator, may be useful as well.
1871
1872The signature is inserted into your message with the command
1873\\<mh-letter-mode-map>\\[mh-insert-signature] or with the option
1874`mh-identity-list'."
1875 :type 'file
23347d76 1876 :group 'mh-letter
70a1d47e 1877 :package-version '(MH-E . "6.0"))
dda00b2c 1878
c90c4cf1 1879(defcustom-mh mh-signature-separator-flag t
dda00b2c
BW
1880 "*Non-nil means a signature separator should be inserted.
1881
1882It is not recommended that you change this option since various
1883mail user agents, including MH-E, use the separator to present
1884the signature differently, and to suppress the signature when
1885replying or yanking a letter into a draft."
1886 :type 'boolean
23347d76 1887 :group 'mh-letter
70a1d47e 1888 :package-version '(MH-E . "8.0"))
dda00b2c 1889
c90c4cf1 1890(defcustom-mh mh-x-face-file "~/.face"
dda00b2c
BW
1891 "*File containing face header field to insert in outgoing mail.
1892
1893If the file starts with either of the strings \"X-Face:\", \"Face:\"
1894or \"X-Image-URL:\" then the contents are added to the message header
1895verbatim. Otherwise it is assumed that the file contains the value of
1896the \"X-Face:\" header field.
1897
1898The \"X-Face:\" header field, which is a low-resolution, black and
1899white image, can be generated using the \"compface\" command (see URL
1900`ftp://ftp.cs.indiana.edu/pub/faces/compface/compface.tar.Z'). The
1901\"Online X-Face Converter\" is a useful resource for quick conversion
1902of images into \"X-Face:\" header fields (see URL
1903`http://www.dairiki.org/xface/').
1904
1905Use the \"make-face\" script to convert a JPEG image to the higher
1906resolution, color, \"Face:\" header field (see URL
1907`http://quimby.gnus.org/circus/face/make-face').
1908
1909The URL of any image can be used for the \"X-Image-URL:\" field and no
1910processing of the image is required.
1911
1912To prevent the setting of any of these header fields, either set
1913`mh-x-face-file' to nil, or simply ensure that the file defined by
1914this option doesn't exist."
1915 :type 'file
23347d76 1916 :group 'mh-letter
70a1d47e 1917 :package-version '(MH-E . "7.0"))
dda00b2c 1918
c90c4cf1 1919(defcustom-mh mh-yank-behavior 'attribution
dda00b2c
BW
1920 "*Controls which part of a message is yanked by \\<mh-letter-mode-map>\\[mh-yank-cur-msg].
1921
1922To include the entire message, including the entire header, use
1923\"Body and Header\". Use \"Body\" to yank just the body without
1924the header. To yank only the portion of the message following the
1925point, set this option to \"Below Point\".
1926
1927Choose \"Invoke supercite\" to pass the entire message and header
1928through supercite.
1929
1930If the \"Body With Attribution\" setting is used, then the
1931message minus the header is yanked and a simple attribution line
1932is added at the top using the value of the option
1933`mh-extract-from-attribution-verb'. This is the default.
1934
1935If the \"Invoke supercite\" or \"Body With Attribution\" settings
1936are used, the \"-noformat\" argument is passed to the \"repl\"
1937program to override a \"-filter\" or \"-format\" argument. These
1938settings also have \"Automatically\" variants that perform the
1939action automatically when you reply so that you don't need to use
1940\\[mh-yank-cur-msg] at all. Note that this automatic action is
1941only performed if the show buffer matches the message being
1942replied to. People who use the automatic variants tend to turn on
1943the option `mh-delete-yanked-msg-window-flag' as well so that the
1944show window is never displayed.
1945
1946If the show buffer has a region, the option `mh-yank-behavior' is
1947ignored unless its value is one of Attribution variants in which
1948case the attribution is added to the yanked region.
1949
1950If this option is set to one of the supercite flavors, the hook
1951`mail-citation-hook' is ignored and `mh-ins-buf-prefix' is not
1952inserted."
1953 :type '(choice (const :tag "Body and Header" t)
1954 (const :tag "Body" body)
1955 (const :tag "Below Point" nil)
1956 (const :tag "Invoke supercite" supercite)
1957 (const :tag "Invoke supercite, Automatically" autosupercite)
1958 (const :tag "Body With Attribution" attribution)
1959 (const :tag "Body With Attribution, Automatically"
1960 autoattrib))
23347d76 1961 :group 'mh-letter
70a1d47e 1962 :package-version '(MH-E . "8.0"))
dda00b2c
BW
1963
1964;;; Ranges (:group 'mh-ranges)
1965
c90c4cf1 1966(defcustom-mh mh-interpret-number-as-range-flag t
dda00b2c
BW
1967 "*Non-nil means interpret a number as a range.
1968
1969Since one of the most frequent ranges used is \"last:N\", MH-E
1970will interpret input such as \"200\" as \"last:200\" if this
1971option is on (which is the default). If you need to scan just the
1972message 200, then use the range \"200:200\"."
1973 :type 'boolean
23347d76 1974 :group 'mh-ranges
70a1d47e 1975 :package-version '(MH-E . "7.4"))
dda00b2c
BW
1976
1977;;; Scan Line Formats (:group 'mh-scan-line-formats)
1978
1979(eval-and-compile
1980 (unless (fboundp 'mh-adaptive-cmd-note-flag-check)
1981 (defun mh-adaptive-cmd-note-flag-check (symbol value)
1982 "Temporary definition.
1983Real definition, below, uses variables that aren't defined yet."
1984 (set-default symbol value))))
1985
c90c4cf1 1986(defcustom-mh mh-adaptive-cmd-note-flag t
dda00b2c
BW
1987 "*Non-nil means that the message number width is determined dynamically.
1988
1989If you've created your own format to handle long message numbers,
1990you'll be pleased to know you no longer need it since MH-E adapts its
1991internal format based upon the largest message number if this option
1992is on (the default). This option may only be turned on when
1993`mh-scan-format-file' is set to \"Use MH-E scan Format\".
1994
1995If you prefer fixed-width message numbers, turn off this option and
1996call `mh-set-cmd-note' with the width specified by your format file
1997\(see `mh-scan-format-file'). For example, the default width is 4, so
1998you would use \"(mh-set-cmd-note 4)\"."
1999 :type 'boolean
2000 :group 'mh-scan-line-formats
23347d76 2001 :set 'mh-adaptive-cmd-note-flag-check
70a1d47e 2002 :package-version '(MH-E . "7.0"))
dda00b2c
BW
2003
2004(defun mh-scan-format-file-check (symbol value)
cb5bf6ba 2005 "Check if desired setting is valid.
dda00b2c
BW
2006Throw an error if user tries to set `mh-scan-format-file' to
2007anything but t when `mh-adaptive-cmd-note-flag' is on. Otherwise,
2008set SYMBOL to VALUE."
2009 (if (and (not (eq value t))
fd61b9ab 2010 mh-adaptive-cmd-note-flag)
dda00b2c
BW
2011 (error "%s %s" "You must turn off `mh-adaptive-cmd-note-flag'"
2012 "unless you use \"Use MH-E scan Format\"")
2013 (set-default symbol value)))
2014
c90c4cf1 2015(defcustom-mh mh-scan-format-file t
dda00b2c
BW
2016 "Specifies the format file to pass to the scan program.
2017
2018The default setting for this option is \"Use MH-E scan Format\". This
2019means that the format string will be taken from the either
2020`mh-scan-format-mh' or `mh-scan-format-nmh' depending on whether MH or
efa47761 2021nmh (or GNU mailutils MH) is in use. This setting also enables you to
dda00b2c
BW
2022turn on the `mh-adaptive-cmd-note-flag' option.
2023
2024You can also set this option to \"Use Default scan Format\" to get the
2025same output as you would get if you ran \"scan\" from the shell. If
2026you have a format file that you want MH-E to use but not MH, you can
2027set this option to \"Specify a scan Format File\" and enter the name
2028of your format file.
2029
2030If you change the format of the scan lines you'll need to tell MH-E
2031how to parse the new format. As you will see, quite a lot of variables
2032are involved to do that. Use \"\\[apropos] RET mh-scan.*regexp\" to
2033obtain a list of these variables. You will also have to call
2034`mh-set-cmd-note' if your notations are not in column 4 (columns in
2035Emacs start with 0)."
2036 :type '(choice (const :tag "Use MH-E scan Format" t)
2037 (const :tag "Use Default scan Format" nil)
2038 (file :tag "Specify a scan Format File"))
2039 :group 'mh-scan-line-formats
23347d76 2040 :set 'mh-scan-format-file-check
70a1d47e 2041 :package-version '(MH-E . "6.0"))
dda00b2c
BW
2042
2043(defun mh-adaptive-cmd-note-flag-check (symbol value)
cb5bf6ba 2044 "Check if desired setting is valid.
dda00b2c
BW
2045Throw an error if user tries to turn on
2046`mh-adaptive-cmd-note-flag' when `mh-scan-format-file' isn't t.
2047Otherwise, set SYMBOL to VALUE."
2048 (if (and value
2049 (not (eq mh-scan-format-file t)))
2050 (error "%s %s" "Can't turn on unless `mh-scan-format-file'"
2051 "is set to \"Use MH-E scan Format\"")
2052 (set-default symbol value)))
2053
c90c4cf1 2054(defcustom-mh mh-scan-prog "scan"
dda00b2c
BW
2055 "*Program used to scan messages.
2056
2057The name of the program that generates a listing of one line per
2058message is held in this option. Unless this variable contains an
2059absolute pathname, it is assumed to be in the `mh-progs'
2060directory. You may link another program to `scan' (see
2061\"mh-profile(5)\") to produce a different type of listing."
2062 :type 'string
23347d76 2063 :group 'mh-scan-line-formats
70a1d47e 2064 :package-version '(MH-E . "6.0"))
dda00b2c
BW
2065(make-variable-buffer-local 'mh-scan-prog)
2066
dda00b2c
BW
2067;;; Searching (:group 'mh-search)
2068
c90c4cf1 2069(defcustom-mh mh-search-program nil
dda00b2c
BW
2070 "Search program that MH-E shall use.
2071
2072The default setting of this option is \"Auto-detect\" which means
2073that MH-E will automatically choose one of swish++, swish-e,
2074mairix, namazu, pick and grep in that order. If, for example, you
2075have both swish++ and mairix installed and you want to use
2076mairix, then you can set this option to \"mairix\".
2077
2078More information about setting up an indexing program to use with
2079MH-E can be found in the documentation of `mh-search'."
2080 :type '(choice (const :tag "Auto-detect" nil)
2081 (const :tag "swish++" swish++)
2082 (const :tag "swish-e" swish)
2083 (const :tag "mairix" mairix)
2084 (const :tag "namazu" namazu)
2085 (const :tag "pick" pick)
2086 (const :tag "grep" grep))
23347d76 2087 :group 'mh-search
70a1d47e 2088 :package-version '(MH-E . "8.0"))
dda00b2c
BW
2089
2090;;; Sending Mail (:group 'mh-sending-mail)
2091
c90c4cf1 2092(defcustom-mh mh-compose-forward-as-mime-flag t
dda00b2c
BW
2093 "*Non-nil means that messages are forwarded as attachments.
2094
2095By default, this option is on which means that the forwarded
2096messages are included as attachments. If you would prefer to
2097forward your messages verbatim (as text, inline), then turn off
2098this option. Forwarding messages verbatim works well for short,
2099textual messages, but your recipient won't be able to view any
2100non-textual attachments that were in the forwarded message. Be
2101aware that if you have \"forw: -mime\" in your MH profile, then
2102forwarded messages will always be included as attachments
2103regardless of the settings of this option."
2104 :type 'boolean
23347d76 2105 :group 'mh-sending-mail
70a1d47e 2106 :package-version '(MH-E . "8.0"))
dda00b2c 2107
c90c4cf1 2108(defcustom-mh mh-compose-letter-function nil
dda00b2c
BW
2109 "Invoked when starting a new draft.
2110
2111However, it is the last function called before you edit your
2112message. The consequence of this is that you can write a function
2113to write and send the message for you. This function is passed
2114three arguments: the contents of the TO, SUBJECT, and CC header
2115fields."
2116 :type '(choice (const nil) function)
23347d76 2117 :group 'mh-sending-mail
70a1d47e 2118 :package-version '(MH-E . "6.0"))
dda00b2c 2119
c90c4cf1 2120(defcustom-mh mh-compose-prompt-flag nil
dda00b2c
BW
2121 "*Non-nil means prompt for header fields when composing a new draft."
2122 :type 'boolean
23347d76 2123 :group 'mh-sending-mail
70a1d47e 2124 :package-version '(MH-E . "7.4"))
dda00b2c 2125
c90c4cf1 2126(defcustom-mh mh-forward-subject-format "%s: %s"
dda00b2c
BW
2127 "*Format string for forwarded message subject.
2128
2129This option is a string which includes two escapes (\"%s\"). The
2130first \"%s\" is replaced with the sender of the original message,
2131and the second one is replaced with the original \"Subject:\"."
2132 :type 'string
23347d76 2133 :group 'mh-sending-mail
70a1d47e 2134 :package-version '(MH-E . "6.0"))
dda00b2c 2135
c90c4cf1 2136(defcustom-mh mh-insert-x-mailer-flag t
dda00b2c
BW
2137 "*Non-nil means append an \"X-Mailer:\" header field to the header.
2138
2139This header field includes the version of MH-E and Emacs that you
2140are using. If you don't want to participate in our marketing, you
2141can turn this option off."
2142 :type 'boolean
23347d76 2143 :group 'mh-sending-mail
70a1d47e 2144 :package-version '(MH-E . "7.0"))
dda00b2c 2145
c90c4cf1 2146(defcustom-mh mh-redist-full-contents-flag nil
dda00b2c
BW
2147 "*Non-nil means the \"dist\" command needs entire letter for redistribution.
2148
2149This option must be turned on if \"dist\" requires the whole
2150letter for redistribution, which is the case if \"send\" is
2151compiled with the BERK option (which many people abhor). If you
2152find that MH will not allow you to redistribute a message that
2153has been redistributed before, turn off this option."
2154 :type 'boolean
23347d76 2155 :group 'mh-sending-mail
70a1d47e 2156 :package-version '(MH-E . "8.0"))
dda00b2c 2157
c90c4cf1 2158(defcustom-mh mh-reply-default-reply-to nil
dda00b2c
BW
2159 "*Sets the person or persons to whom a reply will be sent.
2160
2161This option is set to \"Prompt\" by default so that you are
2162prompted for the recipient of a reply. If you find that most of
2163the time that you specify \"cc\" when you reply to a message, set
2164this option to \"cc\". Other choices include \"from\", \"to\", or
2165\"all\". You can always edit the recipients in the draft."
2166 :type '(choice (const :tag "Prompt" nil)
2167 (const "from")
2168 (const "to")
2169 (const "cc")
2170 (const "all"))
23347d76 2171 :group 'mh-sending-mail
70a1d47e 2172 :package-version '(MH-E . "6.0"))
dda00b2c 2173
c90c4cf1 2174(defcustom-mh mh-reply-show-message-flag t
dda00b2c
BW
2175 "*Non-nil means the MH-Show buffer is displayed when replying.
2176
2177If you include the message automatically, you can hide the
2178MH-Show buffer by turning off this option.
2179
2180See also `mh-reply'."
2181 :type 'boolean
23347d76 2182 :group 'mh-sending-mail
70a1d47e 2183 :package-version '(MH-E . "7.0"))
dda00b2c
BW
2184
2185;;; Sequences (:group 'mh-sequences)
2186
2187;; If `mh-unpropagated-sequences' becomes a defcustom, add the following to
2188;; the docstring: "Additional sequences that should not to be preserved can be
2189;; specified by setting `mh-unpropagated-sequences' appropriately." XXX
2190
c90c4cf1 2191(defcustom-mh mh-refile-preserves-sequences-flag t
dda00b2c
BW
2192 "*Non-nil means that sequences are preserved when messages are refiled.
2193
2194If a message is in any sequence (except \"Previous-Sequence:\"
2195and \"cur\") when it is refiled, then it will still be in those
2196sequences in the destination folder. If this behavior is not
2197desired, then turn off this option."
2198 :type 'boolean
23347d76 2199 :group 'mh-sequences
70a1d47e 2200 :package-version '(MH-E . "7.4"))
dda00b2c 2201
c90c4cf1 2202(defcustom-mh mh-tick-seq 'tick
dda00b2c
BW
2203 "The name of the MH sequence for ticked messages.
2204
2205You can customize this option if you already use the \"tick\"
2206sequence for your own use. You can also disable all of the
2207ticking functions by choosing the \"Disable Ticking\" item but
2208there isn't much advantage to that."
2209 :type '(choice (const :tag "Disable Ticking" nil)
2210 symbol)
23347d76 2211 :group 'mh-sequences
70a1d47e 2212 :package-version '(MH-E . "7.3"))
dda00b2c 2213
c90c4cf1 2214(defcustom-mh mh-update-sequences-after-mh-show-flag t
dda00b2c
BW
2215 "*Non-nil means flush MH sequences to disk after message is shown\\<mh-folder-mode-map>.
2216
2217Three sequences are maintained internally by MH-E and pushed out
2218to MH when a message is shown. They include the sequence
2219specified by your \"Unseen-Sequence:\" profile entry, \"cur\",
2220and the sequence listed by the option `mh-tick-seq' which is
2221\"tick\" by default. If you do not like this behavior, turn off
2222this option. You can then update the state manually with the
2223\\[mh-execute-commands], \\[mh-quit], or \\[mh-update-sequences]
2224commands."
2225 :type 'boolean
23347d76 2226 :group 'mh-sequences
70a1d47e 2227 :package-version '(MH-E . "7.0"))
dda00b2c 2228
41b97610
BW
2229(defcustom-mh mh-whitelist-preserves-sequences-flag t
2230 "*Non-nil means that sequences are preserved when messages are whitelisted.
2231
2232If a message is in any sequence (except \"Previous-Sequence:\"
2233and \"cur\") when it is whitelisted, then it will still be in
2234those sequences in the destination folder. If this behavior is
2235not desired, then turn off this option."
2236 :type 'boolean
2237 :group 'mh-sequences
2238 :package-version '(MH-E . "8.4"))
2239
dda00b2c
BW
2240;;; Reading Your Mail (:group 'mh-show)
2241
c90c4cf1 2242(defcustom-mh mh-bury-show-buffer-flag t
dda00b2c
BW
2243 "*Non-nil means show buffer is buried.
2244
2245One advantage of not burying the show buffer is that one can
2246delete the show buffer more easily in an electric buffer list
2247because of its proximity to its associated MH-Folder buffer. Try
2248running \\[electric-buffer-list] to see what I mean."
2249 :type 'boolean
23347d76 2250 :group 'mh-show
70a1d47e 2251 :package-version '(MH-E . "7.0"))
dda00b2c 2252
c90c4cf1 2253(defcustom-mh mh-clean-message-header-flag t
dda00b2c
BW
2254 "*Non-nil means remove extraneous header fields.
2255
2256See also `mh-invisible-header-fields-default' and
2257`mh-invisible-header-fields'."
2258 :type 'boolean
23347d76 2259 :group 'mh-show
70a1d47e 2260 :package-version '(MH-E . "7.0"))
dda00b2c 2261
c90c4cf1 2262(defcustom-mh mh-decode-mime-flag (not (not (locate-library "mm-decode")))
dda00b2c
BW
2263 "*Non-nil means attachments are handled\\<mh-folder-mode-map>.
2264
2265MH-E can handle attachments as well if the Gnus `mm-decode'
2266library is present. If so, this option will be on. Otherwise,
2267you'll see the MIME body parts rather than text or attachments.
2268There isn't much point in turning off this option; however, you
2269can inspect it if it appears that the body parts are not being
2270interpreted correctly or toggle it with the command
2271\\[mh-toggle-mh-decode-mime-flag] to view the raw message.
2272
2273This option also controls the display of quoted-printable
2274messages and other graphical widgets. See the options
2275`mh-graphical-smileys-flag' and `mh-graphical-emphasis-flag'."
2276 :type 'boolean
23347d76 2277 :group 'mh-show
70a1d47e 2278 :package-version '(MH-E . "7.0"))
dda00b2c 2279
c90c4cf1 2280(defcustom-mh mh-display-buttons-for-alternatives-flag nil
dda00b2c
BW
2281 "*Non-nil means display buttons for all alternative attachments.
2282
2283Sometimes, a mail program will produce multiple alternatives of
2284the attachment in increasing degree of faithfulness to the
2285original content. By default, only the preferred alternative is
2286displayed. If this option is on, then the preferred part is shown
2287inline and buttons are shown for each of the other alternatives."
2288 :type 'boolean
23347d76 2289 :group 'mh-show
70a1d47e 2290 :package-version '(MH-E . "7.4"))
dda00b2c 2291
c90c4cf1 2292(defcustom-mh mh-display-buttons-for-inline-parts-flag nil
dda00b2c
BW
2293 "*Non-nil means display buttons for all inline attachments\\<mh-folder-mode-map>.
2294
2295The sender can request that attachments should be viewed inline so
2296that they do not really appear like an attachment at all to the
2297reader. Most of the time, this is desirable, so by default MH-E
2298suppresses the buttons for inline attachments. On the other hand, you
2299may receive code or HTML which the sender has added to his message as
2300inline attachments so that you can read them in MH-E. In this case, it
2301is useful to see the buttons so that you know you don't have to cut
2302and paste the code into a file; you can simply save the attachment.
2303
2304If you want to make the buttons visible for inline attachments, you
2305can use the command \\[mh-toggle-mime-buttons] to toggle the
2306visibility of these buttons. You can turn on these buttons permanently
2307by turning on this option.
2308
2309MH-E cannot display all attachments inline however. It can display
2310text (including HTML) and images."
2311 :type 'boolean
23347d76 2312 :group 'mh-show
70a1d47e 2313 :package-version '(MH-E . "7.0"))
dda00b2c 2314
c90c4cf1 2315(defcustom-mh mh-do-not-confirm-flag nil
dda00b2c
BW
2316 "*Non-nil means non-reversible commands do not prompt for confirmation.
2317
2318Commands such as `mh-pack-folder' prompt to confirm whether to
2319process outstanding moves and deletes or not before continuing.
2320Turning on this option means that these actions will be
2321performed--which is usually desired but cannot be
2322retracted--without question."
2323 :type 'boolean
23347d76 2324 :group 'mh-show
70a1d47e 2325 :package-version '(MH-E . "7.0"))
dda00b2c 2326
c90c4cf1 2327(defcustom-mh mh-fetch-x-image-url nil
dda00b2c
BW
2328 "*Control fetching of \"X-Image-URL:\" header field image.
2329
2330Ths option controls the fetching of the \"X-Image-URL:\" header
2331field image with the following values:
2332
2333Ask Before Fetching
2334 You are prompted before the image is fetched. MH-E will
2335 remember your reply and will either use the already fetched
2336 image the next time the same URL is encountered or silently
2337 skip it if you didn't fetch it the first time. This is a
2338 good setting.
2339
2340Never Fetch
2341 Images are never fetched and only displayed if they are
2342 already present in the cache. This is the default.
2343
2344There isn't a value of \"Always Fetch\" for privacy and DOS (denial of
2345service) reasons. For example, fetching a URL can tip off a spammer
2346that you've read his email (which is why you shouldn't blindly answer
2347yes if you've set this option to \"Ask Before Fetching\"). Someone may
2348also flood your network and fill your disk drive by sending a torrent
2349of messages, each specifying a unique URL to a very large file.
2350
2351The cache of images is found in the directory \".mhe-x-image-cache\"
2352within your MH directory. You can add your own face to the \"From:\"
2353field too. See Info node `(mh-e)Picture'.
2354
2355This setting only has effect if the option `mh-show-use-xface-flag' is
2356turned on."
2357
2358 :type '(choice (const :tag "Ask Before Fetching" ask)
2359 (const :tag "Never Fetch" nil))
23347d76 2360 :group 'mh-show
70a1d47e 2361 :package-version '(MH-E . "7.3"))
dda00b2c 2362
c90c4cf1 2363(defcustom-mh mh-graphical-smileys-flag t
dda00b2c
BW
2364 "*Non-nil means graphical smileys are displayed.
2365
2366It is a long standing custom to inject body language using a
2367cornucopia of punctuation, also known as the \"smileys\". MH-E
2368can render these as graphical widgets if this option is turned
2369on, which it is by default. Smileys include patterns such as :-)
2370and ;-).
2371
2372This option is disabled if the option `mh-decode-mime-flag' is
2373turned off."
2374 :type 'boolean
23347d76 2375 :group 'mh-show
70a1d47e 2376 :package-version '(MH-E . "7.0"))
dda00b2c 2377
c90c4cf1 2378(defcustom-mh mh-graphical-emphasis-flag t
dda00b2c
BW
2379 "*Non-nil means graphical emphasis is displayed.
2380
2381A few typesetting features are indicated in ASCII text with
2382certain characters. If your terminal supports it, MH-E can render
2383these typesetting directives naturally if this option is turned
2384on, which it is by default. For example, _underline_ will be
2385underlined, *bold* will appear in bold, /italics/ will appear in
2386italics, and so on. See the option `gnus-emphasis-alist' for the
2387whole list.
2388
2389This option is disabled if the option `mh-decode-mime-flag' is
2390turned off."
2391 :type 'boolean
23347d76 2392 :group 'mh-show
70a1d47e 2393 :package-version '(MH-E . "7.0"))
dda00b2c 2394
c90c4cf1 2395(defcustom-mh mh-highlight-citation-style 'gnus
dda00b2c
BW
2396 "Style for highlighting citations.
2397
2398If the sender of the message has cited other messages in his
2399message, then MH-E will highlight these citations to emphasize
2400the sender's actual response. This option can be customized to
2401change the highlighting style. The \"Multicolor\" method uses a
2402different color for each indentation while the \"Monochrome\"
2403method highlights all citations in red. To disable highlighting
2404of citations entirely, choose \"None\"."
2405 :type '(choice (const :tag "Multicolor" gnus)
2406 (const :tag "Monochrome" font-lock)
2407 (const :tag "None" nil))
23347d76 2408 :group 'mh-show
70a1d47e 2409 :package-version '(MH-E . "8.0"))
dda00b2c 2410
7911d1c8 2411;; These entries have been intentionally excluded by the developers.
c50115f1
JH
2412;; "Comments:" ; RFC 2822 - show this one
2413;; "Fax:" ; http://people.dsv.su.se/~jpalme/ietf/mail-headers/
2414;; "Mail-System-Version:" ; http://people.dsv.su.se/~jpalme/ietf/mail-headers/
2415;; "Mailer:" ; http://people.dsv.su.se/~jpalme/ietf/mail-headers/
5cb66178 2416;; "Organization:" ;
c50115f1
JH
2417;; "Phone:" ; http://people.dsv.su.se/~jpalme/ietf/mail-headers/
2418;; "Reply-By:" ; RFC 2156
2419;; "Reply-To:" ; RFC 2822
7911d1c8 2420;; "Sender:" ;
c50115f1 2421;; "User-Agent:" ; Similar to X-Mailer, so display it.
5cb66178 2422;; "X-Mailer:" ;
7911d1c8
BW
2423;; "X-Operator:" ; Similar to X-Mailer, so display it
2424
a17ce60d
JH
2425;; Keep fields alphabetized with case folding. Use M-:(setq
2426;; sort-fold-case t) from the minibuffer to accomplish this.
7911d1c8 2427;; Mention source, if known.
dda00b2c 2428(defvar mh-invisible-header-fields-internal
c50115f1
JH
2429 '(
2430 "Abuse-Reports-To:" ; http://people.dsv.su.se/~jpalme/ietf/mail-headers/
7911d1c8
BW
2431 "Accept-Language:"
2432 "AcceptLanguage:"
4690fe3f 2433 "Accreditor:" ; Habeas
243256f8
JH
2434 "Also-Control:" ; H. Spencer: News Article Format and Transmission, June 1994
2435 "Alternate-recipient:" ; RFC 2156
2436 "Approved-By:" ; http://people.dsv.su.se/~jpalme/ietf/mail-headers/
2437 "Approved:" ; RFC 1036
2438 "Article-Names:" ; H. Spencer: News Article Format and Transmission, June 1994
2439 "Article-Updates:" ; H. Spencer: News Article Format and Transmission, June 1994
2440 "Authentication-Results:"
2441 "Auto-forwarded:" ; RFC 2156
2442 "Autoforwarded:" ; RFC 2156
dda00b2c 2443 "Bestservhost:"
a17ce60d
JH
2444 "Bounces-To:"
2445 "Bounces_to:"
90404d5a 2446 "Bytes:"
243256f8 2447 "Cancel-Key:" ; http://people.dsv.su.se/~jpalme/ietf/mail-headers/
dda00b2c 2448 "Cancel-Lock:" ; NNTP posts
b6fd8984 2449 "Comment:" ; Shows up with DomainKeys
243256f8
JH
2450 "Content-" ; RFC 2045, 1123, 1766, 1864, 2045, 2110, 2156, 2183, 2912
2451 "Control:" ; RFC 1036
2452 "Conversion-With-Loss:" ; RFC 2156
2453 "Conversion:" ; RFC 2156
243256f8
JH
2454 "Delivered-To:" ; Egroups/yahoogroups mailing list manager
2455 "Delivery-Date:" ; RFC 2156
dda00b2c 2456 "Delivery:"
243256f8
JH
2457 "Discarded-X400-" ; RFC 2156
2458 "Disclose-Recipients:" ; RFC 2156
2459 "Disposition-Notification-Options:" ; RFC 2298
2460 "Disposition-Notification-To:" ; RFC 2298
2461 "Distribution:" ; RFC 1036
7911d1c8 2462 "DKIM-" ; http://antispam.yahoo.com/domainkeys
7911d1c8 2463 "DL-Expansion-History:" ; RFC 2156
243256f8 2464 "DomainKey-" ; http://antispam.yahoo.com/domainkeys
7911d1c8 2465 "DomainKey-Signature:"
243256f8 2466 "Encoding:" ; RFC 1505
dda00b2c 2467 "Envelope-to:"
243256f8
JH
2468 "Errors-To:" ; http://people.dsv.su.se/~jpalme/ietf/mail-headers/
2469 "Expires:" ; RFC 1036
2470 "Expiry-Date:" ; RFC 2156
dda00b2c 2471 "Face:" ; Gnus Face header
243256f8
JH
2472 "Followup-To:" ; RFC 1036
2473 "For-Approval:" ; http://people.dsv.su.se/~jpalme/ietf/mail-headers/
2474 "For-Comment:" ; http://people.dsv.su.se/~jpalme/ietf/mail-headers/
f6b1b0a8 2475 "For-Handling:" ; http://people.dsv.su.se/~jpalme/ietf/mail-headers/
dda00b2c
BW
2476 "Forwarded:" ; MH
2477 "From " ; sendmail
243256f8
JH
2478 "Generate-Delivery-Report:" ; RFC 2156
2479 "Importance:" ; RFC 2156, 2421
2480 "In-Reply-To:" ; RFC 2822
2481 "Incomplete-Copy:" ; RFC 2156
2482 "Keywords:" ; RFC 2822
2483 "Language:" ; RFC 2156
2484 "Lines:" ; RFC 1036
2485 "List-" ; RFC 2369, 2919
2486 "Mail-Copies-To:" ; http://people.dsv.su.se/~jpalme/ietf/mail-headers/
2487 "Mail-Followup-To:" ; http://people.dsv.su.se/~jpalme/ietf/mail-headers/
dda00b2c 2488 "Mail-from:" ; MH
7911d1c8 2489 "Mail-Reply-To:" ; http://people.dsv.su.se/~jpalme/ietf/mail-headers/
243256f8
JH
2490 "Mailing-List:" ; Egroups/yahoogroups mailing list manager
2491 "Message-Content:" ; http://people.dsv.su.se/~jpalme/ietf/mail-headers/
dda00b2c 2492 "Message-Id:" ; RFC 822
243256f8 2493 "Message-Type:" ; RFC 2156
dda00b2c 2494 "Mime-Version" ; RFC 2045
7911d1c8 2495 "Msgid:"
7911d1c8 2496 "NNTP-" ; News
243256f8 2497 "Obsoletes:" ; RFC 2156
dda00b2c 2498 "Old-Return-Path:"
243256f8
JH
2499 "OpenPGP:"
2500 "Original-Encoded-Information-Types:" ; RFC 2156
dda00b2c 2501 "Original-Lines:" ; mail to news
dda00b2c 2502 "Original-Newsgroups:" ; mail to news
7911d1c8 2503 "Original-NNTP-" ; mail to news
dda00b2c
BW
2504 "Original-Path:" ; mail to news
2505 "Original-Received:" ; mail to news
09e80d9f 2506 "Original-Recipient:" ; RFC 2298
dda00b2c
BW
2507 "Original-To:" ; mail to news
2508 "Original-X-" ; mail to news
243256f8
JH
2509 "Origination-Client:" ; http://people.dsv.su.se/~jpalme/ietf/mail-headers/
2510 "Originator:" ; http://people.dsv.su.se/~jpalme/ietf/mail-headers/
dda00b2c
BW
2511 "P1-Content-Type:" ; X400
2512 "P1-Message-Id:" ; X400
2513 "P1-Recipient:" ; X400
243256f8 2514 "Path:" ; RFC 1036
243256f8
JH
2515 "Pics-Label:" ; W3C
2516 "Posted-To:" ; http://people.dsv.su.se/~jpalme/ietf/mail-headers/
2517 "Precedence:" ; http://people.dsv.su.se/~jpalme/ietf/mail-headers/
dda00b2c 2518 "Prev-Resent" ; MH
243256f8
JH
2519 "Prevent-NonDelivery-Report:" ; RFC 2156
2520 "Priority:" ; RFC 2156
2521 "Read-Receipt-To:" ; http://people.dsv.su.se/~jpalme/ietf/mail-headers/
dda00b2c 2522 "Received-SPF:" ; Gmail
243256f8
JH
2523 "Received:" ; RFC 822
2524 "References:" ; RFC 2822
2525 "Registered-Mail-Reply-Requested-By:" ; http://people.dsv.su.se/~jpalme/ietf/mail-headers/
dda00b2c 2526 "Remailed-" ; MH
243256f8 2527 "Replaces:" ; http://people.dsv.su.se/~jpalme/ietf/mail-headers/
dda00b2c 2528 "Replied:" ; MH
243256f8 2529 "Resent-" ; RFC 2822
dda00b2c 2530 "Return-Path:" ; RFC 822
243256f8
JH
2531 "Return-Receipt-Requested:" ; http://people.dsv.su.se/~jpalme/ietf/mail-headers/
2532 "Return-Receipt-To:" ; http://people.dsv.su.se/~jpalme/ietf/mail-headers/
4690fe3f 2533 "Seal-Send-Time:"
7911d1c8 2534 "See-Also:" ; H. Spencer: News Article Format and Transmission, June 1994
243256f8 2535 "Sensitivity:" ; RFC 2156, 2421
22bcf204 2536 "Speech-Act:" ; http://people.dsv.su.se/~jpalme/ietf/mail-headers/
dda00b2c 2537 "Status:" ; sendmail
243256f8
JH
2538 "Supersedes:" ; H. Spencer: News Article Format and Transmission, June 1994
2539 "Telefax:" ; http://people.dsv.su.se/~jpalme/ietf/mail-headers/
dda00b2c 2540 "Thread-"
7911d1c8
BW
2541 "Thread-Index:"
2542 "Thread-Topic:"
243256f8
JH
2543 "Translated-By:" ; http://people.dsv.su.se/~jpalme/ietf/mail-headers/
2544 "Translation-Of:" ; http://people.dsv.su.se/~jpalme/ietf/mail-headers/
dda00b2c 2545 "Ua-Content-Id:" ; X400
dda00b2c 2546 "Via:" ; MH
dda00b2c 2547 "X-Abuse-and-DMCA-"
7911d1c8 2548 "X-Abuse-Info:"
dda00b2c
BW
2549 "X-Accept-Language:" ; Netscape/Mozilla
2550 "X-Ack:"
a17ce60d 2551 "X-ACL-Warn:" ; http://www.exim.org
243256f8 2552 "X-Admin:" ; http://people.dsv.su.se/~jpalme/ietf/mail-headers/
dda00b2c 2553 "X-Administrivia-To:"
7911d1c8 2554 "X-AMAZON" ; Amazon.com
c6134398 2555 "X-AnalysisOut:" ; Exchange
dda00b2c 2556 "X-AntiAbuse:" ; cPanel
c50115f1 2557 "X-Antivirus-Scanner:"
7911d1c8 2558 "X-AOL-IP:" ; AOL WebMail
dda00b2c
BW
2559 "X-Apparently-From:" ; MS Outlook
2560 "X-Apparently-To:" ; Egroups/yahoogroups mailing list manager
c50115f1 2561 "X-Attribution:"
243256f8 2562 "X-AuditID:"
c50115f1 2563 "X-Authenticated-Info:" ; Verizon.net?
efd5b7df 2564 "X-Authenticated-Sender:" ; AT&T Message Center (webmail)
c6134398 2565 "X-Authentication-Info:" ; verizon.net?
dda00b2c 2566 "X-Authentication-Warning:" ; sendmail
7911d1c8 2567 "X-Authority-Analysis:"
c6134398 2568 "X-Auto-Response-Suppress:" ; Exchange
efd5b7df 2569 "X-Barracuda-" ; Barracuda spam scores
c6134398 2570 "X-Bayes-Prob:" ; IEEE spam filter
dda00b2c 2571 "X-Beenthere:" ; Mailman mailing list manager
a17ce60d 2572 "X-BFI:"
243256f8 2573 "X-Bigfish:"
dda00b2c 2574 "X-Bogosity:" ; bogofilter
a17ce60d
JH
2575 "X-BPS1:" ; http://www.boggletools.com
2576 "X-BPS2:" ; http://www.boggletools.com
201a821a 2577 "X-Brightmail-Tracker:" ; Brightmail
243256f8 2578 "X-BrightmailFiltered:" ; Brightmail
efd5b7df 2579 "X-Bugzilla-" ; Bugzilla
c6134398 2580 "X-Cam-" ; Cambridge scanners
a17ce60d
JH
2581 "X-Campaign-Id:"
2582 "X-Campaign:"
90404d5a 2583 "X-Campaignid:"
c6134398 2584 "X-CanIt-Geo:" ; IEEE spam filter
a17ce60d 2585 "X-Cloudmark-SP-" ; Cloudmark (www.cloudmark.com)
c50115f1 2586 "X-Comment:" ; AT&T Mailennium
243256f8 2587 "X-Complaints-To:" ; http://people.dsv.su.se/~jpalme/ietf/mail-headers/
c6134398 2588 "X-Completed:"
243256f8 2589 "X-Confirm-Reading-To:" ; http://people.dsv.su.se/~jpalme/ietf/mail-headers/
7911d1c8 2590 "X-Content-Filtered-By:"
dda00b2c 2591 "X-ContentStamp:" ; NetZero
90404d5a 2592 "X-Country-Chain:" ; http://www.declude.com/x-note.htm
c50115f1
JH
2593 "X-Cr-Hashedpuzzle:"
2594 "X-Cr-Puzzleid:"
dda00b2c 2595 "X-Cron-Env:"
c6134398 2596 "X-DCC-" ; SpamAssassin
90404d5a 2597 "X-Declude-" ; http://www.declude.com/x-note.htm
7911d1c8 2598 "X-Dedicated:"
dda00b2c 2599 "X-Delivered"
a17ce60d
JH
2600 "X-Destination-ID:"
2601 "X-detected-operating-system:" ; GNU.ORG?
7911d1c8
BW
2602 "X-DH-Virus-"
2603 "X-DMCA"
a17ce60d 2604 "X-DocGen-Version:" ; DocGen
7911d1c8
BW
2605 "X-Domain:"
2606 "X-Echelon-Distraction"
efd5b7df 2607 "X-EFL-Spamscore:" ; MIT alumni spam filtering
7911d1c8 2608 "X-eGroups-" ; Egroups/yahoogroups mailing list manager
5cb66178 2609 "X-EID:"
dda00b2c 2610 "X-ELNK-Trace:" ; Earthlink mailer
a17ce60d
JH
2611 "X-EM-" ; Some ecommerce software
2612 "X-Email-Type-Id:" ; Paypal http://www.paypal.com
243256f8 2613 "X-Enigmail-Version:"
dda00b2c 2614 "X-Envelope-Date:" ; GNU mailutils
243256f8 2615 "X-Envelope-From:" ; http://people.dsv.su.se/~jpalme/ietf/mail-headers/
dda00b2c 2616 "X-Envelope-Sender:"
243256f8 2617 "X-Envelope-To:" ; http://people.dsv.su.se/~jpalme/ietf/mail-headers/
c50115f1 2618 "X-EviteMessageId:" ; evite.com
dda00b2c 2619 "X-Evolution:" ; Evolution mail client
243256f8
JH
2620 "X-ExtLoop"
2621 "X-Face:" ; http://people.dsv.su.se/~jpalme/ietf/mail-headers/
c6134398 2622 "X-Facebook" ; Facebook
a17ce60d 2623 "X-FB-SS:"
90404d5a 2624 "X-fmx-"
dda00b2c 2625 "X-Folder:" ; Spam
c6134398 2626 "X-Forwarded-" ; Google+
dda00b2c 2627 "X-From-Line"
a17ce60d 2628 "X-FuHaFi:" ; http://www.gmx.net/
c6134398 2629 "X-Generated-By:" ; launchpad.net
dda00b2c
BW
2630 "X-Gmail-" ; Gmail
2631 "X-Gnus-Mail-Source:" ; gnus
243256f8 2632 "X-Google-" ; Google mail
7911d1c8 2633 "X-Google-Sender-Auth:"
dda00b2c 2634 "X-Greylist:" ; milter-greylist-1.2.1
a17ce60d 2635 "X-Habeas-" ; http://www.returnpath.net
201a821a 2636 "X-Hashcash:" ; hashcash
c6134398 2637 "X-Headers-End:" ; SpamCop
7911d1c8
BW
2638 "X-HPL-"
2639 "X-HR-"
2640 "X-HTTP-UserAgent:"
2cefb8a7 2641 "X-Hz" ; Hertz
90404d5a 2642 "X-Identity:" ; http://www.declude.com/x-note.htm
c6134398 2643 "X-IEEE-UCE-" ; IEEE spam filter
243256f8 2644 "X-Image-URL:"
7911d1c8 2645 "X-IMAP:" ; http://people.dsv.su.se/~jpalme/ietf/mail-headers/
dda00b2c 2646 "X-Info:" ; NTMail
243256f8 2647 "X-IronPort-" ; IronPort AV
7911d1c8
BW
2648 "X-ISI-4-30-3-MailScanner:"
2649 "X-J2-"
c6134398
BW
2650 "X-Jira-Fingerprint:" ; JIRA
2651 "X-Junkmail-" ; RCN?
dda00b2c 2652 "X-Juno-" ; Juno
7911d1c8 2653 "X-Key:"
c6134398 2654 "X-Launchpad-" ; plaunchpad.net
243256f8 2655 "X-List-Host:" ; http://people.dsv.su.se/~jpalme/ietf/mail-headers/
dda00b2c
BW
2656 "X-List-Subscribe:" ; Unknown mailing list managers
2657 "X-List-Unsubscribe:" ; Unknown mailing list managers
2658 "X-Listprocessor-" ; ListProc(tm) by CREN
243256f8
JH
2659 "X-Listserver:" ; http://people.dsv.su.se/~jpalme/ietf/mail-headers/
2660 "X-Loop:" ; http://people.dsv.su.se/~jpalme/ietf/mail-headers/
c50115f1 2661 "X-Lrde-Mailscanner:"
dda00b2c 2662 "X-Lumos-SenderID:" ; Roving ConstantContact
a17ce60d 2663 "X-mail_abuse_inquiries:" ; http://www.salesforce.com
efd5b7df 2664 "X-Mail-from:" ; fastmail.fm
7911d1c8 2665 "X-MAIL-INFO:" ; NetZero
90404d5a 2666 "X-Mailer_"
f24f2e22 2667 "X-MailFlowPolicy:" ; Cisco Email Security (formerly IronPort; http://www.ironport.com)
dda00b2c 2668 "X-Mailing-List:" ; Unknown mailing list managers
a17ce60d 2669 "X-MailingID:"
efd5b7df 2670 "X-Mailman-Approved-At:" ; Mailman mailing list manager
dda00b2c 2671 "X-Mailman-Version:" ; Mailman mailing list manager
7911d1c8 2672 "X-MailScanner" ; ListProc(tm) by CREN
243256f8 2673 "X-Mailutils-Message-Id" ; GNU Mailutils
dda00b2c 2674 "X-Majordomo:" ; Majordomo mailing list manager
fb9958d7 2675 "X-Match:"
a17ce60d 2676 "X-MaxCode-Template:" ; Paypal http://www.paypal.com
7911d1c8
BW
2677 "X-MB-Message-" ; AOL WebMail
2678 "X-MDaemon-Deliver-To:"
2679 "X-MDRemoteIP:"
a17ce60d 2680 "X-ME-Bayesian:" ; http://www.newmediadevelopment.net/page.cfm/parent/Client-Area/content/Managing-spam/
dda00b2c 2681 "X-Message-Id"
7911d1c8 2682 "X-Message-Type:"
dda00b2c 2683 "X-MessageWall-Score:" ; Unknown mailing list manager, AUC TeX
7911d1c8
BW
2684 "X-MHE-Checksum:" ; Checksum added during index search
2685 "X-MIME-Autoconverted:" ; sendmail
2686 "X-MIMEOLE:" ; http://people.dsv.su.se/~jpalme/ietf/mail-headers/sendmail
2687 "X-MIMETrack:"
dda00b2c
BW
2688 "X-Mms-" ; T-Mobile pictures
2689 "X-Mozilla-Status:" ; Netscape/Mozilla
7911d1c8 2690 "X-MS-" ; MS Outlook
dda00b2c 2691 "X-Msmail-" ; MS Outlook
7911d1c8 2692 "X-MSMail-Priority" ; http://people.dsv.su.se/~jpalme/ietf/mail-headers/
c6134398 2693 "X-MXL-Hash:"
dda00b2c
BW
2694 "X-NAI-Spam-" ; Network Associates Inc. SpamKiller
2695 "X-News:" ; News
243256f8
JH
2696 "X-Newsreader:" ; http://people.dsv.su.se/~jpalme/ietf/mail-headers/
2697 "X-No-Archive:" ; http://people.dsv.su.se/~jpalme/ietf/mail-headers/
dda00b2c 2698 "X-Notes-Item:" ; Lotus Notes Domino structured header
c6134398
BW
2699 "X-Notification-" ; Google+
2700 "X-Notifications:" ; Google+
dda00b2c 2701 "X-OperatingSystem:"
c6134398 2702 "X-Oracle-Calendar:" ; Oracle calendar invitations
7911d1c8 2703 "X-ORBL:"
dda00b2c 2704 "X-Orcl-Content-Type:"
7911d1c8 2705 "X-Organization:"
243256f8 2706 "X-Original-Arrival-Type:" ; http://people.dsv.su.se/~jpalme/ietf/mail-headers/
dda00b2c
BW
2707 "X-Original-Complaints-To:"
2708 "X-Original-Date:" ; SourceForge mailing list manager
2709 "X-Original-To:"
2710 "X-Original-Trace:"
2711 "X-OriginalArrivalTime:" ; Hotmail
243256f8 2712 "X-Originating-Email:" ; Hotmail
dda00b2c 2713 "X-Originating-IP:" ; Hotmail
90404d5a 2714 "X-pair-"
7911d1c8
BW
2715 "X-PGP:"
2716 "X-PID:"
243256f8 2717 "X-PMG-"
7911d1c8 2718 "X-PMX-Version:"
c6134398 2719 "X-Policyd-Weight:" ; policyd-weight (Postfix)
dda00b2c
BW
2720 "X-Postfilter:"
2721 "X-Priority:" ; MS Outlook
2cefb8a7 2722 "X-Proofpoint-" ; Proofpoint mail filter
13384ea6 2723 "X-Provags-ID:"
7911d1c8 2724 "X-PSTN-"
dda00b2c 2725 "X-Qotd-" ; User added
243256f8 2726 "X-RCPT-TO:" ; http://people.dsv.su.se/~jpalme/ietf/mail-headers/
dda00b2c
BW
2727 "X-Received-Date:"
2728 "X-Received:"
243256f8 2729 "X-Report-Abuse-To:" ; http://people.dsv.su.se/~jpalme/ietf/mail-headers/
dda00b2c 2730 "X-Request-"
efd5b7df 2731 "X-Resolved-to:" ; fastmail.fm
dda00b2c 2732 "X-Return-Path-Hint:" ; Roving ConstantContact
2cefb8a7 2733 "X-RIM-" ; Research In Motion (i.e. BlackBerry)
7911d1c8 2734 "X-RM"
c50115f1 2735 "X-RocketYMMF:" ; Yahoo
efd5b7df
ED
2736 "X-Roving-" ; Roving ConstantContact
2737 "X-SA-Exim-" ; Exim SpamAssassin
7911d1c8 2738 "X-Sasl-enc:" ; Apple Mail
dda00b2c
BW
2739 "X-SBClass:" ; Spam
2740 "X-SBNote:" ; Spam
2741 "X-SBPass:" ; Spam
7911d1c8 2742 "X-SBRS:"
dda00b2c 2743 "X-SBRule:" ; Spam
f12d6a4a 2744 "X-Scanned-By:"
c6134398 2745 "X-Sender-ID:" ; Google+
243256f8 2746 "X-Sender:" ; http://people.dsv.su.se/~jpalme/ietf/mail-headers/
f24f2e22 2747 "X-Sendergroup:" ; Cisco Email Security (formerly IronPort; http://www.ironport.com)
dda00b2c
BW
2748 "X-Server-Date:"
2749 "X-Server-Uuid:"
7911d1c8 2750 "X-Service-Code:"
a17ce60d 2751 "X-SFDC-" ; http://www.salesforce.com
dda00b2c 2752 "X-Sieve:" ; Sieve filtering
a17ce60d
JH
2753 "X-SMFBL:"
2754 "X-SMHeaderMap:"
7911d1c8 2755 "X-SMTP-"
dda00b2c 2756 "X-Source"
c6134398
BW
2757 "X-Spam-" ; SpamAssassin
2758 "X-Spam:" ; Exchange
dda00b2c 2759 "X-SpamBouncer:" ; Spam
90404d5a 2760 "X-SPF-"
dda00b2c 2761 "X-Status"
7911d1c8 2762 "X-Submission-Address:"
dda00b2c 2763 "X-Submissions-To:"
7911d1c8 2764 "X-Sun-Charset:"
dda00b2c 2765 "X-Telecom-Digest"
a17ce60d 2766 "X-TM-IMSS-Message-ID:" ; http://www.trendmicro.com
dda00b2c
BW
2767 "X-Trace:"
2768 "X-UID"
243256f8 2769 "X-UIDL:" ; http://people.dsv.su.se/~jpalme/ietf/mail-headers/
7911d1c8 2770 "X-Unity"
dda00b2c 2771 "X-UNTD-" ; NetZero
243256f8
JH
2772 "X-URI:" ; http://people.dsv.su.se/~jpalme/ietf/mail-headers/
2773 "X-URL:" ; http://people.dsv.su.se/~jpalme/ietf/mail-headers/
dda00b2c 2774 "X-USANET-" ; usa.net
90404d5a 2775 "X-Usenet-Provider"
dda00b2c 2776 "X-UserInfo1:"
a17ce60d
JH
2777 "X-VGI-OESCD:"
2778 "X-VirtualServer:"
2779 "X-VirtualServerGroup:"
24b2be09 2780 "X-Virus-" ;
dda00b2c 2781 "X-Vms-To:"
7911d1c8 2782 "X-VSMLoop:" ; NTMail
dda00b2c
BW
2783 "X-WebTV-Signature:"
2784 "X-Wss-Id:" ; Worldtalk gateways
243256f8 2785 "X-X-Sender:" ; http://people.dsv.su.se/~jpalme/ietf/mail-headers/
a17ce60d 2786 "X-XPT-XSL-Name:" ; Paypal http://www.paypal.com
624d4a5c 2787 "X-xsi-"
a17ce60d
JH
2788 "X-XWALL-" ; http://www.dataenter.co.at/doc/xwall_undocumented_config.htm
2789 "X-Y-GMX-Trusted:" ; http://www.gmx.net/
dda00b2c 2790 "X-Yahoo"
7911d1c8
BW
2791 "X-Yahoo-Newman-"
2792 "X-YMail-"
a17ce60d 2793 "X-ZixNet:"
dda00b2c 2794 "X400-" ; X400
243256f8
JH
2795 "Xref:" ; RFC 1036
2796 )
dda00b2c
BW
2797 "List of default header fields that are not to be shown.
2798
2799Do not alter this variable directly. Instead, add entries from
2800here that you would like to be displayed in
2801`mh-invisible-header-fields-default' and add entries to hide in
2802`mh-invisible-header-fields'.")
2803
2804(eval-and-compile
2805 (unless (fboundp 'mh-invisible-headers)
2806 (defun mh-invisible-headers ()
2807 "Temporary definition.
2808Real definition, below, uses variables that aren't defined yet."
2809 nil)))
2810
2811(defvar mh-delay-invisible-header-generation-flag t
2812 "Non-nil means to delay the generation of invisible header fields.
2813Because the function `mh-invisible-headers' uses both
2814`mh-invisible-header-fields' and `mh-invisible-header-fields', it
2815cannot be run until both variables have been initialized.")
2816
c90c4cf1 2817(defcustom-mh mh-invisible-header-fields nil
dda00b2c
BW
2818 "*Additional header fields to hide.
2819
2820Header fields that you would like to hide that aren't listed in
2821`mh-invisible-header-fields-default' can be added to this option
2822with a couple of caveats. Regular expressions are not allowed.
2823Unique fields should have a \":\" suffix; otherwise, the element
2824can be used to render invisible an entire class of fields that
4690fe3f
BW
2825start with the same prefix.
2826
2827If you think a header field should be generally ignored, please
2828update SF #1916032 (see URL
2829`https://sourceforge.net/tracker/index.php?func=detail&aid=1916032&group_id=13357&atid=113357').
dda00b2c
BW
2830
2831See also `mh-clean-message-header-flag'."
2832
2833 :type '(repeat (string :tag "Header field"))
2834 :set (lambda (symbol value)
2835 (set-default symbol value)
2836 (mh-invisible-headers))
23347d76 2837 :group 'mh-show
70a1d47e 2838 :package-version '(MH-E . "7.1"))
dda00b2c 2839
c90c4cf1 2840(defcustom-mh mh-invisible-header-fields-default nil
dda00b2c
BW
2841 "*List of hidden header fields.
2842
2843The header fields listed in this option are hidden, although you
2844can check off any field that you would like to see.
2845
2846Header fields that you would like to hide that aren't listed can
2847be added to the option `mh-invisible-header-fields'.
2848
4690fe3f
BW
2849See also `mh-clean-message-header-flag'.
2850
2851If you think a header field should be added to this list, please
2852update SF #1916032 (see URL
2853`https://sourceforge.net/tracker/index.php?func=detail&aid=1916032&group_id=13357&atid=113357')."
dda00b2c
BW
2854 :type `(set ,@(mapcar (lambda (x) `(const ,x))
2855 mh-invisible-header-fields-internal))
2856 :set (lambda (symbol value)
2857 (set-default symbol value)
2858 (mh-invisible-headers))
23347d76 2859 :group 'mh-show
70a1d47e 2860 :package-version '(MH-E . "8.0"))
dda00b2c
BW
2861
2862(defvar mh-invisible-header-fields-compiled nil
2863 "*Regexp matching lines in a message header that are not to be shown.
2864Do not alter this variable directly. Instead, customize
2865`mh-invisible-header-fields-default' checking for fields normally
2866hidden that you wish to display, and add extra entries to hide in
2867`mh-invisible-header-fields'.")
2868
2869(defun mh-invisible-headers ()
2870 "Make or remake the variable `mh-invisible-header-fields-compiled'.
2871Done using `mh-invisible-header-fields-internal' as input, from
2872which entries from `mh-invisible-header-fields-default' are
2873removed and entries from `mh-invisible-header-fields' are added."
2874 (let ((fields mh-invisible-header-fields-internal))
2875 (when mh-invisible-header-fields-default
2876 ;; Remove entries from `mh-invisible-header-fields-default'
2877 (setq fields
2878 (loop for x in fields
2879 unless (member x mh-invisible-header-fields-default)
2880 collect x)))
2881 (when (and (boundp 'mh-invisible-header-fields)
2882 mh-invisible-header-fields)
2883 (dolist (x mh-invisible-header-fields)
2884 (unless (member x fields) (setq fields (cons x fields)))))
2885 (if fields
2886 (setq mh-invisible-header-fields-compiled
2887 (concat
2888 "^"
2889 ;; workaround for insufficient default
2890 (let ((max-specpdl-size 1000))
2891 (regexp-opt fields t))))
2892 (setq mh-invisible-header-fields-compiled nil))))
2893
2894;; Compile invisible header fields.
2895(mh-invisible-headers)
2896
c90c4cf1 2897(defcustom-mh mh-lpr-command-format "lpr -J '%s'"
dda00b2c
BW
2898 "*Command used to print\\<mh-folder-mode-map>.
2899
2900This option contains the Unix command line which performs the
2901actual printing for the \\[mh-print-msg] command. The string can
2902contain one escape, \"%s\", which is replaced by the name of the
2903folder and the message number and is useful for print job names.
2904I use \"mpage -h'%s' -b Letter -H1of -mlrtb -P\" which produces a
2905nice header and adds a bit of margin so the text fits within my
2906printer's margins.
2907
2908This options is not used by the commands \\[mh-ps-print-msg] or
2909\\[mh-ps-print-msg-file]."
2910 :type 'string
23347d76 2911 :group 'mh-show
70a1d47e 2912 :package-version '(MH-E . "6.0"))
dda00b2c 2913
c90c4cf1 2914(defcustom-mh mh-max-inline-image-height nil
dda00b2c
BW
2915 "*Maximum inline image height if \"Content-Disposition:\" is not present.
2916
2917Some older mail programs do not insert this needed plumbing to
2918tell MH-E whether to display the attachments inline or not. If
2919this is the case, MH-E will display these images inline if they
2920are smaller than the window. However, you might want to allow
2921larger images to be displayed inline. To do this, you can change
2922the options `mh-max-inline-image-width' and
2923`mh-max-inline-image-height' from their default value of zero to
2924a large number. The size of your screen is a good choice for
2925these numbers."
2926 :type '(choice (const nil) integer)
23347d76 2927 :group 'mh-show
70a1d47e 2928 :package-version '(MH-E . "7.0"))
dda00b2c 2929
c90c4cf1 2930(defcustom-mh mh-max-inline-image-width nil
dda00b2c
BW
2931 "*Maximum inline image width if \"Content-Disposition:\" is not present.
2932
2933Some older mail programs do not insert this needed plumbing to
2934tell MH-E whether to display the attachments inline or not. If
2935this is the case, MH-E will display these images inline if they
2936are smaller than the window. However, you might want to allow
2937larger images to be displayed inline. To do this, you can change
2938the options `mh-max-inline-image-width' and
2939`mh-max-inline-image-height' from their default value of zero to
2940a large number. The size of your screen is a good choice for
2941these numbers."
2942 :type '(choice (const nil) integer)
23347d76 2943 :group 'mh-show
70a1d47e 2944 :package-version '(MH-E . "7.0"))
dda00b2c 2945
c90c4cf1 2946(defcustom-mh mh-mhl-format-file nil
dda00b2c
BW
2947 "*Specifies the format file to pass to the \"mhl\" program.
2948
2949Normally MH-E takes care of displaying messages itself (rather than
2950calling an MH program to do the work). If you'd rather have \"mhl\"
2951display the message (within MH-E), change this option from its default
2952value of \"Use Default mhl Format (Printing Only)\".
2953
2954You can set this option to \"Use Default mhl Format\" to get the same
2955output as you would get if you ran \"mhl\" from the shell.
2956
2957If you have a format file that you want MH-E to use, you can set this
2958option to \"Specify an mhl Format File\" and enter the name of your
2959format file. Your format file should specify a non-zero value for
2960\"overflowoffset\" to allow MH-E to parse the header. Note that
2961\"mhl\" is always used for printing and forwarding; in this case, the
2962value of this option is consulted if you have specified a format
2963file."
2964 :type '(choice (const :tag "Use Default mhl Format (Printing Only)" nil)
2965 (const :tag "Use Default mhl Format" t)
2966 (file :tag "Specify an mhl Format File"))
23347d76 2967 :group 'mh-show
70a1d47e 2968 :package-version '(MH-E . "8.0"))
dda00b2c 2969
c90c4cf1 2970(defcustom-mh mh-mime-save-parts-default-directory t
dda00b2c
BW
2971 "Default directory to use for \\<mh-folder-mode-map>\\[mh-mime-save-parts].
2972
2973The default value for this option is \"Prompt Always\" so that
2974you are always prompted for the directory in which to save the
2975attachments. However, if you usually use the same directory
2976within a session, then you can set this option to \"Prompt the
2977First Time\" to avoid the prompt each time. you can make this
2978directory permanent by choosing \"Directory\" and entering the
2979directory's name."
2980 :type '(choice (const :tag "Prompt the First Time" nil)
2981 (const :tag "Prompt Always" t)
2982 directory)
23347d76 2983 :group 'mh-show
70a1d47e 2984 :package-version '(MH-E . "7.0"))
dda00b2c 2985
c90c4cf1 2986(defcustom-mh mh-print-background-flag nil
dda00b2c
BW
2987 "*Non-nil means messages should be printed in the background\\<mh-folder-mode-map>.
2988
2989Normally messages are printed in the foreground. If this is slow on
2990your system, you may elect to turn off this option to print in the
2991background.
2992
2993WARNING: If you do this, do not delete the message until it is printed
2994or else the output may be truncated.
2995
2996This option is not used by the commands \\[mh-ps-print-msg] or
2997\\[mh-ps-print-msg-file]."
2998 :type 'boolean
23347d76 2999 :group 'mh-show
70a1d47e 3000 :package-version '(MH-E . "7.0"))
dda00b2c 3001
c90c4cf1 3002(defcustom-mh mh-show-maximum-size 0
dda00b2c
BW
3003 "*Maximum size of message (in bytes) to display automatically.
3004
3005This option provides an opportunity to skip over large messages
3006which may be slow to load. The default value of 0 means that all
3007message are shown regardless of size."
3008 :type 'integer
23347d76 3009 :group 'mh-show
70a1d47e 3010 :package-version '(MH-E . "8.0"))
dda00b2c 3011
c90c4cf1 3012(defcustom-mh mh-show-use-xface-flag (>= emacs-major-version 21)
dda00b2c
BW
3013 "*Non-nil means display face images in MH-show buffers.
3014
3015MH-E can display the content of \"Face:\", \"X-Face:\", and
3016\"X-Image-URL:\" header fields. If any of these fields occur in the
3017header of your message, the sender's face will appear in the \"From:\"
3018header field. If more than one of these fields appear, then the first
3019field found in the order \"Face:\", \"X-Face:\", and \"X-Image-URL:\"
3020will be used.
3021
3022The option `mh-show-use-xface-flag' is used to turn this feature on
3023and off. This feature will be turned on by default if your system
3024supports it.
3025
3026The first header field used, if present, is the Gnus-specific
3027\"Face:\" field. The \"Face:\" field appeared in GNU Emacs 21 and
3028XEmacs. For more information, see URL
3029`http://quimby.gnus.org/circus/face/'. Next is the traditional
3030\"X-Face:\" header field. The display of this field requires the
3031\"uncompface\" program (see URL
3032`ftp://ftp.cs.indiana.edu/pub/faces/compface/compface.tar.z'). Recent
3033versions of XEmacs have internal support for \"X-Face:\" images. If
3034your version of XEmacs does not, then you'll need both \"uncompface\"
3035and the x-face package (see URL `ftp://ftp.jpl.org/pub/elisp/').
3036
3037Finally, MH-E will display images referenced by the \"X-Image-URL:\"
3038header field if neither the \"Face:\" nor the \"X-Face:\" fields are
3039present. The display of the images requires \"wget\" (see URL
3040`http://www.gnu.org/software/wget/wget.html'), \"fetch\", or \"curl\"
3041to fetch the image and the \"convert\" program from the ImageMagick
3042suite (see URL `http://www.imagemagick.org/'). Of the three header
3043fields this is the most efficient in terms of network usage since the
3044image doesn't need to be transmitted with every single mail.
3045
3046The option `mh-fetch-x-image-url' controls the fetching of the
3047\"X-Image-URL:\" header field image."
3048 :type 'boolean
23347d76 3049 :group 'mh-show
70a1d47e 3050 :package-version '(MH-E . "7.0"))
dda00b2c 3051
c90c4cf1 3052(defcustom-mh mh-store-default-directory nil
dda00b2c
BW
3053 "*Default directory for \\<mh-folder-mode-map>\\[mh-store-msg].
3054
3055If you would like to change the initial default directory,
3056customize this option, change the value from \"Current\" to
3057\"Directory\", and then enter the name of the directory for storing
3058the content of these messages."
3059 :type '(choice (const :tag "Current" nil)
3060 directory)
23347d76 3061 :group 'mh-show
70a1d47e 3062 :package-version '(MH-E . "6.0"))
dda00b2c 3063
c90c4cf1 3064(defcustom-mh mh-summary-height nil
dda00b2c
BW
3065 "*Number of lines in MH-Folder buffer (including the mode line).
3066
3067The default value of this option is \"Automatic\" which means
3068that the MH-Folder buffer will maintain the same proportional
3069size if the frame is resized. If you'd prefer a fixed height,
3070then choose the \"Fixed Size\" option and enter the number of
3071lines you'd like to see."
3072 :type '(choice (const :tag "Automatic" nil)
3073 (integer :tag "Fixed Size"))
23347d76 3074 :group 'mh-show
70a1d47e 3075 :package-version '(MH-E . "7.4"))
dda00b2c
BW
3076
3077;;; The Speedbar (:group 'mh-speedbar)
3078
c90c4cf1 3079(defcustom-mh mh-speed-update-interval 60
dda00b2c
BW
3080 "Time between speedbar updates in seconds.
3081Set to 0 to disable automatic update."
3082 :type 'integer
23347d76 3083 :group 'mh-speedbar
70a1d47e 3084 :package-version '(MH-E . "8.0"))
dda00b2c
BW
3085
3086;;; Threading (:group 'mh-thread)
3087
c90c4cf1 3088(defcustom-mh mh-show-threads-flag nil
dda00b2c
BW
3089 "*Non-nil means new folders start in threaded mode.
3090
3091Threading large number of messages can be time consuming so this
3092option is turned off by default. If you turn this option on, then
3093threading will be done only if the number of messages being
3094threaded is less than `mh-large-folder'."
3095 :type 'boolean
23347d76 3096 :group 'mh-thread
70a1d47e 3097 :package-version '(MH-E . "7.1"))
c26cf6c8 3098
dda00b2c
BW
3099;;; The Tool Bar (:group 'mh-tool-bar)
3100
3101;; mh-tool-bar-folder-buttons and mh-tool-bar-letter-buttons defined
3102;; dynamically in mh-tool-bar.el.
3103
c90c4cf1 3104(defcustom-mh mh-tool-bar-search-function 'mh-search
dda00b2c
BW
3105 "*Function called by the tool bar search button.
3106
3107By default, this is set to `mh-search'. You can also choose
3108\"Other Function\" from the \"Value Menu\" and enter a function
3109of your own choosing."
3110 :type '(choice (const mh-search)
3111 (function :tag "Other Function"))
23347d76 3112 :group 'mh-tool-bar
70a1d47e 3113 :package-version '(MH-E . "7.0"))
dda00b2c
BW
3114
3115;; XEmacs has a couple of extra customizations...
3116(mh-do-in-xemacs
c90c4cf1 3117 (defcustom-mh mh-xemacs-use-tool-bar-flag mh-xemacs-has-tool-bar-flag
dda00b2c
BW
3118 "*If non-nil, use tool bar.
3119
3120This option controls whether to show the MH-E icons at all. By
3121default, this option is turned on if the window system supports
3122tool bars. If your system doesn't support tool bars, then you
3123won't be able to turn on this option."
3124 :type 'boolean
3125 :group 'mh-tool-bar
3126 :set (lambda (symbol value)
3127 (if (and (eq value t)
3128 (not mh-xemacs-has-tool-bar-flag))
3129 (error "Tool bar not supported"))
23347d76 3130 (set-default symbol value))
70a1d47e 3131 :package-version '(MH-E . "7.3"))
dda00b2c 3132
c90c4cf1 3133 (defcustom-mh mh-xemacs-tool-bar-position nil
dda00b2c
BW
3134 "*Tool bar location.
3135
3136This option controls the placement of the tool bar along the four
3137edges of the frame. You can choose from one of \"Same As Default
3138Tool Bar\", \"Top\", \"Bottom\", \"Left\", or \"Right\". If this
3139variable is set to anything other than \"Same As Default Tool
3140Bar\" and the default tool bar is in a different location, then
3141two tool bars will be displayed: the MH-E tool bar and the
3142default tool bar."
3143 :type '(radio (const :tag "Same As Default Tool Bar" :value nil)
3144 (const :tag "Top" :value top)
3145 (const :tag "Bottom" :value bottom)
3146 (const :tag "Left" :value left)
3147 (const :tag "Right" :value right))
23347d76 3148 :group 'mh-tool-bar
70a1d47e 3149 :package-version '(MH-E . "7.3")))
942fc772 3150
c26cf6c8
RS
3151\f
3152
dda00b2c
BW
3153;;; Hooks (:group 'mh-hooks + group where hook described)
3154
c90c4cf1 3155(defcustom-mh mh-after-commands-processed-hook nil
e5d763d8 3156 "Hook run by \\<mh-folder-mode-map>\\[mh-execute-commands] after performing outstanding refile and delete requests.
dda00b2c
BW
3157
3158Variables that are useful in this hook include
3159`mh-folders-changed', which lists which folders were affected by
3160deletes and refiles. This list will always include the current
3161folder, which is also available in `mh-current-folder'."
3162 :type 'hook
3163 :group 'mh-hooks
23347d76 3164 :group 'mh-folder
70a1d47e 3165 :package-version '(MH-E . "8.0"))
dda00b2c 3166
c90c4cf1 3167(defcustom-mh mh-alias-reloaded-hook nil
dda00b2c
BW
3168 "Hook run by `mh-alias-reload' after loading aliases."
3169 :type 'hook
3170 :group 'mh-hooks
23347d76 3171 :group 'mh-alias
70a1d47e 3172 :package-version '(MH-E . "8.0"))
dda00b2c 3173
aad5673d 3174(defcustom-mh mh-annotate-msg-hook nil
7106a02d
BW
3175 "Hook run whenever a message is sent and after the scan lines and message are annotated.
3176Hook functions can access the current folder name with
3177`mh-current-folder' and obtain the message numbers of the
3178annotated messages with `mh-annotate-list'."
aad5673d
SG
3179 :type 'hook
3180 :group 'mh-hooks
3181 :group 'mh-sending-mail
3182 :package-version '(MH-E . "8.1"))
3183
c90c4cf1 3184(defcustom-mh mh-before-commands-processed-hook nil
e5d763d8 3185 "Hook run by \\<mh-folder-mode-map>\\[mh-execute-commands] before performing outstanding refile and delete requests.
dda00b2c 3186
41b97610
BW
3187Variables that are useful in this hook include `mh-delete-list',
3188`mh-refile-list', `mh-blacklist', and `mh-whitelist' which can be
3189used to see which changes will be made to the current folder,
3190`mh-current-folder'."
dda00b2c
BW
3191 :type 'hook
3192 :group 'mh-hooks
23347d76 3193 :group 'mh-folder
70a1d47e 3194 :package-version '(MH-E . "8.0"))
dda00b2c 3195
c90c4cf1 3196(defcustom-mh mh-before-quit-hook nil
dda00b2c
BW
3197 "Hook run by \\<mh-folder-mode-map>\\[mh-quit] before quitting MH-E.
3198
3199This hook is called before the quit occurs, so you might use it
3200to perform any MH-E operations; you could perform some query and
3201abort the quit or call `mh-execute-commands', for example.
3202
3203See also `mh-quit-hook'."
3204 :type 'hook
3205 :group 'mh-hooks
23347d76 3206 :group 'mh-folder
70a1d47e 3207 :package-version '(MH-E . "6.0"))
dda00b2c 3208
c90c4cf1 3209(defcustom-mh mh-before-send-letter-hook nil
dda00b2c
BW
3210 "Hook run at the beginning of the \\<mh-letter-mode-map>\\[mh-send-letter] command.
3211
3212For example, if you want to check your spelling in your message
3213before sending, add the `ispell-message' function."
3214 :type 'hook
3215 :options '(ispell-message)
3216 :group 'mh-hooks
23347d76 3217 :group 'mh-letter
70a1d47e 3218 :package-version '(MH-E . "6.0"))
dda00b2c 3219
41b97610
BW
3220(defcustom-mh mh-blacklist-msg-hook nil
3221 "Hook run by \\<mh-letter-mode-map>\\[mh-junk-blacklist] after marking each message for blacklisting."
3222 :type 'hook
3223 :group 'mh-hooks
3224 :group 'mh-show
3225 :package-version '(MH-E . "8.4"))
3226
c90c4cf1 3227(defcustom-mh mh-delete-msg-hook nil
dda00b2c
BW
3228 "Hook run by \\<mh-letter-mode-map>\\[mh-delete-msg] after marking each message for deletion.
3229
3230For example, a past maintainer of MH-E used this once when he
3231kept statistics on his mail usage."
3232 :type 'hook
3233 :group 'mh-hooks
23347d76 3234 :group 'mh-show
70a1d47e 3235 :package-version '(MH-E . "6.0"))
dda00b2c 3236
c90c4cf1 3237(defcustom-mh mh-find-path-hook nil
dda00b2c
BW
3238 "Hook run by `mh-find-path' after reading the user's MH profile.
3239
3240This hook can be used the change the value of the variables that
3241`mh-find-path' sets if you need to run with different values
3242between MH and MH-E."
3243 :type 'hook
3244 :group 'mh-hooks
23347d76 3245 :group 'mh-e
70a1d47e 3246 :package-version '(MH-E . "7.0"))
dda00b2c 3247
c90c4cf1 3248(defcustom-mh mh-folder-mode-hook nil
dda00b2c
BW
3249 "Hook run by `mh-folder-mode' when visiting a new folder."
3250 :type 'hook
3251 :group 'mh-hooks
23347d76 3252 :group 'mh-folder
70a1d47e 3253 :package-version '(MH-E . "6.0"))
dda00b2c 3254
c90c4cf1 3255(defcustom-mh mh-forward-hook nil
dda00b2c
BW
3256 "Hook run by `mh-forward' on a forwarded letter."
3257 :type 'hook
3258 :group 'mh-hooks
23347d76 3259 :group 'mh-sending-mail
70a1d47e 3260 :package-version '(MH-E . "8.0"))
dda00b2c 3261
c90c4cf1 3262(defcustom-mh mh-inc-folder-hook nil
dda00b2c
BW
3263 "Hook run by \\<mh-folder-mode-map>\\[mh-inc-folder] after incorporating mail into a folder."
3264 :type 'hook
3265 :group 'mh-hooks
23347d76 3266 :group 'mh-inc
70a1d47e 3267 :package-version '(MH-E . "6.0"))
dda00b2c 3268
c90c4cf1 3269(defcustom-mh mh-insert-signature-hook nil
dda00b2c
BW
3270 "Hook run by \\<mh-letter-mode-map>\\[mh-insert-signature] after signature has been inserted.
3271
3272Hook functions may access the actual name of the file or the
3273function used to insert the signature with
3274`mh-signature-file-name'."
3275 :type 'hook
3276 :group 'mh-hooks
23347d76 3277 :group 'mh-letter
70a1d47e 3278 :package-version '(MH-E . "8.0"))
dda00b2c 3279
fb9958d7 3280(mh-define-obsolete-variable-alias 'mh-kill-folder-suppress-prompt-hooks
d1069532
SM
3281 'mh-kill-folder-suppress-prompt-functions "24.3")
3282(defcustom-mh mh-kill-folder-suppress-prompt-functions '(mh-search-p)
dda00b2c
BW
3283 "Abnormal hook run at the beginning of \\<mh-folder-mode-map>\\[mh-kill-folder].
3284
3285The hook functions are called with no arguments and should return
3286a non-nil value to suppress the normal prompt when you remove a
3287folder. This is useful for folders that are easily regenerated.
3288
3289The default value of `mh-search-p' suppresses the prompt on
3290folders generated by searching.
3291
3292WARNING: Use this hook with care. If there is a bug in your hook
3293which returns t on \"+inbox\" and you hit \\[mh-kill-folder] by
3294accident in the \"+inbox\" folder, you will not be happy."
3295 :type 'hook
3296 :group 'mh-hooks
23347d76 3297 :group 'mh-folder
70a1d47e 3298 :package-version '(MH-E . "7.4"))
dda00b2c 3299
c90c4cf1 3300(defcustom-mh mh-letter-mode-hook nil
dda00b2c
BW
3301 "Hook run by `mh-letter-mode' on a new letter.
3302
3303This hook allows you to do some processing before editing a
3304letter. For example, you may wish to modify the header after
3305\"repl\" has done its work, or you may have a complicated
3306\"components\" file and need to tell MH-E where the cursor should
3307go."
3308 :type 'hook
3309 :group 'mh-hooks
23347d76 3310 :group 'mh-sending-mail
70a1d47e 3311 :package-version '(MH-E . "6.0"))
dda00b2c 3312
c90c4cf1 3313(defcustom-mh mh-mh-to-mime-hook nil
dda00b2c
BW
3314 "Hook run on the formatted letter by \\<mh-letter-mode-map>\\[mh-mh-to-mime]."
3315 :type 'hook
3316 :group 'mh-hooks
23347d76 3317 :group 'mh-letter
70a1d47e 3318 :package-version '(MH-E . "8.0"))
dda00b2c 3319
c90c4cf1 3320(defcustom-mh mh-search-mode-hook nil
dda00b2c
BW
3321 "Hook run upon entry to `mh-search-mode'\\<mh-folder-mode-map>.
3322
3323If you find that you do the same thing over and over when editing
3324the search template, you may wish to bind some shortcuts to keys.
3325This can be done with this hook which is called when
3326\\[mh-search] is run on a new pattern."
3327 :type 'hook
3328 :group 'mh-hooks
23347d76 3329 :group 'mh-search
70a1d47e 3330 :package-version '(MH-E . "8.0"))
dda00b2c 3331
031c6757
SG
3332(defcustom-mh mh-pack-folder-hook nil
3333 "Hook run by \\<mh-folder-mode-map>\\[mh-pack-folder] after renumbering the messages.
3334Hook functions can access the current folder name with `mh-current-folder'."
3335 :type 'hook
3336 :group 'mh-hooks
3337 :group 'mh-folder
7f1a6a6f 3338 :package-version '(MH-E . "8.2"))
031c6757 3339
c90c4cf1 3340(defcustom-mh mh-quit-hook nil
dda00b2c
BW
3341 "Hook run by \\<mh-folder-mode-map>\\[mh-quit] after quitting MH-E.
3342
3343This hook is not run in an MH-E context, so you might use it to
3344modify the window setup.
3345
3346See also `mh-before-quit-hook'."
3347 :type 'hook
3348 :group 'mh-hooks
23347d76 3349 :group 'mh-folder
70a1d47e 3350 :package-version '(MH-E . "6.0"))
dda00b2c 3351
c90c4cf1 3352(defcustom-mh mh-refile-msg-hook nil
dda00b2c
BW
3353 "Hook run by \\<mh-folder-mode-map>\\[mh-refile-msg] after marking each message for refiling."
3354 :type 'hook
3355 :group 'mh-hooks
23347d76 3356 :group 'mh-folder
70a1d47e 3357 :package-version '(MH-E . "6.0"))
dda00b2c 3358
c90c4cf1 3359(defcustom-mh mh-show-hook nil
dda00b2c
BW
3360 "Hook run after \\<mh-folder-mode-map>\\[mh-show] shows a message.
3361
3362It is the last thing called after messages are displayed. It's
3363used to affect the behavior of MH-E in general or when
3364`mh-show-mode-hook' is too early. See `mh-show-mode-hook'."
3365 :type 'hook
3366 :group 'mh-hooks
23347d76 3367 :group 'mh-show
70a1d47e 3368 :package-version '(MH-E . "6.0"))
dda00b2c 3369
c90c4cf1 3370(defcustom-mh mh-show-mode-hook nil
dda00b2c
BW
3371 "Hook run upon entry to `mh-show-mode'.
3372
3373This hook is called early on in the process of the message
3374display. It is usually used to perform some action on the
3375message's content. See `mh-show-hook'."
3376 :type 'hook
3377 :group 'mh-hooks
23347d76 3378 :group 'mh-show
70a1d47e 3379 :package-version '(MH-E . "6.0"))
dda00b2c 3380
c90c4cf1 3381(defcustom-mh mh-unseen-updated-hook nil
dda00b2c
BW
3382 "Hook run after the unseen sequence has been updated.
3383
3384The variable `mh-seen-list' can be used by this hook to obtain
3385the list of messages which were removed from the unseen
3386sequence."
3387 :type 'hook
3388 :group 'mh-hooks
23347d76 3389 :group 'mh-sequences
70a1d47e 3390 :package-version '(MH-E . "6.0"))
a1b4049d 3391
41b97610
BW
3392(defcustom-mh mh-whitelist-msg-hook nil
3393 "Hook run by \\<mh-letter-mode-map>\\[mh-junk-whitelist] after marking each message for whitelisting."
3394 :type 'hook
3395 :group 'mh-hooks
3396 :group 'mh-show
3397 :package-version '(MH-E . "8.4"))
3398
bdcfe844 3399\f
a1b4049d 3400
dda00b2c
BW
3401;;; Faces (:group 'mh-faces + group where faces described)
3402
3403(if (boundp 'facemenu-unlisted-faces)
3404 (add-to-list 'facemenu-unlisted-faces "^mh-"))
3405
367c48ef
BW
3406;; To add a new face:
3407;; 1. Add entry to variable mh-face-data.
c90c4cf1 3408;; 2. Create face using defface-mh (which removes min-color spec and
367c48ef
BW
3409;; :package-version keyword where these are not supported),
3410;; accessing face data with function mh-face-data.
3411;; 3. Add inherit argument to function mh-face-data if applicable.
6d21875b
BW
3412(defvar mh-face-data
3413 '((mh-folder-followup
3414 ((((class color) (background light))
3415 (:foreground "blue3"))
3416 (((class color) (background dark))
3417 (:foreground "LightGoldenRod"))
3418 (t
3419 (:bold t))))
3420 (mh-folder-msg-number
3421 ((((class color) (min-colors 64) (background light))
3422 (:foreground "snow4"))
3423 (((class color) (min-colors 64) (background dark))
3424 (:foreground "snow3"))
b95d0a24
BW
3425 (((class color) (background light))
3426 (:foreground "purple"))
3427 (((class color) (background dark))
6d21875b
BW
3428 (:foreground "cyan"))))
3429 (mh-folder-refiled
3430 ((((class color) (min-colors 64) (background light))
3431 (:foreground "DarkGoldenrod"))
3432 (((class color) (min-colors 64) (background dark))
3433 (:foreground "LightGoldenrod"))
3434 (((class color))
3435 (:foreground "yellow" :weight light))
3436 (((class grayscale) (background light))
3437 (:foreground "Gray90" :bold t :italic t))
3438 (((class grayscale) (background dark))
3439 (:foreground "DimGray" :bold t :italic t))
3440 (t
3441 (:bold t :italic t))))
3442 (mh-folder-subject
3443 ((((class color) (background light))
3444 (:foreground "blue4"))
3445 (((class color) (background dark))
3446 (:foreground "yellow"))
3447 (t
3448 (:bold t))))
3449 (mh-folder-tick
b95d0a24 3450 ((((class color) (background light))
6d21875b 3451 (:background "#dddf7e"))
b95d0a24 3452 (((class color) (background dark))
6d21875b
BW
3453 (:background "#dddf7e"))
3454 (t
3455 (:underline t))))
3456 (mh-folder-to
3457 ((((class color) (min-colors 64) (background light))
3458 (:foreground "RosyBrown"))
3459 (((class color) (min-colors 64) (background dark))
3460 (:foreground "LightSalmon"))
3461 (((class color))
3462 (:foreground "green"))
3463 (((class grayscale) (background light))
3464 (:foreground "DimGray" :italic t))
3465 (((class grayscale) (background dark))
3466 (:foreground "LightGray" :italic t))
3467 (t
3468 (:italic t))))
3469 (mh-letter-header-field
3470 ((((class color) (background light))
3471 (:background "gray90"))
3472 (((class color) (background dark))
3473 (:background "gray10"))
3474 (t
3475 (:bold t))))
3476 (mh-search-folder
3477 ((((class color) (background light))
3478 (:foreground "dark green" :bold t))
3479 (((class color) (background dark))
3480 (:foreground "indian red" :bold t))
3481 (t
3482 (:bold t))))
3483 (mh-show-cc
3484 ((((class color) (min-colors 64) (background light))
3485 (:foreground "DarkGoldenrod"))
3486 (((class color) (min-colors 64) (background dark))
3487 (:foreground "LightGoldenrod"))
3488 (((class color))
3489 (:foreground "yellow" :weight light))
3490 (((class grayscale) (background light))
3491 (:foreground "Gray90" :bold t :italic t))
3492 (((class grayscale) (background dark))
3493 (:foreground "DimGray" :bold t :italic t))
3494 (t
3495 (:bold t :italic t))))
3496 (mh-show-date
3497 ((((class color) (min-colors 64) (background light))
3498 (:foreground "ForestGreen"))
3499 (((class color) (min-colors 64) (background dark))
3500 (:foreground "PaleGreen"))
3501 (((class color))
3502 (:foreground "green"))
3503 (((class grayscale) (background light))
3504 (:foreground "Gray90" :bold t))
3505 (((class grayscale) (background dark))
3506 (:foreground "DimGray" :bold t))
3507 (t
3508 (:bold t :underline t))))
3509 (mh-show-from
3510 ((((class color) (background light))
3511 (:foreground "red3"))
3512 (((class color) (background dark))
3513 (:foreground "cyan"))
3514 (t
3515 (:bold t))))
3516 (mh-show-header
3517 ((((class color) (min-colors 64) (background light))
3518 (:foreground "RosyBrown"))
3519 (((class color) (min-colors 64) (background dark))
3520 (:foreground "LightSalmon"))
3521 (((class color))
3522 (:foreground "green"))
3523 (((class grayscale) (background light))
3524 (:foreground "DimGray" :italic t))
3525 (((class grayscale) (background dark))
3526 (:foreground "LightGray" :italic t))
3527 (t
3528 (:italic t))))
3529 (mh-show-pgg-bad ((t (:bold t :foreground "DeepPink1"))))
3530 (mh-show-pgg-good ((t (:bold t :foreground "LimeGreen"))))
3531 (mh-show-pgg-unknown ((t (:bold t :foreground "DarkGoldenrod2"))))
3532 (mh-show-signature ((t (:italic t))))
3533 (mh-show-to
3534 ((((class color) (background light))
3535 (:foreground "SaddleBrown"))
3536 (((class color) (background dark))
3537 (:foreground "burlywood"))
3538 (((class grayscale) (background light))
3539 (:foreground "DimGray" :underline t))
3540 (((class grayscale) (background dark))
3541 (:foreground "LightGray" :underline t))
3542 (t (:underline t))))
3543 (mh-speedbar-folder
3544 ((((class color) (background light))
3545 (:foreground "blue4"))
3546 (((class color) (background dark))
3547 (:foreground "light blue"))))
3548 (mh-speedbar-selected-folder
3549 ((((class color) (background light))
3550 (:foreground "red1" :underline t))
3551 (((class color) (background dark))
3552 (:foreground "red1" :underline t))
3553 (t
367c48ef
BW
3554 (:underline t)))))
3555 "MH-E face data.
3556Used by function `mh-face-data' which returns spec that is
c90c4cf1 3557consumed by `defface-mh'.")
367c48ef
BW
3558
3559(require 'cus-face)
3560
3561(defvar mh-inherit-face-flag (assq :inherit custom-face-attributes)
3562 "Non-nil means that the `defface' :inherit keyword is available.
3563The :inherit keyword is available on all supported versions of
3564GNU Emacs and XEmacs from at least 21.5.23 on.")
3565
a3269bc4 3566(defvar mh-min-colors-defined-flag (and (not (featurep 'xemacs))
367c48ef
BW
3567 (>= emacs-major-version 22))
3568 "Non-nil means `defface' supports min-colors display requirement.")
6d21875b
BW
3569
3570(defun mh-face-data (face &optional inherit)
3571 "Return spec for FACE.
367c48ef 3572See `defface' for the spec definition.
6d21875b 3573
367c48ef
BW
3574If INHERIT is non-nil and `defface' supports the :inherit
3575keyword, return INHERIT literally; otherwise, return spec for
3576FACE from the variable `mh-face-data'. This isn't a perfect
3577implementation. In the case that the :inherit keyword is not
3578supported, any additional attributes in the inherit parameter are
3579not added to the returned spec.
3580
3581Furthermore, when `mh-min-colors-defined-flag' is nil, this
3582function finds display entries with \"min-colors\" requirements
3583and either removes the \"min-colors\" requirement or strips the
3584display entirely if the display does not support the number of
3585specified colors."
3586 (let ((spec
3587 (if (and inherit mh-inherit-face-flag)
3588 inherit
3589 (or (cadr (assq face mh-face-data))
3590 (error "Could not find %s in mh-face-data" face)))))
3591
3592 (if mh-min-colors-defined-flag
3593 spec
3594 (let ((cells (mh-display-color-cells))
3595 new-spec)
3596 ;; Remove entries with min-colors, or delete them if we have
3597 ;; fewer colors than they specify.
3598 (loop for entry in (reverse spec) do
3599 (let ((requirement (if (eq (car entry) t)
3600 nil
3601 (assq 'min-colors (car entry)))))
3602 (if requirement
3603 (when (>= cells (nth 1 requirement))
3604 (setq new-spec (cons (cons (delq requirement (car entry))
3605 (cdr entry))
3606 new-spec)))
3607 (setq new-spec (cons entry new-spec)))))
3608 new-spec))))
6d21875b 3609
c90c4cf1 3610(defface-mh mh-folder-address
6d21875b 3611 (mh-face-data 'mh-folder-subject '((t (:inherit mh-folder-subject))))
dda00b2c
BW
3612 "Recipient face."
3613 :group 'mh-faces
23347d76 3614 :group 'mh-folder
70a1d47e 3615 :package-version '(MH-E . "8.0"))
dda00b2c 3616
41b97610
BW
3617(defface-mh mh-folder-blacklisted
3618 (mh-face-data 'mh-folder-msg-number '((t (:inherit mh-folder-msg-number))))
3619 "Blacklisted message face."
3620 :group 'mh-faces
3621 :group 'mh-folder
3622 :package-version '(MH-E . "8.4"))
3623
c90c4cf1 3624(defface-mh mh-folder-body
6d21875b
BW
3625 (mh-face-data 'mh-folder-msg-number
3626 '((((class color))
3627 (:inherit mh-folder-msg-number))
3628 (t
3629 (:inherit mh-folder-msg-number :italic t))))
dda00b2c
BW
3630 "Body text face."
3631 :group 'mh-faces
23347d76 3632 :group 'mh-folder
70a1d47e 3633 :package-version '(MH-E . "8.0"))
dda00b2c 3634
c90c4cf1 3635(defface-mh mh-folder-cur-msg-number
6d21875b
BW
3636 (mh-face-data 'mh-folder-msg-number
3637 '((t (:inherit mh-folder-msg-number :bold t))))
dda00b2c
BW
3638 "Current message number face."
3639 :group 'mh-faces
23347d76 3640 :group 'mh-folder
70a1d47e 3641 :package-version '(MH-E . "8.0"))
dda00b2c 3642
c90c4cf1 3643(defface-mh mh-folder-date
6d21875b 3644 (mh-face-data 'mh-folder-msg-number '((t (:inherit mh-folder-msg-number))))
dda00b2c
BW
3645 "Date face."
3646 :group 'mh-faces
23347d76 3647 :group 'mh-folder
70a1d47e 3648 :package-version '(MH-E . "8.0"))
dda00b2c 3649
c90c4cf1 3650(defface-mh mh-folder-deleted
6d21875b 3651 (mh-face-data 'mh-folder-msg-number '((t (:inherit mh-folder-msg-number))))
dda00b2c
BW
3652 "Deleted message face."
3653 :group 'mh-faces
23347d76 3654 :group 'mh-folder
70a1d47e 3655 :package-version '(MH-E . "8.0"))
dda00b2c 3656
c90c4cf1 3657(defface-mh mh-folder-followup (mh-face-data 'mh-folder-followup)
dda00b2c
BW
3658 "\"Re:\" face."
3659 :group 'mh-faces
23347d76 3660 :group 'mh-folder
70a1d47e 3661 :package-version '(MH-E . "8.0"))
dda00b2c 3662
c90c4cf1 3663(defface-mh mh-folder-msg-number (mh-face-data 'mh-folder-msg-number)
dda00b2c
BW
3664 "Message number face."
3665 :group 'mh-faces
23347d76 3666 :group 'mh-folder
70a1d47e 3667 :package-version '(MH-E . "8.0"))
dda00b2c 3668
c90c4cf1 3669(defface-mh mh-folder-refiled (mh-face-data 'mh-folder-refiled)
dda00b2c
BW
3670 "Refiled message face."
3671 :group 'mh-faces
23347d76 3672 :group 'mh-folder
70a1d47e 3673 :package-version '(MH-E . "8.0"))
dda00b2c 3674
c90c4cf1 3675(defface-mh mh-folder-sent-to-me-hint
6d21875b 3676 (mh-face-data 'mh-folder-msg-number '((t (:inherit mh-folder-date))))
dda00b2c
BW
3677 "Fontification hint face in messages sent directly to us.
3678The detection of messages sent to us is governed by the scan
3679format `mh-scan-format-nmh' and the regular expression
3680`mh-scan-sent-to-me-sender-regexp'."
3681 :group 'mh-faces
23347d76 3682 :group 'mh-folder
70a1d47e 3683 :package-version '(MH-E . "8.0"))
dda00b2c 3684
c90c4cf1 3685(defface-mh mh-folder-sent-to-me-sender
6d21875b 3686 (mh-face-data 'mh-folder-followup '((t (:inherit mh-folder-followup))))
dda00b2c
BW
3687 "Sender face in messages sent directly to us.
3688The detection of messages sent to us is governed by the scan
3689format `mh-scan-format-nmh' and the regular expression
3690`mh-scan-sent-to-me-sender-regexp'."
3691 :group 'mh-faces
23347d76 3692 :group 'mh-folder
70a1d47e 3693 :package-version '(MH-E . "8.0"))
dda00b2c 3694
c90c4cf1 3695(defface-mh mh-folder-subject (mh-face-data 'mh-folder-subject)
dda00b2c
BW
3696 "Subject face."
3697 :group 'mh-faces
23347d76 3698 :group 'mh-folder
70a1d47e 3699 :package-version '(MH-E . "8.0"))
dda00b2c 3700
c90c4cf1 3701(defface-mh mh-folder-tick (mh-face-data 'mh-folder-tick)
dda00b2c
BW
3702 "Ticked message face."
3703 :group 'mh-faces
23347d76 3704 :group 'mh-folder
70a1d47e 3705 :package-version '(MH-E . "8.0"))
dda00b2c 3706
c90c4cf1 3707(defface-mh mh-folder-to (mh-face-data 'mh-folder-to)
dda00b2c
BW
3708 "\"To:\" face."
3709 :group 'mh-faces
23347d76 3710 :group 'mh-folder
70a1d47e 3711 :package-version '(MH-E . "8.0"))
dda00b2c 3712
41b97610
BW
3713(defface-mh mh-folder-whitelisted
3714 (mh-face-data 'mh-folder-refiled '((t (:inherit mh-folder-refiled))))
3715 "Whitelisted message face."
3716 :group 'mh-faces
3717 :group 'mh-folder
3718 :package-version '(MH-E . "8.4"))
3719
c90c4cf1 3720(defface-mh mh-letter-header-field (mh-face-data 'mh-letter-header-field)
dda00b2c
BW
3721 "Editable header field value face in draft buffers."
3722 :group 'mh-faces
23347d76 3723 :group 'mh-letter
70a1d47e 3724 :package-version '(MH-E . "8.0"))
dda00b2c 3725
c90c4cf1 3726(defface-mh mh-search-folder (mh-face-data 'mh-search-folder)
6d21875b
BW
3727 "Folder heading face in MH-Folder buffers created by searches."
3728 :group 'mh-faces
23347d76 3729 :group 'mh-search
70a1d47e 3730 :package-version '(MH-E . "8.0"))
6d21875b 3731
c90c4cf1 3732(defface-mh mh-show-cc (mh-face-data 'mh-show-cc)
dda00b2c
BW
3733 "Face used to highlight \"cc:\" header fields."
3734 :group 'mh-faces
23347d76 3735 :group 'mh-show
70a1d47e 3736 :package-version '(MH-E . "8.0"))
dda00b2c 3737
c90c4cf1 3738(defface-mh mh-show-date (mh-face-data 'mh-show-date)
dda00b2c
BW
3739 "Face used to highlight \"Date:\" header fields."
3740 :group 'mh-faces
23347d76 3741 :group 'mh-show
70a1d47e 3742 :package-version '(MH-E . "8.0"))
dda00b2c 3743
c90c4cf1 3744(defface-mh mh-show-from (mh-face-data 'mh-show-from)
dda00b2c
BW
3745 "Face used to highlight \"From:\" header fields."
3746 :group 'mh-faces
23347d76 3747 :group 'mh-show
70a1d47e 3748 :package-version '(MH-E . "8.0"))
dda00b2c 3749
c90c4cf1 3750(defface-mh mh-show-header (mh-face-data 'mh-show-header)
dda00b2c
BW
3751 "Face used to deemphasize less interesting header fields."
3752 :group 'mh-faces
23347d76 3753 :group 'mh-show
70a1d47e 3754 :package-version '(MH-E . "8.0"))
dda00b2c 3755
c90c4cf1 3756(defface-mh mh-show-pgg-bad (mh-face-data 'mh-show-pgg-bad)
dda00b2c
BW
3757 "Bad PGG signature face."
3758 :group 'mh-faces
23347d76 3759 :group 'mh-show
70a1d47e 3760 :package-version '(MH-E . "8.0"))
dda00b2c 3761
c90c4cf1 3762(defface-mh mh-show-pgg-good (mh-face-data 'mh-show-pgg-good)
dda00b2c
BW
3763 "Good PGG signature face."
3764 :group 'mh-faces
23347d76 3765 :group 'mh-show
70a1d47e 3766 :package-version '(MH-E . "8.0"))
dda00b2c 3767
c90c4cf1 3768(defface-mh mh-show-pgg-unknown (mh-face-data 'mh-show-pgg-unknown)
dda00b2c
BW
3769 "Unknown or untrusted PGG signature face."
3770 :group 'mh-faces
23347d76 3771 :group 'mh-show
70a1d47e 3772 :package-version '(MH-E . "8.0"))
dda00b2c 3773
c90c4cf1 3774(defface-mh mh-show-signature (mh-face-data 'mh-show-signature)
dda00b2c
BW
3775 "Signature face."
3776 :group 'mh-faces
23347d76 3777 :group 'mh-show
70a1d47e 3778 :package-version '(MH-E . "8.0"))
dda00b2c 3779
c90c4cf1 3780(defface-mh mh-show-subject
6d21875b 3781 (mh-face-data 'mh-folder-subject '((t (:inherit mh-folder-subject))))
dda00b2c
BW
3782 "Face used to highlight \"Subject:\" header fields."
3783 :group 'mh-faces
23347d76 3784 :group 'mh-show
70a1d47e 3785 :package-version '(MH-E . "8.0"))
dda00b2c 3786
c90c4cf1 3787(defface-mh mh-show-to (mh-face-data 'mh-show-to)
dda00b2c
BW
3788 "Face used to highlight \"To:\" header fields."
3789 :group 'mh-faces
23347d76 3790 :group 'mh-show
70a1d47e 3791 :package-version '(MH-E . "8.0"))
dda00b2c 3792
c90c4cf1 3793(defface-mh mh-show-xface
6d21875b 3794 (mh-face-data 'mh-show-from '((t (:inherit (mh-show-from highlight)))))
6d21875b 3795"X-Face image face.
dda00b2c
BW
3796The background and foreground are used in the image."
3797 :group 'mh-faces
23347d76 3798 :group 'mh-show
70a1d47e 3799 :package-version '(MH-E . "8.0"))
dda00b2c 3800
c90c4cf1 3801(defface-mh mh-speedbar-folder (mh-face-data 'mh-speedbar-folder)
dda00b2c
BW
3802 "Basic folder face."
3803 :group 'mh-faces
23347d76 3804 :group 'mh-speedbar
70a1d47e 3805 :package-version '(MH-E . "8.0"))
dda00b2c 3806
c90c4cf1 3807(defface-mh mh-speedbar-folder-with-unseen-messages
6d21875b
BW
3808 (mh-face-data 'mh-speedbar-folder
3809 '((t (:inherit mh-speedbar-folder :bold t))))
dda00b2c
BW
3810 "Folder face when folder contains unread messages."
3811 :group 'mh-faces
23347d76 3812 :group 'mh-speedbar
70a1d47e 3813 :package-version '(MH-E . "8.0"))
dda00b2c 3814
c90c4cf1 3815(defface-mh mh-speedbar-selected-folder
6d21875b 3816 (mh-face-data 'mh-speedbar-selected-folder)
dda00b2c
BW
3817 "Selected folder face."
3818 :group 'mh-faces
23347d76 3819 :group 'mh-speedbar
70a1d47e 3820 :package-version '(MH-E . "8.0"))
dda00b2c 3821
c90c4cf1 3822(defface-mh mh-speedbar-selected-folder-with-unseen-messages
6d21875b
BW
3823 (mh-face-data 'mh-speedbar-selected-folder
3824 '((t (:inherit mh-speedbar-selected-folder :bold t))))
dda00b2c
BW
3825 "Selected folder face when folder contains unread messages."
3826 :group 'mh-faces
23347d76 3827 :group 'mh-speedbar
70a1d47e 3828 :package-version '(MH-E . "8.0"))
f1ed9461 3829
bdcfe844
BW
3830(provide 'mh-e)
3831
cee9f5c6
BW
3832;; Local Variables:
3833;; indent-tabs-mode: nil
3834;; sentence-end-double-space: nil
3835;; End:
bdcfe844 3836
c26cf6c8 3837;;; mh-e.el ends here