From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Theodor Thornhill via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#64818: 30.0.50; c++-ts-mode highlight does not work Date: Mon, 24 Jul 2023 20:22:48 +0200 Message-ID: <87y1j5w4nb.fsf@thornhill.no> 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> <83mszlqj0v.fsf@gnu.org> Reply-To: Theodor Thornhill Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="7885"; mail-complaints-to="usenet@ciao.gmane.io" Cc: dianchengwang@gmail.com, casouri@gmail.com, 64818@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Jul 24 20:23:18 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 1qO0DF-0001p1-Ce for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 24 Jul 2023 20:23:17 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qO0D3-0004I0-4y; Mon, 24 Jul 2023 14:23:05 -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 1qO0D0-0004Hp-Hv for bug-gnu-emacs@gnu.org; Mon, 24 Jul 2023 14:23:03 -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 1qO0D0-0001F4-AG for bug-gnu-emacs@gnu.org; Mon, 24 Jul 2023 14:23:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qO0D0-0001oX-0E for bug-gnu-emacs@gnu.org; Mon, 24 Jul 2023 14:23:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Theodor Thornhill Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 24 Jul 2023 18:23:01 +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.16902229766960 (code B ref 64818); Mon, 24 Jul 2023 18:23:01 +0000 Original-Received: (at 64818) by debbugs.gnu.org; 24 Jul 2023 18:22:56 +0000 Original-Received: from localhost ([127.0.0.1]:44000 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qO0Ct-0001oB-UW for submit@debbugs.gnu.org; Mon, 24 Jul 2023 14:22:56 -0400 Original-Received: from out-33.mta1.migadu.com ([2001:41d0:203:375::21]:14198) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qO0Cp-0001o0-3t for 64818@debbugs.gnu.org; Mon, 24 Jul 2023 14:22:54 -0400 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=thornhill.no; s=key1; t=1690222969; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=m0STRaYy1MYRotmerNQFvs6k8VUuAaKl6i0ciQVVUTo=; b=w0mfxhXlSHU4IGkqtf6xsy3gw91oW/z4biCnKZ1QgYZGxKEiMMeJhFEzEn+EA5Me4GKxoS r5hRMS/TUs7RWNqWnbctARnnlqOwKWW+P+BUNVwkMCV1V02wUQmmSkMCIhk14z2kvJO/uU L5pmcA8OEA94gA+X0XLkM+dUhn1gsNscw1z6yHDW77AvrLzPnWAQte5Yjst71OWe/edb9V rk9YG/EqWEnMDlzcr2Cr1DXyLBDccP+xcxpug9dBX1PDY3oGs2v1lJ3Ma3dEaX04QmwIBk jCF3nA10ROvbJfdnqyVE1sx2FKP6/ABsiJVVrX0ICBG0xwrh0mCxEBx3SR5RuQ== In-Reply-To: <83mszlqj0v.fsf@gnu.org> X-Migadu-Flow: FLOW_OUT 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:265997 Archived-At: Eli Zaretskii writes: >> 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. > Now done >> > 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. True, my bad. Theo