From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Tree-sitter integration on feature/tree-sitter Date: Sat, 18 Jun 2022 09:22:26 +0300 Message-ID: <83tu8io5i5.fsf@gnu.org> 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> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="24771"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Yuan Fu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Jun 18 08:28:34 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 1o2Rwd-0006Gx-Q0 for ged-emacs-devel@m.gmane-mx.org; Sat, 18 Jun 2022 08:28:31 +0200 Original-Received: from localhost ([::1]:50810 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o2Rwc-0003kF-DO for ged-emacs-devel@m.gmane-mx.org; Sat, 18 Jun 2022 02:28:30 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:51390) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o2Rqm-0000pP-5t for emacs-devel@gnu.org; Sat, 18 Jun 2022 02:22:29 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:57798) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o2Rql-0007XW-Sw; Sat, 18 Jun 2022 02:22:27 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=ntEYFFn3oGzCzUYDYVtGL2/PDpiN55CGy0O5vIPWvwE=; b=rIbH73ISgVYGGI5G9Ygq BikXxIoYuLzix+9qtm5p1Dolb4EHdjYDueOz0897bgn5F0aIk+Bwf5+x+C9ryREFN0WnjwlZRT6VS mRUMCBY8gSmC8iBcNDuR5Y+ZVsufiMI/0yNiILiggUKJUz1XqeZubs4TsuQTiAlO7XuCx0htjLNMB plpNswvgDNSI2+HJt5ejPWONN6pxGHSD+zSnXirFhzSBlOvgoDlqdoenKPccVmuIINhWPx1eFwgra QOI08iKDwb3QlXa8zw4wH0b2B3hU+jARBu02+vgL22yf2FJ/7SeM83XdhvbdeqcXnVKF4BdH1dkiH GUaf2w9gMebuDQ==; Original-Received: from [87.69.77.57] (port=4057 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o2Rql-0005pB-AE; Sat, 18 Jun 2022 02:22:27 -0400 In-Reply-To: (message from Yuan Fu on Fri, 17 Jun 2022 17:14:58 -0700) 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:291338 Archived-At: > From: Yuan Fu > Date: Fri, 17 Jun 2022 17:14:58 -0700 > Cc: emacs-devel@gnu.org > > >>>> 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. > >>> > >>> And a function to add to the list, right? Or does it already exist? > >> > >> Creating a parser automatically adds it to the parser list of a buffer. > > > > Then removing a parser means we actually delete it? > > Not sure what do you men “delete”. 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. But now I'm confused by what you say here: > 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’ed. 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?