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 13:07:07 -0700 Message-ID: <211D7584-1B0C-4A37-8ADF-08E1942BA719@gmail.com> 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> <83edzmnymo.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="12926"; 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 22:08:04 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 1o2ejk-000369-KX for ged-emacs-devel@m.gmane-mx.org; Sat, 18 Jun 2022 22:08:04 +0200 Original-Received: from localhost ([::1]:43800 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o2ejj-0000KV-9I for ged-emacs-devel@m.gmane-mx.org; Sat, 18 Jun 2022 16:08:03 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:35302) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o2eiu-00082w-NF for emacs-devel@gnu.org; Sat, 18 Jun 2022 16:07:12 -0400 Original-Received: from mail-pf1-x429.google.com ([2607:f8b0:4864:20::429]:43607) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o2eit-0002DZ-6r; Sat, 18 Jun 2022 16:07:12 -0400 Original-Received: by mail-pf1-x429.google.com with SMTP id k127so1732155pfd.10; Sat, 18 Jun 2022 13:07:10 -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=ldyG5fiEupTCw3STJvh9BwofEtATwb4FWeNlcENTHZM=; b=hrYsLyr1gBr3vZIOoK64C9mBx63uVpwlMwXJNV5nOmdsttaTy2851tGt3XMPwxmWES bhT98LA1KloQdrAccnCPCIrvLhXJpXNbDtUq40ptkK5zL2Vo1Jkpf4E3EdGw05I02WzX x9WUACKzCxd8HqZReLoVLirisC4J3seA4Bx2VC8SigNvEDlLO7z69Z6s+mcuRI27Zo0X cTYqNVG1rDeOBX0KHRIrEbYn68XaBZk0xu4+nSZoCYkCsv4qDoCWnTLWgUO/gZilQjmy 8n+m6fqUJYs8ZFjLep6Od/tskJBNbL1TrFzYbwOc3rO0EHfYvR2Z7A6fKHY+PIDe7fuK I5XQ== 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=ldyG5fiEupTCw3STJvh9BwofEtATwb4FWeNlcENTHZM=; b=sGyXFwCOTQq7HSRG270zuz2wCvgC/e7Fhk8sxhCaV7MN7ica6CxDVrwgdYG9gI7yLv TC5k7HclS/cfxffzzolVekuFnZ0JFiWmksEMjT3Q2fRWB+/2TkdeNKwvpNfV9pMXZNXg UilyKkcoEi0oGNlUbNYqHVun23UPxhX/ecnjvLfhxu4OKPHzKEhmJ69xs1Mop8bEHGnn sZoeX+yK1j8A2gUnhehCDBIr5DGOwa0oq0E5OyRfQ5MS7MoWPi31LeJMnSFvmK9UVjdf CSqHac4j6czLSoHivF7bNDwEX5TKBmzgZWL28FaPuiu5BQHkpD4ooDTdzlcM91CcSBT2 NMVA== X-Gm-Message-State: AJIora+QBmOfrhOFwC78JBoRdDImhhwUTC4Xh/000d8T5B3Ks8SD0SBP xSoVNVKiLM2NEVJY6ORQES5+StFNDII= X-Google-Smtp-Source: AGRyM1tLN7gPuzieDn650F2wqMadLRh5n2go5OnpF9398nKYdEGyab9VVFxt0hE9xwEW2yHOHEA64Q== X-Received: by 2002:a05:6a00:a8f:b0:524:e53b:a95b with SMTP id b15-20020a056a000a8f00b00524e53ba95bmr7898614pfl.53.1655582829069; Sat, 18 Jun 2022 13:07:09 -0700 (PDT) Original-Received: from smtpclient.apple ([2600:1700:2ec7:8c90:99d9:ea9d:a995:fcb4]) by smtp.gmail.com with ESMTPSA id w19-20020a1709029a9300b001696751796asm4516158plp.139.2022.06.18.13.07.08 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 18 Jun 2022 13:07:08 -0700 (PDT) In-Reply-To: <83edzmnymo.fsf@gnu.org> X-Mailer: Apple Mail (2.3696.100.31) Received-SPF: pass client-ip=2607:f8b0:4864:20::429; envelope-from=casouri@gmail.com; helo=mail-pf1-x429.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:291384 Archived-At: > On Jun 18, 2022, at 1:50 AM, Eli Zaretskii wrote: >=20 >> From: Yuan Fu >> Date: Sat, 18 Jun 2022 01:25:01 -0700 >> Cc: emacs-devel@gnu.org >>=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? >>=20 >> Yeah. There is no other function, treesit-parser-delete deletes and = removes the parser. >=20 > So you agree with me that a function to remove from the list is not > needed? Once the list is no longer exposed to Lisp, the way Lisp > programs should manipulate the list is by adding and deleting parsers, > and by asking Emacs to show the list of existing parsers. Right? I don=E2=80=99t think we have any disagreement here, it=E2=80=99s just = my miscommunication. We have three functions: - treesit-parser-create that creates a parser and adds it to the parser = list - treesit-parser-delete that deletes a parser and removes it from the = parser list - treesit-parser-list that returns the parser list Yuan=