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