bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#61235: 30.0.50; tree-sit: `treesit-node-check' lacks a way to tell i


From: Mickey Petersen
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: Wed, 08 Feb 2023 08:41:35 +0000
User-agent: mu4e @VERSION@; emacs 30.0.50

Yuan Fu <casouri@gmail.com> writes:

>> On Feb 7, 2023, at 12:03 AM, Mickey Petersen <mickey@masteringemacs.org> 
>> wrote:
>>
>>
>> Yuan Fu <casouri@gmail.com> writes:
>>
>>>> On Feb 6, 2023, at 7:21 AM, Eli Zaretskii <eliz@gnu.org> wrote:
>>>>
>>>>> From: Mickey Petersen <mickey@masteringemacs.org>
>>>>> Cc: casouri@gmail.com, 61235@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?
>
> I’m hoping to write the function as I described, ie, return t only if
> the parser is not deleted and its buffer is live. So I wonder if this
> definition of “live” would work for you?

Sounds good to me, and I think others will find it useful as well!





reply via email to

[Prev in Thread] Current Thread [Next in Thread]