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: Turning on/off tree-sitter modes (was: An anonymous IRC user's opinion) Date: Sat, 23 Nov 2024 15:24:50 +0200 Message-ID: <86r072krq5.fsf@gnu.org> References: <86fro4sddd.fsf@gnu.org> <6ac73c67-cb2d-48ef-8f1d-683c5335aba5@gutov.dev> <8634k4s2r2.fsf@gnu.org> <082b0388-b3a1-4523-9f9b-5ead4b110e11@gutov.dev> <86plmrtemx.fsf@gnu.org> <7aa4a684-3374-4d0f-8efc-c4df29337c5e@gutov.dev> <86cyirtahu.fsf@gnu.org> <556779b3-9308-4fd3-9050-bf9c49658cd1@gutov.dev> <864j43t8t9.fsf@gnu.org> <4cc676e8-cac5-4348-99b0-243baf74687e@gutov.dev> <8634jnt5e3.fsf@gnu.org> <4864104c-cb23-4356-ad89-2fea111db66c@gutov.dev> <86ttc2rrh8.fsf@gnu.org> <86cyipsp94.fsf@gnu.org> <9cd17f8b-f88c-49f6-9024-0b6d297e18ac@gutov.dev> <867c8xsmri.fsf@gnu.org> <566ac897-ea5e-4141-bcb3-306d43c9118a@gutov.dev> <865xohrvfa.fsf@gnu.org> <86wmgwnyle.fsf@gnu.org> <178dfc7f-bc2d-4e3b-8417-a616ccc0eef3@gutov.dev> <86v7wgnxlz.fsf@gnu.org> <01d83ec8-c02b-4806-8764-38dc89a89125@gutov.dev> <86ttbzojho.fsf@gnu.org> <930f5c8e-1481-43a5-8f1d-2c13a98df74f@gutov.dev> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="20856"; mail-complaints-to="usenet@ciao.gmane.io" Cc: johan.myreen@gmail.com, emacs-devel@gnu.org To: Dmitry Gutov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Nov 23 14:25:28 2024 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 1tEq8e-0005IA-OS for ged-emacs-devel@m.gmane-mx.org; Sat, 23 Nov 2024 14:25:28 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tEq88-0005c0-Lb; Sat, 23 Nov 2024 08:24:56 -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 1tEq86-0005bX-Mk for emacs-devel@gnu.org; Sat, 23 Nov 2024 08:24:54 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tEq86-0006bY-ET; Sat, 23 Nov 2024 08:24:54 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=mDlYJtuhWYfkUqlENpS2P3Skp6VjJxoAhx3fkUN9rWg=; b=rSDpeUw4NvXT afVTu3Rbr9xd03ekmq80B9dATuELVEwimC6j+BoO+oNGG2b533iVotLMiA9oDhFm8HVqazVq+XeMP W3UnnKl8rmg2IuaOBBO4iPK9hc1JwmZWKDRg7ddWPX3T6Nlsq4ckKpRN4V3RW1HkS3Ll4dzVtvmZU /6CVqgbkn45JawRrayayt5t5/+CE0HwOURLTOxxG60bPuCnLd1ALlxiMM8a/LMVlMcR5K6Dtg0GWO 95ynr/j0jpSigFi5/XfSd34+W5FuGvxq+3vl58ST3Fn1Nvd3RW85+Pywvjzjh2UamnZFGiDQDl11R 86ulcID7OvyOXjNNSY1HcQ==; In-Reply-To: <930f5c8e-1481-43a5-8f1d-2c13a98df74f@gutov.dev> (message from Dmitry Gutov on Fri, 22 Nov 2024 17:08:52 +0200) 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-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:325622 Archived-At: [I've started a new thread about this.] > Date: Fri, 22 Nov 2024 17:08:52 +0200 > Cc: johan.myreen@gmail.com, emacs-devel@gnu.org > From: Dmitry Gutov > > >> That's what my patch aims to do, to be the replacement for the > >> capabilities we currently have, but in a more "ecological" way. And add > >> a user option, like I think you requested. > > > > Agreed. So I'm asking again: what is the next step? Should we start > > a new discussion about replacing (on master) the current > > implementation with a command based on your patch? > > Sure. > > Not a command, though - a user option. The command is 'M-x > customize-variable', at least in the current version. Though I suppose > that's also up for discussion. > > > One thing that I > > think is missing in your patch is a way to go back to use the non-TS > > modes (where they are available). > > I think it does that already - but only for new buffers. That could be > implemented without too much trouble, now or in a later revision. > > > But maybe people don't think we > > should have that? > > Not sure which would be more natural. But if we implement switching for > existing buffers when when treesit-enable-modes is customized to t, I > suppose the reverse could also be expected. > > > Another thing that seems to be missing is a command > > to enable just one TS-based mode, not all of them. > > How about if that's done like: > > (setopt treesit-enable-modes '(c-ts-mode)) > > Or maybe 'M-x treesit-add-enabled-mode' can be added too. I think a command is better. Here are the issues that are currently not handled by your patch, which perhaps require modifications and additions (but should probably be discussed first): . we need the ability to turn on and off selected TS-based modes, and do it easily . we should include in this feature handling of all the TS-based modes in core (right now, I don't see python-ts-mode, ruby-ts-mode, and csharp-ts-mode, at least) . we should decide how to handle TS-based modes whose non-TS counterparts are available as 3rd-party packages . we should decide whether we want to modify auto-mode-alist or use major-mode remapping for all the TS-based modes