]> code.delx.au - gnu-emacs/blobdiff - lisp/mh-e/mh-e.el
(mh-alias-local-users): Boolean docstrings should start with "Non-nil
[gnu-emacs] / lisp / mh-e / mh-e.el
index 5b7389335902d535e6bc199a98f67adfa244366a..e1e9648e31dd07596bb3ab25c7b0d0dd0e25d68e 100644 (file)
@@ -6,7 +6,7 @@
 
 ;; Author: Bill Wohler <wohler@newt.com>
 ;; Maintainer: Bill Wohler <wohler@newt.com>
-;; Version: 7.85+cvs
+;; Version: 8.0.2
 ;; Keywords: mail
 
 ;; This file is part of GNU Emacs.
 
 ;;; Commentary:
 
+;; MH-E is an Emacs interface to the MH mail system.
+
+;; MH-E is supported by GNU Emacs 21 and 22, as well as XEmacs 21
+;; (except for versions 21.5.9-21.5.16). It is compatible with MH
+;; versions 6.8.4 and higher, all versions of nmh, and GNU mailutils
+;; 0.4 and higher.
+
+;; MH (Message Handler) is a powerful mail reader. See
+;; http://rand-mh.sourceforge.net/.
+
+;; N.B. MH must have been compiled with the MHE compiler flag or several
+;; features necessary for MH-E will be missing from MH commands, specifically
+;; the -build switch to repl and forw.
+
 ;; How to use:
 ;;   M-x mh-rmail to read mail.  Type C-h m there for a list of commands.
 ;;   C-u M-x mh-rmail to visit any folder.
 ;; If you want to customize MH-E before explicitly loading it, add this:
 ;;   (require 'mh-cus-load)
 
-;; MH (Message Handler) is a powerful mail reader.
-
-;; The MH newsgroup is comp.mail.mh; the mailing list is mh-users@ics.uci.edu
-;; (send to mh-users-request to be added). See the monthly Frequently Asked
-;; Questions posting there for information on getting MH and MH-E:
-;;   http://www.faqs.org/faqs/mail/mh-faq/part1/preamble.html
-
-;; N.B. MH must have been compiled with the MHE compiler flag or several
-;; features necessary for MH-E will be missing from MH commands, specifically
-;; the -build switch to repl and forw.
-
-;; MH-E is an Emacs interface to the MH mail system.
-
-;; MH-E is supported in GNU Emacs 21 and 22 as well as XEmacs 21
-;; (except for versions 21.5.9-21.5.16), with MH 6.8.4 on, nmh 1.0.4
-;; on, and GNU mailutils 0.4 on.
-
 ;; Mailing Lists:
 ;;   mh-e-users@lists.sourceforge.net
 ;;   mh-e-announce@lists.sourceforge.net
 
 (mh-require-cl)
 
+(require 'mh-buffers)
+(require 'mh-compat)
+
 (eval-and-compile
   (defvar mh-xemacs-flag (featurep 'xemacs)
     "Non-nil means the current Emacs is XEmacs."))
+
 (mh-do-in-xemacs
   (require 'mh-xemacs))
 
-(require 'mh-buffers)
-(require 'mh-compat)
+(mh-font-lock-add-keywords
+ 'emacs-lisp-mode
+ (eval-when-compile
+   `((,(concat "(\\("
+               ;; Function declarations (use font-lock-function-name-face).
+               "\\(def\\(un\\|macro\\)-mh\\)\\|"
+               ;; Variable declarations (use font-lock-variable-name-face).
+               "\\(def\\(custom\\|face\\)-mh\\)\\|"
+               ;; Group declarations (use font-lock-type-face).
+               "\\(defgroup-mh\\)"
+               "\\)\\>"
+               ;; Any whitespace and defined object.
+               "[ \t'\(]*"
+               "\\(setf[ \t]+\\sw+)\\|\\sw+\\)?")
+      (1 font-lock-keyword-face)
+      (7 (cond ((match-beginning 2) font-lock-function-name-face)
+               ((match-beginning 4) font-lock-variable-name-face)
+               (t font-lock-type-face))
+         nil t)))))
 
 \f
 
 ;; Try to keep variables local to a single file. Provide accessors if
 ;; variables are shared. Use this section as a last resort.
 
-(defconst mh-version "7.85+sans-entropy" "Version number of MH-E.")
+(defconst mh-version "8.0.2" "Version number of MH-E.")
 
 ;; Variants
 
@@ -170,7 +188,7 @@ This directory contains, among other things, the mhl program.")
 (defvar mh-draft-folder nil
   "Cached value of the \"Draft-Folder:\" MH profile component.
 Name of folder containing draft messages.
-Nil means do not use a draft folder.")
+Do not use a draft folder if nil.")
 
 (defvar mh-inbox nil
   "Cached value of the \"Inbox:\" MH profile component.
@@ -426,20 +444,20 @@ gnus-version)
 
 (defun mh-list-to-string-1 (l)
   "Flatten the list L and make every element of the new list into a string."
-  (let ((new-list nil))
-    (while l
-      (cond ((null (car l)))
-            ((symbolp (car l))
-             (setq new-list (cons (symbol-name (car l)) new-list)))
-            ((numberp (car l))
-             (setq new-list (cons (int-to-string (car l)) new-list)))
-            ((equal (car l) ""))
-            ((stringp (car l)) (setq new-list (cons (car l) new-list)))
-            ((listp (car l))
-             (setq new-list (nconc (mh-list-to-string-1 (car l))
-                                   new-list)))
-            (t (error "Bad element in `mh-list-to-string': %s" (car l))))
-      (setq l (cdr l)))
+  (let (new-list)
+    (dolist (element l)
+      (cond ((null element))
+            ((symbolp element)
+             (push (symbol-name element) new-list))
+            ((numberp element)
+             (push (int-to-string element) new-list))
+            ((equal element ""))
+            ((stringp element)
+             (push element new-list))
+            ((listp element)
+             (setq new-list (nconc (mh-list-to-string-1 element) new-list)))
+            (t
+             (error "Bad element: %s" element))))
     new-list))
 
 \f
@@ -464,7 +482,8 @@ all the strings have been used."
           (let ((arg-list (reverse args))
                 (count 0))
             (while (and (not (eobp)) (< count mh-index-max-cmdline-args))
-              (push (buffer-substring-no-properties (point) (line-end-position))
+              (push (buffer-substring-no-properties (point)
+                                                    (mh-line-end-position))
                     arg-list)
               (incf count)
               (forward-line))
@@ -601,7 +620,7 @@ Output is expected to be shown to user, not parsed by MH-E."
   (mh-exchange-point-and-mark-preserving-active-mark))
 
 ;; Shush compiler.
-(eval-when-compile (mh-do-in-xemacs (defvar mark-active)))
+(defvar mark-active)                    ; XEmacs
 
 (defun mh-exchange-point-and-mark-preserving-active-mark ()
   "Put the mark where point is now, and point where the mark is now.
@@ -642,13 +661,66 @@ Set mark after inserted text."
 
 \f
 
+;;; MH-E Customization Support Routines
+
+;; Shush compiler (Emacs 21 and XEmacs).
+(defvar customize-package-emacs-version-alist)
+
+;; Temporary function and data structure used customization.
+;; These will be unbound after the options are defined.
+(defmacro mh-strip-package-version (args)
+  "Strip :package-version keyword and its value from ARGS.
+In Emacs versions that support the :package-version keyword,
+ARGS is returned unchanged."
+  `(if (boundp 'customize-package-emacs-version-alist)
+       ,args
+     (let (seen)
+       (loop for keyword in ,args
+             if (cond ((eq keyword ':package-version) (setq seen t) nil)
+                      (seen (setq seen nil) nil)
+                      (t t))
+             collect keyword))))
+
+(defmacro defgroup-mh (symbol members doc &rest args)
+  "Declare SYMBOL as a customization group containing MEMBERS.
+See documentation for `defgroup' for a description of the arguments
+SYMBOL, MEMBERS, DOC and ARGS.
+This macro is used by Emacs versions that lack the :package-version
+keyword, introduced in Emacs 22."
+  (declare (doc-string 3))
+  `(defgroup ,symbol ,members ,doc ,@(mh-strip-package-version args)))
+(put 'defgroup-mh 'lisp-indent-function 'defun)
+
+(defmacro defcustom-mh (symbol value doc &rest args)
+  "Declare SYMBOL as a customizable variable that defaults to VALUE.
+See documentation for `defcustom' for a description of the arguments
+SYMBOL, VALUE, DOC and ARGS.
+This macro is used by Emacs versions that lack the :package-version
+keyword, introduced in Emacs 22."
+  (declare (doc-string 3))
+  `(defcustom ,symbol ,value ,doc ,@(mh-strip-package-version args)))
+(put 'defcustom-mh 'lisp-indent-function 'defun)
+
+(defmacro defface-mh (face spec doc &rest args)
+  "Declare FACE as a customizable face that defaults to SPEC.
+See documentation for `defface' for a description of the arguments
+FACE, SPEC, DOC and ARGS.
+This macro is used by Emacs versions that lack the :package-version
+keyword, introduced in Emacs 22."
+  (declare (doc-string 3))
+  `(defface ,face ,spec ,doc ,@(mh-strip-package-version args)))
+(put 'defface-mh 'lisp-indent-function 'defun)
+
+\f
+
 ;;; Variant Support
 
-(defcustom mh-path nil
+(defcustom-mh mh-path nil
   "*Additional list of directories to search for MH.
 See `mh-variant'."
   :group 'mh-e
-  :type '(repeat (directory)))
+  :type '(repeat (directory))
+  :package-version '(MH-E "8.0"))
 
 (defun mh-variants ()
   "Return a list of installed variants of MH on the system.
@@ -806,7 +878,9 @@ Currently known variants are 'MH, 'nmh, and 'mu-mh."
 (defun mh-profile-component (component)
   "Return COMPONENT value from mhparam, or nil if unset."
   (save-excursion
-    (mh-exec-cmd-quiet nil "mhparam" "-components" component)
+    ;; MH and nmh use -components, Mailutils uses -component. Since MH
+    ;; and nmh work with an unambiguous prefix, the `s' is dropped here.
+    (mh-exec-cmd-quiet nil "mhparam" "-component" component)
     (mh-profile-component-value component)))
 
 (defun mh-profile-component-value (component)
@@ -855,28 +929,33 @@ finally GNU mailutils."
                (mapconcat '(lambda (x) (format "%s" (car x)))
                           (mh-variants) " or "))))))
 
-(defcustom mh-variant 'autodetect
+(defcustom-mh 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' (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\".
+`exec-path'. If MH-E can't find MH at all, you may have to
+customize `mh-path' and add the directory in which the command
+\"mhparam\" is located. If, on the other hand, you have both nmh
+and mailutils installed (for example) and `mh-variant-in-use' was
+initialized to nmh but you want to use mailutils, then you can
+set this option to \"mailutils\".
 
 When this variable is changed, MH-E resets `mh-progs', `mh-lib',
 `mh-lib-progs', `mh-flists-present-flag', and `mh-variant-in-use'
-accordingly."
+accordingly. Prior to version 8, it was often necessary to set
+some of these variables in \"~/.emacs\"; now it is no longer
+necessary and can actually cause problems."
   :type `(radio
           (const :tag "Auto-detect" autodetect)
           ,@(mapcar (lambda (x) `(const ,(car x))) (mh-variants)))
   :set (lambda (symbol value)
          (set-default symbol value)     ;Done in mh-variant-set-variant!
          (mh-variant-set value))
-  :group 'mh-e)
+  :group 'mh-e
+  :package-version '(MH-E "8.0"))
 
 \f
 
@@ -925,135 +1004,160 @@ windows in the frame are removed."
   (when delete-other-windows-flag
     (delete-other-windows)))
 
+(if (boundp 'customize-package-emacs-version-alist)
+    (add-to-list 'customize-package-emacs-version-alist
+                 '(MH-E ("6.0" . "22.1") ("6.1" . "22.1") ("7.0" . "22.1")
+                        ("7.1" . "22.1") ("7.2" . "22.1") ("7.3" . "22.1")
+                        ("7.4" . "22.1") ("8.0" . "22.1"))))
+
 \f
 
 ;;; MH-E Customization Groups
 
-(defgroup mh-e nil
+(defgroup-mh mh-e nil
   "Emacs interface to the MH mail system.
 MH is the Rand Mail Handler. Other implementations include nmh
 and GNU mailutils."
   :link '(custom-manual "(mh-e)Top")
-  :group 'mail)
+  :group 'mail
+  :package-version '(MH-E . "8.0"))
 
-(defgroup mh-alias nil
+(defgroup-mh mh-alias nil
   "Aliases."
   :link '(custom-manual "(mh-e)Aliases")
   :prefix "mh-alias-"
-  :group 'mh-e)
+  :group 'mh-e
+  :package-version '(MH-E . "7.1"))
 
-(defgroup mh-folder nil
+(defgroup-mh mh-folder nil
   "Organizing your mail with folders."
   :prefix "mh-"
   :link '(custom-manual "(mh-e)Folders")
-  :group 'mh-e)
+  :group 'mh-e
+  :package-version '(MH-E . "7.1"))
 
-(defgroup mh-folder-selection nil
+(defgroup-mh mh-folder-selection nil
   "Folder selection."
   :prefix "mh-"
   :link '(custom-manual "(mh-e)Folder Selection")
-  :group 'mh-e)
+  :group 'mh-e
+  :package-version '(MH-E . "8.0"))
 
-(defgroup mh-identity nil
+(defgroup-mh mh-identity nil
   "Identities."
   :link '(custom-manual "(mh-e)Identities")
   :prefix "mh-identity-"
-  :group 'mh-e)
+  :group 'mh-e
+  :package-version '(MH-E . "7.1"))
 
-(defgroup mh-inc nil
+(defgroup-mh mh-inc nil
   "Incorporating your mail."
   :prefix "mh-inc-"
   :link '(custom-manual "(mh-e)Incorporating Mail")
-  :group 'mh-e)
+  :group 'mh-e
+  :package-version '(MH-E . "8.0"))
 
-(defgroup mh-junk nil
+(defgroup-mh mh-junk nil
   "Dealing with junk mail."
   :link '(custom-manual "(mh-e)Junk")
   :prefix "mh-junk-"
-  :group 'mh-e)
+  :group 'mh-e
+  :package-version '(MH-E . "7.3"))
 
-(defgroup mh-letter nil
+(defgroup-mh mh-letter nil
   "Editing a draft."
   :prefix "mh-"
   :link '(custom-manual "(mh-e)Editing Drafts")
-  :group 'mh-e)
+  :group 'mh-e
+  :package-version '(MH-E . "7.1"))
 
-(defgroup mh-ranges nil
+(defgroup-mh mh-ranges nil
   "Ranges."
   :prefix "mh-"
   :link '(custom-manual "(mh-e)Ranges")
-  :group 'mh-e)
+  :group 'mh-e
+  :package-version '(MH-E . "8.0"))
 
-(defgroup mh-scan-line-formats nil
+(defgroup-mh mh-scan-line-formats nil
   "Scan line formats."
   :link '(custom-manual "(mh-e)Scan Line Formats")
   :prefix "mh-"
-  :group 'mh-e)
+  :group 'mh-e
+  :package-version '(MH-E . "8.0"))
 
-(defgroup mh-search nil
+(defgroup-mh mh-search nil
   "Searching."
   :link '(custom-manual "(mh-e)Searching")
   :prefix "mh-search-"
-  :group 'mh-e)
+  :group 'mh-e
+  :package-version '(MH-E . "8.0"))
 
-(defgroup mh-sending-mail nil
+(defgroup-mh mh-sending-mail nil
   "Sending mail."
   :prefix "mh-"
   :link '(custom-manual "(mh-e)Sending Mail")
-  :group 'mh-e)
+  :group 'mh-e
+  :package-version '(MH-E . "8.0"))
 
-(defgroup mh-sequences nil
+(defgroup-mh mh-sequences nil
   "Sequences."
   :prefix "mh-"
   :link '(custom-manual "(mh-e)Sequences")
-  :group 'mh-e)
+  :group 'mh-e
+  :package-version '(MH-E . "8.0"))
 
-(defgroup mh-show nil
+(defgroup-mh mh-show nil
   "Reading your mail."
   :prefix "mh-"
   :link '(custom-manual "(mh-e)Reading Mail")
-  :group 'mh-e)
+  :group 'mh-e
+  :package-version '(MH-E . "7.1"))
 
-(defgroup mh-speedbar nil
+(defgroup-mh mh-speedbar nil
   "The speedbar."
   :prefix "mh-speed-"
   :link '(custom-manual "(mh-e)Speedbar")
-  :group 'mh-e)
+  :group 'mh-e
+  :package-version '(MH-E . "8.0"))
 
-(defgroup mh-thread nil
+(defgroup-mh mh-thread nil
   "Threading."
   :prefix "mh-thread-"
   :link '(custom-manual "(mh-e)Threading")
-  :group 'mh-e)
+  :group 'mh-e
+  :package-version '(MH-E . "8.0"))
 
-(defgroup mh-tool-bar nil
+(defgroup-mh mh-tool-bar nil
   "The tool bar"
   :link '(custom-manual "(mh-e)Tool Bar")
   :prefix "mh-"
-  :group 'mh-e)
+  :group 'mh-e
+  :package-version '(MH-E . "8.0"))
 
-(defgroup mh-hooks nil
+(defgroup-mh mh-hooks nil
   "MH-E hooks."
   :link '(custom-manual "(mh-e)Top")
   :prefix "mh-"
-  :group 'mh-e)
+  :group 'mh-e
+  :package-version '(MH-E . "7.1"))
 
-(defgroup mh-faces nil
+(defgroup-mh mh-faces nil
   "Faces used in MH-E."
   :link '(custom-manual "(mh-e)Top")
   :prefix "mh-"
   :group 'faces
-  :group 'mh-e)
+  :group 'mh-e
+  :package-version '(MH-E . "7.1"))
 
 \f
 
-;;; Emacs Interface to the MH Mail System (:group mh-e)
+;;; MH-E Customization
 
-;; See Variant Support, above.
+;; See Variant Support, above, for mh-e group.
 
 ;;; Aliases (:group 'mh-alias)
 
-(defcustom mh-alias-completion-ignore-case-flag t
+(defcustom-mh 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
@@ -1061,18 +1165,20 @@ 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)
+  :group 'mh-alias
+  :package-version '(MH-E . "7.1"))
 
-(defcustom mh-alias-expand-aliases-flag nil
+(defcustom-mh mh-alias-expand-aliases-flag nil
   "*Non-nil means to expand aliases entered in the minibuffer.
 
 In other words, aliases entered in the minibuffer will be
 expanded to the full address in the message draft. By default,
 this expansion is not performed."
   :type 'boolean
-  :group 'mh-alias)
+  :group 'mh-alias
+  :package-version '(MH-E . "7.1"))
 
-(defcustom mh-alias-flash-on-comma t
+(defcustom-mh 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
@@ -1082,9 +1188,10 @@ 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))
-  :group 'mh-alias)
+  :group 'mh-alias
+  :package-version '(MH-E . "7.1"))
 
-(defcustom mh-alias-insert-file nil
+(defcustom-mh mh-alias-insert-file nil
   "*Filename used to store a new MH-E alias.
 
 The default setting of this option is \"Use Aliasfile Profile
@@ -1095,9 +1202,10 @@ name, MH-E will prompt for one of them when MH-E adds an alias."
   :type '(choice (const :tag "Use Aliasfile Profile Component" nil)
                  (file :tag "Alias File")
                  (repeat :tag "List of Alias Files" file))
-  :group 'mh-alias)
+  :group 'mh-alias
+  :package-version '(MH-E . "7.1"))
 
-(defcustom mh-alias-insertion-location 'sorted
+(defcustom-mh 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
@@ -1106,10 +1214,11 @@ or \"Bottom\" of your alias file might be more appropriate."
   :type '(choice (const :tag "Alphabetical" sorted)
                  (const :tag "Top" top)
                  (const :tag "Bottom" bottom))
-  :group 'mh-alias)
+  :group 'mh-alias
+  :package-version '(MH-E . "7.1"))
 
-(defcustom mh-alias-local-users t
-  "*If on, local users are added to alias completion.
+(defcustom-mh mh-alias-local-users t
+  "*Non-nil means 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
@@ -1126,9 +1235,10 @@ 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)
+  :group 'mh-alias
+  :package-version '(MH-E . "7.1"))
 
-(defcustom mh-alias-local-users-prefix "local."
+(defcustom-mh mh-alias-local-users-prefix "local."
   "*String prefixed to the real names of users from the password file.
 This option can also be set to \"Use Login\".
 
@@ -1147,9 +1257,10 @@ 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)
+  :group 'mh-alias
+  :package-version '(MH-E . "7.4"))
 
-(defcustom mh-alias-passwd-gecos-comma-separator-flag t
+(defcustom-mh 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
@@ -1158,13 +1269,12 @@ 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)
-
-\f
+  :group 'mh-alias
+  :package-version '(MH-E . "7.4"))
 
 ;;; Organizing Your Mail with Folders (:group 'mh-folder)
 
-(defcustom mh-new-messages-folders t
+(defcustom-mh mh-new-messages-folders t
   "Folders searched for the \"unseen\" sequence.
 
 Set this option to \"Inbox\" to search the \"+inbox\" folder or
@@ -1176,9 +1286,10 @@ 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)
+  :group 'mh-folder
+  :package-version '(MH-E . "8.0"))
 
-(defcustom mh-ticked-messages-folders t
+(defcustom-mh mh-ticked-messages-folders t
   "Folders searched for `mh-tick-seq'.
 
 Set this option to \"Inbox\" to search the \"+inbox\" folder or
@@ -1190,9 +1301,10 @@ 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)
+  :group 'mh-folder
+  :package-version '(MH-E . "8.0"))
 
-(defcustom mh-large-folder 200
+(defcustom-mh 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
@@ -1201,22 +1313,25 @@ 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)
+  :group 'mh-folder
+  :package-version '(MH-E . "7.0"))
 
-(defcustom mh-recenter-summary-flag nil
+(defcustom-mh mh-recenter-summary-flag nil
   "*Non-nil means to recenter the summary window.
 
 If this option is turned on, recenter the summary window when the
 show window is toggled off."
   :type 'boolean
-  :group 'mh-folder)
+  :group 'mh-folder
+  :package-version '(MH-E . "7.0"))
 
-(defcustom mh-recursive-folders-flag nil
+(defcustom-mh mh-recursive-folders-flag nil
   "*Non-nil means that commands which operate on folders do so recursively."
   :type 'boolean
-  :group 'mh-folder)
+  :group 'mh-folder
+  :package-version '(MH-E . "7.0"))
 
-(defcustom mh-sortm-args nil
+(defcustom-mh mh-sortm-args nil
   "*Additional arguments for \"sortm\"\\<mh-folder-mode-map>.
 
 This option is consulted when a prefix argument is used with
@@ -1225,24 +1340,24 @@ 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)
-
-\f
+  :group 'mh-folder
+  :package-version '(MH-E . "8.0"))
 
 ;;; Folder Selection (:group 'mh-folder-selection)
 
-(defcustom mh-default-folder-for-message-function nil
+(defcustom-mh 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."
+When this function is called, the current buffer contains the message
+being refiled and point is 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)
+  :group 'mh-folder-selection
+  :package-version '(MH-E . "8.0"))
 
-(defcustom mh-default-folder-list nil
+(defcustom-mh mh-default-folder-list nil
   "*List of addresses and folders.
 
 The folder name associated with the first address found in this
@@ -1257,9 +1372,10 @@ for more information."
   :type '(repeat (list (regexp :tag "Address")
                        (string :tag "Folder")
                        (boolean :tag "Check Recipient")))
-  :group 'mh-folder-selection)
+  :group 'mh-folder-selection
+  :package-version '(MH-E . "7.2"))
 
-(defcustom mh-default-folder-must-exist-flag t
+(defcustom-mh 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
@@ -1270,18 +1386,18 @@ 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)
+  :group 'mh-folder-selection
+  :package-version '(MH-E . "7.2"))
 
-(defcustom mh-default-folder-prefix ""
+(defcustom-mh mh-default-folder-prefix ""
   "*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."
   :type 'string
-  :group 'mh-folder-selection)
-
-\f
+  :group 'mh-folder-selection
+  :package-version '(MH-E . "7.2"))
 
 ;;; Identities (:group 'mh-identity)
 
@@ -1292,7 +1408,7 @@ for more information."
 Real definition will take effect when mh-identity is loaded."
       nil)))
 
-(defcustom mh-identity-list nil
+(defcustom-mh mh-identity-list nil
   "*List of identities.
 
 To customize this option, click on the \"INS\" button and enter a label
@@ -1358,9 +1474,10 @@ fashion."
   :set (lambda (symbol value)
          (set-default symbol value)
          (mh-identity-make-menu-no-autoload))
-  :group 'mh-identity)
+  :group 'mh-identity
+  :package-version '(MH-E . "7.1"))
 
-(defcustom mh-auto-fields-list nil
+(defcustom-mh 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
@@ -1418,15 +1535,17 @@ as the result is undefined."
                          (cons :tag "Other Field"
                                  (string :tag "Field")
                                  (string :tag "Value"))))))
-  :group 'mh-identity)
+  :group 'mh-identity
+  :package-version '(MH-E . "7.3"))
 
-(defcustom mh-auto-fields-prompt-flag t
+(defcustom-mh mh-auto-fields-prompt-flag t
   "*Non-nil means to prompt before sending if fields inserted.
 See `mh-auto-fields-list'."
   :type 'boolean
-  :group 'mh-identity)
+  :group 'mh-identity
+  :package-version '(MH-E . "8.0"))
 
-(defcustom mh-identity-default nil
+(defcustom-mh mh-identity-default nil
   "Default identity to use when `mh-letter-mode' is called.
 See `mh-identity-list'."
   :type (append
@@ -1434,9 +1553,10 @@ See `mh-identity-list'."
          (cons '(const :tag "None" nil)
                (mapcar (function (lambda (arg) `(const ,arg)))
                        (mapcar 'car mh-identity-list))))
-  :group 'mh-identity)
+  :group 'mh-identity
+  :package-version '(MH-E . "7.1"))
 
-(defcustom mh-identity-handlers
+(defcustom-mh mh-identity-handlers
   '(("From" . mh-identity-handler-top)
     (":default" . mh-identity-handler-bottom)
     (":attribution-verb" . mh-identity-handler-attribution-verb)
@@ -1467,13 +1587,12 @@ 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)
-
-\f
+  :group 'mh-identity
+  :package-version '(MH-E . "8.0"))
 
 ;;; Incorporating Your Mail (:group 'mh-inc)
 
-(defcustom mh-inc-prog "inc"
+(defcustom-mh mh-inc-prog "inc"
   "*Program to incorporate new mail into a folder.
 
 This program generates a one-line summary for each of the new
@@ -1482,7 +1601,8 @@ 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)
+  :group 'mh-inc
+  :package-version '(MH-E . "6.0"))
 
 (eval-and-compile
   (unless (fboundp 'mh-inc-spool-make-no-autoload)
@@ -1491,7 +1611,7 @@ several scan line format variables appropriately."
 Real definition will take effect when mh-inc is loaded."
       nil)))
 
-(defcustom mh-inc-spool-list nil
+(defcustom-mh mh-inc-spool-list nil
   "*Alternate spool files.
 
 You can use the `mh-inc-spool-list' variable to direct MH-E to
@@ -1514,23 +1634,25 @@ 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:
+using the Emacs 22 command \"emacsclient\" as follows:
 
     box ~/mail/mh-e
         title mh-e
         origMode
         polltime 10
         headertime 0
-        command gnudoit -q '(mh-inc-spool-mh-e)'"
+        command emacsclient --eval '(mh-inc-spool-mh-e)'
+
+In XEmacs, the command \"gnuclient\" is used in a similar
+fashion."
   :type '(repeat (list (file :tag "Spool File")
                        (string :tag "Folder")
                        (character :tag "Key Binding")))
   :set (lambda (symbol value)
          (set-default symbol value)
          (mh-inc-spool-make-no-autoload))
-  :group 'mh-inc)
-
-\f
+  :group 'mh-inc
+  :package-version '(MH-E . "7.3"))
 
 ;;; Dealing with Junk Mail (:group 'mh-junk)
 
@@ -1562,24 +1684,32 @@ The function is always called with SYMBOL bound to
                   until (executable-find (symbol-name (car element)))
                   finally return (car element)))))
 
-(defcustom mh-junk-background nil
+(defcustom-mh 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."
+you might try turning on this option.
+
+Note that this option is used as the \"display\" argument in the
+call to `call-process'. Therefore, turning on this option means
+setting its value to \"0\". You can also set its value to t to
+direct the programs' output to the \"*MH-E Log*\" buffer; this
+may be useful for debugging."
   :type '(choice (const :tag "Off" nil)
                  (const :tag "On" 0))
-  :group 'mh-junk)
+  :group 'mh-junk
+  :package-version '(MH-E . "8.0"))
 
-(defcustom mh-junk-disposition nil
+(defcustom-mh mh-junk-disposition nil
   "Disposition of junk mail."
   :type '(choice (const :tag "Delete Spam" nil)
                  (string :tag "Spam Folder"))
-  :group 'mh-junk)
+  :group 'mh-junk
+  :package-version '(MH-E . "8.0"))
 
-(defcustom mh-junk-program nil
+(defcustom-mh mh-junk-program nil
   "Spam program that MH-E should use.
 
 The default setting of this option is \"Auto-detect\" which means
@@ -1592,13 +1722,12 @@ bogofilter, then you can set this option to \"Bogofilter\"."
                  (const :tag "Bogofilter" bogofilter)
                  (const :tag "SpamProbe" spamprobe))
   :set 'mh-junk-choose
-  :group 'mh-junk)
-
-\f
+  :group 'mh-junk
+  :package-version '(MH-E . "7.3"))
 
 ;;; Editing a Draft (:group 'mh-letter)
 
-(defcustom mh-compose-insertion (if (locate-library "mml") 'mml 'mh)
+(defcustom-mh 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
@@ -1609,30 +1738,34 @@ 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)
+  :group 'mh-letter
+  :package-version '(MH-E . "7.0"))
 
-(defcustom mh-compose-skipped-header-fields
+(defcustom-mh mh-compose-skipped-header-fields
   '("From" "Organization" "References" "In-Reply-To"
     "X-Face" "Face" "X-Image-URL" "X-Mailer")
   "List of header fields to skip over when navigating in draft."
   :type '(repeat (string :tag "Field"))
-  :group 'mh-letter)
+  :group 'mh-letter
+  :package-version '(MH-E . "7.4"))
 
-(defcustom mh-compose-space-does-completion-flag nil
+(defcustom-mh mh-compose-space-does-completion-flag nil
   "*Non-nil means \\<mh-letter-mode-map>\\[mh-letter-complete-or-space] does completion in message header."
   :type 'boolean
-  :group 'mh-letter)
+  :group 'mh-letter
+  :package-version '(MH-E . "7.4"))
 
-(defcustom mh-delete-yanked-msg-window-flag nil
+(defcustom-mh mh-delete-yanked-msg-window-flag nil
   "*Non-nil means delete any window displaying the message.
 
 This deletes the window containing the original message after
 yanking it with \\<mh-letter-mode-map>\\[mh-yank-cur-msg] to make
 more room on your screen for your reply."
   :type 'boolean
-  :group 'mh-letter)
+  :group 'mh-letter
+  :package-version '(MH-E . "7.0"))
 
-(defcustom mh-extract-from-attribution-verb "wrote:"
+(defcustom-mh 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].
 
 The attribution consists of the sender's name and email address
@@ -1643,9 +1776,10 @@ followed by the content of this option. This option can be set to
                  (const "a Ã©crit:")
                  (const "schrieb:")
                  (string :tag "Custom String"))
-  :group 'mh-letter)
+  :group 'mh-letter
+  :package-version '(MH-E . "7.0"))
 
-(defcustom mh-ins-buf-prefix "> "
+(defcustom-mh mh-ins-buf-prefix "> "
   "*String to put before each line of a yanked or inserted message.
 
 The prefix \"> \" is the default setting of this option. I
@@ -1658,26 +1792,29 @@ 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)
+  :group 'mh-letter
+  :package-version '(MH-E . "6.0"))
 
-(defcustom mh-letter-complete-function 'ispell-complete-word
+(defcustom-mh mh-letter-complete-function 'ispell-complete-word
   "*Function to call when completing outside of address or folder fields.
 
 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)
+  :group 'mh-letter
+  :package-version '(MH-E . "7.1"))
 
-(defcustom mh-letter-fill-column 72
+(defcustom-mh mh-letter-fill-column 72
   "*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)
+  :group 'mh-letter
+  :package-version '(MH-E . "6.0"))
 
-(defcustom mh-mml-method-default (if mh-pgp-support-flag "pgpmime" "none")
+(defcustom-mh 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
@@ -1697,9 +1834,10 @@ you write!"
                  (const :tag "PGP" "pgp")
                  (const :tag "S/MIME" "smime")
                  (const :tag "None" "none"))
-  :group 'mh-letter)
+  :group 'mh-letter
+  :package-version '(MH-E . "8.0"))
 
-(defcustom mh-signature-file-name "~/.signature"
+(defcustom-mh mh-signature-file-name "~/.signature"
   "*Source of user's signature.
 
 By default, the text of your signature is taken from the file
@@ -1719,9 +1857,10 @@ The signature is inserted into your message with the command
 \\<mh-letter-mode-map>\\[mh-insert-signature] or with the option
 `mh-identity-list'."
   :type 'file
-  :group 'mh-letter)
+  :group 'mh-letter
+  :package-version '(MH-E . "6.0"))
 
-(defcustom mh-signature-separator-flag t
+(defcustom-mh 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
@@ -1729,9 +1868,10 @@ 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)
+  :group 'mh-letter
+  :package-version '(MH-E . "8.0"))
 
-(defcustom mh-x-face-file "~/.face"
+(defcustom-mh 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:\"
@@ -1757,9 +1897,10 @@ To prevent the setting of any of these header fields, either set
 `mh-x-face-file' to nil, or simply ensure that the file defined by
 this option doesn't exist."
   :type 'file
-  :group 'mh-letter)
+  :group 'mh-letter
+  :package-version '(MH-E . "7.0"))
 
-(defcustom mh-yank-behavior 'attribution
+(defcustom-mh mh-yank-behavior 'attribution
   "*Controls which part of a message is yanked by \\<mh-letter-mode-map>\\[mh-yank-cur-msg].
 
 To include the entire message, including the entire header, use
@@ -1801,13 +1942,12 @@ inserted."
                  (const :tag "Body With Attribution" attribution)
                  (const :tag "Body With Attribution, Automatically"
                         autoattrib))
-  :group 'mh-letter)
-
-\f
+  :group 'mh-letter
+  :package-version '(MH-E . "8.0"))
 
 ;;; Ranges (:group 'mh-ranges)
 
-(defcustom mh-interpret-number-as-range-flag t
+(defcustom-mh mh-interpret-number-as-range-flag t
   "*Non-nil means interpret a number as a range.
 
 Since one of the most frequent ranges used is \"last:N\", MH-E
@@ -1815,9 +1955,8 @@ 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)
-
-\f
+  :group 'mh-ranges
+  :package-version '(MH-E . "7.4"))
 
 ;;; Scan Line Formats (:group 'mh-scan-line-formats)
 
@@ -1828,7 +1967,7 @@ message 200, then use the range \"200:200\"."
 Real definition, below, uses variables that aren't defined yet."
       (set-default symbol value))))
 
-(defcustom mh-adaptive-cmd-note-flag t
+(defcustom-mh mh-adaptive-cmd-note-flag t
   "*Non-nil means that the message number width is determined dynamically.
 
 If you've created your own format to handle long message numbers,
@@ -1843,7 +1982,8 @@ call `mh-set-cmd-note' with the width specified by your format file
 you would use \"(mh-set-cmd-note 4)\"."
   :type 'boolean
   :group 'mh-scan-line-formats
-  :set 'mh-adaptive-cmd-note-flag-check)
+  :set 'mh-adaptive-cmd-note-flag-check
+  :package-version '(MH-E . "7.0"))
 
 (defun mh-scan-format-file-check (symbol value)
   "Check if desired setting is legal.
@@ -1856,7 +1996,7 @@ set SYMBOL to VALUE."
              "unless you use \"Use MH-E scan Format\"")
     (set-default symbol value)))
 
-(defcustom mh-scan-format-file t
+(defcustom-mh mh-scan-format-file t
   "Specifies the format file to pass to the scan program.
 
 The default setting for this option is \"Use MH-E scan Format\". This
@@ -1881,7 +2021,8 @@ Emacs start with 0)."
                  (const :tag "Use Default scan Format" nil)
                  (file  :tag "Specify a scan Format File"))
   :group 'mh-scan-line-formats
-  :set 'mh-scan-format-file-check)
+  :set 'mh-scan-format-file-check
+  :package-version '(MH-E . "6.0"))
 
 (defun mh-adaptive-cmd-note-flag-check (symbol value)
   "Check if desired setting is legal.
@@ -1894,7 +2035,7 @@ Otherwise, set SYMBOL to VALUE."
              "is set to \"Use MH-E scan Format\"")
     (set-default symbol value)))
 
-(defcustom mh-scan-prog "scan"
+(defcustom-mh mh-scan-prog "scan"
   "*Program used to scan messages.
 
 The name of the program that generates a listing of one line per
@@ -1903,14 +2044,13 @@ 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)
+  :group 'mh-scan-line-formats
+  :package-version '(MH-E . "6.0"))
 (make-variable-buffer-local 'mh-scan-prog)
 
-\f
-
 ;;; Searching (:group 'mh-search)
 
-(defcustom mh-search-program nil
+(defcustom-mh mh-search-program nil
   "Search program that MH-E shall use.
 
 The default setting of this option is \"Auto-detect\" which means
@@ -1928,13 +2068,12 @@ MH-E can be found in the documentation of `mh-search'."
                  (const :tag "namazu" namazu)
                  (const :tag "pick" pick)
                  (const :tag "grep" grep))
-  :group 'mh-search)
-
-\f
+  :group 'mh-search
+  :package-version '(MH-E . "8.0"))
 
 ;;; Sending Mail (:group 'mh-sending-mail)
 
-(defcustom mh-compose-forward-as-mime-flag t
+(defcustom-mh mh-compose-forward-as-mime-flag t
   "*Non-nil means that messages are forwarded as attachments.
 
 By default, this option is on which means that the forwarded
@@ -1947,9 +2086,10 @@ 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)
+  :group 'mh-sending-mail
+  :package-version '(MH-E . "8.0"))
 
-(defcustom mh-compose-letter-function nil
+(defcustom-mh mh-compose-letter-function nil
   "Invoked when starting a new draft.
 
 However, it is the last function called before you edit your
@@ -1958,32 +2098,36 @@ 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)
+  :group 'mh-sending-mail
+  :package-version '(MH-E . "6.0"))
 
-(defcustom mh-compose-prompt-flag nil
+(defcustom-mh mh-compose-prompt-flag nil
   "*Non-nil means prompt for header fields when composing a new draft."
   :type 'boolean
-  :group 'mh-sending-mail)
+  :group 'mh-sending-mail
+  :package-version '(MH-E . "7.4"))
 
-(defcustom mh-forward-subject-format "%s: %s"
+(defcustom-mh mh-forward-subject-format "%s: %s"
   "*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)
+  :group 'mh-sending-mail
+  :package-version '(MH-E . "6.0"))
 
-(defcustom mh-insert-x-mailer-flag t
+(defcustom-mh mh-insert-x-mailer-flag t
   "*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)
+  :group 'mh-sending-mail
+  :package-version '(MH-E . "7.0"))
 
-(defcustom mh-redist-full-contents-flag nil
+(defcustom-mh 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
@@ -1992,9 +2136,10 @@ 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)
+  :group 'mh-sending-mail
+  :package-version '(MH-E . "8.0"))
 
-(defcustom mh-reply-default-reply-to nil
+(defcustom-mh mh-reply-default-reply-to nil
   "*Sets the person or persons to whom a reply will be sent.
 
 This option is set to \"Prompt\" by default so that you are
@@ -2007,9 +2152,10 @@ this option to \"cc\". Other choices include \"from\", \"to\", or
                  (const "to")
                  (const "cc")
                  (const "all"))
-  :group 'mh-sending-mail)
+  :group 'mh-sending-mail
+  :package-version '(MH-E . "6.0"))
 
-(defcustom mh-reply-show-message-flag t
+(defcustom-mh mh-reply-show-message-flag t
   "*Non-nil means the MH-Show buffer is displayed when replying.
 
 If you include the message automatically, you can hide the
@@ -2017,9 +2163,8 @@ MH-Show buffer by turning off this option.
 
 See also `mh-reply'."
   :type 'boolean
-  :group 'mh-sending-mail)
-
-\f
+  :group 'mh-sending-mail
+  :package-version '(MH-E . "7.0"))
 
 ;;; Sequences (:group 'mh-sequences)
 
@@ -2027,7 +2172,7 @@ See also `mh-reply'."
 ;; 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
+(defcustom-mh mh-refile-preserves-sequences-flag t
   "*Non-nil means that sequences are preserved when messages are refiled.
 
 If a message is in any sequence (except \"Previous-Sequence:\"
@@ -2035,9 +2180,10 @@ 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)
+  :group 'mh-sequences
+  :package-version '(MH-E . "7.4"))
 
-(defcustom mh-tick-seq 'tick
+(defcustom-mh mh-tick-seq 'tick
   "The name of the MH sequence for ticked messages.
 
 You can customize this option if you already use the \"tick\"
@@ -2046,9 +2192,10 @@ 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)
+  :group 'mh-sequences
+  :package-version '(MH-E . "7.3"))
 
-(defcustom mh-update-sequences-after-mh-show-flag t
+(defcustom-mh mh-update-sequences-after-mh-show-flag t
   "*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
@@ -2060,13 +2207,12 @@ 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)
-
-\f
+  :group 'mh-sequences
+  :package-version '(MH-E . "7.0"))
 
 ;;; Reading Your Mail (:group 'mh-show)
 
-(defcustom mh-bury-show-buffer-flag t
+(defcustom-mh mh-bury-show-buffer-flag t
   "*Non-nil means show buffer is buried.
 
 One advantage of not burying the show buffer is that one can
@@ -2074,17 +2220,19 @@ 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)
+  :group 'mh-show
+  :package-version '(MH-E . "7.0"))
 
-(defcustom mh-clean-message-header-flag t
+(defcustom-mh mh-clean-message-header-flag t
   "*Non-nil means remove extraneous header fields.
 
 See also `mh-invisible-header-fields-default' and
 `mh-invisible-header-fields'."
   :type 'boolean
-  :group 'mh-show)
+  :group 'mh-show
+  :package-version '(MH-E . "7.0"))
 
-(defcustom mh-decode-mime-flag (not (not (locate-library "mm-decode")))
+(defcustom-mh mh-decode-mime-flag (not (not (locate-library "mm-decode")))
   "*Non-nil means attachments are handled\\<mh-folder-mode-map>.
 
 MH-E can handle attachments as well if the Gnus `mm-decode'
@@ -2099,9 +2247,10 @@ 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)
+  :group 'mh-show
+  :package-version '(MH-E . "7.0"))
 
-(defcustom mh-display-buttons-for-alternatives-flag nil
+(defcustom-mh mh-display-buttons-for-alternatives-flag nil
   "*Non-nil means display buttons for all alternative attachments.
 
 Sometimes, a mail program will produce multiple alternatives of
@@ -2110,9 +2259,10 @@ 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)
+  :group 'mh-show
+  :package-version '(MH-E . "7.4"))
 
-(defcustom mh-display-buttons-for-inline-parts-flag nil
+(defcustom-mh mh-display-buttons-for-inline-parts-flag nil
   "*Non-nil means display buttons for all inline attachments\\<mh-folder-mode-map>.
 
 The sender can request that attachments should be viewed inline so
@@ -2132,9 +2282,10 @@ 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)
+  :group 'mh-show
+  :package-version '(MH-E . "7.0"))
 
-(defcustom mh-do-not-confirm-flag nil
+(defcustom-mh mh-do-not-confirm-flag nil
   "*Non-nil means non-reversible commands do not prompt for confirmation.
 
 Commands such as `mh-pack-folder' prompt to confirm whether to
@@ -2143,9 +2294,10 @@ 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)
+  :group 'mh-show
+  :package-version '(MH-E . "7.0"))
 
-(defcustom mh-fetch-x-image-url nil
+(defcustom-mh 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
@@ -2178,9 +2330,10 @@ turned on."
 
   :type '(choice (const :tag "Ask Before Fetching" ask)
                  (const :tag "Never Fetch" nil))
-  :group 'mh-show)
+  :group 'mh-show
+  :package-version '(MH-E . "7.3"))
 
-(defcustom mh-graphical-smileys-flag t
+(defcustom-mh mh-graphical-smileys-flag t
   "*Non-nil means graphical smileys are displayed.
 
 It is a long standing custom to inject body language using a
@@ -2192,9 +2345,10 @@ and ;-).
 This option is disabled if the option `mh-decode-mime-flag' is
 turned off."
   :type 'boolean
-  :group 'mh-show)
+  :group 'mh-show
+  :package-version '(MH-E . "7.0"))
 
-(defcustom mh-graphical-emphasis-flag t
+(defcustom-mh mh-graphical-emphasis-flag t
   "*Non-nil means graphical emphasis is displayed.
 
 A few typesetting features are indicated in ASCII text with
@@ -2208,9 +2362,10 @@ whole list.
 This option is disabled if the option `mh-decode-mime-flag' is
 turned off."
   :type 'boolean
-  :group 'mh-show)
+  :group 'mh-show
+  :package-version '(MH-E . "7.0"))
 
-(defcustom mh-highlight-citation-style 'gnus
+(defcustom-mh mh-highlight-citation-style 'gnus
   "Style for highlighting citations.
 
 If the sender of the message has cited other messages in his
@@ -2223,7 +2378,8 @@ of citations entirely, choose \"None\"."
   :type '(choice (const :tag "Multicolor" gnus)
                  (const :tag "Monochrome" font-lock)
                  (const :tag "None" nil))
-  :group 'mh-show)
+  :group 'mh-show
+  :package-version '(MH-E . "8.0"))
 
 ;; Keep fields alphabetized. Mention source, if known.
 (defvar mh-invisible-header-fields-internal
@@ -2284,6 +2440,7 @@ of citations entirely, choose \"None\"."
     "Ua-Content-Id:"                    ; X400
 ;;  "User-Agent:"                       ; Similar to X-Mailer, so display it.
     "Via:"                              ; MH
+    "X-AOL-IP:"                         ; AOL WebMail
     "X-Abuse-Info:"
     "X-Abuse-and-DMCA-"
     "X-Accept-Language:"
@@ -2293,15 +2450,20 @@ of citations entirely, choose \"None\"."
     "X-AntiAbuse:"                      ; cPanel
     "X-Apparently-From:"                ; MS Outlook
     "X-Apparently-To:"           ; Egroups/yahoogroups mailing list manager
+    "X-Authenticated-Sender:"           ; AT&T Message Center (webmail)
     "X-Authentication-Warning:"         ; sendmail
+    "X-Barracuda-"                      ; Barracuda spam scores
     "X-Beenthere:"                      ; Mailman mailing list manager
     "X-Bogosity:"                       ; bogofilter
-    "X-Bugzilla-*"                      ; Bugzilla
+    "X-BrightmailFiltered:"             ; Brightmail
+    "X-Brightmail-Tracker:"             ; Brightmail
+    "X-Bugzilla-"                       ; Bugzilla
     "X-Complaints-To:"
     "X-ContentStamp:"                   ; NetZero
     "X-Cron-Env:"
     "X-DMCA"
     "X-Delivered"
+    "X-EFL-Spamscore:"                  ; MIT alumni spam filtering
     "X-ELNK-Trace:"                     ; Earthlink mailer
     "X-Envelope-Date:"                  ; GNU mailutils
     "X-Envelope-From:"
@@ -2323,7 +2485,9 @@ of citations entirely, choose \"None\"."
     "X-Habeas-SWE-7:"                   ; Spam
     "X-Habeas-SWE-8:"                   ; Spam
     "X-Habeas-SWE-9:"                   ; Spam
+    "X-Hashcash:"                       ; hashcash
     "X-Info:"                           ; NTMail
+    "X-IronPort-AV:"                    ; IronPort AV
     "X-Juno-"                           ; Juno
     "X-List-Host:"                      ; Unknown mailing list managers
     "X-List-Subscribe:"                 ; Unknown mailing list managers
@@ -2333,12 +2497,15 @@ of citations entirely, choose \"None\"."
     "X-Loop:"                           ; Unknown mailing list managers
     "X-Lumos-SenderID:"                 ; Roving ConstantContact
     "X-MAIL-INFO:"                      ; NetZero
-    "X-MHE-Checksum"                    ; Checksum added during index search
+    "X-MB-Message-"                     ; AOL WebMail
+    "X-MHE-Checksum:"                   ; Checksum added during index search
     "X-MIME-Autoconverted:"             ; sendmail
     "X-MIMETrack:"
     "X-MS-"                             ; MS Outlook
+    "X-Mail-from:"                      ; fastmail.fm
     "X-MailScanner"                     ; ListProc(tm) by CREN
     "X-Mailing-List:"                   ; Unknown mailing list managers
+    "X-Mailman-Approved-At:"            ; Mailman mailing list manager
     "X-Mailman-Version:"                ; Mailman mailing list manager
     "X-Majordomo:"                      ; Majordomo mailing list manager
     "X-Message-Id"
@@ -2362,19 +2529,23 @@ of citations entirely, choose \"None\"."
     "X-Originating-IP:"                 ; Hotmail
     "X-Postfilter:"
     "X-Priority:"                       ; MS Outlook
+    "X-Provags-ID:"
     "X-Qotd-"                           ; User added
     "X-RM"
     "X-Received-Date:"
     "X-Received:"
     "X-Request-"
+    "X-Resolved-to:"                    ; fastmail.fm
     "X-Return-Path-Hint:"               ; Roving ConstantContact
-    "X-Roving-*"                        ; Roving ConstantContact
+    "X-Roving-"                         ; Roving ConstantContact
+    "X-SA-Exim-"                        ; Exim SpamAssassin
     "X-SBClass:"                        ; Spam
     "X-SBNote:"                         ; Spam
     "X-SBPass:"                         ; Spam
     "X-SBRule:"                         ; Spam
     "X-SMTP-"
-    "X-Scanned-By"
+    "X-Sasl-enc:"                       ; Apple Mail
+    "X-Scanned-By:"
     "X-Sender:"
     "X-Server-Date:"
     "X-Server-Uuid:"
@@ -2422,7 +2593,7 @@ Because the function `mh-invisible-headers' uses both
 `mh-invisible-header-fields' and `mh-invisible-header-fields', it
 cannot be run until both variables have been initialized.")
 
-(defcustom mh-invisible-header-fields nil
+(defcustom-mh mh-invisible-header-fields nil
   "*Additional header fields to hide.
 
 Header fields that you would like to hide that aren't listed in
@@ -2440,9 +2611,10 @@ See also `mh-clean-message-header-flag'."
   :set (lambda (symbol value)
          (set-default symbol value)
          (mh-invisible-headers))
-  :group 'mh-show)
+  :group 'mh-show
+  :package-version '(MH-E . "7.1"))
 
-(defcustom mh-invisible-header-fields-default nil
+(defcustom-mh mh-invisible-header-fields-default nil
   "*List of hidden header fields.
 
 The header fields listed in this option are hidden, although you
@@ -2457,7 +2629,8 @@ See also `mh-clean-message-header-flag'."
   :set (lambda (symbol value)
          (set-default symbol value)
          (mh-invisible-headers))
-  :group 'mh-show)
+  :group 'mh-show
+  :package-version '(MH-E . "8.0"))
 
 (defvar mh-invisible-header-fields-compiled nil
   "*Regexp matching lines in a message header that are not to be shown.
@@ -2494,7 +2667,7 @@ removed and entries from `mh-invisible-header-fields' are added."
 ;; Compile invisible header fields.
 (mh-invisible-headers)
 
-(defcustom mh-lpr-command-format "lpr -J '%s'"
+(defcustom-mh mh-lpr-command-format "lpr -J '%s'"
   "*Command used to print\\<mh-folder-mode-map>.
 
 This option contains the Unix command line which performs the
@@ -2508,9 +2681,10 @@ 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)
+  :group 'mh-show
+  :package-version '(MH-E . "6.0"))
 
-(defcustom mh-max-inline-image-height nil
+(defcustom-mh mh-max-inline-image-height nil
   "*Maximum inline image height if \"Content-Disposition:\" is not present.
 
 Some older mail programs do not insert this needed plumbing to
@@ -2523,9 +2697,10 @@ the options `mh-max-inline-image-width' and
 a large number. The size of your screen is a good choice for
 these numbers."
   :type '(choice (const nil) integer)
-  :group 'mh-show)
+  :group 'mh-show
+  :package-version '(MH-E . "7.0"))
 
-(defcustom mh-max-inline-image-width nil
+(defcustom-mh mh-max-inline-image-width nil
   "*Maximum inline image width if \"Content-Disposition:\" is not present.
 
 Some older mail programs do not insert this needed plumbing to
@@ -2538,9 +2713,10 @@ the options `mh-max-inline-image-width' and
 a large number. The size of your screen is a good choice for
 these numbers."
   :type '(choice (const nil) integer)
-  :group 'mh-show)
+  :group 'mh-show
+  :package-version '(MH-E . "7.0"))
 
-(defcustom mh-mhl-format-file nil
+(defcustom-mh 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
@@ -2561,9 +2737,10 @@ 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)
+  :group 'mh-show
+  :package-version '(MH-E . "8.0"))
 
-(defcustom mh-mime-save-parts-default-directory t
+(defcustom-mh mh-mime-save-parts-default-directory 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
@@ -2576,9 +2753,10 @@ directory's name."
   :type '(choice (const :tag "Prompt the First Time" nil)
                  (const :tag "Prompt Always" t)
                  directory)
-  :group 'mh-show)
+  :group 'mh-show
+  :package-version '(MH-E . "7.0"))
 
-(defcustom mh-print-background-flag nil
+(defcustom-mh mh-print-background-flag nil
   "*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
@@ -2591,34 +2769,20 @@ 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)
+  :group 'mh-show
+  :package-version '(MH-E . "7.0"))
 
-(defcustom mh-show-maximum-size 0
+(defcustom-mh mh-show-maximum-size 0
   "*Maximum size of message (in bytes) to display automatically.
 
 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-use-goto-addr-flag (and (boundp 'goto-address-highlight-p)
-                                           goto-address-highlight-p)
-  "*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.
+  :group 'mh-show
+  :package-version '(MH-E . "8.0"))
 
-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)
+(defcustom-mh mh-show-use-xface-flag (>= emacs-major-version 21)
   "*Non-nil means display face images in MH-show buffers.
 
 MH-E can display the content of \"Face:\", \"X-Face:\", and
@@ -2655,9 +2819,10 @@ 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)
+  :group 'mh-show
+  :package-version '(MH-E . "7.0"))
 
-(defcustom mh-store-default-directory nil
+(defcustom-mh mh-store-default-directory nil
   "*Default directory for \\<mh-folder-mode-map>\\[mh-store-msg].
 
 If you would like to change the initial default directory,
@@ -2666,9 +2831,10 @@ customize this option, change the value from \"Current\" to
 the content of these messages."
   :type '(choice (const :tag "Current" nil)
                  directory)
-  :group 'mh-show)
+  :group 'mh-show
+  :package-version '(MH-E . "6.0"))
 
-(defcustom mh-summary-height nil
+(defcustom-mh mh-summary-height nil
   "*Number of lines in MH-Folder buffer (including the mode line).
 
 The default value of this option is \"Automatic\" which means
@@ -2678,23 +2844,21 @@ 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 Size"))
-  :group 'mh-show)
-
-\f
+  :group 'mh-show
+  :package-version '(MH-E . "7.4"))
 
 ;;; The Speedbar (:group 'mh-speedbar)
 
-(defcustom mh-speed-update-interval 60
+(defcustom-mh mh-speed-update-interval 60
   "Time between speedbar updates in seconds.
 Set to 0 to disable automatic update."
   :type 'integer
-  :group 'mh-speedbar)
-
-\f
+  :group 'mh-speedbar
+  :package-version '(MH-E . "8.0"))
 
 ;;; Threading (:group 'mh-thread)
 
-(defcustom mh-show-threads-flag nil
+(defcustom-mh 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
@@ -2702,16 +2866,15 @@ 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-thread)
-
-\f
+  :group 'mh-thread
+  :package-version '(MH-E . "7.1"))
 
 ;;; The Tool Bar (:group 'mh-tool-bar)
 
 ;; mh-tool-bar-folder-buttons and mh-tool-bar-letter-buttons defined
 ;; dynamically in mh-tool-bar.el.
 
-(defcustom mh-tool-bar-search-function 'mh-search
+(defcustom-mh 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
@@ -2719,11 +2882,12 @@ By default, this is set to `mh-search'. You can also choose
 of your own choosing."
   :type '(choice (const mh-search)
                  (function :tag "Other Function"))
-  :group 'mh-tool-bar)
+  :group 'mh-tool-bar
+  :package-version '(MH-E . "7.0"))
 
 ;; XEmacs has a couple of extra customizations...
 (mh-do-in-xemacs
-  (defcustom mh-xemacs-use-tool-bar-flag mh-xemacs-has-tool-bar-flag
+  (defcustom-mh 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
@@ -2736,9 +2900,10 @@ won't be able to turn on this option."
            (if (and (eq value t)
                     (not mh-xemacs-has-tool-bar-flag))
                (error "Tool bar not supported"))
-           (set-default symbol value)))
+           (set-default symbol value))
+    :package-version '(MH-E . "7.3"))
 
-  (defcustom mh-xemacs-tool-bar-position nil
+  (defcustom-mh mh-xemacs-tool-bar-position nil
     "*Tool bar location.
 
 This option controls the placement of the tool bar along the four
@@ -2753,13 +2918,14 @@ default tool bar."
                   (const :tag "Bottom" :value bottom)
                   (const :tag "Left" :value left)
                   (const :tag "Right" :value right))
-    :group 'mh-tool-bar))
+    :group 'mh-tool-bar
+    :package-version '(MH-E . "7.3")))
 
 \f
 
 ;;; Hooks (:group 'mh-hooks + group where hook described)
 
-(defcustom mh-after-commands-processed-hook nil
+(defcustom-mh mh-after-commands-processed-hook nil
   "Hook run by \\<mh-folder-mode-map>\\[mh-execute-commands] after performing outstanding refile and delete requests.
 
 Variables that are useful in this hook include
@@ -2768,15 +2934,17 @@ deletes and refiles. This list will always include the current
 folder, which is also available in `mh-current-folder'."
   :type 'hook
   :group 'mh-hooks
-  :group 'mh-folder)
+  :group 'mh-folder
+  :package-version '(MH-E . "8.0"))
 
-(defcustom mh-alias-reloaded-hook nil
+(defcustom-mh mh-alias-reloaded-hook nil
   "Hook run by `mh-alias-reload' after loading aliases."
   :type 'hook
   :group 'mh-hooks
-  :group 'mh-alias)
+  :group 'mh-alias
+  :package-version '(MH-E . "8.0"))
 
-(defcustom mh-before-commands-processed-hook nil
+(defcustom-mh mh-before-commands-processed-hook nil
   "Hook run by \\<mh-folder-mode-map>\\[mh-execute-commands] before performing outstanding refile and delete requests.
 
 Variables that are useful in this hook include `mh-delete-list'
@@ -2784,9 +2952,10 @@ 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)
+  :group 'mh-folder
+  :package-version '(MH-E . "8.0"))
 
-(defcustom mh-before-quit-hook nil
+(defcustom-mh mh-before-quit-hook nil
   "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
@@ -2796,9 +2965,10 @@ abort the quit or call `mh-execute-commands', for example.
 See also `mh-quit-hook'."
   :type 'hook
   :group 'mh-hooks
-  :group 'mh-folder)
+  :group 'mh-folder
+  :package-version '(MH-E . "6.0"))
 
-(defcustom mh-before-send-letter-hook nil
+(defcustom-mh mh-before-send-letter-hook nil
   "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
@@ -2806,18 +2976,20 @@ before sending, add the `ispell-message' function."
   :type 'hook
   :options '(ispell-message)
   :group 'mh-hooks
-  :group 'mh-letter)
+  :group 'mh-letter
+  :package-version '(MH-E . "6.0"))
 
-(defcustom mh-delete-msg-hook nil
+(defcustom-mh mh-delete-msg-hook nil
   "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)
+  :group 'mh-show
+  :package-version '(MH-E . "6.0"))
 
-(defcustom mh-find-path-hook nil
+(defcustom-mh 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
@@ -2825,27 +2997,31 @@ This hook can be used the change the value of the variables that
 between MH and MH-E."
   :type 'hook
   :group 'mh-hooks
-  :group 'mh-e)
+  :group 'mh-e
+  :package-version '(MH-E . "7.0"))
 
-(defcustom mh-folder-mode-hook nil
+(defcustom-mh mh-folder-mode-hook nil
   "Hook run by `mh-folder-mode' when visiting a new folder."
   :type 'hook
   :group 'mh-hooks
-  :group 'mh-folder)
+  :group 'mh-folder
+  :package-version '(MH-E . "6.0"))
 
-(defcustom mh-forward-hook nil
+(defcustom-mh mh-forward-hook nil
   "Hook run by `mh-forward' on a forwarded letter."
   :type 'hook
   :group 'mh-hooks
-  :group 'mh-sending-mail)
+  :group 'mh-sending-mail
+  :package-version '(MH-E . "8.0"))
 
-(defcustom mh-inc-folder-hook nil
+(defcustom-mh mh-inc-folder-hook nil
   "Hook run by \\<mh-folder-mode-map>\\[mh-inc-folder] after incorporating mail into a folder."
   :type 'hook
   :group 'mh-hooks
-  :group 'mh-inc)
+  :group 'mh-inc
+  :package-version '(MH-E . "6.0"))
 
-(defcustom mh-insert-signature-hook nil
+(defcustom-mh 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
@@ -2853,9 +3029,10 @@ function used to insert the signature with
 `mh-signature-file-name'."
   :type 'hook
   :group 'mh-hooks
-  :group 'mh-letter)
+  :group 'mh-letter
+  :package-version '(MH-E . "8.0"))
 
-(defcustom mh-kill-folder-suppress-prompt-hooks '(mh-search-p)
+(defcustom-mh 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
@@ -2870,9 +3047,10 @@ 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)
+  :group 'mh-folder
+  :package-version '(MH-E . "7.4"))
 
-(defcustom mh-letter-mode-hook nil
+(defcustom-mh mh-letter-mode-hook nil
   "Hook run by `mh-letter-mode' on a new letter.
 
 This hook allows you to do some processing before editing a
@@ -2882,15 +3060,17 @@ letter. For example, you may wish to modify the header after
 go."
   :type 'hook
   :group 'mh-hooks
-  :group 'mh-sending-mail)
+  :group 'mh-sending-mail
+  :package-version '(MH-E . "6.0"))
 
-(defcustom mh-mh-to-mime-hook nil
+(defcustom-mh 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-letter)
+  :group 'mh-letter
+  :package-version '(MH-E . "8.0"))
 
-(defcustom mh-search-mode-hook nil
+(defcustom-mh 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
@@ -2899,9 +3079,10 @@ 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)
+  :group 'mh-search
+  :package-version '(MH-E . "8.0"))
 
-(defcustom mh-quit-hook nil
+(defcustom-mh mh-quit-hook nil
   "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
@@ -2910,15 +3091,17 @@ modify the window setup.
 See also `mh-before-quit-hook'."
   :type 'hook
   :group 'mh-hooks
-  :group 'mh-folder)
+  :group 'mh-folder
+  :package-version '(MH-E . "6.0"))
 
-(defcustom mh-refile-msg-hook nil
+(defcustom-mh mh-refile-msg-hook nil
   "Hook run by \\<mh-folder-mode-map>\\[mh-refile-msg] after marking each message for refiling."
   :type 'hook
   :group 'mh-hooks
-  :group 'mh-folder)
+  :group 'mh-folder
+  :package-version '(MH-E . "6.0"))
 
-(defcustom mh-show-hook nil
+(defcustom-mh mh-show-hook nil
   "Hook run after \\<mh-folder-mode-map>\\[mh-show] shows a message.
 
 It is the last thing called after messages are displayed. It's
@@ -2926,9 +3109,10 @@ 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)
+  :group 'mh-show
+  :package-version '(MH-E . "6.0"))
 
-(defcustom mh-show-mode-hook nil
+(defcustom-mh mh-show-mode-hook nil
   "Hook run upon entry to `mh-show-mode'.
 
 This hook is called early on in the process of the message
@@ -2936,9 +3120,10 @@ 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)
+  :group 'mh-show
+  :package-version '(MH-E . "6.0"))
 
-(defcustom mh-unseen-updated-hook nil
+(defcustom-mh mh-unseen-updated-hook nil
   "Hook run after the unseen sequence has been updated.
 
 The variable `mh-seen-list' can be used by this hook to obtain
@@ -2946,7 +3131,8 @@ the list of messages which were removed from the unseen
 sequence."
   :type 'hook
   :group 'mh-hooks
-  :group 'mh-sequences)
+  :group 'mh-sequences
+  :package-version '(MH-E . "6.0"))
 
 \f
 
@@ -2955,331 +3141,415 @@ sequence."
 (if (boundp 'facemenu-unlisted-faces)
     (add-to-list 'facemenu-unlisted-faces "^mh-"))
 
+;; To add a new face:
+;; 1. Add entry to variable mh-face-data.
+;; 2. Create face using defface-mh (which removes min-color spec and
+;;    :package-version keyword where these are not supported),
+;;    accessing face data with function mh-face-data.
+;; 3. Add inherit argument to function mh-face-data if applicable.
+(defvar mh-face-data
+  '((mh-folder-followup
+     ((((class color) (background light))
+       (:foreground "blue3"))
+      (((class color) (background dark))
+       (:foreground "LightGoldenRod"))
+      (t
+       (:bold t))))
+    (mh-folder-msg-number
+     ((((class color) (min-colors 64) (background light))
+       (:foreground "snow4"))
+      (((class color) (min-colors 64) (background dark))
+       (:foreground "snow3"))
+      (((class color) (background light))
+       (:foreground "purple"))
+      (((class color) (background dark))
+       (:foreground "cyan"))))
+    (mh-folder-refiled
+     ((((class color) (min-colors 64) (background light))
+       (:foreground "DarkGoldenrod"))
+      (((class color) (min-colors 64) (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))))
+    (mh-folder-subject
+     ((((class color) (background light))
+       (:foreground "blue4"))
+      (((class color) (background dark))
+       (:foreground "yellow"))
+      (t
+       (:bold t))))
+    (mh-folder-tick
+     ((((class color) (background light))
+       (:background "#dddf7e"))
+      (((class color) (background dark))
+       (:background "#dddf7e"))
+      (t
+       (:underline t))))
+    (mh-folder-to
+     ((((class color) (min-colors 64) (background light))
+       (:foreground "RosyBrown"))
+      (((class color) (min-colors 64) (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))))
+    (mh-letter-header-field
+     ((((class color) (background light))
+       (:background "gray90"))
+      (((class color) (background dark))
+       (:background "gray10"))
+      (t
+       (:bold t))))
+    (mh-search-folder
+     ((((class color) (background light))
+       (:foreground "dark green" :bold t))
+      (((class color) (background dark))
+       (:foreground "indian red" :bold t))
+      (t
+       (:bold t))))
+    (mh-show-cc
+     ((((class color) (min-colors 64) (background light))
+       (:foreground "DarkGoldenrod"))
+      (((class color) (min-colors 64) (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))))
+    (mh-show-date
+     ((((class color) (min-colors 64) (background light))
+       (:foreground "ForestGreen"))
+      (((class color) (min-colors 64) (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))))
+    (mh-show-from
+     ((((class color) (background light))
+       (:foreground "red3"))
+      (((class color) (background dark))
+       (:foreground "cyan"))
+      (t
+       (:bold t))))
+    (mh-show-header
+     ((((class color) (min-colors 64) (background light))
+       (:foreground "RosyBrown"))
+      (((class color) (min-colors 64) (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))))
+    (mh-show-pgg-bad ((t (:bold t :foreground "DeepPink1"))))
+    (mh-show-pgg-good ((t (:bold t :foreground "LimeGreen"))))
+    (mh-show-pgg-unknown ((t (:bold t :foreground "DarkGoldenrod2"))))
+    (mh-show-signature ((t (:italic t))))
+    (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))))
+    (mh-speedbar-folder
+     ((((class color) (background light))
+       (:foreground "blue4"))
+      (((class color) (background dark))
+       (:foreground "light blue"))))
+    (mh-speedbar-selected-folder
+     ((((class color) (background light))
+       (:foreground "red1" :underline t))
+      (((class color) (background dark))
+       (:foreground "red1" :underline t))
+      (t
+       (:underline t)))))
+  "MH-E face data.
+Used by function `mh-face-data' which returns spec that is
+consumed by `defface-mh'.")
+
+(require 'cus-face)
+
+(defvar mh-inherit-face-flag (assq :inherit custom-face-attributes)
+  "Non-nil means that the `defface' :inherit keyword is available.
+The :inherit keyword is available on all supported versions of
+GNU Emacs and XEmacs from at least 21.5.23 on.")
+
 (defvar mh-min-colors-defined-flag (and (not mh-xemacs-flag)
                                         (>= emacs-major-version 22))
-  "Non-nil means defface supports min-colors display requirement.")
-
-(defun mh-defface-compat (spec)
-  "Convert SPEC for defface if necessary to run on older platforms.
-Modifies SPEC in place and returns it. See `defface' for the spec definition.
-
-When `mh-min-colors-defined-flag' is nil, this function finds
-display entries with \"min-colors\" requirements and either
-removes the \"min-colors\" requirement or strips the display
-entirely if the display does not support the number of specified
-colors."
-  (if mh-min-colors-defined-flag
-      spec
-    (let ((cells (display-color-cells))
-          new-spec)
-      ;; Remove entries with min-colors, or delete them if we have fewer colors
-      ;; than they specify.
-      (loop for entry in (reverse spec) do
-            (let ((requirement (if (eq (car entry) t)
-                                   nil
-                                 (assoc 'min-colors (car entry)))))
-              (if requirement
-                  (when (>= cells (nth 1 requirement))
-                    (setq new-spec (cons (cons (delq requirement (car entry))
-                                               (cdr entry))
-                                         new-spec)))
-                (setq new-spec (cons entry new-spec)))))
-      new-spec)))
-
-(defface mh-folder-address '((t (:inherit mh-folder-subject)))
+  "Non-nil means `defface' supports min-colors display requirement.")
+
+(defun mh-face-data (face &optional inherit)
+  "Return spec for FACE.
+See `defface' for the spec definition.
+
+If INHERIT is non-nil and `defface' supports the :inherit
+keyword, return INHERIT literally; otherwise, return spec for
+FACE from the variable `mh-face-data'. This isn't a perfect
+implementation. In the case that the :inherit keyword is not
+supported, any additional attributes in the inherit parameter are
+not added to the returned spec.
+
+Furthermore, when `mh-min-colors-defined-flag' is nil, this
+function finds display entries with \"min-colors\" requirements
+and either removes the \"min-colors\" requirement or strips the
+display entirely if the display does not support the number of
+specified colors."
+  (let ((spec
+         (if (and inherit mh-inherit-face-flag)
+             inherit
+           (or (cadr (assq face mh-face-data))
+               (error "Could not find %s in mh-face-data" face)))))
+
+    (if mh-min-colors-defined-flag
+        spec
+      (let ((cells (mh-display-color-cells))
+            new-spec)
+        ;; Remove entries with min-colors, or delete them if we have
+        ;; fewer colors than they specify.
+        (loop for entry in (reverse spec) do
+              (let ((requirement (if (eq (car entry) t)
+                                     nil
+                                   (assq 'min-colors (car entry)))))
+                (if requirement
+                    (when (>= cells (nth 1 requirement))
+                      (setq new-spec (cons (cons (delq requirement (car entry))
+                                                 (cdr entry))
+                                           new-spec)))
+                  (setq new-spec (cons entry new-spec)))))
+        new-spec))))
+
+(defface-mh mh-folder-address
+  (mh-face-data 'mh-folder-subject '((t (:inherit mh-folder-subject))))
   "Recipient face."
   :group 'mh-faces
-  :group 'mh-folder)
-
-(defface mh-folder-body
-  '((((class color))
-     (:inherit mh-folder-msg-number))
-    (t
-     (:inherit mh-folder-msg-number :italic t)))
+  :group 'mh-folder
+  :package-version '(MH-E . "8.0"))
+
+(defface-mh mh-folder-body
+  (mh-face-data 'mh-folder-msg-number
+                '((((class color))
+                   (:inherit mh-folder-msg-number))
+                  (t
+                   (:inherit mh-folder-msg-number :italic t))))
   "Body text face."
   :group 'mh-faces
-  :group 'mh-folder)
+  :group 'mh-folder
+  :package-version '(MH-E . "8.0"))
 
-(defface mh-folder-cur-msg-number
-  '((t
-     (:inherit mh-folder-msg-number :bold t)))
+(defface-mh mh-folder-cur-msg-number
+  (mh-face-data 'mh-folder-msg-number
+                '((t (:inherit mh-folder-msg-number :bold t))))
   "Current message number face."
   :group 'mh-faces
-  :group 'mh-folder)
+  :group 'mh-folder
+  :package-version '(MH-E . "8.0"))
 
-(defface mh-folder-date '((t (:inherit mh-folder-msg-number)))
+(defface-mh mh-folder-date
+  (mh-face-data 'mh-folder-msg-number '((t (:inherit mh-folder-msg-number))))
   "Date face."
   :group 'mh-faces
-  :group 'mh-folder)
+  :group 'mh-folder
+  :package-version '(MH-E . "8.0"))
 
-(defface mh-folder-deleted '((t (:inherit mh-folder-msg-number)))
+(defface-mh mh-folder-deleted
+  (mh-face-data 'mh-folder-msg-number '((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"))
-    (((class color) (background dark))
-     (:foreground "LightGoldenRod"))
-    (t
-     (:bold t)))
+  :group 'mh-folder
+  :package-version '(MH-E . "8.0"))
+
+(defface-mh mh-folder-followup (mh-face-data 'mh-folder-followup)
   "\"Re:\" face."
   :group 'mh-faces
-  :group 'mh-folder)
-
-(defface mh-folder-msg-number
-  (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"))))
+  :group 'mh-folder
+  :package-version '(MH-E . "8.0"))
 
+(defface-mh mh-folder-msg-number (mh-face-data 'mh-folder-msg-number)
   "Message number face."
   :group 'mh-faces
-  :group 'mh-folder)
-
-(defface mh-folder-refiled
-  (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))))
+  :group 'mh-folder
+  :package-version '(MH-E . "8.0"))
+
+(defface-mh mh-folder-refiled (mh-face-data 'mh-folder-refiled)
   "Refiled message face."
   :group 'mh-faces
-  :group 'mh-folder)
+  :group 'mh-folder
+  :package-version '(MH-E . "8.0"))
 
-(defface mh-folder-sent-to-me-hint '((t (:inherit mh-folder-date)))
+(defface-mh mh-folder-sent-to-me-hint
+  (mh-face-data 'mh-folder-msg-number '((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)
+  :group 'mh-folder
+  :package-version '(MH-E . "8.0"))
 
-(defface mh-folder-sent-to-me-sender '((t (:inherit mh-folder-followup)))
+(defface-mh mh-folder-sent-to-me-sender
+  (mh-face-data 'mh-folder-followup '((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"))
-    (((class color) (background dark))
-     (:foreground "yellow"))
-    (t
-     (:bold t)))
+  :group 'mh-folder
+  :package-version '(MH-E . "8.0"))
+
+(defface-mh mh-folder-subject (mh-face-data 'mh-folder-subject)
   "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)))
+  :group 'mh-folder
+  :package-version '(MH-E . "8.0"))
+
+(defface-mh mh-folder-tick (mh-face-data 'mh-folder-tick)
   "Ticked message face."
   :group 'mh-faces
-  :group 'mh-folder)
-
-(defface mh-folder-to
-  (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))))
+  :group 'mh-folder
+  :package-version '(MH-E . "8.0"))
+
+(defface-mh mh-folder-to (mh-face-data 'mh-folder-to)
   "\"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)))
-  "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)))
+  :group 'mh-folder
+  :package-version '(MH-E . "8.0"))
+
+(defface-mh mh-letter-header-field (mh-face-data 'mh-letter-header-field)
   "Editable header field value face in draft buffers."
   :group 'mh-faces
-  :group 'mh-letter)
-
-(defface mh-show-cc
-  (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))))
+  :group 'mh-letter
+  :package-version '(MH-E . "8.0"))
+
+(defface-mh mh-search-folder (mh-face-data 'mh-search-folder)
+  "Folder heading face in MH-Folder buffers created by searches."
+  :group 'mh-faces
+  :group 'mh-search
+  :package-version '(MH-E . "8.0"))
+
+(defface-mh mh-show-cc (mh-face-data 'mh-show-cc)
   "Face used to highlight \"cc:\" header fields."
   :group 'mh-faces
-  :group 'mh-show)
-
-(defface mh-show-date
-  (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))))
+  :group 'mh-show
+  :package-version '(MH-E . "8.0"))
+
+(defface-mh mh-show-date (mh-face-data 'mh-show-date)
   "Face used to highlight \"Date:\" header fields."
   :group 'mh-faces
-  :group 'mh-show)
-
-(defface mh-show-from
-  '((((class color) (background light))
-     (:foreground "red3"))
-    (((class color) (background dark))
-     (:foreground "cyan"))
-    (t
-     (:bold t)))
+  :group 'mh-show
+  :package-version '(MH-E . "8.0"))
+
+(defface-mh mh-show-from (mh-face-data 'mh-show-from)
   "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))))
+  :group 'mh-show
+  :package-version '(MH-E . "8.0"))
+
+(defface-mh mh-show-header (mh-face-data 'mh-show-header)
   "Face used to deemphasize less interesting header fields."
   :group 'mh-faces
-  :group 'mh-show)
+  :group 'mh-show
+  :package-version '(MH-E . "8.0"))
 
-(defface mh-show-pgg-bad '((t (:bold t :foreground "DeepPink1")))
+(defface-mh mh-show-pgg-bad (mh-face-data 'mh-show-pgg-bad)
   "Bad PGG signature face."
   :group 'mh-faces
-  :group 'mh-show)
+  :group 'mh-show
+  :package-version '(MH-E . "8.0"))
 
-(defface mh-show-pgg-good '((t (:bold t :foreground "LimeGreen")))
+(defface-mh mh-show-pgg-good (mh-face-data 'mh-show-pgg-good)
   "Good PGG signature face."
   :group 'mh-faces
-  :group 'mh-show)
+  :group 'mh-show
+  :package-version '(MH-E . "8.0"))
 
-(defface mh-show-pgg-unknown '((t (:bold t :foreground "DarkGoldenrod2")))
+(defface-mh mh-show-pgg-unknown (mh-face-data 'mh-show-pgg-unknown)
   "Unknown or untrusted PGG signature face."
   :group 'mh-faces
-  :group 'mh-show)
+  :group 'mh-show
+  :package-version '(MH-E . "8.0"))
 
-(defface mh-show-signature '((t (:italic t)))
+(defface-mh mh-show-signature (mh-face-data 'mh-show-signature)
   "Signature face."
   :group 'mh-faces
-  :group 'mh-show)
+  :group 'mh-show
+  :package-version '(MH-E . "8.0"))
 
-(defface mh-show-subject '((t (:inherit mh-folder-subject)))
+(defface-mh mh-show-subject
+  (mh-face-data 'mh-folder-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)))
+  :group 'mh-show
+  :package-version '(MH-E . "8.0"))
+
+(defface-mh mh-show-to (mh-face-data 'mh-show-to)
   "Face used to highlight \"To:\" header fields."
   :group 'mh-faces
-  :group 'mh-show)
+  :group 'mh-show
+  :package-version '(MH-E . "8.0"))
 
-(defface mh-show-xface '((t (:inherit (mh-show-from highlight))))
-  "X-Face image face.
+(defface-mh mh-show-xface
+  (mh-face-data 'mh-show-from '((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)
+  :group 'mh-show
+  :package-version '(MH-E . "8.0"))
 
-(defface mh-speedbar-folder
-  '((((class color) (background light))
-     (:foreground "blue4"))
-    (((class color) (background dark))
-     (:foreground "light blue")))
+(defface-mh mh-speedbar-folder (mh-face-data 'mh-speedbar-folder)
   "Basic folder face."
   :group 'mh-faces
-  :group 'mh-speedbar)
+  :group 'mh-speedbar
+  :package-version '(MH-E . "8.0"))
 
-(defface mh-speedbar-folder-with-unseen-messages
-  '((t
-     (:inherit mh-speedbar-folder :bold t)))
+(defface-mh mh-speedbar-folder-with-unseen-messages
+  (mh-face-data 'mh-speedbar-folder
+                '((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)))
+  :group 'mh-speedbar
+  :package-version '(MH-E . "8.0"))
+
+(defface-mh mh-speedbar-selected-folder
+  (mh-face-data 'mh-speedbar-selected-folder)
   "Selected folder face."
   :group 'mh-faces
-  :group 'mh-speedbar)
+  :group 'mh-speedbar
+  :package-version '(MH-E . "8.0"))
 
-(defface mh-speedbar-selected-folder-with-unseen-messages
-  '((t
-     (:inherit mh-speedbar-selected-folder :bold t)))
+(defface-mh mh-speedbar-selected-folder-with-unseen-messages
+  (mh-face-data 'mh-speedbar-selected-folder
+                '((t (:inherit mh-speedbar-selected-folder :bold t))))
   "Selected folder face when folder contains unread messages."
   :group 'mh-faces
-  :group 'mh-speedbar)
+  :group 'mh-speedbar
+  :package-version '(MH-E . "8.0"))
 
 (provide 'mh-e)