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 Date: Sat, 23 Nov 2024 20:50:30 +0200 Message-ID: <865xodlr7t.fsf@gnu.org> References: <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> <86r072krq5.fsf@gnu.org> <8b907a41-aa08-4b61-bced-7d4d3fcef4b2@gutov.dev> <87frnhsvp3.fsf@mail.linkov.net> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="37329"; mail-complaints-to="usenet@ciao.gmane.io" Cc: dmitry@gutov.dev, johan.myreen@gmail.com, emacs-devel@gnu.org To: Juri Linkov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Nov 23 19:51:15 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 1tEvDu-0009VG-Co for ged-emacs-devel@m.gmane-mx.org; Sat, 23 Nov 2024 19:51:14 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tEvDI-0005kh-QK; Sat, 23 Nov 2024 13:50:36 -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 1tEvDF-0005kP-0R for emacs-devel@gnu.org; Sat, 23 Nov 2024 13:50:33 -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 1tEvDE-0000S9-Fv; Sat, 23 Nov 2024 13:50:32 -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=mmDvUaUaAxfskSia7yeV3MKWWxEa6qtI5H0ChdVSwHg=; b=XWaKbbk/3kXG 6SwBedvp8YQ213Um2hTR6+YYbGN6VkhC+pRXjTNlDgC7VNFEhFIpYtiyJS8rtlcIVjYmfZWtq9ngM NXBnGzSeETWAYwtlafFmkTD43aKGw4X90udlgmUaDnmcDM3D4zGZBGw9aArNn1DR8wyv2Mje53GWA LmKPEAuUA2sN+aLFF8XxkKqT7gBiGWPBl0XsDihh9OiuX/C20W0/tHPuUume/s5SPQdsXgG/Y7rqX lWPQ9C2yoM4o/3WjaTH7LWnINcnx7O/OFB1fQ5OIGk/u1zyQNfZJUU0E4eRsBGLj2N8quNO1L4/O/ ENmh8CBYIrgn4SCUvdkavw==; In-Reply-To: <87frnhsvp3.fsf@mail.linkov.net> (message from Juri Linkov on Sat, 23 Nov 2024 19:51: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:325631 Archived-At: > From: Juri Linkov > Cc: Eli Zaretskii , johan.myreen@gmail.com, emacs-devel@gnu.org > Recently Philip rightly noticed that 'major-mode-remap-alist' > would be sufficient. And indeed, such a command could be implemented > just as > > (defun treesit-add-enabled-mode (non-ts-mode ts-mode) > (setopt major-mode-remap-alist > (cons (cons non-ts-mode ts-mode) > major-mode-remap-alist))) But is it okay to have a command modify a user option? Do we have examples of this anywhere else?