comparison lisp/mh-e/mh-customize.el @ 50702:7dd3d5eae9c7

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