From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.devel Subject: Re: Turning on/off tree-sitter modes Date: Sun, 24 Nov 2024 04:21:43 +0200 Message-ID: References: <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> <865xodlr7t.fsf@gnu.org> <874j3xoiu8.fsf@mail.linkov.net> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="5773"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla Thunderbird Cc: johan.myreen@gmail.com, emacs-devel@gnu.org, Stefan Monnier To: Juri Linkov , Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Nov 24 03:22:44 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 1tF2Gq-0001N3-A1 for ged-emacs-devel@m.gmane-mx.org; Sun, 24 Nov 2024 03:22:44 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tF2Fz-0007Rs-Ld; Sat, 23 Nov 2024 21:21:51 -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 1tF2Fy-0007Rj-Ob for emacs-devel@gnu.org; Sat, 23 Nov 2024 21:21:50 -0500 Original-Received: from fhigh-a6-smtp.messagingengine.com ([103.168.172.157]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tF2Fx-0000gD-4F; Sat, 23 Nov 2024 21:21:50 -0500 Original-Received: from phl-compute-07.internal (phl-compute-07.phl.internal [10.202.2.47]) by mailfhigh.phl.internal (Postfix) with ESMTP id D6BEA1140084; Sat, 23 Nov 2024 21:21:47 -0500 (EST) Original-Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-07.internal (MEProxy); Sat, 23 Nov 2024 21:21:47 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm2; t=1732414907; x=1732501307; bh=RWxboNWWoBXQc3+wmLXgbwXmyB2p4G853ttzThN1+lU=; b= Fzre31uk8r3NA17mAqqBCMaBqPXl1CYCJ8Pk2yMb+Xw7iveE5nYHckq95/ZcN+df Ie2yeFiguY85vhUeRilWqZqH45sJoDzzzt24QnfVXrz47O6daoepxIz68GwBAqSE 7GzRUzKNi+frk3GaVOpGT/42GKyI16xGgFNKTv3EtSZ6C9kZVAnqemFahmC3BVGs 3HK0QNHH5MdHenXAgybyRK9y2kTIIbVPa6Sd0yXjOMHUeAUxOY6T/uxZXudgDMZf P5DAkaJ4EYugjcn2gfhlJIQZP2/sbCt/kVWwBmlsrYY5oHUnw0esrqbHoe9IMbN9 eDGpSkBdGz41yYbClk/nrg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1732414907; x= 1732501307; bh=RWxboNWWoBXQc3+wmLXgbwXmyB2p4G853ttzThN1+lU=; b=T 0C30TCoQ8OM5EpB8xlxyPdz8xyy0q/y4wuoMNlxvt/hzsr/i8djXTrXQSgNI5QCX CmW1hUcJcwu/Xh/5eBFBFA/U6SsN4c3BBgzcBZR1zrKuYdObzANknw3oyjGEmhIn uQpEmXHoLNjVUq/Ljj4KrajK+B+h5PAAcL2cJqiqxrwPwiokD4w26KGyjGH2qXaq 8lrdHzXmUNpYWRdAhF7o73YA+TjUuiKpAAeV9iFNxStcohlV/QwjbqxgpU1XL3TP +TzP/4phCtBneGX0Y8Bo5j92qoZawT6Te/HzZ+pzuAZOmKRPRSgdnSiRce4fdUyC 5+xrVXbNuSfkczgVgmCRQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddrgedvgdeggecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdpuffr tefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnth hsucdlqddutddtmdenucfjughrpefkffggfgfuvfevfhfhjggtgfesthejredttddvjeen ucfhrhhomhepffhmihhtrhihucfiuhhtohhvuceoughmihhtrhihsehguhhtohhvrdguvg hvqeenucggtffrrghtthgvrhhnpeetudeljeegheetgfehgeejkeeuhedvveeikeeufedt vddtveefhfdvveegudejheenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmh grihhlfhhrohhmpegumhhithhrhiesghhuthhovhdruggvvhdpnhgspghrtghpthhtohep hedpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtohepjhhurhhisehlihhnkhhovhdrnh gvthdprhgtphhtthhopegvlhhiiiesghhnuhdrohhrghdprhgtphhtthhopehjohhhrghn rdhmhihrvggvnhesghhmrghilhdrtghomhdprhgtphhtthhopegvmhgrtghsqdguvghvvg hlsehgnhhurdhorhhgpdhrtghpthhtohepmhhonhhnihgvrhesihhrohdruhhmohhnthhr vggrlhdrtggr X-ME-Proxy: Feedback-ID: i07de48aa:Fastmail Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 23 Nov 2024 21:21:45 -0500 (EST) Content-Language: en-US In-Reply-To: <874j3xoiu8.fsf@mail.linkov.net> Received-SPF: pass client-ip=103.168.172.157; envelope-from=dmitry@gutov.dev; helo=fhigh-a6-smtp.messagingengine.com X-Spam_score_int: -26 X-Spam_score: -2.7 X-Spam_bar: -- X-Spam_report: (-2.7 / 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, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, URIBL_SBL_A=0.1 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:325640 Archived-At: On 23/11/2024 21:23, Juri Linkov wrote: >>> 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? > Then it could modify the variable 'major-mode-remap-defaults'. > And 'major-mode-remap-alist' will take precedence over it > when customized. I don't have a strong opinion, but it seems like if a variable is modified by explicit command from the user, major-mode-remap-alist seems more appropriate than major-mode-remap-defaults (which would be about some global defaults). Not 100% sure though - because that plan would delete the vast majority of the uses of the latter from the core (except for TeX's mappings, it seems).