]> git.eshelyaron.com Git - emacs.git/commit
(define-globalized-minor-mode): Require the use of `run-mode-hooks`
authorStefan Monnier <monnier@iro.umontreal.ca>
Sat, 13 Apr 2024 14:31:28 +0000 (10:31 -0400)
committerEshel Yaron <me@eshelyaron.com>
Sun, 14 Apr 2024 17:11:27 +0000 (19:11 +0200)
commit938c345b12a75fc5900f0368e303f850e45f0c95
tree00da0bcd23e49dfb219060ae41b49fbcfd502ac6
parent4c6fd3c3bdc3d6ee8d03e3fc340156e8a1f97c9e
(define-globalized-minor-mode): Require the use of `run-mode-hooks`

When `define-globalized-minor-mode` was introduced (Emacs-22),
`run-mode-hooks` was brand new, so we could not expect all major
modes to use it and we had to rely on brittle workarounds to try
and approximate `after-change-major-mode-hook`.

These workarounds have undesirable side effects, and (we hope)
they're not needed any more now that virtually all major modes
have been changed to use `run-mode-hooks` (or
`define-derived-mode`).

* lisp/emacs-lisp/easy-mmode.el (define-globalized-minor-mode):
Rely only on `after-change-major-mode-hook`, remove the "cmhh"
[typo for the intended "cmmh", BTW] workaround.

* doc/lispref/modes.texi (Mode Hooks): Clarify the importance of
`after-change-major-mode-hook` w.r.t `define-globalized-minor-mode`.
(Defining Minor Modes): Rewrite the explanation of which buffers
are affected, including adjusting it to the fact that
`fundamental-mode` has used run `run-mode-hooks` for last 10 years.

(cherry picked from commit 17e26cf57e18c5df2172a7049591d89fc53b3fb6)
doc/lispref/modes.texi
etc/NEWS
lisp/emacs-lisp/easy-mmode.el