/[emacs]/emacs/lisp/mh-e/mh-customize.el
ViewVC logotype

Diff of /emacs/lisp/mh-e/mh-customize.el

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.3 by lektu, Tue Feb 4 13:15:32 2003 UTC revision 1.4 by wohler, Fri Apr 25 05:52:00 2003 UTC
# Line 1  Line 1 
1  ;;; mh-customize.el --- MH-E customization  ;;; mh-customize.el --- MH-E customization
2    
3  ;; Copyright (C) 2002 Free Software Foundation, Inc.  ;; Copyright (C) 2002, 2003 Free Software Foundation, Inc.
4    
5  ;; Author: Bill Wohler <wohler@newt.com>  ;; Author: Bill Wohler <wohler@newt.com>
6  ;; Maintainer: Bill Wohler <wohler@newt.com>  ;; Maintainer: Bill Wohler <wohler@newt.com>
# Line 26  Line 26 
26    
27  ;;; Commentary:  ;;; Commentary:
28    
29  ;; All of the defgroups, defcustoms, and deffaces in MH-E are found here. This  ;; All of the defgroups, defcustoms, and deffaces in MH-E are found
30  ;; makes it possible to customize modules that aren't loaded yet. It also  ;; here. This makes it possible to customize modules that aren't loaded
31  ;; makes it easier to organize the customization groups.  ;; yet. It also makes it easier to organize the customization groups.
32    
33  ;; This file contains the following sections:  ;; This file contains the following sections:
34  ;;  ;;
# Line 55  Line 55 
55    
56  ;;; Change Log:  ;;; Change Log:
57    
 ;; $Id$  
   
