Don't update `minor-modes' in global modes

* lisp/emacs-lisp/easy-mmode.el (define-minor-mode): There's no
point in setting the buffer-local `minor-modes' in global modes.
This commit is contained in:
Lars Ingebrigtsen 2021-02-14 16:51:14 +01:00
parent 1baadbe060
commit 2f00a3435a

View file

@ -330,10 +330,11 @@ or call the function `%s'."))))
nil)
(t
t)))
;; Keep `minor-modes' up to date.
(setq minor-modes (delq ',modefun minor-modes))
(when ,getter
(push ',modefun minor-modes))
(unless ,globalp
;; Keep `minor-modes' up to date.
(setq minor-modes (delq ',modefun minor-modes))
(when ,getter
(push ',modefun minor-modes)))
,@body
;; The on/off hooks are here for backward compatibility only.
(run-hooks ',hook (if ,getter ',hook-on ',hook-off))