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 #8 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: 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: Tue, 18 Feb 2020 02:12:32 +0200
> I think commit fb16313025 (2018-12-18T23:10:09Z!juri <at> linkov.net) had an
> unintended side-effect on fundamental-mode.  From emacs -Q:

This commit contains this change:

diff --git a/lisp/replace.el b/lisp/replace.el
index dcae12e9b7..b8f231eb55 100644
--- a/lisp/replace.el
+++ b/lisp/replace.el
@@ -1907,10 +1907,8 @@ occur-engine
       global-matches)))
 
 (defun occur-engine-line (beg end &optional keep-props)
-  (if (and keep-props (if (boundp 'jit-lock-mode) jit-lock-mode)
-	   (text-property-not-all beg end 'fontified t))
-      (if (fboundp 'jit-lock-fontify-now)
-	  (jit-lock-fontify-now beg end)))
+  (if (and keep-props font-lock-mode)
+      (font-lock-ensure beg end))
   (if (and keep-props (not (eq occur-excluded-properties t)))
       (let ((str (buffer-substring beg end)))
 	(remove-list-of-text-properties

> - C-x b repro RET
> - foo RET "bar" RET baz
> - M-s o . RET
>
> In emacs 26.3, the Occur buffer pops up and not much else happens;
> starting with emacs 27, font-lock-string-face is applied to "bar".
>
> I haven't dug much more than that; FWIW however, emacs 26.3 already
> applied font-lock-string-face to double-quoted strings when running
> (font-lock-ensure) in a fundamental buffer, so maybe the right fix
> belongs e.g. somewhere in font-lock-set-defaults?

Stefan, could you suggest what to do with font-lock-ensure
to not highlight double-quoted strings in fundamental-mode?




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.