GNU bug report logs - #61235
30.0.50; tree-sit: `treesit-node-check' lacks a way to tell if a node belongs to a deleted parser

Previous Next

Package: emacs;

Reported by: Mickey Petersen <mickey <at> masteringemacs.org>

Date: Thu, 2 Feb 2023 19:47:02 UTC

Severity: normal

Found in version 30.0.50

Fixed in version 29.1

Done: Yuan Fu <casouri <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Mickey Petersen <mickey <at> masteringemacs.org>
To: Yuan Fu <casouri <at> gmail.com>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 61235 <at> debbugs.gnu.org
Subject: bug#61235: 30.0.50; tree-sit: `treesit-node-check' lacks a way to tell if a node belongs to a deleted parser
Date: Tue, 07 Feb 2023 08:03:56 +0000
Yuan Fu <casouri <at> gmail.com> writes:

>> On Feb 6, 2023, at 7:21 AM, Eli Zaretskii <eliz <at> gnu.org> wrote:
>>
>>> From: Mickey Petersen <mickey <at> masteringemacs.org>
>>> Cc: casouri <at> gmail.com, 61235 <at> debbugs.gnu.org
>>> Date: Mon, 06 Feb 2023 14:08:46 +0000
>>>
>>> All I want is a way for treesit-node-check to tell me if the node
>>> belongs to a dead or alive parser.
>>
>> That'd be fine by me, but the patch posted by Yuan was a different
>> one.
>>
>> Yuan, any reason not to extend treesit-node-check instead?
>
> I did extend treesit-node-check in the patch. But I also added a
> function treesit-parser-live-p, which makes the same check but
> directly on a parser. It just made sense to me that if we let
> treesit-node-check check the nodes’ parser’s status, we’d also add a
> function to allow directly checking the status of a parser.
>
> Micky, the function I added (and the extension to treesit-node-check)
> checks that the parser is not deleted AND its buffer is live. That
> makes the most sense to me, but would it cause any problem for your
> use case?

Thanks for turning around the features so fast.

I can use `treesit-node-buffer' and `buffer-live-p' to accomplish
that, so perhaps leaving out that check makes sense?

> Yuan





This bug report was last modified 2 years and 94 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.