diff lisp/mh-e/mh-customize.el @ 90261:7beb78bc1f8e

Revision: miles@gnu.org--gnu-2005/emacs--unicode--0--patch-97 Merge from emacs--cvs-trunk--0 Patches applied: * emacs--cvs-trunk--0 (patch 616-696) - Add lisp/mh-e/.arch-inventory - Update from CVS - Merge from gnus--rel--5.10 - Update from CVS: lisp/smerge-mode.el: Add 'tools' to file keywords. - lisp/gnus/ChangeLog: Remove duplicate entry * gnus--rel--5.10 (patch 147-181) - Update from CVS - Merge from emacs--cvs-trunk--0 - Update from CVS: lisp/mml.el (mml-preview): Doc fix. - Update from CVS: texi/message.texi: Fix default values. - Update from CVS: texi/gnus.texi (RSS): Addition.
author Miles Bader <miles@gnu.org>
date Mon, 16 Jan 2006 08:37:27 +0000
parents 0ca0d9181b5e 5012e59a73c7
children
line wrap: on
line diff
--- a/lisp/mh-e/mh-customize.el	Mon Jan 16 06:59:21 2006 +0000
+++ b/lisp/mh-e/mh-customize.el	Mon Jan 16 08:37:27 2006 +0000
@@ -1,6 +1,6 @@
 ;;; mh-customize.el --- MH-E customization
 
-;; Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
+;; Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
 
 ;; Author: Bill Wohler <wohler@newt.com>
 ;; Maintainer: Bill Wohler <wohler@newt.com>
@@ -54,39 +54,42 @@
 ;;
 ;; 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.
+;;    All faces must be placed in the mh-faces group; in addition, add the
+;;    group associated with the manual node in which the face is described.
+;;    Since the mh-faces group appears near the end of this file, the faces
+;;    will appear at the end of these other groups.
 ;;
 ;;; Change Log:
 
 ;;; Code:
 
