GNU bug report logs - #62339
cc-mode fontifies variables incorrectly when const follows type

Previous Next

Package: emacs;

Reported by: Daniel Colascione <dancol <at> dancol.org>

Date: Tue, 21 Mar 2023 15:17:02 UTC

Severity: normal

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

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Alan Mackenzie <acm <at> muc.de>
To: Daniel Colascione <dancol <at> dancol.org>
Cc: 62339 <at> debbugs.gnu.org, Eli Zaretskii <eliz <at> gnu.org>
Subject: bug#62339: cc-mode fontifies variables incorrectly when const follows type
Date: Wed, 5 Apr 2023 15:53:47 +0000
Hello, Daniel.

On Thu, Mar 23, 2023 at 14:40:23 +0000, Alan Mackenzie wrote:
> On Wed, Mar 22, 2023 at 18:17:05 -0400, Daniel Colascione wrote:

> > >> > This problem reproduces for me on latest master with emacs -Q:

> > >> > ```
> > >> > TEST(Foo, Bar) {
> > >> >   NamedTemporaryDirectory const test_directory;
> > >> > }
> > >> > ```

> > >> Thanks.  What I see with Emacs built from master is that
> > >> test_directory in the above example gets font-lock-type-face in
> > >> c++-mode (but not in c-mode).  With Emacs built from emacs-29, both
> > >> modes produce correct fontification.

> > >> Alan, can you please look into this?

[ .... ]

> It turned out that the bug was caused by a single missing line of code, a 
> (c-forward-syntactic-ws) in c-forward-type, so the fix wasn't too
> difficult.  I've taken the opportunity also to fix some minor other
> innaccuracies in c-forward-type.

> Please try the following patch, and either confirm to me that it appears
> to fix the bug, or say what's still wrong.  Thanks!

Ping?

-- 
Alan Mackenzie (Nuremberg, Germany).




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

Previous Next


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