mh-customize.el 98.4 KB
Newer Older
Bill Wohler's avatar
Bill Wohler committed
1 2
;;; mh-customize.el --- MH-E customization

Bill Wohler's avatar
Bill Wohler committed
3
;; Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
Bill Wohler's avatar
Bill Wohler committed
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23

;; Author: Bill Wohler <wohler@newt.com>
;; Maintainer: Bill Wohler <wohler@newt.com>
;; Keywords: mail
;; See: mh-e.el

;; This file is part of GNU Emacs.

;; GNU Emacs is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation; either version 2, or (at your option)
;; any later version.

;; GNU Emacs is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;; GNU General Public License for more details.

;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs; see the file COPYING.  If not, write to the
Lute Kamstra's avatar
Lute Kamstra committed
24 25
;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
;; Boston, MA 02110-1301, USA.
Bill Wohler's avatar
Bill Wohler committed
26 27 28

;;; Commentary:

Bill Wohler's avatar
Bill Wohler committed
29 30 31
;; All of the defgroups, defcustoms, and deffaces in MH-E are found
;; here. This makes it possible to customize modules that aren't loaded
;; yet. It also makes it easier to organize the customization groups.
Bill Wohler's avatar
Bill Wohler committed
32 33 34 35 36

;; This file contains the following sections:
;;
;; 1. MH-E Customization Groups
;;
Bill Wohler's avatar
Bill Wohler committed
37 38 39
;;    These are the customization group definitions. Every group has a
;;    associated manual node. The ordering is alphabetical, except for the
;;    groups mh-faces and mh-hooks which are last .
Bill Wohler's avatar
Bill Wohler committed
40 41 42
;;
;; 2. MH-E Customization
;;
Bill Wohler's avatar
Bill Wohler committed
43 44 45 46
;;    These are the actual customization variables. There is a sub-section for
;;    each group in the MH-E Customization Groups section, in the same order,
;;    separated by page breaks. Within each section, variables are sorted
;;    alphabetically.
Bill Wohler's avatar
Bill Wohler committed
47
;;
Bill Wohler's avatar
Bill Wohler committed
48 49 50 51 52 53 54 55 56 57 58 59 60
;; 3. Hooks
;;
;;    All hooks must be placed in the mh-hook group; in addition, add the
;;    group associated with the manual node in which the hook is described.
;;    Since the mh-hook group appears near the end of this file, the hooks
;;    will appear at the end of these other groups.
;;
;; 4. Faces
;;
;;    Create a new face group if necessary; in this case, add the group
;;    associated with the manual node in which the faces are described to the
;;    faces' group definition. Since the face groups appear last, the face
;;    groups will appear at the end of these other groups.
Bill Wohler's avatar
Bill Wohler committed
61 62 63 64
;;
;;; Change Log:

;;; Code:
Bill Wohler's avatar
Bill Wohler committed
65

