]> git.eshelyaron.com Git - emacs.git/commitdiff
Don't update `minor-modes' in global modes
authorLars Ingebrigtsen <larsi@gnus.org>
Sun, 14 Feb 2021 15:51:14 +0000 (16:51 +0100)
committerLars Ingebrigtsen <larsi@gnus.org>
Sun, 14 Feb 2021 15:51:14 +0000 (16:51 +0100)
* lisp/emacs-lisp/easy-mmode.el (define-minor-mode): There's no
point in setting the buffer-local `minor-modes' in global modes.

lisp/emacs-lisp/easy-mmode.el

index 7e5e2a9b8a93fa0d9a1df9d076b2f73e7e952c07..5ba0d2187f22ac4838c7931ab3680240e38defd1 100644 (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))