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