Subject: Re: bug#56423: 29.0.50; Hi-lock in dired broken by toggling wdired-mode

From: Michael Heerdegen <[email-masked]>
Date: Wed, 06 Jul 2022 20:58:45 +0200

Michael Heerdegen <[email-masked]> writes:

> The (only) reason for this is that when toggling `wdired-mode' the
> hi-lock pattern rules added to `font-lock-keywords' are gone (why?).

Ok, tried to follow what happens.  Hitting the first key after entering
wdired calls `font-lock-set-defaults' like this:

| (font-lock-set-defaults)
| (font-lock-fontify-region 132 243)
| (jit-lock--run-functions 132 243)
| (jit-lock-fontify-now 132 1632)
| (jit-lock-function 132)

and `font-lock-set-defaults' finds that

  (derived-mode-p font-lock-major-mode)

fails so that it recomputes the `font-lock-keywords' from the defaults.
I guess we could prevent that happening?

Michael.