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: Tue, 26 Nov 2024 20:45:29 +0200 Message-ID: <15ca9021-c386-465c-9bc7-5b01df0b2d05@gutov.dev> References: <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> <0d1e2770-0889-4862-8105-8a5f4631b11c@gutov.dev> <87ed31gku5.fsf@mail.linkov.net> <86plmljbsm.fsf@gnu.org> <8734jgftif.fsf@mail.linkov.net> <86ttbwihp6.fsf@gnu.org> <4f8f8b97-6650-4a6f-b121-82964fec49cf@gutov.dev> <86o723ikga.fsf@gnu.org> <41e2710f-d612-40e2-9037-d8d388c5edc7@gutov.dev> <86ldx6gjai.fsf@gnu.org> <0dd4b5d1-d2bb-4d87-b18c-8906a1aff4d7@gutov.dev> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="12117"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla Thunderbird Cc: juri@linkov.net, johan.myreen@gmail.com, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Nov 26 19:46:33 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 1tG0Zz-0002vq-Nv for ged-emacs-devel@m.gmane-mx.org; Tue, 26 Nov 2024 19:46:32 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tG0ZV-0005dz-0x; Tue, 26 Nov 2024 13:46:01 -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 1tG0Z8-0005Z0-4j for emacs-devel@gnu.org; Tue, 26 Nov 2024 13:45:47 -0500 Original-Received: from fout-b8-smtp.messagingengine.com ([202.12.124.151]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tG0Z5-0007gY-Ns; Tue, 26 Nov 2024 13:45:37 -0500 Original-Received: from phl-compute-05.internal (phl-compute-05.phl.internal [10.202.2.45]) by mailfout.stl.internal (Postfix) with ESMTP id 6954911401FF; Tue, 26 Nov 2024 13:45:34 -0500 (EST) Original-Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-05.internal (MEProxy); Tue, 26 Nov 2024 13:45:34 -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=1732646734; x=1732733134; bh=/GS3m8XX1FoO1sukxTCBVDyBX5lEQFcziA6r+RNPRqQ=; b= YTKFdk6QcIT4463zDyS6Wrm9Ayrbd0B2UOaXIIPsVj1LmzMB1vc+5TSrn84cLCBD jJFEMBsu6d4QmC8Gy/DoQxFch5MNU128R65wSNn4ebeR6ypm9aWLJAf6lEW/ODc7 U3WYnU5pg/X+FNnFPmnh7djO5coLe5rvTvn9sBMBQqfvFcWP4Gw2lIiPj+p2PhxA JHPMnN1X49yxq5C0ohqmJYNorFjW0un6qiDX9SG6eTHqw4MH+hFGBsZLPsRSxhZt Om0kB7ATN61p1Av34gz7OKC6c0T2s5HUU5bS5Px7oP/wEbelfl7x/+ycexESg3QV JbQVc0vZldt0CaPsSvuANA== 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=1732646734; x= 1732733134; bh=/GS3m8XX1FoO1sukxTCBVDyBX5lEQFcziA6r+RNPRqQ=; b=I k2ty1vh6aRzgjfckdgNOuRKSczd55jlRUgcwXBXFqHv1X3DEKk/jTcGi7KS54wJL Cpi5fDFyQmOrHNDVkxgB21ArCgslkE72OHy/EPQMYDXLlj7OMA5GbAyo8jkoRY/O 04gd1PFcUW5KbZ+0vv0OLuDZtuD2FHEONfFh/j4eXutkzUTArGCBodq4nDhnrWnz cS3arvgWfVuaOlnAPU9BaSMo9l/YS/H5/Pra/hO5metVY65PC6O9scDyYsZ8PdU8 JnxfdKCfpPc6M8QmZpLfZpkLJF9ArSj2A8pSCCS8Ox5GkSP/dgTxDrShWEYNl7me k9QrdvVBo2BxKjS/XBBLw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddrgeejgdduuddvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnh htshculddquddttddmnecujfgurhepkfffgggfuffhvfevfhgjtgfgsehtkeertddtvdej necuhfhrohhmpeffmhhithhrhicuifhuthhovhcuoegumhhithhrhiesghhuthhovhdrug gvvheqnecuggftrfgrthhtvghrnhepvdelieejveekjeelffegudeiudejfffhveduudff vdevteekgeevffejgfffleeunecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpe hmrghilhhfrhhomhepughmihhtrhihsehguhhtohhvrdguvghvpdhnsggprhgtphhtthho peegpdhmohguvgepshhmthhpohhuthdprhgtphhtthhopegvlhhiiiesghhnuhdrohhrgh dprhgtphhtthhopehjuhhriheslhhinhhkohhvrdhnvghtpdhrtghpthhtohepjhhohhgr nhdrmhihrhgvvghnsehgmhgrihhlrdgtohhmpdhrtghpthhtohepvghmrggtshdquggvvh gvlhesghhnuhdrohhrgh X-ME-Proxy: Feedback-ID: i07de48aa:Fastmail Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 26 Nov 2024 13:45:32 -0500 (EST) Content-Language: en-US In-Reply-To: <0dd4b5d1-d2bb-4d87-b18c-8906a1aff4d7@gutov.dev> Received-SPF: pass client-ip=202.12.124.151; envelope-from=dmitry@gutov.dev; helo=fout-b8-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_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_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:325721 Archived-At: On 26/11/2024 20:42, Dmitry Gutov wrote: > On 26/11/2024 16:29, Eli Zaretskii wrote: >>> Maybe like this: >>> >>>     Major Mode Remap Alist: >>>     List of remappings: >>>     INS DEL Remap: >>>                 From major mode: js-mode >>>                 To mode (or function): js-ts-mode >> I'd prefer >> >>     Major Mode Remap Alist: >>     List of remappings: >>     INS DEL >>              Remap from major mode: js-mode >>              To mode (or function): js-ts-mode > > If we use the less-compact version, then the separate label "Remap:" (or > "Repeat" by default) is not optional - it has to be there. But if the word "Alist" was the issue, we can replace it: Major Mode Remap Alist: Remappings: INS DEL From major mode: js-mode To mode (or function): js-ts-mode diff --git a/lisp/files.el b/lisp/files.el index 9c105dbe1a5..9249585df0c 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -3606,7 +3606,10 @@ major-mode-remap-alist FUNCTION is typically a major mode which \"does the same thing\" as MODE, but can also be nil to hide other entries (either in this var or in `major-mode-remap-defaults') and means that we should call MODE." - :type '(alist (symbol) (function))) + :type '(alist + :tag "Remappings" + :key-type (symbol :tag "From major mode") + :value-type (function :tag "To mode (or function)"))) (defvar major-mode-remap-defaults nil "Alist mapping file-specified modes to alternative modes.