From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Daniel Colascione Newsgroups: gmane.emacs.bugs Subject: bug#62339: cc-mode fontifies variables incorrectly when const follows type Date: Wed, 05 Apr 2023 23:16:16 -0400 Message-ID: <18754903670.2829.cc5b3318d7e9908e2c46732289705cb0@dancol.org> References: <878rfqcez5.fsf@dancol.org> <837cva6m1e.fsf@gnu.org> <87y1no6f6d.fsf@dancol.org> <83ttyc6cqz.fsf@gnu.org> <87lejo1ldz.fsf@dancol.org> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="18754909c6571a02829dd3b894" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="4262"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: AquaMail/1.43.0 (build: 104300275) Cc: 62339@debbugs.gnu.org, Eli Zaretskii To: Alan Mackenzie Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Apr 06 05:17:20 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pkG7j-0000pK-Vv for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 06 Apr 2023 05:17:20 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pkG7V-0006gt-5p; Wed, 05 Apr 2023 23:17:05 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pkG7T-0006fQ-6L for bug-gnu-emacs@gnu.org; Wed, 05 Apr 2023 23:17:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pkG7S-0004lx-Ua for bug-gnu-emacs@gnu.org; Wed, 05 Apr 2023 23:17:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pkG7S-0003sA-D6 for bug-gnu-emacs@gnu.org; Wed, 05 Apr 2023 23:17:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Daniel Colascione Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 06 Apr 2023 03:17:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62339 X-GNU-PR-Package: emacs Original-Received: via spool by 62339-submit@debbugs.gnu.org id=B62339.168075098614829 (code B ref 62339); Thu, 06 Apr 2023 03:17:02 +0000 Original-Received: (at 62339) by debbugs.gnu.org; 6 Apr 2023 03:16:26 +0000 Original-Received: from localhost ([127.0.0.1]:53126 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pkG6r-0003r7-M7 for submit@debbugs.gnu.org; Wed, 05 Apr 2023 23:16:26 -0400 Original-Received: from dancol.org ([96.126.100.184]:41944) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pkG6o-0003qu-Bo for 62339@debbugs.gnu.org; Wed, 05 Apr 2023 23:16:23 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=dancol.org; s=x; h=Content-Type:MIME-Version:Subject:References:In-Reply-To:Message-ID: Date:CC:To:From:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=AsG23ki/fK/S0KSlZTFP/wzoJHiSW/Mytg9fOYmL2uU=; b=O3UnhUgsNxkBvaYtmasm2m3voM klYmwpTgWD3phLdoxPlNDGXJABlBtHMl0e+S0oCU+EJ62MsDV1QeTfDO4jlu8tfv5K4oG0SF3c+lb aVJRXwodiTaDLK4Welw03xaOnhjGrMItus0JWqxlDckIX4t5TfalVQHQZohKnivIyCTgzzbfsGhs/ Jeo/i2aEXRBmPSPsIuPwXwDgw5p0Tq9RllmBZyKAfoiHTUBPGa9gl14bXhbwlaP55oPWJ8neESlYh 4fqhpu4XgUYqq394Nd2Qcdd9V5xK4ONgmB/dzAjinJ6dKj/fZAsrlpcK2D5vXf9yUusxoJ+QnKbnU HDzuHCCw==; Original-Received: from 097-104-088-154.res.spectrum.com ([97.104.88.154]:44354 helo=[192.168.86.235]) by dancol.org with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256 (Exim 4.94.2) (envelope-from ) id 1pkG6j-0007NE-Ew; Wed, 05 Apr 2023 20:16:18 -0700 In-Reply-To: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:259296 Archived-At: This is a multi-part message in MIME format. --18754909c6571a02829dd3b894 Content-Type: text/plain; format=flowed; charset="us-ascii" Content-Transfer-Encoding: 8bit On April 5, 2023 11:53:54 Alan Mackenzie 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). --18754909c6571a02829dd3b894 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable


On April 5, 2023 11:53:54 Alan Mackenzie <acm@muc.de&g= t; wrote:

Hello, Daniel.

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

This problem reproduces for me on latest master with emac= s -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-f= ace 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 wa= sn't too
difficult.  I've taken the opportunity also to fix s= ome 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!<= /div>

Ping?

Works for me. Thanks!

<= div dir=3D"auto">

-- 
Alan Mackenzie (Nuremberg, Germany).

--18754909c6571a02829dd3b894--