comparison lisp/mh-e/mh-customize.el @ 56406:d36b00b98db0

Upgraded to MH-E version 7.4.4. See etc/MH-E-NEWS and lisp/mh-e/ChangeLog for details.
author Bill Wohler <wohler@newt.com>
date Tue, 13 Jul 2004 03:06:25 +0000
parents 695cf19ef79e
children e9a6cbc8ca5e 97905c4f1a42
comparison
equal deleted inserted replaced
56405:10b68aa88abe 56406:d36b00b98db0
1 ;;; mh-customize.el --- MH-E customization 1 ;;; mh-customize.el --- MH-E customization
2 2
3 ;; Copyright (C) 2002, 2003 Free Software Foundation, Inc. 3 ;; Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
4 4
5 ;; Author: Bill Wohler <wohler@newt.com> 5 ;; Author: Bill Wohler <wohler@newt.com>
6 ;; Maintainer: Bill Wohler <wohler@newt.com> 6 ;; Maintainer: Bill Wohler <wohler@newt.com>
7 ;; Keywords: mail 7 ;; Keywords: mail
8 ;; See: mh-e.el 8 ;; See: mh-e.el
55 55
56 ;;; Change Log: 56 ;;; Change Log:
57 57
58 ;;; Code: 58 ;;; Code:
59 (provide 'mh-customize) 59 (provide 'mh-customize)
60 (require 'mh-e) 60 (require 'mh-utils)
61
62 (when mh-xemacs-flag
63 (require 'mh-xemacs))
61 64
62 ;;;###mh-autoload 65 ;;;###mh-autoload
63 (defun mh-customize (&optional delete-other-windows-flag) 66 (defun mh-customize (&optional delete-other-windows-flag)
64 "Customize MH-E variables. 67 "Customize MH-E variables.
65 With optional argument DELETE-OTHER-WINDOWS-FLAG, other windows in the frame 68 With optional argument DELETE-OTHER-WINDOWS-FLAG, other windows in the frame
156 :link '(custom-manual "(mh-e)Customizing mh-e") 159 :link '(custom-manual "(mh-e)Customizing mh-e")
157 :prefix "mh-" 160 :prefix "mh-"
158 :group 'mh-faces 161 :group 'mh-faces
159 :group 'mh-folder) 162 :group 'mh-folder)
160 163
161 (defgroup mh-show-faces nil
162 "Faces used in message display."
163 :link '(custom-manual "(mh-e)Customizing mh-e")
164 :prefix "mh-"
165 :group 'mh-faces
166 :group 'mh-show)
167
168 (defgroup mh-index-faces nil 164 (defgroup mh-index-faces nil
169 "Faces used in indexed searches." 165 "Faces used in indexed searches."
170 :link '(custom-manual "(mh-e)Customizing mh-e") 166 :link '(custom-manual "(mh-e)Customizing mh-e")
171 :prefix "mh-" 167 :prefix "mh-"
172 :group 'mh-faces 168 :group 'mh-faces
173 :group 'mh-index) 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)
174 184
175 185
176 186
177 ;;; MH-E Customization (:group mh) 187 ;;; MH-E Customization (:group mh)
178 188
228 (mh-tool-bar-reply-generator mh-tool-bar-reply-all "all" t) 238 (mh-tool-bar-reply-generator mh-tool-bar-reply-all "all" t)
229 (mh-tool-bar-reply-generator mh-show-tool-bar-reply-all "all" nil) 239 (mh-tool-bar-reply-generator mh-show-tool-bar-reply-all "all" nil)
230 240
231 ;; XEmacs has a couple of extra customizations... 241 ;; XEmacs has a couple of extra customizations...
232 (mh-do-in-xemacs 242 (mh-do-in-xemacs
233 (require 'mh-xemacs-icons)
234 (defcustom mh-xemacs-use-toolbar-flag (if (and (featurep 'toolbar) 243 (defcustom mh-xemacs-use-toolbar-flag (if (and (featurep 'toolbar)
235 (featurep 'xpm) 244 (featurep 'xpm)
236 (device-on-window-system-p)) 245 (device-on-window-system-p))
237 t 246 t
238 nil) 247 nil)
281 Here :KEYWORD is one of :folder or :letter. If it is :folder then the default 290 Here :KEYWORD is one of :folder or :letter. If it is :folder then the default
282 buttons in the folder and show mode buffers are being specified. If it is 291 buttons in the folder and show mode buffers are being specified. If it is
283 :letter then the default buttons in the letter mode are listed. FUNC1, FUNC2, 292 :letter then the default buttons in the letter mode are listed. FUNC1, FUNC2,
284 FUNC3, ... are the names of the functions that the buttons would execute. 293 FUNC3, ... are the names of the functions that the buttons would execute.
285 294
286 Each element of BUTTONS is a list of four things: 295 Each element of BUTTONS is a list consisting of four mandatory items and one
287 296 optional item as follows:
288 (FUNCTION MODES ICON DOC) 297
298 (FUNCTION MODES ICON DOC &optional ENABLE-EXPR)
289 299
290 where, 300 where,
291 301
292 FUNCTION is the name of the function that will be executed when the button 302 FUNCTION is the name of the function that will be executed when the button
293 is clicked. 303 is clicked.
306 ICON is the icon that is drawn in the button. 316 ICON is the icon that is drawn in the button.
307 317
308 DOC is the documentation for the button. It is used in tool-tips and in 318 DOC is the documentation for the button. It is used in tool-tips and in
309 providing other help to the user. GNU Emacs uses only the first line of the 319 providing other help to the user. GNU Emacs uses only the first line of the
310 string. So the DOC should be formatted such that the first line is useful and 320 string. So the DOC should be formatted such that the first line is useful and
311 complete without the rest of the string." 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."
312 ;; The following variable names have been carefully chosen to make code 326 ;; The following variable names have been carefully chosen to make code
313 ;; generation easier. Modifying the names should be done carefully. 327 ;; generation easier. Modifying the names should be done carefully.
314 (let (folder-buttons folder-docs folder-button-setter sequence-button-setter 328 (let (folder-buttons folder-docs folder-button-setter sequence-button-setter
315 show-buttons show-button-setter show-seq-button-setter 329 show-buttons show-button-setter show-seq-button-setter
316 letter-buttons letter-docs letter-button-setter 330 letter-buttons letter-docs letter-button-setter
318 folder-vectors show-vectors letter-vectors) 332 folder-vectors show-vectors letter-vectors)
319 (dolist (x defaults) 333 (dolist (x defaults)
320 (cond ((eq (car x) :folder) (setq folder-defaults (cdr x))) 334 (cond ((eq (car x) :folder) (setq folder-defaults (cdr x)))
321 ((eq (car x) :letter) (setq letter-defaults (cdr x))))) 335 ((eq (car x) :letter) (setq letter-defaults (cdr x)))))
322 (dolist (button buttons) 336 (dolist (button buttons)
323 (unless (and (listp button) (equal (length button) 4)) 337 (unless (and (listp button)
338 (or (equal (length button) 4) (equal (length button) 5)))
324 (error "Incorrect MH-E tool-bar button specification: %s" button)) 339 (error "Incorrect MH-E tool-bar button specification: %s" button))
325 (let* ((name (nth 0 button)) 340 (let* ((name (nth 0 button))
326 (name-str (symbol-name name)) 341 (name-str (symbol-name name))
327 (icon (nth 2 button)) 342 (icon (nth 2 button))
328 (xemacs-icon (mh-do-in-xemacs 343 (xemacs-icon (mh-do-in-xemacs
329 (cdr (assoc (intern icon) mh-xemacs-icon-map)))) 344 (cdr (assoc (intern icon) mh-xemacs-icon-map))))
330 (full-doc (nth 3 button)) 345 (full-doc (nth 3 button))
331 (doc (if (string-match "\\(.*\\)\n" full-doc) 346 (doc (if (string-match "\\(.*\\)\n" full-doc)
332 (match-string 1 full-doc) 347 (match-string 1 full-doc)
333 full-doc)) 348 full-doc))
349 (enable-expr (or (nth 4 button) t))
334 (modes (nth 1 button)) 350 (modes (nth 1 button))
335 functions show-sym) 351 functions show-sym)
336 (when (memq 'letter modes) (setq functions `(:letter ,name))) 352 (when (memq 'letter modes) (setq functions `(:letter ,name)))
337 (when (or (memq 'folder modes) (memq 'sequence modes)) 353 (when (or (memq 'folder modes) (memq 'sequence modes))
338 (setq functions 354 (setq functions
367 ((eq mbuttons 'folder-buttons) 'folder-docs)))) 383 ((eq mbuttons 'folder-buttons) 'folder-docs))))
368 (add-to-list vector-list `[,xemacs-icon ,function t ,full-doc]) 384 (add-to-list vector-list `[,xemacs-icon ,function t ,full-doc])
369 (add-to-list 385 (add-to-list
370 setter `(when (member ',name ,list) 386 setter `(when (member ',name ,list)
371 (mh-funcall-if-exists 387 (mh-funcall-if-exists
372 tool-bar-add-item ,icon ',function ',key :help ,doc))) 388 tool-bar-add-item ,icon ',function ',key
389 :help ,doc :enable ',enable-expr)))
373 (add-to-list mbuttons name) 390 (add-to-list mbuttons name)
374 (if docs (add-to-list docs doc)))))) 391 (if docs (add-to-list docs doc))))))
375 (setq folder-buttons (nreverse folder-buttons) 392 (setq folder-buttons (nreverse folder-buttons)
376 letter-buttons (nreverse letter-buttons) 393 letter-buttons (nreverse letter-buttons)
377 show-buttons (nreverse show-buttons) 394 show-buttons (nreverse show-buttons)
462 (width 40) 479 (width 40)
463 (buffer (current-buffer))) 480 (buffer (current-buffer)))
464 (when (and mh-xemacs-toolbar-position mh-xemacs-use-toolbar-flag) 481 (when (and mh-xemacs-toolbar-position mh-xemacs-use-toolbar-flag)
465 (cond 482 (cond
466 ((eq mh-xemacs-toolbar-position 'top) 483 ((eq mh-xemacs-toolbar-position 'top)
467 (set-specifier top-toolbar (cons buffer toolbar)) 484 (set-specifier top-toolbar toolbar buffer)
468 (set-specifier top-toolbar-visible-p t) 485 (set-specifier top-toolbar-visible-p t)
469 (set-specifier top-toolbar-height height)) 486 (set-specifier top-toolbar-height height))
470 ((eq mh-xemacs-toolbar-position 'bottom) 487 ((eq mh-xemacs-toolbar-position 'bottom)
471 (set-specifier bottom-toolbar (cons buffer toolbar)) 488 (set-specifier bottom-toolbar toolbar buffer)
472 (set-specifier bottom-toolbar-visible-p t) 489 (set-specifier bottom-toolbar-visible-p t)
473 (set-specifier bottom-toolbar-height height)) 490 (set-specifier bottom-toolbar-height height))
474 ((eq mh-xemacs-toolbar-position 'left) 491 ((eq mh-xemacs-toolbar-position 'left)
475 (set-specifier left-toolbar (cons buffer toolbar)) 492 (set-specifier left-toolbar toolbar buffer)
476 (set-specifier left-toolbar-visible-p t) 493 (set-specifier left-toolbar-visible-p t)
477 (set-specifier left-toolbar-width width)) 494 (set-specifier left-toolbar-width width))
478 ((eq mh-xemacs-toolbar-position 'right) 495 ((eq mh-xemacs-toolbar-position 'right)
479 (set-specifier right-toolbar (cons buffer toolbar)) 496 (set-specifier right-toolbar toolbar buffer)
480 (set-specifier right-toolbar-visible-p t) 497 (set-specifier right-toolbar-visible-p t)
481 (set-specifier right-toolbar-width width)) 498 (set-specifier right-toolbar-width width))
482 (t (set-specifier default-toolbar (cons buffer toolbar)))))))) 499 (t (set-specifier default-toolbar toolbar buffer)))))))
483 ;; Declare customizable toolbars 500 ;; Declare customizable toolbars
484 (custom-declare-variable 501 (custom-declare-variable
485 'mh-tool-bar-folder-buttons 502 'mh-tool-bar-folder-buttons
486 '(list ,@(mapcar (lambda (x) `(quote ,x)) folder-defaults)) 503 '(list ,@(mapcar (lambda (x) `(quote ,x)) folder-defaults))
487 "Choose buttons to include in MH-E folder/show toolbar." 504 "Choose buttons to include in MH-E folder/show toolbar."
539 (mh-tool-bar-reply-to (folder) "reply-to" "Reply to \"to\"") 556 (mh-tool-bar-reply-to (folder) "reply-to" "Reply to \"to\"")
540 (mh-tool-bar-reply-all (folder) "reply-all" "Reply to \"all\"") 557 (mh-tool-bar-reply-all (folder) "reply-all" "Reply to \"all\"")
541 (mh-reply (folder) "mail/reply2" 558 (mh-reply (folder) "mail/reply2"
542 "Reply to this message\nThis button runs `mh-reply'") 559 "Reply to this message\nThis button runs `mh-reply'")
543 (mh-alias-grab-from-field (folder) "alias" 560 (mh-alias-grab-from-field (folder) "alias"
544 "Grab From alias\nThis button runs `mh-alias-grab-from-field'") 561 "Grab From alias\nThis button runs `mh-alias-grab-from-field'"
562 (mh-alias-from-has-no-alias-p))
545 (mh-send (folder) "mail_compose" 563 (mh-send (folder) "mail_compose"
546 "Compose new message\nThis button runs `mh-send'") 564 "Compose new message\nThis button runs `mh-send'")
547 (mh-rescan-folder (folder) "rescan" 565 (mh-rescan-folder (folder) "rescan"
548 "Rescan this folder\nThis button runs `mh-rescan-folder'") 566 "Rescan this folder\nThis button runs `mh-rescan-folder'")
549 (mh-pack-folder (folder) "repack" 567 (mh-pack-folder (folder) "repack"
659 Normally \"inc\". This file is searched for relative to 677 Normally \"inc\". This file is searched for relative to
660 the `mh-progs' directory unless it is an absolute pathname." 678 the `mh-progs' directory unless it is an absolute pathname."
661 :type 'string 679 :type 'string
662 :group 'mh-folder) 680 :group 'mh-folder)
663 681
664
665 (defcustom mh-inc-spool-list nil 682 (defcustom mh-inc-spool-list nil
666 "*Alist of alternate spool files, corresponding folders and keybindings. 683 "*Alist of alternate spool files, corresponding folders and keybindings.
667 Here's an example. Suppose you have subscribed to the MH-E devel mailing 684 Here's an example. Suppose you have subscribed to the MH-E devel mailing
668 list. You could filter its mail into a separate spool file named 685 list. You could filter its mail into a separate spool file named
669 ~/mail/mh-e using Procmail and a .procmailrc entry like: 686 ~/mail/mh-e using Procmail and a .procmailrc entry like:
697 (string :tag "Folder") 714 (string :tag "Folder")
698 (character :tag "Key binding"))) 715 (character :tag "Key binding")))
699 :set 'mh-inc-spool-list-set 716 :set 'mh-inc-spool-list-set
700 :group 'mh-folder) 717 :group 'mh-folder)
701 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
702 (defcustom mh-lpr-command-format "lpr -J '%s'" 726 (defcustom mh-lpr-command-format "lpr -J '%s'"
703 "*Format for Unix command that prints a message. 727 "*Format for Unix command that prints a message.
704 The string should be a Unix command line, with the string '%s' where 728 The string should be a Unix command line, with the string '%s' where
705 the job's name (folder and message number) should appear. The formatted 729 the job's name (folder and message number) should appear. The formatted
706 message text is piped to this command when you type \\<mh-folder-mode-map>`\\[mh-print-msg]'." 730 message text is piped to this command when you type \\<mh-folder-mode-map>`\\[mh-print-msg]'."
729 :type 'boolean 753 :type 'boolean
730 :group 'mh-folder) 754 :group 'mh-folder)
731 755
732 (defcustom mh-recursive-folders-flag nil 756 (defcustom mh-recursive-folders-flag nil
733 "*Non-nil means that commands which operate on folders do so recursively." 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."
734 :type 'boolean 770 :type 'boolean
735 :group 'mh-folder) 771 :group 'mh-folder)
736 772
737 (defcustom mh-scan-format-file t 773 (defcustom mh-scan-format-file t
738 "Specifies the format file to pass to the scan program. 774 "Specifies the format file to pass to the scan program.
817 (const :tag "glimpse" glimpse) 853 (const :tag "glimpse" glimpse)
818 (const :tag "pick" pick) 854 (const :tag "pick" pick)
819 (const :tag "grep" grep)) 855 (const :tag "grep" grep))
820 :group 'mh-index) 856 :group 'mh-index)
821 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
822 868
823 869
824 ;;; Spam Handling (:group 'mh-junk) 870 ;;; Spam Handling (:group 'mh-junk)
825 871
826 ;; Spam fighting program chosen 872 ;; Spam fighting program chosen
876 :type 'boolean 922 :type 'boolean
877 :group 'mh-show) 923 :group 'mh-show)
878 924
879 (defcustom mh-clean-message-header-flag t 925 (defcustom mh-clean-message-header-flag t
880 "*Non-nil means clean headers of messages that are displayed or inserted. 926 "*Non-nil means clean headers of messages that are displayed or inserted.
881 The variables `mh-invisible-headers' and `mh-visible-headers' control 927 The variable `mh-invisible-headers' if set determines the header fields that
882 what is removed." 928 are displayed. If it isn't set, then the variable `mh-invisible-headers'
929 determines the header fields that are removed."
883 :type 'boolean 930 :type 'boolean
884 :group 'mh-show) 931 :group 'mh-show)
885 932
886 (defcustom mh-decode-mime-flag (not (not (locate-library "mm-decode"))) 933 (defcustom mh-decode-mime-flag (not (not (locate-library "mm-decode")))
887 "*Non-nil means that Gnus is used to show MIME attachments with Gnus." 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."
888 :type 'boolean 943 :type 'boolean
889 :group 'mh-show) 944 :group 'mh-show)
890 945
891 (defcustom mh-display-buttons-for-inline-parts-flag nil 946 (defcustom mh-display-buttons-for-inline-parts-flag nil
892 "*Non-nil means display buttons for all inline MIME parts. 947 "*Non-nil means display buttons for all inline MIME parts.
947 (const :tag "Don't fontify" nil)) 1002 (const :tag "Don't fontify" nil))
948 :group 'mh-show) 1003 :group 'mh-show)
949 1004
950 (defvar mh-invisible-headers nil 1005 (defvar mh-invisible-headers nil
951 "*Regexp matching lines in a message header that are not to be shown. 1006 "*Regexp matching lines in a message header that are not to be shown.
952 Use the function `mh-invisible-headers' to generate this variable. 1007 Customize the variable `mh-invisible-header-fields' to generate this variable;
953 If `mh-visible-headers' is non-nil, it is used instead to specify what 1008 It will in turn automatically use the function `mh-invisible-headers' to
954 to keep.") 1009 generate this variable.
1010 If the variable `mh-visible-headers' is non-nil, it is used instead to specify
1011 what to keep.")
955 1012
956 (defun mh-invisible-headers () 1013 (defun mh-invisible-headers ()
957 "Make or remake the variable `mh-invisible-headers'. 1014 "Make or remake the variable `mh-invisible-headers'.
958 Done using `mh-invisible-header-fields' as input." 1015 Done using `mh-invisible-header-fields' as input."
959 (setq mh-invisible-headers 1016 (if mh-invisible-header-fields
960 (concat 1017 (setq mh-invisible-headers
961 "^" 1018 (concat
962 (let ((max-specpdl-size 1000) ;workaround for insufficient default 1019 "^"
963 (fields mh-invisible-header-fields)) 1020 (let ((max-specpdl-size 1000) ;workaround for insufficient default
964 (regexp-opt fields t))))) 1021 (fields mh-invisible-header-fields))
965 1022 (regexp-opt fields t))))
966 (defun mh-invisible-header-fields-set (symbol value) 1023 (setq mh-invisible-headers nil)))
967 "Update `mh-invisible-header-fields'.
968 The function is called with SYMBOL bound to `mh-invisible-header-fields' and
969 VALUE is the the list of headers that are invisible. As a side effect, the
970 variable `mh-invisible-fields' is set."
971 (set-default symbol value)
972 (mh-invisible-headers))
973 1024
974 ;; Keep fields alphabetized. Mention source, if known. 1025 ;; Keep fields alphabetized. Mention source, if known.
975 (defcustom mh-invisible-header-fields 1026 (defcustom mh-invisible-header-fields
976 '("Approved:" 1027 '("Approved:"
977 "Autoforwarded:" 1028 "Autoforwarded:"
980 "Content-" ; RFC 2045 1031 "Content-" ; RFC 2045
981 "Delivered-To:" ; Egroups/yahoogroups mailing list manager 1032 "Delivered-To:" ; Egroups/yahoogroups mailing list manager
982 "Delivery-Date:" ; MH 1033 "Delivery-Date:" ; MH
983 "Delivery:" 1034 "Delivery:"
984 "Encoding:" 1035 "Encoding:"
1036 "Envelope-to:"
985 "Errors-To:" 1037 "Errors-To:"
986 "Face:" ; Gnus Face header 1038 "Face:" ; Gnus Face header
987 "Forwarded:" ; MH 1039 "Forwarded:" ; MH
988 "From " ; sendmail 1040 "From " ; sendmail
989 "Importance:" ; MS Outlook 1041 "Importance:" ; MS Outlook
1021 "Resent" ; MH 1073 "Resent" ; MH
1022 "Return-Path:" ; RFC 822 1074 "Return-Path:" ; RFC 822
1023 "Sensitivity:" ; MS Outlook 1075 "Sensitivity:" ; MS Outlook
1024 "Status:" ; sendmail 1076 "Status:" ; sendmail
1025 "Ua-Content-Id:" ; X400 1077 "Ua-Content-Id:" ; X400
1026 "User-Agent:" 1078 ;; "User-Agent:" ; Similar to X-Mailer, so display it.
1027 "Via:" ; MH 1079 "Via:" ; MH
1028 "X-Abuse-Info:" 1080 "X-Abuse-Info:"
1029 "X-Accept-Language:" 1081 "X-Accept-Language:"
1030 "X-Accept-Language:" ; Netscape/Mozilla 1082 "X-Accept-Language:" ; Netscape/Mozilla
1031 "X-Ack:" 1083 "X-Ack:"
1074 "X-No-Archive:" 1126 "X-No-Archive:"
1075 "X-Notes-Item:" ; Lotus Notes Domino structured header 1127 "X-Notes-Item:" ; Lotus Notes Domino structured header
1076 "X-Orcl-Content-Type:" 1128 "X-Orcl-Content-Type:"
1077 "X-Original-Complaints-To:" 1129 "X-Original-Complaints-To:"
1078 "X-Original-Date:" ; SourceForge mailing list manager 1130 "X-Original-Date:" ; SourceForge mailing list manager
1131 "X-Original-To:"
1079 "X-Original-Trace:" 1132 "X-Original-Trace:"
1080 "X-OriginalArrivalTime:" ; Hotmail 1133 "X-OriginalArrivalTime:" ; Hotmail
1081 "X-Originating-IP:" ; Hotmail 1134 "X-Originating-IP:" ; Hotmail
1082 "X-Priority:" ; MS Outlook 1135 "X-Priority:" ; MS Outlook
1083 "X-Qotd-" ; User added 1136 "X-Qotd-" ; User added
1111 "Xref:") 1164 "Xref:")
1112 "*List of header fields that are not to be shown. 1165 "*List of header fields that are not to be shown.
1113 Regexps are not allowed. Unique fields should have a \":\" suffix; otherwise, 1166 Regexps are not allowed. Unique fields should have a \":\" suffix; otherwise,
1114 the element can be used to render invisible an entire class of fields that 1167 the element can be used to render invisible an entire class of fields that
1115 start with the same prefix. 1168 start with the same prefix.
1116 This variable is ignored if `mh-visible-headers' is set." 1169 This variable is ignored if the variable `mh-visible-headers' is set."
1117 :type '(repeat (string :tag "Header field")) 1170 :type '(repeat (string :tag "Header field"))
1118 :set 'mh-invisible-header-fields-set 1171 :set (lambda (symbol value)
1172 (set-default symbol value)
1173 (mh-invisible-headers))
1119 :group 'mh-show) 1174 :group 'mh-show)
1120 1175
1121 (defcustom mh-max-inline-image-height nil 1176 (defcustom mh-max-inline-image-height nil
1122 "*Maximum inline image height if Content-Disposition is not present. 1177 "*Maximum inline image height if Content-Disposition is not present.
1123 If nil, image will be displayed if its height is smaller than the height of 1178 If nil, image will be displayed if its height is smaller than the height of
1183 Versions of GNU Emacs prior to 21.1 don't support the display of 1238 Versions of GNU Emacs prior to 21.1 don't support the display of
1184 inline images. So face images are not displayed in these versions." 1239 inline images. So face images are not displayed in these versions."
1185 :type 'boolean 1240 :type 'boolean
1186 :group 'mh-show) 1241 :group 'mh-show)
1187 1242
1188 (defcustom mh-summary-height (or (and (fboundp 'frame-height) 1243 (defcustom mh-summary-height nil
1189 (> (frame-height) 24)
1190 (min 10 (/ (frame-height) 6)))
1191 4)
1192 "*Number of lines in MH-Folder window (including the mode line)." 1244 "*Number of lines in MH-Folder window (including the mode line)."
1193 :type 'integer 1245 :type '(choice (const :tag "Automatic" nil)
1194 :group 'mh-show) 1246 (integer :tag "Fixed sized"))
1195 1247 :group 'mh-show)
1196 (defcustom mh-visible-headers nil 1248
1197 "*Contains a regexp specifying the headers to keep when cleaning. 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.
1198 Only used if `mh-clean-message-header-flag' is non-nil. Setting it overrides 1254 Only used if `mh-clean-message-header-flag' is non-nil. Setting it overrides
1199 the variable `mh-invisible-headers'." 1255 the variable `mh-invisible-headers'.")
1200 :type '(choice (const nil) regexp) 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))
1201 :group 'mh-show) 1280 :group 'mh-show)
1202 1281
1203 (defcustom mhl-formfile nil 1282 (defcustom mhl-formfile nil
1204 "*Name of format file to be used by mhl to show and print messages. 1283 "*Name of format file to be used by mhl to show and print messages.
1205 A value of t means use the default format file. 1284 A value of t means use the default format file.
1223 1302
1224 (defcustom mh-compose-letter-function nil 1303 (defcustom mh-compose-letter-function nil
1225 "Invoked when setting up a letter draft. 1304 "Invoked when setting up a letter draft.
1226 It is passed three arguments: TO recipients, SUBJECT, and CC recipients." 1305 It is passed three arguments: TO recipients, SUBJECT, and CC recipients."
1227 :type '(choice (const nil) function) 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
1228 :group 'mh-letter) 1324 :group 'mh-letter)
1229 1325
1230 (defcustom mh-delete-yanked-msg-window-flag nil 1326 (defcustom mh-delete-yanked-msg-window-flag nil
1231 "*Non-nil means delete any window displaying the message. 1327 "*Non-nil means delete any window displaying the message.
1232 Controls window display when a message is yanked by \\<mh-letter-mode-map>\\[mh-yank-cur-msg]. 1328 Controls window display when a message is yanked by \\<mh-letter-mode-map>\\[mh-yank-cur-msg].
1426 If you set this variable to a string, it will be executed to generate a 1522 If you set this variable to a string, it will be executed to generate a
1427 password file. A value of \"ypcat passwd\" is helpful if NIS is in use." 1523 password file. A value of \"ypcat passwd\" is helpful if NIS is in use."
1428 :type '(choice (boolean) (string)) 1524 :type '(choice (boolean) (string))
1429 :group 'mh-alias) 1525 :group 'mh-alias)
1430 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
1431 (defcustom mh-alias-system-aliases 1554 (defcustom mh-alias-system-aliases
1432 '("/etc/nmh/MailAliases" "/usr/lib/mh/MailAliases" "/etc/passwd") 1555 '("/etc/nmh/MailAliases" "/usr/lib/mh/MailAliases" "/etc/passwd")
1433 "*A list of system files from which to cull aliases. 1556 "*A list of system files from which to cull aliases.
1434 If these files are modified, they are automatically reread. This list need 1557 If these files are modified, they are automatically reread. This list need
1435 include only system aliases and the passwd file, since personal alias files 1558 include only system aliases and the passwd file, since personal alias files
1440 1563
1441 1564
1442 1565
1443 ;;; Multiple personalities (:group 'mh-identity) 1566 ;;; Multiple personalities (:group 'mh-identity)
1444 1567
1445 (defvar mh-identity-list ())
1446
1447 (defcustom mh-auto-fields-list nil
1448 "Alist of addresses for which header lines are automatically inserted.
1449 Each element has the form (REGEXP ((KEYWORD VALUE) (KEYWORD VALUE)).
1450 When the REGEXP appears in the To or cc fields of a message, the corresponding
1451 KEYWORD header field is insert with its VALUE in the message header.
1452
1453 There is one special case for KEYWORD, that of \"identity\", which means to
1454 insert that identity using `mh-insert-identity'.
1455
1456 The common KEYWORD cases of \"Mail-Followup-To\" and \"fcc\" are also
1457 prompted for in the customization interface."
1458 :type `(repeat
1459 (list :tag ""
1460 (string :tag "Regular expression to match")
1461 (repeat :tag "At least one pair from below"
1462 (choice
1463 (cons :tag "Identity entry"
1464 (const "identity")
1465 ,(append
1466 '(radio)
1467 (mapcar (function (lambda (arg) `(const ,arg)))
1468 (mapcar 'car mh-identity-list))))
1469 (cons :tag "fcc field"
1470 (const "fcc")
1471 (string :tag "Value"))
1472 (cons :tag "Mail-Followup-To field"
1473 (const "Mail-Followup-To")
1474 (string :tag "Value"))
1475 (cons :tag "Other field and value pair"
1476 (string :tag "Field")
1477 (string :tag "Value"))))))
1478 :group 'mh-identity)
1479
1480 (defcustom mh-identity-default nil
1481 "Default identity to use when `mh-letter-mode' is called."
1482 ;; Dynamically render :type corresponding to `mh-identity-list' entries,
1483 ;; e.g.:
1484 ;; :type '(radio (const :tag "none" nil)
1485 ;; (const "home")
1486 ;; (const "work"))
1487 :type (append
1488 '(radio)
1489 (cons '(const :tag "None" nil)
1490 (mapcar (function (lambda (arg) `(const ,arg)))
1491 (mapcar 'car mh-identity-list))))
1492 :group 'mh-identity)
1493
1494 (defcustom mh-identity-list nil 1568 (defcustom mh-identity-list nil
1495 "*List holding MH-E identity. 1569 "*List holding MH-E identity.
1496 Omit the colon and trailing space from the field names. 1570 Omit the colon and trailing space from the field names.
1497 The keyword name \"none\" is reversed for internal use. 1571 The keyword name \"none\" is reserved for internal use.
1498 Use the keyname name \"signature\" to specify either a signature file or a 1572 Use the keyname name \"signature\" to specify either a signature file or a
1499 function to call to insert a signature at point. 1573 function to call to insert a signature at point.
1500 1574
1501 Providing an empty Value (\"\") will cause the field to be deleted. 1575 Providing an empty Value (\"\") will cause the field to be deleted.
1502 1576
1536 (string :tag "Field") 1610 (string :tag "Field")
1537 (string :tag "Value")))))) 1611 (string :tag "Value"))))))
1538 :set 'mh-identity-list-set 1612 :set 'mh-identity-list-set
1539 :group 'mh-identity) 1613 :group 'mh-identity)
1540 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
1541 1662
1542 1663
1543 ;;; Hooks (:group 'mh-hooks + group where hook defined) 1664 ;;; Hooks (:group 'mh-hooks + group where hook defined)
1544 1665
1545 ;;; These are alphabetized. All hooks should be placed in the 'mh-hook group; 1666 ;;; These are alphabetized. All hooks should be placed in the 'mh-hook group;
1591 :type 'hook 1712 :type 'hook
1592 :group 'mh-hooks) 1713 :group 'mh-hooks)
1593 1714
1594 (defcustom mh-inc-folder-hook nil 1715 (defcustom mh-inc-folder-hook nil
1595 "Invoked by \\<mh-folder-mode-map>`\\[mh-inc-folder]' after incorporating mail into a folder." 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."
1596 :type 'hook 1734 :type 'hook
1597 :group 'mh-hooks 1735 :group 'mh-hooks
1598 :group 'mh-folder) 1736 :group 'mh-folder)
1599 1737
1600 (defcustom mh-letter-insert-signature-hook nil 1738 (defcustom mh-letter-insert-signature-hook nil
1915 (t 2053 (t
1916 (:bold t))) 2054 (:bold t)))
1917 "Face for highlighting folders in MH-Index buffers." 2055 "Face for highlighting folders in MH-Index buffers."
1918 :group 'mh-index-faces) 2056 :group 'mh-index-faces)
1919 2057
2058
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
1920 ;;; Local Variables: 2071 ;;; Local Variables:
1921 ;;; indent-tabs-mode: nil 2072 ;;; indent-tabs-mode: nil
1922 ;;; sentence-end-double-space: nil 2073 ;;; sentence-end-double-space: nil
1923 ;;; End: 2074 ;;; End:
1924 2075