Subject: bug#39597: 27.0.60: M-x occur adds fontification to fundamental-mode

From: Kévin Le Gouguec <[email-masked]>
Date: Wed, 19 Feb 2020 19:57:07 +0100

Stefan Monnier <[email-masked]> writes:

> Maybe something like the patch below?

I can confirm that this fixes the issue.

> I'm not sufficiently familiar with the design of `font-lock-specified-p`
> to be completely sure where the check should be placed; this is my best guess.

I tried to read as much as I could about font-lock in the Emacs and
Elisp manuals, but I'm still overwhelmed by all the variables and
functions involved, e.g.

- font-lock-mode
- font-lock-specified-p
- font-lock-ensure
- font-lock-set-defaults
- font-lock-fontified
- font-lock-defaults
- font-lock-major-mode

M-? and M-. make it trivial to say which function sets which variables,
which predicate depends on which variables, which variable influences
which functions… but I can't figure out what the overall design is,
i.e. which symbols are font-lock plumbing, which ones are meant to be
used by major modes, which ones should be used by minor modes…

IOW I have no idea where the check should be place either :/