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