GNU bug report logs - #39597
27.0.60: M-x occur adds fontification to fundamental-mode

Previous Next

Package: emacs;

Reported by: Kévin Le Gouguec <kevin.legouguec <at> gmail.com>

Date: Fri, 14 Feb 2020 08:19:02 UTC

Severity: normal

Tags: fixed

Found in version 27.0.60

Fixed in version 28.0.50

Done: Juri Linkov <juri <at> linkov.net>

Bug is archived. No further changes may be made.

Full log


Message #41 received at 39597 <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> linkov.net>
To: Kévin Le Gouguec <kevin.legouguec <at> gmail.com>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 39597 <at> debbugs.gnu.org,
 Stefan Monnier <monnier <at> iro.umontreal.ca>
Subject: Re: bug#39597: 27.0.60: M-x occur adds fontification to
 fundamental-mode
Date: Sun, 23 Feb 2020 02:24:15 +0200
> Idle musing: I wonder if something could be done inside
> fundamental-mode.  It's not the only fontification issue I've noticed
> there[1].
>
> [1] E.g. (I was about to report this as a distinct issue… someday…)
>
>     C-x b foo
>     foo RET bar RET baz RET
>     M-s h r a RET RET
>     aaaa
>
>     ⇒ In all modes *but* fundamental-mode, hi-lock-mode dynamically
>     highlights new matches (e.g. the added "aaaa" string here).
>
>     This bug is not strictly related to the current one, since the
>     former has been with us since at least 26.3, but that does make me
>     wonder whether both issues could be solved by turning some font-lock
>     knob in fundamental-mode…

Searching for "font-lock-specified-p" in hi-lock.el
shows these fragments of code.  This first condition decides
whether to use font-lock for highlighting matches
that returns nil in fundamental-mode:

      (if (and font-lock-mode (font-lock-specified-p major-mode))

      ;; FIXME: Calling `font-lock-remove-keywords' causes
      ;; `font-lock-specified-p' to go from nil to non-nil (because it
      ;; calls font-lock-set-defaults).  This is yet-another bug in
      ;; font-lock-add/remove-keywords, which we circumvent here by
      ;; testing `font-lock-fontified' (bug#19796).




This bug report was last modified 5 years and 145 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.