aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2024-04-13 10:10:19 -0400
committerStefan Monnier2024-04-13 10:10:19 -0400
commit3f7e26e2bed4ee7adab3a5d2bfa289517499e4c8 (patch)
tree8bd863c99410d7dba4827d1f234d17026ce910b1
parentd67e08d6c3f9a00b824c827247a7de3d08ccad39 (diff)
downloademacs-3f7e26e2bed4ee7adab3a5d2bfa289517499e4c8.tar.gz
emacs-3f7e26e2bed4ee7adab3a5d2bfa289517499e4c8.zip
(define-globalized-minor-mode): Fix bug#58888
* lisp/emacs-lisp/easy-mmode.el (define-globalized-minor-mode) <MODE-cmhh>: Try and detect well-behaved modes so they're not affected by those which require the cmhh hack.
-rw-r--r--lisp/emacs-lisp/easy-mmode.el8
1 files changed, 6 insertions, 2 deletions
diff --git a/lisp/emacs-lisp/easy-mmode.el b/lisp/emacs-lisp/easy-mmode.el
index 095bd5faa03..b09466d79fc 100644
--- a/lisp/emacs-lisp/easy-mmode.el
+++ b/lisp/emacs-lisp/easy-mmode.el
@@ -661,8 +661,12 @@ list."
661 661
662 ;; The function that catches kill-all-local-variables. 662 ;; The function that catches kill-all-local-variables.
663 (defun ,MODE-cmhh () 663 (defun ,MODE-cmhh ()
664 (add-to-list ',MODE-buffers (current-buffer)) 664 ;; If `delay-mode-hooks' is set, it indicates that the current
665 (add-hook 'post-command-hook #',MODE-check-buffers)) 665 ;; buffer's mode will run `run-mode-hooks' afterwards anyway,
666 ;; so we don't need to keep this buffer in MODE-buffers.
667 (unless delay-mode-hooks
668 (add-to-list ',MODE-buffers (current-buffer))
669 (add-hook 'post-command-hook #',MODE-check-buffers)))
666 (put ',MODE-cmhh 'definition-name ',global-mode)))) 670 (put ',MODE-cmhh 'definition-name ',global-mode))))
667 671
668(defun easy-mmode--globalized-predicate-p (predicate) 672(defun easy-mmode--globalized-predicate-p (predicate)