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#64818: 30.0.50; c++-ts-mode highlight does not work Date: Mon, 24 Jul 2023 21:08:48 +0300 Message-ID: <83mszlqj0v.fsf@gnu.org> References: <83sf9dsewi.fsf@gnu.org> <87ila9sann.fsf@thornhill.no> <834jlts9q0.fsf@gnu.org> <87pm4h5qk2.fsf@thornhill.no> <83wmypqokz.fsf@gnu.org> <9173CE5D-08AE-4BF3-AD37-3B521845F8AC@thornhill.no> <83pm4hqme2.fsf@gnu.org> <87mszl5j30.fsf@thornhill.no> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="16190"; mail-complaints-to="usenet@ciao.gmane.io" Cc: dianchengwang@gmail.com, casouri@gmail.com, 64818@debbugs.gnu.org To: Theodor Thornhill Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Jul 24 20:09: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 1qNzzn-00040j-DA for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 24 Jul 2023 20:09:23 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qNzzX-0007Ak-Tx; Mon, 24 Jul 2023 14:09:07 -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 1qNzzU-0007A9-Ty for bug-gnu-emacs@gnu.org; Mon, 24 Jul 2023 14:09:05 -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 1qNzzT-00027g-5A for bug-gnu-emacs@gnu.org; Mon, 24 Jul 2023 14:09:04 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qNzzS-0001TS-J2 for bug-gnu-emacs@gnu.org; Mon, 24 Jul 2023 14:09:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 24 Jul 2023 18:09:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 64818 X-GNU-PR-Package: emacs Original-Received: via spool by 64818-submit@debbugs.gnu.org id=B64818.16902220955610 (code B ref 64818); Mon, 24 Jul 2023 18:09:02 +0000 Original-Received: (at 64818) by debbugs.gnu.org; 24 Jul 2023 18:08:15 +0000 Original-Received: from localhost ([127.0.0.1]:43984 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qNzyg-0001SQ-Ml for submit@debbugs.gnu.org; Mon, 24 Jul 2023 14:08:15 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:57488) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qNzyd-0001SC-BQ for 64818@debbugs.gnu.org; Mon, 24 Jul 2023 14:08:13 -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 1qNzyX-0001yP-5w; Mon, 24 Jul 2023 14:08:05 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=xCPnXvwIbwFDbxqmVuUkbZfa6mryU4xroulBZnx5TiY=; b=U1h9S1oFwvP7 EhSX3sAywSCCp5Yo8R8B/UYiam5g8SN/Ihbo9fCrCCglsLL4oJsCsaP+2DzqGZaHXgNi3yvmMYK0l cgqf9LIKRrWkPYx6d6GQNnZS9IsnUTxzcXDnVGGgChnAtDP7LhalaqVVFNNaCvDLQs0A1vZuZ24Bg MCcxSDcGSxVk2P+cecYJQ5LoeCMx5ro5QKw/Z5W8Wc/8vYuR6xuDryJMRmngRwmQg1YtozfhvPgFi ZGfhcfPNsh9Y6tdLgo0R280fh6HMtAbwUQJ0/1E+s5LKNGBlEEW0fdNoYPgPjLdRDRuPdbbRu9NT2 boKejxT4VUnBlu1EmauqTg==; 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 1qNzyW-0001Ra-MC; Mon, 24 Jul 2023 14:08:04 -0400 In-Reply-To: <87mszl5j30.fsf@thornhill.no> (message from Theodor Thornhill on Mon, 24 Jul 2023 19:13:07 +0200) 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:265994 Archived-At: > From: Theodor Thornhill > Cc: 64818@debbugs.gnu.org, dianchengwang@gmail.com > Date: Mon, 24 Jul 2023 19:13:07 +0200 > > Eli Zaretskii writes: > > > Can you show the patch? > > > > diff --git a/lisp/progmodes/c-ts-mode.el b/lisp/progmodes/c-ts-mode.el > index 7f4f6f11387..98797bf3ce7 100644 > --- a/lisp/progmodes/c-ts-mode.el > +++ b/lisp/progmodes/c-ts-mode.el > @@ -574,9 +574,7 @@ c-ts-mode--font-lock-settings > :feature 'constant > `((true) @font-lock-constant-face > (false) @font-lock-constant-face > - (null) @font-lock-constant-face > - ,@(when (eq mode 'cpp) > - '((nullptr) @font-lock-constant-face))) > + (null) @font-lock-constant-face) > > :language mode > :feature 'keyword Thanks, please install this on the emacs-29 branch. > > What about catching errors inside treesit.c or treesit.el, so that the > > features that disappeared and queries that fail don't fail the entire > > font-lock? Would that work, or at least make Emacs more robust in the > > face of such changes? > > > > Yuan, WDYT? > > > > (This more robust approach is certainly not for Emacs 29.1, even if we > > agree that it's a good idea.) > > I'll defer that to Yuan, as I'm not 100% on where such errors can be > caught, and if it can make the parser enter some state it shouldn't be > in. AFAIU, it isn't the parser that signaled an error, it's our code which queried tree-sitter about a node that doesn't exist.