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