]> code.delx.au - gnu-emacs/blob - lisp/mh-e/mh-customize.el
Update years in copyright notice; nfc.
[gnu-emacs] / lisp / mh-e / mh-customize.el
1 ;;; mh-customize.el --- MH-E customization
2
3 ;; Copyright (C) 2005 Free Software Foundation, Inc.
4
5 ;; Author: Bill Wohler <wohler@newt.com>
6 ;; Maintainer: Bill Wohler <wohler@newt.com>
7 ;; Keywords: mail
8 ;; See: mh-e.el
9
10 ;; This file is part of GNU Emacs.
11
12 ;; GNU Emacs is free software; you can redistribute it and/or modify
13 ;; it under the terms of the GNU General Public License as published by
14 ;; the Free Software Foundation; either version 2, or (at your option)
15 ;; any later version.
16
17 ;; GNU Emacs is distributed in the hope that it will be useful,
18 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
19 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 ;; GNU General Public License for more details.
21
22 ;; You should have received a copy of the GNU General Public License
23 ;; along with GNU Emacs; see the file COPYING. If not, write to the
24 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
25 ;; Boston, MA 02111-1307, USA.
26
27 ;;; Commentary:
28
29 ;; All of the defgroups, defcustoms, and deffaces in MH-E are found
30 ;; here. This makes it possible to customize modules that aren't loaded
31 ;; yet. It also makes it easier to organize the customization groups.
32
33 ;; This file contains the following sections:
34 ;;
35 ;; 1. MH-E Customization Groups
36 ;;
37 ;; These are the customization group definitions. Every group has a
38 ;; associated manual node. The ordering is alphabetical, except for the
39 ;; groups mh-faces and mh-hooks which are last .
40 ;;
41 ;; 2. MH-E Customization
42 ;;
43 ;; These are the actual customization variables. There is a sub-section for
44 ;; each group in the MH-E Customization Groups section, in the same order,
45 ;; separated by page breaks. Within each section, variables are sorted
46 ;; alphabetically.
47 ;;
48 ;; 3. Hooks
49 ;;
50 ;; All hooks must be placed in the mh-hook group; in addition, add the
51 ;; group associated with the manual node in which the hook is described.
52 ;; Since the mh-hook group appears near the end of this file, the hooks
53 ;; will appear at the end of these other groups.
54 ;;
55 ;; 4. Faces
56 ;;
57 ;; Create a new face group if necessary; in this case, add the group
58 ;; associated with the manual node in which the faces are described to the
59 ;; faces' group definition. Since the face groups appear last, the face
60 ;; groups will appear at the end of these other groups.
61 ;;
62 ;;; Change Log:
63
64 ;;; Code:
65
66 (provide 'mh-customize)
67
68 (eval-when-compile (require 'mh-acros))
69 (mh-require-cl)
70 (require 'mh-loaddefs)
71
72 (autoload 'Info-goto-node "info")
73
74 (eval-and-compile
75 (defvar mh-xemacs-flag (featurep 'xemacs)
76 "Non-nil means the current Emacs is XEmacs."))
77
78 (when mh-xemacs-flag
79 (require 'mh-xemacs))
80
81 ;; XXX: Functions autoloaded from the following files are used to initialize
82 ;; customizable variables. They are require'd here, since otherwise the
83 ;; corresponding .elc would be loaded at compile time.
84 (eval-when-compile
85 (require 'mh-init)
86 (require 'mh-identity))
87
88 (defun mh-customize (&optional delete-other-windows-flag)
89 "Customize MH-E variables.
90 If optional argument DELETE-OTHER-WINDOWS-FLAG is non-nil, other windows in
91 the frame are removed."
92 (interactive "P")
93 (customize-group 'mh)
94 (when delete-other-windows-flag
95 (delete-other-windows)))
96
97 \f
98
99 ;;; For compiler warnings...
100 (defvar mh-show-buffer)
101 (defvar mh-show-folder-buffer)
102
103 ;;; MH-E Customization Groups
104
105 (defgroup mh nil
106 "Emacs interface to the MH mail system.
107 MH is the Rand Mail Handler. Other implementations include nmh and GNU
108 mailutils."
109 :link '(custom-manual "(mh-e)Top")
110 :group 'mail)
111
112 (defgroup mh-e '((mh custom-group)) ; Sort of an alias for 'mh group
113 "Emacs interface to the MH mail system.
114 MH is the Rand Mail Handler. Other implementations include nmh and GNU
115 mailutils."
116 :link '(custom-manual "(mh-e)Top"))
117
118 (defgroup mh-alias nil
119 "Aliases."
120 :link '(custom-manual "(mh-e)Aliases")
121 :prefix "mh-alias-"
122 :group 'mh)
123
124 (defgroup mh-folder nil
125 "Organizing your mail with folders."
126 :prefix "mh-"
127 :link '(custom-manual "(mh-e)Organizing")
128 :group 'mh)
129
130 (defgroup mh-folder-selection nil
131 "Folder selection."
132 :prefix "mh-"
133 :link '(custom-manual "(mh-e)Folder Selection")
134 :group 'mh)
135
136 (defgroup mh-identity nil
137 "Identities."
138 :link '(custom-manual "(mh-e)Identities")
139 :prefix "mh-identity-"
140 :group 'mh)
141
142 (defgroup mh-inc nil
143 "Incorporating your mail."
144 :prefix "mh-inc-"
145 :link '(custom-manual "(mh-e)Incorporating Mail")
146 :group 'mh)
147
148 (defgroup mh-index nil
149 "Searching."
150 :link '(custom-manual "(mh-e)Searching")
151 :prefix "mh-index-"
152 :group 'mh)
153
154 (defgroup mh-junk nil
155 "Dealing with junk mail."
156 :link '(custom-manual "(mh-e)Junk")
157 :prefix "mh-junk-"
158 :group 'mh)
159
160 (defgroup mh-letter nil
161 "Editing a draft."
162 :prefix "mh-"
163 :link '(custom-manual "(mh-e)Editing Drafts")
164 :group 'mh)
165
166 (defgroup mh-ranges nil
167 "Ranges."
168 :prefix "mh-"
169 :link '(custom-manual "(mh-e)Ranges")
170 :group 'mh)
171
172 (defgroup mh-scan-line-formats nil
173 "Scan line formats."
174 :link '(custom-manual "(mh-e)Scan Line Formats")
175 :prefix "mh-"
176 :group 'mh)
177
178 (defgroup mh-sending-mail nil
179 "Sending mail."
180 :prefix "mh-"
181 :link '(custom-manual "(mh-e)Sending Mail")
182 :group 'mh)
183
184 (defgroup mh-sequences nil
185 "Sequences."
186 :prefix "mh-"
187 :link '(custom-manual "(mh-e)Sequences")
188 :group 'mh)
189
190 (defgroup mh-show nil
191 "Reading your mail."
192 :prefix "mh-"
193 :link '(custom-manual "(mh-e)Reading Mail")
194 :group 'mh)
195
196 (defgroup mh-speed nil
197 "The speedbar."
198 :prefix "mh-speed-"
199 :link '(custom-manual "(mh-e)Speedbar")
200 :group 'mh)
201
202 (defgroup mh-toolbar nil
203 "The toolbar"
204 :link '(custom-manual "(mh-e)Toolbar")
205 :prefix "mh-"
206 :group 'mh)
207
208 (defgroup mh-faces nil
209 "Faces used in MH-E."
210 :link '(custom-manual "(mh-e)Top")
211 :prefix "mh-"
212 :group 'faces
213 :group 'mh)
214
215 (defgroup mh-hooks nil
216 "MH-E hooks."
217 :link '(custom-manual "(mh-e)Top")
218 :prefix "mh-"
219 :group 'mh)
220
221 ;;; Faces
222
223 (defgroup mh-folder-faces nil
224 "Faces used in scan listing."
225 :link '(custom-manual "(mh-e)Organizing")
226 :prefix "mh-"
227 :group 'mh-faces
228 :group 'mh-show)
229
230 (defgroup mh-index-faces nil
231 "Faces used in searching."
232 :link '(custom-manual "(mh-e)Searching")
233 :prefix "mh-"
234 :group 'mh-faces
235 :group 'mh-index)
236
237 (defgroup mh-letter-faces nil
238 "Faces used in message drafts."
239 :link '(custom-manual "(mh-e)Sending Mail")
240 :prefix "mh-"
241 :group 'mh-faces
242 :group 'mh-letter)
243
244 (defgroup mh-show-faces nil
245 "Faces used in message display."
246 :link '(custom-manual "(mh-e)Reading Mail")
247 :prefix "mh-"
248 :group 'mh-faces
249 :group 'mh-show)
250
251 (defgroup mh-speed-faces nil
252 "Faces used in speedbar."
253 :link '(custom-manual "(mh-e)Speedbar")
254 :prefix "mh-"
255 :group 'mh-faces
256 :group 'mh-speed)
257
258 \f
259
260 ;;; Emacs interface to the MH mail system (:group mh)
261 (eval-when (compile)
262 (setq mh-variant 'none))
263
264 (defcustom mh-variant 'autodetect
265 "*Specifies the variant used by MH-E.
266
267 The default setting of this option is `Auto-detect' which means that MH-E will
268 automatically choose the first of nmh, MH, or GNU mailutils that it finds in
269 the directories listed in `mh-path', `mh-sys-path', and `exec-path'. If, for
270 example, you have both nmh and mailutils installed and `mh-variant-in-use' was
271 initialized to nmh but you want to use mailutils, then you can set this option
272 to `mailutils'.
273
274 When this variable is changed, MH-E resets `mh-progs', `mh-lib',
275 `mh-lib-progs', `mh-flists-present-flag', and `mh-variant-in-use'
276 accordingly."
277 :type `(radio
278 (const :tag "Auto-detect" autodetect)
279 ,@(mapcar (lambda (x) `(const ,(car x))) (mh-variants)))
280 :set (lambda (symbol value)
281 (set-default symbol value) ;Done in mh-variant-set-variant!
282 (mh-variant-set value))
283 :group 'mh)
284
285 \f
286
287 ;;; Aliases (:group 'mh-alias)
288
289 (defcustom mh-alias-completion-ignore-case-flag t
290 "*Non-nil means don't consider case significant in MH alias completion.
291 As MH ignores case in the aliases, so too does MH-E. However, you may turn
292 this option off to make case significant which can be used to segregate
293 completion of your aliases. You might use lowercase for mailing lists and
294 uppercase for people."
295 :type 'boolean
296 :group 'mh-alias)
297
298 (defcustom mh-alias-expand-aliases-flag nil
299 "*Non-nil means to expand aliases entered in the minibuffer.
300 In other words, aliases entered in the minibuffer will be expanded to the full
301 address in the message draft. By default, this expansion is not performed."
302 :type 'boolean
303 :group 'mh-alias)
304
305 (defcustom mh-alias-flash-on-comma t
306 "*Specify whether to flash address or warn on translation.
307 This option controls the behavior when a [comma] is pressed while entering
308 aliases or addresses. The default setting flashes the address associated with
309 an address in the minibuffer briefly, but does not display a warning if the
310 alias is not found."
311 :type '(choice (const :tag "Flash but Don't Warn If No Alias" t)
312 (const :tag "Flash and Warn If No Alias" 1)
313 (const :tag "Don't Flash Nor Warn If No Alias" nil))
314 :group 'mh-alias)
315
316 (defcustom mh-alias-insert-file nil
317 "*Filename used to store a new MH-E alias.
318 The default setting of this option is `Use Aliasfile Profile Component'. This
319 option can also hold the name of a file or a list a file names. If this option
320 is set to a list of file names, or the `Aliasfile:' profile component contains
321 more than one file name, MH-E will prompt for one of them when MH-E adds an
322 alias."
323 :type '(choice (const :tag "Use Aliasfile Profile Component" nil)
324 (file :tag "Alias File")
325 (repeat :tag "List of Alias Files" file))
326 :group 'mh-alias)
327
328 (defcustom mh-alias-insertion-location 'sorted
329 "Specifies where new aliases are entered in alias files.
330 This option is set to `Alphabetical' by default. If you organize your alias
331 file in other ways, then adding aliases to the `Top' or `Bottom' of your alias
332 file might be more appropriate."
333 :type '(choice (const :tag "Alphabetical" sorted)
334 (const :tag "Top" top)
335 (const :tag "Bottom" bottom))
336 :group 'mh-alias)
337
338 (defcustom mh-alias-local-users t
339 "*If on, local users are added to alias completion.
340
341 Aliases are created from `/etc/passwd' entries with a user ID larger than
342 a magical number, typically 200. This can be a handy tool on a machine where
343 you and co-workers exchange messages. These aliases have the form
344 `local.first.last' if a real name is present in the password file.
345 Otherwise, the alias will have the form `local.login'.
346
347 If you're on a system with thousands of users you don't know, and the loading
348 of local aliases slows MH-E down noticeably, then turn this option off.
349
350 This option also takes a string which is executed to generate the password
351 file. For example, use \"ypcat passwd\" to obtain the NIS password file."
352 :type '(choice (boolean) (string))
353 :group 'mh-alias)
354
355 (defcustom mh-alias-local-users-prefix "local."
356 "*String prepended to the real names of users from the password file.
357 This option can also be set to `Use Login'.
358
359 For example, consider the following password file entry:
360
361 psg:x:1000:1000:Peter S Galbraith,,,:/home/psg:/bin/tcsh
362
363 The following settings of this option will produce the associated aliases:
364
365 \"local.\" local.peter.galbraith
366 \"\" peter.galbraith
367 Use Login psg
368
369 This option has no effect if variable `mh-alias-local-users' is turned off."
370 :type '(choice (const :tag "Use Login" nil)
371 (string))
372 :group 'mh-alias)
373
374 (defcustom mh-alias-passwd-gecos-comma-separator-flag t
375 "*Non-nil means the gecos field in the password file uses a comma separator.
376 In the example in `mh-alias-local-users-prefix', commas are used to separate
377 different values within the so-called gecos field. This is a fairly common
378 usage. However, in the rare case that the gecos field in your password file is
379 not separated by commas and whose contents may contain commas, you can turn
380 this option off."
381 :type 'boolean
382 :group 'mh-alias)
383
384 \f
385
386 ;;; Organizing Your Mail with Folders (:group 'mh-folder)
387
388 (defcustom mh-recenter-summary-flag nil
389 "*Non-nil means to recenter the summary window.
390 If this option is turned on, recenter the summary window when the show window
391 is toggled off."
392 :type 'boolean
393 :group 'mh-folder)
394
395 \f
396
397 ;;; Folder Selection (:group 'mh-folder-selection)
398
399 (defcustom mh-default-folder-for-message-function nil
400 "Function to select a default folder for refiling or `Fcc'.
401 The current buffer is set to the message being refiled with point at the start
402 of the message. This function should return the default folder as a string
403 with a leading `+' sign. It can also return nil so that the last folder name
404 is used as the default, or an empty string to suppress the default entirely."
405 :type 'function
406 :group 'mh-folder-selection)
407
408 (defcustom mh-default-folder-list nil
409 "*List of addresses and folders.
410 The folder name associated with the first address found in this list is used
411 as the default for `mh-refile-msg' and similar functions. Each element in this
412 list contains a `Check Recipient' item. If this item is turned on, then the
413 address is checked against the recipient instead of the sender. This is useful
414 for mailing lists.
415
416 See `mh-prompt-for-refile-folder' and `mh-folder-from-address' for more
417 information."
418 :type '(repeat (list (regexp :tag "Address")
419 (string :tag "Folder")
420 (boolean :tag "Check Recipient")))
421 :group 'mh-folder-selection)
422
423 (defcustom mh-default-folder-must-exist-flag t
424 "*Non-nil means guessed folder name must exist to be used.
425 If the derived folder does not exist, and this option is on, then the last
426 folder name used is suggested. This is useful if you get mail from various
427 people for whom you have an alias, but file them all in the same project
428 folder.
429
430 See `mh-prompt-for-refile-folder' and `mh-folder-from-address' for more
431 information."
432 :type 'boolean
433 :group 'mh-folder-selection)
434
435 (defcustom mh-default-folder-prefix ""
436 "*Prefix used for folder names generated from aliases.
437 The prefix is used to prevent clutter in your mail directory.
438
439 See `mh-prompt-for-refile-folder' and `mh-folder-from-address' for more
440 information."
441 :type 'string
442 :group 'mh-folder-selection)
443
444 \f
445
446 ;;; Identities (:group 'mh-identity)
447
448 (defcustom mh-identity-list nil
449 "*List of identities.
450
451 Each element consists of an identity label, and a collection of header fields
452 and a signature to insert if the identity is selected (see
453 `mh-identity-default', `mh-insert-identity' and the `Identity' menu in a
454 MH-Letter buffer). The `Value Menu' contains the common header fields `From'
455 and `Organization'. Other header fields may be added using the `Other Field'
456 menu item. The `Signature' menu item is used to insert a signature with
457 `mh-insert-signature'. The `GPG Key ID' menu item is used to specify a
458 different key to sign or encrypt messages."
459 :type '(repeat (list :tag ""
460 (string :tag "Label")
461 (repeat :tag "Add at least one item below"
462 (choice
463 (cons :tag "From Field"
464 (const "From")
465 (string :tag "Value"))
466 (cons :tag "Organization Field"
467 (const "Organization")
468 (string :tag "Value"))
469 (cons :tag "Other Field"
470 (string :tag "Field")
471 (string :tag "Value"))
472 (cons :tag "Attribution Verb"
473 (const ":attribution-verb")
474 (string :tag "Value"))
475 (cons :tag "Signature"
476 (const :tag "Signature"
477 ":signature")
478 (choice
479 (const :tag "mh-signature-file-name"
480 nil)
481 (file)
482 (function)))
483 (cons :tag "GPG Key ID"
484 (const :tag "GPG Key ID"
485 ":pgg-default-user-id")
486 (string :tag "Value"))))))
487 :set 'mh-identity-list-set
488 :group 'mh-identity)
489
490 (defcustom mh-auto-fields-list nil
491 "List of recipients for which header lines are automatically inserted.
492 Each element consists of the recipient, which is a regular expression, and a
493 collection of header fields and identities to insert if the message is sent to
494 this recipient. The `Value Menu' contains the common header fields `Fcc' and
495 `Mail-Followup-To'. Other header fields may be added using the `Other Field'
496 menu item. The `Identity' menu item is used to insert entire identities with
497 `mh-insert-identity'."
498 :type `(repeat
499 (list :tag ""
500 (string :tag "Recipient")
501 (repeat :tag "Add at least one item below"
502 (choice
503 (cons :tag "Identity"
504 (const ":identity")
505 ,(append
506 '(radio)
507 (mapcar
508 (function (lambda (arg) `(const ,arg)))
509 (mapcar 'car mh-identity-list))))
510 (cons :tag "Fcc Field"
511 (const "fcc")
512 (string :tag "Value"))
513 (cons :tag "Mail-Followup-To Field"
514 (const "Mail-Followup-To")
515 (string :tag "Value"))
516 (cons :tag "Other Field"
517 (string :tag "Field")
518 (string :tag "Value"))))))
519 :group 'mh-identity)
520
521 (defcustom mh-auto-fields-prompt-flag t
522 "*Non-nil means to prompt before sending if fields inserted.
523 See `mh-auto-fields-list'."
524 :type 'boolean
525 :group 'mh-identity)
526
527 (defcustom mh-identity-default nil
528 "Default identity to use when `mh-letter-mode' is called."
529 :type (append
530 '(radio)
531 (cons '(const :tag "None" nil)
532 (mapcar (function (lambda (arg) `(const ,arg)))
533 (mapcar 'car mh-identity-list))))
534 :group 'mh-identity)
535
536 (defcustom mh-identity-handlers
537 '((":default" . mh-identity-handler-bottom)
538 ("from" . mh-identity-handler-top)
539 (":attribution-verb" . mh-identity-handler-attribution-verb)
540 (":signature" . mh-identity-handler-signature)
541 (":pgg-default-user-id" . mh-identity-handler-gpg-identity))
542 "Handler functions for fields in `mh-identity-list'.
543 This is an alist of fields (strings) and handlers (functions). Strings are
544 lowercase. Use \":signature\" for Signature and \":pgg-default-user-id\" for
545 GPG Key ID. The function associated with the string \":default\" is used if no
546 other functions are appropriate."
547 :type '(repeat (cons (string :tag "Field") function))
548 :group 'mh-identity)
549
550 \f
551
552 ;;; Incorporating Your Mail (:group 'mh-inc)
553
554 (defcustom mh-inc-prog "inc"
555 "*Program to run to incorporate new mail into a folder.
556 Normally \"inc\". This program is relative to the `mh-progs' directory unless
557 it is an absolute pathname."
558 :type 'string
559 :group 'mh-inc)
560
561 (defcustom mh-inc-spool-list nil
562 "*Alist of alternate spool files, corresponding folders and keybindings.
563 This option will be described by example.
564
565 Suppose you have subscribed to the mh-e-devel mailing list and you use
566 procmail to filter its mail into `~/mail/mh-e' with the following
567 `.procmailrc' recipe:
568
569 MAILDIR=$HOME/mail
570 :0:
571 * ^From mh-e-devel-admin@lists.sourceforge.net
572 mh-e
573
574 If you wanted to incorporate that spool file into an MH folder called mh-e
575 with the \"I m\" or \\[mh-inc-spool-mh-e] commands, you would use the
576 following:
577
578 Spool File: ~/mail/mh-e
579 Folder: mh-e
580 Key Binding: m
581
582 Then, you could also install `xbuffy' and configure an extra mailbox using the
583 gnuserv package to run the `mh-inc-spool-mh-e' command in Emacs:
584
585 box ~/mail/mh-e
586 title mh-e
587 origMode
588 polltime 10
589 headertime 0
590 command gnudoit -q '(mh-inc-spool-mh-e)'
591
592 To incorporate the spool file, click the xbuffy box with the middle mouse
593 button."
594 :type '(repeat (list (file :tag "Spool File")
595 (string :tag "Folder")
596 (character :tag "Key Binding")))
597 :set 'mh-inc-spool-list-set
598 :group 'mh-inc)
599
600 \f
601
602 ;;; Searching (:group 'mh-index)
603
604 (defcustom mh-index-new-messages-folders t
605 "Folders searched for the `unseen' sequence.
606 This option can be set to `Inbox' to search the `+inbox' folder or `All' to
607 search all of the top level folders. Otherwise, list the folders that should
608 be searched with the `Choose Folders' menu item.
609
610 See also `mh-recursive-folders-flag'."
611 :group 'mh-index
612 :type '(choice (const :tag "Inbox" t)
613 (const :tag "All" nil)
614 (repeat :tag "Choose Folders" (string :tag "Folder"))))
615
616 (defcustom mh-index-program nil
617 "Indexing program that MH-E shall use.
618 The default setting of this option is `Auto-detect' which means that MH-E will
619 automatically choose one of swish++, swish-e, mairix, namazu, pick and grep in
620 that order. If, for example, you have both swish++ and mairix installed and
621 you want to use mairix, then you can set this option to `mairix'.
622
623 More information about setting up an indexing program to use with MH-E can be
624 found in the documentation of `mh-index-search'."
625 :type '(choice (const :tag "Auto-detect" nil)
626 (const :tag "swish++" swish++)
627 (const :tag "swish-e" swish)
628 (const :tag "mairix" mairix)
629 (const :tag "namazu" namazu)
630 (const :tag "pick" pick)
631 (const :tag "grep" grep))
632 :group 'mh-index)
633
634 (defcustom mh-index-ticked-messages-folders t
635 "Folders searched for `mh-tick-seq'.
636 This option can be set to `Inbox' to search the `+inbox' folder or `All' to
637 search all of the top level folders. Otherwise, list the folders that should
638 be searched with the `Choose Folders' menu item.
639
640 See also `mh-recursive-folders-flag'."
641 :group 'mh-index
642 :type '(choice (const :tag "Inbox" t)
643 (const :tag "All" nil)
644 (repeat :tag "Choose Folders" (string :tag "Folder"))))
645
646 \f
647
648 ;;; Dealing with Junk Mail (:group 'mh-junk)
649
650 ;; Spam fighting program chosen
651 (defvar mh-junk-choice nil)
652
653 ;; Available spam filter interfaces
654 (defvar mh-junk-function-alist
655 '((spamassassin mh-spamassassin-blacklist mh-spamassassin-whitelist)
656 (bogofilter mh-bogofilter-blacklist mh-bogofilter-whitelist)
657 (spamprobe mh-spamprobe-blacklist mh-spamprobe-whitelist))
658 "Available choices of spam programs to use.
659 This is an alist. For each element there are functions that blacklist a message
660 as spam and whitelist a message incorrectly classified as spam.")
661
662 (defun mh-junk-choose (symbol value)
663 "Choose spam program to use.
664 The function is always called with SYMBOL bound to `mh-junk-program' and VALUE
665 bound to the new value of `mh-junk-program'. The function sets the variable
666 `mh-junk-choice' in addition to `mh-junk-program'."
667 (set symbol value)
668 (setq mh-junk-choice
669 (or value
670 (loop for element in mh-junk-function-alist
671 until (executable-find (symbol-name (car element)))
672 finally return (car element)))))
673
674 ;; User customizable variables
675 (defcustom mh-junk-disposition nil
676 "Disposition of junk mail."
677 :type '(choice (const :tag "Delete Spam" nil)
678 (string :tag "Spam Folder"))
679 :group 'mh-junk)
680
681 (defcustom mh-junk-program nil
682 "Spam program that MH-E should use.
683 The default setting of this option is `Auto-detect' which means that MH-E will
684 automatically choose one of SpamAssassin, Bogofilter, or SpamProbe in that
685 order. If, for example, you have both SpamAssassin and Bogofilter installed
686 and you want to use BogoFilter, then you can set this option to `Bogofilter'."
687 :type '(choice (const :tag "Auto-detect" nil)
688 (const :tag "SpamAssassin" spamassassin)
689 (const :tag "Bogofilter" bogofilter)
690 (const :tag "SpamProbe" spamprobe))
691 :set 'mh-junk-choose
692 :group 'mh-junk)
693
694 (defcustom mh-junk-background nil
695 "If on, spam programs are run in background.
696 By default, the programs are run in the foreground, but this can be slow when
697 junking large numbers of messages. If you have enough memory or don't junk
698 that many messages at the same time, you might try turning on this option."
699 :type '(choice (const :tag "Off" nil)
700 (const :tag "On" 0))
701 :group 'mh-junk)
702
703 \f
704
705 ;;; Editing a Draft (:group 'mh-letter)
706
707 (defcustom mh-mml-method-default (if mh-gnus-pgp-support-flag "pgpmime" "none")
708 "Default method to use in security directives."
709 :type '(choice (const :tag "PGP (MIME)" "pgpmime")
710 (const :tag "PGP" "pgp")
711 (const :tag "S/MIME" "smime")
712 (const :tag "None" "none"))
713 :group 'mh-letter)
714
715 (defcustom mh-compose-forward-as-mime-flag t
716 "Non-nil means that messages are forwarded as a MIME part."
717 :type 'boolean
718 :group 'mh-letter)
719
720 (defcustom mh-compose-insertion (if (locate-library "mml") 'gnus 'mhn)
721 "Type of MIME message directives in messages.
722
723 By default, this option is set to `Gnus' if it is supported. This option can
724 also be set manually to `mhn' if mhn directives are preferred."
725 :type '(choice (const :tag "Gnus" gnus)
726 (const :tag "mhn" mhn))
727 :group 'mh-letter)
728
729 (defcustom mh-compose-skipped-header-fields
730 '("From" "Organization" "References" "In-Reply-To"
731 "X-Face" "Face" "X-Image-URL" "X-Mailer")
732 "List of header fields to skip over when navigating in draft."
733 :type '(repeat (string :tag "Field"))
734 :group 'mh-letter)
735
736 (defcustom mh-compose-space-does-completion-flag nil
737 "*Non-nil means that <SPC> does completion in message header."
738 :type 'boolean
739 :group 'mh-letter)
740
741 (defcustom mh-delete-yanked-msg-window-flag nil
742 "*Non-nil means delete any window displaying the message.
743 If this option is on, yanking the current message into a draft letter with
744 \\<mh-letter-mode-map>\\[mh-yank-cur-msg] deletes any windows displaying the
745 message."
746 :type 'boolean
747 :group 'mh-letter)
748
749 (defcustom mh-extract-from-attribution-verb "wrote:"
750 "*Verb to use for attribution when a message is yanked by \\<mh-letter-mode-map>\\[mh-yank-cur-msg]."
751 :type '(choice (const "wrote:")
752 (const "a écrit:")
753 (const "schrieb:")
754 (string :tag "Custom String"))
755 :group 'mh-letter)
756
757 (defcustom mh-ins-buf-prefix "> "
758 "*String to put before each non-blank line of a yanked or inserted message.
759 Used when the message is inserted into an outgoing letter
760 by \\<mh-letter-mode-map>\\[mh-insert-letter] or \\[mh-yank-cur-msg]."
761 :type 'string
762 :group 'mh-letter)
763
764 (defcustom mh-insert-x-mailer-flag t
765 "*Non-nil means append an X-Mailer field to the header."
766 :type 'boolean
767 :group 'mh-letter)
768
769 (defcustom mh-letter-complete-function 'ispell-complete-word
770 "*Function to call when completing outside of address or folder fields.
771 By default, this is set to `ispell-complete-word'."
772 :type '(choice function (const nil))
773 :group 'mh-letter)
774
775 (defcustom mh-letter-fill-column 72
776 "*Fill column to use in `mh-letter-mode'.
777 This is usually less than in other text modes because email messages get
778 quoted by some prefix (sometimes many times) when they are replied to,
779 and it's best to avoid quoted lines that span more than 80 columns."
780 :type 'integer
781 :group 'mh-letter)
782
783 (defcustom mh-reply-show-message-flag t
784 "*Non-nil means the show buffer is displayed using \\<mh-letter-mode-map>\\[mh-reply].
785
786 The setting of this variable determines whether the MH `show-buffer' is
787 displayed with the current message when using `mh-reply' without a prefix
788 argument. Set it to nil if you already include the message automatically
789 in your draft using
790 repl: -filter repl.filter
791 in your ~/.mh_profile file."
792 :type 'boolean
793 :group 'mh-letter)
794
795 (defcustom mh-signature-file-name "~/.signature"
796 "*Source of user's signature.
797
798 By default, the text of your signature is taken from the file `~/.signature'.
799 You can read from other files by changing this option. This file may contain a
800 vCard in which case an attachment is added with the vCard.
801
802 This option may also be a symbol, in which case that function is called. You
803 may not want a signature separator to be added for you; instead you may want
804 to insert one yourself. Variables that you may find useful to do this include
805 `mh-signature-separator' (when inserting a signature separator) and
806 `mh-signature-separator-regexp' (for finding said separator). The function
807 `mh-signature-separator-p', which reports t if the buffer contains a
808 separator, may be useful as well.
809
810 The signature is inserted into your message with the command
811 \\<mh-letter-mode-map>\\[mh-insert-signature] or with the `mh-identity-list'
812 option."
813 :type 'file
814 :group 'mh-letter)
815
816 (defcustom mh-signature-separator-flag t
817 "*Non-nil means a signature separator should be inserted.
818 It is not recommended that you change this option since various mail user
819 agents, including MH-E, use the separator to present the signature
820 differently, and to suppress the signature when replying or yanking a letter
821 into a draft."
822 :type 'boolean
823 :group 'mh-letter)
824
825 (defcustom mh-x-face-file "~/.face"
826 "*File containing face header field to insert in outgoing mail.
827
828 If the file starts with either of the strings `X-Face:', `Face:' or
829 `X-Image-URL:' then the contents are added to the message header verbatim.
830 Otherwise it is assumed that the file contains the value of the `X-Face:'
831 header field.
832
833 The `X-Face:' header field, which is a low-resolution, black and white image,
834 can be generated using the `compface' command, which can be obtained from
835 ftp://ftp.cs.indiana.edu/pub/faces/compface/compface.tar.Z. The \"Online
836 X-Face Convertor\" at http://www.dairiki.org/xface/ is a useful resource for
837 quick conversion of images into `X-Face:' header fields.
838
839 Use the `make-face' script (http://quimby.gnus.org/circus/face/make-face) to
840 convert a JPEG image to the higher resolution, color, `Face:' header field.
841
842 The URL of any image can be used for the `X-Image-URL:' field and no
843 processing of the image is required.
844
845 To prevent the setting of any of these header fields, either set
846 `mh-x-face-file' to nil, or simply ensure that the file defined by this option
847 doesn't exist."
848 :type 'file
849 :group 'mh-letter)
850
851 (defcustom mh-yank-from-start-of-msg 'attribution
852 "*Controls which part of a message is yanked by \\<mh-letter-mode-map>\\[mh-yank-cur-msg].
853 If t, include the entire message, with full headers. This is historically
854 here for use with supercite, but is now deprecated in favor of the setting
855 `supercite' below.
856
857 If the symbol `body', then yank the message minus the header.
858
859 If the symbol `supercite', include the entire message, with full headers.
860 This also causes the invocation of `sc-cite-original' without the setting
861 of `mail-citation-hook', now deprecated practice.
862
863 If the symbol `autosupercite', do as for `supercite' automatically when
864 show buffer matches the message being replied-to. When this option is used,
865 the -noformat switch is passed to the repl program to override a -filter or
866 -format switch.
867
868 If the symbol `attribution', then yank the message minus the header and add
869 a simple attribution line at the top.
870
871 If the symbol `autoattrib', do as for `attribution' automatically when show
872 buffer matches the message being replied-to. You can make sure this is
873 always the case by setting `mh-reply-show-message-flag' to t (which is the
874 default) and optionally `mh-delete-yanked-msg-window-flag' to t as well such
875 that the show window is never displayed. When the `autoattrib' option is
876 used, the -noformat switch is passed to the repl program to override a
877 -filter or -format switch.
878
879 If nil, yank only the portion of the message following the point.
880
881 If the show buffer has a region, this variable is ignored unless its value is
882 one of `attribution' or `autoattrib' in which case the attribution is added
883 to the yanked region."
884 :type '(choice (const :tag "Below point" nil)
885 (const :tag "Without header" body)
886 (const :tag "Invoke supercite" supercite)
887 (const :tag "Invoke supercite, automatically" autosupercite)
888 (const :tag "Without header, with attribution" attribution)
889 (const :tag "Without header, with attribution, automatically"
890 autoattrib)
891 (const :tag "Entire message with headers" t))
892 :group 'mh-letter)
893
894 \f
895
896 ;;; Ranges (:group 'mh-ranges)
897
898 (defcustom mh-interpret-number-as-range-flag t
899 "Non-nil means interpret a number as a range.
900 If the variable is non-nil, and you use an integer, N, when asked for a
901 range to scan, then MH-E uses the range \"last:N\"."
902 :type 'boolean
903 :group 'mh-ranges)
904
905 \f
906
907 ;;; Scan Line Formats (:group 'mh-scan-line-formats)
908
909 (defcustom mh-adaptive-cmd-note-flag t
910 "*Non-nil means that the message number width is determined dynamically.
911 This is done once when a folder is first opened by running scan on the last
912 message of the folder. The message number for the last message is extracted
913 and its width calculated. This width is used when calling `mh-set-cmd-note'.
914
915 If you prefer fixed-width message numbers, set this variable to nil and call
916 `mh-set-cmd-note' with the width specified by the scan format in
917 `mh-scan-format-file'. For example, the default width is 4, so you would use
918 \"(mh-set-cmd-note 4)\" if `mh-scan-format-file' were nil."
919 :type 'boolean
920 :group 'mh-scan-line-formats)
921
922 (defcustom mh-scan-format-file t
923 "Specifies the format file to pass to the scan program.
924 If t, the format string will be taken from the either `mh-scan-format-mh'
925 or `mh-scan-format-nmh' depending on whether MH or nmh is in use.
926 If nil, the default scan output will be used.
927
928 If you customize the scan format, you may need to modify a few variables
929 containing regexps that MH-E uses to identify specific portions of the output.
930 Use `M-x apropos RET mh-scan.*regexp' to obtain a list of these variables. You
931 may also have to call `mh-set-cmd-note' with the width of your message
932 numbers. See also `mh-adaptive-cmd-note-flag'."
933 :type '(choice (const :tag "Use MH-E scan Format" t)
934 (const :tag "Use Default scan Format" nil)
935 (file :tag "Specify a scan Format File"))
936 :group 'mh-scan-line-formats)
937
938 (defcustom mh-scan-prog "scan"
939 "*Program to run to generate one-line-per-message listing of a folder.
940 Normally \"scan\" or a file name linked to scan. This file is searched
941 for relative to the `mh-progs' directory unless it is an absolute pathname."
942 :type 'string
943 :group 'mh-scan-line-formats)
944 (make-variable-buffer-local 'mh-scan-prog)
945
946 \f
947
948 ;;; Sending Mail (:group 'mh-sending-mail)
949
950 (defcustom mh-compose-letter-function nil
951 "Invoked when setting up a letter draft.
952 It is passed three arguments: TO recipients, SUBJECT, and CC recipients."
953 :type '(choice (const nil) function)
954 :group 'mh-sending-mail)
955
956 (defcustom mh-compose-prompt-flag nil
957 "*Non-nil means prompt for header fields when composing a new draft."
958 :type 'boolean
959 :group 'mh-sending-mail)
960
961 (defcustom mh-forward-subject-format "%s: %s"
962 "*Format to generate the Subject: line contents for a forwarded message.
963 The two string arguments to the format are the sender of the original
964 message and the original subject line."
965 :type 'string
966 :group 'mh-sending-mail)
967
968 (defcustom mh-reply-default-reply-to nil
969 "*Sets the person or persons to whom a reply will be sent.
970 If nil, prompt for recipient. If non-nil, then \\<mh-folder-mode-map>`\\[mh-reply]' will use this
971 value and it should be one of \"from\", \"to\", \"cc\", or \"all\".
972 The values \"cc\" and \"all\" do the same thing."
973 :type '(choice (const :tag "Prompt" nil)
974 (const "from") (const "to")
975 (const "cc") (const "all"))
976 :group 'mh-sending-mail)
977
978 \f
979
980 ;;; Sequences (:group 'mh-sequences)
981
982 ;;; If `mh-unpropagated-sequences' becomes a defcustom, add the following to
983 ;;; the docstring: "Additional sequences that should not to be preserved can be
984 ;;; specified by setting `mh-unpropagated-sequences' appropriately." XXX
985
986 (defcustom mh-refile-preserves-sequences-flag t
987 "*Non-nil means that sequences are preserved when messages are refiled.
988 If this variable is non-nil and a message belonging to a sequence other than
989 cur or Previous-Sequence (see mh-profile 5) is refiled then it is put in the
990 same sequence in the destination folder."
991 :type 'boolean
992 :group 'mh-sequences)
993
994 (defcustom mh-tick-seq 'tick
995 "The name of the MH sequence for ticked messages.
996 You would change this option if you already use the `tick' sequence for your
997 own use. You can also disable all of the ticking functions by choosing the
998 `Disable Ticking' item but there isn't much advantage to that."
999 :type '(choice (const :tag "Disable Ticking" nil)
1000 symbol)
1001 :group 'mh-sequences)
1002
1003 (defcustom mh-update-sequences-after-mh-show-flag t
1004 "*Non-nil means flush MH sequences to disk after message is shown.
1005 Three sequences are maintained internally by MH-E and pushed out to MH when a
1006 message is shown. They include the sequence specified by your
1007 `Unseen-Sequence:' profile entry, `cur', and the sequence listed by
1008 the `mh-tick-seq' option which is `tick' by default.
1009 If you do not like this behavior, set this option to nil. You can then update
1010 the state manually with the \\<mh-folder-mode-map>`\\[mh-execute-commands]', `\\[mh-quit]', or `\\[mh-update-sequences]' commands."
1011 :type 'boolean
1012 :group 'mh-sequences)
1013
1014 \f
1015
1016 ;;; Reading Your Mail (:group 'mh-show)
1017
1018 (defcustom mh-bury-show-buffer-flag t
1019 "*Non-nil means that the displayed show buffer for a folder is buried."
1020 :type 'boolean
1021 :group 'mh-show)
1022
1023 (defcustom mh-clean-message-header-flag t
1024 "*Non-nil means remove extraneous header fields.
1025 The header fields listed in the `mh-invisible-header-fields-default' option
1026 are hidden, although you can check off any field that you would like to see.
1027 Header fields that you would like to hide that aren't listed can be added to
1028 the `mh-invisible-header-fields' option."
1029 :type 'boolean
1030 :group 'mh-show)
1031
1032 (defcustom mh-decode-mime-flag (not (not (locate-library "mm-decode")))
1033 "*Non-nil means that Gnus is used to show MIME attachments with Gnus."
1034 :type 'boolean
1035 :group 'mh-show)
1036
1037 (defcustom mh-display-buttons-for-alternatives-flag nil
1038 "*Non-nil means display buttons for all MIME alternatives.
1039 Default behavior is to display only the preferred alternative. If this
1040 variable is non-nil, then the preferred part is shown inline and buttons
1041 are shown for each of the other alternatives."
1042 :type 'boolean
1043 :group 'mh-show)
1044
1045 (defcustom mh-display-buttons-for-inline-parts-flag nil
1046 "*Non-nil means display buttons for all inline MIME parts.
1047 If non-nil, buttons are displayed for all MIME parts. Inline parts start off
1048 in displayed state but they can be hidden by clicking the button. If nil no
1049 buttons are shown for inline parts."
1050 :type 'boolean
1051 :group 'mh-show)
1052
1053 (defcustom mh-do-not-confirm-flag nil
1054 "*Non-nil means do not prompt for confirmation.
1055 Commands such as `mh-pack-folder' prompt to confirm whether to process
1056 outstanding moves and deletes or not before continuing. A non-nil setting will
1057 perform the action--which is usually desired but cannot be retracted--without
1058 question."
1059 :type 'boolean
1060 :group 'mh-show)
1061
1062 (defcustom mh-fetch-x-image-url 'ask
1063 "*Control fetching of `X-Image-URL:' header field image.
1064 If set to \"Always fetch\" (t), the image is always fetched. You probably want
1065 to avoid this setting for privacy and DOS (denial of service) reasons. For
1066 example, fetching a URL can tip off a spammer that you've read his email.
1067 Someone may also flood your network and fill your disk drive by sending a
1068 torrent of messages, each specifying a unique URL to a very large file.
1069
1070 If set to \"Ask before fetching\" ('ask), you are prompted before the image is
1071 fetched. MH-E will remember your reply and will either use the already fetched
1072 image the next time the same URL is encountered or silently skip it if you
1073 didn't fetch it the first time. This is the default.
1074
1075 If set to \"Never fetch\" (nil), images are never fetched and only displayed
1076 if they are already present in the cache.
1077
1078 The cache of images is found in the directory `.mhe-x-image-cache' within your
1079 MH directory. To see how you can add your own face to the `From:' field, see
1080 `mh-x-face-file'.
1081
1082 This setting only has effect if `mh-show-use-xface-flag' is non-nil."
1083
1084 :type '(choice (const :tag "Always fetch" t)
1085 (const :tag "Ask before fetching" ask)
1086 (const :tag "Never fetch" nil))
1087 :group 'mh-show)
1088
1089 (defcustom mh-graphical-smileys-flag t
1090 "*Non-nil means graphical smileys are displayed.
1091 Non-nil means that small graphics will be used in the show buffer instead of
1092 patterns like :-), ;-) etc. The setting only has effect if
1093 `mh-decode-mime-flag' is non-nil."
1094 :type 'boolean
1095 :group 'mh-show)
1096
1097 (defcustom mh-graphical-emphasis-flag t
1098 "*Non-nil means graphical emphasis is displayed.
1099 Non-nil means that _underline_ will be underlined, *bold* will appear in bold,
1100 /italic/ will appear in italic etc. See `gnus-emphasis-alist' for the whole
1101 list. The setting only has effect if `mh-decode-mime-flag' is non-nil."
1102 :type 'boolean
1103 :group 'mh-show)
1104
1105 (defcustom mh-highlight-citation-p 'gnus
1106 "How to highlight citations in show buffers.
1107 The gnus method uses a different color for each indentation."
1108 :type '(choice (const :tag "Use Gnus" gnus)
1109 (const :tag "Use font-lock" font-lock)
1110 (const :tag "Don't fontify" nil))
1111 :group 'mh-show)
1112
1113 ;; Keep fields alphabetized. Mention source, if known.
1114 (defvar mh-invisible-header-fields-internal
1115 '("Approved:"
1116 "Autoforwarded:"
1117 "Bestservhost:"
1118 "Cancel-Lock:" ; NNTP posts
1119 "Content-" ; RFC 2045
1120 "Delivered-To:" ; Egroups/yahoogroups mailing list manager
1121 "Delivery-Date:" ; MH
1122 "Delivery:"
1123 "Encoding:"
1124 "Envelope-to:"
1125 "Errors-To:"
1126 "Face:" ; Gnus Face header
1127 "Forwarded:" ; MH
1128 "From " ; sendmail
1129 "Importance:" ; MS Outlook
1130 "In-Reply-To:" ; MH
1131 "Lines:"
1132 "List-" ; Mailman mailing list manager
1133 "List-" ; Unknown mailing list managers
1134 "List-Subscribe:" ; Unknown mailing list managers
1135 "List-Unsubscribe:" ; Unknown mailing list managers
1136 "Mail-from:" ; MH
1137 "Mailing-List:" ; Egroups/yahoogroups mailing list manager
1138 "Message-Id:" ; RFC 822
1139 "Mime-Version" ; RFC 2045
1140 "NNTP-" ; News
1141 "Old-Return-Path:"
1142 "Original-Encoded-Information-Types:" ; X400
1143 "Original-Lines:" ; mail to news
1144 "Original-NNTP-" ; mail to news
1145 "Original-Newsgroups:" ; mail to news
1146 "Original-Path:" ; mail to news
1147 "Original-Received:" ; mail to news
1148 "Original-To:" ; mail to news
1149 "Original-X-" ; mail to news
1150 "Originator:"
1151 "P1-Content-Type:" ; X400
1152 "P1-Message-Id:" ; X400
1153 "P1-Recipient:" ; X400
1154 "Path:"
1155 "Precedence:"
1156 "Prev-Resent" ; MH
1157 "Priority:"
1158 "Received:" ; RFC 822
1159 "References:"
1160 "Remailed-" ; MH
1161 "Replied:" ; MH
1162 "Resent" ; MH
1163 "Return-Path:" ; RFC 822
1164 "Sensitivity:" ; MS Outlook
1165 "Status:" ; sendmail
1166 "Thread-"
1167 "Ua-Content-Id:" ; X400
1168 ;; "User-Agent:" ; Similar to X-Mailer, so display it.
1169 "Via:" ; MH
1170 "X-Abuse-Info:"
1171 "X-Abuse-and-DMCA-"
1172 "X-Accept-Language:"
1173 "X-Accept-Language:" ; Netscape/Mozilla
1174 "X-Ack:"
1175 "X-Administrivia-To:"
1176 "X-AntiAbuse:" ; cPanel
1177 "X-Apparently-From:" ; MS Outlook
1178 "X-Apparently-To:" ; Egroups/yahoogroups mailing list manager
1179 "X-Authentication-Warning:" ; sendmail
1180 "X-Beenthere:" ; Mailman mailing list manager
1181 "X-Bogosity:" ; bogofilter
1182 "X-Complaints-To:"
1183 "X-Cron-Env:"
1184 "X-DMCA"
1185 "X-Delivered"
1186 "X-ELNK-Trace:" ; Earthlink mailer
1187 "X-Envelope-Date:" ; GNU mailutils
1188 "X-Envelope-From:"
1189 "X-Envelope-Sender:"
1190 "X-Envelope-To:"
1191 "X-Face:"
1192 "X-Folder:" ; Spam
1193 "X-From-Line"
1194 "X-Gnus-Mail-Source:" ; gnus
1195 "X-Greylist:" ; milter-greylist-1.2.1
1196 "X-Habeas-SWE-1:" ; Spam
1197 "X-Habeas-SWE-2:" ; Spam
1198 "X-Habeas-SWE-3:" ; Spam
1199 "X-Habeas-SWE-4:" ; Spam
1200 "X-Habeas-SWE-5:" ; Spam
1201 "X-Habeas-SWE-6:" ; Spam
1202 "X-Habeas-SWE-7:" ; Spam
1203 "X-Habeas-SWE-8:" ; Spam
1204 "X-Habeas-SWE-9:" ; Spam
1205 "X-Image-URL:" ; URL equivalent of X-Face and Face
1206 "X-Info:" ; NTMail
1207 "X-Juno-" ; Juno
1208 "X-List-Host:" ; Unknown mailing list managers
1209 "X-List-Subscribe:" ; Unknown mailing list managers
1210 "X-List-Unsubscribe:" ; Unknown mailing list managers
1211 "X-Listprocessor-" ; ListProc(tm) by CREN
1212 "X-Listserver:" ; Unknown mailing list managers
1213 "X-Loop:" ; Unknown mailing list managers
1214 "X-MHE-Checksum" ; Checksum added during index search
1215 "X-MIME-Autoconverted:" ; sendmail
1216 "X-MIMETrack:"
1217 "X-Mms-" ; T-Mobile pictures
1218 "X-MS-" ; MS Outlook
1219 "X-MailScanner" ; ListProc(tm) by CREN
1220 "X-Mailing-List:" ; Unknown mailing list managers
1221 "X-Mailman-Version:" ; Mailman mailing list manager
1222 "X-Majordomo:" ; Majordomo mailing list manager
1223 "X-Message-Id"
1224 "X-MessageWall-Score:" ; Unknown mailing list manager, AUC TeX
1225 "X-MimeOLE:" ; MS Outlook
1226 "X-Mozilla-Status:" ; Netscape/Mozilla
1227 "X-Msmail-" ; MS Outlook
1228 "X-NAI-Spam-" ; Network Associates Inc. SpamKiller
1229 "X-News:" ; News
1230 "X-No-Archive:"
1231 "X-Notes-Item:" ; Lotus Notes Domino structured header
1232 "X-OperatingSystem:"
1233 ;;"X-Operator:" ; Similar to X-Mailer, so display it
1234 "X-Orcl-Content-Type:"
1235 "X-Original-Complaints-To:"
1236 "X-Original-Date:" ; SourceForge mailing list manager
1237 "X-Original-To:"
1238 "X-Original-Trace:"
1239 "X-OriginalArrivalTime:" ; Hotmail
1240 "X-Originating-IP:" ; Hotmail
1241 "X-Postfilter:"
1242 "X-Priority:" ; MS Outlook
1243 "X-Qotd-" ; User added
1244 "X-RM"
1245 "X-Received-Date:"
1246 "X-Received:"
1247 "X-Request-"
1248 "X-SBClass:" ; Spam
1249 "X-SBNote:" ; Spam
1250 "X-SBPass:" ; Spam
1251 "X-SBRule:" ; Spam
1252 "X-SMTP-"
1253 "X-Scanned-By"
1254 "X-Sender:"
1255 "X-Server-Date:"
1256 "X-Server-Uuid:"
1257 "X-Sieve:" ; Sieve filtering
1258 "X-Source"
1259 "X-Spam-" ; Spamassassin
1260 "X-SpamBouncer:" ; Spam
1261 "X-Status"
1262 "X-Submissions-To:"
1263 "X-Telecom-Digest"
1264 "X-Trace:"
1265 "X-UID"
1266 "X-UIDL:"
1267 "X-UserInfo1:"
1268 "X-VSMLoop:" ; NTMail
1269 "X-Vms-To:"
1270 "X-WebTV-Signature:"
1271 "X-Wss-Id:" ; Worldtalk gateways
1272 "X-Yahoo"
1273 "X-eGroups-" ; Egroups/yahoogroups mailing list manager
1274 "X-pgp:"
1275 "X-submission-address:"
1276 "X400-" ; X400
1277 "Xref:")
1278 "List of default header fields that are not to be shown.
1279 Do not alter this variable directly. Instead, add entries from here that you
1280 would like to be displayed in `mh-invisible-header-fields-default'
1281 and add entries to hide in `mh-invisible-header-fields'.")
1282
1283 (defvar mh-invisible-header-fields-compiled nil
1284 "*Regexp matching lines in a message header that are not to be shown.
1285 Do not alter this variable directly. Instead, customize
1286 `mh-invisible-header-fields-default' checking for fields normally
1287 hidden that you wish to display, and add extra entries to hide in
1288 `mh-invisible-header-fields'.")
1289
1290 (defun mh-invisible-headers ()
1291 "Make or remake the variable `mh-invisible-header-fields-compiled'.
1292 Done using `mh-invisible-header-fields-internal' as input, from which entries
1293 from `mh-invisible-header-fields-default' are removed and entries
1294 from `mh-invisible-header-fields' are added."
1295 (let ((fields mh-invisible-header-fields-internal))
1296 (when mh-invisible-header-fields-default
1297 ;; Remove entries from `mh-invisible-header-fields-default'
1298 (setq fields
1299 (loop for x in fields
1300 unless (member x mh-invisible-header-fields-default)
1301 collect x)))
1302 (when (and (boundp 'mh-invisible-header-fields)
1303 mh-invisible-header-fields)
1304 (dolist (x mh-invisible-header-fields)
1305 (unless (member x fields) (setq fields (cons x fields)))))
1306 (if fields
1307 (setq mh-invisible-header-fields-compiled
1308 (concat
1309 "^"
1310 ;; workaround for insufficient default
1311 (let ((max-specpdl-size 1000))
1312 (regexp-opt fields t))))
1313 (setq mh-invisible-header-fields-compiled nil))))
1314
1315 (defcustom mh-invisible-header-fields-default nil
1316 "*List of hidden header fields.
1317 The header fields listed in this option are hidden, although you can check off
1318 any field that you would like to see. Header fields that you would like to
1319 hide that aren't listed can be added to the `mh-invisible-header-fields'
1320 option.
1321
1322 See also `mh-clean-message-header-flag'."
1323 :type `(set ,@(mapcar (lambda (x) `(const ,x))
1324 mh-invisible-header-fields-internal))
1325 :set (lambda (symbol value)
1326 (set-default symbol value)
1327 (mh-invisible-headers))
1328 :group 'mh-show)
1329
1330 (defcustom mh-invisible-header-fields nil
1331 "*Additional header fields to hide.
1332 Header fields that you would like to hide that aren't listed in
1333 `mh-invisible-header-fields-default' can be added to this option with a couple
1334 of caveats. Regular expressions are not allowed. Unique fields should have a
1335 `:' suffix; otherwise, the element can be used to render invisible an entire
1336 class of fields that start with the same prefix.
1337
1338 See also `mh-clean-message-header-flag'."
1339
1340 :type '(repeat (string :tag "Header field"))
1341 :set (lambda (symbol value)
1342 (set-default symbol value)
1343 (mh-invisible-headers))
1344 :group 'mh-show)
1345
1346 (defcustom mh-lpr-command-format "lpr -J '%s'"
1347 "*Format for Unix command that prints a message.
1348 The string should be a Unix command line, with the string '%s' where
1349 the job's name (folder and message number) should appear. The formatted
1350 message text is piped to this command when you type \\<mh-folder-mode-map>`\\[mh-print-msg]'."
1351 :type 'string
1352 :group 'mh-show)
1353
1354 (defcustom mh-max-inline-image-height nil
1355 "*Maximum inline image height if Content-Disposition is not present.
1356 If nil, image will be displayed if its height is smaller than the height of
1357 the window."
1358 :type '(choice (const nil) integer)
1359 :group 'mh-show)
1360
1361 (defcustom mh-max-inline-image-width nil
1362 "*Maximum inline image width if Content-Disposition is not present.
1363 If nil, image will be displayed if its width is smaller than the width of the
1364 window."
1365 :type '(choice (const nil) integer)
1366 :group 'mh-show)
1367
1368 (defcustom mh-mime-save-parts-default-directory t
1369 "Default directory to use for `mh-mime-save-parts'.
1370 If nil, prompt and set for next time the command is used during same session.
1371 If t, prompt always"
1372 :type '(choice (const :tag "Prompt the first time" nil)
1373 (const :tag "Prompt always" t)
1374 directory)
1375 :group 'mh-show)
1376
1377 (defcustom mh-print-background-flag nil
1378 "*Non-nil means messages should be printed in the background.
1379 WARNING: do not delete the messages until printing is finished;
1380 otherwise, your output may be truncated."
1381 :type 'boolean
1382 :group 'mh-show)
1383
1384 (defcustom mh-recursive-folders-flag nil
1385 "*Non-nil means that commands which operate on folders do so recursively."
1386 :type 'boolean
1387 :group 'mh-show)
1388
1389 (defcustom mh-show-maximum-size 0
1390 "*Maximum size of message (in bytes) to display automatically.
1391 Provides an opportunity to skip over large messages which may be slow to load.
1392 Use a value of 0 to display all messages automatically regardless of size."
1393 :type 'integer
1394 :group 'mh-show)
1395
1396 (defcustom mh-show-threads-flag nil
1397 "Non-nil means new folders start in threaded mode.
1398 Threading large number of messages can be time consuming. So if the flag is
1399 non-nil then threading will be done only if the number of messages being
1400 threaded is less than `mh-large-folder'."
1401 :type 'boolean
1402 :group 'mh-show)
1403
1404 ;; Use goto-addr if it was already loaded (which probably sets this
1405 ;; variable to t), or if this variable is otherwise set to t.
1406 (defcustom mh-show-use-goto-addr-flag (and (boundp 'goto-address-highlight-p)
1407 goto-address-highlight-p)
1408 "*Non-nil means highlight URLs and email addresses.
1409 The `goto-addr' module is used."
1410 :type 'boolean
1411 :group 'mh-show)
1412
1413 (defcustom mh-show-use-xface-flag (>= emacs-major-version 21)
1414 "*Non-nil means display face images in `mh-show-mode'.
1415
1416 MH-E can display the content of `Face:', `X-Face:', and `X-Image-URL:' header
1417 fields. If any of these fields occur in the header of your message, the
1418 sender's face will appear in the `From:' header field. If more than one of
1419 these fields appear, then the first field found in the order `Face:',
1420 `X-Face:', and `X-Image-URL:' will be used. Note that versions of GNU Emacs
1421 prior to 21.1 don't support the display of inline images, so face images are
1422 not displayed in these versions.
1423
1424 The option `mh-show-use-xface-flag' is used to turn this feature on and off.
1425 This feature will be turned on by default if your system supports it.
1426
1427 The first header field used, if present, is the Gnus-specific `Face:' field.
1428 The `Face:' field appeared in GNU Emacs 21 and XEmacs. For more information,
1429 see http://quimby.gnus.org/circus/face/. Next is the traditional `X-Face:'
1430 header field. The display of this field requires the `uncompface' program
1431 which can be obtained from
1432 ftp://ftp.cs.indiana.edu/pub/faces/compface/compface.tar.Z. Recent versions of
1433 XEmacs have internal support for `X-Face:' images. If your version of XEmacs
1434 does not, then you'll need both `uncompface' and the x-face package which is
1435 available at ftp://ftp.jpl.org/pub/elisp/.
1436
1437 Finally, MH-E will display images referenced by the `X-Image-URL:' header
1438 field if neither the `Face:' nor the `X-Face:' fields are present. The display
1439 of the images requires `wget' (available from
1440 http://www.gnu.org/software/wget/wget.html), `fetch', or `curl' to fetch the
1441 image and the `convert' program from the ImageMagick suite, available from
1442 http://www.imagemagick.org/. Of the three header fields this is the most
1443 efficient in terms of network usage since the image doesn't need to be
1444 transmitted with every single mail.
1445
1446 The option `mh-fetch-x-image-url' controls the fetching of the `X-Image-URL:'
1447 header field image."
1448 :type 'boolean
1449 :group 'mh-show)
1450
1451 (defcustom mh-store-default-directory nil
1452 "*Last directory used by \\[mh-store-msg]; default for next store.
1453 A directory name string, or nil to use current directory."
1454 :type '(choice (const :tag "Current" nil)
1455 directory)
1456 :group 'mh-show)
1457
1458 (defcustom mh-summary-height nil
1459 "*Number of lines in MH-Folder window (including the mode line)."
1460 :type '(choice (const :tag "Automatic" nil)
1461 (integer :tag "Fixed sized"))
1462 :group 'mh-show)
1463
1464 (defcustom mhl-formfile nil
1465 "*Name of format file to be used by mhl to show and print messages.
1466 A value of t means use the default format file.
1467 nil means don't use mhl to format messages when showing; mhl is still used,
1468 with the default format file, to format messages when printing them.
1469 The format used should specify a non-zero value for overflowoffset so
1470 the message continues to conform to RFC 822 and MH-E can parse the headers."
1471 :type '(choice (const nil) (const t) string)
1472 :group 'mh-show)
1473 (put 'mhl-formfile 'info-file "mh-e")
1474
1475 \f
1476
1477 ;;; The Speedbar (:group 'mh-speed)
1478
1479 (defcustom mh-large-folder 200
1480 "The number of messages that indicates a large folder.
1481 If a folder is deemed to be large, that is the number of messages in it exceed
1482 this value, then confirmation is needed when it is visited. Even when
1483 `mh-show-threads-flag' is non-nil, the folder is not automatically threaded, if
1484 it is large. If set to nil all folders are treated as if they are small."
1485 :type '(choice (const :tag "No limit") integer)
1486 :group 'mh-speed)
1487
1488 (defcustom mh-speed-flists-interval 60
1489 "Time between calls to flists in seconds.
1490 If 0, flists is not called repeatedly."
1491 :type 'integer
1492 :group 'mh-speed)
1493
1494 (defcustom mh-speed-run-flists-flag t
1495 "Non-nil means flists is used.
1496 If non-nil, flists is executed every `mh-speed-flists-interval' seconds to
1497 update the display of the number of unseen and total messages in each folder.
1498 If resources are limited, this can be set to nil and the speedbar display can
1499 be updated manually with the \\[mh-speed-flists] command."
1500 :type 'boolean
1501 :group 'mh-speed)
1502
1503 \f
1504
1505 ;;; The Toolbar (:group 'mh-toolbar)
1506
1507 (defcustom mh-tool-bar-search-function 'mh-search-folder
1508 "*Function called by the tool-bar search button.
1509 See `mh-search-folder' and `mh-index-search' for details."
1510 :type '(choice (const mh-search-folder)
1511 (const mh-index-search)
1512 (function :tag "Other function"))
1513 :group 'mh-toolbar)
1514
1515 ;; Functions called from the tool bar
1516 (defun mh-tool-bar-search (&optional arg)
1517 "Interactively call `mh-tool-bar-search-function'.
1518 Optional argument ARG is not used."
1519 (interactive "P")
1520 (call-interactively mh-tool-bar-search-function))
1521
1522 (defun mh-tool-bar-customize ()
1523 "Call `mh-customize' from the toolbar."
1524 (interactive)
1525 (mh-customize t))
1526
1527 (defun mh-tool-bar-folder-help ()
1528 "Visit \"(mh-e)Top\"."
1529 (interactive)
1530 (Info-goto-node "(mh-e)Top")
1531 (delete-other-windows))
1532
1533 (defun mh-tool-bar-letter-help ()
1534 "Visit \"(mh-e)Draft Editing\"."
1535 (interactive)
1536 (Info-goto-node "(mh-e)Draft Editing")
1537 (delete-other-windows))
1538
1539 (defmacro mh-tool-bar-reply-generator (function recipient folder-buffer-flag)
1540 "Generate FUNCTION that replies to RECIPIENT.
1541 If FOLDER-BUFFER-FLAG is nil then the function generated
1542 When INCLUDE-FLAG is non-nil, include message body being replied to."
1543 `(defun ,function (&optional arg)
1544 ,(format "Reply to \"%s\".\nWhen ARG is non-nil include message in reply."
1545 recipient)
1546 (interactive "P")
1547 ,(if folder-buffer-flag nil '(set-buffer mh-show-folder-buffer))
1548 (mh-reply (mh-get-msg-num nil) ,recipient arg)))
1549
1550 (mh-tool-bar-reply-generator mh-tool-bar-reply-from "from" t)
1551 (mh-tool-bar-reply-generator mh-show-tool-bar-reply-from "from" nil)
1552 (mh-tool-bar-reply-generator mh-tool-bar-reply-to "to" t)
1553 (mh-tool-bar-reply-generator mh-show-tool-bar-reply-to "to" nil)
1554 (mh-tool-bar-reply-generator mh-tool-bar-reply-all "all" t)
1555 (mh-tool-bar-reply-generator mh-show-tool-bar-reply-all "all" nil)
1556
1557 ;; XEmacs has a couple of extra customizations...
1558 (mh-do-in-xemacs
1559 (defcustom mh-xemacs-use-toolbar-flag (if (and (featurep 'toolbar)
1560 (featurep 'xpm)
1561 (device-on-window-system-p))
1562 t
1563 nil)
1564 "*If non-nil, use toolbar.
1565
1566 This will default to t if you are in an environment that supports
1567 toolbars and xpm."
1568 :type 'boolean
1569 :group 'mh-toolbar)
1570
1571 (defcustom mh-xemacs-toolbar-position (if mh-xemacs-use-toolbar-flag
1572 'default
1573 nil)
1574 "*Where to put the toolbar.
1575
1576 Valid non-nil values are \"default\", \"top\", \"bottom\", \"left\",
1577 \"right\". These match the four edges of the frame, with \"default\"
1578 meaning \"use the same position as the default-toolbar\".
1579
1580 A nil value means do not use a toolbar.
1581
1582 If this variable is set to anything other than \"default\" and the
1583 default-toolbar has a different positional setting from the value of
1584 this variable, then two toolbars will be displayed. The MH-E toolbar
1585 and the default-toolbar."
1586 :type '(radio (const :tag "Same position as the \"default-toolbar\""
1587 :value default)
1588 (const :tag "Along the top edge of the frame"
1589 :value top)
1590 (const :tag "Along the bottom edge of the frame"
1591 :value bottom)
1592 (const :tag "Along the left edge of the frame"
1593 :value left)
1594 (const :tag "Along the right edge of the frame"
1595 :value right)
1596 (const :tag "Don't use a toolbar" nil))
1597 :group 'mh-toolbar))
1598
1599 (defmacro mh-tool-bar-define (defaults &rest buttons)
1600 "Define a tool bar for MH-E.
1601 DEFAULTS is the list of buttons that are present by default. It is a list of
1602 lists where the sublists are of the following form:
1603
1604 (:KEYWORD FUNC1 FUNC2 FUNC3 ...)
1605
1606 Here :KEYWORD is one of :folder or :letter. If it is :folder then the default
1607 buttons in the folder and show mode buffers are being specified. If it is
1608 :letter then the default buttons in the letter mode are listed. FUNC1, FUNC2,
1609 FUNC3, ... are the names of the functions that the buttons would execute.
1610
1611 Each element of BUTTONS is a list consisting of four mandatory items and one
1612 optional item as follows:
1613
1614 (FUNCTION MODES ICON DOC &optional ENABLE-EXPR)
1615
1616 where,
1617
1618 FUNCTION is the name of the function that will be executed when the button
1619 is clicked.
1620
1621 MODES is a list of symbols. List elements must be from `folder', `letter' and
1622 `sequence'. If `folder' is present then the button is available in the
1623 folder and show buffer. If the name of FUNCTION is of the form \"mh-foo\",
1624 where foo is some arbitrary string, then we check if the function
1625 `mh-show-foo' exists. If it exists then that function is used in the show
1626 buffer. Otherwise the original function `mh-foo' is used in the show buffer
1627 as well. Presence of `sequence' is handled similar to the above. The only
1628 difference is that the button is shown only when the folder is narrowed to a
1629 sequence. If `letter' is present in MODES, then the button is available
1630 during draft editing and runs FUNCTION when clicked.
1631
1632 ICON is the icon that is drawn in the button.
1633
1634 DOC is the documentation for the button. It is used in tool-tips and in
1635 providing other help to the user. GNU Emacs uses only the first line of the
1636 string. So the DOC should be formatted such that the first line is useful and
1637 complete without the rest of the string.
1638
1639 Optional item ENABLE-EXPR is an arbitrary lisp expression. If it evaluates
1640 to nil, then the button is deactivated, otherwise it is active. If is in't
1641 present then the button is always active."
1642 ;; The following variable names have been carefully chosen to make code
1643 ;; generation easier. Modifying the names should be done carefully.
1644 (let (folder-buttons folder-docs folder-button-setter sequence-button-setter
1645 show-buttons show-button-setter show-seq-button-setter
1646 letter-buttons letter-docs letter-button-setter
1647 folder-defaults letter-defaults
1648 folder-vectors show-vectors letter-vectors)
1649 (dolist (x defaults)
1650 (cond ((eq (car x) :folder) (setq folder-defaults (cdr x)))
1651 ((eq (car x) :letter) (setq letter-defaults (cdr x)))))
1652 (dolist (button buttons)
1653 (unless (and (listp button)
1654 (or (equal (length button) 4) (equal (length button) 5)))
1655 (error "Incorrect MH-E tool-bar button specification: %s" button))
1656 (let* ((name (nth 0 button))
1657 (name-str (symbol-name name))
1658 (icon (nth 2 button))
1659 (xemacs-icon (mh-do-in-xemacs
1660 (cdr (assoc (intern icon) mh-xemacs-icon-map))))
1661 (full-doc (nth 3 button))
1662 (doc (if (string-match "\\(.*\\)\n" full-doc)
1663 (match-string 1 full-doc)
1664 full-doc))
1665 (enable-expr (or (nth 4 button) t))
1666 (modes (nth 1 button))
1667 functions show-sym)
1668 (when (memq 'letter modes) (setq functions `(:letter ,name)))
1669 (when (or (memq 'folder modes) (memq 'sequence modes))
1670 (setq functions
1671 (append `(,(if (memq 'folder modes) :folder :sequence) ,name)
1672 functions))
1673 (setq show-sym
1674 (if (string-match "^mh-\\(.*\\)$" name-str)
1675 (intern (concat "mh-show-" (match-string 1 name-str)))
1676 name))
1677 (setq functions
1678 (append `(,(if (memq 'folder modes) :show :show-seq)
1679 ,(if (fboundp show-sym) show-sym name))
1680 functions)))
1681 (do ((functions functions (cddr functions)))
1682 ((null functions))
1683 (let* ((type (car functions))
1684 (function (cadr functions))
1685 (type1 (substring (symbol-name type) 1))
1686 (vector-list (cond ((eq type :show) 'show-vectors)
1687 ((eq type :show-seq) 'show-vectors)
1688 ((eq type :letter) 'letter-vectors)
1689 (t 'folder-vectors)))
1690 (list (cond ((eq type :letter) 'mh-tool-bar-letter-buttons)
1691 (t 'mh-tool-bar-folder-buttons)))
1692 (key (intern (concat "mh-" type1 "toolbar-" name-str)))
1693 (setter (intern (concat type1 "-button-setter")))
1694 (mbuttons (cond ((eq type :letter) 'letter-buttons)
1695 ((eq type :show) 'show-buttons)
1696 ((eq type :show-seq) 'show-buttons)
1697 (t 'folder-buttons)))
1698 (docs (cond ((eq mbuttons 'letter-buttons) 'letter-docs)
1699 ((eq mbuttons 'folder-buttons) 'folder-docs))))
1700 (add-to-list vector-list `[,xemacs-icon ,function t ,full-doc])
1701 (add-to-list
1702 setter `(when (member ',name ,list)
1703 (mh-funcall-if-exists
1704 tool-bar-add-item ,icon ',function ',key
1705 :help ,doc :enable ',enable-expr)))
1706 (add-to-list mbuttons name)
1707 (if docs (add-to-list docs doc))))))
1708 (setq folder-buttons (nreverse folder-buttons)
1709 letter-buttons (nreverse letter-buttons)
1710 show-buttons (nreverse show-buttons)
1711 letter-docs (nreverse letter-docs)
1712 folder-docs (nreverse folder-docs)
1713 folder-vectors (nreverse folder-vectors)
1714 show-vectors (nreverse show-vectors)
1715 letter-vectors (nreverse letter-vectors))
1716 (dolist (x folder-defaults)
1717 (unless (memq x folder-buttons)
1718 (error "Folder defaults contains unknown button '%s'" x)))
1719 (dolist (x letter-defaults)
1720 (unless (memq x letter-buttons)
1721 (error "Letter defaults contains unknown button '%s'" x)))
1722 `(eval-when (compile load eval)
1723 (defvar mh-folder-tool-bar-map nil)
1724 (defvar mh-folder-seq-tool-bar-map nil)
1725 (defvar mh-show-tool-bar-map nil)
1726 (defvar mh-show-seq-tool-bar-map nil)
1727 (defvar mh-letter-tool-bar-map nil)
1728 ;; GNU Emacs tool bar specific code
1729 (mh-do-in-gnu-emacs
1730 ;; Custom setter functions
1731 (defun mh-tool-bar-folder-buttons-set (symbol value)
1732 "Construct toolbar for `mh-folder-mode' and `mh-show-mode'."
1733 (set-default symbol value)
1734 (setq mh-folder-tool-bar-map
1735 (let ((tool-bar-map (make-sparse-keymap)))
1736 ,@(nreverse folder-button-setter)
1737 tool-bar-map))
1738 (setq mh-show-tool-bar-map
1739 (let ((tool-bar-map (make-sparse-keymap)))
1740 ,@(nreverse show-button-setter)
1741 tool-bar-map))
1742 (setq mh-show-seq-tool-bar-map
1743 (let ((tool-bar-map (copy-keymap mh-show-tool-bar-map)))
1744 ,@(nreverse show-seq-button-setter)
1745 tool-bar-map))
1746 (setq mh-folder-seq-tool-bar-map
1747 (let ((tool-bar-map (copy-keymap mh-folder-tool-bar-map)))
1748 ,@(nreverse sequence-button-setter)
1749 tool-bar-map)))
1750 (defun mh-tool-bar-letter-buttons-set (symbol value)
1751 "Construct toolbar for `mh-letter-mode'."
1752 (set-default symbol value)
1753 (setq mh-letter-tool-bar-map
1754 (let ((tool-bar-map (make-sparse-keymap)))
1755 ,@(nreverse letter-button-setter)
1756 tool-bar-map))))
1757 ;; XEmacs specific code
1758 (mh-do-in-xemacs
1759 (defvar mh-toolbar-folder-vector-map
1760 ',(loop for button in folder-buttons
1761 for vector in folder-vectors
1762 collect (cons button vector)))
1763 (defvar mh-toolbar-show-vector-map
1764 ',(loop for button in show-buttons
1765 for vector in show-vectors
1766 collect (cons button vector)))
1767 (defvar mh-toolbar-letter-vector-map
1768 ',(loop for button in letter-buttons
1769 for vector in letter-vectors
1770 collect (cons button vector)))
1771 (defvar mh-toolbar-folder-buttons nil)
1772 (defvar mh-toolbar-show-buttons nil)
1773 (defvar mh-toolbar-letter-buttons nil)
1774 ;; Custom setter functions
1775 (defun mh-tool-bar-letter-buttons-set (symbol value)
1776 (set-default symbol value)
1777 (when mh-xemacs-has-toolbar-flag
1778 (setq mh-toolbar-letter-buttons
1779 (loop for b in value
1780 collect (cdr (assoc b mh-toolbar-letter-vector-map))))))
1781 (defun mh-tool-bar-folder-buttons-set (symbol value)
1782 (set-default symbol value)
1783 (when mh-xemacs-has-toolbar-flag
1784 (setq mh-toolbar-folder-buttons
1785 (loop for b in value
1786 collect (cdr (assoc b mh-toolbar-folder-vector-map))))
1787 (setq mh-toolbar-show-buttons
1788 (loop for b in value
1789 collect (cdr (assoc b mh-toolbar-show-vector-map))))))
1790 ;; Initialize toolbar
1791 (defun mh-toolbar-init (mode)
1792 "Install toolbar in MODE."
1793 (let ((toolbar (cond ((eq mode :folder) mh-toolbar-folder-buttons)
1794 ((eq mode :letter) mh-toolbar-letter-buttons)
1795 ((eq mode :show) mh-toolbar-show-buttons)))
1796 (height 37)
1797 (width 40)
1798 (buffer (current-buffer)))
1799 (when (and mh-xemacs-toolbar-position mh-xemacs-use-toolbar-flag
1800 mh-xemacs-has-toolbar-flag)
1801 (cond
1802 ((eq mh-xemacs-toolbar-position 'top)
1803 (set-specifier top-toolbar toolbar buffer)
1804 (set-specifier top-toolbar-visible-p t)
1805 (set-specifier top-toolbar-height height))
1806 ((eq mh-xemacs-toolbar-position 'bottom)
1807 (set-specifier bottom-toolbar toolbar buffer)
1808 (set-specifier bottom-toolbar-visible-p t)
1809 (set-specifier bottom-toolbar-height height))
1810 ((eq mh-xemacs-toolbar-position 'left)
1811 (set-specifier left-toolbar toolbar buffer)
1812 (set-specifier left-toolbar-visible-p t)
1813 (set-specifier left-toolbar-width width))
1814 ((eq mh-xemacs-toolbar-position 'right)
1815 (set-specifier right-toolbar toolbar buffer)
1816 (set-specifier right-toolbar-visible-p t)
1817 (set-specifier right-toolbar-width width))
1818 (t (set-specifier default-toolbar toolbar buffer)))))))
1819 ;; Declare customizable toolbars
1820 (custom-declare-variable
1821 'mh-tool-bar-folder-buttons
1822 '(list ,@(mapcar (lambda (x) `(quote ,x)) folder-defaults))
1823 "Choose buttons to include in MH-E folder/show toolbar."
1824 :group 'mh-toolbar :set 'mh-tool-bar-folder-buttons-set
1825 :type '(set ,@(loop for x in folder-buttons
1826 for y in folder-docs
1827 collect `(const :tag ,y ,x))))
1828 (custom-declare-variable
1829 'mh-tool-bar-letter-buttons
1830 '(list ,@(mapcar (lambda (x) `(quote ,x)) letter-defaults))
1831 "Choose buttons to include in MH-E letter toolbar."
1832 :group 'mh-toolbar :set 'mh-tool-bar-letter-buttons-set
1833 :type '(set ,@(loop for x in letter-buttons
1834 for y in letter-docs
1835 collect `(const :tag ,y ,x)))))))
1836
1837 (mh-tool-bar-define
1838 ((:folder mh-inc-folder mh-mime-save-parts mh-previous-undeleted-msg
1839 mh-page-msg mh-next-undeleted-msg mh-delete-msg mh-refile-msg
1840 mh-undo mh-execute-commands mh-toggle-tick mh-reply
1841 mh-alias-grab-from-field mh-send mh-rescan-folder
1842 mh-tool-bar-search mh-visit-folder
1843 mh-tool-bar-customize mh-tool-bar-folder-help mh-widen)
1844 (:letter mh-send-letter mh-compose-insertion ispell-message save-buffer
1845 undo kill-region menu-bar-kill-ring-save yank mh-fully-kill-draft
1846 mh-tool-bar-customize mh-tool-bar-letter-help))
1847 ;; Folder/Show buffer buttons
1848 (mh-inc-folder (folder) "mail"
1849 "Incorporate new mail in Inbox
1850 This button runs `mh-inc-folder' which drags any
1851 new mail into your Inbox folder.")
1852 (mh-mime-save-parts (folder) "attach"
1853 "Save MIME parts from this message
1854 This button runs `mh-mime-save-parts' which saves a message's
1855 different parts into separate files.")
1856 (mh-previous-undeleted-msg (folder) "left_arrow"
1857 "Go to the previous undeleted message
1858 This button runs `mh-previous-undeleted-msg'")
1859 (mh-page-msg (folder) "page-down"
1860 "Page the current message forwards\nThis button runs `mh-page-msg'")
1861 (mh-next-undeleted-msg (folder) "right_arrow"
1862 "Go to the next undeleted message\nThe button runs `mh-next-undeleted-msg'")
1863 (mh-delete-msg (folder) "close"
1864 "Mark this message for deletion\nThis button runs `mh-delete-msg'")
1865 (mh-refile-msg (folder) "refile"
1866 "Refile this message\nThis button runs `mh-refile-msg'")
1867 (mh-undo (folder) "undo" "Undo last operation\nThis button runs `undo'"
1868 (mh-outstanding-commands-p))
1869 (mh-execute-commands (folder) "execute"
1870 "Perform moves and deletes\nThis button runs `mh-execute-commands'"
1871 (mh-outstanding-commands-p))
1872 (mh-toggle-tick (folder) "highlight"
1873 "Toggle tick mark\nThis button runs `mh-toggle-tick'")
1874 (mh-toggle-showing (folder) "show"
1875 "Toggle showing message\nThis button runs `mh-toggle-showing'")
1876 (mh-tool-bar-reply-from (folder) "reply-from" "Reply to \"from\"")
1877 (mh-tool-bar-reply-to (folder) "reply-to" "Reply to \"to\"")
1878 (mh-tool-bar-reply-all (folder) "reply-all" "Reply to \"all\"")
1879 (mh-reply (folder) "mail/reply2"
1880 "Reply to this message\nThis button runs `mh-reply'")
1881 (mh-alias-grab-from-field (folder) "alias"
1882 "Grab From alias\nThis button runs `mh-alias-grab-from-field'"
1883 (and (mh-extract-from-header-value) (not (mh-alias-for-from-p))))
1884 (mh-send (folder) "mail_compose"
1885 "Compose new message\nThis button runs `mh-send'")
1886 (mh-rescan-folder (folder) "rescan"
1887 "Rescan this folder\nThis button runs `mh-rescan-folder'")
1888 (mh-pack-folder (folder) "repack"
1889 "Repack this folder\nThis button runs `mh-pack-folder'")
1890 (mh-tool-bar-search (folder) "search"
1891 "Search\nThis button runs `mh-tool-bar-search-function'")
1892 (mh-visit-folder (folder) "fld_open"
1893 "Visit other folder\nThis button runs `mh-visit-folder'")
1894 ;; Letter buffer buttons
1895 (mh-send-letter (letter) "mail_send" "Send this letter")
1896 (mh-compose-insertion (letter) "attach" "Insert attachment")
1897 (ispell-message (letter) "spell" "Check spelling")
1898 (save-buffer (letter) "save" "Save current buffer to its file"
1899 (buffer-modified-p))
1900 (undo (letter) "undo" "Undo last operation")
1901 (kill-region (letter) "cut"
1902 "Cut (kill) text in region between mark and current position")
1903 (menu-bar-kill-ring-save (letter) "copy"
1904 "Copy text in region between mark and current position")
1905 (yank (letter) "paste" "Paste (yank) text cut or copied earlier")
1906 (mh-fully-kill-draft (letter) "close" "Kill this draft")
1907 ;; Common buttons
1908 (mh-tool-bar-customize (folder letter) "preferences" "MH-E Preferences")
1909 (mh-tool-bar-folder-help (folder) "help"
1910 "Help! (general help)\nThis button runs `Info-goto-node'")
1911 (mh-tool-bar-letter-help (letter) "help"
1912 "Help! (general help)\nThis button runs `Info-goto-node'")
1913 ;; Folder narrowed to sequence buttons
1914 (mh-widen (sequence) "widen"
1915 "Widen from the sequence\nThis button runs `mh-widen'"))
1916
1917 \f
1918
1919 ;;; Hooks (:group 'mh-hooks + group where hook described)
1920
1921 (defcustom mail-citation-hook nil
1922 "*Hook for modifying a citation just inserted in the mail buffer.
1923 Each hook function can find the citation between point and mark.
1924 And each hook function should leave point and mark around the citation
1925 text as modified.
1926
1927 If this hook is entirely empty (nil), the text of the message is inserted
1928 with `mh-ins-buf-prefix' prefixed to each line.
1929
1930 See also the variable `mh-yank-from-start-of-msg', which controls how
1931 much of the message passed to the hook.
1932
1933 This hook was historically provided to set up supercite. You may now leave
1934 this nil and set up supercite by setting the variable
1935 `mh-yank-from-start-of-msg' to 'supercite or, for more automatic insertion,
1936 to 'autosupercite.
1937
1938 The hook 'trivial-cite is NOT part of Emacs. It is provided from tc.el,
1939 available here:
1940 http://shasta.cs.uiuc.edu/~lrclause/tc.html
1941 If you use it, customize `mh-yank-from-start-of-msg' to
1942 \"Entire message with headers\"."
1943 :type 'hook
1944 :options '(trivial-cite)
1945 :group 'mh-hooks
1946 :group 'mh-letter)
1947
1948 (defcustom mh-alias-reloaded-hook nil
1949 "Invoked by `mh-alias-reload' after reloading aliases."
1950 :type 'hook
1951 :group 'mh-hooks
1952 :group 'mh-alias)
1953
1954 (defcustom mh-before-quit-hook nil
1955 "Invoked by \\<mh-folder-mode-map>`\\[mh-quit]' before quitting MH-E.
1956 See also `mh-quit-hook'."
1957 :type 'hook
1958 :group 'mh-hooks
1959 :group 'mh-show)
1960
1961 (defcustom mh-before-send-letter-hook nil
1962 "Invoked at the beginning of the \\<mh-letter-mode-map>\\[mh-send-letter] command."
1963 :type 'hook
1964 :group 'mh-hooks
1965 :group 'mh-letter)
1966
1967 (defcustom mh-delete-msg-hook nil
1968 "Invoked after marking each message for deletion."
1969 :type 'hook
1970 :group 'mh-hooks
1971 :group 'mh-show)
1972
1973 (defcustom mh-edit-mhn-hook nil
1974 "Invoked on the formatted letter by \\<mh-letter-mode-map>\\[mh-edit-mhn]."
1975 :type 'hook
1976 :group 'mh-hooks
1977 :group 'mh-letter)
1978
1979 (defcustom mh-find-path-hook nil
1980 "Invoked by `mh-find-path' after reading the user's MH profile."
1981 :type 'hook
1982 :group 'mh-hooks
1983 :group 'mh-show)
1984
1985 (defcustom mh-folder-mode-hook nil
1986 "Invoked in `mh-folder-mode' on a new folder."
1987 :type 'hook
1988 :group 'mh-hooks
1989 :group 'mh-show)
1990
1991 (defcustom mh-folder-updated-hook nil
1992 "Invoked when the folder actions (such as moves and deletes) are performed.
1993 Variables that are useful in this hook include `mh-delete-list' and
1994 `mh-refile-list' which can be used to see which changes are being made to
1995 current folder, `mh-current-folder'."
1996 :type 'hook
1997 :group 'mh-hooks)
1998
1999 (defcustom mh-forward-hook nil
2000 "Invoked on the forwarded letter by \\<mh-folder-mode-map>\\[mh-forward]."
2001 :type 'hook
2002 :group 'mh-hooks
2003 :group 'mh-folder)
2004
2005 (defcustom mh-inc-folder-hook nil
2006 "Invoked by \\<mh-folder-mode-map>`\\[mh-inc-folder]' after incorporating mail into a folder."
2007 :type 'hook
2008 :group 'mh-hooks
2009 :group 'mh-inc)
2010
2011 (defcustom mh-kill-folder-suppress-prompt-hook '(mh-index-p)
2012 "Invoked at the beginning of the \\<mh-folder-mode-map>`\\[mh-kill-folder]' command.
2013 This hook is a list of functions to be called, with no arguments, which should
2014 return a value of non-nil if you should not be asked if you're sure that you
2015 want to remove the folder. This is useful for folders that are easily
2016 regenerated.
2017
2018 The default value of `mh-index-p' suppresses the prompt on folders generated
2019 by an index search.
2020
2021 WARNING: Use this hook with care. If there is a bug in your hook which returns
2022 t on +inbox and you hit \\<mh-folder-mode-map>`\\[mh-kill-folder]' by accident
2023 in the +inbox buffer, you will not be happy."
2024 :type 'hook
2025 :group 'mh-hooks
2026 :group 'mh-show)
2027
2028 (defcustom mh-letter-insert-signature-hook nil
2029 "Invoked after signature has been inserted.
2030 This hook may access the actual name of the file or the function used to
2031 insert the signature with `mh-signature-file-name'."
2032 :type 'hook
2033 :group 'mh-hooks
2034 :group 'mh-letter)
2035
2036 (defcustom mh-letter-mode-hook nil
2037 "Invoked in `mh-letter-mode' on a new letter."
2038 :type 'hook
2039 :group 'mh-hooks
2040 :group 'mh-sending-mail)
2041
2042 (defcustom mh-pick-mode-hook nil
2043 "Invoked upon entry to `mh-pick-mode'."
2044 :type 'hook
2045 :group 'mh-hooks
2046 :group 'mh-index)
2047
2048 (defcustom mh-quit-hook nil
2049 "Invoked after \\<mh-folder-mode-map>`\\[mh-quit]' quits MH-E.
2050 See also `mh-before-quit-hook'."
2051 :type 'hook
2052 :group 'mh-hooks
2053 :group 'mh-show)
2054
2055 (defcustom mh-refile-msg-hook nil
2056 "Invoked after marking each message for refiling."
2057 :type 'hook
2058 :group 'mh-hooks
2059 :group 'mh-show)
2060
2061 (defcustom mh-show-hook nil
2062 "Invoked after \\<mh-folder-mode-map>`\\[mh-show]' shows a message."
2063 :type 'hook
2064 :group 'mh-hooks
2065 :group 'mh-show)
2066
2067 (defcustom mh-show-mode-hook nil
2068 "Invoked upon entry to `mh-show-mode'."
2069 :type 'hook
2070 :group 'mh-hooks
2071 :group 'mh-show)
2072
2073 (defcustom mh-unseen-updated-hook nil
2074 "Invoked after the unseen sequence has been updated.
2075 The variable `mh-seen-list' can be used to obtain the list of messages which
2076 will be removed from the unseen sequence."
2077 :type 'hook
2078 :group 'mh-hooks
2079 :group 'mh-show)
2080
2081 \f
2082
2083 ;;; Faces (:group 'mh-*-faces + group where faces described)
2084
2085 ;;; Faces Used in Scan Listing (:group 'mh-folder-faces)
2086
2087 (defvar mh-folder-body-face 'mh-folder-body-face
2088 "Face for highlighting body text in MH-Folder buffers.")
2089 (defface mh-folder-body-face
2090 '((((type tty) (class color)) (:foreground "green"))
2091 (((class grayscale) (background light)) (:foreground "DimGray" :italic t))
2092 (((class grayscale) (background dark)) (:foreground "LightGray" :italic t))
2093 (((class color) (background light)) (:foreground "RosyBrown"))
2094 (((class color) (background dark)) (:foreground "LightSalmon"))
2095 (t (:italic t)))
2096 "Face for highlighting body text in MH-Folder buffers."
2097 :group 'mh-folder-faces)
2098
2099 (defvar mh-folder-cur-msg-face 'mh-folder-cur-msg-face
2100 "Face for the current message line in MH-Folder buffers.")
2101 (defface mh-folder-cur-msg-face
2102 '((((type tty pc) (class color))
2103 (:background "LightGreen"))
2104 (((class color) (background light))
2105 (:background "LightGreen") ;Use this for solid background colour
2106 ;; (:underline t) ;Use this for underlining
2107 )
2108 (((class color) (background dark))
2109 (:background "DarkOliveGreen4"))
2110 (t (:underline t)))
2111 "Face for the current message line in MH-Folder buffers."
2112 :group 'mh-folder-faces)
2113
2114 (defvar mh-folder-cur-msg-number-face 'mh-folder-cur-msg-number-face
2115 "Face for highlighting the current message in MH-Folder buffers.")
2116 (defface mh-folder-cur-msg-number-face
2117 '((((type tty) (class color)) (:foreground "cyan" :weight bold))
2118 (((class grayscale) (background light)) (:foreground "LightGray" :bold t))
2119 (((class grayscale) (background dark)) (:foreground "DimGray" :bold t))
2120 (((class color) (background light)) (:foreground "Purple"))
2121 (((class color) (background dark)) (:foreground "Cyan"))
2122 (t (:bold t)))
2123 "Face for highlighting the current message in MH-Folder buffers."
2124 :group 'mh-folder-faces)
2125
2126 (defvar mh-folder-date-face 'mh-folder-date-face
2127 "Face for highlighting the date in MH-Folder buffers.")
2128 (defface mh-folder-date-face
2129 '((((class color) (background light))
2130 (:foreground "snow4"))
2131 (((class color) (background dark))
2132 (:foreground "snow3"))
2133 (t
2134 (:bold t)))
2135 "Face for highlighting the date in MH-Folder buffers."
2136 :group 'mh-folder-faces)
2137
2138 (defvar mh-folder-followup-face 'mh-folder-followup-face
2139 "Face for highlighting Re: (followup) subject text in MH-Folder buffers.")
2140 (defface mh-folder-followup-face
2141 '((((class color) (background light))
2142 (:foreground "blue3"))
2143 (((class color) (background dark))
2144 (:foreground "LightGoldenRod"))
2145 (t
2146 (:bold t)))
2147 "Face for highlighting Re: (followup) subject text in MH-Folder buffers."
2148 :group 'mh-folder-faces)
2149
2150 (defvar mh-folder-msg-number-face 'mh-folder-msg-number-face
2151 "Face for highlighting the message number in MH-Folder buffers.")
2152 (defface mh-folder-msg-number-face
2153 '((((class color) (background light))
2154 (:foreground "snow4"))
2155 (((class color) (background dark))
2156 (:foreground "snow3"))
2157 (t
2158 (:bold t)))
2159 "Face for highlighting the message number in MH-Folder buffers."
2160 :group 'mh-folder-faces)
2161
2162 (defvar mh-folder-deleted-face 'mh-folder-deleted-face
2163 "Face for highlighting deleted messages in MH-Folder buffers.")
2164 (copy-face 'mh-folder-msg-number-face 'mh-folder-deleted-face)
2165
2166 (defvar mh-folder-refiled-face 'mh-folder-refiled-face
2167 "Face for highlighting refiled messages in MH-Folder buffers.")
2168 (defface mh-folder-refiled-face
2169 '((((type tty) (class color)) (:foreground "yellow" :weight light))
2170 (((class grayscale) (background light))
2171 (:foreground "Gray90" :bold t :italic t))
2172 (((class grayscale) (background dark))
2173 (:foreground "DimGray" :bold t :italic t))
2174 (((class color) (background light)) (:foreground "DarkGoldenrod"))
2175 (((class color) (background dark)) (:foreground "LightGoldenrod"))
2176 (t (:bold t :italic t)))
2177 "Face for highlighting refiled messages in MH-Folder buffers."
2178 :group 'mh-folder-faces)
2179
2180 (defvar mh-folder-subject-face 'mh-folder-subject-face
2181 "Face for highlighting subject text in MH-Folder buffers.")
2182 (if (boundp 'facemenu-unlisted-faces)
2183 (add-to-list 'facemenu-unlisted-faces "^mh-folder"))
2184 (defface mh-folder-subject-face
2185 '((((class color) (background light))
2186 (:foreground "blue4"))
2187 (((class color) (background dark))
2188 (:foreground "yellow"))
2189 (t
2190 (:bold t)))
2191 "Face for highlighting subject text in MH-Folder buffers."
2192 :group 'mh-folder-faces)
2193
2194 (defface mh-folder-tick-face
2195 '((((class color) (background dark)) (:background "#dddf7e"))
2196 (((class color) (background light)) (:background "#dddf7e"))
2197 (t (:underline t)))
2198 "Face used to show ticked messages."
2199 :group 'mh-folder-faces)
2200
2201 (defvar mh-folder-address-face 'mh-folder-address-face
2202 "Face for highlighting the address in MH-Folder buffers.")
2203 (copy-face 'mh-folder-subject-face 'mh-folder-address-face)
2204
2205 (defvar mh-folder-scan-format-face 'mh-folder-scan-format-face
2206 "Face for highlighting `mh-scan-format-regexp' matches in MH-Folder buffers.")
2207 (copy-face 'mh-folder-followup-face 'mh-folder-scan-format-face)
2208
2209 (defvar mh-folder-to-face 'mh-folder-to-face
2210 "Face for highlighting the To: string in MH-Folder buffers.")
2211 (defface mh-folder-to-face
2212 '((((type tty) (class color)) (:foreground "green"))
2213 (((class grayscale) (background light)) (:foreground "DimGray" :italic t))
2214 (((class grayscale) (background dark)) (:foreground "LightGray" :italic t))
2215 (((class color) (background light)) (:foreground "RosyBrown"))
2216 (((class color) (background dark)) (:foreground "LightSalmon"))
2217 (t (:italic t)))
2218 "Face for highlighting the To: string in MH-Folder buffers."
2219 :group 'mh-folder-faces)
2220
2221 \f
2222
2223 ;;; Faces Used in Searching (:group 'mh-index-faces)
2224
2225 (defvar mh-index-folder-face 'mh-index-folder-face
2226 "Face for highlighting folders in MH-Index buffers.")
2227 (defface mh-index-folder-face
2228 '((((class color) (background light))
2229 (:foreground "dark green" :bold t))
2230 (((class color) (background dark))
2231 (:foreground "indian red" :bold t))
2232 (t
2233 (:bold t)))
2234 "Face for highlighting folders in MH-Index buffers."
2235 :group 'mh-index-faces)
2236
2237 \f
2238
2239 ;;; Faces Used in Message Drafts (:group 'mh-letter-faces)
2240
2241 (defface mh-letter-header-field-face
2242 '((((class color) (background light))
2243 (:background "gray90"))
2244 (((class color) (background dark))
2245 (:background "gray10"))
2246 (t (:bold t)))
2247 "Face for displaying header fields in draft buffers."
2248 :group 'mh-letter-faces)
2249
2250 \f
2251
2252 ;;; Faces Used in Message Display (:group 'mh-show-faces)
2253
2254 (defvar mh-show-cc-face 'mh-show-cc-face
2255 "Face for highlighting cc header fields.")
2256 (defface mh-show-cc-face
2257 '((((type tty) (class color)) (:foreground "yellow" :weight light))
2258 (((class grayscale) (background light))
2259 (:foreground "Gray90" :bold t :italic t))
2260 (((class grayscale) (background dark))
2261 (:foreground "DimGray" :bold t :italic t))
2262 (((class color) (background light)) (:foreground "DarkGoldenrod"))
2263 (((class color) (background dark)) (:foreground "LightGoldenrod"))
2264 (t (:bold t :italic t)))
2265 "Face for highlighting cc header fields."
2266 :group 'mh-show-faces)
2267
2268 (defvar mh-show-date-face 'mh-show-date-face
2269 "Face for highlighting the Date header field.")
2270 (defface mh-show-date-face
2271 '((((type tty) (class color)) (:foreground "green"))
2272 (((class grayscale) (background light)) (:foreground "Gray90" :bold t))
2273 (((class grayscale) (background dark)) (:foreground "DimGray" :bold t))
2274 (((class color) (background light)) (:foreground "ForestGreen"))
2275 (((class color) (background dark)) (:foreground "PaleGreen"))
2276 (t (:bold t :underline t)))
2277 "Face for highlighting the Date header field."
2278 :group 'mh-show-faces)
2279
2280 (defvar mh-show-header-face 'mh-show-header-face
2281 "Face used to deemphasize unspecified header fields.")
2282 (defface mh-show-header-face
2283 '((((type tty) (class color)) (:foreground "green"))
2284 (((class grayscale) (background light)) (:foreground "DimGray" :italic t))
2285 (((class grayscale) (background dark)) (:foreground "LightGray" :italic t))
2286 (((class color) (background light)) (:foreground "RosyBrown"))
2287 (((class color) (background dark)) (:foreground "LightSalmon"))
2288 (t (:italic t)))
2289 "Face used to deemphasize unspecified header fields."
2290 :group 'mh-show-faces)
2291
2292 (defface mh-show-signature-face
2293 '((t (:italic t)))
2294 "Face for highlighting message signature."
2295 :group 'mh-show-faces)
2296
2297 (defvar mh-show-to-face 'mh-show-to-face
2298 "Face for highlighting the To: header field.")
2299 (if (boundp 'facemenu-unlisted-faces)
2300 (add-to-list 'facemenu-unlisted-faces "^mh-show"))
2301 (defface mh-show-to-face
2302 '((((class grayscale) (background light))
2303 (:foreground "DimGray" :underline t))
2304 (((class grayscale) (background dark))
2305 (:foreground "LightGray" :underline t))
2306 (((class color) (background light)) (:foreground "SaddleBrown"))
2307 (((class color) (background dark)) (:foreground "burlywood"))
2308 (t (:underline t)))
2309 "Face for highlighting the To: header field."
2310 :group 'mh-show-faces)
2311
2312 (defvar mh-show-from-face 'mh-show-from-face
2313 "Face for highlighting the From: header field.")
2314 (defface mh-show-from-face
2315 '((((class color) (background light))
2316 (:foreground "red3"))
2317 (((class color) (background dark))
2318 (:foreground "cyan"))
2319 (t
2320 (:bold t)))
2321 "Face for highlighting the From: header field."
2322 :group 'mh-show-faces)
2323
2324 (defface mh-show-xface-face
2325 '((t (:foreground "black" :background "white")))
2326 "Face for displaying the X-Face image.
2327 The background and foreground is used in the image."
2328 :group 'mh-show-faces)
2329
2330 (defvar mh-show-subject-face 'mh-show-subject-face
2331 "Face for highlighting the Subject header field.")
2332 (copy-face 'mh-folder-subject-face 'mh-show-subject-face)
2333
2334 \f
2335
2336 ;;; Faces Used in Speedbar (:group 'mh-speed-faces)
2337
2338 (defface mh-speedbar-folder-face
2339 '((((class color) (background light))
2340 (:foreground "blue4"))
2341 (((class color) (background dark))
2342 (:foreground "light blue")))
2343 "Face used for folders in the speedbar buffer."
2344 :group 'mh-speed-faces)
2345
2346 (defface mh-speedbar-selected-folder-face
2347 '((((class color) (background light))
2348 (:foreground "red1" :underline t))
2349 (((class color) (background dark))
2350 (:foreground "red1" :underline t))
2351 (t (:underline t)))
2352 "Face used for the current folder."
2353 :group 'mh-speed-faces)
2354
2355 (defface mh-speedbar-folder-with-unseen-messages-face
2356 '((t (:inherit mh-speedbar-folder-face :bold t)))
2357 "Face used for folders in the speedbar buffer which have unread messages."
2358 :group 'mh-speed-faces)
2359
2360 (defface mh-speedbar-selected-folder-with-unseen-messages-face
2361 '((t (:inherit mh-speedbar-selected-folder-face :bold t)))
2362 "Face used for the current folder when it has unread messages."
2363 :group 'mh-speed-faces)
2364
2365 ;;; Local Variables:
2366 ;;; indent-tabs-mode: nil
2367 ;;; sentence-end-double-space: nil
2368 ;;; End:
2369
2370 ;;; arch-tag: 778d2a20-82e2-4276-be9d-309386776a68
2371 ;;; mh-customize.el ends here