From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Vincenzo Pupillo Newsgroups: gmane.emacs.bugs Subject: bug#71518: 30.0.50; Errors during redisplay with c++-ts-mode Date: Sat, 22 Jun 2024 16:42:09 +0200 Message-ID: <4884041.OV4Wx5bFTl@fedora> References: <865xue1gtu.fsf@gnu.org> <7108109B-3AFB-4623-890E-1E19903FA0D0@gmail.com> <86wmmhidrw.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="nextPart26461351.1r3eYUQgxm" Content-Transfer-Encoding: 7Bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="24209"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 71518@debbugs.gnu.org To: Yuan Fu , Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Jun 22 16:44:21 2024 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 1sL1yX-00064C-9q for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 22 Jun 2024 16:44:21 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sL1yG-00058V-IT; Sat, 22 Jun 2024 10:44: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 1sL1yE-000585-8Z for bug-gnu-emacs@gnu.org; Sat, 22 Jun 2024 10:44:02 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sL1yE-0002hY-0Z for bug-gnu-emacs@gnu.org; Sat, 22 Jun 2024 10:44:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sL1yD-0007t9-QA for bug-gnu-emacs@gnu.org; Sat, 22 Jun 2024 10:44:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Vincenzo Pupillo Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 22 Jun 2024 14:44:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 71518 X-GNU-PR-Package: emacs Original-Received: via spool by 71518-submit@debbugs.gnu.org id=B71518.171906740030239 (code B ref 71518); Sat, 22 Jun 2024 14:44:01 +0000 Original-Received: (at 71518) by debbugs.gnu.org; 22 Jun 2024 14:43:20 +0000 Original-Received: from localhost ([127.0.0.1]:48447 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sL1xX-0007rf-IP for submit@debbugs.gnu.org; Sat, 22 Jun 2024 10:43:20 -0400 Original-Received: from mail-ed1-f54.google.com ([209.85.208.54]:44116) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sL1xV-0007rL-4C for 71518@debbugs.gnu.org; Sat, 22 Jun 2024 10:43:18 -0400 Original-Received: by mail-ed1-f54.google.com with SMTP id 4fb4d7f45d1cf-57d203d4682so3549026a12.0 for <71518@debbugs.gnu.org>; Sat, 22 Jun 2024 07:43:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1719067331; x=1719672131; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Y6bG0PyOdQtUvPR3lEh8d1mv/gXrE6zFvXMyxQKpa70=; b=jKUSy2iuJ8zGpDjrutWo2HoRQu3gBoh0N0k8GkAYGqSFplf3alF4iciBlhPcBnECTO Dq3EVp7ZA6GUV/JICVSQaGCH+IEHVSGK2UM02BS/QKqJ0UH81R8yruiX5fI6Rd27tuEK /vOputgTgm1AEKYOqmV7yyoGj1d9k40gYcjzZU3YNQo5BBiAFrPk/Lui03Dh6qrICi5x uBmybLWNUHOD2CY3XPVBvCKnClYHpUFiqMjbV4WApLDFrPDjtRiiiRDama/OQrQiIrcB KXuy8dhmqp0qk1ULptjlL6V0ulDmQUM6qnm2cGfdWzpNgHn1/uJU1iTKVIcNjXx7V8SD /n+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719067331; x=1719672131; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Y6bG0PyOdQtUvPR3lEh8d1mv/gXrE6zFvXMyxQKpa70=; b=sUmLvKUSkjUXP/2V3zzrD7RceN527Fu+nsodkjXQOM+bo3SxUmYd0PvjOsAgwOjIJr RPx/XZ3LUFOVk3R8RXSvdw3czJXlEZpeQ0R891sKHBb1C/8Ox/6v8UlJcZfIQhVLsPd3 5sVt5p9QI+06K65X0+kyLRTztSb5hxcZHIIBLSMCuw751Ote5DRF7sK8GR5acypxWU1B bXykgUafTgsN+2hZO3OvF7/EnYc/vnWdxTCCZvAxX6L223myl4HyiDZ5NnL6gd9ChAax TUr920XA4Ingrb77OPo2e6nflBO5OSq8RZs3lrvq9fEjJg4HMCR078mL2YkSOP6uQkHf 49wg== X-Gm-Message-State: AOJu0Yy5XHUJaZO+OhoIJblCK4v19ZXR+0Gk4ikKVgr/NSpdvK/vI1CE RAxk29I7KNPhUqWUHVrfaZZMQf8SjDDLavvWa+hYl8Gv1aNX9TNuZrfq85jz9QQ= X-Google-Smtp-Source: AGHT+IG4J4xZVpV7+/3OMB8h7qgr9nrfZz9hIndt33Za+PPY5DoEaRBoINFLFlgalkO9hRyX9X9vVg== X-Received: by 2002:a50:aadc:0:b0:57d:5c0:9dc0 with SMTP id 4fb4d7f45d1cf-57d4580b023mr695992a12.38.1719067330847; Sat, 22 Jun 2024 07:42:10 -0700 (PDT) Original-Received: from fedora.localnet (2-230-139-124.ip202.fastwebnet.it. [2.230.139.124]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-57d30427f8fsm2447172a12.34.2024.06.22.07.42.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 22 Jun 2024 07:42:10 -0700 (PDT) X-Google-Original-From: Vincenzo Pupillo In-Reply-To: <86wmmhidrw.fsf@gnu.org> 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:287712 Archived-At: This is a multi-part message in MIME format. --nextPart26461351.1r3eYUQgxm Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Hi Eli, fortunately, this time it was easier than usual! Ciao. Vincenzo In data sabato 22 giugno 2024 10:26:43 CEST, Eli Zaretskii ha scritto: > Ping! Any progress with this bug? >=20 > > From: Yuan Fu > > Date: Wed, 12 Jun 2024 23:51:21 -0700 > > Cc: 71518@debbugs.gnu.org, > >=20 > > Bug Report Emacs , > > Eli Zaretskii > > =20 > > > On Jun 12, 2024, at 6:53=E2=80=AFAM, Vincenzo Pupillo > > > wrote:> >=20 > > > In data mercoled=C3=AC 12 giugno 2024 14:33:17 CEST, Eli Zaretskii ha= =20 scritto: > > >> To reproduce in "emacs -Q", visit some C++ source file (I used > > >> breakpoint.c from the GDB sources), then turn on c++-ts-mode. The > > >> fontification is all incorrect, and *Messages* has these error > > >>=20 > > >> messages: > > >> Error during redisplay: (jit-lock-function 7286) signaled > > >> (treesit-query-error "Node type error at" 575 "[\"_Atomic\" \"break= \" > > >> \"case\" \"const\" \"continue\" \"default\" \"do\" \"else\" \"enum\" > > >> \"extern\" \"for\" \"goto\" \"if\" \"inline\" \"register\" > > >> \"restrict\" \"return\" \"sizeof\" \"static\" \"struct\" \"switch\" > > >> \"typedef\" \"union\" \"volatile\" \"while\" \"and\" \"and_eq\" > > >> \"bitand\" \"bitor\" \"catch\" \"class\" \"co_await\" \"co_return\" > > >> \"co_yield\" \"compl\" \"concept\" \"consteval\" \"constexpr\" > > >> \"constinit\" \"decltype\" \"delete\" \"explicit\" \"final\" > > >> \"friend\" \"mutable\" \"namespace\" \"new\" \"noexcept\" \"not\" > > >> \"not_eq\" \"operator\" \"or\" \"or_eq\" \"override\" \"private\" > > >> \"protected\" \"public\" \"requires\" \"template\" \"throw\" \"try\" > > >> \"typename\" \"using\" \"virtual\" \"xor\" \"xor_eq\"] > > >> @font-lock-keyword-face (auto) @font-lock-keyword-face (this) > > >> @font-lock-keyword-face" "Debug the query with > > >> `treesit-query-validate'")> >>=20 > > >> This happens with the latest C++ tree-sitter grammar library. I gue= ss > > >> they made some incompatible change in the grammar or something? > > >=20 > > > Yes, they changed the grammar. > > > https://github.com/tree-sitter/tree-sitter-cpp/issues/271 > > >=20 > > > V. > >=20 > > So it seems =E2=80=9Cvirtual=E2=80=9D is now a named node rather than a= n anonymous node, > > which is a little odd. I asked the author about it in the GitHub issue, > > let me clear that up before fixing c-ts-mode. > >=20 > > And, Eli, we really really should pin tree-sitter grammars. As more peo= ple > > start using tree-sitter modes, they will found out about the breakage > > before we do and the tree-sitter major mode would be unusable for them > > before they upgrade their grammar. Most of them will not know how to do > > it and which commit to downgrade to. And I really don=E2=80=99t want to= chase the > > random changes these grammars make all the time. Fixing for these > > breakages is arguably a heavier maintenance burden than pinning > > tree-sitter grammars. > >=20 > > Yuan --nextPart26461351.1r3eYUQgxm Content-Disposition: attachment; filename="0001-Fix-for-grammar-change-of-keyword-virtual-in-tree-si.patch" Content-Transfer-Encoding: 7Bit Content-Type: text/x-patch; charset="x-UTF_8J"; name="0001-Fix-for-grammar-change-of-keyword-virtual-in-tree-si.patch" >From 84c0c0c821b82d59874996cb7bb78e8205fa1377 Mon Sep 17 00:00:00 2001 From: Vincenzo Pupillo Date: Sat, 22 Jun 2024 16:22:16 +0200 Subject: [PATCH] Fix for grammar change of keyword "virtual" in tree-sitter-cpp * lisp/progmodes/c-ts-mode.el (c-ts-mode--keywords): Removed the keyword "virtual". * lisp/progmodes/c-ts-mode.el (c-ts-mode--font-lock-settings): New font lock rule. --- lisp/progmodes/c-ts-mode.el | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lisp/progmodes/c-ts-mode.el b/lisp/progmodes/c-ts-mode.el index f453392ff7f..7bfb84baecb 100644 --- a/lisp/progmodes/c-ts-mode.el +++ b/lisp/progmodes/c-ts-mode.el @@ -572,7 +572,7 @@ c-ts-mode--keywords "not" "not_eq" "operator" "or" "or_eq" "override" "private" "protected" "public" "requires" "template" "throw" - "try" "typename" "using" "virtual" + "try" "typename" "using" "xor" "xor_eq")) (append '("auto") c-keywords)))) @@ -632,7 +632,8 @@ c-ts-mode--font-lock-settings :language mode :feature 'keyword - `([,@(c-ts-mode--keywords mode)] @font-lock-keyword-face + `((virtual) @font-lock-keyword-face + [,@(c-ts-mode--keywords mode)] @font-lock-keyword-face ,@(when (eq mode 'cpp) '((auto) @font-lock-keyword-face (this) @font-lock-keyword-face))) -- 2.45.2 --nextPart26461351.1r3eYUQgxm--