[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master f314ac2: Make the -modes variable autoloaded
From: |
Lars Ingebrigtsen |
Subject: |
master f314ac2: Make the -modes variable autoloaded |
Date: |
Mon, 26 Oct 2020 15:44:30 -0400 (EDT) |
branch: master
commit f314ac2a30a475a2c578df8816adc9a2155dc259
Author: Lars Ingebrigtsen <larsi@gnus.org>
Commit: Lars Ingebrigtsen <larsi@gnus.org>
Make the -modes variable autoloaded
* lisp/emacs-lisp/easy-mmode.el (define-globalized-minor-mode):
Make the -modes variable be autoloaded.
---
lisp/emacs-lisp/easy-mmode.el | 38 +++++++++++++++++++-------------------
1 file changed, 19 insertions(+), 19 deletions(-)
diff --git a/lisp/emacs-lisp/easy-mmode.el b/lisp/emacs-lisp/easy-mmode.el
index fe85667..a707d20 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
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- master f314ac2: Make the -modes variable autoloaded,
Lars Ingebrigtsen <=