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