diff options
| author | Bill Wohler | 2006-04-07 18:58:38 +0000 |
|---|---|---|
| committer | Bill Wohler | 2006-04-07 18:58:38 +0000 |
| commit | fde155f459ee240985aebcf77264dc695a88bdad (patch) | |
| tree | 63c0ee18685871977ecd362754ccb8576ec6e1ab | |
| parent | 122c30092c43596cbafab64ad706e41a2f2565fd (diff) | |
| download | emacs-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/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/mh-e/mh-e.el | 114 |
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 @@ | |||
| 1 | 2006-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 | |||
| 1 | 2006-03-31 Bill Wohler <wohler@newt.com> | 6 | 2006-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. | ||
| 656 | In Emacs versions that support the :package-version keyword, | ||
| 657 | ARGS 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. | ||
| 669 | See documentation for `defgroup' for a description of the arguments | ||
| 670 | SYMBOL, MEMBERS, DOC and ARGS. | ||
| 671 | This macro is used by Emacs versions that lack the :package-version | ||
| 672 | keyword, 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. | ||
| 679 | See documentation for `defcustom' for a description of the arguments | ||
| 680 | SYMBOL, VALUE, DOC and ARGS. | ||
| 681 | This macro is used by Emacs versions that lack the :package-version | ||
| 682 | keyword, 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. | ||
| 689 | See documentation for `defface' for a description of the arguments | ||
| 690 | FACE, SPEC, DOC and ARGS. | ||
| 691 | This macro is used by Emacs versions that lack the :package-version | ||
| 692 | keyword, 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. |
| 651 | See `mh-variant'." | 703 | See `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 | ||
| 865 | The default setting of this option is \"Auto-detect\" which means | 918 | The 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. | ||
| 900 | In Emacs versions that support the :package-version keyword, | ||
| 901 | ARGS 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. | ||
| 913 | See documentation for `defgroup' for a description of the arguments | ||
| 914 | SYMBOL, MEMBERS, DOC and ARGS. | ||
| 915 | This macro is used by Emacs versions that lack the :package-version | ||
| 916 | keyword, 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. | ||
| 923 | See documentation for `defcustom' for a description of the arguments | ||
| 924 | SYMBOL, VALUE, DOC and ARGS. | ||
| 925 | This macro is used by Emacs versions that lack the :package-version | ||
| 926 | keyword, 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. | ||
| 933 | See documentation for `defface' for a description of the arguments | ||
| 934 | FACE, SPEC, DOC and ARGS. | ||
| 935 | This macro is used by Emacs versions that lack the :package-version | ||
| 936 | keyword, 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 | ||