From: Yuan Fu <casouri@gmail.com>
To: Mickey Petersen <mickey@masteringemacs.org>
Cc: Eli Zaretskii <eliz@gnu.org>, 61235@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, 7 Feb 2023 19:52:56 -0800 [thread overview]
Message-ID: <5F2D3873-1CC2-4820-A0F5-F15BF0DDCEDD@gmail.com> (raw)
In-Reply-To: <877cwtew8o.fsf@masteringemacs.org>
> 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?
Yuan
next prev parent reply other threads:[~2023-02-08 3:52 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-02 19:46 bug#61235: 30.0.50; tree-sit: `treesit-node-check' lacks a way to tell if a node belongs to a deleted parser Mickey Petersen
2023-02-06 4:24 ` Yuan Fu
2023-02-06 12:34 ` Eli Zaretskii
2023-02-06 12:35 ` Mickey Petersen
2023-02-06 13:19 ` Eli Zaretskii
2023-02-06 13:19 ` Mickey Petersen
2023-02-06 14:05 ` Eli Zaretskii
2023-02-06 14:08 ` Mickey Petersen
2023-02-06 15:21 ` Eli Zaretskii
2023-02-07 3:00 ` Yuan Fu
2023-02-07 3:31 ` Eli Zaretskii
2023-02-07 4:55 ` Yuan Fu
2023-02-07 12:24 ` Eli Zaretskii
2023-02-08 3:54 ` Yuan Fu
2023-02-07 8:03 ` Mickey Petersen
2023-02-08 3:52 ` Yuan Fu [this message]
2023-02-08 8:41 ` Mickey Petersen
2023-02-10 1:28 ` Yuan Fu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5F2D3873-1CC2-4820-A0F5-F15BF0DDCEDD@gmail.com \
--to=casouri@gmail.com \
--cc=61235@debbugs.gnu.org \
--cc=eliz@gnu.org \
--cc=mickey@masteringemacs.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).