diff options
author | Lars Ingebrigtsen <larsi@gnus.org> | 2021-02-15 13:08:15 +0100 |
---|---|---|
committer | Lars Ingebrigtsen <larsi@gnus.org> | 2021-02-15 13:08:21 +0100 |
commit | b535c8ba8735409b43ec9b1ce99a966cfa1383b1 (patch) | |
tree | 94fae987664b71a00ed74ebe3b32f90a4d554da3 /lisp/emacs-lisp | |
parent | 0bd846c17474b161b11fbe21545609cd545b1798 (diff) | |
download | emacs-b535c8ba8735409b43ec9b1ce99a966cfa1383b1.tar.gz emacs-b535c8ba8735409b43ec9b1ce99a966cfa1383b1.tar.bz2 emacs-b535c8ba8735409b43ec9b1ce99a966cfa1383b1.zip |
Add a new variable `global-minor-modes'
* doc/lispref/modes.texi (Minor Modes): Document it.
* lisp/simple.el (global-minor-modes): New variable.
(completion-in-mode-p): Use it.
(completion-with-modes-p): Use it.
* lisp/emacs-lisp/easy-mmode.el (define-minor-mode): Support it.
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r-- | lisp/emacs-lisp/easy-mmode.el | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/lisp/emacs-lisp/easy-mmode.el b/lisp/emacs-lisp/easy-mmode.el index c48ec505ce0..4a9e58083b0 100644 --- a/lisp/emacs-lisp/easy-mmode.el +++ b/lisp/emacs-lisp/easy-mmode.el @@ -330,11 +330,14 @@ or call the function `%s'.")))) nil) (t t))) - (unless ,globalp - ;; Keep `local-minor-modes' up to date. - (setq local-minor-modes (delq ',modefun local-minor-modes)) - (when ,getter - (push ',modefun local-minor-modes))) + ;; Keep minor modes list up to date. + ,@(if globalp + `((setq global-minor-modes (delq ',modefun global-minor-modes)) + (when ,getter + (push ',modefun global-minor-modes))) + `((setq local-minor-modes (delq ',modefun local-minor-modes)) + (when ,getter + (push ',modefun local-minor-modes)))) ,@body ;; The on/off hooks are here for backward compatibility only. (run-hooks ',hook (if ,getter ',hook-on ',hook-off)) |