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