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 19:59:42 +0200 Message-ID: <2832324.DJkKcVGEfx@fedora> References: <865xue1gtu.fsf@gnu.org> <861q4ohq65.fsf@gnu.org> <86zfrcgb9s.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="nextPart19549152.fSG56mABFh" Content-Transfer-Encoding: 7Bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="25471"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 71518@debbugs.gnu.org, casouri@gmail.com To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Jun 22 20:01:16 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 1sL534-0006U3-OP for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 22 Jun 2024 20:01:15 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sL52u-0007oc-QK; Sat, 22 Jun 2024 14:01: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 1sL52s-0007oG-Jo for bug-gnu-emacs@gnu.org; Sat, 22 Jun 2024 14:01: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 1sL52s-0007EK-BR for bug-gnu-emacs@gnu.org; Sat, 22 Jun 2024 14:01:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sL52s-0006h7-25 for bug-gnu-emacs@gnu.org; Sat, 22 Jun 2024 14:01:02 -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 18:01:02 +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.171907925225704 (code B ref 71518); Sat, 22 Jun 2024 18:01:02 +0000 Original-Received: (at 71518) by debbugs.gnu.org; 22 Jun 2024 18:00:52 +0000 Original-Received: from localhost ([127.0.0.1]:54796 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sL52h-0006gT-SZ for submit@debbugs.gnu.org; Sat, 22 Jun 2024 14:00:52 -0400 Original-Received: from mail-ej1-f44.google.com ([209.85.218.44]:42352) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sL52g-0006g6-5c for 71518@debbugs.gnu.org; Sat, 22 Jun 2024 14:00:50 -0400 Original-Received: by mail-ej1-f44.google.com with SMTP id a640c23a62f3a-a7245453319so22476666b.1 for <71518@debbugs.gnu.org>; Sat, 22 Jun 2024 11:00:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1719079184; x=1719683984; 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=0wRHOzdOW/vRzi1l2PmR/A+Di1cf40ZPUdxg6OFbfTA=; b=k+xTw3kAlfdMtoZCP4FwQ7Xn505mEB2OjZLOvdY6LbQptGAMz7lc1kFf0xLvtxhbHh 1t0FtnqrbYLmYMAxOZOlk1ZjxzqcCHXMP9BSfI6QKKDm70e/ASDm7D23Dts/ywBFk6Ub X/cUSwgAYR3D8KL/ggtRTzeCQBU8FLA+oe1Dcl8ypzq3EoxVDIWkxzufYz+nYF3cXfsf 0m9pfDNLD9K6PEppVZCjKobKvwZ7MVP28cEJWRhBY9P5nRWIeSXlpKSlXcjtjknSsh8f G6d6UYYUHyPPIBFNslB8xiIV5zYYq9swjWMKSI2Z5MqNIwGL+Ih2JshgNCRU0If2wxy6 +Nrw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719079184; x=1719683984; 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=0wRHOzdOW/vRzi1l2PmR/A+Di1cf40ZPUdxg6OFbfTA=; b=JNFxA3eIuKwErvFQ8r7H51iD5beCB/GNBQQWu8ZDr7HYIxCYSmTLBKgJ+xgGPVcwTh YfBVuiGjH/tKMAFYLJOT5e2p9Qq38FEcBcI26S7rsERmc1DjKUclYjjAaQRW7Cx6d6cL r34EfmJeOcarVVi9t5e893ykRpEQ4wXdR/x2c2IXYm+CVf7uYxtC4J+RczIxzYnhw8+R Gu5DvYxvC4QI7JiwESHyUvgDuZUAakNx5IvCu3OG7+cCBncQljc2D8IKpGx6ghKHV6oK lqmcDjW4knEv8DRSJGCB8xuwtKFf3j7U7E6kxT3Yo9MvHmw65dcGH9NFvqke5ewMSxUh Licg== X-Gm-Message-State: AOJu0YzALViYBPOX7+NMy+LpQq2BEtkBdE4bu7O3QbbLaNMOUuLyfe9l tmneoUiuH9E2wrXLttBTUpTmGABACDayucIr2fDif7nBNeBwevzF X-Google-Smtp-Source: AGHT+IGGGNDlo24zKj3Ok3ajiB+jkHHfCMF+4OoP3Dao+Giz0YWjOBWvhZednRlK+YuK3OU5Pm5FIw== X-Received: by 2002:a17:907:1610:b0:a6e:f53c:8da0 with SMTP id a640c23a62f3a-a70275ea4e9mr156908066b.8.1719079184079; Sat, 22 Jun 2024 10:59:44 -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 a640c23a62f3a-a7245c37d9esm16815966b.154.2024.06.22.10.59.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 22 Jun 2024 10:59:43 -0700 (PDT) In-Reply-To: <86zfrcgb9s.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:287726 Archived-At: This is a multi-part message in MIME format. --nextPart19549152.fSG56mABFh Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="utf-8" In data sabato 22 giugno 2024 19:03:43 CEST, Eli Zaretskii ha scritto: > > Cc: 71518@debbugs.gnu.org, casouri@gmail.com > > Date: Sat, 22 Jun 2024 19:56:34 +0300 > > From: Eli Zaretskii > > > > Hmm... I still see an error message in *Messages* after installing > > > > this (I have grammar library version 0.22.2): > > Error during redisplay: (jit-lock-function 1) signaled > > (treesit-query-error "Node type error at" 2 "(virtual) > > @font-lock-keyword-face [\"auto\" \"_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\"] @font-lock-keyword-face" "Debug the query with > > `treesit-query-validate'")> > > Any ideas or suggestions? "virtual" is highlighted, though, so I > > guess this is a matter of suppressing the errors or something? > > E.g., you can see in go-ts-mode.el how the code probes whether a > certain query is supported, and uses it only if it is. Sorry, I only tested with .cpp files. The rule had to be protected by (when (eq mode 'cpp)... Now I have tested this with *.c and *.h as well, with old and new grammar. Thanks Vincenzo --nextPart19549152.fSG56mABFh 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 f518a28117c0418dc11bc4d9312df6609272813b 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 The new rule works with both the new (>= 0.22.1) and the old (<= 0.22.0) grammar. * 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. (Bug#71518) --- 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..e7f74fc53f2 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)))) @@ -635,7 +635,8 @@ c-ts-mode--font-lock-settings `([,@(c-ts-mode--keywords mode)] @font-lock-keyword-face ,@(when (eq mode 'cpp) '((auto) @font-lock-keyword-face - (this) @font-lock-keyword-face))) + (this) @font-lock-keyword-face + (virtual) @font-lock-keyword-face))) :language mode :feature 'operator -- 2.45.2 --nextPart19549152.fSG56mABFh--