Bill Wohler's avatar
Bill Wohler committed
66
(provide 'mh-customize)
Bill Wohler's avatar
Bill Wohler committed
67 68 69 70 71 72 73 74

(eval-when-compile (require 'mh-acros))
(mh-require-cl)
(require 'mh-loaddefs)

(eval-and-compile
  (defvar mh-xemacs-flag (featurep 'xemacs)
    "Non-nil means the current Emacs is XEmacs."))
Bill Wohler's avatar
Bill Wohler committed
75 76 77

(when mh-xemacs-flag
  (require 'mh-xemacs))
Bill Wohler's avatar
Bill Wohler committed
78

Bill Wohler's avatar
Bill Wohler committed
79 80 81 82 83 84 85
;; XXX: Functions autoloaded from the following files are used to initialize
;;  customizable variables. They are require'd here, since otherwise the
;;  corresponding .elc would be loaded at compile time.
(eval-when-compile
  (require 'mh-init)
  (require 'mh-identity))

Bill Wohler's avatar
Bill Wohler committed
86 87
(defun mh-customize (&optional delete-other-windows-flag)
  "Customize MH-E variables.
Bill Wohler's avatar
Bill Wohler committed
88 89
If optional argument DELETE-OTHER-WINDOWS-FLAG is non-nil, other windows in
the frame are removed."
Bill Wohler's avatar
Bill Wohler committed
90
  (interactive "P")
91
  (customize-group 'mh-e)
Bill Wohler's avatar
Bill Wohler committed
92 93
  (when delete-other-windows-flag
    (delete-other-windows)))
Bill Wohler's avatar
Bill Wohler committed
94

Bill Wohler's avatar
Bill Wohler committed
95 96 97


;;; For compiler warnings...
98 99 100
(eval-when-compile
  (defvar mh-show-buffer)
  (defvar mh-show-folder-buffer))
Bill Wohler's avatar
Bill Wohler committed
101

Bill Wohler's avatar
Bill Wohler committed
102 103
;;; MH-E Customization Groups

Bill Wohler's avatar
Bill Wohler committed
104
(defgroup mh-e nil
Bill Wohler's avatar
Bill Wohler committed
105 106 107
  "Emacs interface to the MH mail system.
MH is the Rand Mail Handler. Other implementations include nmh and GNU
mailutils."
Bill Wohler's avatar
Bill Wohler committed
108 109 110
  :link '(custom-manual "(mh-e)Top")
  :group 'mail)

Bill Wohler's avatar
Bill Wohler committed
111 112 113 114
(defgroup mh-alias nil
  "Aliases."
  :link '(custom-manual "(mh-e)Aliases")
  :prefix "mh-alias-"
Bill Wohler's avatar
Bill Wohler committed
115
  :group 'mh-e)
Bill Wohler's avatar
Bill Wohler committed
116

Bill Wohler's avatar
Bill Wohler committed
117 118
(defgroup mh-folder nil
  "Organizing your mail with folders."
Bill Wohler's avatar
Bill Wohler committed
119
  :prefix "mh-"
Bill Wohler's avatar
Bill Wohler committed
120
  :link '(custom-manual "(mh-e)Organizing")
Bill Wohler's avatar
Bill Wohler committed
121
  :group 'mh-e)
Bill Wohler's avatar
Bill Wohler committed
122

Bill Wohler's avatar
Bill Wohler committed
123 124
(defgroup mh-folder-selection nil
  "Folder selection."
Bill Wohler's avatar
Bill Wohler committed
125
  :prefix "mh-"
Bill Wohler's avatar
Bill Wohler committed
126
  :link '(custom-manual "(mh-e)Folder Selection")
Bill Wohler's avatar
Bill Wohler committed
127
  :group 'mh-e)
Bill Wohler's avatar
Bill Wohler committed
128 129 130 131 132

(defgroup mh-identity nil
  "Identities."
  :link '(custom-manual "(mh-e)Identities")
  :prefix "mh-identity-"
Bill Wohler's avatar
Bill Wohler committed
133
  :group 'mh-e)
Bill Wohler's avatar
Bill Wohler committed
134 135 136 137 138

(defgroup mh-inc nil
  "Incorporating your mail."
  :prefix "mh-inc-"
  :link '(custom-manual "(mh-e)Incorporating Mail")
Bill Wohler's avatar
Bill Wohler committed
139
  :group 'mh-e)
Bill Wohler's avatar
Bill Wohler committed
140

Bill Wohler's avatar
Bill Wohler committed
141
(defgroup mh-index nil
Bill Wohler's avatar
Bill Wohler committed
142 143 144
  "Searching."
  :link '(custom-manual "(mh-e)Searching")
  :prefix "mh-index-"
Bill Wohler's avatar
Bill Wohler committed
145
  :group 'mh-e)
Bill Wohler's avatar
Bill Wohler committed
146 147

(defgroup mh-junk nil
Bill Wohler's avatar
Bill Wohler committed
148 149
  "Dealing with junk mail."
  :link '(custom-manual "(mh-e)Junk")
Bill Wohler's avatar
Bill Wohler committed
150
  :prefix "mh-junk-"
Bill Wohler's avatar
Bill Wohler committed
151
  :group 'mh-e)
Bill Wohler's avatar
Bill Wohler committed
152

Bill Wohler's avatar
Bill Wohler committed
153 154
(defgroup mh-letter nil
  "Editing a draft."
Bill Wohler's avatar
Bill Wohler committed
155
  :prefix "mh-"
Bill Wohler's avatar
Bill Wohler committed
156
  :link '(custom-manual "(mh-e)Editing Drafts")
Bill Wohler's avatar
Bill Wohler committed
157
  :group 'mh-e)
Bill Wohler's avatar
Bill Wohler committed
158

Bill Wohler's avatar
Bill Wohler committed
159 160
(defgroup mh-ranges nil
  "Ranges."
Bill Wohler's avatar
Bill Wohler committed
161
  :prefix "mh-"
Bill Wohler's avatar
Bill Wohler committed
162
  :link '(custom-manual "(mh-e)Ranges")
Bill Wohler's avatar
Bill Wohler committed
163
  :group 'mh-e)
Bill Wohler's avatar
Bill Wohler committed
164

Bill Wohler's avatar
Bill Wohler committed
165 166 167
(defgroup mh-scan-line-formats nil
  "Scan line formats."
  :link '(custom-manual "(mh-e)Scan Line Formats")
Bill Wohler's avatar
Bill Wohler committed
168
  :prefix "mh-"
Bill Wohler's avatar
Bill Wohler committed
169
  :group 'mh-e)
Bill Wohler's avatar
Bill Wohler committed
170

Bill Wohler's avatar
Bill Wohler committed
171 172 173 174
(defgroup mh-sending-mail nil
  "Sending mail."
  :prefix "mh-"
  :link '(custom-manual "(mh-e)Sending Mail")
Bill Wohler's avatar
Bill Wohler committed
175
  :group 'mh-e)
Bill Wohler's avatar
Bill Wohler committed
176

Bill Wohler's avatar
Bill Wohler committed
177 178 179 180
(defgroup mh-sequences nil
  "Sequences."
  :prefix "mh-"
  :link '(custom-manual "(mh-e)Sequences")
Bill Wohler's avatar
Bill Wohler committed
181
  :group 'mh-e)
Bill Wohler's avatar
Bill Wohler committed
182 183 184 185 186

(defgroup mh-show nil
  "Reading your mail."
  :prefix "mh-"
  :link '(custom-manual "(mh-e)Reading Mail")
Bill Wohler's avatar
Bill Wohler committed
187
  :group 'mh-e)
Bill Wohler's avatar
Bill Wohler committed
188 189 190 191 192

(defgroup mh-speed nil
  "The speedbar."
  :prefix "mh-speed-"
  :link '(custom-manual "(mh-e)Speedbar")
Bill Wohler's avatar
Bill Wohler committed
193
  :group 'mh-e)
Bill Wohler's avatar
Bill Wohler committed
194 195 196 197 198

(defgroup mh-toolbar nil
  "The toolbar"
  :link '(custom-manual "(mh-e)Toolbar")
  :prefix "mh-"
Bill Wohler's avatar
Bill Wohler committed
199
  :group 'mh-e)
Bill Wohler's avatar
Bill Wohler committed
200 201 202 203

(defgroup mh-faces nil
  "Faces used in MH-E."
  :link '(custom-manual "(mh-e)Top")
Bill Wohler's avatar
Bill Wohler committed
204
  :prefix "mh-"
Bill Wohler's avatar
Bill Wohler committed
205
  :group 'faces
Bill Wohler's avatar
Bill Wohler committed
206
  :group 'mh-e)
Bill Wohler's avatar
Bill Wohler committed
207 208 209

(defgroup mh-hooks nil
  "MH-E hooks."
Bill Wohler's avatar
Bill Wohler committed
210
  :link '(custom-manual "(mh-e)Top")
Bill Wohler's avatar
Bill Wohler committed
211
  :prefix "mh-"
Bill Wohler's avatar
Bill Wohler committed
212
  :group 'mh-e)
Bill Wohler's avatar
Bill Wohler committed
213 214 215 216 217

;;; Faces

(defgroup mh-folder-faces nil
  "Faces used in scan listing."
Bill Wohler's avatar
Bill Wohler committed
218
  :link '(custom-manual "(mh-e)Organizing")
Bill Wohler's avatar
Bill Wohler committed
219 220
  :prefix "mh-"
  :group 'mh-faces
Bill Wohler's avatar
Bill Wohler committed
221
  :group 'mh-show)
Bill Wohler's avatar
Bill Wohler committed
222

Bill Wohler's avatar
Bill Wohler committed
223
(defgroup mh-index-faces nil
Bill Wohler's avatar
Bill Wohler committed
224 225
  "Faces used in searching."
  :link '(custom-manual "(mh-e)Searching")
Bill Wohler's avatar
Bill Wohler committed
226 227 228 229
  :prefix "mh-"
  :group 'mh-faces
  :group 'mh-index)

Bill Wohler's avatar
Bill Wohler committed
230 231 232 233 234 235 236
(defgroup mh-letter-faces nil
  "Faces used in message drafts."
  :link '(custom-manual "(mh-e)Sending Mail")
  :prefix "mh-"
  :group 'mh-faces
  :group 'mh-letter)

Bill Wohler's avatar
Bill Wohler committed
237 238
(defgroup mh-show-faces nil
  "Faces used in message display."
Bill Wohler's avatar
Bill Wohler committed
239
  :link '(custom-manual "(mh-e)Reading Mail")
Bill Wohler's avatar
Bill Wohler committed
240 241 242 243
  :prefix "mh-"
  :group 'mh-faces
  :group 'mh-show)

Bill Wohler's avatar
Bill Wohler committed
244 245 246
(defgroup mh-speed-faces nil
  "Faces used in speedbar."
  :link '(custom-manual "(mh-e)Speedbar")
Bill Wohler's avatar
Bill Wohler committed
247 248
  :prefix "mh-"
  :group 'mh-faces
Bill Wohler's avatar
Bill Wohler committed
249
  :group 'mh-speed)
Bill Wohler's avatar
Bill Wohler committed
250 251 252



Bill Wohler's avatar
Bill Wohler committed
253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275
;;; Emacs interface to the MH mail system (:group mh)
(eval-when (compile)
  (setq mh-variant 'none))

(defcustom mh-variant 'autodetect
  "*Specifies the variant used by MH-E.

The default setting of this option is `Auto-detect' which means that MH-E will
automatically choose the first of nmh, MH, or GNU mailutils that it finds in
the directories listed in `mh-path', `mh-sys-path', and `exec-path'. If, for
example, you have both nmh and mailutils installed and `mh-variant-in-use' was
initialized to nmh but you want to use mailutils, then you can set this option
to `mailutils'.

When this variable is changed, MH-E resets `mh-progs', `mh-lib',
`mh-lib-progs', `mh-flists-present-flag', and `mh-variant-in-use'
accordingly."
  :type `(radio
          (const :tag "Auto-detect" autodetect)
          ,@(mapcar (lambda (x) `(const ,(car x))) (mh-variants)))
  :set (lambda (symbol value)
         (set-default symbol value)     ;Done in mh-variant-set-variant!
         (mh-variant-set value))
Bill Wohler's avatar
Bill Wohler committed
276
  :group 'mh-e)
Bill Wohler's avatar
Bill Wohler committed
277

Bill Wohler's avatar
Bill Wohler committed
278

Bill Wohler's avatar
Bill Wohler committed
279

Bill Wohler's avatar
Bill Wohler committed
280
;;; Aliases (:group 'mh-alias)
Bill Wohler's avatar
Bill Wohler committed
281

Bill Wohler's avatar
Bill Wohler committed
282 283 284 285 286 287 288 289
(defcustom mh-alias-completion-ignore-case-flag t
  "*Non-nil means don't consider case significant in MH alias completion.
As MH ignores case in the aliases, so too does MH-E. However, you may turn
this option off to make case significant which can be used to segregate
completion of your aliases. You might use lowercase for mailing lists and
uppercase for people."
  :type 'boolean
  :group 'mh-alias)
Bill Wohler's avatar
Bill Wohler committed
290

Bill Wohler's avatar
Bill Wohler committed
291 292 293 294 295 296
(defcustom mh-alias-expand-aliases-flag nil
  "*Non-nil means to expand aliases entered in the minibuffer.
In other words, aliases entered in the minibuffer will be expanded to the full
address in the message draft. By default, this expansion is not performed."
  :type 'boolean
  :group 'mh-alias)
Bill Wohler's avatar
Bill Wohler committed
297

Bill Wohler's avatar
Bill Wohler committed
298 299 300 301 302 303 304
(defcustom mh-alias-flash-on-comma t
  "*Specify whether to flash address or warn on translation.
This option controls the behavior when a [comma] is pressed while entering
aliases or addresses. The default setting flashes the address associated with
an address in the minibuffer briefly, but does not display a warning if the
alias is not found."
  :type '(choice (const :tag "Flash but Don't Warn If No Alias" t)
305 306
                 (const :tag "Flash and Warn If No Alias" 1)
                 (const :tag "Don't Flash Nor Warn If No Alias" nil))
Bill Wohler's avatar
Bill Wohler committed
307
  :group 'mh-alias)
Bill Wohler's avatar
Bill Wohler committed
308

Bill Wohler's avatar
Bill Wohler committed
309 310 311 312 313 314 315 316 317 318 319
(defcustom mh-alias-insert-file nil
  "*Filename used to store a new MH-E alias.
The default setting of this option is `Use Aliasfile Profile Component'. This
option can also hold the name of a file or a list a file names. If this option
is set to a list of file names, or the `Aliasfile:' profile component contains
more than one file name, MH-E will prompt for one of them when MH-E adds an
alias."
  :type '(choice (const :tag "Use Aliasfile Profile Component" nil)
                 (file :tag "Alias File")
                 (repeat :tag "List of Alias Files" file))
  :group 'mh-alias)
Bill Wohler's avatar
Bill Wohler committed
320

Bill Wohler's avatar
Bill Wohler committed
321 322 323 324 325 326 327 328 329
(defcustom mh-alias-insertion-location 'sorted
  "Specifies where new aliases are entered in alias files.
This option is set to `Alphabetical' by default. If you organize your alias
file in other ways, then adding aliases to the `Top' or `Bottom' of your alias
file might be more appropriate."
  :type '(choice (const :tag "Alphabetical" sorted)
                 (const :tag "Top" top)
                 (const :tag "Bottom" bottom))
  :group 'mh-alias)
Bill Wohler's avatar
Bill Wohler committed
330

Bill Wohler's avatar
Bill Wohler committed
331 332
(defcustom mh-alias-local-users t
  "*If on, local users are added to alias completion.
Bill Wohler's avatar
Bill Wohler committed
333

Bill Wohler's avatar
Bill Wohler committed
334 335 336 337 338
Aliases are created from `/etc/passwd' entries with a user ID larger than
a magical number, typically 200. This can be a handy tool on a machine where
you and co-workers exchange messages. These aliases have the form
`local.first.last' if a real name is present in the password file.
Otherwise, the alias will have the form `local.login'.
Bill Wohler's avatar
Bill Wohler committed
339

Bill Wohler's avatar
Bill Wohler committed
340 341
If you're on a system with thousands of users you don't know, and the loading
of local aliases slows MH-E down noticeably, then turn this option off.
Bill Wohler's avatar
Bill Wohler committed
342

Bill Wohler's avatar
Bill Wohler committed
343 344 345 346
This option also takes a string which is executed to generate the password
file. For example, use \"ypcat passwd\" to obtain the NIS password file."
  :type '(choice (boolean) (string))
  :group 'mh-alias)
Bill Wohler's avatar
Bill Wohler committed
347

Bill Wohler's avatar
Bill Wohler committed
348 349 350
(defcustom mh-alias-local-users-prefix "local."
  "*String prepended to the real names of users from the password file.
This option can also be set to `Use Login'.
Bill Wohler's avatar
Bill Wohler committed
351

Bill Wohler's avatar
Bill Wohler committed
352
For example, consider the following password file entry:
Bill Wohler's avatar
Bill Wohler committed
353

Bill Wohler's avatar
Bill Wohler committed
354
    psg:x:1000:1000:Peter S Galbraith,,,:/home/psg:/bin/tcsh
Bill Wohler's avatar
Bill Wohler committed
355

Bill Wohler's avatar
Bill Wohler committed
356
The following settings of this option will produce the associated aliases:
Bill Wohler's avatar
Bill Wohler committed
357

Bill Wohler's avatar
Bill Wohler committed
358 359 360
    \"local.\"                  local.peter.galbraith
    \"\"                        peter.galbraith
    Use Login                   psg
Bill Wohler's avatar
Bill Wohler committed
361

Bill Wohler's avatar
Bill Wohler committed
362 363 364 365
This option has no effect if variable `mh-alias-local-users' is turned off."
  :type '(choice (const :tag "Use Login" nil)
                 (string))
  :group 'mh-alias)
Bill Wohler's avatar
Bill Wohler committed
366

Bill Wohler's avatar
Bill Wohler committed
367 368 369 370 371 372 373 374 375
(defcustom mh-alias-passwd-gecos-comma-separator-flag t
  "*Non-nil means the gecos field in the password file uses a comma separator.
In the example in `mh-alias-local-users-prefix', commas are used to separate
different values within the so-called gecos field. This is a fairly common
usage. However, in the rare case that the gecos field in your password file is
not separated by commas and whose contents may contain commas, you can turn
this option off."
  :type 'boolean
  :group 'mh-alias)
Bill Wohler's avatar
Bill Wohler committed
376

Bill Wohler's avatar
Bill Wohler committed
377

Bill Wohler's avatar
Bill Wohler committed
378

Bill Wohler's avatar
Bill Wohler committed
379
;;; Organizing Your Mail with Folders (:group 'mh-folder)
Bill Wohler's avatar
Bill Wohler committed
380

Bill Wohler's avatar
Bill Wohler committed
381 382 383 384 385 386
(defcustom mh-recenter-summary-flag nil
  "*Non-nil means to recenter the summary window.
If this option is turned on, recenter the summary window when the show window
is toggled off."
  :type 'boolean
  :group 'mh-folder)
Bill Wohler's avatar
Bill Wohler committed
387

Bill Wohler's avatar
Bill Wohler committed
388

Bill Wohler's avatar
Bill Wohler committed
389

Bill Wohler's avatar
Bill Wohler committed
390
;;; Folder Selection (:group 'mh-folder-selection)
Bill Wohler's avatar
Bill Wohler committed
391

Bill Wohler's avatar
Bill Wohler committed
392 393 394 395 396 397 398 399
(defcustom mh-default-folder-for-message-function nil
  "Function to select a default folder for refiling or `Fcc'.
The current buffer is set to the message being refiled with point at the start
of the message. This function should return the default folder as a string
with a leading `+' sign. It can also return nil so that the last folder name
is used as the default, or an empty string to suppress the default entirely."
  :type 'function
  :group 'mh-folder-selection)
Bill Wohler's avatar
Bill Wohler committed
400

Bill Wohler's avatar
Bill Wohler committed
401
(defcustom mh-default-folder-list nil
Bill Wohler's avatar
Bill Wohler committed
402 403 404 405 406 407
  "*List of addresses and folders.
The folder name associated with the first address found in this list is used
as the default for `mh-refile-msg' and similar functions. Each element in this
list contains a `Check Recipient' item. If this item is turned on, then the
address is checked against the recipient instead of the sender. This is useful
for mailing lists.
Bill Wohler's avatar
Bill Wohler committed
408

Bill Wohler's avatar
Bill Wohler committed
409 410
See `mh-prompt-for-refile-folder' and `mh-folder-from-address' for more
information."
Bill Wohler's avatar
Bill Wohler committed
411 412 413
  :type '(repeat (list (regexp :tag "Address")
                       (string :tag "Folder")
                       (boolean :tag "Check Recipient")))
Bill Wohler's avatar
Bill Wohler committed
414
  :group 'mh-folder-selection)
Bill Wohler's avatar
Bill Wohler committed
415 416 417

(defcustom mh-default-folder-must-exist-flag t
  "*Non-nil means guessed folder name must exist to be used.
Bill Wohler's avatar
Bill Wohler committed
418 419 420 421 422
If the derived folder does not exist, and this option is on, then the last
folder name used is suggested. This is useful if you get mail from various
people for whom you have an alias, but file them all in the same project
folder.

Bill Wohler's avatar
Bill Wohler committed
423 424
See `mh-prompt-for-refile-folder' and `mh-folder-from-address' for more
information."
Bill Wohler's avatar
Bill Wohler committed
425
  :type 'boolean
Bill Wohler's avatar
Bill Wohler committed
426
  :group 'mh-folder-selection)
Bill Wohler's avatar
Bill Wohler committed
427

Bill Wohler's avatar
Bill Wohler committed
428
(defcustom mh-default-folder-prefix ""
Bill Wohler's avatar
Bill Wohler committed
429 430 431
  "*Prefix used for folder names generated from aliases.
The prefix is used to prevent clutter in your mail directory.

Bill Wohler's avatar
Bill Wohler committed
432 433 434
See `mh-prompt-for-refile-folder' and `mh-folder-from-address' for more
information."
  :type 'string
Bill Wohler's avatar
Bill Wohler committed
435
  :group 'mh-folder-selection)
Bill Wohler's avatar
Bill Wohler committed
436

Bill Wohler's avatar
Bill Wohler committed
437

Bill Wohler's avatar
Bill Wohler committed
438

Bill Wohler's avatar
Bill Wohler committed
439
;;; Identities (:group 'mh-identity)
Bill Wohler's avatar
Bill Wohler committed
440

Bill Wohler's avatar
Bill Wohler committed
441 442 443
(defcustom mh-identity-list nil
  "*List of identities.

Bill Wohler's avatar
Bill Wohler committed
444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471
To customize this option, click on the `INS' button and enter a label such as
`Home' or `Work'. Then click on the `INS' button with the label `Add at least
one item below'. Then choose one of the items in the `Value Menu'.

You can specify an alternate `From:' header field using the `From Field' menu
item. You must include a valid email address. A standard format is `First Last
<login@@host.domain>'. If you use an initial with a period, then you must
quote your name as in `\"First I. Last\" <login@@host.domain>'. People usually
list the name of the company where they work using the `Organization Field'
menu item. Set any arbitrary header field and value in the `Other Field' menu
item. Unless the header field is a standard one, precede the name of your
field's label with `X-', as in `X-Fruit-of-the-Day:'. The value of
`Attribution Verb' overrides the setting of
`mh-extract-from-attribution-verb'. Set your signature with the `Signature'
menu item. You can specify the contents of `mh-signature-file-name', a file,
or a function. Specify a different key to sign or encrypt messages with the
`GPG Key ID' menu item.

You can select the identities you have added via the menu called `Identity' in
the MH-Letter buffer. You can also use \\[mh-insert-identity]. To clear the
fields and signature added by the identity, select the `None' identity.

The `Identity' menu contains two other items to save you from having to set
the identity on every message. The menu item `Set Default for Session' can be
used to set the default identity to the current identity until you exit Emacs.
The menu item `Save as Default' sets the option `mh-identity-default' to the
current identity setting. You can also customize the `mh-identity-default'
option in the usual fashion."
Bill Wohler's avatar
Bill Wohler committed
472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501
  :type '(repeat (list :tag ""
                       (string :tag "Label")
                       (repeat :tag "Add at least one item below"
                               (choice
                                (cons :tag "From Field"
                                      (const "From")
                                      (string :tag "Value"))
                                (cons :tag "Organization Field"
                                      (const "Organization")
                                      (string :tag "Value"))
                                (cons :tag "Other Field"
                                      (string :tag "Field")
                                      (string :tag "Value"))
                                (cons :tag "Attribution Verb"
                                      (const ":attribution-verb")
                                      (string :tag "Value"))
                                (cons :tag "Signature"
                                      (const :tag "Signature"
                                             ":signature")
                                      (choice
                                       (const :tag "mh-signature-file-name"
                                              nil)
                                       (file)
                                       (function)))
                                (cons :tag "GPG Key ID"
                                      (const :tag "GPG Key ID"
                                             ":pgg-default-user-id")
                                      (string :tag "Value"))))))
  :set 'mh-identity-list-set
  :group 'mh-identity)
Bill Wohler's avatar
Bill Wohler committed
502

Bill Wohler's avatar
Bill Wohler committed
503 504
(defcustom mh-auto-fields-list nil
  "List of recipients for which header lines are automatically inserted.
Bill Wohler's avatar
Bill Wohler committed
505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536

This option can be used to set the identity depending on the recipient. To
customize this option, click on the `INS' button and enter a regular
expression for the recipient's address. Click on the `INS' button with the
`Add at least one item below' label. Then choose one of the items in the
`Value Menu'.

The `Identity' menu item is used to select an identity from those configured
in `mh-identity-list'. All of the information for that identity will be added
if the recipient matches. The `Fcc Field' menu item is used to select a folder
that is used in the `Fcc:' header. When you send the message, MH will put a
copy of your message in this folder. The `Mail-Followup-To Field' menu item is
used to insert an `Mail-Followup-To:' header field with the recipients you
provide. If the recipient's mail user agent supports this header field (as nmh
does), then their replies will go to the addresses listed. This is useful if
their replies go both to the list and to you and you don't have a mechanism to
suppress duplicates. If you reply to someone not on the list, you must either
remove the `Mail-Followup-To:' field, or ensure the recipient is also listed
there so that he receives replies to your reply. Other header fields may be
added using the `Other Field' menu item.

These fields can only be added after the recipient is known. Once the header
contains one or more recipients, run the \\[mh-insert-auto-fields] command or
choose the `Identity -> Insert Auto Fields' menu item to insert these fields
manually. However, you can just send the message and the fields will be added
automatically. You are given a chance to see these fields and to confirm them
before the message is actually sent. You can do away with this confirmation by
turning off the option `mh-auto-fields-prompt-flag'.

You should avoid using the same header field in `mh-auto-fields-list' and
`mh-identity-list' definitions that may apply to the same message as the
result is undefined."
Bill Wohler's avatar
Bill Wohler committed
537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558
  :type `(repeat
          (list :tag ""
                (string :tag "Recipient")
                (repeat :tag "Add at least one item below"
                        (choice
                         (cons :tag "Identity"
                               (const ":identity")
                               ,(append
                                 '(radio)
                                 (mapcar
                                  (function (lambda (arg) `(const ,arg)))
                                  (mapcar 'car mh-identity-list))))
                         (cons :tag "Fcc Field"
                               (const "fcc")
                               (string :tag "Value"))
                         (cons :tag "Mail-Followup-To Field"
                               (const "Mail-Followup-To")
                               (string :tag "Value"))
                         (cons :tag "Other Field"
                                 (string :tag "Field")
                                 (string :tag "Value"))))))
  :group 'mh-identity)
Bill Wohler's avatar
Bill Wohler committed
559

Bill Wohler's avatar
Bill Wohler committed
560 561 562
(defcustom mh-auto-fields-prompt-flag t
  "*Non-nil means to prompt before sending if fields inserted.
See `mh-auto-fields-list'."
Bill Wohler's avatar
Bill Wohler committed
563
  :type 'boolean
Bill Wohler's avatar
Bill Wohler committed
564
  :group 'mh-identity)
Bill Wohler's avatar
Bill Wohler committed
565

Bill Wohler's avatar
Bill Wohler committed
566
(defcustom mh-identity-default nil
Bill Wohler's avatar
Bill Wohler committed
567 568
  "Default identity to use when `mh-letter-mode' is called.
See `mh-identity-list'."
Bill Wohler's avatar
Bill Wohler committed
569 570 571 572 573 574
  :type (append
         '(radio)
         (cons '(const :tag "None" nil)
               (mapcar (function (lambda (arg) `(const ,arg)))
                       (mapcar 'car mh-identity-list))))
  :group 'mh-identity)
Bill Wohler's avatar
Bill Wohler committed
575

Bill Wohler's avatar
Bill Wohler committed
576
(defcustom mh-identity-handlers
Bill Wohler's avatar
Bill Wohler committed
577 578
  '(("From" . mh-identity-handler-top)
    (":default" . mh-identity-handler-bottom)
Bill Wohler's avatar
Bill Wohler committed
579 580 581 582
    (":attribution-verb" . mh-identity-handler-attribution-verb)
    (":signature" . mh-identity-handler-signature)
    (":pgg-default-user-id" . mh-identity-handler-gpg-identity))
  "Handler functions for fields in `mh-identity-list'.
Bill Wohler's avatar
Bill Wohler committed
583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602

This option is used to change the way that fields, signatures, and
attributions in `mh-identity-list' are added. To customize
`mh-identity-handlers', replace the name of an existing handler function
associated with the field you want to change with the name of a function you
have written. You can also click on an `INS' button and insert a field of your
choice and the name of the function you have written to handle it.

The `Field' field can be any field that you've used in your
`mh-identity-list'. The special fields `:attribution-verb', `:signature', or
`:pgg-default-user-id' are used for the `mh-identity-list' choices
`Attribution Verb', `Signature', and `GPG Key ID' respectively.

The handler associated with the `:default' field is used when no other field
matches.

The handler functions are passed two or three arguments: the FIELD itself (for
example, `From'), or one of the special fields (for example, `:signature'),
and the ACTION `'remove' or `'add'. If the action is `'add', an additional
argument containing the VALUE for the field is given."
Bill Wohler's avatar
Bill Wohler committed
603 604
  :type '(repeat (cons (string :tag "Field") function))
  :group 'mh-identity)
Bill Wohler's avatar
Bill Wohler committed
605

Bill Wohler's avatar
Bill Wohler committed
606

Bill Wohler's avatar
Bill Wohler committed
607

Bill Wohler's avatar
Bill Wohler committed
608
;;; Incorporating Your Mail (:group 'mh-inc)
Bill Wohler's avatar
Bill Wohler committed
609

Bill Wohler's avatar
Bill Wohler committed
610
(defcustom mh-inc-prog "inc"
Bill Wohler's avatar
Bill Wohler committed
611 612 613 614 615 616
  "*Program to incorporate new mail into a folder.

This program generates a one-line summary for each of the new messages. Unless
it is an absolute pathname, the file is assumed to be in the `mh-progs'
directory. You may also link a file to `inc' that uses a different format.
You'll then need to modify several scan line format variables appropriately."
Bill Wohler's avatar
Bill Wohler committed
617 618
  :type 'string
  :group 'mh-inc)
Bill Wohler's avatar
Bill Wohler committed
619

Bill Wohler's avatar
Bill Wohler committed
620
(defcustom mh-inc-spool-list nil
Bill Wohler's avatar
Bill Wohler committed
621 622 623 624 625
  "*Alternate spool files.

You can use the `mh-inc-spool-list' variable to direct MH-E to retrieve mail
from arbitrary spool files other than your system mailbox, file it in folders
other than your `+inbox', and assign key bindings to incorporate this mail.
Bill Wohler's avatar
Bill Wohler committed
626

Bill Wohler's avatar
Bill Wohler committed
627 628 629
Suppose you are subscribed to the `mh-e-devel' mailing list and you use
`procmail' to filter this mail into `~/mail/mh-e' with the following recipe in
`.procmailrc':
Bill Wohler's avatar
Bill Wohler committed
630 631 632

    MAILDIR=$HOME/mail
    :0:
Bill Wohler's avatar
Bill Wohler committed
633
    * ^From mh-e-devel-admin@stop.mail-abuse.org
Bill Wohler's avatar
Bill Wohler committed
634 635
    mh-e

Bill Wohler's avatar
Bill Wohler committed
636 637 638 639
In order to incorporate `~/mail/mh-e' into `+mh-e' with an `I m'
\(`mh-inc-spool-mh-e'\) command, customize this option, and click on the `INS'
button. Enter a `Spool File' of `~/mail/mh-e', a `Folder' of `mh-e', and a
`Key Binding' of `m'.
Bill Wohler's avatar
Bill Wohler committed
640

Bill Wohler's avatar
Bill Wohler committed
641 642
You can use `xbuffy' to automate the incorporation of this mail using the
`gnudoit' command in the `gnuserv' package as follows:
Bill Wohler's avatar
Bill Wohler committed
643 644 645 646 647 648

    box ~/mail/mh-e
        title mh-e
        origMode
        polltime 10
        headertime 0
Bill Wohler's avatar
Bill Wohler committed
649
        command gnudoit -q '(mh-inc-spool-mh-e)'"
Bill Wohler's avatar
Bill Wohler committed
650 651 652 653 654
  :type '(repeat (list (file :tag "Spool File")
                       (string :tag "Folder")
                       (character :tag "Key Binding")))
  :set 'mh-inc-spool-list-set
  :group 'mh-inc)
Bill Wohler's avatar
Bill Wohler committed
655

Bill Wohler's avatar
Bill Wohler committed
656 657


Bill Wohler's avatar
Bill Wohler committed
658
;;; Searching (:group 'mh-index)
Bill Wohler's avatar
Bill Wohler committed
659 660

(defcustom mh-index-new-messages-folders t
Bill Wohler's avatar
Bill Wohler committed
661 662
  "Folders searched for the \"unseen\" sequence.
Set this option to \"Inbox\" to search the \"+inbox\" folder or \"All\" to
Bill Wohler's avatar
Bill Wohler committed
663
search all of the top level folders. Otherwise, list the folders that should
Bill Wohler's avatar
Bill Wohler committed
664
be searched with the \"Choose Folders\" menu item.
Bill Wohler's avatar
Bill Wohler committed
665

Bill Wohler's avatar
Bill Wohler committed
666 667 668 669
See also `mh-recursive-folders-flag'."
  :group 'mh-index
  :type '(choice (const :tag "Inbox" t)
                 (const :tag "All" nil)
Bill Wohler's avatar
Bill Wohler committed
670
                 (repeat :tag "Choose Folders" (string :tag "Folder"))))
Bill Wohler's avatar
Bill Wohler committed
671 672 673

(defcustom mh-index-program nil
  "Indexing program that MH-E shall use.
Bill Wohler's avatar
Bill Wohler committed
674 675 676 677
The default setting of this option is `Auto-detect' which means that MH-E will
automatically choose one of swish++, swish-e, mairix, namazu, pick and grep in
that order. If, for example, you have both swish++ and mairix installed and
you want to use mairix, then you can set this option to `mairix'.
Bill Wohler's avatar
Bill Wohler committed
678 679 680 681 682 683 684 685 686 687 688 689

More information about setting up an indexing program to use with MH-E can be
found in the documentation of `mh-index-search'."
  :type '(choice (const :tag "Auto-detect" nil)
                 (const :tag "swish++" swish++)
                 (const :tag "swish-e" swish)
                 (const :tag "mairix" mairix)
                 (const :tag "namazu" namazu)
                 (const :tag "pick" pick)
                 (const :tag "grep" grep))
  :group 'mh-index)

Bill Wohler's avatar
Bill Wohler committed
690 691
(defcustom mh-index-ticked-messages-folders t
  "Folders searched for `mh-tick-seq'.
Bill Wohler's avatar
Bill Wohler committed
692
Set this option to \"Inbox\" to search the \"+inbox\" folder or \"All\" to
Bill Wohler's avatar
Bill Wohler committed
693
search all of the top level folders. Otherwise, list the folders that should
Bill Wohler's avatar
Bill Wohler committed
694
be searched with the \"Choose Folders\" menu item.
Bill Wohler's avatar
Bill Wohler committed
695

Bill Wohler's avatar
Bill Wohler committed
696 697 698 699
See also `mh-recursive-folders-flag'."
  :group 'mh-index
  :type '(choice (const :tag "Inbox" t)
                 (const :tag "All" nil)
Bill Wohler's avatar
Bill Wohler committed
700
                 (repeat :tag "Choose Folders" (string :tag "Folder"))))
Bill Wohler's avatar
Bill Wohler committed
701

Bill Wohler's avatar
Bill Wohler committed
702 703


Bill Wohler's avatar
Bill Wohler committed
704
;;; Dealing with Junk Mail (:group 'mh-junk)
Bill Wohler's avatar
Bill Wohler committed
705 706 707 708 709 710

;; Spam fighting program chosen
(defvar mh-junk-choice nil)

;; Available spam filter interfaces
(defvar mh-junk-function-alist
Bill Wohler's avatar
Bill Wohler committed
711 712 713
  '((spamassassin mh-spamassassin-blacklist mh-spamassassin-whitelist)
    (bogofilter mh-bogofilter-blacklist mh-bogofilter-whitelist)
    (spamprobe mh-spamprobe-blacklist mh-spamprobe-whitelist))
Bill Wohler's avatar
Bill Wohler committed
714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730
  "Available choices of spam programs to use.
This is an alist. For each element there are functions that blacklist a message
as spam and whitelist a message incorrectly classified as spam.")

(defun mh-junk-choose (symbol value)
  "Choose spam program to use.
The function is always called with SYMBOL bound to `mh-junk-program' and VALUE
bound to the new value of `mh-junk-program'. The function sets the variable
`mh-junk-choice' in addition to `mh-junk-program'."
  (set symbol value)
  (setq mh-junk-choice
        (or value
            (loop for element in mh-junk-function-alist
                  until (executable-find (symbol-name (car element)))
                  finally return (car element)))))

;; User customizable variables
Bill Wohler's avatar
Bill Wohler committed
731 732 733 734 735 736 737 738 739
(defcustom mh-junk-background nil
  "If on, spam programs are run in background.
By default, the programs are run in the foreground, but this can be slow when
junking large numbers of messages. If you have enough memory or don't junk
that many messages at the same time, you might try turning on this option."
  :type '(choice (const :tag "Off" nil)
                 (const :tag "On" 0))
  :group 'mh-junk)

Bill Wohler's avatar
Bill Wohler committed
740 741 742 743 744 745 746 747
(defcustom mh-junk-disposition nil
  "Disposition of junk mail."
  :type '(choice (const :tag "Delete Spam" nil)
                 (string :tag "Spam Folder"))
  :group 'mh-junk)

(defcustom mh-junk-program nil
  "Spam program that MH-E should use.
Bill Wohler's avatar
Bill Wohler committed
748 749 750 751 752 753

The default setting of this option is \"Auto-detect\" which means that MH-E
will automatically choose one of SpamAssassin, Bogofilter, or SpamProbe in
that order. If, for example, you have both SpamAssassin and Bogofilter
installed and you want to use BogoFilter, then you can set this option to
\"Bogofilter\"."
Bill Wohler's avatar
Bill Wohler committed
754 755 756 757 758
  :type '(choice (const :tag "Auto-detect" nil)
                 (const :tag "SpamAssassin" spamassassin)
                 (const :tag "Bogofilter" bogofilter)
                 (const :tag "SpamProbe" spamprobe))
  :set 'mh-junk-choose
Bill Wohler's avatar
Bill Wohler committed
759 760
  :group 'mh-junk)

Bill Wohler's avatar
Bill Wohler committed
761 762 763 764


;;; Editing a Draft (:group 'mh-letter)

765 766 767 768 769 770 771 772 773
(defcustom mh-compose-insertion (if (locate-library "mml") 'mml 'mh)
  "Type of tags used when composing MIME messages. In addition to MH-style
directives, MH-E also supports MML (MIME Meta Language) tags. (see Info node
`(emacs-mime)Composing'). This option can be used to choose between them. By
default, this option is set to \"MML\" if it is supported since it provides a
lot more functionality. This option can also be set to \"MH\" if MH-style
directives are preferred."
  :type '(choice (const :tag "MML" mml)
                 (const :tag "MH"  mh))
Bill Wohler's avatar
Bill Wohler committed
774 775 776 777 778 779 780 781 782 783
  :group 'mh-letter)

(defcustom mh-compose-skipped-header-fields
  '("From" "Organization" "References" "In-Reply-To"
    "X-Face" "Face" "X-Image-URL" "X-Mailer")
  "List of header fields to skip over when navigating in draft."
  :type '(repeat (string :tag "Field"))
  :group 'mh-letter)

(defcustom mh-compose-space-does-completion-flag nil
784
  "*On means \\<mh-letter-mode-map>\\[mh-letter-complete-or-space] does completion in message header."
Bill Wohler's avatar
Bill Wohler committed
785 786 787 788
  :type 'boolean
  :group 'mh-letter)

(defcustom mh-delete-yanked-msg-window-flag nil
789 790 791 792
  "*On means delete any window displaying the message.
This deletes the window containing the original message after yanking it with
\\<mh-letter-mode-map>\\[mh-yank-cur-msg] to make more room on your screen for
your reply."
Bill Wohler's avatar
Bill Wohler committed
793 794 795 796
  :type 'boolean
  :group 'mh-letter)

(defcustom mh-extract-from-attribution-verb "wrote:"
797 798 799 800 801
  "*Verb to use for attribution when a message is yanked by \\<mh-letter-mode-map>\\[mh-yank-cur-msg].
The attribution consists of the sender's name and email address followed by
the content of this option. This option can be set to \"wrote:\", \"a
écrit:\", and \"schrieb:\". You can also use the \"Custom String\" menu item
to enter your own verb."
Bill Wohler's avatar
Bill Wohler committed
802 803 804 805 806 807 808
  :type '(choice (const "wrote:")
                 (const "a écrit:")
                 (const "schrieb:")
                 (string :tag "Custom String"))
  :group 'mh-letter)

(defcustom mh-ins-buf-prefix "> "
809 810 811 812 813
  "*String to put before each line of a yanked or inserted message.
The prefix \"> \" is the default setting of this option. I suggest that you
not modify this option since it is used by many mailers and news readers:
messages are far easier to read if several included messages have all been
indented by the same string."
Bill Wohler's avatar
Bill Wohler committed
814 815 816 817 818
  :type 'string
  :group 'mh-letter)

(defcustom mh-letter-complete-function 'ispell-complete-word
  "*Function to call when completing outside of address or folder fields.
819 820
In the body of the message, \\<mh-letter-mode-map>\\[mh-letter-complete] runs
this function, which is set to \"ispell-complete-word\" by default."
Bill Wohler's avatar
Bill Wohler committed
821 822 823 824
  :type '(choice function (const nil))
  :group 'mh-letter)

(defcustom mh-letter-fill-column 72
825 826 827
  "*Fill column to use in MH Letter mode.
By default, this option is 72 to allow others to quote your message without
line wrapping."
Bill Wohler's avatar
Bill Wohler committed
828 829 830
  :type 'integer
  :group 'mh-letter)

831 832 833 834 835 836 837 838 839 840 841 842 843
(defcustom mh-mml-method-default (if mh-pgp-support-flag "pgpmime" "none")
  "Default method to use in security tags.
This option is used to select between a variety of mail security mechanisms.
The default is \"PGP (MIME)\" if it is supported\; otherwise, the default is
\"None\". Other mechanisms include vanilla \"PGP\" and \"S/MIME\".

The `pgg' customization group may have some settings which may interest you
\(see Info node `(pgg)').

In particular, I set the option `pgg-encrypt-for-me' to t so that all messages
I encrypt are encrypted with my public key as well. If you keep a copy of all
of your outgoing mail with a \"Fcc:\" header field, this setting is vital so
that you can read the mail you write!"
Bill Wohler's avatar
Bill Wohler committed
844 845 846 847
  :type '(choice (const :tag "PGP (MIME)" "pgpmime")
                 (const :tag "PGP" "pgp")
                 (const :tag "S/MIME" "smime")
                 (const :tag "None" "none"))
Bill Wohler's avatar
Bill Wohler committed
848 849 850 851 852
  :group 'mh-letter)

(defcustom mh-signature-file-name "~/.signature"
  "*Source of user's signature.

853
By default, the text of your signature is taken from the file \"~/.signature\".
Bill Wohler's avatar
Bill Wohler committed
854 855 856 857 858
You can read from other files by changing this option. This file may contain a
vCard in which case an attachment is added with the vCard.

This option may also be a symbol, in which case that function is called. You
may not want a signature separator to be added for you; instead you may want
859
to insert one yourself. Options that you may find useful to do this include
Bill Wohler's avatar
Bill Wohler committed
860 861 862 863 864 865 866 867 868 869 870 871
`mh-signature-separator' (when inserting a signature separator) and
`mh-signature-separator-regexp' (for finding said separator). The function
`mh-signature-separator-p', which reports t if the buffer contains a
separator, may be useful as well.

The signature is inserted into your message with the command
\\<mh-letter-mode-map>\\[mh-insert-signature] or with the `mh-identity-list'
option."
  :type 'file
  :group 'mh-letter)

(defcustom mh-signature-separator-flag t
872
  "*On means a signature separator should be inserted.
Bill Wohler's avatar
Bill Wohler committed
873 874 875 876 877 878 879 880 881 882
It is not recommended that you change this option since various mail user
agents, including MH-E, use the separator to present the signature
differently, and to suppress the signature when replying or yanking a letter
into a draft."
  :type 'boolean
  :group 'mh-letter)

(defcustom mh-x-face-file "~/.face"
  "*File containing face header field to insert in outgoing mail.

883 884 885
If the file starts with either of the strings \"X-Face:\", \"Face:\" or
\"X-Image-URL:\" then the contents are added to the message header verbatim.
Otherwise it is assumed that the file contains the value of the \"X-Face:\"
Bill Wohler's avatar
Bill Wohler committed
886 887
header field.

888 889 890 891 892
The \"X-Face:\" header field, which is a low-resolution, black and white
image, can be generated using the \"compface\"
(ftp://ftp.cs.indiana.edu/pub/faces/compface/compface.tar.Z) command. The
\"Online X-Face Converter\" (http://www.dairiki.org/xface/) is a useful
resource for quick conversion of images into \"X-Face:\" header fields.
Bill Wohler's avatar
Bill Wohler committed
893

894 895
Use the \"make-face\" (http://quimby.gnus.org/circus/face/make-face) script to
convert a JPEG image to the higher resolution, color, \"Face:\" header field.
Bill Wohler's avatar
Bill Wohler committed
896

897
The URL of any image can be used for the \"X-Image-URL:\" field and no
Bill Wohler's avatar
Bill Wohler committed
898 899 900 901 902 903 904 905
processing of the image is required.

To prevent the setting of any of these header fields, either set
`mh-x-face-file' to nil, or simply ensure that the file defined by this option
doesn't exist."
  :type 'file
  :group 'mh-letter)

906
(defcustom mh-yank-behavior 'attribution
Bill Wohler's avatar
Bill Wohler committed
907 908
  "*Controls which part of a message is yanked by \\<mh-letter-mode-map>\\[mh-yank-cur-msg].

909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933
To include the entire message, including the entire header, use \"Body and
Header\". Use \"Body\" to yank just the body without the header. To yank only
the portion of the message following the point, set this option to \"Below
Point\".

Choose \"Invoke supercite\" to pass the entire message and header through
supercite.

If the \"Body With Attribution\" setting is used, then the message minus the
header is yanked and a simple attribution line is added at the top using the
value of the `mh-extract-from-attribution-verb' option. This is the default.

If the \"Invoke supercite\" or \"Body With Attribution\" settings are used,
the \"-noformat\" argument is passed to the \"repl\" program to override a
\"-filter\" or \"-format\" argument. These settings also have
\"Automatically\" variants that perform the action automatically when you
reply so that you don't need to use \\[mh-yank-cur-msg] at all. Note that this
automatic action is only performed if the show buffer matches the message
being replied to. People who use the automatic variants tend to turn on the
`mh-delete-yanked-msg-window-flag' option as well so that the show window is
never displayed.

If the show buffer has a region, the `mh-yank-behavior' option is ignored
unless its value is one of Attribution variants in which case the attribution
is added to the yanked region."
Bill Wohler's avatar
Bill Wohler committed
934 935 936
  :type '(choice (const :tag "Body and Header" t)
                 (const :tag "Body" body)
                 (const :tag "Below Point" nil)
Bill Wohler's avatar
Bill Wohler committed
937
                 (const :tag "Invoke supercite" supercite)
Bill Wohler's avatar
Bill Wohler committed
938 939 940 941
                 (const :tag "Invoke supercite, Automatically" autosupercite)
                 (const :tag "Body With Attribution" attribution)
                 (const :tag "Body With Attribution, Automatically"
                        autoattrib))
Bill Wohler's avatar
Bill Wohler committed
942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999
  :group 'mh-letter)



;;; Ranges (:group 'mh-ranges)

(defcustom mh-interpret-number-as-range-flag t
  "Non-nil means interpret a number as a range.
If the variable is non-nil, and you use an integer, N, when asked for a
range to scan, then MH-E uses the range \"last:N\"."
  :type 'boolean
  :group 'mh-ranges)



;;; Scan Line Formats (:group 'mh-scan-line-formats)

(defcustom mh-adaptive-cmd-note-flag t
  "*Non-nil means that the message number width is determined dynamically.
This is done once when a folder is first opened by running scan on the last
message of the folder. The message number for the last message is extracted
and its width calculated. This width is used when calling `mh-set-cmd-note'.

If you prefer fixed-width message numbers, set this variable to nil and call
`mh-set-cmd-note' with the width specified by the scan format in
`mh-scan-format-file'. For example, the default width is 4, so you would use
\"(mh-set-cmd-note 4)\" if `mh-scan-format-file' were nil."
  :type 'boolean
  :group 'mh-scan-line-formats)

(defcustom mh-scan-format-file t
  "Specifies the format file to pass to the scan program.
If t, the format string will be taken from the either `mh-scan-format-mh'
or `mh-scan-format-nmh' depending on whether MH or nmh is in use.
If nil, the default scan output will be used.

If you customize the scan format, you may need to modify a few variables
containing regexps that MH-E uses to identify specific portions of the output.
Use `M-x apropos RET mh-scan.*regexp' to obtain a list of these variables. You
may also have to call `mh-set-cmd-note' with the width of your message
numbers. See also `mh-adaptive-cmd-note-flag'."
  :type '(choice (const :tag "Use MH-E scan Format" t)
                 (const :tag "Use Default scan Format" nil)
                 (file  :tag "Specify a scan Format File"))
  :group 'mh-scan-line-formats)

(defcustom mh-scan-prog "scan"
  "*Program to run to generate one-line-per-message listing of a folder.
Normally \"scan\" or a file name linked to scan.  This file is searched
for relative to the `mh-progs' directory unless it is an absolute pathname."
  :type 'string
  :group 'mh-scan-line-formats)
(make-variable-buffer-local 'mh-scan-prog)



;;; Sending Mail (:group 'mh-sending-mail)

Bill Wohler's avatar
Bill Wohler committed
1000 1001 1002 1003 1004
(defcustom mh-compose-forward-as-mime-flag t
  "Non-nil means that messages are forwarded as a MIME part."
  :type 'boolean
  :group 'mh-sending-mail)

Bill Wohler's avatar
Bill Wohler committed
1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022
(defcustom mh-compose-letter-function nil
  "Invoked when setting up a letter draft.
It is passed three arguments: TO recipients, SUBJECT, and CC recipients."
  :type '(choice (const nil) function)
  :group 'mh-sending-mail)

(defcustom mh-compose-prompt-flag nil
  "*Non-nil means prompt for header fields when composing a new draft."
  :type 'boolean
  :group 'mh-sending-mail)

(defcustom mh-forward-subject-format "%s: %s"
  "*Format to generate the Subject: line contents for a forwarded message.
The two string arguments to the format are the sender of the original
message and the original subject line."
  :type 'string
  :group 'mh-sending-mail)

Bill Wohler's avatar
Bill Wohler committed
1023 1024 1025 1026 1027
(defcustom mh-insert-x-mailer-flag t
  "*Non-nil means append an X-Mailer field to the header."
  :type 'boolean
  :group 'mh-sending-mail)

Bill Wohler's avatar
Bill Wohler committed
1028 1029 1030 1031 1032 1033 1034 1035 1036 1037
(defcustom mh-reply-default-reply-to nil
  "*Sets the person or persons to whom a reply will be sent.
If nil, prompt for recipient.  If non-nil, then \\<mh-folder-mode-map>`\\[mh-reply]' will use this
value and it should be one of \"from\", \"to\", \"cc\", or \"all\".
The values \"cc\" and \"all\" do the same thing."
  :type '(choice (const :tag "Prompt" nil)
                 (const "from") (const "to")
                 (const "cc") (const "all"))
  :group 'mh-sending-mail)

Bill Wohler's avatar
Bill Wohler committed
1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049
(defcustom mh-reply-show-message-flag t
  "*Non-nil means the show buffer is displayed using \\<mh-letter-mode-map>\\[mh-reply].

The setting of this variable determines whether the MH `show-buffer' is
displayed with the current message when using `mh-reply' without a prefix
argument.  Set it to nil if you already include the message automatically
in your draft using
 repl: -filter repl.filter
in your ~/.mh_profile file."
  :type 'boolean
  :group 'mh-sending-mail)

Bill Wohler's avatar
Bill Wohler committed
1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084


;;; Sequences (:group 'mh-sequences)

;;; If `mh-unpropagated-sequences' becomes a defcustom, add the following to
;;; the docstring: "Additional sequences that should not to be preserved can be
;;; specified by setting `mh-unpropagated-sequences' appropriately." XXX

(defcustom mh-refile-preserves-sequences-flag t
  "*Non-nil means that sequences are preserved when messages are refiled.
If this variable is non-nil and a message belonging to a sequence other than
cur or Previous-Sequence (see mh-profile 5) is refiled then it is put in the
same sequence in the destination folder."
  :type 'boolean
  :group 'mh-sequences)

(defcustom mh-tick-seq 'tick
  "The name of the MH sequence for ticked messages.
You would change this option if you already use the `tick' sequence for your
own use. You can also disable all of the ticking functions by choosing the
`Disable Ticking' item but there isn't much advantage to that."
  :type '(choice (const :tag "Disable Ticking" nil)
                 symbol)
  :group 'mh-sequences)

(defcustom mh-update-sequences-after-mh-show-flag t
  "*Non-nil means flush MH sequences to disk after message is shown.
Three sequences are maintained internally by MH-E and pushed out to MH when a
message is shown. They include the sequence specified by your
`Unseen-Sequence:' profile entry, `cur', and the sequence listed by
the `mh-tick-seq' option which is `tick' by default.
If you do not like this behavior, set this option to nil. You can then update
the state manually with the \\<mh-folder-mode-map>`\\[mh-execute-commands]', `\\[mh-quit]', or `\\[mh-update-sequences]' commands."
  :type 'boolean
  :group 'mh-sequences)
Bill Wohler's avatar
Bill Wohler committed
1085 1086 1087



Bill Wohler's avatar
Bill Wohler committed
1088
;;; Reading Your Mail (:group 'mh-show)
Bill Wohler's avatar
Bill Wohler committed
1089 1090 1091 1092 1093 1094 1095

(defcustom mh-bury-show-buffer-flag t
  "*Non-nil means that the displayed show buffer for a folder is buried."
  :type 'boolean
  :group 'mh-show)

(defcustom mh-clean-message-header-flag t
Bill Wohler's avatar
Bill Wohler committed
1096 1097 1098 1099 1100
  "*Non-nil means remove extraneous header fields.
The header fields listed in the `mh-invisible-header-fields-default' option
are hidden, although you can check off any field that you would like to see.
Header fields that you would like to hide that aren't listed can be added to
the `mh-invisible-header-fields' option."
Bill Wohler's avatar
Bill Wohler committed
1101 1102 1103 1104 1105 1106 1107 1108
  :type 'boolean
  :group 'mh-show)

(defcustom mh-decode-mime-flag (not (not (locate-library "mm-decode")))
  "*Non-nil means that Gnus is used to show MIME attachments with Gnus."
  :type 'boolean
  :group 'mh-show)

Bill Wohler's avatar
Bill Wohler committed
1109 1110 1111 1112 1113 1114 1115 1116
(defcustom mh-display-buttons-for-alternatives-flag nil
  "*Non-nil means display buttons for all MIME alternatives.
Default behavior is to display only the preferred alternative. If this
variable is non-nil, then the preferred part is shown inline and buttons
are shown for each of the other alternatives."
  :type 'boolean
  :group 'mh-show)

Bill Wohler's avatar
Bill Wohler committed
1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133
(defcustom mh-display-buttons-for-inline-parts-flag nil
  "*Non-nil means display buttons for all inline MIME parts.
If non-nil, buttons are displayed for all MIME parts. Inline parts start off
in displayed state but they can be hidden by clicking the button. If nil no
buttons are shown for inline parts."
  :type 'boolean
  :group 'mh-show)

(defcustom mh-do-not-confirm-flag nil
  "*Non-nil means do not prompt for confirmation.
Commands such as `mh-pack-folder' prompt to confirm whether to process
outstanding moves and deletes or not before continuing. A non-nil setting will
perform the action--which is usually desired but cannot be retracted--without
question."
  :type 'boolean
  :group 'mh-show)

Bill Wohler's avatar
Bill Wohler committed
1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145
(defcustom mh-fetch-x-image-url 'ask
  "*Control fetching of `X-Image-URL:' header field image.
If set to \"Always fetch\" (t), the image is always fetched. You probably want
to avoid this setting for privacy and DOS (denial of service) reasons. For
example, fetching a URL can tip off a spammer that you've read his email.
Someone may also flood your network and fill your disk drive by sending a
torrent of messages, each specifying a unique URL to a very large file.

If set to \"Ask before fetching\" ('ask), you are prompted before the image is
fetched. MH-E will remember your reply and will either use the already fetched
image the next time the same URL is encountered or silently skip it if you
didn't fetch it the first time. This is the default.
Bill Wohler's avatar
Bill Wohler committed
1146

Bill Wohler's avatar
Bill Wohler committed
1147 1148
If set to \"Never fetch\" (nil), images are never fetched and only displayed
if they are already present in the cache.
Bill Wohler's avatar
Bill Wohler committed
1149

Bill Wohler's avatar
Bill Wohler committed
1150 1151 1152 1153 1154
The cache of images is found in the directory `.mhe-x-image-cache' within your
MH directory. To see how you can add your own face to the `From:' field, see
`mh-x-face-file'.

This setting only has effect if `mh-show-use-xface-flag' is non-nil."
Bill Wohler's avatar
Bill Wohler committed
1155 1156 1157 1158 1159 1160

  :type '(choice (const :tag "Always fetch" t)
                 (const :tag "Ask before fetching" ask)
                 (const :tag "Never fetch" nil))
  :group 'mh-show)

Bill Wohler's avatar
Bill Wohler committed
1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179
(defcustom mh-graphical-smileys-flag t
  "*Non-nil means graphical smileys are displayed.
Non-nil means that small graphics will be used in the show buffer instead of
patterns like :-), ;-) etc. The setting only has effect if
`mh-decode-mime-flag' is non-nil."
  :type 'boolean
  :group 'mh-show)

(defcustom mh-graphical-emphasis-flag t
  "*Non-nil means graphical emphasis is displayed.
Non-nil means that _underline_ will be underlined, *bold* will appear in bold,
/italic/ will appear in italic etc. See `gnus-emphasis-alist' for the whole
list. The setting only has effect if `mh-decode-mime-flag' is non-nil."
  :type 'boolean
  :group 'mh-show)

(defcustom mh-highlight-citation-p 'gnus
  "How to highlight citations in show buffers.
The gnus method uses a different color for each indentation."
Bill Wohler's avatar
Bill Wohler committed
1180
  :type '(choice (const :tag "Use Gnus" gnus)
Bill Wohler's avatar
Bill Wohler committed
1181 1182 1183 1184
                 (const :tag "Use font-lock" font-lock)
                 (const :tag "Don't fontify" nil))
  :group 'mh-show)

Bill Wohler's avatar
Bill Wohler committed
1185
;; Keep fields alphabetized. Mention source, if known.
Bill Wohler's avatar
Bill Wohler committed
1186
(defvar mh-invisible-header-fields-internal
Bill Wohler's avatar
Bill Wohler committed
1187 1188 1189 1190 1191 1192 1193 1194
  '("Approved:"
    "Autoforwarded:"
    "Bestservhost:"
    "Cancel-Lock:"                      ; NNTP posts
    "Content-"                          ; RFC 2045
    "Delivered-To:"              ; Egroups/yahoogroups mailing list manager
    "Delivery-Date:"                    ; MH
    "Delivery:"
Bill Wohler's avatar
Bill Wohler committed
1195
    "DomainKey-Signature:"              ;http://antispam.yahoo.com/domainkeys
Bill Wohler's avatar
Bill Wohler committed
1196
    "Encoding:"
Bill Wohler's avatar
Bill Wohler committed
1197
    "Envelope-to:"
Bill Wohler's avatar
Bill Wohler committed
1198 1199 1200 1201 1202 1203 1204 1205