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 #14 received at 39597 <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> linkov.net>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 39597 <at> debbugs.gnu.org,
 Kévin Le Gouguec <kevin.legouguec <at> gmail.com>
Subject: Re: bug#39597: 27.0.60: M-x occur adds fontification to
 fundamental-mode
Date: Wed, 19 Feb 2020 00:49:12 +0200
> Maybe something like the patch below?
> 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.

> diff --git a/lisp/font-lock.el b/lisp/font-lock.el
> index 438511b647..bf045d9d7e 100644
> --- a/lisp/font-lock.el
> +++ b/lisp/font-lock.el
> @@ -1139,9 +1139,10 @@ font-lock-ensure
>    "Make sure the region BEG...END has been fontified.
>  If the region is not specified, it defaults to the entire accessible
>  portion of the buffer."
> -  (font-lock-set-defaults)
> -  (funcall font-lock-ensure-function
> -           (or beg (point-min)) (or end (point-max))))
> +  (when (font-lock-specified-p t)
> +    (font-lock-set-defaults)
> +    (funcall font-lock-ensure-function
> +             (or beg (point-min)) (or end (point-max)))))
>  
>  (defun font-lock-default-fontify-buffer ()
>    "Fontify the whole buffer using `font-lock-fontify-region-function'."

I confirm this fixes the problem reported by Kévin,
so maybe this should be installed to emacs-27.




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.