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


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

From: Daniel Colascione <dancol <at> dancol.org>
To: Alan Mackenzie <acm <at> muc.de>
Cc: 62339 <at> debbugs.gnu.org, Eli Zaretskii <eliz <at> gnu.org>
Subject: Re: bug#62339: cc-mode fontifies variables incorrectly when const
 follows type
Date: Wed, 05 Apr 2023 23:16:16 -0400
[Message part 1 (text/plain, inline)]

On April 5, 2023 11:53:54 Alan Mackenzie <acm <at> muc.de> wrote:

> 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?

Works for me. Thanks!


>
> --
> Alan Mackenzie (Nuremberg, Germany).

[Message part 2 (text/html, inline)]

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.