From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#75198: 31.0.50; [treesitter] peculiar error Date: Sat, 04 Jan 2025 19:43:43 +0200 Organization: LINKOV.NET Message-ID: <87pll2mq7c.fsf@mail.linkov.net> References: <87y0zxmgeu.fsf@akurth.de> <87h66l6opc.fsf@mail.linkov.net> <5123F6E2-519E-42DE-9437-E65D1749D9D4@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="36329"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/31.0.50 (x86_64-pc-linux-gnu) Cc: 75198@debbugs.gnu.org To: Yuan Fu Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Jan 04 18:54:29 2025 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 1tU8Lz-0009GK-Dy for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 04 Jan 2025 18:54:27 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tU8Li-0000m5-6W; Sat, 04 Jan 2025 12:54:10 -0500 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 1tU8Lb-0000l9-VZ for bug-gnu-emacs@gnu.org; Sat, 04 Jan 2025 12:54:04 -0500 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 1tU8Lb-0002Jm-Me for bug-gnu-emacs@gnu.org; Sat, 04 Jan 2025 12:54:03 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:References:In-Reply-To:From:To:Subject; bh=Bxk1y/O0owHMycCrO0tr90PJktV/LFhMsCw9P5Wt4a8=; b=GJPa1s1u9JSfE7sQwuQ3Y0R6GpGmD/L6hxioodgCf4VGe89Udk3TWG+xMHI6DiTddwCTGYNJ2+EquB5a9NMAc2UMcGpxxazExhB3gQlDzBj3gn7dlqZyWv4Vw5geV6Mdz1VPPYtluPpFg64r/kSXm42scZwP0+0UirGa9XCiBNsauifXEnWsbFGHHMup7gKwdcITRLEdsg5HJdacW3vsK5g3IySsuu7915iu+iqp474Pva34Ur7sMO3GkVh8fe1g9TIc7ic847hapgZ32NMTMAjixXbiJ1teLIP76GRWqcYXfR945di9Fa3I0CB5lx4rZAo7JEnKTGY3OiSyetZwIg==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tU8Lb-0004YK-HB for bug-gnu-emacs@gnu.org; Sat, 04 Jan 2025 12:54:03 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 04 Jan 2025 17:54:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 75198 X-GNU-PR-Package: emacs Original-Received: via spool by 75198-submit@debbugs.gnu.org id=B75198.173601322317441 (code B ref 75198); Sat, 04 Jan 2025 17:54:03 +0000 Original-Received: (at 75198) by debbugs.gnu.org; 4 Jan 2025 17:53:43 +0000 Original-Received: from localhost ([127.0.0.1]:57177 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tU8LG-0004XF-JQ for submit@debbugs.gnu.org; Sat, 04 Jan 2025 12:53:42 -0500 Original-Received: from relay3-d.mail.gandi.net ([217.70.183.195]:49271) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1tU8LD-0004Wu-R8 for 75198@debbugs.gnu.org; Sat, 04 Jan 2025 12:53:40 -0500 Original-Received: by mail.gandi.net (Postfix) with ESMTPSA id 9C78F60003; Sat, 4 Jan 2025 17:53:30 +0000 (UTC) In-Reply-To: <5123F6E2-519E-42DE-9437-E65D1749D9D4@gmail.com> (Yuan Fu's message of "Sat, 4 Jan 2025 00:26:08 -0800") X-GND-Sasl: juri@linkov.net 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:298440 Archived-At: >> The problem is that 'treesit-parent-until' raises an error by default. >> So needed to copy its implementation where treesit-node-match-p >> sets the argument IGNORE-MISSING to t. >> >> Or maybe better to add new arg IGNORE-MISSING to treesit-parent-until. > > Hmm, I’m not sure. If we go this route, we’d need to add IGNORE-MISSING for > every single function that uses treesit-node-match-p. Agreed, adding a new arg to all such functions is not the right thing. Then maybe better to define the preferred behavior by a new dynamically bound variable, e.g. (let ((treesit-raise-error t)) (treesit-parent-until ... pred)) > It’s better for these functions to check whether the definition of the > thing they’re going to use exists or not, before calling > treesit-node-match-p; alternatively, if they know they don’t care, > they can pass t to IGNORE-MISSING. Not sure how much this will degrade the performance of every function that uses treesit-node-match-p.