From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#63323: c-ts-mode does not know about `restrict' Date: Sun, 07 May 2023 08:14:25 +0300 Message-ID: <831qjsg1u6.fsf@gnu.org> References: <87r0rtkh2j.fsf.ref@yahoo.com> <87r0rtkh2j.fsf@yahoo.com> <834jophhug.fsf@gnu.org> <83v8h5fya0.fsf@gnu.org> <61B53D25-0E51-4B4C-9890-10E9B97E1840@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="20110"; mail-complaints-to="usenet@ciao.gmane.io" Cc: luangruo@yahoo.com, 63323-done@debbugs.gnu.org To: Yuan Fu Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun May 07 07:14:23 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 1pvWj0-00054j-6e for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 07 May 2023 07:14:22 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pvWii-00060O-JY; Sun, 07 May 2023 01:14:04 -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 1pvWih-000606-IV for bug-gnu-emacs@gnu.org; Sun, 07 May 2023 01:14: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 1pvWih-0003NR-0o for bug-gnu-emacs@gnu.org; Sun, 07 May 2023 01:14:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pvWig-0005Nz-Q2 for bug-gnu-emacs@gnu.org; Sun, 07 May 2023 01:14:02 -0400 Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-To: bug-gnu-emacs@gnu.org Resent-Date: Sun, 07 May 2023 05:14:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: cc-closed 63323 X-GNU-PR-Package: emacs Mail-Followup-To: 63323@debbugs.gnu.org, eliz@gnu.org, luangruo@yahoo.com Original-Received: via spool by 63323-done@debbugs.gnu.org id=D63323.168343642320665 (code D ref 63323); Sun, 07 May 2023 05:14:02 +0000 Original-Received: (at 63323-done) by debbugs.gnu.org; 7 May 2023 05:13:43 +0000 Original-Received: from localhost ([127.0.0.1]:36171 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pvWiN-0005NF-DT for submit@debbugs.gnu.org; Sun, 07 May 2023 01:13:43 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:60082) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pvWiL-0005N1-BG for 63323-done@debbugs.gnu.org; Sun, 07 May 2023 01:13:41 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pvWiG-0003EH-2G; Sun, 07 May 2023 01:13:36 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=U0qPHbrM+l1fjmjfLn3fox0U+cZWB7Zhgi3YI3TzTJU=; b=pPkXb9GHB+m9cI5tpg0R OoPq+r/i/BZCMAldpHZRyVefhQ/9PZyEnBY9C8ugCSKChKJfRvd76JifxsUAbRZTwVZmkcdifeYQ1 /o6fI94YR+2IAuHuxYcW3exCVnfAKLMUvKAa1NHLHwHImicUsbAL5TcbYIAnbUqQDxy+D2zhUMd0p pI1vZRgsSAds5vZ48NERXsOWtPhvhjXK3o5GcSDHAtByIjyi0yL9suH81m2W+T1Zy1F78s/zaz4vZ 0uOg6Wq4EFDXaXcpmUl5cdMR+Mp2K48+LkRJSCEjE63nkILZSM0T9YZPQ23ffNW7AzigPOldXZl9R vijMuP1vCZbfzg==; Original-Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pvWi8-0006DK-VS; Sun, 07 May 2023 01:13:35 -0400 In-Reply-To: <61B53D25-0E51-4B4C-9890-10E9B97E1840@gmail.com> (message from Yuan Fu on Sat, 6 May 2023 15:54:32 -0700) 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:261230 Archived-At: > From: Yuan Fu > Date: Sat, 6 May 2023 15:54:32 -0700 > Cc: luangruo@yahoo.com, > 63323@debbugs.gnu.org > > > > > Actually, it looks like we recognize the type qualifiers in C as > > keywords, via a separate list. So I've just added to that list the > > two missing qualifiers: 'restrict' and '_Atomic', and that fixes this > > bug for me. > > > > Yuan, is that the right fix? I've installed it on the emacs-29 > > branch. > > I check tree-sitter-c’s grammar and it defines type_qualifier [1], so if you move (type_qualifier) @font-lock-type-face out of the check for cpp, if would work. Recognizing them as keywords also works. So both are technically correct. C-mode uses keyword face, so I think your fix is a-ok. > > [1] you probably know this, but for completeness: > > type_qualifier: $ => choice( > 'const', > 'volatile', > 'restrict', > '_Atomic' > ), Right, they just copied from the C Standard. Whether we want to stay with qualifiers in keywords or not depends on whether we thing type qualifiers could or should be fontified differently from keywords. (What do other IDEs do with C type qualifiers?) Something to think for the future, I guess. For now, I'm closing this bug.