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

From: Alan Mackenzie <acm <at> muc.de>
To: Gregory Heytings <gregory <at> heytings.org>
Cc: 56848-done <at> debbugs.gnu.org, control <at> debbugs.gnu.org
Subject: Re: bug#56848: CC Mode fontification bug
Date: Sun, 15 Jan 2023 12:32:31 +0000
reopen 56848
quit

Hello, Gregory.

Thanks for the Cc:!

I'm (trying to) reopen the bug with this post.

On Sat, Jan 14, 2023 at 21:28:24 +0000, Gregory Heytings wrote:

> Closing this bug.  The proposed patch has been included in commits 
> 4bd8ad2bc5 and 1cbc22b9c7.

I wasn't previously aware of this bug.  I'm not at all happy about the
patches you proposed and have applied.  In particular, you say
(2022-07-31):

> When font locking has already put, say, a font-lock-comment-face, or a
> font-lock-function-name-face, or a font-lock-variable-name-face on an
> occurrence of that identifier, there is no reason to undo that.  It is
> only occurrences that have been marked as "fontified" but on which no
> face has been put that should be unfontified.

, without justification.  There are circumstances in which identifiers
with font-lock-type-face need to be refontified with
font-lock-variable-face, and the reverse, amongs others.  It was trying
to optimise in this area which caused some of Po Lu's bug reports over
the last three months.

An example of what can go wrong is, supposing we have just mistyped

    food sausage;

as

    foo sausage;

..  "All" the identifiers "foo" throughout the buffer will get fontified
with type-face.  On returning to the line and correcting "foo" to
"food", these "foo"s need to be refontified.  This actual scenario
occurred in one of Po's bug reports.

I think that after the patches in this bug, the refontification won't
happen.  I've reopened the bug, and I'm asking you to reconsider these
things.

Thanks!

-- 
Alan Mackenzie (Nuremberg, Germany).




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.