From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.bugs Subject: bug#64830: 30.0.50 C++ treesitter mode no coloration Date: Sun, 25 Aug 2024 02:19:28 +0000 Message-ID: References: <868qwy8ii9.fsf@gnu.org> <86o75s5pu0.fsf@gnu.org> <86mslc5plq.fsf@gnu.org> <86h6bk5nnu.fsf@gnu.org> <3C502C2B-829D-42C3-A74A-2A783F5880CE@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="26835"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 64830@debbugs.gnu.org, Eli Zaretskii To: Yuan Fu Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Aug 25 04:20:34 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 1si2rp-0006pf-Tb for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 25 Aug 2024 04:20:34 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1si2rY-0000Z0-3M; Sat, 24 Aug 2024 22:20:16 -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 1si2rV-0000Ym-UE for bug-gnu-emacs@gnu.org; Sat, 24 Aug 2024 22:20:14 -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 1si2rV-0003lT-Ku for bug-gnu-emacs@gnu.org; Sat, 24 Aug 2024 22:20:13 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=From:In-Reply-To:MIME-Version:References:Date:To:Subject; bh=NJJ10spNH8lAe3C081Nety2c0BRQlhYEe6E/xBPIaXY=; b=vUcC4bELOOuoi/g7ABMAhcCLfie1ZZcSf7PFQdSyL6dr+LS9/mjALaVq5SQSyk2TYi7HYqdrXyNdrSRGMtaIO4hSTaHAoufKXhewPRn36KwxIGW8q19Pr6qex9LDvBjYNeGd3EAffFjdqQzFREhs2nT9UFidUXx/uGWUVYZlJTU5z5J+IP4FJek49R5AimBR6rCcW0lZtGjFNNVJIAFijGgtM23q75tx1iklMpERwapGwqE6cNYKStDLzlYYtr1jYcbd3BhVTS9zk8uxQUFna2zjarjzw2sN7fh6FdH2hqrlibi4Q2V++t6L+TbBB7QSfWGBxOHMnF1mC10+QJaQRg==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1si2sI-0003WD-ER for bug-gnu-emacs@gnu.org; Sat, 24 Aug 2024 22:21:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Alan Mackenzie Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 25 Aug 2024 02:21:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 64830 X-GNU-PR-Package: emacs Original-Received: via spool by 64830-submit@debbugs.gnu.org id=B64830.172455242913467 (code B ref 64830); Sun, 25 Aug 2024 02:21:02 +0000 Original-Received: (at 64830) by debbugs.gnu.org; 25 Aug 2024 02:20:29 +0000 Original-Received: from localhost ([127.0.0.1]:42029 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1si2rl-0003V8-3j for submit@debbugs.gnu.org; Sat, 24 Aug 2024 22:20:29 -0400 Original-Received: from mail.muc.de ([193.149.48.3]:41515) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1si2rg-0003Un-RT for 64830@debbugs.gnu.org; Sat, 24 Aug 2024 22:20:27 -0400 Original-Received: (qmail 90407 invoked by uid 3782); 25 Aug 2024 04:19:29 +0200 Original-Received: from muc.de (p4fe152fc.dip0.t-ipconnect.de [79.225.82.252]) (using STARTTLS) by colin.muc.de (tmda-ofmipd) with ESMTP; Sun, 25 Aug 2024 04:19:28 +0200 Original-Received: (qmail 4822 invoked by uid 1000); 25 Aug 2024 02:19:28 -0000 Content-Disposition: inline In-Reply-To: X-Submission-Agent: TMDA/1.3.x (Ph3nix) X-Primary-Address: acm@muc.de 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:290706 Archived-At: Hello, Yuan. On Sat, Aug 24, 2024 at 13:43:25 -0700, Yuan Fu wrote: > > On Aug 24, 2024, at 12:38 PM, Alan Mackenzie wrote: > > On Sat, Aug 24, 2024 at 11:35:36 -0700, Yuan Fu wrote: > >>> On Aug 19, 2024, at 8:46 PM, Yuan Fu wrote: > >>>> On Aug 16, 2024, at 11:27 AM, Eli Zaretskii wrote: > >>>>> Date: Fri, 16 Aug 2024 18:06:31 +0000 > >>>>> Cc: 64830@debbugs.gnu.org, casouri@gmail.com, acm@muc.de > >>>>> From: Alan Mackenzie > >>>>>> Maybe your Emacs 30 build is old? > >>>>> No. I updated it on Wednesday, the most recent commit I have being: > >>>>> commit 9bedb957bebdca99b1bb96f58ea790e20ed48dee (HEAD -> emacs-30, > >>>>> origin/emacs-30) > >>>>> Author: Eli Zaretskii > >>>>> Date: Wed Aug 14 11:35:48 2024 +0300 > >>>>> Improve documentation of time-parsing functions > >>>>> .. I will update it right now and retry .... > >>>>> ..... DONE. It makes no difference. I don't understand either > >>>>> why I see this bug and you don't. > >>>> Maybe try updating the C++ grammar library? > >>>> Yuan, any ideas? > >>> Nothing obviously wrong from a glance. I’m very busy recently but > >>> I’ll have some time this week to look into this. Sorry for the > >>> delay :-) > >>> Yuan > >> Upon closer inspection, I think this is caused by a recent change in > >> c-ts-mode font-lock rules, in > >> 014aab9847a0d3d898cb8cbc7224143f2d741abb. > >> Alan, could you do this: don’t upgrade your c++ grammar and try this > >> patch, if I was right it should fix your problem. Thanks! > > I updated my emacs-30 branch, checked that that commit was included, > > and rebuilt it. The problem still exists on my copy of Emacs 30. > > :-( > No no I mean apply the attached patch and see if it fixes the problem. > The commit hash I mentioned is the source of the bug, not the fix ;-) Sorry about the misunderstanding. I've now applied your patch, the one whose first hunk's header is: @@ -537,6 +537,16 @@ c-ts-mode--top-level-label-matcher , but it unfortunately doesn't solve the bug. On templates-21.cc, one of the test files from CC Mode, on doing M-x c++-ts-mode, there is no fontification at all. In *Messages* we have Error during redisplay: (jit-lock-function 1) signaled (treesit-query-error "Node type error at" 677 "[\"_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\" \"xor\" \"xor_eq\"] @font-lock-keyword-face (auto) @font-lock-keyword-face (this) @font-lock-keyword-face (virtual) @font-lock-keyword-face" "Debug the query with `treesit-query-validate'") That "Node type error at" 677 isn't a buffer position - the buffer is only 325 characters long. Is there anything else I could do to help, here? > Yuan -- Alan Mackenzie (Nuremberg, Germany).