From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Turning on/off tree-sitter modes Date: Tue, 03 Dec 2024 12:10:11 -0500 Message-ID: References: <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> <27a62624-387c-4233-b995-170270e26efd@gutov.dev> <86iks245q0.fsf@gnu.org> <86bjxt2avf.fsf@gnu.org> <86wmgg26rt.fsf@gnu.org> <86ser41zr2.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="35772"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: dmitry@gutov.dev, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Dec 03 18:11:04 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 1tIWQR-00099v-Q9 for ged-emacs-devel@m.gmane-mx.org; Tue, 03 Dec 2024 18:11:03 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tIWPu-0003HR-8l; Tue, 03 Dec 2024 12:10:30 -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 1tIWPi-0003Fn-Rf for emacs-devel@gnu.org; Tue, 03 Dec 2024 12:10:20 -0500 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tIWPg-0007eU-RX; Tue, 03 Dec 2024 12:10:18 -0500 Original-Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 53E1A4454ED; Tue, 3 Dec 2024 12:10:13 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1733245812; bh=Hszrs5EL8JZuj3VUv+HNVSS8xFvgvaYu7SToZcgE7Fk=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=dmC+A0fnzO2kiIwHUjKZJ+anozCXJc74Xqy6GHpVW7fuHDLKdfKmpfvNF5nDbUBr+ gaUDFnmmjn7fT7XqRB/yhhheiQFCsFhydv5NA6IdjQ2sSq3iGpGsYvGToX0WAsi10f dosG9qEDDndjrOO+8WEqJyTDB+VI0zZgKWGfFmf3ZvesTfDiWbprOGY8GbZaC/epHh Ayl90lEU2Eo2e5vzUDqTKa7b25RzquMWauVXp9my4lZurd6YgsbC9BYCGthwEA2Qch yiB/dUJdyxoXZXCFqL5fCqI2xpsUwY7VDmFy/QcSxqOJgp02E1dhWDE9kS8HrOws47 FPYpxxqlicP4Q== Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 6CFCD4454DD; Tue, 3 Dec 2024 12:10:12 -0500 (EST) Original-Received: from lechazo (lechon.iro.umontreal.ca [132.204.27.242]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 5D3E3120372; Tue, 3 Dec 2024 12:10:12 -0500 (EST) In-Reply-To: <86ser41zr2.fsf@gnu.org> (Eli Zaretskii's message of "Tue, 03 Dec 2024 18:45:53 +0200") Received-SPF: pass client-ip=132.204.25.50; envelope-from=monnier@iro.umontreal.ca; helo=mailscanner.iro.umontreal.ca X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, 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:325997 Archived-At: > It's possible, but I don't understand why we need to invent a mode > just to use major-mode-remap-defaults/alist. That was just a means to > an end, no? > > Why not consider cmake-ts-mode just a normal major mode, like any > other FOO-mode? That would work as well, yes, but then we need to make sure it "works" even when there's no grammar installed. I assumed that it is currently unusable without a grammar, but I just tried and it seems to work OK (no worse than fundamental-mode, which is all we need). So yes, we could simply setup `auto-mode-alist` unconditionally via `;;;###autoload`. And users could still use `cmake-mode` (or any other alternative) by configuring `major-mode-remap-alist`. Stefan