+;;(message "> mh-customize")
 (provide 'mh-customize)
 
 (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."))
-
-(when mh-xemacs-flag
-  (require 'mh-xemacs))
-
-;; 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.
+    "Non-nil means the current Emacs is XEmacs.")
+  (when mh-xemacs-flag
+    (require 'mh-xemacs)))
+
+(eval-and-compile
+  (require 'mh-identity)
+  (require 'mh-init)
+  (require 'mh-loaddefs))
+;;(message "< mh-customize")
+
+;; For compiler warnings...
 (eval-when-compile
-  (require 'mh-init)
-  (require 'mh-identity))
+  (defvar mh-show-buffer)
+  (defvar mh-show-folder-buffer))
 
 (defun mh-customize (&optional delete-other-windows-flag)
   "Customize MH-E variables.
-If optional argument DELETE-OTHER-WINDOWS-FLAG is non-nil, other windows in
-the frame are removed."
+If optional argument DELETE-OTHER-WINDOWS-FLAG is non-nil, other
+windows in the frame are removed."
   (interactive "P")
   (customize-group 'mh-e)
   (when delete-other-windows-flag
@@ -94,17 +97,12 @@
 
 
 
-;;; For compiler warnings...
-(eval-when-compile
-  (defvar mh-show-buffer)
-  (defvar mh-show-folder-buffer))
-
 ;;; MH-E Customization Groups
 
 (defgroup mh-e nil
   "Emacs interface to the MH mail system.
-MH is the Rand Mail Handler. Other implementations include nmh and GNU
-mailutils."
+MH is the Rand Mail Handler. Other implementations include nmh
+and GNU mailutils."
   :link '(custom-manual "(mh-e)Top")
   :group 'mail)
 
@@ -117,7 +115,7 @@
 (defgroup mh-folder nil
   "Organizing your mail with folders."
   :prefix "mh-"
-  :link '(custom-manual "(mh-e)Organizing")
+  :link '(custom-manual "(mh-e)Folders")
   :group 'mh-e)
 
 (defgroup mh-folder-selection nil
@@ -138,12 +136,6 @@
   :link '(custom-manual "(mh-e)Incorporating Mail")
   :group 'mh-e)
 
-(defgroup mh-index nil
-  "Searching."
-  :link '(custom-manual "(mh-e)Searching")
-  :prefix "mh-index-"
-  :group 'mh-e)
-
 (defgroup mh-junk nil
   "Dealing with junk mail."
   :link '(custom-manual "(mh-e)Junk")
@@ -168,6 +160,12 @@
   :prefix "mh-"
   :group 'mh-e)
 
+(defgroup mh-search nil
+  "Searching."
+  :link '(custom-manual "(mh-e)Searching")
+  :prefix "mh-search-"
+  :group 'mh-e)
+
 (defgroup mh-sending-mail nil
   "Sending mail."
   :prefix "mh-"
@@ -186,15 +184,27 @@
   :link '(custom-manual "(mh-e)Reading Mail")
   :group 'mh-e)
 
-(defgroup mh-speed nil
+(defgroup mh-speedbar nil
   "The speedbar."
   :prefix "mh-speed-"
   :link '(custom-manual "(mh-e)Speedbar")
   :group 'mh-e)
 
-(defgroup mh-toolbar nil
-  "The toolbar"
-  :link '(custom-manual "(mh-e)Toolbar")
+(defgroup mh-thread nil
+  "Threading."
+  :prefix "mh-thread-"
+  :link '(custom-manual "(mh-e)Threading")
+  :group 'mh-e)
+
+(defgroup mh-tool-bar nil
+  "The tool bar"
+  :link '(custom-manual "(mh-e)Tool Bar")
+  :prefix "mh-"
+  :group 'mh-e)
+
+(defgroup mh-hooks nil
+  "MH-E hooks."
+  :link '(custom-manual "(mh-e)Top")
   :prefix "mh-"
   :group 'mh-e)
 
@@ -205,64 +215,29 @@
   :group 'faces
   :group 'mh-e)
 
-(defgroup mh-hooks nil
-  "MH-E hooks."
-  :link '(custom-manual "(mh-e)Top")
-  :prefix "mh-"
-  :group 'mh-e)
-
-;;; Faces
-
-(defgroup mh-folder-faces nil
-  "Faces used in scan listing."
-  :link '(custom-manual "(mh-e)Organizing")
-  :prefix "mh-"
-  :group 'mh-faces
-  :group 'mh-show)
-
-(defgroup mh-index-faces nil
-  "Faces used in searching."
-  :link '(custom-manual "(mh-e)Searching")
-  :prefix "mh-"
-  :group 'mh-faces
-  :group 'mh-index)
-
-(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)
-
-(defgroup mh-show-faces nil
-  "Faces used in message display."
-  :link '(custom-manual "(mh-e)Reading Mail")
-  :prefix "mh-"
-  :group 'mh-faces
-  :group 'mh-show)
-
-(defgroup mh-speed-faces nil
-  "Faces used in speedbar."
-  :link '(custom-manual "(mh-e)Speedbar")
-  :prefix "mh-"
-  :group 'mh-faces
-  :group 'mh-speed)
-
 
 
-;;; Emacs interface to the MH mail system (:group mh)
+;;; Emacs interface to the MH mail system (:group mh-e)
 (eval-when (compile)
   (setq mh-variant 'none))
 
+(defcustom mh-path nil
+  "*Additional list of directories to search for MH.
+See `mh-variant'."
+  :group 'mh-e
+  :type '(repeat (directory)))
+
 (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'.
+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' (which you can customize), `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'
@@ -281,26 +256,30 @@
 
 (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."
+
+As MH ignores case in the aliases, so too does MH-E. However, you
+may turn off this option 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)
 
 (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."
+
+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)
 
 (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."
+
+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)
                  (const :tag "Flash and Warn If No Alias" 1)
                  (const :tag "Don't Flash Nor Warn If No Alias" nil))
@@ -308,11 +287,12 @@
 
 (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."
+
+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))
@@ -320,9 +300,10 @@
 
 (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."
+
+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))
@@ -331,46 +312,52 @@
 (defcustom mh-alias-local-users t
   "*If on, local users are added to alias completion.
 
-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'.
-
-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.
-
-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."
+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\".
+
+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.
+
+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)
 
 (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'.
+  "*String prefixed to the real names of users from the password file.
+This option can also be set to \"Use Login\".
 
 For example, consider the following password file entry:
 
     psg:x:1000:1000:Peter S Galbraith,,,:/home/psg:/bin/tcsh
 
-The following settings of this option will produce the associated aliases:
+The following settings of this option will produce the associated
+aliases:
 
     \"local.\"                  local.peter.galbraith
     \"\"                        peter.galbraith
     Use Login                   psg
 
-This option has no effect if variable `mh-alias-local-users' is turned off."
+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)
 
 (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."
+
+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)
 
@@ -378,36 +365,96 @@
 
 ;;; Organizing Your Mail with Folders (:group 'mh-folder)
 
+(defcustom mh-new-messages-folders t
+  "Folders searched for the \"unseen\" sequence.
+
+Set this option to \"Inbox\" to search the \"+inbox\" folder or
+\"All\" to search all of the top level folders. Otherwise, list
+the folders that should be searched with the \"Choose Folders\"
+menu item.
+
+See also `mh-recursive-folders-flag'."
+  :type '(choice (const :tag "Inbox" t)
+                 (const :tag "All" nil)
+                 (repeat :tag "Choose Folders" (string :tag "Folder")))
+  :group 'mh-folder)
+
+(defcustom mh-ticked-messages-folders t
+  "Folders searched for `mh-tick-seq'.
+
+Set this option to \"Inbox\" to search the \"+inbox\" folder or
+\"All\" to search all of the top level folders. Otherwise, list
+the folders that should be searched with the \"Choose Folders\"
+menu item.
+
+See also `mh-recursive-folders-flag'."
+  :type '(choice (const :tag "Inbox" t)
+                 (const :tag "All" nil)
+                 (repeat :tag "Choose Folders" (string :tag "Folder")))
+  :group 'mh-folder)
+
+(defcustom mh-large-folder 200
+  "The number of messages that indicates a large folder.
+
+If a folder is deemed to be large, that is the number of messages
+in it exceed this value, then confirmation is needed when it is
+visited. Even when `mh-show-threads-flag' is non-nil, the folder
+is not automatically threaded, if it is large. If set to nil all
+folders are treated as if they are small."
+  :type '(choice (const :tag "No Limit") integer)
+  :group 'mh-folder)
+
 (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."
+
+If this option is turned on, recenter the summary window when the
+show window is toggled off."
+  :type 'boolean
+  :group 'mh-folder)
+
+(defcustom mh-recursive-folders-flag nil
+  "*Non-nil means that commands which operate on folders do so recursively."
   :type 'boolean
   :group 'mh-folder)
 
+(defcustom mh-sortm-args nil
+  "*Additional arguments for \"sortm\"\\<mh-folder-mode-map>.
+
+This option is consulted when a prefix argument is used with
+\\[mh-sort-folder]. Normally default arguments to \"sortm\" are
+specified in the MH profile. This option may be used to provide
+an alternate view. For example, \"'(\"-nolimit\" \"-textfield\"
+\"subject\")\" is a useful setting."
+  :type 'string
+  :group 'mh-folder)
+
 
 
 ;;; Folder Selection (:group 'mh-folder-selection)
 
 (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."
+  "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)
 
 (defcustom mh-default-folder-list nil
   "*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.
-
-See `mh-prompt-for-refile-folder' and `mh-folder-from-address' for more
-information."
+
+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.
+
+See `mh-prompt-for-refile-folder' and `mh-folder-from-address'
+for more information."
   :type '(repeat (list (regexp :tag "Address")
                        (string :tag "Folder")
                        (boolean :tag "Check Recipient")))
@@ -415,13 +462,14 @@
 
 (defcustom mh-default-folder-must-exist-flag t
   "*Non-nil means guessed folder name must exist to be used.
-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.
-
-See `mh-prompt-for-refile-folder' and `mh-folder-from-address' for more
-information."
+
+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.
+
+See `mh-prompt-for-refile-folder' and `mh-folder-from-address'
+for more information."
   :type 'boolean
   :group 'mh-folder-selection)
 
@@ -429,8 +477,8 @@
   "*Prefix used for folder names generated from aliases.
 The prefix is used to prevent clutter in your mail directory.
 
-See `mh-prompt-for-refile-folder' and `mh-folder-from-address' for more
-information."
+See `mh-prompt-for-refile-folder' and `mh-folder-from-address'
+for more information."
   :type 'string
   :group 'mh-folder-selection)
 
@@ -441,34 +489,38 @@
 (defcustom mh-identity-list nil
   "*List of identities.
 
-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."
+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."
   :type '(repeat (list :tag ""
                        (string :tag "Label")
                        (repeat :tag "Add at least one item below"
@@ -503,37 +555,40 @@
 (defcustom mh-auto-fields-list nil
   "List of recipients for which header lines are automatically inserted.
 
-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."
+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."
   :type `(repeat
           (list :tag ""
                 (string :tag "Recipient")
@@ -581,25 +636,28 @@
     (":pgg-default-user-id" . mh-identity-handler-gpg-identity))
   "Handler functions for fields in `mh-identity-list'.
 
-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."
+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."
   :type '(repeat (cons (string :tag "Field") function))
   :group 'mh-identity)
 
@@ -610,36 +668,38 @@
 (defcustom mh-inc-prog "inc"
   "*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."
+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."
   :type 'string
   :group 'mh-inc)
 
 (defcustom mh-inc-spool-list nil
   "*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.
-
-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':
+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.
+
+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\":
 
     MAILDIR=$HOME/mail
     :0:
     * ^From mh-e-devel-admin@stop.mail-abuse.org
     mh-e
 
-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'.
-
-You can use `xbuffy' to automate the incorporation of this mail using the
-`gnudoit' command in the `gnuserv' package as follows:
+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\".
+
+You can use \"xbuffy\" to automate the incorporation of this mail
+using the \"gnudoit\" command in the \"gnuserv\" package as follows:
 
     box ~/mail/mh-e
         title mh-e
@@ -655,52 +715,6 @@
 
 
 
-;;; Searching (:group 'mh-index)
-
-(defcustom mh-index-new-messages-folders t
-  "Folders searched for the \"unseen\" sequence.
-Set this option to \"Inbox\" to search the \"+inbox\" folder or \"All\" to
-search all of the top level folders. Otherwise, list the folders that should
-be searched with the \"Choose Folders\" menu item.
-
-See also `mh-recursive-folders-flag'."
-  :group 'mh-index
-  :type '(choice (const :tag "Inbox" t)
-                 (const :tag "All" nil)
-                 (repeat :tag "Choose Folders" (string :tag "Folder"))))
-
-(defcustom mh-index-program nil
-  "Indexing program that MH-E shall use.
-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'.
-
-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)
-
-(defcustom mh-index-ticked-messages-folders t
-  "Folders searched for `mh-tick-seq'.
-Set this option to \"Inbox\" to search the \"+inbox\" folder or \"All\" to
-search all of the top level folders. Otherwise, list the folders that should
-be searched with the \"Choose Folders\" menu item.
-
-See also `mh-recursive-folders-flag'."
-  :group 'mh-index
-  :type '(choice (const :tag "Inbox" t)
-                 (const :tag "All" nil)
-                 (repeat :tag "Choose Folders" (string :tag "Folder"))))
-
-
-
 ;;; Dealing with Junk Mail (:group 'mh-junk)
 
 ;; Spam fighting program chosen
@@ -712,13 +726,17 @@
     (bogofilter mh-bogofilter-blacklist mh-bogofilter-whitelist)
     (spamprobe mh-spamprobe-blacklist mh-spamprobe-whitelist))
   "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.")
+
+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
+
+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
@@ -730,9 +748,11 @@
 ;; User customizable variables
 (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."
+
+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)
@@ -746,11 +766,11 @@
 (defcustom mh-junk-program nil
   "Spam program that MH-E should use.
 
-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\"."
+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\"."
   :type '(choice (const :tag "Auto-detect" nil)
                  (const :tag "SpamAssassin" spamassassin)
                  (const :tag "Bogofilter" bogofilter)
@@ -762,13 +782,17 @@
 
 ;;; Editing a Draft (:group 'mh-letter)
 
-(defcustom mh-compose-insertion (if (locate-library "mml") 'gnus 'mhn)
-  "Type of MIME message directives in messages.
-
-By default, this option is set to `Gnus' if it is supported. This option can
-also be set manually to `mhn' if mhn directives are preferred."
-  :type '(choice (const :tag "Gnus" gnus)
-                 (const :tag "mhn"  mhn))
+(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))
   :group 'mh-letter)
 
 (defcustom mh-compose-skipped-header-fields
@@ -779,20 +803,26 @@
   :group 'mh-letter)
 
 (defcustom mh-compose-space-does-completion-flag nil
-  "*Non-nil means that <SPC> does completion in message header."
+  "*Non-nil means \\<mh-letter-mode-map>\\[mh-letter-complete-or-space] does completion in message header."
   :type 'boolean
   :group 'mh-letter)
 
 (defcustom mh-delete-yanked-msg-window-flag nil
   "*Non-nil means delete any window displaying the message.
-If this option is on, yanking the current message into a draft letter with
-\\<mh-letter-mode-map>\\[mh-yank-cur-msg] deletes any windows 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."
   :type 'boolean
   :group 'mh-letter)
 
 (defcustom mh-extract-from-attribution-verb "wrote:"
-  "*Verb to use for attribution when a message is yanked by \\<mh-letter-mode-map>\\[mh-yank-cur-msg]."
+  "*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."
   :type '(choice (const "wrote:")
                  (const "a écrit:")
                  (const "schrieb:")
@@ -800,28 +830,53 @@
   :group 'mh-letter)
 
 (defcustom mh-ins-buf-prefix "> "
-  "*String to put before each non-blank line of a yanked or inserted message.
-Used when the message is inserted into an outgoing letter
-by \\<mh-letter-mode-map>\\[mh-insert-letter] or \\[mh-yank-cur-msg]."
+  "*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.
+
+This prefix is not inserted if you use one of the supercite
+flavors of `mh-yank-behavior' or you have added a
+`mail-citation-hook'."
   :type 'string
   :group 'mh-letter)
 
 (defcustom mh-letter-complete-function 'ispell-complete-word
   "*Function to call when completing outside of address or folder fields.
-By default, this is set to `ispell-complete-word'."
+
+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."
   :type '(choice function (const nil))
   :group 'mh-letter)
 
 (defcustom mh-letter-fill-column 72
-  "*Fill column to use in `mh-letter-mode'.
-This is usually less than in other text modes because email messages get
-quoted by some prefix (sometimes many times) when they are replied to,
-and it's best to avoid quoted lines that span more than 80 columns."
+  "*Fill column to use in MH Letter mode.
+
+By default, this option is 72 to allow others to quote your
+message without line wrapping."
   :type 'integer
   :group 'mh-letter)
 
-(defcustom mh-mml-method-default (if mh-gnus-pgp-support-flag "pgpmime" "none")
-  "Default method to use in security directives."
+(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 turn on the option `pgg-encrypt-for-me' 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!"
   :type '(choice (const :tag "PGP (MIME)" "pgpmime")
                  (const :tag "PGP" "pgp")
                  (const :tag "S/MIME" "smime")
@@ -831,92 +886,97 @@
 (defcustom mh-signature-file-name "~/.signature"
   "*Source of user's signature.
 
-By default, the text of your signature is taken from the file `~/.signature'.
-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
-to insert one yourself. Variables that you may find useful to do this include
-`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.
+By default, the text of your signature is taken from the file
+\"~/.signature\". You can read from other sources 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 to insert one yourself. Options that you may find
+useful to do this include `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."
+\\<mh-letter-mode-map>\\[mh-insert-signature] or with the option
+`mh-identity-list'."
   :type 'file
   :group 'mh-letter)
 
 (defcustom mh-signature-separator-flag t
   "*Non-nil means a signature separator should be inserted.
-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."
+
+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.
 
-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:'
-header field.
-
-The `X-Face:' header field, which is a low-resolution, black and white image,
-can be generated using the `compface' command, which can be obtained from
-ftp://ftp.cs.indiana.edu/pub/faces/compface/compface.tar.Z. The \"Online
-X-Face Convertor\" at http://www.dairiki.org/xface/ is a useful resource for
-quick conversion of images into `X-Face:' header fields.
-
-Use the `make-face' script (http://quimby.gnus.org/circus/face/make-face) to
-convert a JPEG image to the higher resolution, color, `Face:' header field.
-
-The URL of any image can be used for the `X-Image-URL:' field and no
+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:\" header field.
+
+The \"X-Face:\" header field, which is a low-resolution, black and
+white image, can be generated using the \"compface\" command (see URL
+`ftp://ftp.cs.indiana.edu/pub/faces/compface/compface.tar.Z'). The
+\"Online X-Face Converter\" is a useful resource for quick conversion
+of images into \"X-Face:\" header fields (see URL
+`http://www.dairiki.org/xface/').
+
+Use the \"make-face\" script to convert a JPEG image to the higher
+resolution, color, \"Face:\" header field (see URL
+`http://quimby.gnus.org/circus/face/make-face').
+
+The URL of any image can be used for the \"X-Image-URL:\" field and no
 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."
+`mh-x-face-file' to nil, or simply ensure that the file defined by
+this option doesn't exist."
   :type 'file
   :group 'mh-letter)
 
-(defcustom mh-yank-from-start-of-msg 'attribution
+(defcustom mh-yank-behavior 'attribution
   "*Controls which part of a message is yanked by \\<mh-letter-mode-map>\\[mh-yank-cur-msg].
-If t, include the entire message, with full headers.  This is historically
-here for use with supercite, but is now deprecated in favor of the setting
-`supercite' below.
-
-If the symbol `body', then yank the message minus the header.
-
-If the symbol `supercite', include the entire message, with full headers.
-This also causes the invocation of `sc-cite-original' without the setting
-of `mail-citation-hook', now deprecated practice.
-
-If the symbol `autosupercite', do as for `supercite' automatically when
-show buffer matches the message being replied-to.  When this option is used,
-the -noformat switch is passed to the repl program to override a -filter or
--format switch.
-
-If the symbol `attribution', then yank the message minus the header and add
-a simple attribution line at the top.
-
-If the symbol `autoattrib', do as for `attribution' automatically when show
-buffer matches the message being replied-to.  You can make sure this is
-always the case by setting `mh-reply-show-message-flag' to t (which is the
-default) and optionally `mh-delete-yanked-msg-window-flag' to t as well such
-that the show window is never displayed.  When the `autoattrib' option is
-used, the -noformat switch is passed to the repl program to override a
--filter or -format switch.
-
-If nil, yank only the portion of the message following the point.
-
-If the show buffer has a region, this variable is ignored unless its value is
-one of `attribution' or `autoattrib' in which case the attribution is added
-to the yanked region."
+
+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 option
+`mh-extract-from-attribution-verb'. 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 option `mh-delete-yanked-msg-window-flag' as well so that the
+show window is never displayed.
+
+If the show buffer has a region, the option `mh-yank-behavior' is
+ignored unless its value is one of Attribution variants in which
+case the attribution is added to the yanked region.
+
+If this option is set to one of the supercite flavors, the hook
+`mail-citation-hook' is ignored and `mh-ins-buf-prefix' is not
+inserted."
   :type '(choice (const :tag "Body and Header" t)
                  (const :tag "Body" body)
                  (const :tag "Below Point" nil)
@@ -932,9 +992,12 @@
 ;;; 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\"."
+  "*Non-nil means interpret a number as a range.
+
+Since one of the most frequent ranges used is \"last:N\", MH-E
+will interpret input such as \"200\" as \"last:200\" if this
+option is on (which is the default). If you need to scan just the
+message 200, then use the range \"200:200\"."
   :type 'boolean
   :group 'mh-ranges)
 
@@ -942,55 +1005,142 @@
 
 ;;; Scan Line Formats (:group 'mh-scan-line-formats)
 
+;; Forward definition.
+(defvar mh-scan-format-file t)
+
+(defun mh-adaptive-cmd-note-flag-check (symbol value)
+  "Check if desired setting is legal.
+Throw an error if user tries to turn on
+`mh-adaptive-cmd-note-flag' when `mh-scan-format-file' isn't t.
+Otherwise, set SYMBOL to VALUE."
+  (if (and value
+           (not (eq mh-scan-format-file t)))
+      (error "%s %s" "Can't turn on unless `mh-scan-format-file'"
+             "is set to \"Use MH-E scan Format\"")
+    (set-default symbol value)))
+
+;; Forward definition.
+(defvar mh-adaptive-cmd-note-flag)
+
+(defun mh-scan-format-file-check (symbol value)
+  "Check if desired setting is legal.
+Throw an error if user tries to set `mh-scan-format-file' to
+anything but t when `mh-adaptive-cmd-note-flag' is on. Otherwise,
+set SYMBOL to VALUE."
+  (if (and (not (eq value t))
+           (eq mh-adaptive-cmd-note-flag t))
+      (error "%s %s" "You must turn off `mh-adaptive-cmd-note-flag'"
+             "unless you use \"Use MH-E scan Format\"")
+    (set-default symbol value)))
+
 (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."
+
+If you've created your own format to handle long message numbers,
+you'll be pleased to know you no longer need it since MH-E adapts its
+internal format based upon the largest message number if this option
+is on (the default). This option may only be turned on when
+`mh-scan-format-file' is set to \"Use MH-E scan Format\".
+
+If you prefer fixed-width message numbers, turn off this option and
+call `mh-set-cmd-note' with the width specified by your format file
+\(see `mh-scan-format-file'). For example, the default width is 4, so
+you would use \"(mh-set-cmd-note 4)\"."
   :type 'boolean
-  :group 'mh-scan-line-formats)
-
+  :group 'mh-scan-line-formats
+  :set 'mh-adaptive-cmd-note-flag-check)
+
+;; Update forward definition above if default changes.
 (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'."
+
+The default setting for this option is \"Use MH-E scan Format\". This
+means that the format string will be taken from the either
+`mh-scan-format-mh' or `mh-scan-format-nmh' depending on whether MH or
+nmh (or GNU mailutils) is in use. This setting also enables you to
+turn on the `mh-adaptive-cmd-note-flag' option.
+
+You can also set this option to \"Use Default scan Format\" to get the
+same output as you would get if you ran \"scan\" from the shell. If
+you have a format file that you want MH-E to use but not MH, you can
+set this option to \"Specify a scan Format File\" and enter the name
+of your format file.
+
+If you change the format of the scan lines you'll need to tell MH-E
+how to parse the new format. As you will see, quite a lot of variables
+are involved to do that. Use \"\\[apropos] RET mh-scan.*regexp\" to
+obtain a list of these variables. You will also have to call
+`mh-set-cmd-note' if your notations are not in column 4 (columns in
+Emacs start with 0)."
   :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)
+  :group 'mh-scan-line-formats
+  :set 'mh-scan-format-file-check)
 
 (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."
+  "*Program used to scan messages.
+
+The name of the program that generates a listing of one line per
+message is held in this option. Unless this variable contains an
+absolute pathname, it is assumed to be in the `mh-progs'
+directory. You may link another program to `scan' (see
+\"mh-profile(5)\") to produce a different type of listing."
   :type 'string
   :group 'mh-scan-line-formats)
 (make-variable-buffer-local 'mh-scan-prog)
 
 
 
+;;; Searching (:group 'mh-search)
+
+(defcustom mh-search-program nil
+  "Search program that MH-E shall use.
+
+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\".
+
+More information about setting up an indexing program to use with
+MH-E can be found in the documentation of `mh-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-search)
+
+
+
 ;;; Sending Mail (:group 'mh-sending-mail)
 
 (defcustom mh-compose-forward-as-mime-flag t
-  "Non-nil means that messages are forwarded as a MIME part."
+  "*Non-nil means that messages are forwarded as attachments.
+
+By default, this option is on which means that the forwarded
+messages are included as attachments. If you would prefer to
+forward your messages verbatim (as text, inline), then turn off
+this option. Forwarding messages verbatim works well for short,
+textual messages, but your recipient won't be able to view any
+non-textual attachments that were in the forwarded message. Be
+aware that if you have \"forw: -mime\" in your MH profile, then
+forwarded messages will always be included as attachments
+regardless of the settings of this option."
   :type 'boolean
   :group 'mh-sending-mail)
 
 (defcustom mh-compose-letter-function nil
-  "Invoked when setting up a letter draft.
-It is passed three arguments: TO recipients, SUBJECT, and CC recipients."
+  "Invoked when starting a new draft.
+
+However, it is the last function called before you edit your
+message. The consequence of this is that you can write a function
+to write and send the message for you. This function is passed
+three arguments: the contents of the TO, SUBJECT, and CC header
+fields."
   :type '(choice (const nil) function)
   :group 'mh-sending-mail)
 
@@ -1000,36 +1150,56 @@
   :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."
+  "*Format string for forwarded message subject.
+
+This option is a string which includes two escapes (\"%s\"). The
+first \"%s\" is replaced with the sender of the original message,
+and the second one is replaced with the original \"Subject:\"."
   :type 'string
   :group 'mh-sending-mail)
 
 (defcustom mh-insert-x-mailer-flag t
-  "*Non-nil means append an X-Mailer field to the header."
+  "*Non-nil means append an \"X-Mailer:\" header field to the header.
+
+This header field includes the version of MH-E and Emacs that you
+are using. If you don't want to participate in our marketing, you
+can turn this option off."
+  :type 'boolean
+  :group 'mh-sending-mail)
+
+(defcustom mh-redist-full-contents-flag nil
+  "*Non-nil means the \"dist\" command needs entire letter for redistribution.
+
+This option must be turned on if \"dist\" requires the whole
+letter for redistribution, which is the case if \"send\" is
+compiled with the BERK option (which many people abhor). If you
+find that MH will not allow you to redistribute a message that
+has been redistributed before, turn off this option."
   :type 'boolean
   :group 'mh-sending-mail)
 
 (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."
+
+This option is set to \"Prompt\" by default so that you are
+prompted for the recipient of a reply. If you find that most of
+the time that you specify \"cc\" when you reply to a message, set
+this option to \"cc\". Other choices include \"from\", \"to\", or
+\"all\". You can always edit the recipients in the draft."
   :type '(choice (const :tag "Prompt" nil)
-                 (const "from") (const "to")
-                 (const "cc") (const "all"))
+                 (const "from")
+                 (const "to")
+                 (const "cc")
+                 (const "all"))
   :group 'mh-sending-mail)
 
 (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."
+  "*Non-nil means the MH-Show buffer is displayed when replying.
+
+If you include the message automatically, you can hide the
+MH-Show buffer by turning off this option.
+
+See also `mh-reply'."
   :type 'boolean
   :group 'mh-sending-mail)
 
@@ -1037,35 +1207,42 @@
 
 ;;; 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
+;; 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."
+
+If a message is in any sequence (except \"Previous-Sequence:\"
+and \"cur\") when it is refiled, then it will still be in those
+sequences in the destination folder. If this behavior is not
+desired, then turn off this option."
   :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."
+
+You can customize 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."
+  "*Non-nil means flush MH sequences to disk after message is shown\\<mh-folder-mode-map>.
+
+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 option `mh-tick-seq' which is
+\"tick\" by default. If you do not like this behavior, turn off
+this option. You can then update the state manually with the
+\\[mh-execute-commands], \\[mh-quit], or \\[mh-update-sequences]
+commands."
   :type 'boolean
   :group 'mh-sequences)
 
@@ -1074,98 +1251,162 @@
 ;;; Reading Your Mail (:group 'mh-show)
 
 (defcustom mh-bury-show-buffer-flag t
-  "*Non-nil means that the displayed show buffer for a folder is buried."
+  "*Non-nil means show buffer is buried.
+
+One advantage of not burying the show buffer is that one can
+delete the show buffer more easily in an electric buffer list
+because of its proximity to its associated MH-Folder buffer. Try
+running \\[electric-buffer-list] to see what I mean."
   :type 'boolean
   :group 'mh-show)
 
 (defcustom mh-clean-message-header-flag t
   "*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."
+
+See also `mh-invisible-header-fields-default' and
+`mh-invisible-header-fields'."
   :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."
+  "*Non-nil means attachments are handled\\<mh-folder-mode-map>.
+
+MH-E can handle attachments as well if the Gnus `mm-decode'
+library is present. If so, this option will be on. Otherwise,
+you'll see the MIME body parts rather than text or attachments.
+There isn't much point in turning off this option; however, you
+can inspect it if it appears that the body parts are not being
+interpreted correctly or toggle it with the command
+\\[mh-toggle-mh-decode-mime-flag] to view the raw message.
+
+This option also controls the display of quoted-printable
+messages and other graphical widgets. See the options
+`mh-graphical-smileys-flag' and `mh-graphical-emphasis-flag'."
   :type 'boolean
   :group 'mh-show)
 
 (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."
+  "*Non-nil means display buttons for all alternative attachments.
+
+Sometimes, a mail program will produce multiple alternatives of
+the attachment in increasing degree of faithfulness to the
+original content. By default, only the preferred alternative is
+displayed. If this option is on, then the preferred part is shown
+inline and buttons are shown for each of the other alternatives."
   :type 'boolean
   :group 'mh-show)
 
 (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."
+  "*Non-nil means display buttons for all inline attachments\\<mh-folder-mode-map>.
+
+The sender can request that attachments should be viewed inline so
+that they do not really appear like an attachment at all to the
+reader. Most of the time, this is desirable, so by default MH-E
+suppresses the buttons for inline attachments. On the other hand, you
+may receive code or HTML which the sender has added to his message as
+inline attachments so that you can read them in MH-E. In this case, it
+is useful to see the buttons so that you know you don't have to cut
+and paste the code into a file; you can simply save the attachment.
+
+If you want to make the buttons visible for inline attachments, you
+can use the command \\[mh-toggle-mime-buttons] to toggle the
+visibility of these buttons. You can turn on these buttons permanently
+by turning on this option.
+
+MH-E cannot display all attachments inline however. It can display
+text (including HTML) and images."
   :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."
+  "*Non-nil means non-reversible commands 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.
+Turning on this option means that these actions will be
+performed--which is usually desired but cannot be
+retracted--without question."
   :type 'boolean
   :group 'mh-show)
 
-(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.
-
-If set to \"Never fetch\" (nil), images are never fetched and only displayed
-if they are already present in the cache.
-
-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."
-
-  :type '(choice (const :tag "Always fetch" t)
-                 (const :tag "Ask before fetching" ask)
-                 (const :tag "Never fetch" nil))
+(defcustom mh-fetch-x-image-url nil
+  "*Control fetching of \"X-Image-URL:\" header field image.
+
+Ths option controls the fetching of the \"X-Image-URL:\" header
+field image with the following values:
+
+Ask Before Fetching
+     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 a
+     good setting.
+
+Never Fetch
+     Images are never fetched and only displayed if they are
+     already present in the cache. This is the default.
+
+There isn't a value of \"Always Fetch\" for privacy and DOS (denial of
+service) reasons. For example, fetching a URL can tip off a spammer
+that you've read his email (which is why you shouldn't blindly answer
+yes if you've set this option to \"Ask Before Fetching\"). 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.
+
+The cache of images is found in the directory \".mhe-x-image-cache\"
+within your MH directory. You can add your own face to the \"From:\"
+field too. See Info node `(mh-e)Picture'.
+
+This setting only has effect if the option `mh-show-use-xface-flag' is
+turned on."
+
+  :type '(choice (const :tag "Ask Before Fetching" ask)
+                 (const :tag "Never Fetch" nil))
   :group 'mh-show)
 
 (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."
+
+It is a long standing custom to inject body language using a
+cornucopia of punctuation, also known as the \"smileys\". MH-E
+can render these as graphical widgets if this option is turned
+on, which it is by default. Smileys include patterns such as :-)
+and ;-).
+
+This option is disabled if the option `mh-decode-mime-flag' is
+turned off."
   :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."
+
+A few typesetting features are indicated in ASCII text with
+certain characters. If your terminal supports it, MH-E can render
+these typesetting directives naturally if this option is turned
+on, which it is by default. For example, _underline_ will be
+underlined, *bold* will appear in bold, /italics/ will appear in
+italics, and so on. See the option `gnus-emphasis-alist' for the
+whole list.
+
+This option is disabled if the option `mh-decode-mime-flag' is
+turned off."
   :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."
-  :type '(choice (const :tag "Use Gnus" gnus)
-                 (const :tag "Use font-lock" font-lock)
-                 (const :tag "Don't fontify" nil))
+(defcustom mh-highlight-citation-style 'gnus
+  "Style for highlighting citations.
+
+If the sender of the message has cited other messages in his
+message, then MH-E will highlight these citations to emphasize
+the sender's actual response. This option can be customized to
+change the highlighting style. The \"Multicolor\" method uses a
+different color for each indentation while the \"Monochrome\"
+method highlights all citations in red. To disable highlighting
+of citations entirely, choose \"None\"."
+  :type '(choice (const :tag "Multicolor" gnus)
+                 (const :tag "Monochrome" font-lock)
+                 (const :tag "None" nil))
   :group 'mh-show)
 
 ;; Keep fields alphabetized. Mention source, if known.
@@ -1239,7 +1480,9 @@
     "X-Authentication-Warning:"         ; sendmail
     "X-Beenthere:"                      ; Mailman mailing list manager
     "X-Bogosity:"                       ; bogofilter
+    "X-Bugzilla-*"                      ; Bugzilla
     "X-Complaints-To:"
+    "X-ContentStamp:"                   ; NetZero
     "X-Cron-Env:"
     "X-DMCA"
     "X-Delivered"
@@ -1264,7 +1507,6 @@
     "X-Habeas-SWE-7:"                   ; Spam
     "X-Habeas-SWE-8:"                   ; Spam
     "X-Habeas-SWE-9:"                   ; Spam
-    "X-Image-URL:"                      ; URL equivalent of X-Face and Face
     "X-Info:"                           ; NTMail
     "X-Juno-"                           ; Juno
     "X-List-Host:"                      ; Unknown mailing list managers
@@ -1273,10 +1515,11 @@
     "X-Listprocessor-"                  ; ListProc(tm) by CREN
     "X-Listserver:"                     ; Unknown mailing list managers
     "X-Loop:"                           ; Unknown mailing list managers
+    "X-Lumos-SenderID:"                 ; Roving ConstantContact
+    "X-MAIL-INFO:"                      ; NetZero
     "X-MHE-Checksum"                    ; Checksum added during index search
     "X-MIME-Autoconverted:"             ; sendmail
     "X-MIMETrack:"
-    "X-Mms-"                            ; T-Mobile pictures
     "X-MS-"                             ; MS Outlook
     "X-MailScanner"                     ; ListProc(tm) by CREN
     "X-Mailing-List:"                   ; Unknown mailing list managers
@@ -1285,6 +1528,7 @@
     "X-Message-Id"
     "X-MessageWall-Score:"              ; Unknown mailing list manager, AUC TeX
     "X-MimeOLE:"                        ; MS Outlook
+    "X-Mms-"                            ; T-Mobile pictures
     "X-Mozilla-Status:"                 ; Netscape/Mozilla
     "X-Msmail-"                         ; MS Outlook
     "X-NAI-Spam-"                       ; Network Associates Inc. SpamKiller
@@ -1307,6 +1551,8 @@
     "X-Received-Date:"
     "X-Received:"
     "X-Request-"
+    "X-Return-Path-Hint:"               ; Roving ConstantContact
+    "X-Roving-*"                        ; Roving ConstantContact
     "X-SBClass:"                        ; Spam
     "X-SBNote:"                         ; Spam
     "X-SBPass:"                         ; Spam
@@ -1326,9 +1572,11 @@
     "X-Trace:"
     "X-UID"
     "X-UIDL:"
+    "X-UNTD-"                           ; NetZero
     "X-USANET-"                         ; usa.net
     "X-UserInfo1:"
     "X-VSMLoop:"                        ; NTMail
+    "X-Virus-Scanned"                   ; amavisd-new
     "X-Vms-To:"
     "X-WebTV-Signature:"
     "X-Wss-Id:"                         ; Worldtalk gateways
@@ -1339,9 +1587,11 @@
     "X400-"                             ; X400
     "Xref:")
   "List of default header fields that are not to be shown.
-Do not alter this variable directly.  Instead, add entries from here that you
-would like to be displayed in `mh-invisible-header-fields-default'
-and add entries to hide in `mh-invisible-header-fields'.")
+
+Do not alter this variable directly. Instead, add entries from
+here that you would like to be displayed in
+`mh-invisible-header-fields-default' and add entries to hide in
+`mh-invisible-header-fields'.")
 
 (defvar mh-invisible-header-fields-compiled nil
   "*Regexp matching lines in a message header that are not to be shown.
@@ -1350,11 +1600,15 @@
 hidden that you wish to display, and add extra entries to hide in
 `mh-invisible-header-fields'.")
 
+;; Forward definition.
+(defvar mh-invisible-header-fields)
+(defvar mh-invisible-header-fields-default nil)
+
 (defun mh-invisible-headers ()
   "Make or remake the variable `mh-invisible-header-fields-compiled'.
-Done using `mh-invisible-header-fields-internal' as input, from which entries
-from `mh-invisible-header-fields-default' are removed and entries
-from `mh-invisible-header-fields' are added."
+Done using `mh-invisible-header-fields-internal' as input, from
+which entries from `mh-invisible-header-fields-default' are
+removed and entries from `mh-invisible-header-fields' are added."
   (let ((fields mh-invisible-header-fields-internal))
     (when mh-invisible-header-fields-default
       ;; Remove entries from `mh-invisible-header-fields-default'
@@ -1375,28 +1629,17 @@
                  (regexp-opt fields t))))
       (setq mh-invisible-header-fields-compiled nil))))
 
-(defcustom mh-invisible-header-fields-default nil
-  "*List of hidden header fields.
-The header fields listed in this 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.
-
-See also `mh-clean-message-header-flag'."
-  :type `(set ,@(mapcar (lambda (x) `(const ,x))
-                        mh-invisible-header-fields-internal))
-  :set (lambda (symbol value)
-         (set-default symbol value)
-         (mh-invisible-headers))
-  :group 'mh-show)
-
 (defcustom mh-invisible-header-fields nil
   "*Additional header fields to hide.
+
 Header fields that you would like to hide that aren't listed in
-`mh-invisible-header-fields-default' can be added to this option with a couple
-of caveats. Regular expressions are not allowed. Unique fields should have a
-`:' suffix; otherwise, the element can be used to render invisible an entire
-class of fields that start with the same prefix.
+`mh-invisible-header-fields-default' can be added to this option
+with a couple of caveats. Regular expressions are not allowed.
+Unique fields should have a \":\" suffix; otherwise, the element
+can be used to render invisible an entire class of fields that
+start with the same prefix. If you think a header field should be
+generally ignored, report a bug (see URL
+`https://sourceforge.net/tracker/?group_id=13357&atid=113357').
 
 See also `mh-clean-message-header-flag'."
 
@@ -1406,174 +1649,247 @@
          (mh-invisible-headers))
   :group 'mh-show)
 
+;; Update forward definition above if default changes.
+(defcustom mh-invisible-header-fields-default nil
+  "*List of hidden header fields.
+
+The header fields listed in this 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 option `mh-invisible-header-fields'.
+
+See also `mh-clean-message-header-flag'."
+  :type `(set ,@(mapcar (lambda (x) `(const ,x))
+                        mh-invisible-header-fields-internal))
+  :set (lambda (symbol value)
+         (set-default symbol value)
+         (mh-invisible-headers))
+  :group 'mh-show)
+
 (defcustom mh-lpr-command-format "lpr -J '%s'"
-  "*Format for Unix command that prints a message.
-The string should be a Unix command line, with the string '%s' where
-the job's name (folder and message number) should appear.  The formatted
-message text is piped to this command when you type \\<mh-folder-mode-map>`\\[mh-print-msg]'."
+  "*Command used to print\\<mh-folder-mode-map>.
+
+This option contains the Unix command line which performs the
+actual printing for the \\[mh-print-msg] command. The string can
+contain one escape, \"%s\", which is replaced by the name of the
+folder and the message number and is useful for print job names.
+I use \"mpage -h'%s' -b Letter -H1of -mlrtb -P\" which produces a
+nice header and adds a bit of margin so the text fits within my
+printer's margins.
+
+This options is not used by the commands \\[mh-ps-print-msg] or
+\\[mh-ps-print-msg-file]."
   :type 'string
   :group 'mh-show)
 
 (defcustom mh-max-inline-image-height nil
-  "*Maximum inline image height if Content-Disposition is not present.
-If nil, image will be displayed if its height is smaller than the height of
-the window."
+  "*Maximum inline image height if \"Content-Disposition:\" is not present.
+
+Some older mail programs do not insert this needed plumbing to
+tell MH-E whether to display the attachments inline or not. If
+this is the case, MH-E will display these images inline if they
+are smaller than the window. However, you might want to allow
+larger images to be displayed inline. To do this, you can change
+the options `mh-max-inline-image-width' and
+`mh-max-inline-image-height' from their default value of zero to
+a large number. The size of your screen is a good choice for
+these numbers."
   :type '(choice (const nil) integer)
   :group 'mh-show)
 
 (defcustom mh-max-inline-image-width nil
-  "*Maximum inline image width if Content-Disposition is not present.
-If nil, image will be displayed if its width is smaller than the width of the
-window."
+  "*Maximum inline image width if \"Content-Disposition:\" is not present.
+
+Some older mail programs do not insert this needed plumbing to
+tell MH-E whether to display the attachments inline or not. If
+this is the case, MH-E will display these images inline if they
+are smaller than the window. However, you might want to allow
+larger images to be displayed inline. To do this, you can change
+the options `mh-max-inline-image-width' and
+`mh-max-inline-image-height' from their default value of zero to
+a large number. The size of your screen is a good choice for
+these numbers."
   :type '(choice (const nil) integer)
   :group 'mh-show)
 
+(defcustom mh-mhl-format-file nil
+  "*Specifies the format file to pass to the \"mhl\" program.
+
+Normally MH-E takes care of displaying messages itself (rather than
+calling an MH program to do the work). If you'd rather have \"mhl\"
+display the message (within MH-E), change this option from its default
+value of \"Use Default mhl Format (Printing Only)\".
+
+You can set this option to \"Use Default mhl Format\" to get the same
+output as you would get if you ran \"mhl\" from the shell.
+
+If you have a format file that you want MH-E to use, you can set this
+option to \"Specify an mhl Format File\" and enter the name of your
+format file. Your format file should specify a non-zero value for
+\"overflowoffset\" to allow MH-E to parse the header. Note that
+\"mhl\" is always used for printing and forwarding; in this case, the
+value of this option is consulted if you have specified a format
+file."
+  :type '(choice (const :tag "Use Default mhl Format (Printing Only)" nil)
+                 (const :tag "Use Default mhl Format" t)
+                 (file :tag "Specify an mhl Format File"))
+  :group 'mh-show)
+
 (defcustom mh-mime-save-parts-default-directory t
-  "Default directory to use for `mh-mime-save-parts'.
-If nil, prompt and set for next time the command is used during same session.
-If t, prompt always"
-  :type '(choice (const :tag "Prompt the first time" nil)
-                 (const :tag "Prompt always" t)
+  "Default directory to use for \\<mh-folder-mode-map>\\[mh-mime-save-parts].
+
+The default value for this option is \"Prompt Always\" so that
+you are always prompted for the directory in which to save the
+attachments. However, if you usually use the same directory
+within a session, then you can set this option to \"Prompt the
+First Time\" to avoid the prompt each time. you can make this
+directory permanent by choosing \"Directory\" and entering the
+directory's name."
+  :type '(choice (const :tag "Prompt the First Time" nil)
+                 (const :tag "Prompt Always" t)
                  directory)
   :group 'mh-show)
 
 (defcustom mh-print-background-flag nil
-  "*Non-nil means messages should be printed in the background.
-WARNING: do not delete the messages until printing is finished;
-otherwise, your output may be truncated."
-  :type 'boolean
-  :group 'mh-show)
-
-(defcustom mh-recursive-folders-flag nil
-  "*Non-nil means that commands which operate on folders do so recursively."
+  "*Non-nil means messages should be printed in the background\\<mh-folder-mode-map>.
+
+Normally messages are printed in the foreground. If this is slow on
+your system, you may elect to turn off this option to print in the
+background.
+
+WARNING: If you do this, do not delete the message until it is printed
+or else the output may be truncated.
+
+This option is not used by the commands \\[mh-ps-print-msg] or
+\\[mh-ps-print-msg-file]."
   :type 'boolean
   :group 'mh-show)
 
 (defcustom mh-show-maximum-size 0
   "*Maximum size of message (in bytes) to display automatically.
-Provides an opportunity to skip over large messages which may be slow to load.
-Use a value of 0 to display all messages automatically regardless of size."
+
+This option provides an opportunity to skip over large messages
+which may be slow to load. The default value of 0 means that all
+message are shown regardless of size."
   :type 'integer
   :group 'mh-show)
 
-(defcustom mh-show-threads-flag nil
-  "Non-nil means new folders start in threaded mode.
-Threading large number of messages can be time consuming. So if the flag is
-non-nil then threading will be done only if the number of messages being
-threaded is less than `mh-large-folder'."
-  :type 'boolean
-  :group 'mh-show)
-
-;; Use goto-addr if it was already loaded (which probably sets this
-;; variable to t), or if this variable is otherwise set to t.
 (defcustom mh-show-use-goto-addr-flag (and (boundp 'goto-address-highlight-p)
                                            goto-address-highlight-p)
-  "*Non-nil means highlight URLs and email addresses.
-The `goto-addr' module is used."
+  "*Non-nil means highlight URLs and email addresses\\<goto-address-highlight-keymap>.
+
+To send a message using the highlighted email address or to view
+the web page for the highlighted URL, use the middle mouse button
+or \\[goto-address-at-point].
+
+See Info node `(mh-e)Sending Mail' to see how to configure Emacs
+to send the message using MH-E.
+
+The default value of this option comes from the value of
+`goto-address-highlight-p'."
   :type 'boolean
   :group 'mh-show)
 
 (defcustom mh-show-use-xface-flag (>= emacs-major-version 21)
-  "*Non-nil means display face images in `mh-show-mode'.
-
-MH-E can display the content of `Face:', `X-Face:', and `X-Image-URL:' header
-fields. If any of these fields occur in the header of your message, the
-sender's face will appear in the `From:' header field. If more than one of
-these fields appear, then the first field found in the order `Face:',
-`X-Face:', and `X-Image-URL:' will be used. Note that versions of GNU Emacs
-prior to 21.1 don't support the display of inline images, so face images are
-not displayed in these versions.
-
-The option `mh-show-use-xface-flag' is used to turn this feature on and off.
-This feature will be turned on by default if your system supports it.
-
-The first header field used, if present, is the Gnus-specific `Face:' field.
-The `Face:' field appeared in GNU Emacs 21 and XEmacs. For more information,
-see http://quimby.gnus.org/circus/face/. Next is the traditional `X-Face:'
-header field. The display of this field requires the `uncompface' program
-which can be obtained from
-ftp://ftp.cs.indiana.edu/pub/faces/compface/compface.tar.Z. Recent versions of
-XEmacs have internal support for `X-Face:' images. If your version of XEmacs
-does not, then you'll need both `uncompface' and the x-face package which is
-available at ftp://ftp.jpl.org/pub/elisp/.
-
-Finally, MH-E will display images referenced by the `X-Image-URL:' header
-field if neither the `Face:' nor the `X-Face:' fields are present. The display
-of the images requires `wget' (available from
-http://www.gnu.org/software/wget/wget.html), `fetch', or `curl' to fetch the
-image and the `convert' program from the ImageMagick suite, available from
-http://www.imagemagick.org/. Of the three header fields this is the most
-efficient in terms of network usage since the image doesn't need to be
-transmitted with every single mail.
-
-The option `mh-fetch-x-image-url' controls the fetching of the `X-Image-URL:'
-header field image."
+  "*Non-nil means display face images in MH-show buffers.
+
+MH-E can display the content of \"Face:\", \"X-Face:\", and
+\"X-Image-URL:\" header fields. If any of these fields occur in the
+header of your message, the sender's face will appear in the \"From:\"
+header field. If more than one of these fields appear, then the first
+field found in the order \"Face:\", \"X-Face:\", and \"X-Image-URL:\"
+will be used.
+
+The option `mh-show-use-xface-flag' is used to turn this feature on
+and off. This feature will be turned on by default if your system
+supports it.
+
+The first header field used, if present, is the Gnus-specific
+\"Face:\" field. The \"Face:\" field appeared in GNU Emacs 21 and
+XEmacs. For more information, see URL
+`http://quimby.gnus.org/circus/face/'. Next is the traditional
+\"X-Face:\" header field. The display of this field requires the
+\"uncompface\" program (see URL
+`ftp://ftp.cs.indiana.edu/pub/faces/compface/compface.tar.z'). Recent
+versions of XEmacs have internal support for \"X-Face:\" images. If
+your version of XEmacs does not, then you'll need both \"uncompface\"
+and the x-face package (see URL `ftp://ftp.jpl.org/pub/elisp/').
+
+Finally, MH-E will display images referenced by the \"X-Image-URL:\"
+header field if neither the \"Face:\" nor the \"X-Face:\" fields are
+present. The display of the images requires \"wget\" (see URL
+`http://www.gnu.org/software/wget/wget.html'), \"fetch\", or \"curl\"
+to fetch the image and the \"convert\" program from the ImageMagick
+suite (see URL `http://www.imagemagick.org/'). Of the three header
+fields this is the most efficient in terms of network usage since the
+image doesn't need to be transmitted with every single mail.
+
+The option `mh-fetch-x-image-url' controls the fetching of the
+\"X-Image-URL:\" header field image."
   :type 'boolean
   :group 'mh-show)
 
 (defcustom mh-store-default-directory nil
-  "*Last directory used by \\[mh-store-msg]; default for next store.
-A directory name string, or nil to use current directory."
+  "*Default directory for \\<mh-folder-mode-map>\\[mh-store-msg].
+
+If you would like to change the initial default directory,
+customize this option, change the value from \"Current\" to
+\"Directory\", and then enter the name of the directory for storing
+the content of these messages."
   :type '(choice (const :tag "Current" nil)
                  directory)
   :group 'mh-show)
 
 (defcustom mh-summary-height nil
-  "*Number of lines in MH-Folder window (including the mode line)."
+  "*Number of lines in MH-Folder buffer (including the mode line).
+
+The default value of this option is \"Automatic\" which means
+that the MH-Folder buffer will maintain the same proportional
+size if the frame is resized. If you'd prefer a fixed height,
+then choose the \"Fixed Size\" option and enter the number of
+lines you'd like to see."
   :type '(choice (const :tag "Automatic" nil)
-                 (integer :tag "Fixed sized"))
+                 (integer :tag "Fixed Size"))
   :group 'mh-show)
 
-(defcustom mhl-formfile nil
-  "*Name of format file to be used by mhl to show and print messages.
-A value of t means use the default format file.
-nil means don't use mhl to format messages when showing; mhl is still used,
-with the default format file, to format messages when printing them.
-The format used should specify a non-zero value for overflowoffset so
-the message continues to conform to RFC 822 and MH-E can parse the headers."
-  :type '(choice (const nil) (const t) string)
-  :group 'mh-show)
-(put 'mhl-formfile 'info-file "mh-e")
+
+
+;;; The Speedbar (:group 'mh-speedbar)
+
+(defcustom mh-speed-update-interval 60
+  "Time between speedbar updates in seconds.
+Set to 0 to disable automatic update."
+  :type 'integer
+  :group 'mh-speedbar)
 
 
 
-;;; The Speedbar (:group 'mh-speed)
-
-(defcustom mh-large-folder 200
-  "The number of messages that indicates a large folder.
-If a folder is deemed to be large, that is the number of messages in it exceed
-this value, then confirmation is needed when it is visited. Even when
-`mh-show-threads-flag' is non-nil, the folder is not automatically threaded, if
-it is large. If set to nil all folders are treated as if they are small."
-  :type '(choice (const :tag "No limit") integer)
-  :group 'mh-speed)
-
-(defcustom mh-speed-flists-interval 60
-  "Time between calls to flists in seconds.
-If 0, flists is not called repeatedly."
-  :type 'integer
-  :group 'mh-speed)
-
-(defcustom mh-speed-run-flists-flag t
-  "Non-nil means flists is used.
-If non-nil, flists is executed every `mh-speed-flists-interval' seconds to
-update the display of the number of unseen and total messages in each folder.
-If resources are limited, this can be set to nil and the speedbar display can
-be updated manually with the \\[mh-speed-flists] command."
+;;; Threading (:group 'mh-thread)
+
+(defcustom mh-show-threads-flag nil
+  "*Non-nil means new folders start in threaded mode.
+
+Threading large number of messages can be time consuming so this
+option is turned off by default. If you turn this option on, then
+threading will be done only if the number of messages being
+threaded is less than `mh-large-folder'."
   :type 'boolean
-  :group 'mh-speed)
+  :group 'mh-thread)
 
 
 
-;;; The Toolbar (:group 'mh-toolbar)
-
-(defcustom mh-tool-bar-search-function 'mh-search-folder
-  "*Function called by the tool-bar search button.
-See `mh-search-folder' and `mh-index-search' for details."
-  :type '(choice (const mh-search-folder)
-                 (const mh-index-search)
-                 (function :tag "Other function"))
-  :group 'mh-toolbar)
+;;; The Tool Bar (:group 'mh-tool-bar)
+
+(defcustom mh-tool-bar-search-function 'mh-search
+  "*Function called by the tool bar search button.
+
+By default, this is set to `mh-search'. You can also choose
+\"Other Function\" from the \"Value Menu\" and enter a function
+of your own choosing."
+  :type '(choice (const mh-search)
+                 (function :tag "Other Function"))
+  :group 'mh-tool-bar)
 
 ;; Functions called from the tool bar
 (defun mh-tool-bar-search (&optional arg)
@@ -1583,7 +1899,7 @@
   (call-interactively mh-tool-bar-search-function))
 
 (defun mh-tool-bar-customize ()
-  "Call `mh-customize' from the toolbar."
+  "Call `mh-customize' from the tool bar."
   (interactive)
   (mh-customize t))
 
@@ -1594,14 +1910,14 @@
   (delete-other-windows))
 
 (defun mh-tool-bar-letter-help ()
-  "Visit \"(mh-e)Draft Editing\"."
+  "Visit \"(mh-e)Editing Drafts\"."
   (interactive)
-  (info "(mh-e)Draft Editing")
+  (info "(mh-e)Editing Drafts")
   (delete-other-windows))
 
 (defmacro mh-tool-bar-reply-generator (function recipient folder-buffer-flag)
   "Generate FUNCTION that replies to RECIPIENT.
-If FOLDER-BUFFER-FLAG is nil then the function generated
+If FOLDER-BUFFER-FLAG is nil then the function generated...
 When INCLUDE-FLAG is non-nil, include message body being replied to."
   `(defun ,function (&optional arg)
      ,(format "Reply to \"%s\".\nWhen ARG is non-nil include message in reply."
@@ -1619,89 +1935,91 @@
 
 ;; XEmacs has a couple of extra customizations...
 (mh-do-in-xemacs
-  (defcustom mh-xemacs-use-toolbar-flag (if (and (featurep 'toolbar)
-                                                 (featurep 'xpm)
-                                                 (device-on-window-system-p))
-                                            t
-                                          nil)
-    "*If non-nil, use toolbar.
-
-This will default to t if you are in an environment that supports
-toolbars and xpm."
+  (defcustom mh-xemacs-use-tool-bar-flag mh-xemacs-has-tool-bar-flag
+    "*If non-nil, use tool bar.
+
+This option controls whether to show the MH-E icons at all. By
+default, this option is turned on if the window system supports
+tool bars. If your system doesn't support tool bars, then you
+won't be able to turn on this option."
     :type 'boolean
-    :group 'mh-toolbar)
-
-  (defcustom mh-xemacs-toolbar-position (if mh-xemacs-use-toolbar-flag
-                                            'default
-                                          nil)
-    "*Where to put the toolbar.
-
-Valid non-nil values are \"default\", \"top\", \"bottom\", \"left\",
-\"right\".  These match the four edges of the frame, with \"default\"
-meaning \"use the same position as the default-toolbar\".
-
-A nil value means do not use a toolbar.
-
-If this variable is set to anything other than \"default\" and the
-default-toolbar has a different positional setting from the value of
-this variable, then two toolbars will be displayed.  The MH-E toolbar
-and the default-toolbar."
-    :type '(radio (const :tag "Same position as the \"default-toolbar\""
-                         :value default)
-                  (const :tag "Along the top edge of the frame"
-                         :value top)
-                  (const :tag "Along the bottom edge of the frame"
-                         :value bottom)
-                  (const :tag "Along the left edge of the frame"
-                         :value left)
-                  (const :tag "Along the right edge of the frame"
-                         :value right)
-                  (const :tag "Don't use a toolbar" nil))
-    :group 'mh-toolbar))
+    :group 'mh-tool-bar
+    :set (lambda (symbol value)
+           (if (and (eq value t)
+                    (not mh-xemacs-has-tool-bar-flag))
+               (error "Tool bar not supported"))
+           (set-default symbol value)))
+
+  (defcustom mh-xemacs-tool-bar-position nil
+    "*Tool bar location.
+
+This option controls the placement of the tool bar along the four
+edges of the frame. You can choose from one of \"Same As Default
+Tool Bar\", \"Top\", \"Bottom\", \"Left\", or \"Right\". If this
+variable is set to anything other than \"Same As Default Tool
+Bar\" and the default tool bar is in a different location, then
+two tool bars will be displayed: the MH-E tool bar and the
+default tool bar."
+    :type '(radio (const :tag "Same As Default Tool Bar" :value nil)
+                  (const :tag "Top" :value top)
+                  (const :tag "Bottom" :value bottom)
+                  (const :tag "Left" :value left)
+                  (const :tag "Right" :value right))
+    :group 'mh-tool-bar))
+
+(defun mh-buffer-exists-p (mode)
+  "Test whether a buffer with major mode MODE is present."
+  (loop for buf in (buffer-list)
+        when (save-excursion
+               (set-buffer buf)
+               (eq major-mode mode))
+        return t))
 
 (defmacro mh-tool-bar-define (defaults &rest buttons)
   "Define a tool bar for MH-E.
-DEFAULTS is the list of buttons that are present by default. It is a list of
-lists where the sublists are of the following form:
+DEFAULTS is the list of buttons that are present by default. It
+is a list of lists where the sublists are of the following form:
 
   (:KEYWORD FUNC1 FUNC2 FUNC3 ...)
 
-Here :KEYWORD is one of :folder or :letter. If it is :folder then the default
-buttons in the folder and show mode buffers are being specified. If it is
-:letter then the default buttons in the letter mode are listed. FUNC1, FUNC2,
-FUNC3, ... are the names of the functions that the buttons would execute.
-
-Each element of BUTTONS is a list consisting of four mandatory items and one
-optional item as follows:
+Here :KEYWORD is one of :folder or :letter. If it is :folder then
+the default buttons in the folder and show mode buffers are being
+specified. If it is :letter then the default buttons in the
+letter mode are listed. FUNC1, FUNC2, FUNC3, ... are the names of
+the functions that the buttons would execute.
+
+Each element of BUTTONS is a list consisting of four mandatory
+items and one optional item as follows:
 
   (FUNCTION MODES ICON DOC &optional ENABLE-EXPR)
 
 where,
 
-  FUNCTION is the name of the function that will be executed when the button
-  is clicked.
-
-  MODES is a list of symbols. List elements must be from `folder', `letter' and
-  `sequence'. If `folder' is present then the button is available in the
-  folder and show buffer. If the name of FUNCTION is of the form \"mh-foo\",
-  where foo is some arbitrary string, then we check if the function
-  `mh-show-foo' exists. If it exists then that function is used in the show
-  buffer. Otherwise the original function `mh-foo' is used in the show buffer
-  as well. Presence of `sequence' is handled similar to the above. The only
-  difference is that the button is shown only when the folder is narrowed to a
-  sequence. If `letter' is present in MODES, then the button is available
-  during draft editing and runs FUNCTION when clicked.
+  FUNCTION is the name of the function that will be executed when
+  the button is clicked.
+
+  MODES is a list of symbols. List elements must be from \"folder\",
+  \"letter\" and \"sequence\". If \"folder\" is present then the button is
+  available in the folder and show buffer. If the name of FUNCTION is
+  of the form \"mh-foo\", where foo is some arbitrary string, then we
+  check if the function `mh-show-foo' exists. If it exists then that
+  function is used in the show buffer. Otherwise the original function
+  `mh-foo' is used in the show buffer as well. Presence of \"sequence\"
+  is handled similar to the above. The only difference is that the
+  button is shown only when the folder is narrowed to a sequence. If
+  \"letter\" is present in MODES, then the button is available during
+  draft editing and runs FUNCTION when clicked.
 
   ICON is the icon that is drawn in the button.
 
-  DOC is the documentation for the button. It is used in tool-tips and in
-  providing other help to the user. GNU Emacs uses only the first line of the
-  string. So the DOC should be formatted such that the first line is useful and
-  complete without the rest of the string.
-
-  Optional item ENABLE-EXPR is an arbitrary lisp expression. If it evaluates
-  to nil, then the button is deactivated, otherwise it is active. If is in't
-  present then the button is always active."
+  DOC is the documentation for the button. It is used in tool-tips and
+  in providing other help to the user. GNU Emacs uses only the first
+  line of the string. So the DOC should be formatted such that the
+  first line is useful and complete without the rest of the string.
+
+  Optional item ENABLE-EXPR is an arbitrary lisp expression. If it
+  evaluates to nil, then the button is deactivated, otherwise it is
+  active. If it isn't present then the button is always active."
   ;; The following variable names have been carefully chosen to make code
   ;; generation easier. Modifying the names should be done carefully.
   (let (folder-buttons folder-docs folder-button-setter sequence-button-setter
@@ -1752,7 +2070,7 @@
                                     (t 'folder-vectors)))
                  (list (cond ((eq type :letter) 'mh-tool-bar-letter-buttons)
                              (t 'mh-tool-bar-folder-buttons)))
-                 (key (intern (concat "mh-" type1 "toolbar-" name-str)))
+                 (key (intern (concat "mh-" type1 "tool-bar-" name-str)))
                  (setter (intern (concat type1 "-button-setter")))
                  (mbuttons (cond ((eq type :letter) 'letter-buttons)
                                  ((eq type :show) 'show-buttons)
@@ -1790,109 +2108,116 @@
        (defvar mh-letter-tool-bar-map nil)
        ;; GNU Emacs tool bar specific code
        (mh-do-in-gnu-emacs
+         ;; Tool bar initialization functions
+         (defun mh-tool-bar-folder-buttons-init ()
+           (when (mh-buffer-exists-p 'mh-folder-mode)
+             (mh-image-load-path)
+             (setq mh-folder-tool-bar-map
+                   (let ((tool-bar-map (make-sparse-keymap)))
+                     ,@(nreverse folder-button-setter)
+                     tool-bar-map))
+             (setq mh-show-tool-bar-map
+                   (let ((tool-bar-map (make-sparse-keymap)))
+                     ,@(nreverse show-button-setter)
+                     tool-bar-map))
+             (setq mh-show-seq-tool-bar-map
+                   (let ((tool-bar-map (copy-keymap mh-show-tool-bar-map)))
+                     ,@(nreverse show-seq-button-setter)
+                     tool-bar-map))
+             (setq mh-folder-seq-tool-bar-map
+                   (let ((tool-bar-map (copy-keymap mh-folder-tool-bar-map)))
+                     ,@(nreverse sequence-button-setter)
+                     tool-bar-map))))
+         (defun mh-tool-bar-letter-buttons-init ()
+           (when (mh-buffer-exists-p 'mh-letter-mode)
+             (mh-image-load-path)
+             (setq mh-letter-tool-bar-map
+                   (let ((tool-bar-map (make-sparse-keymap)))
+                     ,@(nreverse letter-button-setter)
+                     tool-bar-map))))
          ;; Custom setter functions
          (defun mh-tool-bar-folder-buttons-set (symbol value)
-           "Construct toolbar for `mh-folder-mode' and `mh-show-mode'."
+           "Construct tool bar for `mh-folder-mode' and `mh-show-mode'."
            (set-default symbol value)
-           (setq mh-folder-tool-bar-map
-                 (let ((tool-bar-map (make-sparse-keymap)))
-                   ,@(nreverse folder-button-setter)
-                   tool-bar-map))
-           (setq mh-show-tool-bar-map
-                 (let ((tool-bar-map (make-sparse-keymap)))
-                   ,@(nreverse show-button-setter)
-                   tool-bar-map))
-           (setq mh-show-seq-tool-bar-map
-                 (let ((tool-bar-map (copy-keymap mh-show-tool-bar-map)))
-                   ,@(nreverse show-seq-button-setter)
-                   tool-bar-map))
-           (setq mh-folder-seq-tool-bar-map
-                 (let ((tool-bar-map (copy-keymap mh-folder-tool-bar-map)))
-                   ,@(nreverse sequence-button-setter)
-                   tool-bar-map)))
+           (mh-tool-bar-folder-buttons-init))
          (defun mh-tool-bar-letter-buttons-set (symbol value)
-           "Construct toolbar for `mh-letter-mode'."
+           "Construct tool bar for `mh-letter-mode'."
            (set-default symbol value)
-           (setq mh-letter-tool-bar-map
-                 (let ((tool-bar-map (make-sparse-keymap)))
-                   ,@(nreverse letter-button-setter)
-                   tool-bar-map))))
+           (mh-tool-bar-letter-buttons-init)))
        ;; XEmacs specific code
        (mh-do-in-xemacs
-         (defvar mh-toolbar-folder-vector-map
+         (defvar mh-tool-bar-folder-vector-map
            ',(loop for button in folder-buttons
                    for vector in folder-vectors
                    collect (cons button vector)))
-         (defvar mh-toolbar-show-vector-map
+         (defvar mh-tool-bar-show-vector-map
            ',(loop for button in show-buttons
                    for vector in show-vectors
                    collect (cons button vector)))
-         (defvar mh-toolbar-letter-vector-map
+         (defvar mh-tool-bar-letter-vector-map
            ',(loop for button in letter-buttons
                    for vector in letter-vectors
                    collect (cons button vector)))
-         (defvar mh-toolbar-folder-buttons nil)
-         (defvar mh-toolbar-show-buttons nil)
-         (defvar mh-toolbar-letter-buttons nil)
+         (defvar mh-tool-bar-folder-buttons nil)
+         (defvar mh-tool-bar-show-buttons nil)
+         (defvar mh-tool-bar-letter-buttons nil)
          ;; Custom setter functions
          (defun mh-tool-bar-letter-buttons-set (symbol value)
            (set-default symbol value)
-           (when mh-xemacs-has-toolbar-flag
-             (setq mh-toolbar-letter-buttons
+           (when mh-xemacs-has-tool-bar-flag
+             (setq mh-tool-bar-letter-buttons
                    (loop for b in value
-                         collect (cdr (assoc b mh-toolbar-letter-vector-map))))))
+                         collect (cdr (assoc b mh-tool-bar-letter-vector-map))))))
          (defun mh-tool-bar-folder-buttons-set (symbol value)
            (set-default symbol value)
-           (when mh-xemacs-has-toolbar-flag
-             (setq mh-toolbar-folder-buttons
+           (when mh-xemacs-has-tool-bar-flag
+             (setq mh-tool-bar-folder-buttons
                    (loop for b in value
-                         collect (cdr (assoc b mh-toolbar-folder-vector-map))))
-             (setq mh-toolbar-show-buttons
+                         collect (cdr (assoc b mh-tool-bar-folder-vector-map))))
+             (setq mh-tool-bar-show-buttons
                    (loop for b in value
-                         collect (cdr (assoc b mh-toolbar-show-vector-map))))))
-         ;; Initialize toolbar
-         (defun mh-toolbar-init (mode)
-           "Install toolbar in MODE."
-           (let ((toolbar (cond ((eq mode :folder) mh-toolbar-folder-buttons)
-                                ((eq mode :letter) mh-toolbar-letter-buttons)
-                                ((eq mode :show) mh-toolbar-show-buttons)))
+                         collect (cdr (assoc b mh-tool-bar-show-vector-map))))))
+         (defun mh-tool-bar-init (mode)
+           "Install tool bar in MODE."
+           (let ((tool-bar (cond ((eq mode :folder) mh-tool-bar-folder-buttons)
+                                ((eq mode :letter) mh-tool-bar-letter-buttons)
+                                ((eq mode :show) mh-tool-bar-show-buttons)))
                  (height 37)
                  (width 40)
                  (buffer (current-buffer)))
-             (when (and mh-xemacs-toolbar-position mh-xemacs-use-toolbar-flag
-                        mh-xemacs-has-toolbar-flag)
+             (when mh-xemacs-use-tool-bar-flag
                (cond
-                ((eq mh-xemacs-toolbar-position 'top)
-                 (set-specifier top-toolbar toolbar buffer)
+                ((eq mh-xemacs-tool-bar-position 'top)
+                 (set-specifier top-toolbar tool-bar buffer)
                  (set-specifier top-toolbar-visible-p t)
                  (set-specifier top-toolbar-height height))
-                ((eq mh-xemacs-toolbar-position 'bottom)
-                 (set-specifier bottom-toolbar toolbar buffer)
+                ((eq mh-xemacs-tool-bar-position 'bottom)
+                 (set-specifier bottom-toolbar tool-bar buffer)
                  (set-specifier bottom-toolbar-visible-p t)
                  (set-specifier bottom-toolbar-height height))
-                ((eq mh-xemacs-toolbar-position 'left)
-                 (set-specifier left-toolbar toolbar buffer)
+                ((eq mh-xemacs-tool-bar-position 'left)
+                 (set-specifier left-toolbar tool-bar buffer)
                  (set-specifier left-toolbar-visible-p t)
                  (set-specifier left-toolbar-width width))
-                ((eq mh-xemacs-toolbar-position 'right)
-                 (set-specifier right-toolbar toolbar buffer)
+                ((eq mh-xemacs-tool-bar-position 'right)
+                 (set-specifier right-toolbar tool-bar buffer)
                  (set-specifier right-toolbar-visible-p t)
                  (set-specifier right-toolbar-width width))
-                (t (set-specifier default-toolbar toolbar buffer)))))))
-       ;; Declare customizable toolbars
+                (t (set-specifier default-toolbar tool-bar buffer)))))))
+       ;; Declare customizable tool bars
        (custom-declare-variable
         'mh-tool-bar-folder-buttons
         '(list ,@(mapcar (lambda (x) `(quote ,x)) folder-defaults))
-        "Choose buttons to include in MH-E folder/show toolbar."
-        :group 'mh-toolbar :set 'mh-tool-bar-folder-buttons-set
+        "List of buttons to include in MH-Folder tool bar."
+        :group 'mh-tool-bar :set 'mh-tool-bar-folder-buttons-set
         :type '(set ,@(loop for x in folder-buttons
                             for y in folder-docs
                             collect `(const :tag ,y ,x))))
        (custom-declare-variable
         'mh-tool-bar-letter-buttons
         '(list ,@(mapcar (lambda (x) `(quote ,x)) letter-defaults))
-        "Choose buttons to include in MH-E letter toolbar."
-        :group 'mh-toolbar :set 'mh-tool-bar-letter-buttons-set
+        "List of buttons to include in MH-Letter tool bar."
+        :group 'mh-tool-bar :set 'mh-tool-bar-letter-buttons-set
         :type '(set ,@(loop for x in letter-buttons
                             for y in letter-docs
                             collect `(const :tag ,y ,x)))))))
@@ -1981,225 +2306,233 @@
 
 ;;; Hooks (:group 'mh-hooks + group where hook described)
 
-(defcustom mail-citation-hook nil
-  "*Hook for modifying a citation just inserted in the mail buffer.
-Each hook function can find the citation between point and mark.
-And each hook function should leave point and mark around the citation
-text as modified.
-
-If this hook is entirely empty (nil), the text of the message is inserted
-with `mh-ins-buf-prefix' prefixed to each line.
-
-See also the variable `mh-yank-from-start-of-msg', which controls how
-much of the message passed to the hook.
-
-This hook was historically provided to set up supercite.  You may now leave
-this nil and set up supercite by setting the variable
-`mh-yank-from-start-of-msg' to 'supercite or, for more automatic insertion,
-to 'autosupercite.
-
-The hook 'trivial-cite is NOT part of Emacs.  It is provided from tc.el,
-available here:
- http://shasta.cs.uiuc.edu/~lrclause/tc.html
-If you use it, customize `mh-yank-from-start-of-msg' to
- \"Entire message with headers\"."
+(defcustom mh-after-commands-processed-hook nil
+  "Hook run by \\<mh-folder-mode-map>\\[mh-execute-commands] after performing outstanding requests.
+
+Variables that are useful in this hook include
+`mh-folders-changed', which lists which folders were affected by
+deletes and refiles. This list will always include the current
+folder, which is also available in `mh-current-folder'."
   :type 'hook
-  :options '(trivial-cite)
   :group 'mh-hooks
-  :group 'mh-letter)
+  :group 'mh-folder)
 
 (defcustom mh-alias-reloaded-hook nil
-  "Invoked by `mh-alias-reload' after reloading aliases."
+  "Hook run by `mh-alias-reload' after loading aliases."
   :type 'hook
   :group 'mh-hooks
   :group 'mh-alias)
 
+(defcustom mh-before-commands-processed-hook nil
+  "Hook run by \\<mh-folder-mode-map>\\[mh-execute-commands] before performing outstanding requests.
+
+Variables that are useful in this hook include `mh-delete-list'
+and `mh-refile-list' which can be used to see which changes will
+be made to the current folder, `mh-current-folder'."
+  :type 'hook
+  :group 'mh-hooks
+  :group 'mh-folder)
+
 (defcustom mh-before-quit-hook nil
-  "Invoked by \\<mh-folder-mode-map>`\\[mh-quit]' before quitting MH-E.
+  "Hook run by \\<mh-folder-mode-map>\\[mh-quit] before quitting MH-E.
+
+This hook is called before the quit occurs, so you might use it
+to perform any MH-E operations; you could perform some query and
+abort the quit or call `mh-execute-commands', for example.
+
 See also `mh-quit-hook'."
   :type 'hook
   :group 'mh-hooks
-  :group 'mh-show)
+  :group 'mh-folder)
 
 (defcustom mh-before-send-letter-hook nil
-  "Invoked at the beginning of the \\<mh-letter-mode-map>\\[mh-send-letter] command."
+  "Hook run at the beginning of the \\<mh-letter-mode-map>\\[mh-send-letter] command.
+
+For example, if you want to check your spelling in your message
+before sending, add the `ispell-message' function."
   :type 'hook
+  :options '(ispell-message)
   :group 'mh-hooks
   :group 'mh-letter)
 
 (defcustom mh-delete-msg-hook nil
-  "Invoked after marking each message for deletion."
-  :type 'hook
-  :group 'mh-hooks
-  :group 'mh-show)
-
-(defcustom mh-edit-mhn-hook nil
-  "Invoked on the formatted letter by \\<mh-letter-mode-map>\\[mh-edit-mhn]."
-  :type 'hook
-  :group 'mh-hooks
-  :group 'mh-letter)
-
-(defcustom mh-find-path-hook nil
-  "Invoked by `mh-find-path' after reading the user's MH profile."
+  "Hook run by \\<mh-letter-mode-map>\\[mh-delete-msg] after marking each message for deletion.
+
+For example, a past maintainer of MH-E used this once when he
+kept statistics on his mail usage."
   :type 'hook
   :group 'mh-hooks
   :group 'mh-show)
 
-(defcustom mh-folder-mode-hook nil
-  "Invoked in `mh-folder-mode' on a new folder."
+(defcustom mh-find-path-hook nil
+  "Hook run by `mh-find-path' after reading the user's MH profile.
+
+This hook can be used the change the value of the variables that
+`mh-find-path' sets if you need to run with different values
+between MH and MH-E."
   :type 'hook
   :group 'mh-hooks
-  :group 'mh-show)
-
-(defcustom mh-folder-updated-hook nil
-  "Invoked when the folder actions (such as moves and deletes) are performed.
-Variables that are useful in this hook include `mh-delete-list' and
-`mh-refile-list' which can be used to see which changes are being made to
-current folder, `mh-current-folder'."
-  :type 'hook
-  :group 'mh-hooks)
-
-(defcustom mh-forward-hook nil
-  "Invoked on the forwarded letter by \\<mh-folder-mode-map>\\[mh-forward]."
+  :group 'mh-e)
+
+(defcustom mh-folder-mode-hook nil
+  "Hook run by `mh-folder-mode' when visiting a new folder."
   :type 'hook
   :group 'mh-hooks
   :group 'mh-folder)
 
+(defcustom mh-forward-hook nil
+  "Hook run by `mh-forward' on a forwarded letter."
+  :type 'hook
+  :group 'mh-hooks
+  :group 'mh-sending-mail)
+
 (defcustom mh-inc-folder-hook nil
-  "Invoked by \\<mh-folder-mode-map>`\\[mh-inc-folder]' after incorporating mail into a folder."
+  "Hook run by \\<mh-folder-mode-map>\\[mh-inc-folder] after incorporating mail into a folder."
   :type 'hook
   :group 'mh-hooks
   :group 'mh-inc)
 
-(defcustom mh-kill-folder-suppress-prompt-hook '(mh-index-p)
-  "Invoked at the beginning of the  \\<mh-folder-mode-map>`\\[mh-kill-folder]' command.
-This hook is a list of functions to be called, with no arguments, which should
-return a value of non-nil if you should not be asked if you're sure that you
-want to remove the folder. This is useful for folders that are easily
-regenerated.
-
-The default value of `mh-index-p' suppresses the prompt on folders generated
-by an index search.
-
-WARNING: Use this hook with care. If there is a bug in your hook which returns
-t on +inbox and you hit \\<mh-folder-mode-map>`\\[mh-kill-folder]' by accident
-in the +inbox buffer, you will not be happy."
-  :type 'hook
-  :group 'mh-hooks
-  :group 'mh-show)
-
-(defcustom mh-letter-insert-signature-hook nil
-  "Invoked after signature has been inserted.
-This hook may access the actual name of the file or the function used to
-insert the signature with `mh-signature-file-name'."
+(defcustom mh-insert-signature-hook nil
+  "Hook run by \\<mh-letter-mode-map>\\[mh-insert-signature] after signature has been inserted.
+
+Hook functions may access the actual name of the file or the
+function used to insert the signature with
+`mh-signature-file-name'."
   :type 'hook
   :group 'mh-hooks
   :group 'mh-letter)
 
+(defcustom mh-kill-folder-suppress-prompt-hooks '(mh-search-p)
+  "Abnormal hook run at the beginning of \\<mh-folder-mode-map>\\[mh-kill-folder].
+
+The hook functions are called with no arguments and should return
+a non-nil value to suppress the normal prompt when you remove a
+folder. This is useful for folders that are easily regenerated.
+
+The default value of `mh-search-p' suppresses the prompt on
+folders generated by searching.
+
+WARNING: Use this hook with care. If there is a bug in your hook
+which returns t on \"+inbox\" and you hit \\[mh-kill-folder] by
+accident in the \"+inbox\" folder, you will not be happy."
+  :type 'hook
+  :group 'mh-hooks
+  :group 'mh-folder)
+
 (defcustom mh-letter-mode-hook nil
-  "Invoked in `mh-letter-mode' on a new letter."
+  "Hook run by `mh-letter-mode' on a new letter.
+
+This hook allows you to do some processing before editing a
+letter. For example, you may wish to modify the header after
+\"repl\" has done its work, or you may have a complicated
+\"components\" file and need to tell MH-E where the cursor should
+go."
   :type 'hook
   :group 'mh-hooks
   :group 'mh-sending-mail)
 
-(defcustom mh-pick-mode-hook nil
-  "Invoked upon entry to `mh-pick-mode'."
+(defcustom mh-mh-to-mime-hook nil
+  "Hook run on the formatted letter by \\<mh-letter-mode-map>\\[mh-mh-to-mime]."
   :type 'hook
   :group 'mh-hooks
-  :group 'mh-index)
+  :group 'mh-letter)
+
+(defcustom mh-search-mode-hook nil
+  "Hook run upon entry to `mh-search-mode'\\<mh-folder-mode-map>.
+
+If you find that you do the same thing over and over when editing
+the search template, you may wish to bind some shortcuts to keys.
+This can be done with this hook which is called when
+\\[mh-search] is run on a new pattern."
+  :type 'hook
+  :group 'mh-hooks
+  :group 'mh-search)
 
 (defcustom mh-quit-hook nil
-  "Invoked after \\<mh-folder-mode-map>`\\[mh-quit]' quits MH-E.
+  "Hook run by \\<mh-folder-mode-map>\\[mh-quit] after quitting MH-E.
+
+This hook is not run in an MH-E context, so you might use it to
+modify the window setup.
+
 See also `mh-before-quit-hook'."
   :type 'hook
   :group 'mh-hooks
-  :group 'mh-show)
+  :group 'mh-folder)
 
 (defcustom mh-refile-msg-hook nil
-  "Invoked after marking each message for refiling."
+  "Hook run by \\<mh-folder-mode-map>\\[mh-refile-msg] after marking each message for refiling."
   :type 'hook
   :group 'mh-hooks
-  :group 'mh-show)
+  :group 'mh-folder)
 
 (defcustom mh-show-hook nil
-  "Invoked after \\<mh-folder-mode-map>`\\[mh-show]' shows a message."
+  "Hook run after \\<mh-folder-mode-map>\\[mh-show] shows a message.
+
+It is the last thing called after messages are displayed. It's
+used to affect the behavior of MH-E in general or when
+`mh-show-mode-hook' is too early. See `mh-show-mode-hook'."
   :type 'hook
   :group 'mh-hooks
   :group 'mh-show)
 
 (defcustom mh-show-mode-hook nil
-  "Invoked upon entry to `mh-show-mode'."
+  "Hook run upon entry to `mh-show-mode'.
+
+This hook is called early on in the process of the message
+display. It is usually used to perform some action on the
+message's content. See `mh-show-hook'."
   :type 'hook
   :group 'mh-hooks
   :group 'mh-show)
 
 (defcustom mh-unseen-updated-hook nil
-  "Invoked after the unseen sequence has been updated.
-The variable `mh-seen-list' can be used to obtain the list of messages which
-will be removed from the unseen sequence."
+  "Hook run after the unseen sequence has been updated.
+
+The variable `mh-seen-list' can be used by this hook to obtain
+the list of messages which were removed from the unseen
+sequence."
   :type 'hook
   :group 'mh-hooks
-  :group 'mh-show)
+  :group 'mh-sequences)
 
 
 
-;;; Faces (:group 'mh-*-faces + group where faces described)
-
-;;; Faces Used in Scan Listing (:group 'mh-folder-faces)
-
-(defvar mh-folder-body-face 'mh-folder-body
-  "Face used to highlight body text in MH-Folder buffers.")
+;;; Faces (:group 'mh-faces + group where faces described)
+
+(if (boundp 'facemenu-unlisted-faces)
+    (add-to-list 'facemenu-unlisted-faces "^mh-"))
+
+(defface mh-folder-address '((t (:inherit mh-folder-subject)))
+  "Recipient face."
+  :group 'mh-faces
+  :group 'mh-folder)
+
 (defface mh-folder-body
-  '((((type tty) (class color)) (:foreground "green"))
-    (((class grayscale) (background light)) (:foreground "DimGray" :italic t))
-    (((class grayscale) (background dark)) (:foreground "LightGray" :italic t))
-    (((class color) (background light)) (:foreground "RosyBrown"))
-    (((class color) (background dark)) (:foreground "LightSalmon"))
-    (t (:italic t)))
-  "Face used to highlight body text in MH-Folder buffers."
-  :group 'mh-folder-faces)
-
-(defvar mh-folder-cur-msg-face 'mh-folder-cur-msg
-  "Face used for the current message line in MH-Folder buffers.")
-(defface mh-folder-cur-msg
-  '((((type tty pc) (class color))
-     (:background "LightGreen"))
-    (((class color) (background light))
-     (:background "LightGreen")         ;Use this for solid background colour
-     ;;  (:underline t)                 ;Use this for underlining
-     )
-    (((class color) (background dark))
-     (:background "DarkOliveGreen4"))
-    (t (:underline t)))
-  "Face used for the current message line in MH-Folder buffers."
-  :group 'mh-folder-faces)
-
-(defvar mh-folder-cur-msg-number-face 'mh-folder-cur-msg-number
-  "Face used to highlight the current message in MH-Folder buffers.")
+  '((((class color))
+     (:inherit mh-folder-msg-number))
+    (t
+     (:inherit mh-folder-msg-number :italic t)))
+  "Body text face."
+  :group 'mh-faces
+  :group 'mh-folder)
+
 (defface mh-folder-cur-msg-number
-  '((((type tty) (class color)) (:foreground "cyan" :weight bold))
-    (((class grayscale) (background light)) (:foreground "LightGray" :bold t))
-    (((class grayscale) (background dark)) (:foreground "DimGray" :bold t))
-    (((class color) (background light)) (:foreground "Purple"))
-    (((class color) (background dark)) (:foreground "Cyan"))
-    (t (:bold t)))
-  "Face used to highlight the current message in MH-Folder buffers."
-  :group 'mh-folder-faces)
-
-(defvar mh-folder-date-face 'mh-folder-date
-  "Face used to highlight the date in MH-Folder buffers.")
-(defface mh-folder-date
-  '((((class color) (background light))
-     (:foreground "snow4"))
-    (((class color) (background dark))
-     (:foreground "snow3"))
-    (t
-     (:bold t)))
-  "Face used to highlight the date in MH-Folder buffers."
-  :group 'mh-folder-faces)
-
-(defvar mh-folder-followup-face 'mh-folder-followup
-  "Face used to highlight Re: subject text in MH-Folder buffers.")
+  '((t
+     (:inherit mh-folder-msg-number :bold t)))
+  "Current message number face."
+  :group 'mh-faces
+  :group 'mh-folder)
+
+(defface mh-folder-date '((t (:inherit mh-folder-msg-number)))
+  "Date face."
+  :group 'mh-faces
+  :group 'mh-folder)
+
+(defface mh-folder-deleted '((t (:inherit mh-folder-msg-number)))
+  "Deleted message face."
+  :group 'mh-faces
+  :group 'mh-folder)
+
 (defface mh-folder-followup
   '((((class color) (background light))
      (:foreground "blue3"))
@@ -2207,43 +2540,57 @@
      (:foreground "LightGoldenRod"))
     (t
      (:bold t)))
-  "Face used to highlight Re: subject text in MH-Folder buffers."
-  :group 'mh-folder-faces)
-
-(defvar mh-folder-msg-number-face 'mh-folder-msg-number
-  "Face used to highlight the message number in MH-Folder buffers.")
+  "\"Re:\" face."
+  :group 'mh-faces
+  :group 'mh-folder)
+
 (defface mh-folder-msg-number
-  '((((class color) (background light))
-     (:foreground "snow4"))
-    (((class color) (background dark))
-     (:foreground "snow3"))
-    (t
-     (:bold t)))
-  "Face used to highlight the message number in MH-Folder buffers."
-  :group 'mh-folder-faces)
-
-(defvar mh-folder-deleted-face 'mh-folder-deleted
-  "Face used to highlight deleted messages in MH-Folder buffers.")
-(copy-face 'mh-folder-msg-number 'mh-folder-deleted)
-
-(defvar mh-folder-refiled-face 'mh-folder-refiled
-  "Face used to highlight refiled messages in MH-Folder buffers.")
+  (mh-defface-compat
+   '((((class color) (min-colors 88) (background light))
+      (:foreground "snow4"))
+     (((class color) (min-colors 88) (background dark))
+      (:foreground "snow3"))
+     (((class color))
+      (:foreground "cyan"))))
+
+  "Message number face."
+  :group 'mh-faces
+  :group 'mh-folder)
+
 (defface mh-folder-refiled
-  '((((type tty) (class color)) (:foreground "yellow" :weight light))
-    (((class grayscale) (background light))
-     (:foreground "Gray90" :bold t :italic t))
-    (((class grayscale) (background dark))
-     (:foreground "DimGray" :bold t :italic t))
-    (((class color) (background light)) (:foreground "DarkGoldenrod"))
-    (((class color) (background dark)) (:foreground "LightGoldenrod"))
-    (t (:bold t :italic t)))
-  "Face used to highlight refiled messages in MH-Folder buffers."
-  :group 'mh-folder-faces)
-
-(defvar mh-folder-subject-face 'mh-folder-subject
-  "Face used to highlight subject text in MH-Folder buffers.")
-(if (boundp 'facemenu-unlisted-faces)
-    (add-to-list 'facemenu-unlisted-faces "^mh-folder"))
+  (mh-defface-compat
+   '((((class color) (min-colors 88) (background light))
+      (:foreground "DarkGoldenrod"))
+     (((class color) (min-colors 88) (background dark))
+      (:foreground "LightGoldenrod"))
+     (((class color))
+      (:foreground "yellow" :weight light))
+     (((class grayscale) (background light))
+      (:foreground "Gray90" :bold t :italic t))
+     (((class grayscale) (background dark))
+      (:foreground "DimGray" :bold t :italic t))
+     (t
+      (:bold t :italic t))))
+  "Refiled message face."
+  :group 'mh-faces
+  :group 'mh-folder)
+
+(defface mh-folder-sent-to-me-hint '((t (:inherit mh-folder-date)))
+  "Fontification hint face in messages sent directly to us.
+The detection of messages sent to us is governed by the scan
+format `mh-scan-format-nmh' and the regular expression
+`mh-scan-sent-to-me-sender-regexp'."
+  :group 'mh-faces
+  :group 'mh-folder)
+
+(defface mh-folder-sent-to-me-sender '((t (:inherit mh-folder-followup)))
+  "Sender face in messages sent directly to us.
+The detection of messages sent to us is governed by the scan
+format `mh-scan-format-nmh' and the regular expression
+`mh-scan-sent-to-me-sender-regexp'."
+  :group 'mh-faces
+  :group 'mh-folder)
+
 (defface mh-folder-subject
   '((((class color) (background light))
      (:foreground "blue4"))
@@ -2251,152 +2598,97 @@
      (:foreground "yellow"))
     (t
      (:bold t)))
-  "Face used to highlight subject text in MH-Folder buffers."
-  :group 'mh-folder-faces)
+  "Subject face."
+  :group 'mh-faces
+  :group 'mh-folder)
 
 (defface mh-folder-tick
-  '((((class color) (background dark)) (:background "#dddf7e"))
-    (((class color) (background light)) (:background "#dddf7e"))
-    (t (:underline t)))
-  "Face used to show ticked messages."
-  :group 'mh-folder-faces)
-
-(defvar mh-folder-address-face 'mh-folder-address
-  "Face used to highlight the address in MH-Folder buffers.")
-(copy-face 'mh-folder-subject 'mh-folder-address)
-
-(defvar mh-folder-scan-format-face 'mh-folder-scan-format
-  "Face used to highlight `mh-scan-format-regexp' matches in MH-Folder buffers.")
-(copy-face 'mh-folder-followup 'mh-folder-scan-format)
-
-(defvar mh-folder-to-face 'mh-folder-to
-  "Face used to highlight the To: string in MH-Folder buffers.")
+  '((((class color) (background dark))
+     (:background "#dddf7e"))
+    (((class color) (background light))
+     (:background "#dddf7e"))
+    (t
+     (:underline t)))
+  "Ticked message face."
+  :group 'mh-faces
+  :group 'mh-folder)
+
 (defface mh-folder-to
-  '((((type tty) (class color)) (:foreground "green"))
-    (((class grayscale) (background light)) (:foreground "DimGray" :italic t))
-    (((class grayscale) (background dark)) (:foreground "LightGray" :italic t))
-    (((class color) (background light)) (:foreground "RosyBrown"))
-    (((class color) (background dark)) (:foreground "LightSalmon"))
-    (t (:italic t)))
-  "Face used to highlight the To: string in MH-Folder buffers."
-  :group 'mh-folder-faces)
-
-
-
-;;; Faces Used in Searching (:group 'mh-index-faces)
-
-(defvar mh-index-folder-face 'mh-index-folder
-  "Face used to highlight folders in MH-Index buffers.")
-(defface mh-index-folder
+  (mh-defface-compat
+   '((((class color) (min-colors 88) (background light))
+      (:foreground "RosyBrown"))
+     (((class color) (min-colors 88) (background dark))
+      (:foreground "LightSalmon"))
+     (((class color))
+      (:foreground "green"))
+     (((class grayscale) (background light))
+      (:foreground "DimGray" :italic t))
+     (((class grayscale) (background dark))
+      (:foreground "LightGray" :italic t))
+     (t
+      (:italic t))))
+  "\"To:\" face."
+  :group 'mh-faces
+  :group 'mh-folder)
+
+(defface mh-search-folder
   '((((class color) (background light))
      (:foreground "dark green" :bold t))
     (((class color) (background dark))
      (:foreground "indian red" :bold t))
     (t
      (:bold t)))
-  "Face used to highlight folders in MH-Index buffers."
-  :group 'mh-index-faces)
-
-
-
-;;; Faces Used in Message Drafts (:group 'mh-letter-faces)
+  "Folder heading face in MH-Folder buffers created by searches."
+  :group 'mh-faces
+  :group 'mh-search)
 
 (defface mh-letter-header-field
   '((((class color) (background light))
      (:background "gray90"))
     (((class color) (background dark))
      (:background "gray10"))
-    (t (:bold t)))
-  "Face used to display header fields in draft buffers."
-  :group 'mh-letter-faces)
-
-
-
-;;; Faces Used in Message Display (:group 'mh-show-faces)
-
-(defvar mh-show-cc-face 'mh-show-cc
-  "Face used to highlight cc: header fields.")
+    (t
+     (:bold t)))
+  "Editable header field value face in draft buffers."
+  :group 'mh-faces
+  :group 'mh-letter)
+
 (defface mh-show-cc
-  '((((type tty) (class color)) (:foreground "yellow" :weight light))
-    (((class grayscale) (background light))
-     (:foreground "Gray90" :bold t :italic t))
-    (((class grayscale) (background dark))
-     (:foreground "DimGray" :bold t :italic t))
-    (((class color) (background light)) (:foreground "DarkGoldenrod"))
-    (((class color) (background dark)) (:foreground "LightGoldenrod"))
-    (t (:bold t :italic t)))
-  "Face used to highlight cc: header fields."
-  :group 'mh-show-faces)
-
-(defvar mh-show-date-face 'mh-show-date
-  "Face used to highlight the Date: header field.")
+  (mh-defface-compat
+   '((((class color) (min-colors 88) (background light))
+      (:foreground "DarkGoldenrod"))
+     (((class color) (min-colors 88) (background dark))
+      (:foreground "LightGoldenrod"))
+     (((class color))
+      (:foreground "yellow" :weight light))
+     (((class grayscale) (background light))
+      (:foreground "Gray90" :bold t :italic t))
+     (((class grayscale) (background dark))
+      (:foreground "DimGray" :bold t :italic t))
+     (t
+      (:bold t :italic t))))
+  "Face used to highlight \"cc:\" header fields."
+  :group 'mh-faces
+  :group 'mh-show)
+
 (defface mh-show-date
-  '((((type tty) (class color)) (:foreground "green"))
-    (((class grayscale) (background light)) (:foreground "Gray90" :bold t))
-    (((class grayscale) (background dark)) (:foreground "DimGray" :bold t))
-    (((class color) (background light)) (:foreground "ForestGreen"))
-    (((class color) (background dark)) (:foreground "PaleGreen"))
-    (t (:bold t :underline t)))
-  "Face used to highlight the Date: header field."
-  :group 'mh-show-faces)
-
-(defvar mh-show-header-face 'mh-show-header
-  "Face used to deemphasize unspecified header fields.")
-(defface mh-show-header
-  '((((type tty) (class color)) (:foreground "green"))
-    (((class grayscale) (background light)) (:foreground "DimGray" :italic t))
-    (((class grayscale) (background dark)) (:foreground "LightGray" :italic t))
-    (((class color) (background light)) (:foreground "RosyBrown"))
-    (((class color) (background dark)) (:foreground "LightSalmon"))
-    (t (:italic t)))
-  "Face used to deemphasize unspecified header fields."
-  :group 'mh-show-faces)
-
-(defvar mh-show-pgg-good-face 'mh-show-pgg-good
-  "Face used to highlight a good PGG signature.")
-(defface mh-show-pgg-good
-  '((t (:bold t :foreground "LimeGreen")))
-  "Face used to highlight a good PGG signature."
-  :group 'mh-show-faces)
-
-(defvar mh-show-pgg-unknown-face 'mh-show-pgg-unknown
-  "Face used to highlight a PGG signature whose status is unknown.
-This face is also used for a signature when the signer is untrusted.")
-(defface mh-show-pgg-unknown
-  '((t (:bold t :foreground "DarkGoldenrod2")))
-  "Face used to highlight a PGG signature whose status is unknown.
-This face is also used for a signature when the signer is untrusted."
-  :group 'mh-show-faces)
-
-(defvar mh-show-pgg-bad-face 'mh-show-pgg-bad
-  "Face used to highlight a bad PGG signature.")
-(defface mh-show-pgg-bad
-  '((t (:bold t :foreground "DeepPink1")))
-  "Face used to highlight a bad PGG signature."
-  :group 'mh-show-faces)
-
-(defface mh-show-signature
-  '((t (:italic t)))
-  "Face used to highlight the message signature."
-  :group 'mh-show-faces)
-
-(defvar mh-show-to-face 'mh-show-to
-  "Face used to highlight the To: header field.")
-(if (boundp 'facemenu-unlisted-faces)
-    (add-to-list 'facemenu-unlisted-faces "^mh-show"))
-(defface mh-show-to
-  '((((class grayscale) (background light))
-     (:foreground "DimGray" :underline t))
-    (((class grayscale) (background dark))
-     (:foreground "LightGray" :underline t))
-    (((class color) (background light)) (:foreground "SaddleBrown"))
-    (((class color) (background dark))  (:foreground "burlywood"))
-    (t (:underline t)))
-  "Face used to highlight the To: header field."
-  :group 'mh-show-faces)
-
-(defvar mh-show-from-face 'mh-show-from
-  "Face used to highlight the From: header field.")
+  (mh-defface-compat
+   '((((class color) (min-colors 88) (background light))
+      (:foreground "ForestGreen"))
+     (((class color) (min-colors 88) (background dark))
+      (:foreground "PaleGreen"))
+     (((class color))
+      (:foreground "green"))
+     (((class grayscale) (background light))
+      (:foreground "Gray90" :bold t))
+     (((class grayscale) (background dark))
+      (:foreground "DimGray" :bold t))
+     (t
+      (:bold t :underline t))))
+  "Face used to highlight \"Date:\" header fields."
+  :group 'mh-faces
+  :group 'mh-show)
+
 (defface mh-show-from
   '((((class color) (background light))
      (:foreground "red3"))
@@ -2404,54 +2696,207 @@
      (:foreground "cyan"))
     (t
      (:bold t)))
-  "Face used to highlight the From: header field."
-  :group 'mh-show-faces)
-
-(defface mh-show-xface
-  '((t (:foreground "black" :background "white")))
-  "Face used to display the X-Face image.
-The background and foreground is used in the image."
-  :group 'mh-show-faces)
-
-(defvar mh-show-subject-face 'mh-show-subject
-  "Face used to highlight the Subject: header field.")
-(copy-face 'mh-folder-subject 'mh-show-subject)
-
-
-
-;;; Faces Used in Speedbar (:group 'mh-speed-faces)
+  "Face used to highlight \"From:\" header fields."
+  :group 'mh-faces
+  :group 'mh-show)
+
+(defface mh-show-header
+  (mh-defface-compat
+   '((((class color) (min-colors 88) (background light))
+      (:foreground "RosyBrown"))
+     (((class color) (min-colors 88) (background dark))
+      (:foreground "LightSalmon"))
+     (((class color))
+      (:foreground "green"))
+     (((class grayscale) (background light))
+      (:foreground "DimGray" :italic t))
+     (((class grayscale) (background dark))
+      (:foreground "LightGray" :italic t))
+     (t
+      (:italic t))))
+  "Face used to deemphasize less interesting header fields."
+  :group 'mh-faces
+  :group 'mh-show)
+
+(defface mh-show-pgg-bad '((t (:bold t :foreground "DeepPink1")))
+  "Bad PGG signature face."
+  :group 'mh-faces
+  :group 'mh-show)
+
+(defface mh-show-pgg-good '((t (:bold t :foreground "LimeGreen")))
+  "Good PGG signature face."
+  :group 'mh-faces
+  :group 'mh-show)
+
+(defface mh-show-pgg-unknown '((t (:bold t :foreground "DarkGoldenrod2")))
+  "Unknown or untrusted PGG signature face."
+  :group 'mh-faces
+  :group 'mh-show)
+
+(defface mh-show-signature '((t (:italic t)))
+  "Signature face."
+  :group 'mh-faces
+  :group 'mh-show)
+
+(defface mh-show-subject '((t (:inherit mh-folder-subject)))
+  "Face used to highlight \"Subject:\" header fields."
+  :group 'mh-faces
+  :group 'mh-show)
+
+(defface mh-show-to
+  '((((class color) (background light))
+     (:foreground "SaddleBrown"))
+    (((class color) (background dark))
+     (:foreground "burlywood"))
+    (((class grayscale) (background light))
+     (:foreground "DimGray" :underline t))
+    (((class grayscale) (background dark))
+     (:foreground "LightGray" :underline t))
+    (t (:underline t)))
+  "Face used to highlight \"To:\" header fields."
+  :group 'mh-faces
+  :group 'mh-show)
+
+(defface mh-show-xface '((t (:inherit (mh-show-from highlight))))
+  "X-Face image face.
+The background and foreground are used in the image."
+  :group 'mh-faces
+  :group 'mh-show)
 
 (defface mh-speedbar-folder
   '((((class color) (background light))
      (:foreground "blue4"))
     (((class color) (background dark))
      (:foreground "light blue")))
-  "Face used for folders in the speedbar buffer."
-  :group 'mh-speed-faces)
+  "Basic folder face."
+  :group 'mh-faces
+  :group 'mh-speedbar)
+
+(defface mh-speedbar-folder-with-unseen-messages
+  '((t
+     (:inherit mh-speedbar-folder :bold t)))
+  "Folder face when folder contains unread messages."
+  :group 'mh-faces
+  :group 'mh-speedbar)
 
 (defface mh-speedbar-selected-folder
   '((((class color) (background light))
      (:foreground "red1" :underline t))
     (((class color) (background dark))
      (:foreground "red1" :underline t))
-    (t (:underline t)))
-  "Face used for the current folder."
-  :group 'mh-speed-faces)
-
-(defface mh-speedbar-folder-with-unseen-messages
-  '((t (:inherit mh-speedbar-folder :bold t)))
-  "Face used for folders in the speedbar buffer which have unread messages."
-  :group 'mh-speed-faces)
+    (t
+     (:underline t)))
+  "Selected folder face."
+  :group 'mh-faces
+  :group 'mh-speedbar)
 
 (defface mh-speedbar-selected-folder-with-unseen-messages
-  '((t (:inherit mh-speedbar-selected-folder :bold t)))
-  "Face used for the current folder when it has unread messages."
-  :group 'mh-speed-faces)
-
-;;; Local Variables:
-;;; indent-tabs-mode: nil
-;;; sentence-end-double-space: nil
-;;; End:
-
-;;; arch-tag: 778d2a20-82e2-4276-be9d-309386776a68
+  '((t
+     (:inherit mh-speedbar-selected-folder :bold t)))
+  "Selected folder face when folder contains unread messages."
+  :group 'mh-faces
+  :group 'mh-speedbar)
+
+;;; XXX Temporary function for comparing old and new faces. Delete
+;;; when everybody is happy.
+(defvar bw-face-generation 'new)
+
+(defun bw-toggle-faces ()
+  "Toggle between old and new faces."
+  (interactive)
+  (cond ((eq bw-face-generation 'new)
+         (message "Going from new to old...")
+         (bw-new-face-to-old)
+         (message "Going from new to old...done")
+         (setq bw-face-generation 'old))
+        ((eq bw-face-generation 'old)
+         (message "Going from old to new...")
+         (bw-old-face-to-new)
+         (message "Going from old to new...done")
+         (setq bw-face-generation 'new))))
+
+(defun bw-new-face-to-old ()
+  "Set old faces."
+  (face-spec-set 'mh-folder-body
+    (mh-defface-compat
+     '((((class color) (min-colors 88) (background light))
+        (:foreground "RosyBrown"))
+       (((class color) (min-colors 88) (background dark))
+        (:foreground "LightSalmon"))
+       (((class color))
+        (:foreground "green"))
+       (((class grayscale) (background light))
+        (:foreground "DimGray" :italic t))
+       (((class grayscale) (background dark))
+        (:foreground "LightGray" :italic t))
+       (t
+        (:italic t)))))
+
+  (face-spec-set 'mh-folder-msg-number
+    '((((class color) (background light))
+       (:foreground "snow4"))
+      (((class color) (background dark))
+       (:foreground "snow3"))
+      (t
+       (:bold t))))
+
+  (face-spec-set 'mh-folder-cur-msg-number
+    (mh-defface-compat
+     '((((class color) (min-colors 88) (background light))
+        (:foreground "Purple"))
+       (((class color) (min-colors 88) (background dark))
+        (:foreground "Cyan"))
+       (((class color))
+        (:foreground "cyan" :weight bold))
+       (((class grayscale) (background light))
+        (:foreground "LightGray" :bold t))
+       (((class grayscale) (background dark))
+        (:foreground "DimGray" :bold t))
+       (t
+        (:bold t)))))
+
+  (face-spec-set 'mh-folder-date
+    '((((class color) (background light))
+       (:foreground "snow4"))
+      (((class color) (background dark))
+       (:foreground "snow3"))
+      (t
+       (:bold t))))
+
+  (face-spec-set 'mh-folder-msg-number
+    '((((class color) (background light))
+       (:foreground "snow4"))
+      (((class color) (background dark))
+       (:foreground "snow3"))
+      (t
+       (:bold t)))))
+
+(defun bw-old-face-to-new ()
+  "Set new faces."
+  (face-spec-set 'mh-folder-body
+    '((((class color))
+       (:inherit mh-folder-msg-number))
+      (t
+       (:inherit mh-folder-msg-number :italic t))))
+
+  (face-spec-set 'mh-folder-cur-msg-number
+    '((t
+       (:inherit mh-folder-msg-number :bold t))))
+
+  (face-spec-set 'mh-folder-date '((t (:inherit mh-folder-msg-number))))
+
+  (face-spec-set 'mh-folder-msg-number
+    '((((class color) (background light))
+       (:foreground "snow4"))
+      (((class color) (background dark))
+       (:foreground "snow3"))
+      (((class color))
+       (:foreground "cyan")))))
+
+;; Local Variables:
+;; indent-tabs-mode: nil
+;; sentence-end-double-space: nil
+;; End:
+
+;; arch-tag: 778d2a20-82e2-4276-be9d-309386776a68
 ;;; mh-customize.el ends here