(mh-sortm-args): Sync docstrings with manual.
[emacs.git] / lisp / mh-e / mh-customize.el
blob780318d9766a84271c1413205354652a0590fb12
1 ;;; mh-customize.el --- MH-E customization
3 ;; Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
5 ;; Author: Bill Wohler <wohler@newt.com>
6 ;; Maintainer: Bill Wohler <wohler@newt.com>
7 ;; Keywords: mail
8 ;; See: mh-e.el
10 ;; This file is part of GNU Emacs.
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.
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.
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., 51 Franklin Street, Fifth Floor,
25 ;; Boston, MA 02110-1301, USA.
27 ;;; Commentary:
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.
33 ;; This file contains the following sections:
35 ;; 1. MH-E Customization Groups
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 .
41 ;; 2. MH-E Customization
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.
48 ;; 3. Hooks
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.
55 ;; 4. Faces
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.
62 ;;; Change Log:
64 ;;; Code:
66 (provide 'mh-customize)
68 (eval-when-compile (require 'mh-acros))
69 (mh-require-cl)
70 (require 'mh-loaddefs)
72 (eval-and-compile
73 (defvar mh-xemacs-flag (featurep 'xemacs)
74 "Non-nil means the current Emacs is XEmacs."))
76 (when mh-xemacs-flag
77 (require 'mh-xemacs))
79 ;; XXX: Functions autoloaded from the following files are used to initialize
80 ;; customizable variables. They are require'd here, since otherwise the
81 ;; corresponding .elc would be loaded at compile time.
82 (eval-when-compile
83 (require 'mh-init)
84 (require 'mh-identity))
86 (defun mh-customize (&optional delete-other-windows-flag)
87 "Customize MH-E variables.
88 If optional argument DELETE-OTHER-WINDOWS-FLAG is non-nil, other windows in
89 the frame are removed."
90 (interactive "P")
91 (customize-group 'mh-e)
92 (when delete-other-windows-flag
93 (delete-other-windows)))
97 ;;; For compiler warnings...
98 (eval-when-compile
99 (defvar mh-show-buffer)
100 (defvar mh-show-folder-buffer))
102 ;;; MH-E Customization Groups
104 (defgroup mh-e nil
105 "Emacs interface to the MH mail system.
106 MH is the Rand Mail Handler. Other implementations include nmh and GNU
107 mailutils."
108 :link '(custom-manual "(mh-e)Top")
109 :group 'mail)
111 (defgroup mh-alias nil
112 "Aliases."
113 :link '(custom-manual "(mh-e)Aliases")
114 :prefix "mh-alias-"
115 :group 'mh-e)
117 (defgroup mh-folder nil
118 "Organizing your mail with folders."
119 :prefix "mh-"
120 :link '(custom-manual "(mh-e)Folders")
121 :group 'mh-e)
123 (defgroup mh-folder-selection nil
124 "Folder selection."
125 :prefix "mh-"
126 :link '(custom-manual "(mh-e)Folder Selection")
127 :group 'mh-e)
129 (defgroup mh-identity nil
130 "Identities."
131 :link '(custom-manual "(mh-e)Identities")
132 :prefix "mh-identity-"
133 :group 'mh-e)
135 (defgroup mh-inc nil
136 "Incorporating your mail."
137 :prefix "mh-inc-"
138 :link '(custom-manual "(mh-e)Incorporating Mail")
139 :group 'mh-e)
141 (defgroup mh-index nil
142 "Searching."
143 :link '(custom-manual "(mh-e)Searching")
144 :prefix "mh-index-"
145 :group 'mh-e)
147 (defgroup mh-junk nil
148 "Dealing with junk mail."
149 :link '(custom-manual "(mh-e)Junk")
150 :prefix "mh-junk-"
151 :group 'mh-e)
153 (defgroup mh-letter nil
154 "Editing a draft."
155 :prefix "mh-"
156 :link '(custom-manual "(mh-e)Editing Drafts")
157 :group 'mh-e)
159 (defgroup mh-ranges nil
160 "Ranges."
161 :prefix "mh-"
162 :link '(custom-manual "(mh-e)Ranges")
163 :group 'mh-e)
165 (defgroup mh-scan-line-formats nil
166 "Scan line formats."
167 :link '(custom-manual "(mh-e)Scan Line Formats")
168 :prefix "mh-"
169 :group 'mh-e)
171 (defgroup mh-sending-mail nil
172 "Sending mail."
173 :prefix "mh-"
174 :link '(custom-manual "(mh-e)Sending Mail")
175 :group 'mh-e)
177 (defgroup mh-sequences nil
178 "Sequences."
179 :prefix "mh-"
180 :link '(custom-manual "(mh-e)Sequences")
181 :group 'mh-e)
183 (defgroup mh-show nil
184 "Reading your mail."
185 :prefix "mh-"
186 :link '(custom-manual "(mh-e)Reading Mail")
187 :group 'mh-e)
189 (defgroup mh-speedbar nil
190 "The speedbar."
191 :prefix "mh-speed-"
192 :link '(custom-manual "(mh-e)Speedbar")
193 :group 'mh-e)
195 (defgroup mh-thread nil
196 "Threading."
197 :prefix "mh-thread-"
198 :link '(custom-manual "(mh-e)Threading")
199 :group 'mh-e)
201 (defgroup mh-toolbar nil
202 "The toolbar"
203 :link '(custom-manual "(mh-e)Toolbar")
204 :prefix "mh-"
205 :group 'mh-e)
207 (defgroup mh-faces nil
208 "Faces used in MH-E."
209 :link '(custom-manual "(mh-e)Top")
210 :prefix "mh-"
211 :group 'faces
212 :group 'mh-e)
214 (defgroup mh-hooks nil
215 "MH-E hooks."
216 :link '(custom-manual "(mh-e)Top")
217 :prefix "mh-"
218 :group 'mh-e)
220 ;;; Faces
222 (defgroup mh-folder-faces nil
223 "Faces used in scan listing."
224 :link '(custom-manual "(mh-e)Folders")
225 :prefix "mh-"
226 :group 'mh-faces
227 :group 'mh-folder)
229 (defgroup mh-index-faces nil
230 "Faces used in searching."
231 :link '(custom-manual "(mh-e)Searching")
232 :prefix "mh-"
233 :group 'mh-faces
234 :group 'mh-index)
236 (defgroup mh-letter-faces nil
237 "Faces used in message drafts."
238 :link '(custom-manual "(mh-e)Editing Drafts")
239 :prefix "mh-"
240 :group 'mh-faces
241 :group 'mh-letter)
243 (defgroup mh-show-faces nil
244 "Faces used in message display."
245 :link '(custom-manual "(mh-e)Reading Mail")
246 :prefix "mh-"
247 :group 'mh-faces
248 :group 'mh-show)
250 (defgroup mh-speed-faces nil
251 "Faces used in speedbar."
252 :link '(custom-manual "(mh-e)Speedbar")
253 :prefix "mh-"
254 :group 'mh-faces
255 :group 'mh-speed)
259 ;;; Emacs interface to the MH mail system (:group mh-e)
260 (eval-when (compile)
261 (setq mh-variant 'none))
263 (defcustom mh-variant 'autodetect
264 "*Specifies the variant used by MH-E.
266 The default setting of this option is `Auto-detect' which means that MH-E will
267 automatically choose the first of nmh, MH, or GNU mailutils that it finds in
268 the directories listed in `mh-path', `mh-sys-path', and `exec-path'. If, for
269 example, you have both nmh and mailutils installed and `mh-variant-in-use' was
270 initialized to nmh but you want to use mailutils, then you can set this option
271 to `mailutils'.
273 When this variable is changed, MH-E resets `mh-progs', `mh-lib',
274 `mh-lib-progs', `mh-flists-present-flag', and `mh-variant-in-use'
275 accordingly."
276 :type `(radio
277 (const :tag "Auto-detect" autodetect)
278 ,@(mapcar (lambda (x) `(const ,(car x))) (mh-variants)))
279 :set (lambda (symbol value)
280 (set-default symbol value) ;Done in mh-variant-set-variant!
281 (mh-variant-set value))
282 :group 'mh-e)
286 ;;; Aliases (:group 'mh-alias)
288 (defcustom mh-alias-completion-ignore-case-flag t
289 "*Non-nil means don't consider case significant in MH alias completion.
290 As MH ignores case in the aliases, so too does MH-E. However, you may turn
291 this option off to make case significant which can be used to segregate
292 completion of your aliases. You might use lowercase for mailing lists and
293 uppercase for people."
294 :type 'boolean
295 :group 'mh-alias)
297 (defcustom mh-alias-expand-aliases-flag nil
298 "*Non-nil means to expand aliases entered in the minibuffer.
299 In other words, aliases entered in the minibuffer will be expanded to the full
300 address in the message draft. By default, this expansion is not performed."
301 :type 'boolean
302 :group 'mh-alias)
304 (defcustom mh-alias-flash-on-comma t
305 "*Specify whether to flash address or warn on translation.
306 This option controls the behavior when a [comma] is pressed while entering
307 aliases or addresses. The default setting flashes the address associated with
308 an address in the minibuffer briefly, but does not display a warning if the
309 alias is not found."
310 :type '(choice (const :tag "Flash but Don't Warn If No Alias" t)
311 (const :tag "Flash and Warn If No Alias" 1)
312 (const :tag "Don't Flash Nor Warn If No Alias" nil))
313 :group 'mh-alias)
315 (defcustom mh-alias-insert-file nil
316 "*Filename used to store a new MH-E alias.
317 The default setting of this option is `Use Aliasfile Profile Component'. This
318 option can also hold the name of a file or a list a file names. If this option
319 is set to a list of file names, or the `Aliasfile:' profile component contains
320 more than one file name, MH-E will prompt for one of them when MH-E adds an
321 alias."
322 :type '(choice (const :tag "Use Aliasfile Profile Component" nil)
323 (file :tag "Alias File")
324 (repeat :tag "List of Alias Files" file))
325 :group 'mh-alias)
327 (defcustom mh-alias-insertion-location 'sorted
328 "Specifies where new aliases are entered in alias files.
329 This option is set to `Alphabetical' by default. If you organize your alias
330 file in other ways, then adding aliases to the `Top' or `Bottom' of your alias
331 file might be more appropriate."
332 :type '(choice (const :tag "Alphabetical" sorted)
333 (const :tag "Top" top)
334 (const :tag "Bottom" bottom))
335 :group 'mh-alias)
337 (defcustom mh-alias-local-users t
338 "*If on, local users are added to alias completion.
340 Aliases are created from `/etc/passwd' entries with a user ID larger than
341 a magical number, typically 200. This can be a handy tool on a machine where
342 you and co-workers exchange messages. These aliases have the form
343 `local.first.last' if a real name is present in the password file.
344 Otherwise, the alias will have the form `local.login'.
346 If you're on a system with thousands of users you don't know, and the loading
347 of local aliases slows MH-E down noticeably, then turn this option off.
349 This option also takes a string which is executed to generate the password
350 file. For example, use \"ypcat passwd\" to obtain the NIS password file."
351 :type '(choice (boolean) (string))
352 :group 'mh-alias)
354 (defcustom mh-alias-local-users-prefix "local."
355 "*String prefixed to the real names of users from the password file.
356 This option can also be set to `Use Login'.
358 For example, consider the following password file entry:
360 psg:x:1000:1000:Peter S Galbraith,,,:/home/psg:/bin/tcsh
362 The following settings of this option will produce the associated aliases:
364 \"local.\" local.peter.galbraith
365 \"\" peter.galbraith
366 Use Login psg
368 This option has no effect if variable `mh-alias-local-users' is turned off."
369 :type '(choice (const :tag "Use Login" nil)
370 (string))
371 :group 'mh-alias)
373 (defcustom mh-alias-passwd-gecos-comma-separator-flag t
374 "*Non-nil means the gecos field in the password file uses a comma separator.
375 In the example in `mh-alias-local-users-prefix', commas are used to separate
376 different values within the so-called gecos field. This is a fairly common
377 usage. However, in the rare case that the gecos field in your password file is
378 not separated by commas and whose contents may contain commas, you can turn
379 this option off."
380 :type 'boolean
381 :group 'mh-alias)
385 ;;; Organizing Your Mail with Folders (:group 'mh-folder)
387 (defcustom mh-new-messages-folders t
388 "Folders searched for the \"unseen\" sequence.
390 Set this option to \"Inbox\" to search the \"+inbox\" folder or \"All\" to
391 search all of the top level folders. Otherwise, list the folders that should
392 be searched with the \"Choose Folders\" menu item.
394 See also `mh-recursive-folders-flag'."
395 :type '(choice (const :tag "Inbox" t)
396 (const :tag "All" nil)
397 (repeat :tag "Choose Folders" (string :tag "Folder")))
398 :group 'mh-folder)
400 (defcustom mh-ticked-messages-folders t
401 "Folders searched for `mh-tick-seq'.
403 Set this option to \"Inbox\" to search the \"+inbox\" folder or \"All\" to
404 search all of the top level folders. Otherwise, list the folders that should
405 be searched with the \"Choose Folders\" menu item.
407 See also `mh-recursive-folders-flag'."
408 :type '(choice (const :tag "Inbox" t)
409 (const :tag "All" nil)
410 (repeat :tag "Choose Folders" (string :tag "Folder")))
411 :group 'mh-folder)
413 (defcustom mh-large-folder 200
414 "The number of messages that indicates a large folder.
415 If a folder is deemed to be large, that is the number of messages in it exceed
416 this value, then confirmation is needed when it is visited. Even when
417 `mh-show-threads-flag' is non-nil, the folder is not automatically threaded, if
418 it is large. If set to nil all folders are treated as if they are small."
419 :type '(choice (const :tag "No Limit") integer)
420 :group 'mh-folder)
422 (defcustom mh-recenter-summary-flag nil
423 "*Non-nil means to recenter the summary window.
424 If this option is turned on, recenter the summary window when the show window
425 is toggled off."
426 :type 'boolean
427 :group 'mh-folder)
429 (defcustom mh-recursive-folders-flag nil
430 "*Non-nil means that commands which operate on folders do so recursively."
431 :type 'boolean
432 :group 'mh-folder)
434 (defcustom mh-sortm-args nil
435 "*Additional arguments for \"sortm\"\\<mh-folder-mode-map>.
437 This option is consulted when a prefix argument is used with
438 \\[mh-sort-folder]. Normally default arguments to \"sortm\" are specified in
439 the MH profile. This option may be used to provide an alternate view. For
440 example, \"'(\"-nolimit\" \"-textfield\" \"subject\")\" is a useful setting."
441 :type 'string
442 :group 'mh-folder)
446 ;;; Folder Selection (:group 'mh-folder-selection)
448 (defcustom mh-default-folder-for-message-function nil
449 "Function to select a default folder for refiling or `Fcc'.
450 The current buffer is set to the message being refiled with point at the start
451 of the message. This function should return the default folder as a string
452 with a leading `+' sign. It can also return nil so that the last folder name
453 is used as the default, or an empty string to suppress the default entirely."
454 :type 'function
455 :group 'mh-folder-selection)
457 (defcustom mh-default-folder-list nil
458 "*List of addresses and folders.
459 The folder name associated with the first address found in this list is used
460 as the default for `mh-refile-msg' and similar functions. Each element in this
461 list contains a `Check Recipient' item. If this item is turned on, then the
462 address is checked against the recipient instead of the sender. This is useful
463 for mailing lists.
465 See `mh-prompt-for-refile-folder' and `mh-folder-from-address' for more
466 information."
467 :type '(repeat (list (regexp :tag "Address")
468 (string :tag "Folder")
469 (boolean :tag "Check Recipient")))
470 :group 'mh-folder-selection)
472 (defcustom mh-default-folder-must-exist-flag t
473 "*Non-nil means guessed folder name must exist to be used.
474 If the derived folder does not exist, and this option is on, then the last
475 folder name used is suggested. This is useful if you get mail from various
476 people for whom you have an alias, but file them all in the same project
477 folder.
479 See `mh-prompt-for-refile-folder' and `mh-folder-from-address' for more
480 information."
481 :type 'boolean
482 :group 'mh-folder-selection)
484 (defcustom mh-default-folder-prefix ""
485 "*Prefix used for folder names generated from aliases.
486 The prefix is used to prevent clutter in your mail directory.
488 See `mh-prompt-for-refile-folder' and `mh-folder-from-address' for more
489 information."
490 :type 'string
491 :group 'mh-folder-selection)
495 ;;; Identities (:group 'mh-identity)
497 (defcustom mh-identity-list nil
498 "*List of identities.
500 To customize this option, click on the `INS' button and enter a label such as
501 `Home' or `Work'. Then click on the `INS' button with the label `Add at least
502 one item below'. Then choose one of the items in the `Value Menu'.
504 You can specify an alternate `From:' header field using the `From Field' menu
505 item. You must include a valid email address. A standard format is `First Last
506 <login@@host.domain>'. If you use an initial with a period, then you must
507 quote your name as in `\"First I. Last\" <login@@host.domain>'. People usually
508 list the name of the company where they work using the `Organization Field'
509 menu item. Set any arbitrary header field and value in the `Other Field' menu
510 item. Unless the header field is a standard one, precede the name of your
511 field's label with `X-', as in `X-Fruit-of-the-Day:'. The value of
512 `Attribution Verb' overrides the setting of
513 `mh-extract-from-attribution-verb'. Set your signature with the `Signature'
514 menu item. You can specify the contents of `mh-signature-file-name', a file,
515 or a function. Specify a different key to sign or encrypt messages with the
516 `GPG Key ID' menu item.
518 You can select the identities you have added via the menu called `Identity' in
519 the MH-Letter buffer. You can also use \\[mh-insert-identity]. To clear the
520 fields and signature added by the identity, select the `None' identity.
522 The `Identity' menu contains two other items to save you from having to set
523 the identity on every message. The menu item `Set Default for Session' can be
524 used to set the default identity to the current identity until you exit Emacs.
525 The menu item `Save as Default' sets the option `mh-identity-default' to the
526 current identity setting. You can also customize the `mh-identity-default'
527 option in the usual fashion."
528 :type '(repeat (list :tag ""
529 (string :tag "Label")
530 (repeat :tag "Add at least one item below"
531 (choice
532 (cons :tag "From Field"
533 (const "From")
534 (string :tag "Value"))
535 (cons :tag "Organization Field"
536 (const "Organization")
537 (string :tag "Value"))
538 (cons :tag "Other Field"
539 (string :tag "Field")
540 (string :tag "Value"))
541 (cons :tag "Attribution Verb"
542 (const ":attribution-verb")
543 (string :tag "Value"))
544 (cons :tag "Signature"
545 (const :tag "Signature"
546 ":signature")
547 (choice
548 (const :tag "mh-signature-file-name"
549 nil)
550 (file)
551 (function)))
552 (cons :tag "GPG Key ID"
553 (const :tag "GPG Key ID"
554 ":pgg-default-user-id")
555 (string :tag "Value"))))))
556 :set 'mh-identity-list-set
557 :group 'mh-identity)
559 (defcustom mh-auto-fields-list nil
560 "List of recipients for which header lines are automatically inserted.
562 This option can be used to set the identity depending on the recipient. To
563 customize this option, click on the `INS' button and enter a regular
564 expression for the recipient's address. Click on the `INS' button with the
565 `Add at least one item below' label. Then choose one of the items in the
566 `Value Menu'.
568 The `Identity' menu item is used to select an identity from those configured
569 in `mh-identity-list'. All of the information for that identity will be added
570 if the recipient matches. The `Fcc Field' menu item is used to select a folder
571 that is used in the `Fcc:' header. When you send the message, MH will put a
572 copy of your message in this folder. The `Mail-Followup-To Field' menu item is
573 used to insert an `Mail-Followup-To:' header field with the recipients you
574 provide. If the recipient's mail user agent supports this header field (as nmh
575 does), then their replies will go to the addresses listed. This is useful if
576 their replies go both to the list and to you and you don't have a mechanism to
577 suppress duplicates. If you reply to someone not on the list, you must either
578 remove the `Mail-Followup-To:' field, or ensure the recipient is also listed
579 there so that he receives replies to your reply. Other header fields may be
580 added using the `Other Field' menu item.
582 These fields can only be added after the recipient is known. Once the header
583 contains one or more recipients, run the \\[mh-insert-auto-fields] command or
584 choose the `Identity -> Insert Auto Fields' menu item to insert these fields
585 manually. However, you can just send the message and the fields will be added
586 automatically. You are given a chance to see these fields and to confirm them
587 before the message is actually sent. You can do away with this confirmation by
588 turning off the option `mh-auto-fields-prompt-flag'.
590 You should avoid using the same header field in `mh-auto-fields-list' and
591 `mh-identity-list' definitions that may apply to the same message as the
592 result is undefined."
593 :type `(repeat
594 (list :tag ""
595 (string :tag "Recipient")
596 (repeat :tag "Add at least one item below"
597 (choice
598 (cons :tag "Identity"
599 (const ":identity")
600 ,(append
601 '(radio)
602 (mapcar
603 (function (lambda (arg) `(const ,arg)))
604 (mapcar 'car mh-identity-list))))
605 (cons :tag "Fcc Field"
606 (const "fcc")
607 (string :tag "Value"))
608 (cons :tag "Mail-Followup-To Field"
609 (const "Mail-Followup-To")
610 (string :tag "Value"))
611 (cons :tag "Other Field"
612 (string :tag "Field")
613 (string :tag "Value"))))))
614 :group 'mh-identity)
616 (defcustom mh-auto-fields-prompt-flag t
617 "*Non-nil means to prompt before sending if fields inserted.
618 See `mh-auto-fields-list'."
619 :type 'boolean
620 :group 'mh-identity)
622 (defcustom mh-identity-default nil
623 "Default identity to use when `mh-letter-mode' is called.
624 See `mh-identity-list'."
625 :type (append
626 '(radio)
627 (cons '(const :tag "None" nil)
628 (mapcar (function (lambda (arg) `(const ,arg)))
629 (mapcar 'car mh-identity-list))))
630 :group 'mh-identity)
632 (defcustom mh-identity-handlers
633 '(("From" . mh-identity-handler-top)
634 (":default" . mh-identity-handler-bottom)
635 (":attribution-verb" . mh-identity-handler-attribution-verb)
636 (":signature" . mh-identity-handler-signature)
637 (":pgg-default-user-id" . mh-identity-handler-gpg-identity))
638 "Handler functions for fields in `mh-identity-list'.
640 This option is used to change the way that fields, signatures, and
641 attributions in `mh-identity-list' are added. To customize
642 `mh-identity-handlers', replace the name of an existing handler function
643 associated with the field you want to change with the name of a function you
644 have written. You can also click on an `INS' button and insert a field of your
645 choice and the name of the function you have written to handle it.
647 The `Field' field can be any field that you've used in your
648 `mh-identity-list'. The special fields `:attribution-verb', `:signature', or
649 `:pgg-default-user-id' are used for the `mh-identity-list' choices
650 `Attribution Verb', `Signature', and `GPG Key ID' respectively.
652 The handler associated with the `:default' field is used when no other field
653 matches.
655 The handler functions are passed two or three arguments: the FIELD itself (for
656 example, `From'), or one of the special fields (for example, `:signature'),
657 and the ACTION `'remove' or `'add'. If the action is `'add', an additional
658 argument containing the VALUE for the field is given."
659 :type '(repeat (cons (string :tag "Field") function))
660 :group 'mh-identity)
664 ;;; Incorporating Your Mail (:group 'mh-inc)
666 (defcustom mh-inc-prog "inc"
667 "*Program to incorporate new mail into a folder.
669 This program generates a one-line summary for each of the new messages. Unless
670 it is an absolute pathname, the file is assumed to be in the `mh-progs'
671 directory. You may also link a file to `inc' that uses a different format.
672 You'll then need to modify several scan line format variables appropriately."
673 :type 'string
674 :group 'mh-inc)
676 (defcustom mh-inc-spool-list nil
677 "*Alternate spool files.
679 You can use the `mh-inc-spool-list' variable to direct MH-E to retrieve mail
680 from arbitrary spool files other than your system mailbox, file it in folders
681 other than your `+inbox', and assign key bindings to incorporate this mail.
683 Suppose you are subscribed to the `mh-e-devel' mailing list and you use
684 `procmail' to filter this mail into `~/mail/mh-e' with the following recipe in
685 `.procmailrc':
687 MAILDIR=$HOME/mail
689 * ^From mh-e-devel-admin@stop.mail-abuse.org
690 mh-e
692 In order to incorporate `~/mail/mh-e' into `+mh-e' with an `I m'
693 \(`mh-inc-spool-mh-e'\) command, customize this option, and click on the `INS'
694 button. Enter a `Spool File' of `~/mail/mh-e', a `Folder' of `mh-e', and a
695 `Key Binding' of `m'.
697 You can use `xbuffy' to automate the incorporation of this mail using the
698 `gnudoit' command in the `gnuserv' package as follows:
700 box ~/mail/mh-e
701 title mh-e
702 origMode
703 polltime 10
704 headertime 0
705 command gnudoit -q '(mh-inc-spool-mh-e)'"
706 :type '(repeat (list (file :tag "Spool File")
707 (string :tag "Folder")
708 (character :tag "Key Binding")))
709 :set 'mh-inc-spool-list-set
710 :group 'mh-inc)
714 ;;; Searching (:group 'mh-index)
716 (defcustom mh-index-program nil
717 "Indexing program that MH-E shall use.
718 The default setting of this option is `Auto-detect' which means that MH-E will
719 automatically choose one of swish++, swish-e, mairix, namazu, pick and grep in
720 that order. If, for example, you have both swish++ and mairix installed and
721 you want to use mairix, then you can set this option to `mairix'.
723 More information about setting up an indexing program to use with MH-E can be
724 found in the documentation of `mh-index-search'."
725 :type '(choice (const :tag "Auto-detect" nil)
726 (const :tag "swish++" swish++)
727 (const :tag "swish-e" swish)
728 (const :tag "mairix" mairix)
729 (const :tag "namazu" namazu)
730 (const :tag "pick" pick)
731 (const :tag "grep" grep))
732 :group 'mh-index)
736 ;;; Dealing with Junk Mail (:group 'mh-junk)
738 ;; Spam fighting program chosen
739 (defvar mh-junk-choice nil)
741 ;; Available spam filter interfaces
742 (defvar mh-junk-function-alist
743 '((spamassassin mh-spamassassin-blacklist mh-spamassassin-whitelist)
744 (bogofilter mh-bogofilter-blacklist mh-bogofilter-whitelist)
745 (spamprobe mh-spamprobe-blacklist mh-spamprobe-whitelist))
746 "Available choices of spam programs to use.
747 This is an alist. For each element there are functions that blacklist a message
748 as spam and whitelist a message incorrectly classified as spam.")
750 (defun mh-junk-choose (symbol value)
751 "Choose spam program to use.
752 The function is always called with SYMBOL bound to `mh-junk-program' and VALUE
753 bound to the new value of `mh-junk-program'. The function sets the variable
754 `mh-junk-choice' in addition to `mh-junk-program'."
755 (set symbol value)
756 (setq mh-junk-choice
757 (or value
758 (loop for element in mh-junk-function-alist
759 until (executable-find (symbol-name (car element)))
760 finally return (car element)))))
762 ;; User customizable variables
763 (defcustom mh-junk-background nil
764 "If on, spam programs are run in background.
765 By default, the programs are run in the foreground, but this can be slow when
766 junking large numbers of messages. If you have enough memory or don't junk
767 that many messages at the same time, you might try turning on this option."
768 :type '(choice (const :tag "Off" nil)
769 (const :tag "On" 0))
770 :group 'mh-junk)
772 (defcustom mh-junk-disposition nil
773 "Disposition of junk mail."
774 :type '(choice (const :tag "Delete Spam" nil)
775 (string :tag "Spam Folder"))
776 :group 'mh-junk)
778 (defcustom mh-junk-program nil
779 "Spam program that MH-E should use.
781 The default setting of this option is \"Auto-detect\" which means that MH-E
782 will automatically choose one of SpamAssassin, bogofilter, or SpamProbe in
783 that order. If, for example, you have both SpamAssassin and bogofilter
784 installed and you want to use bogofilter, then you can set this option to
785 \"Bogofilter\"."
786 :type '(choice (const :tag "Auto-detect" nil)
787 (const :tag "SpamAssassin" spamassassin)
788 (const :tag "Bogofilter" bogofilter)
789 (const :tag "SpamProbe" spamprobe))
790 :set 'mh-junk-choose
791 :group 'mh-junk)
795 ;;; Editing a Draft (:group 'mh-letter)
797 (defcustom mh-compose-insertion (if (locate-library "mml") 'mml 'mh)
798 "Type of tags used when composing MIME messages.
799 In addition to MH-style directives, MH-E also supports MML (MIME Meta
800 Language) tags. (see Info node `(emacs-mime)Composing'). This option can be
801 used to choose between them. By default, this option is set to \"MML\" if it
802 is supported since it provides a lot more functionality. This option can also
803 be set to \"MH\" if MH-style directives are preferred."
804 :type '(choice (const :tag "MML" mml)
805 (const :tag "MH" mh))
806 :group 'mh-letter)
808 (defcustom mh-compose-skipped-header-fields
809 '("From" "Organization" "References" "In-Reply-To"
810 "X-Face" "Face" "X-Image-URL" "X-Mailer")
811 "List of header fields to skip over when navigating in draft."
812 :type '(repeat (string :tag "Field"))
813 :group 'mh-letter)
815 (defcustom mh-compose-space-does-completion-flag nil
816 "*Non-nil means \\<mh-letter-mode-map>\\[mh-letter-complete-or-space] does completion in message header."
817 :type 'boolean
818 :group 'mh-letter)
820 (defcustom mh-delete-yanked-msg-window-flag nil
821 "*Non-nil means delete any window displaying the message.
822 This deletes the window containing the original message after yanking it with
823 \\<mh-letter-mode-map>\\[mh-yank-cur-msg] to make more room on your screen for
824 your reply."
825 :type 'boolean
826 :group 'mh-letter)
828 (defcustom mh-extract-from-attribution-verb "wrote:"
829 "*Verb to use for attribution when a message is yanked by \\<mh-letter-mode-map>\\[mh-yank-cur-msg].
830 The attribution consists of the sender's name and email address followed by
831 the content of this option. This option can be set to \"wrote:\", \"a
832 écrit:\", and \"schrieb:\". You can also use the \"Custom String\" menu item
833 to enter your own verb."
834 :type '(choice (const "wrote:")
835 (const "a écrit:")
836 (const "schrieb:")
837 (string :tag "Custom String"))
838 :group 'mh-letter)
840 (defcustom mh-ins-buf-prefix "> "
841 "*String to put before each line of a yanked or inserted message.
842 The prefix \"> \" is the default setting of this option. I suggest that you
843 not modify this option since it is used by many mailers and news readers:
844 messages are far easier to read if several included messages have all been
845 indented by the same string."
846 :type 'string
847 :group 'mh-letter)
849 (defcustom mh-letter-complete-function 'ispell-complete-word
850 "*Function to call when completing outside of address or folder fields.
851 In the body of the message, \\<mh-letter-mode-map>\\[mh-letter-complete] runs
852 this function, which is set to \"ispell-complete-word\" by default."
853 :type '(choice function (const nil))
854 :group 'mh-letter)
856 (defcustom mh-letter-fill-column 72
857 "*Fill column to use in MH Letter mode.
858 By default, this option is 72 to allow others to quote your message without
859 line wrapping."
860 :type 'integer
861 :group 'mh-letter)
863 (defcustom mh-mml-method-default (if mh-pgp-support-flag "pgpmime" "none")
864 "Default method to use in security tags.
865 This option is used to select between a variety of mail security mechanisms.
866 The default is \"PGP (MIME)\" if it is supported\; otherwise, the default is
867 \"None\". Other mechanisms include vanilla \"PGP\" and \"S/MIME\".
869 The `pgg' customization group may have some settings which may interest you
870 \(see Info node `(pgg)').
872 In particular, I set the option `pgg-encrypt-for-me' to t so that all messages
873 I encrypt are encrypted with my public key as well. If you keep a copy of all
874 of your outgoing mail with a \"Fcc:\" header field, this setting is vital so
875 that you can read the mail you write!"
876 :type '(choice (const :tag "PGP (MIME)" "pgpmime")
877 (const :tag "PGP" "pgp")
878 (const :tag "S/MIME" "smime")
879 (const :tag "None" "none"))
880 :group 'mh-letter)
882 (defcustom mh-signature-file-name "~/.signature"
883 "*Source of user's signature.
885 By default, the text of your signature is taken from the file \"~/.signature\".
886 You can read from other files by changing this option. This file may contain a
887 vCard in which case an attachment is added with the vCard.
889 This option may also be a symbol, in which case that function is called. You
890 may not want a signature separator to be added for you; instead you may want
891 to insert one yourself. Options that you may find useful to do this include
892 `mh-signature-separator' (when inserting a signature separator) and
893 `mh-signature-separator-regexp' (for finding said separator). The function
894 `mh-signature-separator-p', which reports t if the buffer contains a
895 separator, may be useful as well.
897 The signature is inserted into your message with the command
898 \\<mh-letter-mode-map>\\[mh-insert-signature] or with the `mh-identity-list'
899 option."
900 :type 'file
901 :group 'mh-letter)
903 (defcustom mh-signature-separator-flag t
904 "*Non-nil means a signature separator should be inserted.
905 It is not recommended that you change this option since various mail user
906 agents, including MH-E, use the separator to present the signature
907 differently, and to suppress the signature when replying or yanking a letter
908 into a draft."
909 :type 'boolean
910 :group 'mh-letter)
912 (defcustom mh-x-face-file "~/.face"
913 "*File containing face header field to insert in outgoing mail.
915 If the file starts with either of the strings \"X-Face:\", \"Face:\" or
916 \"X-Image-URL:\" then the contents are added to the message header verbatim.
917 Otherwise it is assumed that the file contains the value of the \"X-Face:\"
918 header field.
920 The \"X-Face:\" header field, which is a low-resolution, black
921 and white image, can be generated using the \"compface\" command
922 \(see URL `ftp://ftp.cs.indiana.edu/pub/faces/compface/compface.tar.Z').
923 The \"Online X-Face Converter\" is a useful resource for quick
924 conversion of images into \"X-Face:\" header fields (see URL
925 `http://www.dairiki.org/xface/').
927 Use the \"make-face\" script to convert a JPEG image to the
928 higher resolution, color, \"Face:\" header field (see URL
929 `http://quimby.gnus.org/circus/face/make-face').
931 The URL of any image can be used for the \"X-Image-URL:\" field and no
932 processing of the image is required.
934 To prevent the setting of any of these header fields, either set
935 `mh-x-face-file' to nil, or simply ensure that the file defined by this option
936 doesn't exist."
937 :type 'file
938 :group 'mh-letter)
940 (defcustom mh-yank-behavior 'attribution
941 "*Controls which part of a message is yanked by \\<mh-letter-mode-map>\\[mh-yank-cur-msg].
943 To include the entire message, including the entire header, use \"Body and
944 Header\". Use \"Body\" to yank just the body without the header. To yank only
945 the portion of the message following the point, set this option to \"Below
946 Point\".
948 Choose \"Invoke supercite\" to pass the entire message and header through
949 supercite.
951 If the \"Body With Attribution\" setting is used, then the message minus the
952 header is yanked and a simple attribution line is added at the top using the
953 value of the `mh-extract-from-attribution-verb' option. This is the default.
955 If the \"Invoke supercite\" or \"Body With Attribution\" settings are used,
956 the \"-noformat\" argument is passed to the \"repl\" program to override a
957 \"-filter\" or \"-format\" argument. These settings also have
958 \"Automatically\" variants that perform the action automatically when you
959 reply so that you don't need to use \\[mh-yank-cur-msg] at all. Note that this
960 automatic action is only performed if the show buffer matches the message
961 being replied to. People who use the automatic variants tend to turn on the
962 `mh-delete-yanked-msg-window-flag' option as well so that the show window is
963 never displayed.
965 If the show buffer has a region, the `mh-yank-behavior' option is ignored
966 unless its value is one of Attribution variants in which case the attribution
967 is added to the yanked region."
968 :type '(choice (const :tag "Body and Header" t)
969 (const :tag "Body" body)
970 (const :tag "Below Point" nil)
971 (const :tag "Invoke supercite" supercite)
972 (const :tag "Invoke supercite, Automatically" autosupercite)
973 (const :tag "Body With Attribution" attribution)
974 (const :tag "Body With Attribution, Automatically"
975 autoattrib))
976 :group 'mh-letter)
980 ;;; Ranges (:group 'mh-ranges)
982 (defcustom mh-interpret-number-as-range-flag t
983 "*Non-nil means interpret a number as a range.
984 Since one of the most frequent ranges used is \"last:N\", MH-E will interpret
985 input such as \"200\" as \"last:200\" if this option is on (which is the
986 default). If you need to scan just the message 200, then use the range
987 \"200:200\"."
988 :type 'boolean
989 :group 'mh-ranges)
993 ;;; Scan Line Formats (:group 'mh-scan-line-formats)
995 ;;; Forward definition to avoid compiler and runtime error.
996 (defvar mh-scan-format-file t)
998 (defun mh-adaptive-cmd-note-flag-check (symbol value)
999 "Check if desired setting is legal.
1000 Throw an error if user tries to turn on `mh-adaptive-cmd-note-flag' when
1001 `mh-scan-format-file' isn't t. Otherwise, set SYMBOL to VALUE."
1002 (if (and value
1003 (not (eq mh-scan-format-file t)))
1004 (error "%s %s" "Can't turn on unless mh-scan-format-file"
1005 "is set to \"Use MH-E scan Format\"")
1006 (set-default symbol value)))
1008 (defun mh-scan-format-file-check (symbol value)
1009 "Check if desired setting is legal.
1010 Throw an error if user tries to set `mh-scan-format-file' to anything but t
1011 when `mh-adaptive-cmd-note-flag' is on. Otherwise, set SYMBOL to VALUE."
1012 (if (and (not (eq value t))
1013 (eq mh-adaptive-cmd-note-flag t))
1014 (error "%s %s" "You must turn off mh-adaptive-cmd-note-flag"
1015 "unless you use \"Use MH-E scan Format\"")
1016 (set-default symbol value)))
1018 (defcustom mh-adaptive-cmd-note-flag t
1019 "*Non-nil means that the message number width is determined dynamically.
1020 If you've created your own format to handle long message numbers, you'll be
1021 pleased to know you no longer need it since MH-E adapts its internal format
1022 based upon the largest message number if this option is on (the default).
1023 This option may only be turned on when `mh-scan-format-file' is set to \"Use
1024 MH-E scan Format\".
1026 If you prefer fixed-width message numbers, turn off this option and call
1027 `mh-set-cmd-note' with the width specified by your format file
1028 \(see `mh-scan-format-file'). For example, the default width is 4, so you would
1029 use \"(mh-set-cmd-note 4)\"."
1030 :type 'boolean
1031 :group 'mh-scan-line-formats
1032 :set 'mh-adaptive-cmd-note-flag-check)
1034 (defcustom mh-scan-format-file t
1035 "Specifies the format file to pass to the scan program.
1037 The default setting for this option is \"Use MH-E scan Format\". This means
1038 that the format string will be taken from the either `mh-scan-format-mh' or
1039 `mh-scan-format-nmh' depending on whether MH or nmh (or GNU mailutils) is in
1040 use. This setting also enables you to turn on the `mh-adaptive-cmd-note-flag'
1041 option.
1043 You can also set this option to \"Use Default scan Format\" to get the
1044 same output as you would get if you ran \"scan\" from the shell. If you have a
1045 format file that you want MH-E to use but not MH, you can set this option to
1046 \"Specify a scan Format File\" and enter the name of your format file.
1048 If you change the format of the scan lines you'll need to tell MH-E how to
1049 parse the new format. As you will see, quite a lot of variables are involved
1050 to do that. Use \"\\[apropos] RET mh-scan.*regexp\" to obtain a list of these
1051 variables. You will also have to call `mh-set-cmd-note' if your notations are
1052 not in column 4 (columns in Emacs start with 0)."
1053 :type '(choice (const :tag "Use MH-E scan Format" t)
1054 (const :tag "Use Default scan Format" nil)
1055 (file :tag "Specify a scan Format File"))
1056 :group 'mh-scan-line-formats
1057 :set 'mh-scan-format-file-check)
1059 (defcustom mh-scan-prog "scan"
1060 "*Program used to scan messages.
1061 The name of the program that generates a listing of one line per message is
1062 held in this option. Unless this variable contains an absolute pathname, it is
1063 assumed to be in the `mh-progs' directory. You may link another program to
1064 `scan' (see \"mh-profile(5)\") to produce a different type of listing."
1065 :type 'string
1066 :group 'mh-scan-line-formats)
1067 (make-variable-buffer-local 'mh-scan-prog)
1071 ;;; Sending Mail (:group 'mh-sending-mail)
1073 (defcustom mh-compose-forward-as-mime-flag t
1074 "*Non-nil means that messages are forwarded as attachments.
1076 By default, this option is on which means that the forwarded messages are
1077 included as attachments. If you would prefer to forward your messages verbatim
1078 \(as text, inline), then turn off this option. Forwarding messages verbatim
1079 works well for short, textual messages, but your recipient won't be able to
1080 view any non-textual attachments that were in the forwarded message. Be aware
1081 that if you have \"forw: -mime\" in your MH profile, then forwarded messages
1082 will always be included as attachments regardless of the settings of this
1083 option."
1084 :type 'boolean
1085 :group 'mh-sending-mail)
1087 (defcustom mh-compose-letter-function nil
1088 "Invoked when starting a new draft.
1090 However, it is the last function called before you edit your message. The
1091 consequence of this is that you can write a function to write and send the
1092 message for you. This function is passed three arguments: the contents of the
1093 TO, SUBJECT, and CC header fields."
1094 :type '(choice (const nil) function)
1095 :group 'mh-sending-mail)
1097 (defcustom mh-compose-prompt-flag nil
1098 "*Non-nil means prompt for header fields when composing a new draft."
1099 :type 'boolean
1100 :group 'mh-sending-mail)
1102 (defcustom mh-forward-subject-format "%s: %s"
1103 "*Format string for forwarded message subject.
1105 This option is a string which includes two escapes (\"%s\"). The first \"%s\"
1106 is replaced with the sender of the original message, and the second one is
1107 replaced with the original \"Subject:\"."
1108 :type 'string
1109 :group 'mh-sending-mail)
1111 (defcustom mh-insert-x-mailer-flag t
1112 "*Non-nil means append an \"X-Mailer:\" header field to the header.
1114 This header field includes the version of MH-E and Emacs that you are using.
1115 If you don't want to participate in our marketing, you can turn this option
1116 off."
1117 :type 'boolean
1118 :group 'mh-sending-mail)
1120 (defcustom mh-redist-full-contents-flag nil
1121 "*Non-nil means the \"dist\" command needs entire letter for redistribution.
1123 This option must be turned on if \"dist\" requires the whole letter for
1124 redistribution, which is the case if \"send\" is compiled with the BERK option
1125 \(which many people abhor). If you find that MH will not allow you to
1126 redistribute a message that has been redistributed before, turn off this
1127 option."
1128 :type 'boolean
1129 :group 'mh-sending-mail)
1131 (defcustom mh-reply-default-reply-to nil
1132 "*Sets the person or persons to whom a reply will be sent.
1134 This option is set to \"Prompt\" by default so that you are prompted for the
1135 recipient of a reply. If you find that most of the time that you specify
1136 \"cc\" when you reply to a message, set this option to \"cc\". Other choices
1137 include \"from\", \"to\", or \"all\". You can always edit the recipients in
1138 the draft."
1139 :type '(choice (const :tag "Prompt" nil)
1140 (const "from")
1141 (const "to")
1142 (const "cc")
1143 (const "all"))
1144 :group 'mh-sending-mail)
1146 (defcustom mh-reply-show-message-flag t
1147 "*Non-nil means the MH-Show buffer is displayed when replying.
1149 If you include the message automatically, you can hide the MH-Show
1150 buffer by turning off this option.
1152 See also `mh-reply'."
1153 :type 'boolean
1154 :group 'mh-sending-mail)
1158 ;;; Sequences (:group 'mh-sequences)
1160 ;;; If `mh-unpropagated-sequences' becomes a defcustom, add the following to
1161 ;;; the docstring: "Additional sequences that should not to be preserved can be
1162 ;;; specified by setting `mh-unpropagated-sequences' appropriately." XXX
1164 (defcustom mh-refile-preserves-sequences-flag t
1165 "*Non-nil means that sequences are preserved when messages are refiled.
1167 If a message is in any sequence (except \"Previous-Sequence:\" and \"cur\")
1168 when it is refiled, then it will still be in those sequences in the
1169 destination folder. If this behavior is not desired, then turn off this
1170 option."
1171 :type 'boolean
1172 :group 'mh-sequences)
1174 (defcustom mh-tick-seq 'tick
1175 "The name of the MH sequence for ticked messages.
1177 You can customize this option if you already use the \"tick\" sequence for
1178 your own use. You can also disable all of the ticking functions by choosing
1179 the \"Disable Ticking\" item but there isn't much advantage to that."
1180 :type '(choice (const :tag "Disable Ticking" nil)
1181 symbol)
1182 :group 'mh-sequences)
1184 (defcustom mh-update-sequences-after-mh-show-flag t
1185 "*Non-nil means flush MH sequences to disk after message is shown.
1187 Three sequences are maintained internally by MH-E and pushed out to MH when a
1188 message is shown. They include the sequence specified by your
1189 \"Unseen-Sequence:\" profile entry, \"cur\", and the sequence listed by the
1190 option `mh-tick-seq' which is \"tick\" by default. If you do not like this
1191 behavior, turn off this option. You can then update the state manually with
1192 the `\\[mh-execute-commands]', `\\[mh-quit]', or `\\[mh-update-sequences]'
1193 commands."
1194 :type 'boolean
1195 :group 'mh-sequences)
1199 ;;; Reading Your Mail (:group 'mh-show)
1201 (defcustom mh-bury-show-buffer-flag t
1202 "*Non-nil means show buffer is buried.
1204 One advantage of not burying the show buffer is that one can delete the show
1205 buffer more easily in an electric buffer list because of its proximity to its
1206 associated MH-Folder buffer. Try running \\[electric-buffer-list] to see what
1207 I mean."
1208 :type 'boolean
1209 :group 'mh-show)
1211 (defcustom mh-clean-message-header-flag t
1212 "*Non-nil means remove extraneous header fields.
1214 See also `mh-invisible-header-fields-default' and
1215 `mh-invisible-header-fields'."
1216 :type 'boolean
1217 :group 'mh-show)
1219 (defcustom mh-decode-mime-flag (not (not (locate-library "mm-decode")))
1220 "*Non-nil means attachments are handled\\<mh-folder-mode-map>.
1222 MH-E can handle attachments as well if the Gnus `mm-decode' library is
1223 present. If so, this option will be on. Otherwise, you'll see the MIME body
1224 parts rather than text or attachments. There isn't much point in turning off
1225 this option; however, you can inspect it if it appears that the body parts are
1226 not being interpreted correctly or toggle it with the command
1227 \\[mh-toggle-mh-decode-mime-flag] to view the raw message.
1229 This option also controls the display of quoted-printable messages and other
1230 graphical widgets. See the options `mh-graphical-smileys-flag' and
1231 `mh-graphical-emphasis-flag'."
1232 :type 'boolean
1233 :group 'mh-show)
1235 (defcustom mh-display-buttons-for-alternatives-flag nil
1236 "*Non-nil means display buttons for all alternative attachments.
1238 Sometimes, a mail program will produce multiple alternatives of the attachment
1239 in increasing degree of faithfulness to the original content. By default, only
1240 the preferred alternative is displayed. If this option is on, then the
1241 preferred part is shown inline and buttons are shown for each of the other
1242 alternatives."
1243 :type 'boolean
1244 :group 'mh-show)
1246 (defcustom mh-display-buttons-for-inline-parts-flag nil
1247 "*Non-nil means display buttons for all inline attachments\\<mh-folder-mode-map>.
1249 The sender can request that attachments should be viewed inline so that they
1250 do not really appear like an attachment at all to the reader. Most of the
1251 time, this is desirable, so by default MH-E suppresses the buttons for inline
1252 attachments. On the other hand, you may receive code or HTML which the sender
1253 has added to his message as inline attachments so that you can read them in
1254 MH-E. In this case, it is useful to see the buttons so that you know you don't
1255 have to cut and paste the code into a file; you can simply save the
1256 attachment.
1258 If you want to make the buttons visible for inline attachments, you can use
1259 the command \\[mh-toggle-mime-buttons] to toggle the visibility of these
1260 buttons. You can turn on these buttons permanently by turning on this option.
1262 MH-E cannot display all attachments inline however. It can display
1263 text (including HTML) and images."
1264 :type 'boolean
1265 :group 'mh-show)
1267 (defcustom mh-do-not-confirm-flag nil
1268 "*Non-nil means non-reversible commands do not prompt for confirmation.
1270 Commands such as `mh-pack-folder' prompt to confirm whether to process
1271 outstanding moves and deletes or not before continuing. Turning on this option
1272 means that these actions will be performed--which is usually desired but
1273 cannot be retracted--without question."
1274 :type 'boolean
1275 :group 'mh-show)
1277 (defcustom mh-fetch-x-image-url nil
1278 "*Control fetching of \"X-Image-URL:\" header field image.
1280 Ths option controls the fetching of the \"X-Image-URL:\" header field image
1281 with the following values:
1283 Ask Before Fetching
1284 You are prompted before the image is fetched. MH-E will remember
1285 your reply and will either use the already fetched image the next
1286 time the same URL is encountered or silently skip it if you didn't
1287 fetch it the first time. This is a good setting.
1289 Never Fetch
1290 Images are never fetched and only displayed if they are already
1291 present in the cache. This is the default.
1293 There isn't a value of \"Always Fetch\" for privacy and DOS (denial of
1294 service) reasons. For example, fetching a URL can tip off a spammer that
1295 you've read his email (which is why you shouldn't blindly answer yes if you've
1296 set this option to \"Ask Before Fetching\"). Someone may also flood your
1297 network and fill your disk drive by sending a torrent of messages, each
1298 specifying a unique URL to a very large file.
1300 The cache of images is found in the directory \".mhe-x-image-cache\" within
1301 your MH directory. You can add your own face to the \"From:\" field too. See
1302 Info node `(mh-e)Picture'.
1304 This setting only has effect if the option `mh-show-use-xface-flag' is turned
1305 on."
1307 :type '(choice (const :tag "Ask Before Fetching" ask)
1308 (const :tag "Never Fetch" nil))
1309 :group 'mh-show)
1311 (defcustom mh-graphical-smileys-flag t
1312 "*Non-nil means graphical smileys are displayed.
1314 It is a long standing custom to inject body language using a cornucopia of
1315 punctuation, also known as the \"smileys\". MH-E can render these as graphical
1316 widgets if this option is turned on, which it is by default. Smileys include
1317 patterns such as :-) and ;-).
1319 This option is disabled if the option `mh-decode-mime-flag' is turned off."
1320 :type 'boolean
1321 :group 'mh-show)
1323 (defcustom mh-graphical-emphasis-flag t
1324 "*Non-nil means graphical emphasis is displayed.
1326 A few typesetting features are indicated in ASCII text with certain
1327 characters. If your terminal supports it, MH-E can render these typesetting
1328 directives naturally if this option is turned on, which it is by default. For
1329 example, _underline_ will be underlined, *bold* will appear in bold, /italics/
1330 will appear in italics, and so on. See the option `gnus-emphasis-alist' for
1331 the whole list.
1333 This option is disabled if the option `mh-decode-mime-flag' is turned off."
1334 :type 'boolean
1335 :group 'mh-show)
1337 (defcustom mh-highlight-citation-style 'gnus
1338 "Style for highlighting citations.
1340 If the sender of the message has cited other messages in his message, then
1341 MH-E will highlight these citations to emphasize the sender's actual response.
1342 This option can be customized to change the highlighting style. The
1343 \"Multicolor\" method uses a different color for each indentation while the
1344 \"Monochrome\" method highlights all citations in red. To disable highlighting
1345 of citations entirely, choose \"None\"."
1346 :type '(choice (const :tag "Multicolor" gnus)
1347 (const :tag "Monochrome" font-lock)
1348 (const :tag "None" nil))
1349 :group 'mh-show)
1351 ;; Keep fields alphabetized. Mention source, if known.
1352 (defvar mh-invisible-header-fields-internal
1353 '("Approved:"
1354 "Autoforwarded:"
1355 "Bestservhost:"
1356 "Cancel-Lock:" ; NNTP posts
1357 "Content-" ; RFC 2045
1358 "Delivered-To:" ; Egroups/yahoogroups mailing list manager
1359 "Delivery-Date:" ; MH
1360 "Delivery:"
1361 "DomainKey-Signature:" ;http://antispam.yahoo.com/domainkeys
1362 "Encoding:"
1363 "Envelope-to:"
1364 "Errors-To:"
1365 "Face:" ; Gnus Face header
1366 "Forwarded:" ; MH
1367 "From " ; sendmail
1368 "Importance:" ; MS Outlook
1369 "In-Reply-To:" ; MH
1370 "Lines:"
1371 "List-" ; Mailman mailing list manager
1372 "List-" ; Unknown mailing list managers
1373 "List-Subscribe:" ; Unknown mailing list managers
1374 "List-Unsubscribe:" ; Unknown mailing list managers
1375 "Mail-from:" ; MH
1376 "Mailing-List:" ; Egroups/yahoogroups mailing list manager
1377 "Message-Id:" ; RFC 822
1378 "Mime-Version" ; RFC 2045
1379 "NNTP-" ; News
1380 "Old-Return-Path:"
1381 "Original-Encoded-Information-Types:" ; X400
1382 "Original-Lines:" ; mail to news
1383 "Original-NNTP-" ; mail to news
1384 "Original-Newsgroups:" ; mail to news
1385 "Original-Path:" ; mail to news
1386 "Original-Received:" ; mail to news
1387 "Original-To:" ; mail to news
1388 "Original-X-" ; mail to news
1389 "Originator:"
1390 "P1-Content-Type:" ; X400
1391 "P1-Message-Id:" ; X400
1392 "P1-Recipient:" ; X400
1393 "Path:"
1394 "Precedence:"
1395 "Prev-Resent" ; MH
1396 "Priority:"
1397 "Received:" ; RFC 822
1398 "Received-SPF:" ; Gmail
1399 "References:"
1400 "Remailed-" ; MH
1401 "Replied:" ; MH
1402 "Resent" ; MH
1403 "Return-Path:" ; RFC 822
1404 "Sensitivity:" ; MS Outlook
1405 "Status:" ; sendmail
1406 "Thread-"
1407 "Ua-Content-Id:" ; X400
1408 ;; "User-Agent:" ; Similar to X-Mailer, so display it.
1409 "Via:" ; MH
1410 "X-Abuse-Info:"
1411 "X-Abuse-and-DMCA-"
1412 "X-Accept-Language:"
1413 "X-Accept-Language:" ; Netscape/Mozilla
1414 "X-Ack:"
1415 "X-Administrivia-To:"
1416 "X-AntiAbuse:" ; cPanel
1417 "X-Apparently-From:" ; MS Outlook
1418 "X-Apparently-To:" ; Egroups/yahoogroups mailing list manager
1419 "X-Authentication-Warning:" ; sendmail
1420 "X-Beenthere:" ; Mailman mailing list manager
1421 "X-Bogosity:" ; bogofilter
1422 "X-Bugzilla-*" ; Bugzilla
1423 "X-Complaints-To:"
1424 "X-Cron-Env:"
1425 "X-DMCA"
1426 "X-Delivered"
1427 "X-ELNK-Trace:" ; Earthlink mailer
1428 "X-Envelope-Date:" ; GNU mailutils
1429 "X-Envelope-From:"
1430 "X-Envelope-Sender:"
1431 "X-Envelope-To:"
1432 "X-Evolution:" ; Evolution mail client
1433 "X-Face:"
1434 "X-Folder:" ; Spam
1435 "X-From-Line"
1436 "X-Gmail-" ; Gmail
1437 "X-Gnus-Mail-Source:" ; gnus
1438 "X-Greylist:" ; milter-greylist-1.2.1
1439 "X-Habeas-SWE-1:" ; Spam
1440 "X-Habeas-SWE-2:" ; Spam
1441 "X-Habeas-SWE-3:" ; Spam
1442 "X-Habeas-SWE-4:" ; Spam
1443 "X-Habeas-SWE-5:" ; Spam
1444 "X-Habeas-SWE-6:" ; Spam
1445 "X-Habeas-SWE-7:" ; Spam
1446 "X-Habeas-SWE-8:" ; Spam
1447 "X-Habeas-SWE-9:" ; Spam
1448 "X-Info:" ; NTMail
1449 "X-Juno-" ; Juno
1450 "X-List-Host:" ; Unknown mailing list managers
1451 "X-List-Subscribe:" ; Unknown mailing list managers
1452 "X-List-Unsubscribe:" ; Unknown mailing list managers
1453 "X-Listprocessor-" ; ListProc(tm) by CREN
1454 "X-Listserver:" ; Unknown mailing list managers
1455 "X-Loop:" ; Unknown mailing list managers
1456 "X-MHE-Checksum" ; Checksum added during index search
1457 "X-MIME-Autoconverted:" ; sendmail
1458 "X-MIMETrack:"
1459 "X-Mms-" ; T-Mobile pictures
1460 "X-MS-" ; MS Outlook
1461 "X-MailScanner" ; ListProc(tm) by CREN
1462 "X-Mailing-List:" ; Unknown mailing list managers
1463 "X-Mailman-Version:" ; Mailman mailing list manager
1464 "X-Majordomo:" ; Majordomo mailing list manager
1465 "X-Message-Id"
1466 "X-MessageWall-Score:" ; Unknown mailing list manager, AUC TeX
1467 "X-MimeOLE:" ; MS Outlook
1468 "X-Mozilla-Status:" ; Netscape/Mozilla
1469 "X-Msmail-" ; MS Outlook
1470 "X-NAI-Spam-" ; Network Associates Inc. SpamKiller
1471 "X-News:" ; News
1472 "X-No-Archive:"
1473 "X-Notes-Item:" ; Lotus Notes Domino structured header
1474 "X-OperatingSystem:"
1475 ;;"X-Operator:" ; Similar to X-Mailer, so display it
1476 "X-Orcl-Content-Type:"
1477 "X-Original-Complaints-To:"
1478 "X-Original-Date:" ; SourceForge mailing list manager
1479 "X-Original-To:"
1480 "X-Original-Trace:"
1481 "X-OriginalArrivalTime:" ; Hotmail
1482 "X-Originating-IP:" ; Hotmail
1483 "X-Postfilter:"
1484 "X-Priority:" ; MS Outlook
1485 "X-Qotd-" ; User added
1486 "X-RM"
1487 "X-Received-Date:"
1488 "X-Received:"
1489 "X-Request-"
1490 "X-SBClass:" ; Spam
1491 "X-SBNote:" ; Spam
1492 "X-SBPass:" ; Spam
1493 "X-SBRule:" ; Spam
1494 "X-SMTP-"
1495 "X-Scanned-By"
1496 "X-Sender:"
1497 "X-Server-Date:"
1498 "X-Server-Uuid:"
1499 "X-Sieve:" ; Sieve filtering
1500 "X-Source"
1501 "X-Spam-" ; Spamassassin
1502 "X-SpamBouncer:" ; Spam
1503 "X-Status"
1504 "X-Submissions-To:"
1505 "X-Telecom-Digest"
1506 "X-Trace:"
1507 "X-UID"
1508 "X-UIDL:"
1509 "X-USANET-" ; usa.net
1510 "X-UserInfo1:"
1511 "X-Virus-Scanned" ; amavisd-new
1512 "X-VSMLoop:" ; NTMail
1513 "X-Vms-To:"
1514 "X-WebTV-Signature:"
1515 "X-Wss-Id:" ; Worldtalk gateways
1516 "X-Yahoo"
1517 "X-eGroups-" ; Egroups/yahoogroups mailing list manager
1518 "X-pgp:"
1519 "X-submission-address:"
1520 "X400-" ; X400
1521 "Xref:")
1522 "List of default header fields that are not to be shown.
1523 Do not alter this variable directly. Instead, add entries from here that you
1524 would like to be displayed in `mh-invisible-header-fields-default'
1525 and add entries to hide in `mh-invisible-header-fields'.")
1527 (defvar mh-invisible-header-fields-compiled nil
1528 "*Regexp matching lines in a message header that are not to be shown.
1529 Do not alter this variable directly. Instead, customize
1530 `mh-invisible-header-fields-default' checking for fields normally
1531 hidden that you wish to display, and add extra entries to hide in
1532 `mh-invisible-header-fields'.")
1534 (defun mh-invisible-headers ()
1535 "Make or remake the variable `mh-invisible-header-fields-compiled'.
1536 Done using `mh-invisible-header-fields-internal' as input, from which entries
1537 from `mh-invisible-header-fields-default' are removed and entries
1538 from `mh-invisible-header-fields' are added."
1539 (let ((fields mh-invisible-header-fields-internal))
1540 (when mh-invisible-header-fields-default
1541 ;; Remove entries from `mh-invisible-header-fields-default'
1542 (setq fields
1543 (loop for x in fields
1544 unless (member x mh-invisible-header-fields-default)
1545 collect x)))
1546 (when (and (boundp 'mh-invisible-header-fields)
1547 mh-invisible-header-fields)
1548 (dolist (x mh-invisible-header-fields)
1549 (unless (member x fields) (setq fields (cons x fields)))))
1550 (if fields
1551 (setq mh-invisible-header-fields-compiled
1552 (concat
1554 ;; workaround for insufficient default
1555 (let ((max-specpdl-size 1000))
1556 (regexp-opt fields t))))
1557 (setq mh-invisible-header-fields-compiled nil))))
1559 (defcustom mh-invisible-header-fields-default nil
1560 "*List of hidden header fields.
1562 The header fields listed in this option are hidden, although you can check off
1563 any field that you would like to see.
1565 Header fields that you would like to hide that aren't listed can be added to
1566 the option `mh-invisible-header-fields'.
1568 See also `mh-clean-message-header-flag'."
1569 :type `(set ,@(mapcar (lambda (x) `(const ,x))
1570 mh-invisible-header-fields-internal))
1571 :set (lambda (symbol value)
1572 (set-default symbol value)
1573 (mh-invisible-headers))
1574 :group 'mh-show)
1576 (defcustom mh-invisible-header-fields nil
1577 "*Additional header fields to hide.
1579 Header fields that you would like to hide that aren't listed in
1580 `mh-invisible-header-fields-default' can be added to this option with a couple
1581 of caveats. Regular expressions are not allowed. Unique fields should have a
1582 `:' suffix; otherwise, the element can be used to render invisible an entire
1583 class of fields that start with the same prefix. If you think a header field
1584 should be generally ignored, report a bug (see URL
1585 `https://sourceforge.net/tracker/?group_id=13357&atid=113357').
1587 See also `mh-clean-message-header-flag'."
1589 :type '(repeat (string :tag "Header field"))
1590 :set (lambda (symbol value)
1591 (set-default symbol value)
1592 (mh-invisible-headers))
1593 :group 'mh-show)
1595 (defcustom mh-lpr-command-format "lpr -J '%s'"
1596 "*Command used to print\\<mh-folder-mode-map>.
1598 This option contains the Unix command line which performs the actual printing
1599 for the \\[mh-print-msg] command. The string can contain one escape, \"%s\",
1600 which is replaced by the name of the folder and the message number and is
1601 useful for print job names. I use \"mpage -h'%s' -b Letter -H1of -mlrtb -P\"
1602 which produces a nice header and adds a bit of margin so the text fits within
1603 my printer's margins.
1605 This options is not used by the commands \\[mh-ps-print-msg] or
1606 \\[mh-ps-print-msg-file]."
1607 :type 'string
1608 :group 'mh-show)
1610 (defcustom mh-max-inline-image-height nil
1611 "*Maximum inline image height if \"Content-Disposition:\" is not present.
1613 Some older mail programs do not insert this needed plumbing to tell
1614 MH-E whether to display the attachments inline or not. If this is the
1615 case, MH-E will display these images inline if they are smaller than
1616 the window. However, you might want to allow larger images to be
1617 displayed inline. To do this, you can change the options
1618 `mh-max-inline-image-width' and `mh-max-inline-image-height' from their
1619 default value of zero to a large number. The size of your screen is a
1620 good choice for these numbers."
1621 :type '(choice (const nil) integer)
1622 :group 'mh-show)
1624 (defcustom mh-max-inline-image-width nil
1625 "*Maximum inline image width if \"Content-Disposition:\" is not present.
1627 Some older mail programs do not insert this needed plumbing to tell
1628 MH-E whether to display the attachments inline or not. If this is the
1629 case, MH-E will display these images inline if they are smaller than
1630 the window. However, you might want to allow larger images to be
1631 displayed inline. To do this, you can change the options
1632 `mh-max-inline-image-width' and `mh-max-inline-image-height' from their
1633 default value of zero to a large number. The size of your screen is a
1634 good choice for these numbers."
1635 :type '(choice (const nil) integer)
1636 :group 'mh-show)
1638 (defcustom mh-mhl-format-file nil
1639 "*Specifies the format file to pass to the \"mhl\" program.
1641 Normally MH-E takes care of displaying messages itself (rather than calling an
1642 MH program to do the work). If you'd rather have \"mhl\" display the
1643 message (within MH-E), change this option from its default value of \"Use
1644 Default mhl Format (Printing Only)\".
1646 You can set this option to \"Use Default mhl Format\" to get the same output
1647 as you would get if you ran \"mhl\" from the shell.
1649 If you have a format file that you want MH-E to use, you can set this option
1650 to \"Specify an mhl Format File\" and enter the name of your format file. Your
1651 format file should specify a non-zero value for \"overflowoffset\" to allow
1652 MH-E to parse the header. Note that \"mhl\" is always used for printing and
1653 forwarding; in this case, the value of this option is consulted if you have
1654 specified a format file."
1655 :type '(choice (const :tag "Use Default mhl Format (Printing Only)" nil)
1656 (const :tag "Use Default mhl Format" t)
1657 (file :tag "Specify an mhl Format File"))
1658 :group 'mh-show)
1660 (defcustom mh-mime-save-parts-default-directory t
1661 "Default directory to use for \\<mh-folder-mode-map>\\[mh-mime-save-parts].
1663 The default value for this option is \"Prompt Always\" so that you are always
1664 prompted for the directory in which to save the attachments. However, if you
1665 usually use the same directory within a session, then you can set this option
1666 to \"Prompt the First Time\" to avoid the prompt each time. you can make this
1667 directory permanent by choosing \"Directory\" and entering the directory's
1668 name."
1669 :type '(choice (const :tag "Prompt the First Time" nil)
1670 (const :tag "Prompt Always" t)
1671 directory)
1672 :group 'mh-show)
1674 (defcustom mh-print-background-flag nil
1675 "*Non-nil means messages should be printed in the background\\<mh-folder-mode-map>.
1677 Normally messages are printed in the foreground. If this is slow on your
1678 system, you may elect to turn off this option to print in the background.
1680 WARNING: If you do this, do not delete the message until it is printed or else
1681 the output may be truncated.
1683 This option is not used by the commands \\[mh-ps-print-msg] or
1684 \\[mh-ps-print-msg-file]."
1685 :type 'boolean
1686 :group 'mh-show)
1688 (defcustom mh-show-maximum-size 0
1689 "*Maximum size of message (in bytes) to display automatically.
1691 This option provides an opportunity to skip over large messages which may be
1692 slow to load. The default value of 0 means that all message are shown
1693 regardless of size."
1694 :type 'integer
1695 :group 'mh-show)
1697 (defcustom mh-show-use-goto-addr-flag (and (boundp 'goto-address-highlight-p)
1698 goto-address-highlight-p)
1699 "*Non-nil means highlight URLs and email addresses\\<goto-address-highlight-keymap>.
1701 To send a message using the highlighted email address or to view the web page
1702 for the highlighted URL, use the middle mouse button or
1703 \\[goto-address-at-point].
1705 See Info node `(mh-e)Sending Mail' to see how to configure Emacs to send the
1706 message using MH-E.
1708 The default value of this option comes from the value of
1709 `goto-address-highlight-p'."
1710 :type 'boolean
1711 :group 'mh-show)
1713 (defcustom mh-show-use-xface-flag (>= emacs-major-version 21)
1714 "*Non-nil means display face images in MH-show buffers.
1716 MH-E can display the content of \"Face:\", \"X-Face:\", and \"X-Image-URL:\"
1717 header fields. If any of these fields occur in the header of your message, the
1718 sender's face will appear in the \"From:\" header field. If more than one of
1719 these fields appear, then the first field found in the order \"Face:\",
1720 \"X-Face:\", and \"X-Image-URL:\" will be used.
1722 The option `mh-show-use-xface-flag' is used to turn this feature on and off.
1723 This feature will be turned on by default if your system supports it.
1725 The first header field used, if present, is the Gnus-specific \"Face:\" field.
1726 The \"Face:\" field appeared in GNU Emacs 21 and XEmacs. For more information,
1727 see URL `http://quimby.gnus.org/circus/face/'. Next is the traditional
1728 \"X-Face:\" header field. The display of this field requires the
1729 \"uncompface\" program (see URL
1730 `ftp://ftp.cs.indiana.edu/pub/faces/compface/compface.tar.z'). Recent versions
1731 of XEmacs have internal support for \"X-Face:\" images. If your version of
1732 XEmacs does not, then you'll need both \"uncompface\" and the x-face
1733 package (see URL `ftp://ftp.jpl.org/pub/elisp/').
1735 Finally, MH-E will display images referenced by the \"X-Image-URL:\" header
1736 field if neither the \"Face:\" nor the \"X-Face:\" fields are present. The
1737 display of the images requires \"wget\" (see URL
1738 `http://www.gnu.org/software/wget/wget.html'), \"fetch\", or \"curl\" to fetch
1739 the image and the \"convert\" program from the ImageMagick suite (see URL
1740 `http://www.imagemagick.org/'). Of the three header fields this is the most
1741 efficient in terms of network usage since the image doesn't need to be
1742 transmitted with every single mail.
1744 The option `mh-fetch-x-image-url' controls the fetching of the
1745 \"X-Image-URL:\" header field image."
1746 :type 'boolean
1747 :group 'mh-show)
1749 (defcustom mh-store-default-directory nil
1750 "*Default directory for \\<mh-folder-mode-map>\\[mh-store-msg].
1752 If you would like to change the initial default directory, customize this
1753 option, change the value from `Current' to `Directory', and then enter the
1754 name of the directory for storing the content of these messages."
1755 :type '(choice (const :tag "Current" nil)
1756 directory)
1757 :group 'mh-show)
1759 (defcustom mh-summary-height nil
1760 "*Number of lines in MH-Folder buffer (including the mode line).
1762 The default value of this option is \"Automatic\" which means that the
1763 MH-Folder buffer will maintain the same proportional size if the frame is
1764 resized. If you'd prefer a fixed height, then choose the \"Fixed Size\" option
1765 and enter the number of lines you'd like to see."
1766 :type '(choice (const :tag "Automatic" nil)
1767 (integer :tag "Fixed Size"))
1768 :group 'mh-show)
1772 ;;; The Speedbar (:group 'mh-speed)
1774 (defcustom mh-speed-flists-interval 60
1775 "Time between calls to flists in seconds.
1776 If 0, flists is not called repeatedly."
1777 :type 'integer
1778 :group 'mh-speed)
1780 (defcustom mh-speed-run-flists-flag t
1781 "Non-nil means flists is used.
1782 If non-nil, flists is executed every `mh-speed-flists-interval' seconds to
1783 update the display of the number of unseen and total messages in each folder.
1784 If resources are limited, this can be set to nil and the speedbar display can
1785 be updated manually with the \\[mh-speed-flists] command."
1786 :type 'boolean
1787 :group 'mh-speed)
1791 ;;; Threading (:group 'mh-thread)
1793 (defcustom mh-show-threads-flag nil
1794 "*Non-nil means new folders start in threaded mode.
1796 Threading large number of messages can be time consuming so this option is
1797 turned off by default. If you turn this option on, then threading will be done
1798 only if the number of messages being threaded is less than `mh-large-folder'."
1799 :type 'boolean
1800 :group 'mh-thread)
1804 ;;; The Toolbar (:group 'mh-toolbar)
1806 (defcustom mh-tool-bar-search-function 'mh-search-folder
1807 "*Function called by the tool-bar search button.
1808 See `mh-search-folder' and `mh-index-search' for details."
1809 :type '(choice (const mh-search-folder)
1810 (const mh-index-search)
1811 (function :tag "Other function"))
1812 :group 'mh-toolbar)
1814 ;; Functions called from the tool bar
1815 (defun mh-tool-bar-search (&optional arg)
1816 "Interactively call `mh-tool-bar-search-function'.
1817 Optional argument ARG is not used."
1818 (interactive "P")
1819 (call-interactively mh-tool-bar-search-function))
1821 (defun mh-tool-bar-customize ()
1822 "Call `mh-customize' from the toolbar."
1823 (interactive)
1824 (mh-customize t))
1826 (defun mh-tool-bar-folder-help ()
1827 "Visit \"(mh-e)Top\"."
1828 (interactive)
1829 (info "(mh-e)Top")
1830 (delete-other-windows))
1832 (defun mh-tool-bar-letter-help ()
1833 "Visit \"(mh-e)Draft Editing\"."
1834 (interactive)
1835 (info "(mh-e)Draft Editing")
1836 (delete-other-windows))
1838 (defmacro mh-tool-bar-reply-generator (function recipient folder-buffer-flag)
1839 "Generate FUNCTION that replies to RECIPIENT.
1840 If FOLDER-BUFFER-FLAG is nil then the function generated
1841 When INCLUDE-FLAG is non-nil, include message body being replied to."
1842 `(defun ,function (&optional arg)
1843 ,(format "Reply to \"%s\".\nWhen ARG is non-nil include message in reply."
1844 recipient)
1845 (interactive "P")
1846 ,(if folder-buffer-flag nil '(set-buffer mh-show-folder-buffer))
1847 (mh-reply (mh-get-msg-num nil) ,recipient arg)))
1849 (mh-tool-bar-reply-generator mh-tool-bar-reply-from "from" t)
1850 (mh-tool-bar-reply-generator mh-show-tool-bar-reply-from "from" nil)
1851 (mh-tool-bar-reply-generator mh-tool-bar-reply-to "to" t)
1852 (mh-tool-bar-reply-generator mh-show-tool-bar-reply-to "to" nil)
1853 (mh-tool-bar-reply-generator mh-tool-bar-reply-all "all" t)
1854 (mh-tool-bar-reply-generator mh-show-tool-bar-reply-all "all" nil)
1856 ;; XEmacs has a couple of extra customizations...
1857 (mh-do-in-xemacs
1858 (defcustom mh-xemacs-use-toolbar-flag (if (and (featurep 'toolbar)
1859 (featurep 'xpm)
1860 (device-on-window-system-p))
1862 nil)
1863 "*If non-nil, use toolbar.
1865 This will default to t if you are in an environment that supports
1866 toolbars and xpm."
1867 :type 'boolean
1868 :group 'mh-toolbar)
1870 (defcustom mh-xemacs-toolbar-position (if mh-xemacs-use-toolbar-flag
1871 'default
1872 nil)
1873 "*Where to put the toolbar.
1875 Valid non-nil values are \"default\", \"top\", \"bottom\", \"left\",
1876 \"right\". These match the four edges of the frame, with \"default\"
1877 meaning \"use the same position as the default-toolbar\".
1879 A nil value means do not use a toolbar.
1881 If this variable is set to anything other than \"default\" and the
1882 default-toolbar has a different positional setting from the value of
1883 this variable, then two toolbars will be displayed. The MH-E toolbar
1884 and the default-toolbar."
1885 :type '(radio (const :tag "Same position as the \"default-toolbar\""
1886 :value default)
1887 (const :tag "Along the top edge of the frame"
1888 :value top)
1889 (const :tag "Along the bottom edge of the frame"
1890 :value bottom)
1891 (const :tag "Along the left edge of the frame"
1892 :value left)
1893 (const :tag "Along the right edge of the frame"
1894 :value right)
1895 (const :tag "Don't use a toolbar" nil))
1896 :group 'mh-toolbar))
1898 (defun mh-buffer-exists-p (mode)
1899 "Test whether a buffer with major mode MODE is present."
1900 (loop for buf in (buffer-list)
1901 when (save-excursion
1902 (set-buffer buf)
1903 (eq major-mode mode))
1904 return t))
1906 (defmacro mh-tool-bar-define (defaults &rest buttons)
1907 "Define a tool bar for MH-E.
1908 DEFAULTS is the list of buttons that are present by default. It is a list of
1909 lists where the sublists are of the following form:
1911 (:KEYWORD FUNC1 FUNC2 FUNC3 ...)
1913 Here :KEYWORD is one of :folder or :letter. If it is :folder then the default
1914 buttons in the folder and show mode buffers are being specified. If it is
1915 :letter then the default buttons in the letter mode are listed. FUNC1, FUNC2,
1916 FUNC3, ... are the names of the functions that the buttons would execute.
1918 Each element of BUTTONS is a list consisting of four mandatory items and one
1919 optional item as follows:
1921 (FUNCTION MODES ICON DOC &optional ENABLE-EXPR)
1923 where,
1925 FUNCTION is the name of the function that will be executed when the button
1926 is clicked.
1928 MODES is a list of symbols. List elements must be from `folder', `letter' and
1929 `sequence'. If `folder' is present then the button is available in the
1930 folder and show buffer. If the name of FUNCTION is of the form \"mh-foo\",
1931 where foo is some arbitrary string, then we check if the function
1932 `mh-show-foo' exists. If it exists then that function is used in the show
1933 buffer. Otherwise the original function `mh-foo' is used in the show buffer
1934 as well. Presence of `sequence' is handled similar to the above. The only
1935 difference is that the button is shown only when the folder is narrowed to a
1936 sequence. If `letter' is present in MODES, then the button is available
1937 during draft editing and runs FUNCTION when clicked.
1939 ICON is the icon that is drawn in the button.
1941 DOC is the documentation for the button. It is used in tool-tips and in
1942 providing other help to the user. GNU Emacs uses only the first line of the
1943 string. So the DOC should be formatted such that the first line is useful and
1944 complete without the rest of the string.
1946 Optional item ENABLE-EXPR is an arbitrary lisp expression. If it evaluates
1947 to nil, then the button is deactivated, otherwise it is active. If is in't
1948 present then the button is always active."
1949 ;; The following variable names have been carefully chosen to make code
1950 ;; generation easier. Modifying the names should be done carefully.
1951 (let (folder-buttons folder-docs folder-button-setter sequence-button-setter
1952 show-buttons show-button-setter show-seq-button-setter
1953 letter-buttons letter-docs letter-button-setter
1954 folder-defaults letter-defaults
1955 folder-vectors show-vectors letter-vectors)
1956 (dolist (x defaults)
1957 (cond ((eq (car x) :folder) (setq folder-defaults (cdr x)))
1958 ((eq (car x) :letter) (setq letter-defaults (cdr x)))))
1959 (dolist (button buttons)
1960 (unless (and (listp button)
1961 (or (equal (length button) 4) (equal (length button) 5)))
1962 (error "Incorrect MH-E tool-bar button specification: %s" button))
1963 (let* ((name (nth 0 button))
1964 (name-str (symbol-name name))
1965 (icon (nth 2 button))
1966 (xemacs-icon (mh-do-in-xemacs
1967 (cdr (assoc (intern icon) mh-xemacs-icon-map))))
1968 (full-doc (nth 3 button))
1969 (doc (if (string-match "\\(.*\\)\n" full-doc)
1970 (match-string 1 full-doc)
1971 full-doc))
1972 (enable-expr (or (nth 4 button) t))
1973 (modes (nth 1 button))
1974 functions show-sym)
1975 (when (memq 'letter modes) (setq functions `(:letter ,name)))
1976 (when (or (memq 'folder modes) (memq 'sequence modes))
1977 (setq functions
1978 (append `(,(if (memq 'folder modes) :folder :sequence) ,name)
1979 functions))
1980 (setq show-sym
1981 (if (string-match "^mh-\\(.*\\)$" name-str)
1982 (intern (concat "mh-show-" (match-string 1 name-str)))
1983 name))
1984 (setq functions
1985 (append `(,(if (memq 'folder modes) :show :show-seq)
1986 ,(if (fboundp show-sym) show-sym name))
1987 functions)))
1988 (do ((functions functions (cddr functions)))
1989 ((null functions))
1990 (let* ((type (car functions))
1991 (function (cadr functions))
1992 (type1 (substring (symbol-name type) 1))
1993 (vector-list (cond ((eq type :show) 'show-vectors)
1994 ((eq type :show-seq) 'show-vectors)
1995 ((eq type :letter) 'letter-vectors)
1996 (t 'folder-vectors)))
1997 (list (cond ((eq type :letter) 'mh-tool-bar-letter-buttons)
1998 (t 'mh-tool-bar-folder-buttons)))
1999 (key (intern (concat "mh-" type1 "toolbar-" name-str)))
2000 (setter (intern (concat type1 "-button-setter")))
2001 (mbuttons (cond ((eq type :letter) 'letter-buttons)
2002 ((eq type :show) 'show-buttons)
2003 ((eq type :show-seq) 'show-buttons)
2004 (t 'folder-buttons)))
2005 (docs (cond ((eq mbuttons 'letter-buttons) 'letter-docs)
2006 ((eq mbuttons 'folder-buttons) 'folder-docs))))
2007 (add-to-list vector-list `[,xemacs-icon ,function t ,full-doc])
2008 (add-to-list
2009 setter `(when (member ',name ,list)
2010 (mh-funcall-if-exists
2011 tool-bar-add-item ,icon ',function ',key
2012 :help ,doc :enable ',enable-expr)))
2013 (add-to-list mbuttons name)
2014 (if docs (add-to-list docs doc))))))
2015 (setq folder-buttons (nreverse folder-buttons)
2016 letter-buttons (nreverse letter-buttons)
2017 show-buttons (nreverse show-buttons)
2018 letter-docs (nreverse letter-docs)
2019 folder-docs (nreverse folder-docs)
2020 folder-vectors (nreverse folder-vectors)
2021 show-vectors (nreverse show-vectors)
2022 letter-vectors (nreverse letter-vectors))
2023 (dolist (x folder-defaults)
2024 (unless (memq x folder-buttons)
2025 (error "Folder defaults contains unknown button '%s'" x)))
2026 (dolist (x letter-defaults)
2027 (unless (memq x letter-buttons)
2028 (error "Letter defaults contains unknown button '%s'" x)))
2029 `(eval-when (compile load eval)
2030 (defvar mh-folder-tool-bar-map nil)
2031 (defvar mh-folder-seq-tool-bar-map nil)
2032 (defvar mh-show-tool-bar-map nil)
2033 (defvar mh-show-seq-tool-bar-map nil)
2034 (defvar mh-letter-tool-bar-map nil)
2035 ;; GNU Emacs tool bar specific code
2036 (mh-do-in-gnu-emacs
2037 ;; Tool bar initialization functions
2038 (defun mh-tool-bar-folder-buttons-init ()
2039 (when (mh-buffer-exists-p 'mh-folder-mode)
2040 (mh-image-load-path)
2041 (setq mh-folder-tool-bar-map
2042 (let ((tool-bar-map (make-sparse-keymap)))
2043 ,@(nreverse folder-button-setter)
2044 tool-bar-map))
2045 (setq mh-show-tool-bar-map
2046 (let ((tool-bar-map (make-sparse-keymap)))
2047 ,@(nreverse show-button-setter)
2048 tool-bar-map))
2049 (setq mh-show-seq-tool-bar-map
2050 (let ((tool-bar-map (copy-keymap mh-show-tool-bar-map)))
2051 ,@(nreverse show-seq-button-setter)
2052 tool-bar-map))
2053 (setq mh-folder-seq-tool-bar-map
2054 (let ((tool-bar-map (copy-keymap mh-folder-tool-bar-map)))
2055 ,@(nreverse sequence-button-setter)
2056 tool-bar-map))))
2057 (defun mh-tool-bar-letter-buttons-init ()
2058 (when (mh-buffer-exists-p 'mh-letter-mode)
2059 (mh-image-load-path)
2060 (setq mh-letter-tool-bar-map
2061 (let ((tool-bar-map (make-sparse-keymap)))
2062 ,@(nreverse letter-button-setter)
2063 tool-bar-map))))
2064 ;; Custom setter functions
2065 (defun mh-tool-bar-folder-buttons-set (symbol value)
2066 "Construct toolbar for `mh-folder-mode' and `mh-show-mode'."
2067 (set-default symbol value)
2068 (mh-tool-bar-folder-buttons-init))
2069 (defun mh-tool-bar-letter-buttons-set (symbol value)
2070 "Construct toolbar for `mh-letter-mode'."
2071 (set-default symbol value)
2072 (mh-tool-bar-letter-buttons-init)))
2073 ;; XEmacs specific code
2074 (mh-do-in-xemacs
2075 (defvar mh-toolbar-folder-vector-map
2076 ',(loop for button in folder-buttons
2077 for vector in folder-vectors
2078 collect (cons button vector)))
2079 (defvar mh-toolbar-show-vector-map
2080 ',(loop for button in show-buttons
2081 for vector in show-vectors
2082 collect (cons button vector)))
2083 (defvar mh-toolbar-letter-vector-map
2084 ',(loop for button in letter-buttons
2085 for vector in letter-vectors
2086 collect (cons button vector)))
2087 (defvar mh-toolbar-folder-buttons nil)
2088 (defvar mh-toolbar-show-buttons nil)
2089 (defvar mh-toolbar-letter-buttons nil)
2090 ;; Custom setter functions
2091 (defun mh-tool-bar-letter-buttons-set (symbol value)
2092 (set-default symbol value)
2093 (when mh-xemacs-has-toolbar-flag
2094 (setq mh-toolbar-letter-buttons
2095 (loop for b in value
2096 collect (cdr (assoc b mh-toolbar-letter-vector-map))))))
2097 (defun mh-tool-bar-folder-buttons-set (symbol value)
2098 (set-default symbol value)
2099 (when mh-xemacs-has-toolbar-flag
2100 (setq mh-toolbar-folder-buttons
2101 (loop for b in value
2102 collect (cdr (assoc b mh-toolbar-folder-vector-map))))
2103 (setq mh-toolbar-show-buttons
2104 (loop for b in value
2105 collect (cdr (assoc b mh-toolbar-show-vector-map))))))
2106 ;; Initialize toolbar
2107 (defun mh-toolbar-init (mode)
2108 "Install toolbar in MODE."
2109 (let ((toolbar (cond ((eq mode :folder) mh-toolbar-folder-buttons)
2110 ((eq mode :letter) mh-toolbar-letter-buttons)
2111 ((eq mode :show) mh-toolbar-show-buttons)))
2112 (height 37)
2113 (width 40)
2114 (buffer (current-buffer)))
2115 (when (and mh-xemacs-toolbar-position mh-xemacs-use-toolbar-flag
2116 mh-xemacs-has-toolbar-flag)
2117 (cond
2118 ((eq mh-xemacs-toolbar-position 'top)
2119 (set-specifier top-toolbar toolbar buffer)
2120 (set-specifier top-toolbar-visible-p t)
2121 (set-specifier top-toolbar-height height))
2122 ((eq mh-xemacs-toolbar-position 'bottom)
2123 (set-specifier bottom-toolbar toolbar buffer)
2124 (set-specifier bottom-toolbar-visible-p t)
2125 (set-specifier bottom-toolbar-height height))
2126 ((eq mh-xemacs-toolbar-position 'left)
2127 (set-specifier left-toolbar toolbar buffer)
2128 (set-specifier left-toolbar-visible-p t)
2129 (set-specifier left-toolbar-width width))
2130 ((eq mh-xemacs-toolbar-position 'right)
2131 (set-specifier right-toolbar toolbar buffer)
2132 (set-specifier right-toolbar-visible-p t)
2133 (set-specifier right-toolbar-width width))
2134 (t (set-specifier default-toolbar toolbar buffer)))))))
2135 ;; Declare customizable toolbars
2136 (custom-declare-variable
2137 'mh-tool-bar-folder-buttons
2138 '(list ,@(mapcar (lambda (x) `(quote ,x)) folder-defaults))
2139 "Choose buttons to include in MH-E folder/show toolbar."
2140 :group 'mh-toolbar :set 'mh-tool-bar-folder-buttons-set
2141 :type '(set ,@(loop for x in folder-buttons
2142 for y in folder-docs
2143 collect `(const :tag ,y ,x))))
2144 (custom-declare-variable
2145 'mh-tool-bar-letter-buttons
2146 '(list ,@(mapcar (lambda (x) `(quote ,x)) letter-defaults))
2147 "Choose buttons to include in MH-E letter toolbar."
2148 :group 'mh-toolbar :set 'mh-tool-bar-letter-buttons-set
2149 :type '(set ,@(loop for x in letter-buttons
2150 for y in letter-docs
2151 collect `(const :tag ,y ,x)))))))
2153 (mh-tool-bar-define
2154 ((:folder mh-inc-folder mh-mime-save-parts mh-previous-undeleted-msg
2155 mh-page-msg mh-next-undeleted-msg mh-delete-msg mh-refile-msg
2156 mh-undo mh-execute-commands mh-toggle-tick mh-reply
2157 mh-alias-grab-from-field mh-send mh-rescan-folder
2158 mh-tool-bar-search mh-visit-folder
2159 mh-tool-bar-customize mh-tool-bar-folder-help mh-widen)
2160 (:letter mh-send-letter mh-compose-insertion ispell-message save-buffer
2161 undo kill-region menu-bar-kill-ring-save yank mh-fully-kill-draft
2162 mh-tool-bar-customize mh-tool-bar-letter-help))
2163 ;; Folder/Show buffer buttons
2164 (mh-inc-folder (folder) "mail"
2165 "Incorporate new mail in Inbox
2166 This button runs `mh-inc-folder' which drags any
2167 new mail into your Inbox folder.")
2168 (mh-mime-save-parts (folder) "attach"
2169 "Save MIME parts from this message
2170 This button runs `mh-mime-save-parts' which saves a message's
2171 different parts into separate files.")
2172 (mh-previous-undeleted-msg (folder) "left-arrow"
2173 "Go to the previous undeleted message
2174 This button runs `mh-previous-undeleted-msg'")
2175 (mh-page-msg (folder) "page-down"
2176 "Page the current message forwards\nThis button runs `mh-page-msg'")
2177 (mh-next-undeleted-msg (folder) "right-arrow"
2178 "Go to the next undeleted message\nThe button runs `mh-next-undeleted-msg'")
2179 (mh-delete-msg (folder) "close"
2180 "Mark this message for deletion\nThis button runs `mh-delete-msg'")
2181 (mh-refile-msg (folder) "mail/refile"
2182 "Refile this message\nThis button runs `mh-refile-msg'")
2183 (mh-undo (folder) "undo" "Undo last operation\nThis button runs `undo'"
2184 (mh-outstanding-commands-p))
2185 (mh-execute-commands (folder) "execute"
2186 "Perform moves and deletes\nThis button runs `mh-execute-commands'"
2187 (mh-outstanding-commands-p))
2188 (mh-toggle-tick (folder) "highlight"
2189 "Toggle tick mark\nThis button runs `mh-toggle-tick'")
2190 (mh-toggle-showing (folder) "show"
2191 "Toggle showing message\nThis button runs `mh-toggle-showing'")
2192 (mh-tool-bar-reply-from (folder) "mail/reply-from" "Reply to \"from\"")
2193 (mh-tool-bar-reply-to (folder) "mail/reply-to" "Reply to \"to\"")
2194 (mh-tool-bar-reply-all (folder) "mail/reply-all" "Reply to \"all\"")
2195 (mh-reply (folder) "mail/reply"
2196 "Reply to this message\nThis button runs `mh-reply'")
2197 (mh-alias-grab-from-field (folder) "mail/alias"
2198 "Grab From alias\nThis button runs `mh-alias-grab-from-field'"
2199 (and (mh-extract-from-header-value) (not (mh-alias-for-from-p))))
2200 (mh-send (folder) "mail/compose"
2201 "Compose new message\nThis button runs `mh-send'")
2202 (mh-rescan-folder (folder) "refresh"
2203 "Rescan this folder\nThis button runs `mh-rescan-folder'")
2204 (mh-pack-folder (folder) "mail/repack"
2205 "Repack this folder\nThis button runs `mh-pack-folder'")
2206 (mh-tool-bar-search (folder) "search"
2207 "Search\nThis button runs `mh-tool-bar-search-function'")
2208 (mh-visit-folder (folder) "fld-open"
2209 "Visit other folder\nThis button runs `mh-visit-folder'")
2210 ;; Letter buffer buttons
2211 (mh-send-letter (letter) "mail/send" "Send this letter")
2212 (mh-compose-insertion (letter) "attach" "Insert attachment")
2213 (ispell-message (letter) "spell" "Check spelling")
2214 (save-buffer (letter) "save" "Save current buffer to its file"
2215 (buffer-modified-p))
2216 (undo (letter) "undo" "Undo last operation")
2217 (kill-region (letter) "cut"
2218 "Cut (kill) text in region between mark and current position")
2219 (menu-bar-kill-ring-save (letter) "copy"
2220 "Copy text in region between mark and current position")
2221 (yank (letter) "paste" "Paste (yank) text cut or copied earlier")
2222 (mh-fully-kill-draft (letter) "close" "Kill this draft")
2223 ;; Common buttons
2224 (mh-tool-bar-customize (folder letter) "preferences" "MH-E Preferences")
2225 (mh-tool-bar-folder-help (folder) "help"
2226 "Help! (general help)\nThis button runs `info'")
2227 (mh-tool-bar-letter-help (letter) "help"
2228 "Help! (general help)\nThis button runs `info'")
2229 ;; Folder narrowed to sequence buttons
2230 (mh-widen (sequence) "widen"
2231 "Widen from the sequence\nThis button runs `mh-widen'"))
2235 ;;; Hooks (:group 'mh-hooks + group where hook described)
2237 (defcustom mail-citation-hook nil
2238 "*Hook for modifying a citation just inserted in the mail buffer.
2239 You can gain full control over the appearance of the included text by setting
2240 this hook to a function that modifies it. This hook is ignored if the option
2241 `mh-yank-behavior' is set to one of the supercite flavors. Otherwise, this
2242 option controls how much of the message is passed to the hook. The function
2243 can find the citation between point and mark and it should leave point and
2244 mark around the modified citation text for the next hook function. The
2245 standard prefix `mh-ins-buf-prefix' is not added if this hook is set.
2247 For example, if you use the hook function trivial-cite (which is NOT part of
2248 Emacs), set `mh-yank-behavior' to \"Body and Header\" (see URL
2249 `http://shasta.cs.uiuc.edu/~lrclause/tc.html')."
2250 :type 'hook
2251 :options '(trivial-cite)
2252 :group 'mh-hooks
2253 :group 'mh-letter)
2255 (defcustom mh-alias-reloaded-hook nil
2256 "Invoked by `mh-alias-reload' after reloading aliases."
2257 :type 'hook
2258 :group 'mh-hooks
2259 :group 'mh-alias)
2261 (defcustom mh-before-quit-hook nil
2262 "Invoked by \\<mh-folder-mode-map>`\\[mh-quit]' before quitting MH-E.
2263 See also `mh-quit-hook'."
2264 :type 'hook
2265 :group 'mh-hooks
2266 :group 'mh-folder)
2268 (defcustom mh-before-send-letter-hook nil
2269 "Invoked at the beginning of the \\<mh-letter-mode-map>\\[mh-send-letter] command.
2270 For example, if you want to check your spelling in your message before
2271 sending, add the `ispell-message' function."
2272 :type 'hook
2273 :options '(ispell-message)
2274 :group 'mh-hooks
2275 :group 'mh-letter)
2277 (defcustom mh-delete-msg-hook nil
2278 "Invoked after marking each message for deletion.
2280 For example, a past maintainer of MH-E used this once when he kept statistics
2281 on his mail usage."
2282 :type 'hook
2283 :group 'mh-hooks
2284 :group 'mh-show)
2286 (defcustom mh-mh-to-mime-hook nil
2287 "Invoked on the formatted letter by \\<mh-letter-mode-map>\\[mh-mh-to-mime]."
2288 :type 'hook
2289 :group 'mh-hooks
2290 :group 'mh-letter)
2292 (defcustom mh-find-path-hook nil
2293 "Invoked by `mh-find-path' after reading the user's MH profile."
2294 :type 'hook
2295 :group 'mh-hooks
2296 :group 'mh-e)
2298 (defcustom mh-folder-mode-hook nil
2299 "Invoked in `mh-folder-mode' on a new folder."
2300 :type 'hook
2301 :group 'mh-hooks
2302 :group 'mh-folder)
2304 (defcustom mh-folder-updated-hook nil
2305 "Invoked when the folder actions (such as moves and deletes) are performed.
2306 Variables that are useful in this hook include `mh-delete-list' and
2307 `mh-refile-list' which can be used to see which changes are being made to
2308 current folder, `mh-current-folder'."
2309 :type 'hook
2310 :group 'mh-hooks
2311 :group 'mh-folder)
2313 (defcustom mh-forward-hook nil
2314 "Invoked on the forwarded letter by \\<mh-folder-mode-map>\\[mh-forward]."
2315 :type 'hook
2316 :group 'mh-hooks
2317 :group 'mh-sending-mail)
2319 (defcustom mh-inc-folder-hook nil
2320 "Invoked by \\<mh-folder-mode-map>`\\[mh-inc-folder]' after incorporating mail into a folder."
2321 :type 'hook
2322 :group 'mh-hooks
2323 :group 'mh-inc)
2325 (defcustom mh-kill-folder-suppress-prompt-hook '(mh-index-p)
2326 "Invoked at the beginning of the \\<mh-folder-mode-map>`\\[mh-kill-folder]' command.
2327 This hook is a list of functions to be called, with no arguments, which should
2328 return a value of non-nil if you should not be asked if you're sure that you
2329 want to remove the folder. This is useful for folders that are easily
2330 regenerated.
2332 The default value of `mh-index-p' suppresses the prompt on folders generated
2333 by an index search.
2335 WARNING: Use this hook with care. If there is a bug in your hook which returns
2336 t on +inbox and you hit \\<mh-folder-mode-map>`\\[mh-kill-folder]' by accident
2337 in the +inbox buffer, you will not be happy."
2338 :type 'hook
2339 :group 'mh-hooks
2340 :group 'mh-folder)
2342 (defcustom mh-letter-insert-signature-hook nil
2343 "Invoked after signature has been inserted.
2344 This hook may access the actual name of the file or the function used to
2345 insert the signature with `mh-signature-file-name'."
2346 :type 'hook
2347 :group 'mh-hooks
2348 :group 'mh-letter)
2350 (defcustom mh-letter-mode-hook nil
2351 "Invoked by `mh-letter-mode' on a new letter."
2352 :type 'hook
2353 :group 'mh-hooks
2354 :group 'mh-sending-mail)
2356 (defcustom mh-pick-mode-hook nil
2357 "Invoked upon entry to `mh-pick-mode'."
2358 :type 'hook
2359 :group 'mh-hooks
2360 :group 'mh-index)
2362 (defcustom mh-quit-hook nil
2363 "Invoked after \\<mh-folder-mode-map>`\\[mh-quit]' quits MH-E.
2364 See also `mh-before-quit-hook'."
2365 :type 'hook
2366 :group 'mh-hooks
2367 :group 'mh-folder)
2369 (defcustom mh-refile-msg-hook nil
2370 "Invoked after marking each message for refiling."
2371 :type 'hook
2372 :group 'mh-hooks
2373 :group 'mh-folder)
2375 (defcustom mh-show-hook nil
2376 "Invoked after \\<mh-folder-mode-map>\\[mh-show] shows a message.
2378 It is the last thing called after messages are displayed. It's used to affect
2379 the behavior of MH-E in general or when `mh-show-mode-hook' is too early."
2380 :type 'hook
2381 :group 'mh-hooks
2382 :group 'mh-show)
2384 (defcustom mh-show-mode-hook nil
2385 "Invoked upon entry to `mh-show-mode'.
2387 This hook is called early on in the process of the message display. It is
2388 usually used to perform some action on the message's content."
2389 :type 'hook
2390 :group 'mh-hooks
2391 :group 'mh-show)
2393 (defcustom mh-unseen-updated-hook nil
2394 "Invoked after the unseen sequence has been updated.
2395 The variable `mh-seen-list' can be used to obtain the list of messages which
2396 will be removed from the unseen sequence."
2397 :type 'hook
2398 :group 'mh-hooks
2399 :group 'mh-sequences)
2403 ;;; Faces (:group 'mh-*-faces + group where faces described)
2405 ;;; Faces Used in Scan Listing (:group 'mh-folder-faces)
2407 (defvar mh-folder-body-face 'mh-folder-body
2408 "Face used to highlight body text in MH-Folder buffers.")
2409 (defface mh-folder-body
2410 (mh-defface-compat
2411 '((((class color) (min-colors 88) (background light))
2412 (:foreground "RosyBrown"))
2413 (((class color) (min-colors 88) (background dark))
2414 (:foreground "LightSalmon"))
2415 (((class color))
2416 (:foreground "green"))
2417 (((class grayscale) (background light))
2418 (:foreground "DimGray" :italic t))
2419 (((class grayscale) (background dark))
2420 (:foreground "LightGray" :italic t))
2422 (:italic t))))
2423 "Face used to highlight body text in MH-Folder buffers."
2424 :group 'mh-folder-faces)
2426 (defvar mh-folder-cur-msg-face 'mh-folder-cur-msg
2427 "Face used for the current message line in MH-Folder buffers.")
2428 (defface mh-folder-cur-msg
2429 (mh-defface-compat
2430 '((((class color) (min-colors 88) (background light))
2431 (:background "LightGreen") ;Use this for solid background colour
2432 ;; (:underline t) ;Use this for underlining
2434 (((class color) (min-colors 88) (background dark))
2435 (:background "DarkOliveGreen4"))
2436 (((class color))
2437 (:background "LightGreen"))
2439 (:underline t))))
2440 "Face used for the current message line in MH-Folder buffers."
2441 :group 'mh-folder-faces)
2443 (defvar mh-folder-cur-msg-number-face 'mh-folder-cur-msg-number
2444 "Face used to highlight the current message in MH-Folder buffers.")
2445 (defface mh-folder-cur-msg-number
2446 (mh-defface-compat
2447 '((((class color) (min-colors 88) (background light))
2448 (:foreground "Purple"))
2449 (((class color) (min-colors 88) (background dark))
2450 (:foreground "Cyan"))
2451 (((class color))
2452 (:foreground "cyan" :weight bold))
2453 (((class grayscale) (background light))
2454 (:foreground "LightGray" :bold t))
2455 (((class grayscale) (background dark))
2456 (:foreground "DimGray" :bold t))
2458 (:bold t))))
2459 "Face used to highlight the current message in MH-Folder buffers."
2460 :group 'mh-folder-faces)
2462 (defvar mh-folder-date-face 'mh-folder-date
2463 "Face used to highlight the date in MH-Folder buffers.")
2464 (defface mh-folder-date
2465 '((((class color) (background light))
2466 (:foreground "snow4"))
2467 (((class color) (background dark))
2468 (:foreground "snow3"))
2470 (:bold t)))
2471 "Face used to highlight the date in MH-Folder buffers."
2472 :group 'mh-folder-faces)
2474 (defvar mh-folder-followup-face 'mh-folder-followup
2475 "Face used to highlight Re: subject text in MH-Folder buffers.")
2476 (defface mh-folder-followup
2477 '((((class color) (background light))
2478 (:foreground "blue3"))
2479 (((class color) (background dark))
2480 (:foreground "LightGoldenRod"))
2482 (:bold t)))
2483 "Face used to highlight Re: subject text in MH-Folder buffers."
2484 :group 'mh-folder-faces)
2486 (defvar mh-folder-msg-number-face 'mh-folder-msg-number
2487 "Face used to highlight the message number in MH-Folder buffers.")
2488 (defface mh-folder-msg-number
2489 '((((class color) (background light))
2490 (:foreground "snow4"))
2491 (((class color) (background dark))
2492 (:foreground "snow3"))
2494 (:bold t)))
2495 "Face used to highlight the message number in MH-Folder buffers."
2496 :group 'mh-folder-faces)
2498 (defvar mh-folder-deleted-face 'mh-folder-deleted
2499 "Face used to highlight deleted messages in MH-Folder buffers.")
2500 (copy-face 'mh-folder-msg-number 'mh-folder-deleted)
2502 (defvar mh-folder-refiled-face 'mh-folder-refiled
2503 "Face used to highlight refiled messages in MH-Folder buffers.")
2504 (defface mh-folder-refiled
2505 (mh-defface-compat
2506 '((((class color) (min-colors 88) (background light))
2507 (:foreground "DarkGoldenrod"))
2508 (((class color) (min-colors 88) (background dark))
2509 (:foreground "LightGoldenrod"))
2510 (((class color))
2511 (:foreground "yellow" :weight light))
2512 (((class grayscale) (background light))
2513 (:foreground "Gray90" :bold t :italic t))
2514 (((class grayscale) (background dark))
2515 (:foreground "DimGray" :bold t :italic t))
2517 (:bold t :italic t))))
2518 "Face used to highlight refiled messages in MH-Folder buffers."
2519 :group 'mh-folder-faces)
2521 (defvar mh-folder-subject-face 'mh-folder-subject
2522 "Face used to highlight subject text in MH-Folder buffers.")
2523 (if (boundp 'facemenu-unlisted-faces)
2524 (add-to-list 'facemenu-unlisted-faces "^mh-folder"))
2525 (defface mh-folder-subject
2526 '((((class color) (background light))
2527 (:foreground "blue4"))
2528 (((class color) (background dark))
2529 (:foreground "yellow"))
2531 (:bold t)))
2532 "Face used to highlight subject text in MH-Folder buffers."
2533 :group 'mh-folder-faces)
2535 (defface mh-folder-tick
2536 '((((class color) (background dark))
2537 (:background "#dddf7e"))
2538 (((class color) (background light))
2539 (:background "#dddf7e"))
2541 (:underline t)))
2542 "Face used to show ticked messages."
2543 :group 'mh-folder-faces)
2545 (defvar mh-folder-address-face 'mh-folder-address
2546 "Face used to highlight the address in MH-Folder buffers.")
2547 (copy-face 'mh-folder-subject 'mh-folder-address)
2549 (defvar mh-folder-scan-format-face 'mh-folder-scan-format
2550 "Face used to highlight `mh-scan-format-regexp' matches in MH-Folder buffers.")
2551 (copy-face 'mh-folder-followup 'mh-folder-scan-format)
2553 (defvar mh-folder-to-face 'mh-folder-to
2554 "Face used to highlight the To: string in MH-Folder buffers.")
2555 (defface mh-folder-to
2556 (mh-defface-compat
2557 '((((class color) (min-colors 88) (background light))
2558 (:foreground "RosyBrown"))
2559 (((class color) (min-colors 88) (background dark))
2560 (:foreground "LightSalmon"))
2561 (((class color))
2562 (:foreground "green"))
2563 (((class grayscale) (background light))
2564 (:foreground "DimGray" :italic t))
2565 (((class grayscale) (background dark))
2566 (:foreground "LightGray" :italic t))
2568 (:italic t))))
2569 "Face used to highlight the To: string in MH-Folder buffers."
2570 :group 'mh-folder-faces)
2574 ;;; Faces Used in Searching (:group 'mh-index-faces)
2576 (defvar mh-index-folder-face 'mh-index-folder
2577 "Face used to highlight folders in MH-Index buffers.")
2578 (defface mh-index-folder
2579 '((((class color) (background light))
2580 (:foreground "dark green" :bold t))
2581 (((class color) (background dark))
2582 (:foreground "indian red" :bold t))
2584 (:bold t)))
2585 "Face used to highlight folders in MH-Index buffers."
2586 :group 'mh-index-faces)
2590 ;;; Faces Used in Message Drafts (:group 'mh-letter-faces)
2592 (defface mh-letter-header-field
2593 '((((class color) (background light))
2594 (:background "gray90"))
2595 (((class color) (background dark))
2596 (:background "gray10"))
2598 (:bold t)))
2599 "Face used to display header fields in draft buffers."
2600 :group 'mh-letter-faces)
2604 ;;; Faces Used in Message Display (:group 'mh-show-faces)
2606 (defvar mh-show-cc-face 'mh-show-cc
2607 "Face used to highlight cc: header fields.")
2608 (defface mh-show-cc
2609 (mh-defface-compat
2610 '((((class color) (min-colors 88) (background light))
2611 (:foreground "DarkGoldenrod"))
2612 (((class color) (min-colors 88) (background dark))
2613 (:foreground "LightGoldenrod"))
2614 (((class color))
2615 (:foreground "yellow" :weight light))
2616 (((class grayscale) (background light))
2617 (:foreground "Gray90" :bold t :italic t))
2618 (((class grayscale) (background dark))
2619 (:foreground "DimGray" :bold t :italic t))
2621 (:bold t :italic t))))
2622 "Face used to highlight cc: header fields."
2623 :group 'mh-show-faces)
2625 (defvar mh-show-date-face 'mh-show-date
2626 "Face used to highlight the Date: header field.")
2627 (defface mh-show-date
2628 (mh-defface-compat
2629 '((((class color) (min-colors 88) (background light))
2630 (:foreground "ForestGreen"))
2631 (((class color) (min-colors 88) (background dark))
2632 (:foreground "PaleGreen"))
2633 (((class color))
2634 (:foreground "green"))
2635 (((class grayscale) (background light))
2636 (:foreground "Gray90" :bold t))
2637 (((class grayscale) (background dark))
2638 (:foreground "DimGray" :bold t))
2640 (:bold t :underline t))))
2641 "Face used to highlight the Date: header field."
2642 :group 'mh-show-faces)
2644 (defvar mh-show-header-face 'mh-show-header
2645 "Face used to deemphasize unspecified header fields.")
2646 (defface mh-show-header
2647 (mh-defface-compat
2648 '((((class color) (min-colors 88) (background light))
2649 (:foreground "RosyBrown"))
2650 (((class color) (min-colors 88) (background dark))
2651 (:foreground "LightSalmon"))
2652 (((class color))
2653 (:foreground "green"))
2654 (((class grayscale) (background light))
2655 (:foreground "DimGray" :italic t))
2656 (((class grayscale) (background dark))
2657 (:foreground "LightGray" :italic t))
2659 (:italic t))))
2660 "Face used to deemphasize unspecified header fields."
2661 :group 'mh-show-faces)
2663 (defvar mh-show-pgg-good-face 'mh-show-pgg-good
2664 "Face used to highlight a good PGG signature.")
2665 (defface mh-show-pgg-good
2666 '((t
2667 (:bold t :foreground "LimeGreen")))
2668 "Face used to highlight a good PGG signature."
2669 :group 'mh-show-faces)
2671 (defvar mh-show-pgg-unknown-face 'mh-show-pgg-unknown
2672 "Face used to highlight a PGG signature whose status is unknown.
2673 This face is also used for a signature when the signer is untrusted.")
2674 (defface mh-show-pgg-unknown
2675 '((t
2676 (:bold t :foreground "DarkGoldenrod2")))
2677 "Face used to highlight a PGG signature whose status is unknown.
2678 This face is also used for a signature when the signer is untrusted."
2679 :group 'mh-show-faces)
2681 (defvar mh-show-pgg-bad-face 'mh-show-pgg-bad
2682 "Face used to highlight a bad PGG signature.")
2683 (defface mh-show-pgg-bad
2684 '((t
2685 (:bold t :foreground "DeepPink1")))
2686 "Face used to highlight a bad PGG signature."
2687 :group 'mh-show-faces)
2689 (defface mh-show-signature
2690 '((t
2691 (:italic t)))
2692 "Face used to highlight the message signature."
2693 :group 'mh-show-faces)
2695 (defvar mh-show-to-face 'mh-show-to
2696 "Face used to highlight the To: header field.")
2697 (if (boundp 'facemenu-unlisted-faces)
2698 (add-to-list 'facemenu-unlisted-faces "^mh-show"))
2699 (defface mh-show-to
2700 '((((class color) (background light))
2701 (:foreground "SaddleBrown"))
2702 (((class color) (background dark))
2703 (:foreground "burlywood"))
2704 (((class grayscale) (background light))
2705 (:foreground "DimGray" :underline t))
2706 (((class grayscale) (background dark))
2707 (:foreground "LightGray" :underline t))
2708 (t (:underline t)))
2709 "Face used to highlight the To: header field."
2710 :group 'mh-show-faces)
2712 (defvar mh-show-from-face 'mh-show-from
2713 "Face used to highlight the From: header field.")
2714 (defface mh-show-from
2715 '((((class color) (background light))
2716 (:foreground "red3"))
2717 (((class color) (background dark))
2718 (:foreground "cyan"))
2720 (:bold t)))
2721 "Face used to highlight the From: header field."
2722 :group 'mh-show-faces)
2724 (defface mh-show-xface
2725 '((t
2726 (:foreground "black" :background "white")))
2727 "Face used to display the X-Face image.
2728 The background and foreground is used in the image."
2729 :group 'mh-show-faces)
2731 (defvar mh-show-subject-face 'mh-show-subject
2732 "Face used to highlight the Subject: header field.")
2733 (copy-face 'mh-folder-subject 'mh-show-subject)
2737 ;;; Faces Used in Speedbar (:group 'mh-speed-faces)
2739 (defface mh-speedbar-folder
2740 '((((class color) (background light))
2741 (:foreground "blue4"))
2742 (((class color) (background dark))
2743 (:foreground "light blue")))
2744 "Face used for folders in the speedbar buffer."
2745 :group 'mh-speed-faces)
2747 (defface mh-speedbar-selected-folder
2748 '((((class color) (background light))
2749 (:foreground "red1" :underline t))
2750 (((class color) (background dark))
2751 (:foreground "red1" :underline t))
2753 (:underline t)))
2754 "Face used for the current folder."
2755 :group 'mh-speed-faces)
2757 (defface mh-speedbar-folder-with-unseen-messages
2758 '((t
2759 (:inherit mh-speedbar-folder :bold t)))
2760 "Face used for folders in the speedbar buffer which have unread messages."
2761 :group 'mh-speed-faces)
2763 (defface mh-speedbar-selected-folder-with-unseen-messages
2764 '((t
2765 (:inherit mh-speedbar-selected-folder :bold t)))
2766 "Face used for the current folder when it has unread messages."
2767 :group 'mh-speed-faces)
2769 ;;; Local Variables:
2770 ;;; indent-tabs-mode: nil
2771 ;;; sentence-end-double-space: nil
2772 ;;; End:
2774 ;;; arch-tag: 778d2a20-82e2-4276-be9d-309386776a68
2775 ;;; mh-customize.el ends here