diff options
author | Lars Ingebrigtsen <larsi@gnus.org> | 2020-10-26 20:44:15 +0100 |
---|---|---|
committer | Lars Ingebrigtsen <larsi@gnus.org> | 2020-10-26 20:44:21 +0100 |
commit | f314ac2a30a475a2c578df8816adc9a2155dc259 (patch) | |
tree | d8c5a00e0e2a8e1e3cea5ccacca6d5460c61faa3 /lisp/emacs-lisp | |
parent | 6415eb8d7413fe5a6d6c80a54f1d785d743f8737 (diff) | |
download | emacs-f314ac2a30a475a2c578df8816adc9a2155dc259.tar.gz emacs-f314ac2a30a475a2c578df8816adc9a2155dc259.tar.bz2 emacs-f314ac2a30a475a2c578df8816adc9a2155dc259.zip |
Make the -modes variable autoloaded
* lisp/emacs-lisp/easy-mmode.el (define-globalized-minor-mode):
Make the -modes variable be autoloaded.
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r-- | lisp/emacs-lisp/easy-mmode.el | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/lisp/emacs-lisp/easy-mmode.el b/lisp/emacs-lisp/easy-mmode.el index fe85667545d..a707d204f8b 100644 --- a/lisp/emacs-lisp/easy-mmode.el +++ b/lisp/emacs-lisp/easy-mmode.el @@ -486,6 +486,24 @@ this minor mode is used in." (when ,mode (,mode -1))))) ,@body) + ,(when predicate + `(defcustom ,MODE-predicate ,(car predicate) + ,(format "Which major modes `%s' is switched on in. +This variable can be either t (all major modes), nil (no major modes), +or a list of modes and (not modes) to switch use this minor mode or +not. For instance + + (c-mode (not message-mode mail-mode) text-mode) + +means \"use this mode in all modes derived from `c-mode', don't use in +modes derived from `message-mode' or `mail-mode', but do use in other +modes derived from `text-mode'\". An element with value t means \"use\" +and nil means \"don't use\". There's an implicit nil at the end of the +list." + mode) + :type '(repeat sexp) + :group ,group)) + ;; Autoloading define-globalized-minor-mode autoloads everything ;; up-to-here. :autoload-end @@ -533,25 +551,7 @@ this minor mode is used in." (defun ,MODE-cmhh () (add-to-list ',MODE-buffers (current-buffer)) (add-hook 'post-command-hook ',MODE-check-buffers)) - (put ',MODE-cmhh 'definition-name ',global-mode) - - ,(when predicate - `(defcustom ,MODE-predicate ,(car predicate) - ,(format "Which major modes `%s' is switched on in. -This variable can be either t (all major modes), nil (no major modes), -or a list of modes and (not modes) to switch use this minor mode or -not. For instance - - (c-mode (not message-mode mail-mode) text-mode) - -means \"use this mode in all modes derived from `c-mode', don't use in -modes derived from `message-mode' or `mail-mode', but do use in other -modes derived from `text-mode'\". An element with value t means \"use\" -and nil means \"don't use\". There's an implicit nil at the end of the -list." - mode) - :type '(repeat sexp) - :group ,group))))) + (put ',MODE-cmhh 'definition-name ',global-mode)))) (defun easy-mmode--globalized-predicate-p (predicate) (cond |