diff options
| author | Stefan Monnier | 2024-04-13 10:10:19 -0400 |
|---|---|---|
| committer | Stefan Monnier | 2024-04-13 10:10:19 -0400 |
| commit | 3f7e26e2bed4ee7adab3a5d2bfa289517499e4c8 (patch) | |
| tree | 8bd863c99410d7dba4827d1f234d17026ce910b1 | |
| parent | d67e08d6c3f9a00b824c827247a7de3d08ccad39 (diff) | |
| download | emacs-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.el | 8 |
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) |