aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBill Wohler2006-04-07 18:58:38 +0000
committerBill Wohler2006-04-07 18:58:38 +0000
commitfde155f459ee240985aebcf77264dc695a88bdad (patch)
tree63c0ee18685871977ecd362754ccb8576ec6e1ab
parent122c30092c43596cbafab64ad706e41a2f2565fd (diff)
downloademacs-fde155f459ee240985aebcf77264dc695a88bdad.tar.gz
emacs-fde155f459ee240985aebcf77264dc695a88bdad.zip
(mh-path, mh-variant): Define with mh-defcustom and add
:package-version keyword.
-rw-r--r--lisp/mh-e/ChangeLog5
-rw-r--r--lisp/mh-e/mh-e.el114
2 files changed, 63 insertions, 56 deletions
diff --git a/lisp/mh-e/ChangeLog b/lisp/mh-e/ChangeLog
index fa66eaca664..6bf84517bde 100644
--- a/lisp/mh-e/ChangeLog
+++ b/lisp/mh-e/ChangeLog
@@ -1,3 +1,8 @@
12006-04-07 Bill Wohler <wohler@newt.com>
2
3 * mh-e.el (mh-path, mh-variant): Define with mh-defcustom and add
4 :package-version keyword.
5
12006-03-31 Bill Wohler <wohler@newt.com> 62006-03-31 Bill Wohler <wohler@newt.com>
2 7
3 * mh-e.el (mh-strip-package-version): Move before use to avoid 8 * mh-e.el (mh-strip-package-version): Move before use to avoid
diff --git a/lisp/mh-e/mh-e.el b/lisp/mh-e/mh-e.el
index 5f1c66e58d8..a2d0e85841b 100644
--- a/lisp/mh-e/mh-e.el
+++ b/lisp/mh-e/mh-e.el
@@ -644,13 +644,66 @@ Set mark after inserted text."
644 644
645 645
646 646
647;;; MH-E Customization Support Routines
648
649;; Shush compiler (Emacs 21 and XEmacs).
650(defvar customize-package-emacs-version-alist)
651
652;; Temporary function and data structure used customization.
653;; These will be unbound after the options are defined.
654(defmacro mh-strip-package-version (args)
655 "Strip :package-version keyword and its value from ARGS.
656In Emacs versions that support the :package-version keyword,
657ARGS is returned unchanged."
658 `(if (boundp 'customize-package-emacs-version-alist)
659 ,args
660 (let (seen)
661 (loop for keyword in ,args
662 if (cond ((eq keyword ':package-version) (setq seen t) nil)
663 (seen (setq seen nil) nil)
664 (t t))
665 collect keyword))))
666
667(defmacro mh-defgroup (symbol members doc &rest args)
668 "Declare SYMBOL as a customization group containing MEMBERS.
669See documentation for `defgroup' for a description of the arguments
670SYMBOL, MEMBERS, DOC and ARGS.
671This macro is used by Emacs versions that lack the :package-version
672keyword, introduced in Emacs 22."
673 (declare (doc-string 3))
674 `(defgroup ,symbol ,members ,doc ,@(mh-strip-package-version args)))
675(put 'mh-defgroup 'lisp-indent-function 'defun)
676
677(defmacro mh-defcustom (symbol value doc &rest args)
678 "Declare SYMBOL as a customizable variable that defaults to VALUE.
679See documentation for `defcustom' for a description of the arguments
680SYMBOL, VALUE, DOC and ARGS.
681This macro is used by Emacs versions that lack the :package-version
682keyword, introduced in Emacs 22."
683 (declare (doc-string 3))
684 `(defcustom ,symbol ,value ,doc ,@(mh-strip-package-version args)))
685(put 'mh-defcustom 'lisp-indent-function 'defun)
686
687(defmacro mh-defface (face spec doc &rest args)
688 "Declare FACE as a customizable face that defaults to SPEC.
689See documentation for `defface' for a description of the arguments
690FACE, SPEC, DOC and ARGS.
691This macro is used by Emacs versions that lack the :package-version
692keyword, introduced in Emacs 22."
693 (declare (doc-string 3))
694 `(defface ,face ,spec ,doc ,@(mh-strip-package-version args)))
695(put 'mh-defface 'lisp-indent-function 'defun)
696
697
698
647;;; Variant Support 699;;; Variant Support
648 700
649(defcustom mh-path nil 701(mh-defcustom mh-path nil
650 "*Additional list of directories to search for MH. 702 "*Additional list of directories to search for MH.
651See `mh-variant'." 703See `mh-variant'."
652 :group 'mh-e 704 :group 'mh-e
653 :type '(repeat (directory))) 705 :type '(repeat (directory))
706 :package-version '(MH-E "8.0"))
654 707
655(defun mh-variants () 708(defun mh-variants ()
656 "Return a list of installed variants of MH on the system. 709 "Return a list of installed variants of MH on the system.
@@ -859,7 +912,7 @@ finally GNU mailutils."
859 (mapconcat '(lambda (x) (format "%s" (car x))) 912 (mapconcat '(lambda (x) (format "%s" (car x)))
860 (mh-variants) " or ")))))) 913 (mh-variants) " or "))))))
861 914
862(defcustom mh-variant 'autodetect 915(mh-defcustom mh-variant 'autodetect
863 "*Specifies the variant used by MH-E. 916 "*Specifies the variant used by MH-E.
864 917
865The default setting of this option is \"Auto-detect\" which means 918The default setting of this option is \"Auto-detect\" which means
@@ -884,59 +937,8 @@ necessary and can actually cause problems."
884 :set (lambda (symbol value) 937 :set (lambda (symbol value)
885 (set-default symbol value) ;Done in mh-variant-set-variant! 938 (set-default symbol value) ;Done in mh-variant-set-variant!
886 (mh-variant-set value)) 939 (mh-variant-set value))
887 :group 'mh-e) 940 :group 'mh-e
888 941 :package-version '(MH-E "8.0"))
889
890
891;;; MH-E Customization Support Routines
892
893;; Shush compiler (Emacs 21 and XEmacs).
894(defvar customize-package-emacs-version-alist)
895
896;; Temporary function and data structure used customization.
897;; These will be unbound after the options are defined.
898(defmacro mh-strip-package-version (args)
899 "Strip :package-version keyword and its value from ARGS.
900In Emacs versions that support the :package-version keyword,
901ARGS is returned unchanged."
902 `(if (boundp 'customize-package-emacs-version-alist)
903 ,args
904 (let (seen)
905 (loop for keyword in ,args
906 if (cond ((eq keyword ':package-version) (setq seen t) nil)
907 (seen (setq seen nil) nil)
908 (t t))
909 collect keyword))))
910
911(defmacro mh-defgroup (symbol members doc &rest args)
912 "Declare SYMBOL as a customization group containing MEMBERS.
913See documentation for `defgroup' for a description of the arguments
914SYMBOL, MEMBERS, DOC and ARGS.
915This macro is used by Emacs versions that lack the :package-version
916keyword, introduced in Emacs 22."
917 (declare (doc-string 3))
918 `(defgroup ,symbol ,members ,doc ,@(mh-strip-package-version args)))
919(put 'mh-defgroup 'lisp-indent-function 'defun)
920
921(defmacro mh-defcustom (symbol value doc &rest args)
922 "Declare SYMBOL as a customizable variable that defaults to VALUE.
923See documentation for `defcustom' for a description of the arguments
924SYMBOL, VALUE, DOC and ARGS.
925This macro is used by Emacs versions that lack the :package-version
926keyword, introduced in Emacs 22."
927 (declare (doc-string 3))
928 `(defcustom ,symbol ,value ,doc ,@(mh-strip-package-version args)))
929(put 'mh-defcustom 'lisp-indent-function 'defun)
930
931(defmacro mh-defface (face spec doc &rest args)
932 "Declare FACE as a customizable face that defaults to SPEC.
933See documentation for `defface' for a description of the arguments
934FACE, SPEC, DOC and ARGS.
935This macro is used by Emacs versions that lack the :package-version
936keyword, introduced in Emacs 22."
937 (declare (doc-string 3))
938 `(defface ,face ,spec ,doc ,@(mh-strip-package-version args)))
939(put 'mh-defface 'lisp-indent-function 'defun)
940 942
941 943
942 944