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

Legend:
Removed from v.1.3.4.3  
changed lines
  Added in v.1.3.4.4

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