From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Yuan Fu Newsgroups: gmane.emacs.bugs 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: Thu, 9 Feb 2023 17:28:30 -0800 Message-ID: References: <87h6w3hmu6.fsf@masteringemacs.org> Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.300.101.1.3\)) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="9728"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Eli Zaretskii , 61235@debbugs.gnu.org To: Mickey Petersen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Feb 10 02:29:20 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 1pQIE3-0002Np-GS for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 10 Feb 2023 02:29:19 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pQIDo-0002uc-Cu; Thu, 09 Feb 2023 20:29:04 -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 1pQIDm-0002uN-S6 for bug-gnu-emacs@gnu.org; Thu, 09 Feb 2023 20:29:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pQIDm-0004sy-C4 for bug-gnu-emacs@gnu.org; Thu, 09 Feb 2023 20:29:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pQIDm-0006OL-09 for bug-gnu-emacs@gnu.org; Thu, 09 Feb 2023 20:29:02 -0500 X-Loop: help-debbugs@gnu.org In-Reply-To: <87h6w3hmu6.fsf@masteringemacs.org> Resent-From: Yuan Fu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 10 Feb 2023 01:29:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61235 X-GNU-PR-Package: emacs Original-Received: via spool by 61235-submit@debbugs.gnu.org id=B61235.167599253024544 (code B ref 61235); Fri, 10 Feb 2023 01:29:01 +0000 Original-Received: (at 61235) by debbugs.gnu.org; 10 Feb 2023 01:28:50 +0000 Original-Received: from localhost ([127.0.0.1]:33951 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pQIDZ-0006Nm-UV for submit@debbugs.gnu.org; Thu, 09 Feb 2023 20:28:50 -0500 Original-Received: from mail-pj1-f44.google.com ([209.85.216.44]:45822) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pQIDX-0006NT-Vn for 61235@debbugs.gnu.org; Thu, 09 Feb 2023 20:28:48 -0500 Original-Received: by mail-pj1-f44.google.com with SMTP id f15-20020a17090ac28f00b00230a32f0c9eso4072880pjt.4 for <61235@debbugs.gnu.org>; Thu, 09 Feb 2023 17:28:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:cc:date:message-id:subject:mime-version :content-transfer-encoding:from:from:to:cc:subject:date:message-id :reply-to; bh=WZ3NNBnCwkMurKAk0CYve42mYl7U0Jqqf82eorRwG5w=; b=LkqlFOs98upFA6HSYw2MMC7NapzB4e0+bsbWI6wDbTLPp6NW7/fD5tpjZXXGNnnm+X nlnn/B/raCfMH+XI5wJgJG6TwLLJLY7NMUsDsnY1GbAvrkHpBmQCu8P/sig/K5BNMYs2 1ePZUp1XhRAQ1KUQtl8iCoHi9Kf4Wr8s92SH4uU9WgkSYmjNT6IFs93Yeh/ChyBLMQW+ yX9t2NEBkvlOkMNN59SWAZx3+PkHOpjsuR73+EcATRMHJZ4vkKYILmntmU+wD+GA7uSQ Wxo5pomXYf7ggwgNDYAZ8dFAM2VQOHTevIxPT9Sa43tvzV4Oq3MIci40dnRcNBuusPx+ eGIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:cc:date:message-id:subject:mime-version :content-transfer-encoding:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=WZ3NNBnCwkMurKAk0CYve42mYl7U0Jqqf82eorRwG5w=; b=Q+8t4euk4yUPv8Mo3jSTDCLqUN8HmzQc0cVgSDtMBTyQNt0Ed8ZgXTEVg5DoFGQTFe 7KjG6S0szCjzlWSTW2J+xCx6Gm0XvM7UIYGUwaCUTjmysxDlbW9iA/jsDS2zi/8G+8gv x+XTbe5IJDxQ8/sSjUhontn3NURhljmKQPepf+MTQ9ZqwAkV13WE/kA+u0sfNrMSHgsi 5qgnrVD9LkhV73CjvwchyAQKLSfIOyk64gtvnx+yXH9TeWDk4JZYtsnqcSJ7nfLgB36d KUIgRUnOthe8X2lts9c9rgHtSHX09fvkqER84wtBvajuc1uPMG68lDRz3DgHSEQV8MHG 4m/w== X-Gm-Message-State: AO0yUKWOnykl6zCVqNquv1fNfK8URHeq1goEKwKrOleJz9Yz6C5Bw0Sx W/51kjGwz3e75+nlU2pwVpY= X-Google-Smtp-Source: AK7set+fmmdLCgBwlEl8U9Ww3UuG28/laNlaWEbaJnz4jpT7G8SJ8x7/1Ms+HxVwC6YCuxZe36bg7w== X-Received: by 2002:a17:90b:3b8b:b0:231:1c47:1654 with SMTP id pc11-20020a17090b3b8b00b002311c471654mr7487554pjb.27.1675992522334; Thu, 09 Feb 2023 17:28:42 -0800 (PST) Original-Received: from smtpclient.apple (cpe-172-117-161-177.socal.res.rr.com. [172.117.161.177]) by smtp.gmail.com with ESMTPSA id m3-20020a632603000000b0049f77341db3sm1839652pgm.42.2023.02.09.17.28.41 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 09 Feb 2023 17:28:41 -0800 (PST) X-Mailer: Apple Mail (2.3731.300.101.1.3) 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:255259 Archived-At: Mickey Petersen writes: > Yuan Fu writes: > >>> On Feb 7, 2023, at 12:03 AM, Mickey Petersen = wrote: >>> >>> >>> Yuan Fu writes: >>> >>>>> On Feb 6, 2023, at 7:21 AM, Eli Zaretskii wrote: >>>>> >>>>>> From: Mickey Petersen >>>>>> 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=E2=80=99 parser=E2=80=99s = status, we=E2=80=99d 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=E2=80=99m 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 =E2=80=9Clive=E2=80=9D would work for you? > > Sounds good to me, and I think others will find it useful as well! Done. Yuan