From: Eli Zaretskii <eliz@gnu.org>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: yantar92@posteo.net, 58888@debbugs.gnu.org
Subject: bug#58888: 28.1.90; font-lock-defaults not respected when hack-local-variables unsafe variable dialogue is displayed before setting the defaults
Date: Thu, 11 Apr 2024 09:20:33 +0300 [thread overview]
Message-ID: <868r1kv2ry.fsf@gnu.org> (raw)
In-Reply-To: <jwv5xwp6jpm.fsf-monnier+emacs@gnu.org> (bug-gnu-emacs@gnu.org)
> Cc: 58888@debbugs.gnu.org
> Date: Wed, 10 Apr 2024 16:34:48 -0400
> From: Stefan Monnier via "Bug reports for GNU Emacs,
> the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
>
> Eli, any objection to the patch below?
Any idea how many major modes out there don't use run-mode-hooks? We
are basically breaking those with this change, right?
> Subject: [PATCH] (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 they're not
> needed any more now that virtually all major modes have been
> changed to use `run-mode-hooks`.
>
> * lisp/emacs-lisp/easy-mmode.el (define-globalized-minor-mode):
> Rely only on `after-change-major-mode-hook`. Fixes bug#58888.
Please don't quote `like this`. (I think you should by now have a
commit hook in your init files that replaces the quoting with our
style, because this seems to be ubiquitous in all your writings.)
> --- a/etc/NEWS
> +++ b/etc/NEWS
> @@ -1658,6 +1658,12 @@ documentation and examples.
> \f
> * Incompatible Lisp Changes in Emacs 30.1
>
> +** 'define-globalized-minor-mode' requires that modes use 'run-mode-hooks'.
> +Minor modes defined with 'define-globalized-minor-mode', such as
> +'global-font-lock-mode', don't work any more with major modes which
> +don't use 'run-mode-hooks'. Major modes defined with
> +'define-derived-mode' are not affected.
IMO, this NEWS entry is not detailed enough. First, it should mention
that run-mode-hooks is the modern way of running the mode's hook, a
replacement for run-hooks. And second, it should at least hint on
what will happen with modes which don't use run-mode-hooks, so that
affected users could identify the problem when they see its signs.
Also, I think we should tell in the ELisp manual that run-mode-hooks
is now a must, not just a preference, and we should mention in the
Minor Modes chapter that the globalized minor modes will work
correctly only if the major mode uses run-mode-hooks to run its hooks.
next prev parent reply other threads:[~2024-04-11 6:20 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-30 6:58 bug#58888: 28.1.90; font-lock-defaults not respected when hack-local-variables unsafe variable dialogue is displayed before setting the defaults Ihor Radchenko
2022-10-31 2:15 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-10-31 7:11 ` Ihor Radchenko
2024-04-08 12:48 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-08 13:15 ` Eli Zaretskii
2024-04-08 13:42 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-08 19:25 ` Ihor Radchenko
2024-04-10 20:34 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-11 6:20 ` Eli Zaretskii [this message]
2024-04-11 13:27 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-11 14:12 ` Eli Zaretskii
2024-04-13 14:32 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-11 13:53 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-11 14:13 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=868r1kv2ry.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=58888@debbugs.gnu.org \
--cc=monnier@iro.umontreal.ca \
--cc=yantar92@posteo.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).