GNU bug report logs - #56848
CC Mode fontification bug

Previous Next

Package: emacs;

Reported by: Gregory Heytings <gregory <at> heytings.org>

Date: Sun, 31 Jul 2022 00:17:01 UTC

Severity: normal

Done: Alan Mackenzie <acm <at> muc.de>

Bug is archived. No further changes may be made.

Full log


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

From: Gregory Heytings <gregory <at> heytings.org>
To: bug-gnu-emacs <at> gnu.org
Subject: CC Mode fontification bug
Date: Sun, 31 Jul 2022 00:16:37 +0000
[Message part 1 (text/plain, inline)]
Recipe:

emacs -Q
C-x C-f src/xdisp.c RET
M-g c 28 RET
;; take note of the word there: "window"
M-: (get-char-property 28 'fontified) RET
;; observe that this returns t
M-g g 800 RET
C-v
M-: (get-char-property 28 'fontified) RET
;; observe that this returns nil, because "struct window" is now visible

This is a BUG.

When font locking has put a fontified property and one of the 
font-lock-*-faces on characters in the buffer, a mode should not undo that 
unless it has a very good reason to do so.  Otherwise scrolling again 
through an already fontified buffer calls fontification functions again 
without reason.

Patch attached.

With the patch, scrolling again through an already fontified buffer is 
~25% faster.
[Be-conservative-with-occurrences-of-newly-found-types.patch (text/x-diff, attachment)]

This bug report was last modified 2 years and 123 days ago.

Previous Next


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