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.devel Subject: Re: Tree-sitter integration on feature/tree-sitter Date: Sat, 18 Jun 2022 01:25:01 -0700 Message-ID: References: <2c2746e5f2558a87e8eab6f0914264a020173a9d.camel@pm.me> <27630AA3-8026-4E24-8852-ACCD9325B99D@gmail.com> <0E9E702B-B07C-4794-8498-29B9320E14CC@gmail.com> <83letvq0ii.fsf@gnu.org> <6EA831D3-A9C9-4346-B1E8-7748BAB285E2@gmail.com> <83czf7pocp.fsf@gnu.org> <83tu8io5i5.fsf@gnu.org> Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.100.31\)) 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="38813"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Jun 18 10:26:35 2022 Return-path: Envelope-to: ged-emacs-devel@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 1o2Tmt-0009wd-Cl for ged-emacs-devel@m.gmane-mx.org; Sat, 18 Jun 2022 10:26:35 +0200 Original-Received: from localhost ([::1]:37910 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o2Tms-0006jd-7k for ged-emacs-devel@m.gmane-mx.org; Sat, 18 Jun 2022 04:26:34 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:37086) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o2TlS-0004zl-1F for emacs-devel@gnu.org; Sat, 18 Jun 2022 04:25:06 -0400 Original-Received: from mail-qv1-xf2a.google.com ([2607:f8b0:4864:20::f2a]:36857) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o2TlQ-0001DZ-CK; Sat, 18 Jun 2022 04:25:05 -0400 Original-Received: by mail-qv1-xf2a.google.com with SMTP id 43so9495142qvb.3; Sat, 18 Jun 2022 01:25:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=HdMuZftC1XbtHIqOiPE0TUpnYei4+abssLYd6s6YSNk=; b=Q0b5PFdReQoJyxQ8nBHrz0fT8PZz7gVGEvbXL2VdM45P5i4kXI+m5eJ3f474V5IA6o rvi2DhHHIAvbGAzPQm+/QgL+avZK/K0d6RJq95sE2Y+7WbHwtuGP1vB19b2yHLMoGne5 Y+EmKOFnbMTkCBDr58X5gdBfIFyjo/L01gy3KQZnpw9kUF8n8SrTz3KlE7Tic8Z8DRzF ubk3seSZNh3WKfuvbTQ2oTFjzooJf150YKsZ0n2429gLpc6q3rr7Sqd5b69YBdUuCkH8 haUc594kIiot11sphimXKDPdZMKSLSRJcFtdP7RtWL/iRLrmpSImiqFQK0u+pgqXoOmA gKQg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=HdMuZftC1XbtHIqOiPE0TUpnYei4+abssLYd6s6YSNk=; b=NLAHIzIZTPxYfRN5xwILNjA81XCvpyESVqzOOznVPLW/KV1pYWLiTW6I8Bh7Gf+dTT ULr791kPdpgdpagtIhgv04GhPn2XAtA+oZwYU+Pk01eNtkc9TeRnCu1GVSPGZ3190F1O LuynV7QhP/XNJ/0rnOvOLB8n4dOgho5XX1Bh6SJ4RnVeIAPbHILF6b4OKDgkFSEq3YO2 vw/b0whlU40iIIAp8Kk1no3Cdtos1VWbemAqSgfYPfu7QCauw+cNj4W8jMjAcD/JdWQC Ti/3OlFlR8RXsRc4XaUUQEc60a0x1Pj0iPWgXHNyBW6++PUd8Avupj2qWzBw/8KUtdKP zNcw== X-Gm-Message-State: AJIora8K1S0gyGxiS6H6Lxx93nJ4JStQGdHq1e5XPDG4vZn/Szf0Mp1r v7nV/umgsKihI+LcOmpx8K42wzVgQ4g= X-Google-Smtp-Source: AGRyM1tPF5rmEx5NL4NPGku1br6ZZnVHjCFsp4h6OQpthuqZwX7PwO66m8KrVPUbZqCURojd8FO5VA== X-Received: by 2002:a05:622a:650:b0:306:77d2:d7c7 with SMTP id a16-20020a05622a065000b0030677d2d7c7mr11755953qtb.338.1655540702831; Sat, 18 Jun 2022 01:25:02 -0700 (PDT) Original-Received: from smtpclient.apple ([2600:1700:2ec7:8c90:99d9:ea9d:a995:fcb4]) by smtp.gmail.com with ESMTPSA id g19-20020ac85813000000b00307aed25fc7sm5962369qtg.31.2022.06.18.01.25.02 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 18 Jun 2022 01:25:02 -0700 (PDT) In-Reply-To: <83tu8io5i5.fsf@gnu.org> X-Mailer: Apple Mail (2.3696.100.31) Received-SPF: pass client-ip=2607:f8b0:4864:20::f2a; envelope-from=casouri@gmail.com; helo=mail-qv1-xf2a.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:291346 Archived-At: > On Jun 17, 2022, at 11:22 PM, Eli Zaretskii wrote: >=20 >> From: Yuan Fu >> Date: Fri, 17 Jun 2022 17:14:58 -0700 >> Cc: emacs-devel@gnu.org >>=20 >>>>>> Moving forward, I want to make treesit-parser-list internal and = turn it into a function that returns the parser list. And add a function = to remove a parser from the parser list. >>>>>=20 >>>>> And a function to add to the list, right? Or does it already = exist? >>>>=20 >>>> Creating a parser automatically adds it to the parser list of a = buffer. >>>=20 >>> Then removing a parser means we actually delete it? >>=20 >> Not sure what do you men =E2=80=9Cdelete=E2=80=9D. >=20 > If creating a parser adds it to the list, then I guessed the semantics > of removing from the list is the opposite: having the parser no longer > exist, i.e. "delete" it. >=20 > But now I'm confused by what you say here: >=20 >> Treesit-parser-delete removes the parser from the parser list of a = buffer, so it is never kept up-to-date with that buffer again. But you = can still do stuff with it until it is gc=E2=80=99ed. >=20 > If we already have treesit-parser-delete, and that call removes the > parser from the list, then why would we need a function "to remove a > parser from the list"? It sounds like treesit-parser-delete already > does it? Yeah. There is no other function, treesit-parser-delete deletes and = removes the parser. Though I don=E2=80=99t know how can you make a = Lisp_Object =E2=80=9Cno longer exist=E2=80=9D. Normally we just turn = # into #, right? Yuan=