From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.devel Subject: Re: Make all tree-sitter modes optional Date: Wed, 15 Feb 2023 20:25:22 +0200 Organization: LINKOV.NET Message-ID: <86bkluolth.fsf@mail.linkov.net> References: <84973.1672843723@hassadar.pretzelnet.org> <83wn62xi3k.fsf@gnu.org> <83o7rexe2n.fsf@gnu.org> <83h6x5xym7.fsf@gnu.org> <83h6wr6gmz.fsf@gnu.org> <868ri140sr.fsf@mail.linkov.net> <83fsc92gbz.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="39307"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu) Cc: Eli Zaretskii , casouri@gmail.com, monnier@iro.umontreal.ca, larsi@gnus.org, theo@thornhill.no, jostein@secure.kjonigsen.net, emacs-devel@gnu.org To: Alan Mackenzie Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Feb 15 19:37:06 2023 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 1pSMeQ-000A5M-Bp for ged-emacs-devel@m.gmane-mx.org; Wed, 15 Feb 2023 19:37:06 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pSMdo-0000q0-Ka; Wed, 15 Feb 2023 13:36:28 -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 1pSMdm-0000nz-Hx for emacs-devel@gnu.org; Wed, 15 Feb 2023 13:36:26 -0500 Original-Received: from relay8-d.mail.gandi.net ([2001:4b98:dc4:8::228]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pSMdk-0004eA-Ny; Wed, 15 Feb 2023 13:36:26 -0500 Original-Received: (Authenticated sender: juri@linkov.net) by mail.gandi.net (Postfix) with ESMTPSA id 4CF2D1BF20A; Wed, 15 Feb 2023 18:36:14 +0000 (UTC) In-Reply-To: (Alan Mackenzie's message of "Tue, 14 Feb 2023 19:08:42 +0000") Received-SPF: pass client-ip=2001:4b98:dc4:8::228; envelope-from=juri@linkov.net; helo=relay8-d.mail.gandi.net X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:303322 Archived-At: > How about commands c-make-ts-default-mode and c-make-ts-undefault-mode > (and analogous functions for the other ts-modes)? The first of these > would push the new entries onto auto-mode-alist and the second would > remove them again. Or we could have a customisable option, > c-default-c-mode which users could set when they are ready. Either of > these would allow the user to try out the new modes freely without being > coerced against their will to use the new -ts- modes. The proposed defcustom 'treesit-enable-modes' was supposed to have such :set that would compare the old with new list of customized modes, then for added modes like 'c-ts-mode' it could call (treesit-enable 'c-ts-mode), and for removed modes (treesit-disable 'c-ts-mode). Then for modes whose entries already exist in auto-mode-alist, it will add/remove a mapping in major-mode-remap-alist. For modes without an entry in auto-mode-alist, it will update auto-mode-alist.