all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Gregory Heytings <gregory@heytings.org>
To: Eli Zaretskii <eliz@gnu.org>
Cc: Po Lu <luangruo@yahoo.com>, acm@muc.de, emacs-devel@gnu.org
Subject: Re: CC Mode troubles and Emacs 29
Date: Tue, 10 Jan 2023 14:13:27 +0000	[thread overview]
Message-ID: <56368889cb296ad26b5e@heytings.org> (raw)
In-Reply-To: <83k01uo8db.fsf@gnu.org>


>
> If this is so, I find it strange that we don't have heaps of bug reports 
> about this in our bug tracker.  I doubt that anyone could ignore the 
> terrible misbehavior you describe, if indeed the description is accurate 
> and not exaggerated.
>

It's indeed exaggerated, AFAIU.  Basically, it's an effect of the 
c-fontify-new-found-type function, which was added to CC Mode in Oct 2021 
because of this thread: 
https://lists.gnu.org/archive/html/emacs-devel/2021-06/msg00174.html.  A 
simple recipe is this:

emacs -Q
C-x C-f foo.c

and type:

int main () { int foo; foo = 1; }
typedef foo SPC

Now 'foo' in 'foo = 1' is fontified in green, because CC Mode considers 
that 'foo' is a type.  If you now realize that 'foo' is a typo, and that 
what you actually meant is 'foobar', and correct that typo with DEL bar, 
'foo' in 'foo = 1' does not loose its type fontification.  And if you do 
that often enough, in the end the buffer is "filled with green splotches". 
Note that this can easily be fixed with C-u C-x x f C-x x f.

It's actually a nice example of the inherent limits of a fontification 
that is not based on an actual parser.




  reply	other threads:[~2023-01-10 14:13 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <874jt0hw7p.fsf.ref@yahoo.com>
2023-01-09  9:51 ` CC Mode troubles and Emacs 29 Po Lu
2023-01-09 12:31   ` Eli Zaretskii
2023-01-09 13:49     ` Po Lu
2023-01-09 15:48       ` Alan Mackenzie
2023-01-09 16:56         ` Eli Zaretskii
2023-01-10  1:05           ` Po Lu
2023-01-10 12:57             ` Eli Zaretskii
2023-01-10 14:13               ` Gregory Heytings [this message]
2023-01-11  1:36                 ` Po Lu
2023-01-11  1:46                   ` Po Lu
2023-01-11  9:27                   ` Gregory Heytings
2023-01-11 10:12                     ` Po Lu
2023-01-11 13:27                       ` Eli Zaretskii
2023-01-11 14:17                         ` Po Lu
2023-01-11 14:27                           ` Gregory Heytings
2023-01-10 17:37               ` Alan Mackenzie
2023-01-10 17:50                 ` Eli Zaretskii
2023-01-09 16:36       ` Eli Zaretskii
2023-01-10  9:26       ` Gregory Heytings
2023-01-10  9:49         ` Po Lu
2023-01-10 10:06           ` Gregory Heytings
2023-01-10 17:05             ` Alan Mackenzie
2023-01-09 15:52   ` Alan Mackenzie

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=56368889cb296ad26b5e@heytings.org \
    --to=gregory@heytings.org \
    --cc=acm@muc.de \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=luangruo@yahoo.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.