Commit | Line | Data |
---|---|---|
c3d9274a BW |
1 | ;;; mh-customize.el --- MH-E customization |
2 | ||
e495eaec | 3 | ;; Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc. |
c3d9274a BW |
4 | |
5 | ;; Author: Bill Wohler <wohler@newt.com> | |
6 | ;; Maintainer: Bill Wohler <wohler@newt.com> | |
7 | ;; Keywords: mail | |
8 | ;; See: mh-e.el | |
9 | ||
10 | ;; This file is part of GNU Emacs. | |
11 | ||
12 | ;; GNU Emacs is free software; you can redistribute it and/or modify | |
13 | ;; it under the terms of the GNU General Public License as published by | |
14 | ;; the Free Software Foundation; either version 2, or (at your option) | |
15 | ;; any later version. | |
16 | ||
17 | ;; GNU Emacs is distributed in the hope that it will be useful, | |
18 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | |
19 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
20 | ;; GNU General Public License for more details. | |
21 | ||
22 | ;; You should have received a copy of the GNU General Public License | |
23 | ;; along with GNU Emacs; see the file COPYING. If not, write to the | |
3a35cf56 LK |
24 | ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
25 | ;; Boston, MA 02110-1301, USA. | |
c3d9274a BW |
26 | |
27 | ;;; Commentary: | |
28 | ||
924df208 BW |
29 | ;; All of the defgroups, defcustoms, and deffaces in MH-E are found |
30 | ;; here. This makes it possible to customize modules that aren't loaded | |
31 | ;; yet. It also makes it easier to organize the customization groups. | |
c3d9274a BW |
32 | |
33 | ;; This file contains the following sections: | |
34 | ;; | |
35 | ;; 1. MH-E Customization Groups | |
36 | ;; | |
f0d73c14 BW |
37 | ;; These are the customization group definitions. Every group has a |
38 | ;; associated manual node. The ordering is alphabetical, except for the | |
39 | ;; groups mh-faces and mh-hooks which are last . | |
c3d9274a BW |
40 | ;; |
41 | ;; 2. MH-E Customization | |
42 | ;; | |
f0d73c14 BW |
43 | ;; These are the actual customization variables. There is a sub-section for |
44 | ;; each group in the MH-E Customization Groups section, in the same order, | |
45 | ;; separated by page breaks. Within each section, variables are sorted | |
46 | ;; alphabetically. | |
c3d9274a | 47 | ;; |
f0d73c14 BW |
48 | ;; 3. Hooks |
49 | ;; | |
50 | ;; All hooks must be placed in the mh-hook group; in addition, add the | |
51 | ;; 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. | |
c3d9274a | 61 | ;; |
c3d9274a BW |
62 | ;;; Change Log: |
63 | ||
c3d9274a | 64 | ;;; Code: |
f0d73c14 | 65 | |
3d7ca223 | 66 | (provide 'mh-customize) |
f0d73c14 BW |
67 | |
68 | (eval-when-compile (require 'mh-acros)) | |
69 | (mh-require-cl) | |
70 | (require 'mh-loaddefs) | |
71 | ||
f0d73c14 BW |
72 | (eval-and-compile |
73 | (defvar mh-xemacs-flag (featurep 'xemacs) | |
74 | "Non-nil means the current Emacs is XEmacs.")) | |
a66894d8 BW |
75 | |
76 | (when mh-xemacs-flag | |
77 | (require 'mh-xemacs)) | |
c3d9274a | 78 | |
eccf9613 BW |
79 | ;; XXX: Functions autoloaded from the following files are used to initialize |
80 | ;; customizable variables. They are require'd here, since otherwise the | |
81 | ;; corresponding .elc would be loaded at compile time. | |
82 | (eval-when-compile | |
83 | (require 'mh-init) | |
84 | (require 'mh-identity)) | |
85 | ||
3d7ca223 BW |
86 | (defun mh-customize (&optional delete-other-windows-flag) |
87 | "Customize MH-E variables. | |
f0d73c14 BW |
88 | If optional argument DELETE-OTHER-WINDOWS-FLAG is non-nil, other windows in |
89 | the frame are removed." | |
3d7ca223 | 90 | (interactive "P") |
a05fcb7d | 91 | (customize-group 'mh-e) |
3d7ca223 BW |
92 | (when delete-other-windows-flag |
93 | (delete-other-windows))) | |
c3d9274a | 94 | |
f0d73c14 BW |
95 | \f |
96 | ||
97 | ;;; For compiler warnings... | |
a05fcb7d BW |
98 | (eval-when-compile |
99 | (defvar mh-show-buffer) | |
100 | (defvar mh-show-folder-buffer)) | |
f0d73c14 | 101 | |
c3d9274a BW |
102 | ;;; MH-E Customization Groups |
103 | ||
e495eaec | 104 | (defgroup mh-e nil |
f0d73c14 BW |
105 | "Emacs interface to the MH mail system. |
106 | MH is the Rand Mail Handler. Other implementations include nmh and GNU | |
107 | mailutils." | |
c3d9274a BW |
108 | :link '(custom-manual "(mh-e)Top") |
109 | :group 'mail) | |
110 | ||
f0d73c14 BW |
111 | (defgroup mh-alias nil |
112 | "Aliases." | |
113 | :link '(custom-manual "(mh-e)Aliases") | |
114 | :prefix "mh-alias-" | |
e495eaec | 115 | :group 'mh-e) |
c3d9274a | 116 | |
f0d73c14 BW |
117 | (defgroup mh-folder nil |
118 | "Organizing your mail with folders." | |
c3d9274a | 119 | :prefix "mh-" |
f0d73c14 | 120 | :link '(custom-manual "(mh-e)Organizing") |
e495eaec | 121 | :group 'mh-e) |
c3d9274a | 122 | |
f0d73c14 BW |
123 | (defgroup mh-folder-selection nil |
124 | "Folder selection." | |
c3d9274a | 125 | :prefix "mh-" |
f0d73c14 | 126 | :link '(custom-manual "(mh-e)Folder Selection") |
e495eaec | 127 | :group 'mh-e) |
f0d73c14 BW |
128 | |
129 | (defgroup mh-identity nil | |
130 | "Identities." | |
131 | :link '(custom-manual "(mh-e)Identities") | |
132 | :prefix "mh-identity-" | |
e495eaec | 133 | :group 'mh-e) |
f0d73c14 BW |
134 | |
135 | (defgroup mh-inc nil | |
136 | "Incorporating your mail." | |
137 | :prefix "mh-inc-" | |
138 | :link '(custom-manual "(mh-e)Incorporating Mail") | |
e495eaec | 139 | :group 'mh-e) |
c3d9274a | 140 | |
924df208 | 141 | (defgroup mh-index nil |
f0d73c14 BW |
142 | "Searching." |
143 | :link '(custom-manual "(mh-e)Searching") | |
144 | :prefix "mh-index-" | |
e495eaec | 145 | :group 'mh-e) |
924df208 BW |
146 | |
147 | (defgroup mh-junk nil | |
f0d73c14 BW |
148 | "Dealing with junk mail." |
149 | :link '(custom-manual "(mh-e)Junk") | |
924df208 | 150 | :prefix "mh-junk-" |
e495eaec | 151 | :group 'mh-e) |
924df208 | 152 | |
f0d73c14 BW |
153 | (defgroup mh-letter nil |
154 | "Editing a draft." | |
c3d9274a | 155 | :prefix "mh-" |
f0d73c14 | 156 | :link '(custom-manual "(mh-e)Editing Drafts") |
e495eaec | 157 | :group 'mh-e) |
c3d9274a | 158 | |
f0d73c14 BW |
159 | (defgroup mh-ranges nil |
160 | "Ranges." | |
924df208 | 161 | :prefix "mh-" |
f0d73c14 | 162 | :link '(custom-manual "(mh-e)Ranges") |
e495eaec | 163 | :group 'mh-e) |
924df208 | 164 | |
f0d73c14 BW |
165 | (defgroup mh-scan-line-formats nil |
166 | "Scan line formats." | |
167 | :link '(custom-manual "(mh-e)Scan Line Formats") | |
c3d9274a | 168 | :prefix "mh-" |
e495eaec | 169 | :group 'mh-e) |
c3d9274a | 170 | |
f0d73c14 BW |
171 | (defgroup mh-sending-mail nil |
172 | "Sending mail." | |
173 | :prefix "mh-" | |
174 | :link '(custom-manual "(mh-e)Sending Mail") | |
e495eaec | 175 | :group 'mh-e) |
c3d9274a | 176 | |
f0d73c14 BW |
177 | (defgroup mh-sequences nil |
178 | "Sequences." | |
179 | :prefix "mh-" | |
180 | :link '(custom-manual "(mh-e)Sequences") | |
e495eaec | 181 | :group 'mh-e) |
f0d73c14 BW |
182 | |
183 | (defgroup mh-show nil | |
184 | "Reading your mail." | |
185 | :prefix "mh-" | |
186 | :link '(custom-manual "(mh-e)Reading Mail") | |
e495eaec | 187 | :group 'mh-e) |
f0d73c14 BW |
188 | |
189 | (defgroup mh-speed nil | |
190 | "The speedbar." | |
191 | :prefix "mh-speed-" | |
192 | :link '(custom-manual "(mh-e)Speedbar") | |
e495eaec | 193 | :group 'mh-e) |
f0d73c14 BW |
194 | |
195 | (defgroup mh-toolbar nil | |
196 | "The toolbar" | |
197 | :link '(custom-manual "(mh-e)Toolbar") | |
198 | :prefix "mh-" | |
e495eaec | 199 | :group 'mh-e) |
f0d73c14 BW |
200 | |
201 | (defgroup mh-faces nil | |
202 | "Faces used in MH-E." | |
203 | :link '(custom-manual "(mh-e)Top") | |
c3d9274a | 204 | :prefix "mh-" |
f0d73c14 | 205 | :group 'faces |
e495eaec | 206 | :group 'mh-e) |
c3d9274a | 207 | |
c3d9274a BW |
208 | (defgroup mh-hooks nil |
209 | "MH-E hooks." | |
f0d73c14 | 210 | :link '(custom-manual "(mh-e)Top") |
c3d9274a | 211 | :prefix "mh-" |
e495eaec | 212 | :group 'mh-e) |
c3d9274a BW |
213 | |
214 | ;;; Faces | |
215 | ||
c3d9274a BW |
216 | (defgroup mh-folder-faces nil |
217 | "Faces used in scan listing." | |
f0d73c14 | 218 | :link '(custom-manual "(mh-e)Organizing") |
c3d9274a BW |
219 | :prefix "mh-" |
220 | :group 'mh-faces | |
f0d73c14 | 221 | :group 'mh-show) |
c3d9274a | 222 | |
a66894d8 | 223 | (defgroup mh-index-faces nil |
f0d73c14 BW |
224 | "Faces used in searching." |
225 | :link '(custom-manual "(mh-e)Searching") | |
a66894d8 BW |
226 | :prefix "mh-" |
227 | :group 'mh-faces | |
228 | :group 'mh-index) | |
229 | ||
f0d73c14 BW |
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 | ||
c3d9274a BW |
237 | (defgroup mh-show-faces nil |
238 | "Faces used in message display." | |
f0d73c14 | 239 | :link '(custom-manual "(mh-e)Reading Mail") |
c3d9274a BW |
240 | :prefix "mh-" |
241 | :group 'mh-faces | |
242 | :group 'mh-show) | |
243 | ||
f0d73c14 BW |
244 | (defgroup mh-speed-faces nil |
245 | "Faces used in speedbar." | |
246 | :link '(custom-manual "(mh-e)Speedbar") | |
c3d9274a BW |
247 | :prefix "mh-" |
248 | :group 'mh-faces | |
f0d73c14 | 249 | :group 'mh-speed) |
c3d9274a BW |
250 | |
251 | \f | |
252 | ||
f0d73c14 BW |
253 | ;;; Emacs interface to the MH mail system (:group mh) |
254 | (eval-when (compile) | |
255 | (setq mh-variant 'none)) | |
256 | ||
257 | (defcustom mh-variant 'autodetect | |
258 | "*Specifies the variant used by MH-E. | |
259 | ||
260 | The default setting of this option is `Auto-detect' which means that MH-E will | |
261 | automatically choose the first of nmh, MH, or GNU mailutils that it finds in | |
262 | the directories listed in `mh-path', `mh-sys-path', and `exec-path'. If, for | |
263 | 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 | to `mailutils'. | |
266 | ||
267 | When this variable is changed, MH-E resets `mh-progs', `mh-lib', | |
268 | `mh-lib-progs', `mh-flists-present-flag', and `mh-variant-in-use' | |
269 | accordingly." | |
270 | :type `(radio | |
271 | (const :tag "Auto-detect" autodetect) | |
272 | ,@(mapcar (lambda (x) `(const ,(car x))) (mh-variants))) | |
273 | :set (lambda (symbol value) | |
274 | (set-default symbol value) ;Done in mh-variant-set-variant! | |
275 | (mh-variant-set value)) | |
e495eaec | 276 | :group 'mh-e) |
c3d9274a | 277 | |
f0d73c14 | 278 | \f |
c3d9274a | 279 | |
f0d73c14 | 280 | ;;; Aliases (:group 'mh-alias) |
c3d9274a | 281 | |
f0d73c14 BW |
282 | (defcustom mh-alias-completion-ignore-case-flag t |
283 | "*Non-nil means don't consider case significant in MH alias completion. | |
284 | As MH ignores case in the aliases, so too does MH-E. However, you may turn | |
285 | 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) | |
924df208 | 290 | |
f0d73c14 BW |
291 | (defcustom mh-alias-expand-aliases-flag nil |
292 | "*Non-nil means to expand aliases entered in the minibuffer. | |
293 | 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) | |
924df208 | 297 | |
f0d73c14 BW |
298 | (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) | |
a05fcb7d BW |
305 | (const :tag "Flash and Warn If No Alias" 1) |
306 | (const :tag "Don't Flash Nor Warn If No Alias" nil)) | |
f0d73c14 | 307 | :group 'mh-alias) |
924df208 | 308 | |
f0d73c14 BW |
309 | (defcustom mh-alias-insert-file nil |
310 | "*Filename used to store a new MH-E alias. | |
311 | The default setting of this option is `Use Aliasfile Profile Component'. This | |
312 | option can also hold the name of a file or a list a file names. If this option | |
313 | is set to a list of file names, or the `Aliasfile:' profile component contains | |
314 | more than one file name, MH-E will prompt for one of them when MH-E adds an | |
315 | alias." | |
316 | :type '(choice (const :tag "Use Aliasfile Profile Component" nil) | |
317 | (file :tag "Alias File") | |
318 | (repeat :tag "List of Alias Files" file)) | |
319 | :group 'mh-alias) | |
924df208 | 320 | |
f0d73c14 BW |
321 | (defcustom mh-alias-insertion-location 'sorted |
322 | "Specifies where new aliases are entered in alias files. | |
323 | This option is set to `Alphabetical' by default. If you organize your alias | |
324 | 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) | |
924df208 | 330 | |
f0d73c14 BW |
331 | (defcustom mh-alias-local-users t |
332 | "*If on, local users are added to alias completion. | |
924df208 | 333 | |
f0d73c14 BW |
334 | Aliases are created from `/etc/passwd' entries with a user ID larger than |
335 | a magical number, typically 200. This can be a handy tool on a machine where | |
336 | you and co-workers exchange messages. These aliases have the form | |
337 | `local.first.last' if a real name is present in the password file. | |
338 | Otherwise, the alias will have the form `local.login'. | |
924df208 | 339 | |
f0d73c14 BW |
340 | If you're on a system with thousands of users you don't know, and the loading |
341 | of local aliases slows MH-E down noticeably, then turn this option off. | |
924df208 | 342 | |
f0d73c14 BW |
343 | 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) | |
924df208 | 347 | |
f0d73c14 BW |
348 | (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'. | |
924df208 | 351 | |
f0d73c14 | 352 | For example, consider the following password file entry: |
924df208 | 353 | |
f0d73c14 | 354 | psg:x:1000:1000:Peter S Galbraith,,,:/home/psg:/bin/tcsh |
924df208 | 355 | |
f0d73c14 | 356 | The following settings of this option will produce the associated aliases: |
924df208 | 357 | |
f0d73c14 BW |
358 | \"local.\" local.peter.galbraith |
359 | \"\" peter.galbraith | |
360 | Use Login psg | |
924df208 | 361 | |
f0d73c14 BW |
362 | This option has no effect if variable `mh-alias-local-users' is turned off." |
363 | :type '(choice (const :tag "Use Login" nil) | |
364 | (string)) | |
365 | :group 'mh-alias) | |
924df208 | 366 | |
f0d73c14 BW |
367 | (defcustom mh-alias-passwd-gecos-comma-separator-flag t |
368 | "*Non-nil means the gecos field in the password file uses a comma separator. | |
369 | In the example in `mh-alias-local-users-prefix', commas are used to separate | |
370 | different values within the so-called gecos field. This is a fairly common | |
371 | usage. However, in the rare case that the gecos field in your password file is | |
372 | not separated by commas and whose contents may contain commas, you can turn | |
373 | this option off." | |
374 | :type 'boolean | |
375 | :group 'mh-alias) | |
924df208 | 376 | |
f0d73c14 | 377 | \f |
924df208 | 378 | |
f0d73c14 | 379 | ;;; Organizing Your Mail with Folders (:group 'mh-folder) |
924df208 | 380 | |
f0d73c14 BW |
381 | (defcustom mh-recenter-summary-flag nil |
382 | "*Non-nil means to recenter the summary window. | |
383 | If this option is turned on, recenter the summary window when the show window | |
384 | is toggled off." | |
385 | :type 'boolean | |
386 | :group 'mh-folder) | |
924df208 | 387 | |
f0d73c14 | 388 | \f |
924df208 | 389 | |
f0d73c14 | 390 | ;;; Folder Selection (:group 'mh-folder-selection) |
924df208 | 391 | |
f0d73c14 BW |
392 | (defcustom mh-default-folder-for-message-function nil |
393 | "Function to select a default folder for refiling or `Fcc'. | |
394 | The current buffer is set to the message being refiled with point at the start | |
395 | of the message. This function should return the default folder as a string | |
396 | 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 | :type 'function | |
399 | :group 'mh-folder-selection) | |
c3d9274a | 400 | |
3d7ca223 | 401 | (defcustom mh-default-folder-list nil |
f0d73c14 BW |
402 | "*List of addresses and folders. |
403 | The folder name associated with the first address found in this list is used | |
404 | as the default for `mh-refile-msg' and similar functions. Each element in this | |
405 | list contains a `Check Recipient' item. If this item is turned on, then the | |
406 | address is checked against the recipient instead of the sender. This is useful | |
407 | for mailing lists. | |
924df208 | 408 | |
3d7ca223 BW |
409 | See `mh-prompt-for-refile-folder' and `mh-folder-from-address' for more |
410 | information." | |
924df208 BW |
411 | :type '(repeat (list (regexp :tag "Address") |
412 | (string :tag "Folder") | |
413 | (boolean :tag "Check Recipient"))) | |
f0d73c14 | 414 | :group 'mh-folder-selection) |
3d7ca223 BW |
415 | |
416 | (defcustom mh-default-folder-must-exist-flag t | |
417 | "*Non-nil means guessed folder name must exist to be used. | |
f0d73c14 BW |
418 | If the derived folder does not exist, and this option is on, then the last |
419 | folder name used is suggested. This is useful if you get mail from various | |
420 | people for whom you have an alias, but file them all in the same project | |
421 | folder. | |
422 | ||
3d7ca223 BW |
423 | See `mh-prompt-for-refile-folder' and `mh-folder-from-address' for more |
424 | information." | |
c3d9274a | 425 | :type 'boolean |
f0d73c14 | 426 | :group 'mh-folder-selection) |
c3d9274a | 427 | |
3d7ca223 | 428 | (defcustom mh-default-folder-prefix "" |
f0d73c14 BW |
429 | "*Prefix used for folder names generated from aliases. |
430 | The prefix is used to prevent clutter in your mail directory. | |
431 | ||
3d7ca223 BW |
432 | See `mh-prompt-for-refile-folder' and `mh-folder-from-address' for more |
433 | information." | |
434 | :type 'string | |
f0d73c14 | 435 | :group 'mh-folder-selection) |
3d7ca223 | 436 | |
f0d73c14 | 437 | \f |
c3d9274a | 438 | |
f0d73c14 | 439 | ;;; Identities (:group 'mh-identity) |
924df208 | 440 | |
f0d73c14 BW |
441 | (defcustom mh-identity-list nil |
442 | "*List of identities. | |
443 | ||
e495eaec BW |
444 | To customize this option, click on the `INS' button and enter a label such as |
445 | `Home' or `Work'. Then click on the `INS' button with the label `Add at least | |
446 | one item below'. Then choose one of the items in the `Value Menu'. | |
447 | ||
448 | You can specify an alternate `From:' header field using the `From Field' menu | |
449 | item. You must include a valid email address. A standard format is `First Last | |
450 | <login@@host.domain>'. If you use an initial with a period, then you must | |
451 | quote your name as in `\"First I. Last\" <login@@host.domain>'. People usually | |
452 | list the name of the company where they work using the `Organization Field' | |
453 | menu item. Set any arbitrary header field and value in the `Other Field' menu | |
454 | item. Unless the header field is a standard one, precede the name of your | |
455 | field's label with `X-', as in `X-Fruit-of-the-Day:'. The value of | |
456 | `Attribution Verb' overrides the setting of | |
457 | `mh-extract-from-attribution-verb'. Set your signature with the `Signature' | |
458 | menu item. You can specify the contents of `mh-signature-file-name', a file, | |
459 | or a function. Specify a different key to sign or encrypt messages with the | |
460 | `GPG Key ID' menu item. | |
461 | ||
462 | You can select the identities you have added via the menu called `Identity' in | |
463 | the MH-Letter buffer. You can also use \\[mh-insert-identity]. To clear the | |
464 | fields and signature added by the identity, select the `None' identity. | |
465 | ||
466 | The `Identity' menu contains two other items to save you from having to set | |
467 | the identity on every message. The menu item `Set Default for Session' can be | |
468 | used to set the default identity to the current identity until you exit Emacs. | |
469 | The menu item `Save as Default' sets the option `mh-identity-default' to the | |
470 | current identity setting. You can also customize the `mh-identity-default' | |
471 | option in the usual fashion." | |
f0d73c14 BW |
472 | :type '(repeat (list :tag "" |
473 | (string :tag "Label") | |
474 | (repeat :tag "Add at least one item below" | |
475 | (choice | |
476 | (cons :tag "From Field" | |
477 | (const "From") | |
478 | (string :tag "Value")) | |
479 | (cons :tag "Organization Field" | |
480 | (const "Organization") | |
481 | (string :tag "Value")) | |
482 | (cons :tag "Other Field" | |
483 | (string :tag "Field") | |
484 | (string :tag "Value")) | |
485 | (cons :tag "Attribution Verb" | |
486 | (const ":attribution-verb") | |
487 | (string :tag "Value")) | |
488 | (cons :tag "Signature" | |
489 | (const :tag "Signature" | |
490 | ":signature") | |
491 | (choice | |
492 | (const :tag "mh-signature-file-name" | |
493 | nil) | |
494 | (file) | |
495 | (function))) | |
496 | (cons :tag "GPG Key ID" | |
497 | (const :tag "GPG Key ID" | |
498 | ":pgg-default-user-id") | |
499 | (string :tag "Value")))))) | |
500 | :set 'mh-identity-list-set | |
501 | :group 'mh-identity) | |
c3d9274a | 502 | |
f0d73c14 BW |
503 | (defcustom mh-auto-fields-list nil |
504 | "List of recipients for which header lines are automatically inserted. | |
e495eaec BW |
505 | |
506 | This option can be used to set the identity depending on the recipient. To | |
507 | customize this option, click on the `INS' button and enter a regular | |
508 | expression for the recipient's address. Click on the `INS' button with the | |
509 | `Add at least one item below' label. Then choose one of the items in the | |
510 | `Value Menu'. | |
511 | ||
512 | The `Identity' menu item is used to select an identity from those configured | |
513 | in `mh-identity-list'. All of the information for that identity will be added | |
514 | if the recipient matches. The `Fcc Field' menu item is used to select a folder | |
515 | that is used in the `Fcc:' header. When you send the message, MH will put a | |
516 | copy of your message in this folder. The `Mail-Followup-To Field' menu item is | |
517 | used to insert an `Mail-Followup-To:' header field with the recipients you | |
518 | provide. If the recipient's mail user agent supports this header field (as nmh | |
519 | does), then their replies will go to the addresses listed. This is useful if | |
520 | their replies go both to the list and to you and you don't have a mechanism to | |
521 | suppress duplicates. If you reply to someone not on the list, you must either | |
522 | remove the `Mail-Followup-To:' field, or ensure the recipient is also listed | |
523 | there so that he receives replies to your reply. Other header fields may be | |
524 | added using the `Other Field' menu item. | |
525 | ||
526 | These fields can only be added after the recipient is known. Once the header | |
527 | contains one or more recipients, run the \\[mh-insert-auto-fields] command or | |
528 | choose the `Identity -> Insert Auto Fields' menu item to insert these fields | |
529 | manually. However, you can just send the message and the fields will be added | |
530 | automatically. You are given a chance to see these fields and to confirm them | |
531 | before the message is actually sent. You can do away with this confirmation by | |
532 | turning off the option `mh-auto-fields-prompt-flag'. | |
533 | ||
534 | You should avoid using the same header field in `mh-auto-fields-list' and | |
535 | `mh-identity-list' definitions that may apply to the same message as the | |
536 | result is undefined." | |
f0d73c14 BW |
537 | :type `(repeat |
538 | (list :tag "" | |
539 | (string :tag "Recipient") | |
540 | (repeat :tag "Add at least one item below" | |
541 | (choice | |
542 | (cons :tag "Identity" | |
543 | (const ":identity") | |
544 | ,(append | |
545 | '(radio) | |
546 | (mapcar | |
547 | (function (lambda (arg) `(const ,arg))) | |
548 | (mapcar 'car mh-identity-list)))) | |
549 | (cons :tag "Fcc Field" | |
550 | (const "fcc") | |
551 | (string :tag "Value")) | |
552 | (cons :tag "Mail-Followup-To Field" | |
553 | (const "Mail-Followup-To") | |
554 | (string :tag "Value")) | |
555 | (cons :tag "Other Field" | |
556 | (string :tag "Field") | |
557 | (string :tag "Value")))))) | |
558 | :group 'mh-identity) | |
a66894d8 | 559 | |
f0d73c14 BW |
560 | (defcustom mh-auto-fields-prompt-flag t |
561 | "*Non-nil means to prompt before sending if fields inserted. | |
562 | See `mh-auto-fields-list'." | |
a66894d8 | 563 | :type 'boolean |
f0d73c14 | 564 | :group 'mh-identity) |
c3d9274a | 565 | |
f0d73c14 | 566 | (defcustom mh-identity-default nil |
e495eaec BW |
567 | "Default identity to use when `mh-letter-mode' is called. |
568 | See `mh-identity-list'." | |
f0d73c14 BW |
569 | :type (append |
570 | '(radio) | |
571 | (cons '(const :tag "None" nil) | |
572 | (mapcar (function (lambda (arg) `(const ,arg))) | |
573 | (mapcar 'car mh-identity-list)))) | |
574 | :group 'mh-identity) | |
c3d9274a | 575 | |
f0d73c14 | 576 | (defcustom mh-identity-handlers |
e495eaec BW |
577 | '(("From" . mh-identity-handler-top) |
578 | (":default" . mh-identity-handler-bottom) | |
f0d73c14 BW |
579 | (":attribution-verb" . mh-identity-handler-attribution-verb) |
580 | (":signature" . mh-identity-handler-signature) | |
581 | (":pgg-default-user-id" . mh-identity-handler-gpg-identity)) | |
582 | "Handler functions for fields in `mh-identity-list'. | |
e495eaec BW |
583 | |
584 | This option is used to change the way that fields, signatures, and | |
585 | attributions in `mh-identity-list' are added. To customize | |
586 | `mh-identity-handlers', replace the name of an existing handler function | |
587 | associated with the field you want to change with the name of a function you | |
588 | have written. You can also click on an `INS' button and insert a field of your | |
589 | choice and the name of the function you have written to handle it. | |
590 | ||
591 | The `Field' field can be any field that you've used in your | |
592 | `mh-identity-list'. The special fields `:attribution-verb', `:signature', or | |
593 | `:pgg-default-user-id' are used for the `mh-identity-list' choices | |
594 | `Attribution Verb', `Signature', and `GPG Key ID' respectively. | |
595 | ||
596 | The handler associated with the `:default' field is used when no other field | |
597 | matches. | |
598 | ||
599 | The handler functions are passed two or three arguments: the FIELD itself (for | |
600 | example, `From'), or one of the special fields (for example, `:signature'), | |
601 | and the ACTION `'remove' or `'add'. If the action is `'add', an additional | |
602 | argument containing the VALUE for the field is given." | |
f0d73c14 BW |
603 | :type '(repeat (cons (string :tag "Field") function)) |
604 | :group 'mh-identity) | |
c3d9274a | 605 | |
f0d73c14 | 606 | \f |
c3d9274a | 607 | |
f0d73c14 | 608 | ;;; Incorporating Your Mail (:group 'mh-inc) |
c3d9274a | 609 | |
f0d73c14 | 610 | (defcustom mh-inc-prog "inc" |
e495eaec BW |
611 | "*Program to incorporate new mail into a folder. |
612 | ||
613 | This program generates a one-line summary for each of the new messages. Unless | |
614 | it is an absolute pathname, the file is assumed to be in the `mh-progs' | |
615 | directory. You may also link a file to `inc' that uses a different format. | |
616 | You'll then need to modify several scan line format variables appropriately." | |
f0d73c14 BW |
617 | :type 'string |
618 | :group 'mh-inc) | |
924df208 | 619 | |
f0d73c14 | 620 | (defcustom mh-inc-spool-list nil |
e495eaec BW |
621 | "*Alternate spool files. |
622 | ||
623 | You can use the `mh-inc-spool-list' variable to direct MH-E to retrieve mail | |
624 | from arbitrary spool files other than your system mailbox, file it in folders | |
625 | other than your `+inbox', and assign key bindings to incorporate this mail. | |
f0d73c14 | 626 | |
e495eaec BW |
627 | Suppose you are subscribed to the `mh-e-devel' mailing list and you use |
628 | `procmail' to filter this mail into `~/mail/mh-e' with the following recipe in | |
629 | `.procmailrc': | |
f0d73c14 BW |
630 | |
631 | MAILDIR=$HOME/mail | |
632 | :0: | |
e495eaec | 633 | * ^From mh-e-devel-admin@stop.mail-abuse.org |
f0d73c14 BW |
634 | mh-e |
635 | ||
e495eaec BW |
636 | In order to incorporate `~/mail/mh-e' into `+mh-e' with an `I m' |
637 | \(`mh-inc-spool-mh-e'\) command, customize this option, and click on the `INS' | |
638 | button. Enter a `Spool File' of `~/mail/mh-e', a `Folder' of `mh-e', and a | |
639 | `Key Binding' of `m'. | |
f0d73c14 | 640 | |
e495eaec BW |
641 | You can use `xbuffy' to automate the incorporation of this mail using the |
642 | `gnudoit' command in the `gnuserv' package as follows: | |
f0d73c14 BW |
643 | |
644 | box ~/mail/mh-e | |
645 | title mh-e | |
646 | origMode | |
647 | polltime 10 | |
648 | headertime 0 | |
e495eaec | 649 | command gnudoit -q '(mh-inc-spool-mh-e)'" |
f0d73c14 BW |
650 | :type '(repeat (list (file :tag "Spool File") |
651 | (string :tag "Folder") | |
652 | (character :tag "Key Binding"))) | |
653 | :set 'mh-inc-spool-list-set | |
654 | :group 'mh-inc) | |
c3d9274a | 655 | |
3d7ca223 BW |
656 | \f |
657 | ||
f0d73c14 | 658 | ;;; Searching (:group 'mh-index) |
924df208 BW |
659 | |
660 | (defcustom mh-index-new-messages-folders t | |
e495eaec BW |
661 | "Folders searched for the \"unseen\" sequence. |
662 | Set this option to \"Inbox\" to search the \"+inbox\" folder or \"All\" to | |
f0d73c14 | 663 | search all of the top level folders. Otherwise, list the folders that should |
e495eaec | 664 | be searched with the \"Choose Folders\" menu item. |
f0d73c14 | 665 | |
924df208 BW |
666 | See also `mh-recursive-folders-flag'." |
667 | :group 'mh-index | |
668 | :type '(choice (const :tag "Inbox" t) | |
669 | (const :tag "All" nil) | |
f0d73c14 | 670 | (repeat :tag "Choose Folders" (string :tag "Folder")))) |
924df208 BW |
671 | |
672 | (defcustom mh-index-program nil | |
673 | "Indexing program that MH-E shall use. | |
f0d73c14 BW |
674 | The default setting of this option is `Auto-detect' which means that MH-E will |
675 | automatically choose one of swish++, swish-e, mairix, namazu, pick and grep in | |
676 | that order. If, for example, you have both swish++ and mairix installed and | |
677 | you want to use mairix, then you can set this option to `mairix'. | |
924df208 BW |
678 | |
679 | More information about setting up an indexing program to use with MH-E can be | |
680 | found in the documentation of `mh-index-search'." | |
681 | :type '(choice (const :tag "Auto-detect" nil) | |
682 | (const :tag "swish++" swish++) | |
683 | (const :tag "swish-e" swish) | |
684 | (const :tag "mairix" mairix) | |
685 | (const :tag "namazu" namazu) | |
924df208 BW |
686 | (const :tag "pick" pick) |
687 | (const :tag "grep" grep)) | |
688 | :group 'mh-index) | |
689 | ||
a66894d8 BW |
690 | (defcustom mh-index-ticked-messages-folders t |
691 | "Folders searched for `mh-tick-seq'. | |
e495eaec | 692 | Set this option to \"Inbox\" to search the \"+inbox\" folder or \"All\" to |
f0d73c14 | 693 | search all of the top level folders. Otherwise, list the folders that should |
e495eaec | 694 | be searched with the \"Choose Folders\" menu item. |
f0d73c14 | 695 | |
a66894d8 BW |
696 | See also `mh-recursive-folders-flag'." |
697 | :group 'mh-index | |
698 | :type '(choice (const :tag "Inbox" t) | |
699 | (const :tag "All" nil) | |
f0d73c14 | 700 | (repeat :tag "Choose Folders" (string :tag "Folder")))) |
a66894d8 | 701 | |
924df208 BW |
702 | \f |
703 | ||
f0d73c14 | 704 | ;;; Dealing with Junk Mail (:group 'mh-junk) |
924df208 BW |
705 | |
706 | ;; Spam fighting program chosen | |
707 | (defvar mh-junk-choice nil) | |
708 | ||
709 | ;; Available spam filter interfaces | |
710 | (defvar mh-junk-function-alist | |
f0d73c14 BW |
711 | '((spamassassin mh-spamassassin-blacklist mh-spamassassin-whitelist) |
712 | (bogofilter mh-bogofilter-blacklist mh-bogofilter-whitelist) | |
713 | (spamprobe mh-spamprobe-blacklist mh-spamprobe-whitelist)) | |
924df208 BW |
714 | "Available choices of spam programs to use. |
715 | This is an alist. For each element there are functions that blacklist a message | |
716 | as spam and whitelist a message incorrectly classified as spam.") | |
717 | ||
718 | (defun mh-junk-choose (symbol value) | |
719 | "Choose spam program to use. | |
720 | The function is always called with SYMBOL bound to `mh-junk-program' and VALUE | |
721 | bound to the new value of `mh-junk-program'. The function sets the variable | |
722 | `mh-junk-choice' in addition to `mh-junk-program'." | |
723 | (set symbol value) | |
724 | (setq mh-junk-choice | |
725 | (or value | |
726 | (loop for element in mh-junk-function-alist | |
727 | until (executable-find (symbol-name (car element))) | |
728 | finally return (car element))))) | |
729 | ||
730 | ;; User customizable variables | |
e495eaec BW |
731 | (defcustom mh-junk-background nil |
732 | "If on, spam programs are run in background. | |
733 | By default, the programs are run in the foreground, but this can be slow when | |
734 | junking large numbers of messages. If you have enough memory or don't junk | |
735 | that many messages at the same time, you might try turning on this option." | |
736 | :type '(choice (const :tag "Off" nil) | |
737 | (const :tag "On" 0)) | |
738 | :group 'mh-junk) | |
739 | ||
f0d73c14 BW |
740 | (defcustom mh-junk-disposition nil |
741 | "Disposition of junk mail." | |
742 | :type '(choice (const :tag "Delete Spam" nil) | |
743 | (string :tag "Spam Folder")) | |
744 | :group 'mh-junk) | |
745 | ||
746 | (defcustom mh-junk-program nil | |
747 | "Spam program that MH-E should use. | |
e495eaec BW |
748 | |
749 | The default setting of this option is \"Auto-detect\" which means that MH-E | |
750 | will automatically choose one of SpamAssassin, Bogofilter, or SpamProbe in | |
751 | that order. If, for example, you have both SpamAssassin and Bogofilter | |
752 | installed and you want to use BogoFilter, then you can set this option to | |
753 | \"Bogofilter\"." | |
f0d73c14 BW |
754 | :type '(choice (const :tag "Auto-detect" nil) |
755 | (const :tag "SpamAssassin" spamassassin) | |
756 | (const :tag "Bogofilter" bogofilter) | |
757 | (const :tag "SpamProbe" spamprobe)) | |
758 | :set 'mh-junk-choose | |
924df208 BW |
759 | :group 'mh-junk) |
760 | ||
f0d73c14 BW |
761 | \f |
762 | ||
763 | ;;; Editing a Draft (:group 'mh-letter) | |
764 | ||
f0d73c14 BW |
765 | (defcustom mh-compose-insertion (if (locate-library "mml") 'gnus 'mhn) |
766 | "Type of MIME message directives in messages. | |
767 | ||
768 | By default, this option is set to `Gnus' if it is supported. This option can | |
769 | also be set manually to `mhn' if mhn directives are preferred." | |
770 | :type '(choice (const :tag "Gnus" gnus) | |
771 | (const :tag "mhn" mhn)) | |
772 | :group 'mh-letter) | |
773 | ||
774 | (defcustom mh-compose-skipped-header-fields | |
775 | '("From" "Organization" "References" "In-Reply-To" | |
776 | "X-Face" "Face" "X-Image-URL" "X-Mailer") | |
777 | "List of header fields to skip over when navigating in draft." | |
778 | :type '(repeat (string :tag "Field")) | |
779 | :group 'mh-letter) | |
780 | ||
781 | (defcustom mh-compose-space-does-completion-flag nil | |
782 | "*Non-nil means that <SPC> does completion in message header." | |
783 | :type 'boolean | |
784 | :group 'mh-letter) | |
785 | ||
786 | (defcustom mh-delete-yanked-msg-window-flag nil | |
787 | "*Non-nil means delete any window displaying the message. | |
788 | If this option is on, yanking the current message into a draft letter with | |
789 | \\<mh-letter-mode-map>\\[mh-yank-cur-msg] deletes any windows displaying the | |
790 | message." | |
791 | :type 'boolean | |
792 | :group 'mh-letter) | |
793 | ||
794 | (defcustom mh-extract-from-attribution-verb "wrote:" | |
795 | "*Verb to use for attribution when a message is yanked by \\<mh-letter-mode-map>\\[mh-yank-cur-msg]." | |
796 | :type '(choice (const "wrote:") | |
797 |