58  ;;; Code:  ;;; Code:
59  (provide 'mh-customize)  (provide 'mh-customize)
60  (require 'mh-e)  (require 'mh-e)
# Line 95  are removed." Line 93  are removed."
93    :link '(custom-manual "(mh-e)Customizing Moving Mail")    :link '(custom-manual "(mh-e)Customizing Moving Mail")
94    :group 'mh)    :group 'mh)
95    
96    (defgroup mh-index nil
97      "Indexed searching."
98      :link '(custom-manual "(mh-e)Customizing mh-e")
99      :prefix "mh-"
100      :group 'mh)
101    
102    (defgroup mh-junk nil
103      "Spam handling."
104      :link '(custom-manual "(mh-e)Customizing mh-e")
105      :prefix "mh-junk-"
106      :group 'mh)
107    
108  (defgroup mh-show nil  (defgroup mh-show nil
109    "Message display."    "Message display."
110    :prefix "mh-"    :prefix "mh-"
111    :link '(custom-manual "(mh-e)Customizing Reading")    :link '(custom-manual "(mh-e)Customizing Reading")
112    :group 'mh)    :group 'mh)
113    
114    (defgroup mh-faces nil
115      "Faces used in MH-E."
116      :link '(custom-manual "(mh-e)Customizing mh-e")
117      :prefix "mh-"
118      :group 'faces
119      :group 'mh)
120    
121  (defgroup mh-letter nil  (defgroup mh-letter nil
122    "Composing messages."    "Composing messages."
123    :prefix "mh-"    :prefix "mh-"
# Line 113  are removed." Line 130  are removed."
130    :prefix "mh-alias-"    :prefix "mh-alias-"
131    :group 'mh)    :group 'mh)
132    
 (defgroup mh-index nil  
   "Indexed searching."  
   :link '(custom-manual "(mh-e)Customizing mh-e")  
   :prefix "mh-"  
   :group 'mh)  
   
133  (defgroup mh-identity nil  (defgroup mh-identity nil
134    "Multiple personalities."    "Multiple personalities."
135    :link '(custom-manual "(mh-e)Customizing mh-e")    :link '(custom-manual "(mh-e)Customizing mh-e")
136    :prefix "mh-"    :prefix "mh-"
137    :group 'mh)    :group 'mh)
138    
 (defgroup mh-faces nil  
   "Faces used in MH-E."  
   :link '(custom-manual "(mh-e)Customizing mh-e")  
   :prefix "mh-"  
   :group 'faces  
   :group 'mh)  
   
139  (defgroup mh-hooks nil  (defgroup mh-hooks nil
140    "MH-E hooks."    "MH-E hooks."
141    :link '(custom-manual "(mh-e)Customizing mh-e")    :link '(custom-manual "(mh-e)Customizing mh-e")
# Line 174  are removed." Line 178  are removed."
178    
179  ;;; Toolbar configuration (:group 'mh-toolbar)  ;;; Toolbar configuration (:group 'mh-toolbar)
180    
 (defconst mh-tool-bar-item-inc         "Incorporate new mail in Inbox")  
 (defconst mh-tool-bar-item-save-mime   "Save MIME parts")  
 (defconst mh-tool-bar-item-prev-msg    "Previous message")  
 (defconst mh-tool-bar-item-page-msg    "Page this message")  
 (defconst mh-tool-bar-item-next-msg    "Next message")  
 (defconst mh-tool-bar-item-delete      "Mark for deletion")  
 (defconst mh-tool-bar-item-refile      "Refile this message")  
 (defconst mh-tool-bar-item-undo        "Undo this mark")  
 (defconst mh-tool-bar-item-perform     "Perform moves and deletes")  
 (defconst mh-tool-bar-item-toggle-show "Toggle showing message")  
 (defconst mh-tool-bar-item-reply-from  "Reply to \"from\"")  
 (defconst mh-tool-bar-item-reply-to    "Reply to \"to\"")  
 (defconst mh-tool-bar-item-reply-all   "Reply to \"all\"")  
 (defconst mh-tool-bar-item-reply       "Reply to this message")  
 (defconst mh-tool-bar-item-alias       "Grab From alias")  
 (defconst mh-tool-bar-item-compose     "Compose new message")  
 (defconst mh-tool-bar-item-rescan      "Rescan this folder")  
 (defconst mh-tool-bar-item-repack      "Repack this folder")  
 (defconst mh-tool-bar-item-search      "Search")  
 (defconst mh-tool-bar-item-visit       "Visit other folder")  
 (defconst mh-tool-bar-item-prefs       "MH-E preferences")  
 (defconst mh-tool-bar-item-help        "Help")  
 (defconst mh-tool-bar-item-widen       "Widen from this sequence")  
   
 (defconst mh-tool-bar-item-send        "Send this letter")  
 (defconst mh-tool-bar-item-attach      "Insert attachment")  
 (defconst mh-tool-bar-item-spell       "Check spelling")  
 (defconst mh-tool-bar-item-save        "Save current buffer to its file")  
 (defconst mh-tool-bar-item-undo-op     "Undo last operation")  
 (defconst mh-tool-bar-item-kill  
   "Cut (kill) text in region between mark and current position")  
 (defconst mh-tool-bar-item-copy  
   "Copy text in region between mark and current position")  
 (defconst mh-tool-bar-item-paste  
   "Paste (yank) text cut or copied earlier")  
 (defconst mh-tool-bar-item-kill-draft  "Kill this draft")  
 (defconst mh-tool-bar-item-comp-prefs  "MH-E composition preferences")  
   
 (defcustom mh-tool-bar-reply-3-buttons-flag nil  
   "*Non-nil means use three buttons for reply commands in tool-bar.  
 If you have room on your tool-bar because you are using a large font, you  
 may set this variable to expand the single reply button into three buttons  
 that won't lead to minibuffer prompt about who to reply to."  
   :type 'boolean  
   :group 'mh-toolbar)  
   
181  (defcustom mh-tool-bar-search-function 'mh-search-folder  (defcustom mh-tool-bar-search-function 'mh-search-folder
182    "*Function called by the tool-bar search button.    "*Function called by the tool-bar search button.
183  See `mh-search-folder' and `mh-index-search' for details."  See `mh-search-folder' and `mh-index-search' for details."
# Line 228  See `mh-search-folder' and `mh-index-sea Line 186  See `mh-search-folder' and `mh-index-sea
186                   (function :tag "Other function"))                   (function :tag "Other function"))
187    :group 'mh-toolbar)    :group 'mh-toolbar)
188    
189  (eval-when-compile (defvar tool-bar-map))  ;; Functions called from the tool bar
190  (defvar mh-show-tool-bar-map nil)  (defun mh-tool-bar-search (&optional arg)
191  (defun mh-tool-bar-show-set ()    "Interactively call `mh-tool-bar-search-function'.
192    "Construct toolbar for `mh-show-mode'."  Optional argument ARG is not used."
193    (when (fboundp 'tool-bar-add-item)    (interactive "P")
194      (setq    (call-interactively mh-tool-bar-search-function))
      mh-show-tool-bar-map  
      (let ((tool-bar-map (make-sparse-keymap)))  
        (if (member mh-tool-bar-item-inc mh-tool-bar-folder-buttons)  
            (tool-bar-add-item "mail" 'mh-inc-folder 'mh-showtoolbar-inc-folder  
                               :help mh-tool-bar-item-inc))  
        (if (member mh-tool-bar-item-save-mime mh-tool-bar-folder-buttons)  
            (tool-bar-add-item "attach" 'mh-mime-save-parts  
                               'mh-showtoolbar-mime-save-parts  
                               :help mh-tool-bar-item-save-mime))  
        (if (member mh-tool-bar-item-prev-msg mh-tool-bar-folder-buttons)  
            (tool-bar-add-item "left_arrow" 'mh-show-previous-undeleted-msg  
                               'mh-showtoolbar-prev  
                               :help mh-tool-bar-item-prev-msg))  
        (if (member mh-tool-bar-item-page-msg mh-tool-bar-folder-buttons)  
            (tool-bar-add-item "page-down" 'mh-show-page-msg 'mh-showtoolbar-page  
                               :help mh-tool-bar-item-page-msg))  
        (if (member mh-tool-bar-item-next-msg mh-tool-bar-folder-buttons)  
            (tool-bar-add-item "right_arrow" 'mh-show-next-undeleted-msg  
                               'mh-showtoolbar-next  
                               :help mh-tool-bar-item-next-msg))  
        (if (member mh-tool-bar-item-delete mh-tool-bar-folder-buttons)  
            (tool-bar-add-item "close" 'mh-show-delete-msg  
                               'mh-showtoolbar-delete  
                               :help mh-tool-bar-item-delete))  
        (if (member mh-tool-bar-item-refile mh-tool-bar-folder-buttons)  
            (tool-bar-add-item "refile" 'mh-show-refile-msg  
                               'mh-showtoolbar-refile  
                               :help mh-tool-bar-item-refile))  
        (if (member mh-tool-bar-item-undo mh-tool-bar-folder-buttons)  
            (tool-bar-add-item "undo" 'mh-show-undo  'mh-showtoolbar-undo  
                               :help mh-tool-bar-item-undo))  
        (if (member mh-tool-bar-item-perform mh-tool-bar-folder-buttons)  
            (tool-bar-add-item "execute" 'mh-show-execute-commands  
                               'mh-showtoolbar-exec  
                               :help mh-tool-bar-item-perform))  
        (if (member mh-tool-bar-item-toggle-show  mh-tool-bar-folder-buttons)  
            (tool-bar-add-item "show" 'mh-show-toggle-showing  
                               'mh-showtoolbar-toggle-show  
                               :help mh-tool-bar-item-toggle-show))  
        (if (member mh-tool-bar-item-reply-from mh-tool-bar-folder-buttons)  
            (tool-bar-add-item "reply-from"  
                               (lambda (&optional arg)  
                                 (interactive "P")  
                                 (set-buffer mh-show-folder-buffer)  
                                 (mh-reply (mh-get-msg-num nil) "from" arg))  
                               'mh-showtoolbar-reply-from  
                               :help mh-tool-bar-item-reply-from))  
        (if (member mh-tool-bar-item-reply-to mh-tool-bar-folder-buttons)  
            (tool-bar-add-item "reply-to"  
                               (lambda (&optional arg)  
                                 (interactive "P")  
                                 (set-buffer mh-show-folder-buffer)  
                                 (mh-reply (mh-get-msg-num nil) "to" arg))  
                               'mh-showtoolbar-reply-to  
                               :help mh-tool-bar-item-reply-to))  
        (if (member mh-tool-bar-item-reply-all mh-tool-bar-folder-buttons)  
            (tool-bar-add-item "reply-all"  
                               (lambda (&optional arg)  
                                 (interactive "P")  
                                 (set-buffer mh-show-folder-buffer)  
                                 (mh-reply (mh-get-msg-num nil) "all" arg))  
                               'mh-showtoolbar-reply-all  
                               :help mh-tool-bar-item-reply-all))  
        (if (member mh-tool-bar-item-reply mh-tool-bar-folder-buttons)  
            (tool-bar-add-item "mail/reply2" 'mh-show-reply  
                               'mh-showtoolbar-reply  
                               :help mh-tool-bar-item-reply))  
        (if (member mh-tool-bar-item-alias mh-tool-bar-folder-buttons)  
            (tool-bar-add-item "alias" 'mh-alias-grab-from-field  
                               'mh-showtoolbar-alias  
                               :help mh-tool-bar-item-alias  
                               :enable '(mh-alias-from-has-no-alias-p)))  
        (if (member mh-tool-bar-item-compose mh-tool-bar-folder-buttons)  
            (tool-bar-add-item "mail_compose" 'mh-send 'mh-showtoolbar-compose  
                               :help mh-tool-bar-item-compose))  
        (if (member mh-tool-bar-item-rescan mh-tool-bar-folder-buttons)  
            (tool-bar-add-item "rescan" 'mh-show-rescan-folder  
                               'mh-showtoolbar-rescan  
                               :help mh-tool-bar-item-rescan))  
        (if (member mh-tool-bar-item-repack mh-tool-bar-folder-buttons)  
            (tool-bar-add-item "repack" 'mh-show-pack-folder  
                               'mh-showtoolbar-pack  
                               :help mh-tool-bar-item-repack))  
        (if (member mh-tool-bar-item-search mh-tool-bar-folder-buttons)  
            (tool-bar-add-item "search"  
                               (lambda (&optional arg)  
                                 (interactive "P")  
                                 (call-interactively  
                                  mh-tool-bar-search-function))  
                               'mh-showtoolbar-search  
                               :help mh-tool-bar-item-search))  
        (if (member mh-tool-bar-item-visit mh-tool-bar-folder-buttons)  
            (tool-bar-add-item "fld_open" 'mh-visit-folder  
                               'mh-showtoolbar-visit  
                               :help mh-tool-bar-item-visit))  
        (if (member mh-tool-bar-item-prefs mh-tool-bar-folder-buttons)  
            (tool-bar-add-item "preferences" (lambda ()  
                                               (interactive)  
                                               (mh-customize t))  
                               'mh-showtoolbar-customize  
                               :help mh-tool-bar-item-prefs))  
        (if (member mh-tool-bar-item-help mh-tool-bar-folder-buttons)  
            (tool-bar-add-item "help" (lambda ()  
                                        (interactive)  
                                        (Info-goto-node "(mh-e)Top")  
                                        (delete-other-windows))  
                               'mh-showtoolbar-help  
                               :help mh-tool-bar-item-help))  
        tool-bar-map))))  
   
 (defvar mh-letter-tool-bar-map nil)  
 ;;;###mh-autoload  
 (defun mh-tool-bar-letter-set ()  
   "Construct toolbar for `mh-letter-mode'."  
   (when (fboundp 'tool-bar-add-item)  
     (setq  
      mh-letter-tool-bar-map  
      (let ((tool-bar-map (make-sparse-keymap)))  
        (if (member mh-tool-bar-item-send mh-tool-bar-letter-buttons)  
            (tool-bar-add-item "mail_send" 'mh-send-letter  
                               'mh-lettertoolbar-send  
                               :help mh-tool-bar-item-send))  
        (if (member mh-tool-bar-item-attach mh-tool-bar-letter-buttons)  
            (tool-bar-add-item "attach" 'mh-compose-insertion  
                               'mh-lettertoolbar-compose  
                               :help mh-tool-bar-item-attach))  
        (if (member mh-tool-bar-item-spell mh-tool-bar-letter-buttons)  
            (tool-bar-add-item "spell" 'ispell-message 'mh-lettertoolbar-ispell  
                               :help mh-tool-bar-item-spell))  
        (if (member mh-tool-bar-item-save mh-tool-bar-letter-buttons)  
            (tool-bar-add-item-from-menu 'save-buffer "save"))  
        (if (member mh-tool-bar-item-undo-op mh-tool-bar-letter-buttons)  
            (tool-bar-add-item-from-menu 'undo "undo"))  
        (if (member mh-tool-bar-item-kill mh-tool-bar-letter-buttons)  
            (tool-bar-add-item-from-menu 'kill-region "cut"))  
        (if (member mh-tool-bar-item-copy mh-tool-bar-letter-buttons)  
            (tool-bar-add-item-from-menu 'menu-bar-kill-ring-save "copy"))  
        (if (member mh-tool-bar-item-paste mh-tool-bar-letter-buttons)  
            (tool-bar-add-item-from-menu 'yank "paste"))  
        (if (member mh-tool-bar-item-kill-draft mh-tool-bar-letter-buttons)  
           (tool-bar-add-item "close" 'mh-fully-kill-draft  
                              'mh-lettertoolbar-kill  
                              :help mh-tool-bar-item-kill-draft))  
        (if (member mh-tool-bar-item-comp-prefs mh-tool-bar-letter-buttons)  
           (tool-bar-add-item "preferences" (lambda ()  
                                              (interactive)  
                                              (mh-customize t))  
                              'mh-lettertoolbar-customize  
                              :help mh-tool-bar-item-comp-prefs))  
        (if (member mh-tool-bar-item-help mh-tool-bar-letter-buttons)  
           (tool-bar-add-item "help" (lambda ()  
                                       (interactive)  
                                       (Info-goto-node "(mh-e)Draft Editing")  
                                       (delete-other-windows))  
                              'mh-lettertoolbar-help  
                              :help mh-tool-bar-item-help))  
           tool-bar-map))))  
   
 (defvar mh-folder-tool-bar-map nil)  
 (defvar mh-folder-seq-tool-bar-map nil  
   "Tool-bar to use when narrowed to a sequence in MH-Folder buffers.")  
 ;;;###mh-autoload  
 (defun mh-tool-bar-folder-set ()  
   "Construct toolbar for `mh-folder-mode'."  
   (when (fboundp 'tool-bar-add-item)  
     (setq  
      mh-folder-tool-bar-map  
      (let ((tool-bar-map (make-sparse-keymap)))  
        (if (member mh-tool-bar-item-inc mh-tool-bar-folder-buttons)  
            (tool-bar-add-item "mail" 'mh-inc-folder  
                               'mh-foldertoolbar-inc-folder  
                               :help mh-tool-bar-item-inc))  
        (if (member mh-tool-bar-item-save-mime mh-tool-bar-folder-buttons)  
            (tool-bar-add-item "attach" 'mh-mime-save-parts  
                               'mh-foldertoolbar-mime-save-parts  
                               :help mh-tool-bar-item-save-mime))  
        (if (member mh-tool-bar-item-prev-msg mh-tool-bar-folder-buttons)  
            (tool-bar-add-item "left_arrow" 'mh-previous-undeleted-msg  
                               'mh-foldertoolbar-prev  
                               :help mh-tool-bar-item-prev-msg))  
        (if (member mh-tool-bar-item-page-msg mh-tool-bar-folder-buttons)  
            (tool-bar-add-item "page-down" 'mh-page-msg 'mh-foldertoolbar-page  
                               :help mh-tool-bar-item-page-msg))  
        (if (member mh-tool-bar-item-next-msg mh-tool-bar-folder-buttons)  
            (tool-bar-add-item "right_arrow" 'mh-next-undeleted-msg  
                               'mh-foldertoolbar-next  
                               :help mh-tool-bar-item-next-msg))  
        (if (member mh-tool-bar-item-delete mh-tool-bar-folder-buttons)  
            (tool-bar-add-item "close" 'mh-delete-msg 'mh-foldertoolbar-delete  
                               :help mh-tool-bar-item-delete))  
        (if (member mh-tool-bar-item-refile mh-tool-bar-folder-buttons)  
            (tool-bar-add-item "refile" 'mh-refile-msg 'mh-foldertoolbar-refile  
                               :help mh-tool-bar-item-refile))  
        (if (member mh-tool-bar-item-undo mh-tool-bar-folder-buttons)  
            (tool-bar-add-item "undo" 'mh-undo  'mh-foldertoolbar-undo  
                               :help mh-tool-bar-item-undo))  
        (if (member mh-tool-bar-item-perform mh-tool-bar-folder-buttons)  
            (tool-bar-add-item "execute" 'mh-execute-commands  
                               'mh-foldertoolbar-exec  
                               :help mh-tool-bar-item-perform))  
        (if (member mh-tool-bar-item-toggle-show  mh-tool-bar-folder-buttons)  
            (tool-bar-add-item "show" 'mh-toggle-showing  
                               'mh-foldertoolbar-toggle-show  
                               :help mh-tool-bar-item-toggle-show))  
        (if (member mh-tool-bar-item-reply-from mh-tool-bar-folder-buttons)  
            (tool-bar-add-item "reply-from"  
                               (lambda (&optional arg)  
                                 (interactive "P")  
                                 (mh-reply (mh-get-msg-num nil) "from" arg))  
                               'mh-foldertoolbar-reply-from  
                               :help mh-tool-bar-item-reply-from))  
        (if (member mh-tool-bar-item-reply-to mh-tool-bar-folder-buttons)  
            (tool-bar-add-item "reply-to"  
                               (lambda (&optional arg)  
                                 (interactive "P")  
                                 (mh-reply (mh-get-msg-num nil) "to" arg))  
                               'mh-foldertoolbar-reply-to  
                               :help mh-tool-bar-item-reply-to))  
        (if (member mh-tool-bar-item-reply-all mh-tool-bar-folder-buttons)  
            (tool-bar-add-item "reply-all"  
                               (lambda (&optional arg)  
                                 (interactive "P")  
                                 (mh-reply (mh-get-msg-num nil) "all" arg))  
                               'mh-foldertoolbar-reply-all  
                               :help mh-tool-bar-item-reply-all))  
        (if (member mh-tool-bar-item-reply mh-tool-bar-folder-buttons)  
            (tool-bar-add-item "mail/reply2" 'mh-reply  
                               'mh-foldertoolbar-reply  
                               :help mh-tool-bar-item-reply))  
        (if (member mh-tool-bar-item-alias mh-tool-bar-folder-buttons)  
            (tool-bar-add-item "alias" 'mh-alias-grab-from-field  
                               'mh-foldertoolbar-alias  
                               :help mh-tool-bar-item-alias  
                             :enable '(mh-alias-from-has-no-alias-p)))  
        (if (member mh-tool-bar-item-compose mh-tool-bar-folder-buttons)  
            (tool-bar-add-item "mail_compose" 'mh-send 'mh-foldertoolbar-compose  
                               :help mh-tool-bar-item-compose))  
        (if (member mh-tool-bar-item-rescan mh-tool-bar-folder-buttons)  
            (tool-bar-add-item "rescan" 'mh-rescan-folder  
                               'mh-foldertoolbar-rescan  
                               :help mh-tool-bar-item-rescan))  
        (if (member mh-tool-bar-item-repack mh-tool-bar-folder-buttons)  
            (tool-bar-add-item "repack" 'mh-pack-folder 'mh-foldertoolbar-pack  
                               :help mh-tool-bar-item-repack))  
        (if (member mh-tool-bar-item-search mh-tool-bar-folder-buttons)  
            (tool-bar-add-item "search"  
                               (lambda (&optional arg)  
                                 (interactive "P")  
                                 (call-interactively  
                                  mh-tool-bar-search-function))  
                               'mh-foldertoolbar-search  
                               :help mh-tool-bar-item-search))  
        (if (member mh-tool-bar-item-visit mh-tool-bar-folder-buttons)  
          (tool-bar-add-item "fld_open" 'mh-visit-folder  
                             'mh-foldertoolbar-visit  
                             :help mh-tool-bar-item-visit))  
        (if (member mh-tool-bar-item-prefs mh-tool-bar-folder-buttons)  
            (tool-bar-add-item "preferences" (lambda ()  
                                               (interactive)  
                                               (mh-customize t))  
                               'mh-foldertoolbar-customize  
                               :help mh-tool-bar-item-prefs))  
        (if (member mh-tool-bar-item-help mh-tool-bar-folder-buttons)  
            (tool-bar-add-item "help" (lambda ()  
                                        (interactive)  
                                        (Info-goto-node "(mh-e)Top")  
                                        (delete-other-windows))  
                               'mh-foldertoolbar-help  
                               :help mh-tool-bar-item-help))  
        tool-bar-map))  
   
     (setq mh-folder-seq-tool-bar-map  
           (let ((tool-bar-map (copy-keymap mh-folder-tool-bar-map)))  
             (if (member mh-tool-bar-item-widen mh-tool-bar-folder-buttons)  
                 (tool-bar-add-item "widen" 'mh-widen 'mh-foldertoolbar-widen  
                                    :help mh-tool-bar-item-widen))  
             tool-bar-map))))  
   
 (defun mh-tool-bar-folder-buttons-set (symbol value)  
   "Update the `mh-tool-bar-folder-buttons' variable, and rebuild the tool-bar.  
 Sets the default for SYMBOL (e.g. `mh-tool-bar-folder-buttons') to VALUE (as  
 set in customization).  This is called after 'customize is used to alter  
 `mh-tool-bar-folder-buttons'."  
   (set-default symbol value)  
   (mh-tool-bar-show-set)  
   (mh-tool-bar-folder-set))  
   
 (custom-declare-variable  
  'mh-tool-bar-folder-buttons  
  '(append  
    (list mh-tool-bar-item-inc  
          mh-tool-bar-item-save-mime  
          mh-tool-bar-item-prev-msg  
          mh-tool-bar-item-page-msg  
          mh-tool-bar-item-next-msg  
          mh-tool-bar-item-delete  
          mh-tool-bar-item-refile  
          mh-tool-bar-item-undo  
          mh-tool-bar-item-perform  
 ;;;      mh-tool-bar-item-toggle-show  
          )  
    (if mh-tool-bar-reply-3-buttons-flag  
        (list mh-tool-bar-item-reply-from  
              mh-tool-bar-item-reply-to  
              mh-tool-bar-item-reply-all)  
      (list mh-tool-bar-item-reply))  
    (list mh-tool-bar-item-alias  
          mh-tool-bar-item-compose  
          mh-tool-bar-item-rescan  
 ;;;      mh-tool-bar-item-repack  
          mh-tool-bar-item-search  
          mh-tool-bar-item-visit  
          mh-tool-bar-item-prefs  
          mh-tool-bar-item-help  
          mh-tool-bar-item-widen))  
  "Buttons to include in MH-E folder/show toolbar."  
  :group 'mh-toolbar  
  :set 'mh-tool-bar-folder-buttons-set  
  :type `(set (const ,mh-tool-bar-item-inc)  
              (const ,mh-tool-bar-item-save-mime)  
              (const ,mh-tool-bar-item-prev-msg)  
              (const ,mh-tool-bar-item-page-msg)  
              (const ,mh-tool-bar-item-next-msg)  
              (const ,mh-tool-bar-item-delete)  
              (const ,mh-tool-bar-item-refile)  
              (const ,mh-tool-bar-item-undo)  
              (const ,mh-tool-bar-item-perform)  
              (const ,mh-tool-bar-item-toggle-show)  
              (const ,mh-tool-bar-item-reply-from)  
              (const ,mh-tool-bar-item-reply-to)  
              (const ,mh-tool-bar-item-reply-all)  
              (const ,mh-tool-bar-item-reply)  
              (const ,mh-tool-bar-item-alias)  
              (const ,mh-tool-bar-item-compose)  
              (const ,mh-tool-bar-item-rescan)  
              (const ,mh-tool-bar-item-repack)  
              (const ,mh-tool-bar-item-search)  
              (const ,mh-tool-bar-item-visit)  
              (const ,mh-tool-bar-item-prefs)  
              (const ,mh-tool-bar-item-help)  
              (const ,mh-tool-bar-item-widen)))  
   
 (defun mh-tool-bar-letter-buttons-set (symbol value)  
   "Update the `mh-tool-bar-letter-buttons' variable, and rebuild the tool-bar.  
 Sets the default for SYMBOL (e.g. `mh-tool-bar-letter-buttons') to VALUE (as  
 set in customization).  This is called after 'customize is used to alter  
 `mh-tool-bar-letter-buttons'."  
   (set-default symbol value)  
   (mh-tool-bar-letter-set))  
195    
196  (custom-declare-variable  (defun mh-tool-bar-customize ()
197   'mh-tool-bar-letter-buttons    "Call `mh-customize' from the toolbar."
198   '(list mh-tool-bar-item-send    (interactive)
199          mh-tool-bar-item-attach    (mh-customize t))
200          mh-tool-bar-item-spell  
201          mh-tool-bar-item-save  (defun mh-tool-bar-folder-help ()
202          mh-tool-bar-item-undo-op    "Visit \"(mh-e)Top\"."
203          mh-tool-bar-item-kill    (interactive)
204          mh-tool-bar-item-copy    (Info-goto-node "(mh-e)Top")
205          mh-tool-bar-item-paste    (delete-other-windows))
206          mh-tool-bar-item-kill-draft  
207          mh-tool-bar-item-comp-prefs  (defun mh-tool-bar-letter-help ()
208          mh-tool-bar-item-help)    "Visit \"(mh-e)Draft Editing\"."
209   "Buttons to include in MH-E letter toolbar."    (interactive)
210   :group 'mh-toolbar    (Info-goto-node "(mh-e)Draft Editing")
211   :set 'mh-tool-bar-letter-buttons-set    (delete-other-windows))
212   :type `(set (const ,mh-tool-bar-item-send)  
213               (const ,mh-tool-bar-item-attach)  (defmacro mh-tool-bar-reply-generator (function recipient folder-buffer-flag)
214               (const ,mh-tool-bar-item-spell)    "Generate FUNCTION that replies to RECIPIENT.
215               (const ,mh-tool-bar-item-save)  If FOLDER-BUFFER-FLAG is nil then the function generated
216               (const ,mh-tool-bar-item-undo-op)  When INCLUDE-FLAG is non-nil, include message body being replied to."
217               (const ,mh-tool-bar-item-kill)    `(defun ,function (&optional arg)
218               (const ,mh-tool-bar-item-copy)       ,(format "Reply to \"%s\".\nWhen ARG is non-nil include message in reply."
219               (const ,mh-tool-bar-item-paste)                recipient)
220               (const ,mh-tool-bar-item-kill-draft)       (interactive "P")
221               (const ,mh-tool-bar-item-comp-prefs)       ,(if folder-buffer-flag nil '(set-buffer mh-show-folder-buffer))
222               (const ,mh-tool-bar-item-help)))       (mh-reply (mh-get-msg-num nil) ,recipient arg)))
223    
224    (mh-tool-bar-reply-generator mh-tool-bar-reply-from "from" t)
225    (mh-tool-bar-reply-generator mh-show-tool-bar-reply-from "from" nil)
226    (mh-tool-bar-reply-generator mh-tool-bar-reply-to "to" t)
227    (mh-tool-bar-reply-generator mh-show-tool-bar-reply-to "to" nil)
228    (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)
230    
231    ;; XEmacs has a couple of extra customizations...
232    (mh-do-in-xemacs
233      (require 'mh-xemacs-icons)
234      (defcustom mh-xemacs-use-toolbar-flag (if (and (featurep 'toolbar)
235                                                     (featurep 'xpm)
236                                                     (device-on-window-system-p))
237                                                t
238                                              nil)
239        "*If non-nil, use toolbar.
240    
241    This will default to t if you are in an environment that supports
242    toolbars and xpm."
243        :type 'boolean
244        :group 'mh-toolbar)
245    
246      (defcustom mh-xemacs-toolbar-position (if mh-xemacs-use-toolbar-flag
247                                                'default
248                                              nil)
249        "*Where to put the toolbar.
250    
251    Valid non-nil values are \"default\", \"top\", \"bottom\", \"left\",
252    \"right\".  These match the four edges of the frame, with \"default\"
253    meaning \"use the same position as the default-toolbar\".
254    
255    A nil value means do not use a toolbar.
256    
257    If this variable is set to anything other than \"default\" and the
258    default-toolbar has a different positional setting from the value of
259    this variable, then two toolbars will be displayed.  The MH-E toolbar
260    and the default-toolbar."
261        :type '(radio (const :tag "Same position as the \"default-toolbar\""
262                             :value default)
263                      (const :tag "Along the top edge of the frame"
264                             :value top)
265                      (const :tag "Along the bottom edge of the frame"
266                             :value bottom)
267                      (const :tag "Along the left edge of the frame"
268                             :value left)
269                      (const :tag "Along the right edge of the frame"
270                             :value right)
271                      (const :tag "Don't use a toolbar" nil))
272        :group 'mh-toolbar))
273    
274    (defmacro mh-tool-bar-define (defaults &rest buttons)
275      "Define a tool bar for MH-E.
276    DEFAULTS is the list of buttons that are present by default. It is a list of
277    lists where the sublists are of the following form:
278    
279      (:KEYWORD FUNC1 FUNC2 FUNC3 ...)
280    
281    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
283    :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.
285    
286    Each element of BUTTONS is a list of four things:
287    
288      (FUNCTION MODES ICON DOC)
289    
290    where,
291    
292      FUNCTION is the name of the function that will be executed when the button
293      is clicked.
294    
295      MODES is a list of symbols. List elements must be from `folder', `letter' and
296      `sequence'. If `folder' is present then the button is available in the
297      folder and show buffer. If the name of FUNCTION is of the form \"mh-foo\",
298      where foo is some arbitrary string, then we check if the function
299      `mh-show-foo' exists. If it exists then that function is used in the show
300      buffer. Otherwise the original function `mh-foo' is used in the show buffer
301      as well. Presence of `sequence' is handled similar to the above. The only
302      difference is that the button is shown only when the folder is narrowed to a
303      sequence. If `letter' is present in MODES, then the button is available
304      during draft editing and runs FUNCTION when clicked.
305    
306      ICON is the icon that is drawn in the button.
307    
308      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
310      string. So the DOC should be formatted such that the first line is useful and
311      complete without the rest of the string."
312      ;; The following variable names have been carefully chosen to make code
313      ;; generation easier. Modifying the names should be done carefully.
314      (let (folder-buttons folder-docs folder-button-setter sequence-button-setter
315            show-buttons show-button-setter show-seq-button-setter
316            letter-buttons letter-docs letter-button-setter
317            folder-defaults letter-defaults
318            folder-vectors show-vectors letter-vectors)
319        (dolist (x defaults)
320          (cond ((eq (car x) :folder) (setq folder-defaults (cdr x)))
321                ((eq (car x) :letter) (setq letter-defaults (cdr x)))))
322        (dolist (button buttons)
323          (unless (and (listp button) (equal (length button) 4))
324            (error "Incorrect MH-E tool-bar button specification: %s" button))
325          (let* ((name (nth 0 button))
326                 (name-str (symbol-name name))
327                 (icon (nth 2 button))
328                 (xemacs-icon (mh-do-in-xemacs
329                               (cdr (assoc (intern icon) mh-xemacs-icon-map))))
330                 (full-doc (nth 3 button))
331                 (doc (if (string-match "\\(.*\\)\n" full-doc)
332                          (match-string 1 full-doc)
333                        full-doc))
334                 (modes (nth 1 button))
335                 functions show-sym)
336            (when (memq 'letter modes) (setq functions `(:letter ,name)))
337            (when (or (memq 'folder modes) (memq 'sequence modes))
338              (setq functions
339                    (append `(,(if (memq 'folder modes) :folder :sequence) ,name)
340                            functions))
341              (setq show-sym
342                    (if (string-match "^mh-\\(.*\\)$" name-str)
343                        (intern (concat "mh-show-" (match-string 1 name-str)))
344                      name))
345              (setq functions
346                    (append `(,(if (memq 'folder modes) :show :show-seq)
347                              ,(if (fboundp show-sym) show-sym name))
348                            functions)))
349            (do ((functions functions (cddr functions)))
350                ((null functions))
351              (let* ((type (car functions))
352                     (function (cadr functions))
353                     (type1 (substring (symbol-name type) 1))
354                     (vector-list (cond ((eq type :show) 'show-vectors)
355                                        ((eq type :show-seq) 'show-vectors)
356                                        ((eq type :letter) 'letter-vectors)
357                                        (t 'folder-vectors)))
358                     (list (cond ((eq type :letter) 'mh-tool-bar-letter-buttons)
359                                 (t 'mh-tool-bar-folder-buttons)))
360                     (key (intern (concat "mh-" type1 "toolbar-" name-str)))
361                     (setter (intern (concat type1 "-button-setter")))
362                     (mbuttons (cond ((eq type :letter) 'letter-buttons)
363                                     ((eq type :show) 'show-buttons)
364                                     ((eq type :show-seq) 'show-buttons)
365                                     (t 'folder-buttons)))
366                     (docs (cond ((eq mbuttons 'letter-buttons) 'letter-docs)
367                                 ((eq mbuttons 'folder-buttons) 'folder-docs))))
368                (add-to-list vector-list `[,xemacs-icon ,function t ,full-doc])
369                (add-to-list
370                 setter `(when (member ',name ,list)
371                           (mh-funcall-if-exists
372                            tool-bar-add-item ,icon ',function ',key :help ,doc)))
373                (add-to-list mbuttons name)
374                (if docs (add-to-list docs doc))))))
375        (setq folder-buttons (nreverse folder-buttons)
376              letter-buttons (nreverse letter-buttons)
377              show-buttons (nreverse show-buttons)
378              letter-docs (nreverse letter-docs)
379              folder-docs (nreverse folder-docs)
380              folder-vectors (nreverse folder-vectors)
381              show-vectors (nreverse show-vectors)
382              letter-vectors (nreverse letter-vectors))
383        (dolist (x folder-defaults)
384          (unless (memq x folder-buttons)
385            (error "Folder defaults contains unknown button '%s'" x)))
386        (dolist (x letter-defaults)
387          (unless (memq x letter-buttons)
388            (error "Letter defaults contains unknown button '%s'" x)))
389        `(eval-when (compile load eval)
390           (defvar mh-folder-tool-bar-map nil)
391           (defvar mh-folder-seq-tool-bar-map nil)
392           (defvar mh-show-tool-bar-map nil)
393           (defvar mh-show-seq-tool-bar-map nil)
394           (defvar mh-letter-tool-bar-map nil)
395           ;; GNU Emacs tool bar specific code
396           (mh-do-in-gnu-emacs
397             ;; Custom setter functions
398             (defun mh-tool-bar-folder-buttons-set (symbol value)
399               "Construct toolbar for `mh-folder-mode' and `mh-show-mode'."
400               (set-default symbol value)
401               (setq mh-folder-tool-bar-map
402                     (let ((tool-bar-map (make-sparse-keymap)))
403                       ,@(nreverse folder-button-setter)
404                       tool-bar-map))
405               (setq mh-show-tool-bar-map
406                     (let ((tool-bar-map (make-sparse-keymap)))
407                       ,@(nreverse show-button-setter)
408                       tool-bar-map))
409               (setq mh-show-seq-tool-bar-map
410                     (let ((tool-bar-map (copy-keymap mh-show-tool-bar-map)))
411                       ,@(nreverse show-seq-button-setter)
412                       tool-bar-map))
413               (setq mh-folder-seq-tool-bar-map
414                     (let ((tool-bar-map (copy-keymap mh-folder-tool-bar-map)))
415                       ,@(nreverse sequence-button-setter)
416                       tool-bar-map)))
417             (defun mh-tool-bar-letter-buttons-set (symbol value)
418               "Construct toolbar for `mh-letter-mode'."
419               (set-default symbol value)
420               (setq mh-letter-tool-bar-map
421                     (let ((tool-bar-map (make-sparse-keymap)))
422                       ,@(nreverse letter-button-setter)
423                       tool-bar-map))))
424           ;; XEmacs specific code
425           (mh-do-in-xemacs
426             (defvar mh-toolbar-folder-vector-map
427               ',(loop for button in folder-buttons
428                       for vector in folder-vectors
429                       collect (cons button vector)))
430             (defvar mh-toolbar-show-vector-map
431               ',(loop for button in show-buttons
432                       for vector in show-vectors
433                       collect (cons button vector)))
434             (defvar mh-toolbar-letter-vector-map
435               ',(loop for button in letter-buttons
436                       for vector in letter-vectors
437                       collect (cons button vector)))
438             (defvar mh-toolbar-folder-buttons nil)
439             (defvar mh-toolbar-show-buttons nil)
440             (defvar mh-toolbar-letter-buttons nil)
441             ;; Custom setter functions
442             (defun mh-tool-bar-letter-buttons-set (symbol value)
443               (set-default symbol value)
444               (setq mh-toolbar-letter-buttons
445                     (loop for b in value
446                           collect (cdr (assoc b mh-toolbar-letter-vector-map)))))
447             (defun mh-tool-bar-folder-buttons-set (symbol value)
448               (set-default symbol value)
449               (setq mh-toolbar-folder-buttons
450                     (loop for b in value
451                           collect (cdr (assoc b mh-toolbar-folder-vector-map))))
452               (setq mh-toolbar-show-buttons
453                     (loop for b in value
454                           collect (cdr (assoc b mh-toolbar-show-vector-map)))))
455             ;; Initialize toolbar
456             (defun mh-toolbar-init (mode)
457               "Install toolbar in MODE."
458               (let ((toolbar (cond ((eq mode :folder) mh-toolbar-folder-buttons)
459                                    ((eq mode :letter) mh-toolbar-letter-buttons)
460                                    ((eq mode :show) mh-toolbar-show-buttons)))
461                     (height 37)
462                     (width 40)
463                     (buffer (current-buffer)))
464                 (when (and mh-xemacs-toolbar-position mh-xemacs-use-toolbar-flag)
465                   (cond
466                    ((eq mh-xemacs-toolbar-position 'top)
467                     (set-specifier top-toolbar (cons buffer toolbar))
468                     (set-specifier top-toolbar-visible-p t)
469                     (set-specifier top-toolbar-height height))
470                    ((eq mh-xemacs-toolbar-position 'bottom)
471                     (set-specifier bottom-toolbar (cons buffer toolbar))
472                     (set-specifier bottom-toolbar-visible-p t)
473                     (set-specifier bottom-toolbar-height height))
474                    ((eq mh-xemacs-toolbar-position 'left)
475                     (set-specifier left-toolbar (cons buffer toolbar))
476                     (set-specifier left-toolbar-visible-p t)
477                     (set-specifier left-toolbar-width width))
478                    ((eq mh-xemacs-toolbar-position 'right)
479                     (set-specifier right-toolbar (cons buffer toolbar))
480                     (set-specifier right-toolbar-visible-p t)
481                     (set-specifier right-toolbar-width width))
482                    (t (set-specifier default-toolbar (cons buffer toolbar))))))))
483           ;; Declare customizable toolbars
484           (custom-declare-variable
485            'mh-tool-bar-folder-buttons
486            '(list ,@(mapcar (lambda (x) `(quote ,x)) folder-defaults))
487            "Choose buttons to include in MH-E folder/show toolbar."
488            :group 'mh-toolbar :set 'mh-tool-bar-folder-buttons-set
489            :type '(set ,@(loop for x in folder-buttons
490                                for y in folder-docs
491                                collect `(const :tag ,y ,x))))
492           (custom-declare-variable
493            'mh-tool-bar-letter-buttons
494            '(list ,@(mapcar (lambda (x) `(quote ,x)) letter-defaults))
495            "Choose buttons to include in MH-E letter toolbar."
496            :group 'mh-toolbar :set 'mh-tool-bar-letter-buttons-set
497            :type '(set ,@(loop for x in letter-buttons
498                                for y in letter-docs
499                                collect `(const :tag ,y ,x)))))))
500    
501    (mh-tool-bar-define
502        ((:folder mh-inc-folder mh-mime-save-parts mh-previous-undeleted-msg
503                  mh-page-msg  mh-next-undeleted-msg mh-delete-msg mh-refile-msg
504                  mh-undo mh-execute-commands mh-toggle-tick mh-reply
505                  mh-alias-grab-from-field mh-send mh-rescan-folder
506                  mh-tool-bar-search mh-visit-folder
507                  mh-tool-bar-customize mh-tool-bar-folder-help mh-widen)
508         (:letter mh-send-letter mh-compose-insertion ispell-message save-buffer
509                  undo kill-region menu-bar-kill-ring-save yank mh-fully-kill-draft
510                  mh-tool-bar-customize mh-tool-bar-letter-help))
511      ;; Folder/Show buffer buttons
512      (mh-inc-folder (folder) "mail"
513        "Incorporate new mail in Inbox
514    This button runs `mh-inc-folder' which drags any
515    new mail into your Inbox folder.")
516      (mh-mime-save-parts (folder) "attach"
517        "Save MIME parts from this message
518    This button runs `mh-mime-save-parts' which saves a message's
519    different parts into separate files.")
520      (mh-previous-undeleted-msg (folder) "left_arrow"
521        "Go to the previous undeleted message
522    This button runs `mh-previous-undeleted-msg'")
523      (mh-page-msg (folder) "page-down"
524        "Page the current message forwards\nThis button runs `mh-page-msg'")
525      (mh-next-undeleted-msg (folder) "right_arrow"
526        "Go to the next undeleted message\nThe button runs `mh-next-undeleted-msg'")
527      (mh-delete-msg (folder) "close"
528        "Mark this message for deletion\nThis button runs `mh-delete-msg'")
529      (mh-refile-msg (folder) "refile"
530        "Refile this message\nThis button runs `mh-refile-msg'")
531      (mh-undo (folder) "undo" "Undo last operation\nThis button runs `undo'")
532      (mh-execute-commands (folder) "execute"
533        "Perform moves and deletes\nThis button runs `mh-execute-commands'")
534      (mh-toggle-tick (folder) "highlight"
535        "Toggle tick mark\nThis button runs `mh-toggle-tick'")
536      (mh-toggle-showing (folder) "show"
537        "Toggle showing message\nThis button runs `mh-toggle-showing'")
538      (mh-tool-bar-reply-from (folder) "reply-from" "Reply to \"from\"")
539      (mh-tool-bar-reply-to (folder) "reply-to" "Reply to \"to\"")
540      (mh-tool-bar-reply-all (folder) "reply-all" "Reply to \"all\"")
541      (mh-reply (folder) "mail/reply2"
542        "Reply to this message\nThis button runs `mh-reply'")
543      (mh-alias-grab-from-field (folder) "alias"
544        "Grab From alias\nThis button runs `mh-alias-grab-from-field'")
545      (mh-send (folder) "mail_compose"
546        "Compose new message\nThis button runs `mh-send'")
547      (mh-rescan-folder (folder) "rescan"
548        "Rescan this folder\nThis button runs `mh-rescan-folder'")
549      (mh-pack-folder (folder) "repack"
550        "Repack this folder\nThis button runs `mh-pack-folder'")
551      (mh-tool-bar-search (folder) "search"
552        "Search\nThis button runs `mh-tool-bar-search-function'")
553      (mh-visit-folder (folder) "fld_open"
554        "Visit other folder\nThis button runs `mh-visit-folder'")
555      ;; Letter buffer buttons
556      (mh-send-letter (letter) "mail_send" "Send this letter")
557      (mh-compose-insertion (letter) "attach" "Insert attachment")
558      (ispell-message (letter) "spell" "Check spelling")
559      (save-buffer (letter) "save" "Save current buffer to its file")
560      (undo (letter) "undo" "Undo last operation")
561      (kill-region (letter) "cut"
562        "Cut (kill) text in region between mark and current position")
563      (menu-bar-kill-ring-save (letter) "copy"
564        "Copy text in region between mark and current position")
565      (yank (letter) "paste" "Paste (yank) text cut or copied earlier")
566      (mh-fully-kill-draft (letter) "close" "Kill this draft")
567      ;; Common buttons
568      (mh-tool-bar-customize (folder letter) "preferences" "MH-E Preferences")
569      (mh-tool-bar-folder-help (folder) "help"
570        "Help! (general help)\nThis button runs `Info-goto-node'")
571      (mh-tool-bar-letter-help (letter) "help"
572        "Help! (general help)\nThis button runs `Info-goto-node'")
573      ;; Folder narrowed to sequence buttons
574      (mh-widen (sequence) "widen"
575        "Widen from the sequence\nThis button runs `mh-widen'"))
576    
577    
578    
# Line 660  If you prefer fixed-width message number Line 622  If you prefer fixed-width message number
622  (defcustom mh-default-folder-list nil  (defcustom mh-default-folder-list nil
623    "*Alist of addresses and folders.    "*Alist of addresses and folders.
624  When refiling messages, these folders are the default that is provided if the  When refiling messages, these folders are the default that is provided if the
625  sender has the associated address. You do not need to list your aliases here  sender (or recipient if the Check Recipient checkbox has been selected) has
626  as that lookup is already performed.  the associated address, a regexp. The first entry to match will be used, so
627    order them according to the wanted priority. You do not need to list your
628    aliases here as that lookup is already performed.
629    
630  See `mh-prompt-for-refile-folder' and `mh-folder-from-address' for more  See `mh-prompt-for-refile-folder' and `mh-folder-from-address' for more
631  information."  information."
632    :type '(repeat (list (string :tag "Address")    :type '(repeat (list (regexp :tag "Address")
633                         (string :tag "Folder")))                         (string :tag "Folder")
634                           (boolean :tag "Check Recipient")))
635    :group 'mh-folder)    :group 'mh-folder)
636    
637  (defcustom mh-default-folder-must-exist-flag t  (defcustom mh-default-folder-must-exist-flag t
# Line 695  the `mh-progs' directory unless it is an Line 661  the `mh-progs' directory unless it is an
661    :type 'string    :type 'string
662    :group 'mh-folder)    :group 'mh-folder)
663    
664    
665    (defcustom mh-inc-spool-list nil
666      "*Alist of alternate spool files, corresponding folders and keybindings.
667    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
669    ~/mail/mh-e using Procmail and a .procmailrc entry like:
670    
671    MAILDIR=$HOME/mail      #you'd better make sure it exists
672    :0:
673    * ^From mh-e-devel-admin@lists.sourceforge.net
674    mh-e
675    
676    If you wanted to incorporate that spool file into an MH folder called
677    mh-e by pressing \"I m\" in folder-mode or by `M-x mh-inc-spool-mh-e',
678    you would setup  `mh-inc-spool-list' with an entry:
679    
680     Spool file:  ~/mail/mh-e
681     Folder:      mh-e
682     Key binding: m
683    
684    Then, you could also install `xbuffy' and configure an extra mailbox like so:
685    
686    box ~/mail/mh-e
687     title mh-e
688     origMode
689     polltime 10
690     headertime 0
691     command gnudoit -q '(mh-inc-spool-mh-e)'
692    
693    Note that the entry above uses the gnuserv package to communicate the
694    command `mh-inc-spool-mh-e' to Emacs. It will incorporate the spool file
695    when clicking the xbuffy box with the middle mouse button."
696      :type '(repeat (list (file :tag "Spool file")
697                           (string :tag "Folder")
698                           (character :tag "Key binding")))
699      :set 'mh-inc-spool-list-set
700      :group 'mh-folder)
701    
702  (defcustom mh-lpr-command-format "lpr -J '%s'"  (defcustom mh-lpr-command-format "lpr -J '%s'"
703    "*Format for Unix command that prints a message.    "*Format for Unix command that prints a message.
704  The string should be a Unix command line, with the string '%s' where  The string should be a Unix command line, with the string '%s' where
# Line 712  If t, prompt always" Line 716  If t, prompt always"
716                   directory)                   directory)
717    :group 'mh-folder)    :group 'mh-folder)
718    
 (defcustom mh-recenter-summary-flag nil  
   "*Non-nil means to recenter the summary window.  
 Recenter the summary window when the show window is toggled off if non-nil."  
   :type 'boolean  
   :group 'mh-folder)  
   
719  (defcustom mh-print-background-flag nil  (defcustom mh-print-background-flag nil
720    "*Non-nil means messages should be printed in the background.    "*Non-nil means messages should be printed in the background.
721  WARNING: do not delete the messages until printing is finished;  WARNING: do not delete the messages until printing is finished;
# Line 725  otherwise, your output may be truncated. Line 723  otherwise, your output may be truncated.
723    :type 'boolean    :type 'boolean
724    :group 'mh-folder)    :group 'mh-folder)
725    
726    (defcustom mh-recenter-summary-flag nil
727      "*Non-nil means to recenter the summary window.
728    Recenter the summary window when the show window is toggled off if non-nil."
729      :type 'boolean
730      :group 'mh-folder)
731    
732  (defcustom mh-recursive-folders-flag nil  (defcustom mh-recursive-folders-flag nil
733    "*Non-nil means that commands which operate on folders do so recursively."    "*Non-nil means that commands which operate on folders do so recursively."
734    :type 'boolean    :type 'boolean
# Line 769  A directory name string, or nil to use c Line 773  A directory name string, or nil to use c
773                   directory)                   directory)
774    :group 'mh-folder)    :group 'mh-folder)
775    
776    (defcustom mh-tick-seq 'tick
777      "The name of the MH tick sequence."
778      :type '(choice (const :tag "Disable ticking" nil)
779                     symbol)
780      :group 'mh-folder)
781    
782  (defcustom mh-update-sequences-after-mh-show-flag t  (defcustom mh-update-sequences-after-mh-show-flag t
783    "*Non-nil means `mh-update-sequence' is called from `mh-show-mode'.    "*Non-nil means `mh-update-sequence' is called from `mh-show-mode'.
784  If set, `mh-update-sequence' is run every time a message is shown, telling  If set, `mh-update-sequence' is run every time a message is shown, telling
# Line 779  display MIME content using \"M-! mhshow Line 789  display MIME content using \"M-! mhshow
789    
790    
791    
792    ;;; Indexed searching (:group 'mh-index)
793    
794    (defcustom mh-index-new-messages-folders t
795      "Folders searched for `mh-unseen-seq'.
796    If t, then `mh-inbox' is searched. If nil, all the top level folders are
797    searched. Otherwise the list of folders specified as strings are searched.
798    See also `mh-recursive-folders-flag'."
799      :group 'mh-index
800      :type '(choice (const :tag "Inbox" t)
801                     (const :tag "All" nil)
802                     (repeat :tag "Choose folders" (string :tag "Folder"))))
803    
804    (defcustom mh-index-program nil
805      "Indexing program that MH-E shall use.
806    The possible choices are swish++, swish-e, mairix, namazu, glimpse, pick and
807    grep. By default this variable is nil which means that the programs are tried
808    in order and the first one found is used.
809    
810    More information about setting up an indexing program to use with MH-E can be
811    found in the documentation of `mh-index-search'."
812      :type '(choice (const :tag "Auto-detect" nil)
813                     (const :tag "swish++" swish++)
814                     (const :tag "swish-e" swish)
815                     (const :tag "mairix" mairix)
816                     (const :tag "namazu" namazu)
817                     (const :tag "glimpse" glimpse)
818                     (const :tag "pick" pick)
819                     (const :tag "grep" grep))
820      :group 'mh-index)
821    
822    
823    
824    ;;; Spam Handling (:group 'mh-junk)
825    
826    ;; Spam fighting program chosen
827    (defvar mh-junk-choice nil)
828    
829    ;; Available spam filter interfaces
830    (defvar mh-junk-function-alist
831      '((bogofilter mh-bogofilter-blacklist mh-bogofilter-whitelist)
832        (spamprobe mh-spamprobe-blacklist mh-spamprobe-whitelist)
833        (spamassassin mh-spamassassin-blacklist mh-spamassassin-whitelist))
834      "Available choices of spam programs to use.
835    This is an alist. For each element there are functions that blacklist a message
836    as spam and whitelist a message incorrectly classified as spam.")
837    
838    (defun mh-junk-choose (symbol value)
839      "Choose spam program to use.
840    The function is always called with SYMBOL bound to `mh-junk-program' and VALUE
841    bound to the new value of `mh-junk-program'. The function sets the variable
842    `mh-junk-choice' in addition to `mh-junk-program'."
843      (set symbol value)
844      (setq mh-junk-choice
845            (or value
846                (loop for element in mh-junk-function-alist
847                      until (executable-find (symbol-name (car element)))
848                      finally return (car element)))))
849    
850    ;; User customizable variables
851    (defcustom mh-junk-mail-folder nil
852      "Folder to put spam mail in.
853    If nil then the spam is deleted."
854      :type '(choice (const :tag "Delete spam" nil)
855                     (string :tag "Spam folder"))
856      :group 'mh-junk)
857    
858    (defcustom mh-junk-program nil
859      "Spam program that MH-E shall use.
860    The possible choices are bogofilter, spamprobe, and spamassassin. By default
861    this variable is nil which means that the programs are tried in order and the
862    first one found is used."
863      :type '(choice (const :tag "auto-detect" nil)
864                     (const :tag "bogofilter" bogofilter)
865                     (const :tag "spamprobe" spamprobe)
866                     (const :tag "spamassassin" spamassassin))
867      :set 'mh-junk-choose
868      :group 'mh-junk)
869    
870    
871    
872  ;;; Message display (:group 'mh-show)  ;;; Message display (:group 'mh-show)
873    
874  (defcustom mh-bury-show-buffer-flag t  (defcustom mh-bury-show-buffer-flag t
# Line 798  what is removed." Line 888  what is removed."
888    :type 'boolean    :type 'boolean
889    :group 'mh-show)    :group 'mh-show)
890    
 (defcustom mh-decode-content-transfer-encoded-message-flag  
   (and (fboundp 'executable-find) (executable-find "mimencode") t)  
   "Non-nil means decode messages with `mimencode', if necessary.  
   
 Messages which are encoded as quoted-printable or base64 are translated into  
 8-bit characters by the `mimencode' command.  
   
 This variable is initialized to t if `mimencode' is available.  
   
 The `mimencode' program is part of the metamail package. The source can be  
 obtained from  
    ftp://thumper.bellcore.com/pub/nsb/"  
   :type 'boolean  
   :group 'mh-show)  
   
891  (defcustom mh-display-buttons-for-inline-parts-flag nil  (defcustom mh-display-buttons-for-inline-parts-flag nil
892    "*Non-nil means display buttons for all inline MIME parts.    "*Non-nil means display buttons for all inline MIME parts.
893  If non-nil, buttons are displayed for all MIME parts. Inline parts start off  If non-nil, buttons are displayed for all MIME parts. Inline parts start off
# Line 830  question." Line 905  question."
905    :type 'boolean    :type 'boolean
906    :group 'mh-show)    :group 'mh-show)
907    
908    (defcustom mh-fetch-x-image-url nil
909      "Control fetching of X-Image-URL header field image.
910    This setting only has effect if `mh-show-use-xface-flag' is non-nil.
911    
912    If set to t, the image is fetched.
913    
914    If set to 'ask, the user is prompted before the image is fetched. MH-E will
915    remember your reply and will either use the already fetched image the next time
916    the same URL is encountered or silently skip it if you didn't fetch it the
917    first time.
918    
919    If set to nil, the default, images are not fetched and only displayed if they
920    are already present in the cache."
921      :type '(choice (const :tag "Always fetch" t)
922                     (const :tag "Ask before fetching" ask)
923                     (const :tag "Never fetch" nil))
924      :group 'mh-show)
925    
926  (defcustom mh-graphical-smileys-flag t  (defcustom mh-graphical-smileys-flag t
927    "*Non-nil means graphical smileys are displayed.    "*Non-nil means graphical smileys are displayed.
928  Non-nil means that small graphics will be used in the show buffer instead of  Non-nil means that small graphics will be used in the show buffer instead of
# Line 854  The gnus method uses a different color f Line 947  The gnus method uses a different color f
947                   (const :tag "Don't fontify" nil))                   (const :tag "Don't fontify" nil))
948    :group 'mh-show)    :group 'mh-show)
949    
950    (defvar mh-invisible-headers nil
951      "*Regexp matching lines in a message header that are not to be shown.
952    Use the function `mh-invisible-headers' to generate this variable.
953    If `mh-visible-headers' is non-nil, it is used instead to specify what
954    to keep.")
955    
956    (defun mh-invisible-headers ()
957      "Make or remake the variable `mh-invisible-headers'.
958    Done using `mh-invisible-header-fields' as input."
959      (setq mh-invisible-headers
960            (concat
961             "^"
962             (let ((max-specpdl-size 1000) ;workaround for insufficient default
963                   (fields mh-invisible-header-fields))
964               (regexp-opt fields t)))))
965    
966    (defun mh-invisible-header-fields-set (symbol value)
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    
974    ;; Keep fields alphabetized. Mention source, if known.
975    (defcustom mh-invisible-header-fields
976      '("Approved:"
977        "Autoforwarded:"
978        "Bestservhost:"
979        "Cancel-Lock:"                      ; NNTP posts
980        "Content-"                          ; RFC 2045
981        "Delivered-To:"              ; Egroups/yahoogroups mailing list manager
982        "Delivery-Date:"                    ; MH
983        "Delivery:"
984        "Encoding:"
985        "Errors-To:"
986        "Face:"                             ; Gnus Face header
987        "Forwarded:"                        ; MH
988        "From "                             ; sendmail
989        "Importance:"                       ; MS Outlook
990        "In-Reply-To:"                      ; MH
991        "Lines:"
992        "List-"                             ; Mailman mailing list manager
993        "List-"                             ; Unknown mailing list managers
994        "List-Subscribe:"                   ; Unknown mailing list managers
995        "List-Unsubscribe:"                 ; Unknown mailing list managers
996        "Mail-from:"                        ; MH
997        "Mailing-List:"              ; Egroups/yahoogroups mailing list manager
998        "Message-Id:"                       ; RFC 822
999        "Mime-Version"                      ; RFC 2045
1000        "NNTP-"                             ; News
1001        "Old-Return-Path:"
1002        "Original-Encoded-Information-Types:"  ; X400
1003        "Original-Lines:"                   ; mail to news
1004        "Original-Newsgroups:"              ; mail to news
1005        "Original-NNTP-"                    ; mail to news
1006        "Original-Path:"                    ; mail to news
1007        "Original-Received:"                ; mail to news
1008        "Original-To:"                      ; mail to news
1009        "Original-X-"                       ; mail to news
1010        "P1-Content-Type:"                  ; X400
1011        "P1-Message-Id:"                    ; X400
1012        "P1-Recipient:"                     ; X400
1013        "Path:"
1014        "Precedence:"
1015        "Prev-Resent"                       ; MH
1016        "Priority:"
1017        "Received:"                         ; RFC 822
1018        "References:"
1019        "Remailed-"                         ; MH
1020        "Replied:"                          ; MH
1021        "Resent"                            ; MH
1022        "Return-Path:"                      ; RFC 822
1023        "Sensitivity:"                      ; MS Outlook
1024        "Status:"                           ; sendmail
1025        "Ua-Content-Id:"                    ; X400
1026        "User-Agent:"
1027        "Via:"                              ; MH
1028        "X-Abuse-Info:"
1029        "X-Accept-Language:"
1030        "X-Accept-Language:"                ; Netscape/Mozilla
1031        "X-Ack:"
1032        "X-Apparently-From:"                ; MS Outlook
1033        "X-Apparently-To:"           ; Egroups/yahoogroups mailing list manager
1034        "X-Authentication-Warning:"         ; sendmail
1035        "X-Beenthere:"                      ; Mailman mailing list manager
1036        "X-Bogosity:"                       ; bogofilter
1037        "X-Complaints-To:"
1038        "X-Cron-Env:"
1039        "X-Delivered"
1040        "X-Envelope-Sender:"
1041        "X-Envelope-To:"
1042        "X-Face:"
1043        "X-Folder:"                         ; Spam
1044        "X-From-Line"
1045        "X-Gnus-Mail-Source:"               ; gnus
1046        "X-Habeas-SWE-1:"                   ; Spam
1047        "X-Habeas-SWE-2:"                   ; Spam
1048        "X-Habeas-SWE-3:"                   ; Spam
1049        "X-Habeas-SWE-4:"                   ; Spam
1050        "X-Habeas-SWE-5:"                   ; Spam
1051        "X-Habeas-SWE-6:"                   ; Spam
1052        "X-Habeas-SWE-7:"                   ; Spam
1053        "X-Habeas-SWE-8:"                   ; Spam
1054        "X-Habeas-SWE-9:"                   ; Spam
1055        "X-Info:"                           ; NTMail
1056        "X-Juno-"                           ; Juno
1057        "X-List-Host:"                      ; Unknown mailing list managers
1058        "X-List-Subscribe:"                 ; Unknown mailing list managers
1059        "X-List-Unsubscribe:"               ; Unknown mailing list managers
1060        "X-Listserver:"                     ; Unknown mailing list managers
1061        "X-Loop:"                           ; Unknown mailing list managers
1062        "X-MIME-Autoconverted:"             ; sendmail
1063        "X-MIMETrack:"
1064        "X-MS-TNEF-Correlator:"             ; MS Outlook
1065        "X-Mailing-List:"                   ; Unknown mailing list managers
1066        "X-Mailman-Version:"                ; Mailman mailing list manager
1067        "X-Majordomo:"                      ; Majordomo mailing list manager
1068        "X-Message-Id"
1069        "X-MHE-Checksum"                    ; Checksum added during index search
1070        "X-MimeOLE:"                        ; MS Outlook
1071        "X-Mozilla-Status:"                 ; Netscape/Mozilla
1072        "X-Msmail-"                         ; MS Outlook
1073        "X-News:"                           ; News
1074        "X-No-Archive:"
1075        "X-Notes-Item:"                     ; Lotus Notes Domino structured header
1076        "X-Orcl-Content-Type:"
1077        "X-Original-Complaints-To:"
1078        "X-Original-Date:"                  ; SourceForge mailing list manager
1079        "X-Original-Trace:"
1080        "X-OriginalArrivalTime:"            ; Hotmail
1081        "X-Originating-IP:"                 ; Hotmail
1082        "X-Priority:"                       ; MS Outlook
1083        "X-Qotd-"                           ; User added
1084        "X-Received-Date:"
1085        "X-Received:"
1086        "X-Request-"
1087        "X-SBClass:"                        ; Spam
1088        "X-SBNote:"                         ; Spam
1089        "X-SBPass:"                         ; Spam
1090        "X-SBRule:"                         ; Spam
1091        "X-Scanned-By"
1092        "X-Sender:"
1093        "X-Server-Date:"
1094        "X-Server-Uuid:"
1095        "X-Sieve:"                          ; Sieve filtering
1096        "X-Spam-Checker-Version:"           ; Spamassassin
1097        "X-Spam-Level:"                     ; Spamassassin
1098        "X-Spam-Score:"                     ; Spamassassin
1099        "X-Spam-Status:"                    ; Spamassassin
1100        "X-SpamBouncer:"                    ; Spam
1101        "X-Trace:"
1102        "X-UIDL:"
1103        "X-UserInfo1:"
1104        "X-VSMLoop:"                        ; NTMail
1105        "X-Vms-To:"
1106        "X-Wss-Id:"                         ; Worldtalk gateways
1107        "X-eGroups-"                 ; Egroups/yahoogroups mailing list manager
1108        "X-pgp:"
1109        "X-submission-address:"
1110        "X400-"                             ; X400
1111        "Xref:")
1112    "*List of header fields that are not to be shown.
1113    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
1115    start with the same prefix.
1116    This variable is ignored if `mh-visible-headers' is set."
1117      :type '(repeat (string :tag "Header field"))
1118      :set 'mh-invisible-header-fields-set
1119      :group 'mh-show)
1120    
1121  (defcustom mh-max-inline-image-height nil  (defcustom mh-max-inline-image-height nil
1122    "*Maximum inline image height if Content-Disposition is not present.    "*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  If nil, image will be displayed if its height is smaller than the height of
# Line 884  The `goto-addr' module is used." Line 1148  The `goto-addr' module is used."
1148    :type 'boolean    :type 'boolean
1149    :group 'mh-show)    :group 'mh-show)
1150    
1151  (defcustom mh-show-use-xface-flag  (defcustom mh-show-use-xface-flag (>= emacs-major-version 21)
1152    (and window-system    "*Non-nil means display face images in `mh-show-mode'.
1153         (not (null (cond  This flag controls the display of three kinds of faces.
1154                     (mh-xemacs-flag  
1155                      (locate-library "x-face"))  The first is the traditional X-Face header field. For GNU Emacs 21
1156                     ((>= emacs-major-version 21)  and above, the `uncompface' binary is required to be in the execute
1157                      (locate-library "x-face-e21"))  PATH for the display of X-Face images. It can be obtained from
1158                     (t                   ;Emacs20  ftp://ftp.cs.indiana.edu/pub/faces/compface/compface.tar.Z.
1159                      nil))))  
1160         (not (null (and (fboundp 'executable-find)  If the XEmacs you are using has internal support for X-Face images, then MH-E
1161                         (executable-find  will display X-Face images in XEmacs \"out of the box\". Even if you don't have
1162                          "uncompface")))))  X-Face support compiled into your XEmacs, you can still see the X-Face images
1163    "*Non-nil means display faces in `mh-show-mode' with external x-face package.  in MH-E with the aid of an external x-face package and `uncompface'. It is
1164  It is available from ftp://ftp.jpl.org/pub/elisp/. Download it and put its  available from ftp://ftp.jpl.org/pub/elisp/. Download it, put its files in the
1165  files in the Emacs `load-path' and MH-E will invoke it automatically for you if  `load-path' and MH-E will invoke it automatically.
1166  this variable is non-nil.  
1167    Second, MH-E supports the display of the Gnus-specific Face
1168    header field in GNU Emacs >= 21 and XEmacs. No external packages
1169    are required. More information about the Face header can be found
1170    at: http://quimby.gnus.org/circus/face/.
1171    
1172    Finally, MH-E can also display images from the X-Image-URL header field. The
1173    display of the images requires the `wget' program, available from
1174    http://www.gnu.org/software/wget/wget.html, to fetch the image and the
1175    `convert' program from the ImageMagick suite, available from
1176    http://www.imagemagick.org/. Of the three header fields this is the most
1177    efficient in terms of network usage since the image doesn't need to be
1178    transmitted with every single mail. However its display needs the recipient to
1179    fetch a URL and this can be misused. So it is disabled by default. It can be
1180    enabled by customizing `mh-fetch-x-image-url'. Setting that to ask for
1181    confirmation before fetching seems like a good choice.
1182    
1183  The `uncompface' binary is also required to be in the execute PATH. It can  Versions of GNU Emacs prior to 21.1 don't support the display of
1184  be obtained from: ftp://ftp.cs.indiana.edu/pub/faces/compface/compface.tar.Z"  inline images. So face images are not displayed in these versions."
1185    :type 'boolean    :type 'boolean
1186    :group 'mh-show)    :group 'mh-show)
1187    
# Line 932  the message continues to conform to RFC Line 1211  the message continues to conform to RFC
1211    :group 'mh-show)    :group 'mh-show)
1212  (put 'mhl-formfile 'info-file "mh-e")  (put 'mhl-formfile 'info-file "mh-e")
1213    
 (defvar mh-invisible-headers nil  
   "*Regexp matching lines in a message header that are not to be shown.  
 If `mh-visible-headers' is non-nil, it is used instead to specify what  
 to keep.")  
   
 (defun mh-invisible-headers ()  
   "Make or remake the variable `mh-invisible-headers'.  
 Done using `mh-invisible-header-fields' as input."  
   (setq mh-invisible-headers  
         (concat  
          "^"  
          (let ((max-specpdl-size 1000) ;workaround for insufficient default  
                (fields (append (if (not mh-show-use-xface-flag)  
                                    '("X-Face: "))  
                                mh-invisible-header-fields)))  
            (regexp-opt fields t)))))  
   
 (defun mh-invisible-header-fields-set (symbol value)  
   "Update `mh-invisible-header-fields'.  
 The function is called with SYMBOL bound to `mh-invisible-header-fields' and  
 VALUE is the the list of headers that are invisible. As a side effect, the  
 variable `mh-invisible-fields' is set."  
   (set-default symbol value)  
   (mh-invisible-headers))  
   
 ;; Keep fields alphabetized. Mention source, if known.  
 (defcustom mh-invisible-header-fields  
   '("Autoforwarded: "  
     "Bestservhost: "  
     "Content-"                          ; RFC 2045  
     "Delivered-To: "             ; Egroups/yahoogroups mailing list manager  
     "Delivery-Date: "                   ; MH  
     "Delivery: "  
     "Encoding: "  
     "Errors-To: "  
     "Forwarded: "                       ; MH  
     "From "                             ; sendmail  
     "Importance: "                      ; MS Outlook  
     "In-Reply-To: "                     ; MH  
     "Lines: "  
     "List-"                             ; Mailman mailing list manager  
     "List-"                             ; Unknown mailing list managers  
     "List-Subscribe: "                  ; Unknown mailing list managers  
     "List-Unsubscribe: "                ; Unknown mailing list managers  
     "Mail-from: "                       ; MH  
     "Mailing-List: "             ; Egroups/yahoogroups mailing list manager  
     "Message-Id: "                      ; RFC 822  
     "Mime-Version"                      ; RFC 2045  
     "NNTP-"                             ; News  
     "Old-Return-Path: "  
     "Original-Encoded-Information-Types: " ; X400  
     "P1-Content-Type: "                 ; X400  
     "P1-Message-Id: "                   ; X400  
     "P1-Recipient: "                    ; X400  
     "Path: "  
     "Precedence: "  
     "Prev-Resent"                       ; MH  
     "Priority: "  
     "Received: "                        ; RFC 822  
     "References: "  
     "Remailed-"                         ; MH  
     "Replied: "                         ; MH  
     "Resent"                            ; MH  
     "Return-Path: "                     ; RFC 822  
     "Sensitivity: "                     ; MS Outlook  
     "Status: "                          ; sendmail  
     "Ua-Content-Id: "                   ; X400  
     "User-Agent: "  
     "Via: "                             ; MH  
     "X-Abuse-Info: "  
     "X-Accept-Language: "  
     "X-Accept-Language: "               ; Netscape/Mozilla  
     "X-Ack: "  
     "X-Apparently-From: "               ; MS Outlook  
     "X-Apparently-To: "          ; Egroups/yahoogroups mailing list manager  
     "X-Authentication-Warning: "        ; sendmail  
     "X-Beenthere: "                     ; Mailman mailing list manager  
     "X-Complaints-To: "  
     "X-Cron-Env: "  
     "X-Delivered"  
     "X-Envelope-Sender: "  
     "X-Envelope-To: "  
     "X-Folder: "                        ; Spam  
     "X-From-Line"  
     "X-Gnus-Mail-Source: "              ; gnus  
     "X-Habeas-SWE-1: "                  ; Spam  
     "X-Habeas-SWE-2: "                  ; Spam  
     "X-Habeas-SWE-3: "                  ; Spam  
     "X-Habeas-SWE-4: "                  ; Spam  
     "X-Habeas-SWE-5: "                  ; Spam  
     "X-Habeas-SWE-6: "                  ; Spam  
     "X-Habeas-SWE-7: "                  ; Spam  
     "X-Habeas-SWE-8: "                  ; Spam  
     "X-Habeas-SWE-9: "                  ; Spam  
     "X-Info: "                          ; NTMail  
     "X-Juno-"                           ; Juno  
     "X-List-Host: "                     ; Unknown mailing list managers  
     "X-List-Subscribe: "                ; Unknown mailing list managers  
     "X-List-Unsubscribe: "              ; Unknown mailing list managers  
     "X-Listserver: "                    ; Unknown mailing list managers  
     "X-Loop: "                          ; Unknown mailing list managers  
     "X-MIME-Autoconverted: "            ; sendmail  
     "X-MIMETrack: "  
     "X-MS-TNEF-Correlator: "            ; MS Outlook  
     "X-Mailing-List: "                  ; Unknown mailing list managers  
     "X-Mailman-Version: "               ; Mailman mailing list manager  
     "X-Message-Id"  
     "X-MHE-Checksum"                    ; Checksum added during index search  
     "X-MimeOLE: "                       ; MS Outlook  
     "X-Mozilla-Status: "                ; Netscape/Mozilla  
     "X-Msmail-"                         ; MS Outlook  
     "X-News: "                          ; News  
     "X-No-Archive: "  
     "X-Orcl-Content-Type: "  
     "X-Original-Complaints-To: "  
     "X-Original-Date: "                 ; SourceForge mailing list manager  
     "X-Original-Trace: "  
     "X-OriginalArrivalTime: "           ; Hotmail  
     "X-Originating-IP: "                ; Hotmail  
     "X-Priority: "                      ; MS Outlook  
     "X-Qotd-"                           ; User added  
     "X-Received-Date: "  
     "X-Received: "  
     "X-Request-"  
     "X-SBClass: "                       ; Spam  
     "X-SBNote: "                        ; Spam  
     "X-SBPass: "                        ; Spam  
     "X-SBRule: "                        ; Spam  
     "X-Scanned-By"  
     "X-Sender: "  
     "X-Server-Date: "  
     "X-Server-Uuid: "  
     "X-Sieve: "                         ; Sieve filtering  
     "X-Spam-Level: "                    ; Spam  
     "X-Spam-Score: "                    ; Spam  
     "X-Spam-Status: "                   ; Spam  
     "X-SpamBouncer: "                   ; Spam  
     "X-Trace: "  
     "X-UIDL: "  
     "X-UserInfo1: "  
     "X-VSMLoop: "                       ; NTMail  
     "X-Vms-To: "  
     "X-Wss-Id: "                        ; Worldtalk gateways  
     "X-eGroups-"                 ; Egroups/yahoogroups mailing list manager  
     "X-pgp: "  
     "X-submission-address: "  
     "X400-"                             ; X400  
     "Xref: ")  
 "*List of header fields that are not to be shown.  
 Regexps are not allowed. Unique fields should have a \": \" suffix; otherwise,  
 the element can be used to render invisible an entire class of fields that  
 start with the same prefix.  
 This variable is ignored if `mh-visible-headers' is set."  
   :type '(repeat (string :tag "Header field"))  
   :set 'mh-invisible-header-fields-set  
   :group 'mh-show)  
   
1214    
1215    
1216  ;;; Composing messages (:group 'mh-letter)  ;;; Composing messages (:group 'mh-letter)
# Line 1134  by \\[mh-insert-letter] or \\[mh-yank-cu Line 1256  by \\[mh-insert-letter] or \\[mh-yank-cu
1256    :type 'string    :type 'string
1257    :group 'mh-letter)    :group 'mh-letter)
1258    
 (defcustom mh-insert-mail-followup-to-flag t  
   "Non-nil means maybe append a Mail-Followup-To field to the header.  
 The insertion is done if the To: or Cc: fields matches an entry in  
 `mh-insert-mail-followup-to-list'."  
   :type 'boolean  
   :group 'mh-letter)  
   
 (defcustom mh-insert-mail-followup-to-list nil  
   "Alist of addresses for which a Mail-Followup-To field is inserted.  
 Each element has the form (REGEXP ADDRESS).  
 When the REGEXP appears in the To or cc fields of a message, the corresponding  
 ADDRESS is inserted in a Mail-Followup-To field.  
   
 Here's a customization example:  
   
   regexp: mh-e-users@lists.s\\\\(ourceforge\\\\|f\\\\).net  
  address: mh-e-users@lists.sourceforge.net  
   
 This corresponds to:  
   
   (setq mh-insert-mail-followup-to-list  
         '((\"mh-e-users@lists.s\\\\(ourceforge\\\\|f\\\\).net\"  
            \"mh-e-users@lists.sourceforge.net\")))  
   
 While it might be tempting to add a descriptive name to the mailing list  
 address, consider that this field will appear in other people's outgoing  
 mail in their To: field.  It might be best to keep it simple."  
   :type '(repeat (list (string :tag "Regexp")  
                        (string :tag "Address")))  
   :group 'mh-letter)  
   
1259  (defcustom mh-insert-x-mailer-flag t  (defcustom mh-insert-x-mailer-flag t
1260    "*Non-nil means append an X-Mailer field to the header."    "*Non-nil means append an X-Mailer field to the header."
1261    :type 'boolean    :type 'boolean
1262    :group 'mh-letter)    :group 'mh-letter)
1263    
1264    (defcustom mh-letter-complete-function 'ispell-complete-word
1265      "*Function to call when completing outside of fields specific to aliases."
1266      :type '(choice function (const nil))
1267      :group 'mh-letter)
1268    
1269  (defcustom mh-letter-fill-column 72  (defcustom mh-letter-fill-column 72
1270    "*Fill column to use in `mh-letter-mode'.    "*Fill column to use in `mh-letter-mode'.
1271  This is usually less than in other text modes because email messages get  This is usually less than in other text modes because email messages get
# Line 1207  Inserted into message by \\<mh-letter-mo Line 1303  Inserted into message by \\<mh-letter-mo
1303    :group 'mh-letter)    :group 'mh-letter)
1304    
1305  (defcustom mh-x-face-file "~/.face"  (defcustom mh-x-face-file "~/.face"
1306    "*File name containing the encoded X-Face string to insert in outgoing mail.    "*File containing X-Face or Face header field to insert in outgoing mail.
1307  If nil, or the file does not exist, nothing is added to message headers."  
1308    If the file starts with either of the strings \"X-Face: \", \"Face: \" or
1309    \"X-Image-URL: \" then it is assumed to contain the whole field and is added to
1310    the message header verbatim. Otherwise it is assumed that the file contains the
1311    value of the X-Face header field.
1312    
1313    X-Face header fields can be generated using `compface', which can be obtained
1314    from ftp://ftp.cs.indiana.edu/pub/faces/compface/compface.tar.Z. The \"Online
1315    X-Face Convertor\" at http://www.dairiki.org/xface/ is a useful resource for
1316    quick conversion of images into X-Face header fields.
1317    
1318    There is a `make-face' script that converts a jpeg image to a Face header
1319    field at http://quimby.gnus.org/circus/face/make-face.
1320    
1321    The URL of any image can be used for the X-Image-URL field and no processing
1322    of the image is required.
1323    
1324    If nil, or the file does not exist, nothing is added to the message header."
1325    :type 'file    :type 'file
1326    :group 'mh-letter)    :group 'mh-letter)
1327    
 (defvar mh-x-mailer-string nil  
   "*String containing the contents of the X-Mailer header field.  
 If nil, this variable is initialized to show the version of MH-E, Emacs, and  
 MH the first time a message is composed.")  
   
1328  (defcustom mh-yank-from-start-of-msg 'attribution  (defcustom mh-yank-from-start-of-msg 'attribution
1329    "*Controls which part of a message is yanked by \\<mh-letter-mode-map>\\[mh-yank-cur-msg].    "*Controls which part of a message is yanked by \\<mh-letter-mode-map>\\[mh-yank-cur-msg].
1330  If t, include the entire message, with full headers.  This is historically  If t, include the entire message, with full headers.  This is historically
# Line 1260  to the yanked region." Line 1368  to the yanked region."
1368                   (const :tag "Entire message with headers" t))                   (const :tag "Entire message with headers" t))
1369    :group 'mh-letter)    :group 'mh-letter)
1370    
 (defcustom mh-letter-complete-function 'ispell-complete-word  
   "*Function to call when completing outside of fields specific to aliases."  
   :type '(choice function (const nil))  
   :group 'mh-letter)  
   
1371    
1372    
1373  ;;; Alias handling (:group 'mh-alias)  ;;; Alias handling (:group 'mh-alias)
1374    
 (defcustom mh-alias-system-aliases  
   '("/etc/nmh/MailAliases" "/usr/lib/mh/MailAliases" "/etc/passwd")  
   "*A list of system files from which to cull aliases.  
 If these files are modified, they are automatically reread. This list need  
 include only system aliases and the passwd file, since personal alias files  
 listed in your \"AliasFile\" MH profile component are automatically included.  
 You can update the alias list manually using \\[mh-alias-reload]."  
   :group 'mh-alias  
   :type '(choice (file) (repeat file)))  
   
 (defcustom mh-alias-expand-aliases-flag nil  
   "*Non-nil means to expand aliases entered in the minibuffer.  
 In other words, aliases entered in the minibuffer will be expanded to the full  
 address in the message draft. By default, this expansion is not performed."  
   :group 'mh-alias  
   :type 'boolean)  
   
1375  (defcustom mh-alias-completion-ignore-case-flag t  (defcustom mh-alias-completion-ignore-case-flag t
1376    "*Non-nil means don't consider case significant in MH alias completion.    "*Non-nil means don't consider case significant in MH alias completion.
1377  This is the default in plain MH, so it is the default here as well. It  This is the default in plain MH, so it is the default here as well. It
1378  can be useful to set this to t if, for example, you use lowercase  can be useful to set this to t if, for example, you use lowercase
1379  aliases for people and uppercase for mailing lists."  aliases for people and uppercase for mailing lists."
1380    :group 'mh-alias    :type 'boolean
1381    :type 'boolean)    :group 'mh-alias)
1382    
1383    (defcustom mh-alias-expand-aliases-flag nil
1384      "*Non-nil means to expand aliases entered in the minibuffer.
1385    In other words, aliases entered in the minibuffer will be expanded to the full
1386    address in the message draft. By default, this expansion is not performed."
1387      :type 'boolean
1388      :group 'mh-alias)
1389    
1390  (defcustom mh-alias-flash-on-comma t  (defcustom mh-alias-flash-on-comma t
1391    "*Specify whether to flash or warn on translation.    "*Specify whether to flash or warn on translation.
# Line 1301  variable to the following values has the Line 1394  variable to the following values has the
1394  t   Flash alias translation but don't warn if there is no translation.  t   Flash alias translation but don't warn if there is no translation.
1395  1   Flash alias translation and warn if there is no translation.  1   Flash alias translation and warn if there is no translation.
1396  nil Do not flash alias translation nor warn if there is no translation."  nil Do not flash alias translation nor warn if there is no translation."
   :group 'mh-alias  
1397    :type '(choice (const :tag "Flash but don't warn if no translation" t)    :type '(choice (const :tag "Flash but don't warn if no translation" t)
1398                   (const :tag "Flash and warn if no translation" 1)                   (const :tag "Flash and warn if no translation" 1)
1399                   (const :tag "Don't flash nor warn if no translation" nil)))                   (const :tag "Don't flash nor warn if no translation" nil))
1400      :group 'mh-alias)
 (defcustom mh-alias-local-users t  
   "*If t, local users are completed in MH-E To: and Cc: prompts.  
   
 Users with a userid greater than some magic number (usually 200) are available  
 for completion.  
   
 If you set this variable to a string, it will be executed to generate a  
 password file. A value of \"ypcat passwd\" is helpful if NIS is in use."  
   :group 'mh-alias  
   :type '(choice (boolean) (string)))  
1401    
1402  (defcustom mh-alias-insert-file nil  (defcustom mh-alias-insert-file nil
1403    "*Filename to use to store new MH-E aliases.    "*Filename to use to store new MH-E aliases.
1404  This variable can also be a list of filenames, in which case MH-E will prompt  This variable can also be a list of filenames, in which case MH-E will prompt
1405  for one of them. If nil, the default, then MH-E will use the first file found  for one of them. If nil, the default, then MH-E will use the first file found
1406  in the \"AliasFile\" component of the MH profile."  in the \"AliasFile\" component of the MH profile."
   :group 'mh-alias  
1407    :type '(choice (const :tag "Use AliasFile MH profile component" nil)    :type '(choice (const :tag "Use AliasFile MH profile component" nil)
1408                   (file :tag "Alias file")                   (file :tag "Alias file")
1409                   (repeat :tag "List of alias files" file)))                   (repeat :tag "List of alias files" file))
1410      :group 'mh-alias)
1411    
1412  (defcustom mh-alias-insertion-location 'sorted  (defcustom mh-alias-insertion-location 'sorted
1413    "Specifies where new aliases are entered in alias files.    "Specifies where new aliases are entered in alias files.
# Line 1335  Options are sorted alphabetically, at th Line 1417  Options are sorted alphabetically, at th
1417                   (const :tag "At the bottom of file" bottom))                   (const :tag "At the bottom of file" bottom))
1418    :group 'mh-alias)    :group 'mh-alias)
1419    
1420    (defcustom mh-alias-local-users t
1421      "*If t, local users are completed in MH-E To: and Cc: prompts.
1422    
1423  ;;; Indexed searching (:group 'mh-index)  Users with a userid greater than some magic number (usually 200) are available
1424    for completion.
1425    
1426  (defcustom mh-index-program nil  If you set this variable to a string, it will be executed to generate a
1427    "Indexing program that MH-E shall use.  password file. A value of \"ypcat passwd\" is helpful if NIS is in use."
1428  The possible choices are swish++, swish-e, mairix, namazu, glimpse, pick and    :type '(choice (boolean) (string))
1429  grep. By default this variable is nil which means that the programs are tried    :group 'mh-alias)
 in order and the first one found is used.  
1430    
1431  More information about setting up an indexing program to use with MH-E can be  (defcustom mh-alias-system-aliases
1432  found in the documentation of `mh-index-search'."    '("/etc/nmh/MailAliases" "/usr/lib/mh/MailAliases" "/etc/passwd")
1433    :type '(choice (const :tag "Auto-detect" nil)    "*A list of system files from which to cull aliases.
1434                   (const :tag "swish++" swish++)  If these files are modified, they are automatically reread. This list need
1435                   (const :tag "swish-e" swish)  include only system aliases and the passwd file, since personal alias files
1436                   (const :tag "mairix" mairix)  listed in your \"AliasFile\" MH profile component are automatically included.
1437                   (const :tag "namazu" namazu)  You can update the alias list manually using \\[mh-alias-reload]."
1438                   (const :tag "glimpse" glimpse)    :type '(choice (file) (repeat file))
1439                   (const :tag "pick" pick)    :group 'mh-alias)
                  (const :tag "grep" grep))  
   :group 'mh-index)  
1440    
1441    
1442    
1443  ;;; Multiple personalities (:group 'mh-identity)  ;;; Multiple personalities (:group 'mh-identity)
1444    
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  (defcustom mh-identity-list nil
1495    "*List holding MH-E identity.    "*List holding MH-E identity.
1496  Omit the colon and trailing space from the field names.  Omit the colon and trailing space from the field names.
# Line 1408  This would produce the equivalent of: Line 1538  This would produce the equivalent of:
1538    :set 'mh-identity-list-set    :set 'mh-identity-list-set
1539    :group 'mh-identity)    :group 'mh-identity)
1540    
 (defcustom mh-identity-default nil  
   "Default identity to use when `mh-letter-mode' is called."  
   ;; Dynamically render :type corresponding to `mh-identity-list' entries,  
   ;; e.g.:  
   ;;  :type '(radio (const :tag "none" nil)  
   ;;                (const "home")  
   ;;                (const "work"))  
   :type (append  
          '(radio)  
          (cons '(const :tag "None" nil)  
                (mapcar (function (lambda (arg) `(const ,arg)))  
                        (mapcar 'car mh-identity-list))))  
   :group 'mh-identity)  
   
1541    
1542    
1543  ;;; Hooks (:group 'mh-hooks + group where hook defined)  ;;; Hooks (:group 'mh-hooks + group where hook defined)
# Line 1481  current folder, `mh-current-folder'." Line 1597  current folder, `mh-current-folder'."
1597    :group 'mh-hooks    :group 'mh-hooks
1598    :group 'mh-folder)    :group 'mh-folder)
1599    
 (defcustom mh-index-show-hook nil  
   "Invoked after the message has been displayed."  
   :type 'hook  
   :group 'mh-hooks  
   :group 'mh-index)  
   
1600  (defcustom mh-letter-insert-signature-hook nil  (defcustom mh-letter-insert-signature-hook nil
1601    "Invoked at the beginning of the \\<mh-letter-mode-map>\\[mh-insert-signature] command.    "Invoked at the beginning of the \\<mh-letter-mode-map>\\[mh-insert-signature] command.
1602  Can be used to determine which signature file to use based on message content.  Can be used to determine which signature file to use based on message content.
# Line 1685  will be removed from the unseen sequence Line 1795  will be removed from the unseen sequence
1795    "Face for highlighting subject text in MH-Folder buffers."    "Face for highlighting subject text in MH-Folder buffers."
1796    :group 'mh-folder-faces)    :group 'mh-folder-faces)
1797    
1798    (defface mh-folder-tick-face
1799      '((((class color) (background dark)) (:background "#dddf7e"))
1800        (((class color) (background light)) (:background "#dddf7e"))
1801        (t (:underline t)))
1802      "Face used to show ticked messages."
1803      :group 'mh-folder-faces)
1804    
1805  (defvar mh-folder-address-face 'mh-folder-address-face  (defvar mh-folder-address-face 'mh-folder-address-face
1806    "Face for highlighting the address in MH-Folder buffers.")    "Face for highlighting the address in MH-Folder buffers.")
1807  (copy-face 'mh-folder-subject-face 'mh-folder-address-face)  (copy-face 'mh-folder-subject-face 'mh-folder-address-face)
# Line 1774  will be removed from the unseen sequence Line 1891  will be removed from the unseen sequence
1891    "Face for highlighting the From: header field."    "Face for highlighting the From: header field."
1892    :group 'mh-show-faces)    :group 'mh-show-faces)
1893    
1894    (defface mh-show-xface-face
1895      '((t (:foreground "black" :background "white")))
1896      "Face for displaying the X-Face image.
1897    The background and foreground is used in the image."
1898      :group 'mh-show-faces)
1899    
1900  (defvar mh-show-subject-face 'mh-show-subject-face  (defvar mh-show-subject-face 'mh-show-subject-face
1901    "Face for highlighting the Subject header field.")    "Face for highlighting the Subject header field.")
1902  (copy-face 'mh-folder-subject-face 'mh-show-subject-face)  (copy-face 'mh-folder-subject-face 'mh-show-subject-face)

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26