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:40:36 +0200 Message-ID: References: <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> <86r072krq5.fsf@gnu.org> <8b907a41-aa08-4b61-bced-7d4d3fcef4b2@gutov.dev> <86a5dplxey.fsf@gnu.org> 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="26297"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla Thunderbird Cc: johan.myreen@gmail.com, emacs-devel@gnu.org To: Eli Zaretskii , Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Nov 24 03:41:16 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 1tF2Yl-0006gc-HY for ged-emacs-devel@m.gmane-mx.org; Sun, 24 Nov 2024 03:41:15 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tF2YI-0002Xk-AG; Sat, 23 Nov 2024 21:40:46 -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 1tF2YG-0002XS-19 for emacs-devel@gnu.org; Sat, 23 Nov 2024 21:40:44 -0500 Original-Received: from fout-a4-smtp.messagingengine.com ([103.168.172.147]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tF2YE-0002tX-2j; Sat, 23 Nov 2024 21:40:43 -0500 Original-Received: from phl-compute-11.internal (phl-compute-11.phl.internal [10.202.2.51]) by mailfout.phl.internal (Postfix) with ESMTP id 6573913801DE; Sat, 23 Nov 2024 21:40:40 -0500 (EST) Original-Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-11.internal (MEProxy); Sat, 23 Nov 2024 21:40:40 -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=1732416040; x=1732502440; bh=RR4NvB2cXeV91eOjCHlrq3J1/Omx42voHDA/VPmDVpQ=; b= S9p+M68ij5atrU2qr4ikJsxiVVprWuUT+3+lBTFiErpkQqNUbb6j3U9k0CLPCnMa jkHvDUHuJaszh+hYzf6YwicMnWWhZ0uK2UEvPh+7OQwnSq5hwMvi5BB379IoX1DA CSdStygGCbUVdLhJSbD31ka9M/xvOlNoioHVG0PTmGovOUQ3HC0Wat65NxFNRuX+ VH+yh2OwGTuUmYCMzckigv4BRWmySfd04num621Mxv0r4qv7Q9X1nTxHSUTn/Yx4 ctbotzGyqy+hbCbfsSAgndXGiS+kxQAh4FxrFjDX5cs4ERxLHGey6zmWY2dO4I29 90WG+ag5z0Pgly14CK3N4A== 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=1732416040; x= 1732502440; bh=RR4NvB2cXeV91eOjCHlrq3J1/Omx42voHDA/VPmDVpQ=; b=5 AARR1viHQ2q9Lt0N6fVzsXrDTgPdbFkrzsmmbmfCvvcQi0m5MUJCMKmMvmGC07Dr bU+6l8SipZ4jHxG16yhfHJ2DEMwv0WCGGU1Mx6sXmuQhCm3qRXTVxp8H991UaLId wmdVNuJ53KXRc+PIQNRPMTQ4OpVMVI007vFzrPhy3FzeY2Qy0qxpw2eSECwVVaLx vNoyNEO7BGle/wewR4g6+7vYxxodvFVk4lV9p5/BbuN1vsccC/Wj+beI7/wQxBA8 gg//POWAf78sTVvV3YQCDHxUUAeRDV/R1cjGf1cB2P2/IUTTk+cRX0i17t7al/zU zh9TmphBpqPdTVPtJOoMg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddrgedvgdegkecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdpuffr tefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnth hsucdlqddutddtmdenucfjughrpefkffggfgfuvfevfhfhjggtgfesthejredttddvjeen ucfhrhhomhepffhmihhtrhihucfiuhhtohhvuceoughmihhtrhihsehguhhtohhvrdguvg hvqeenucggtffrrghtthgvrhhnpeetudeljeegheetgfehgeejkeeuhedvveeikeeufedt vddtveefhfdvveegudejheenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmh grihhlfhhrohhmpegumhhithhrhiesghhuthhovhdruggvvhdpnhgspghrtghpthhtohep gedpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtohepvghlihiisehgnhhurdhorhhgpd hrtghpthhtohepmhhonhhnihgvrhesihhrohdruhhmohhnthhrvggrlhdrtggrpdhrtghp thhtohepjhhohhgrnhdrmhihrhgvvghnsehgmhgrihhlrdgtohhmpdhrtghpthhtohepvg hmrggtshdquggvvhgvlhesghhnuhdrohhrgh X-ME-Proxy: Feedback-ID: i07de48aa:Fastmail Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 23 Nov 2024 21:40:38 -0500 (EST) Content-Language: en-US In-Reply-To: <86a5dplxey.fsf@gnu.org> Received-SPF: pass client-ip=103.168.172.147; envelope-from=dmitry@gutov.dev; helo=fout-a4-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_MSPIKE_H2=-0.001, 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:325643 Archived-At: On 23/11/2024 18:36, Eli Zaretskii wrote: >> Date: Sat, 23 Nov 2024 18:26:21 +0200 >> Cc: johan.myreen@gmail.com, emacs-devel@gnu.org >> From: Dmitry Gutov >> >>> . we need the ability to turn on and off selected TS-based modes, >>> and do it easily >> >> Note that we don't have such capability currently. > > We have, sort-of: loading the mode "turns it on" (with known caveats > and disadvantages). In any case, I think we should have this, even if > we don't have it now. It should be part of this improvement. No capability to turn it off, I mean. Anyway, not so hard, except for your question regarding having a command change user option. I don't know if it's a problem. >> Both commands would be pure wrappers on top of the user option, so they >> don't seem to require any advance considerations. Somebody can add those >> later, or any variations on them. > > We could indeed make them wrappers, but changing the user option is > not really clean. If nothing else, users will see that the option was > "modified outside Custom", which could be confusing. But if we > conclude that this is the best way, we could avoid this unpleasant > effect as well (AFAIR, it is based on some special property of the > option's symbol). The indication could be helpful too - mostly in cases when the user opens Customize and sees an unexpected value. But we could avoid it like you say, saving the change as if the Customize buffer was used. Whatever is decided - I don't think the implementation will be a blocker. >> I see no reason to depart from the current approach - except I've >> switched from major-mode-remap-defaults to major-mode-remap-alist (where >> the former is used) because the latter corresponds to user preferences, >> and it seems like that's the subject of our switcher. >> >> This could also be discussed, but seems more of an orthogonal issue. > > Not really orthogonal, since I think Stefan was against changing > auto-mode-alist, because it doesn't handle mode cookies and file-local > variables. Orthogonal in the sense that that choice (whether we want to change that thing or not) doesn't affect our design here much. If we wanted to switch back to using auto-mode-alist uniformly - which I wouldn't recommend personally - the new addition wouldn't have to change much. So it's not something we have to revisit right now.