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: Tue, 03 Dec 2024 19:14:59 +0200 Message-ID: <86jzcg1yek.fsf@gnu.org> 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> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="15414"; mail-complaints-to="usenet@ciao.gmane.io" Cc: dmitry@gutov.dev, emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Dec 03 18:15:45 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 1tIWUz-0003qB-HE for ged-emacs-devel@m.gmane-mx.org; Tue, 03 Dec 2024 18:15:45 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tIWUL-0004xX-OB; Tue, 03 Dec 2024 12:15:05 -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 1tIWUK-0004xM-PH for emacs-devel@gnu.org; Tue, 03 Dec 2024 12:15:04 -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 1tIWUI-0008NU-OM; Tue, 03 Dec 2024 12:15:02 -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=I9LXz3YJMV1iaaHhDfjcnk+kkiLZTYG0z/UneN5OHSM=; b=abPe3CA7/3W9 J1YJP8ZUJLEjlFeUAjfR0a7YYpmJqB0rriCqmmxa5mV/sMSYDx2x7JdHgrPI9X08boaCWH+B20Xxn lzikqIi7dJ3GkAfjoFdxy7OPRq0/+c1XDZp/UgF5BKeOkmfuEfcx5St1yPe6EqGak2PMebroluvU0 aPl4DUtNRYFNf050u5ftJq/FGxLFSnqthYVXM8tYYp/qtNsB8zM7di5vhK43i0zOk/eIHS4iWS74v DFPldGVZ6mQ+5+WvZChmlMk/m+HtopBF4bVcPXW4RzxIY9fQQHUO2d0hVSnZoogS1uhKLUVH1X+z+ GjMGq2gJOpFZ2vvFO9WD6A==; In-Reply-To: (message from Stefan Monnier on Tue, 03 Dec 2024 12:10:11 -0500) 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:325998 Archived-At: > From: Stefan Monnier > Cc: dmitry@gutov.dev, emacs-devel@gnu.org > Date: Tue, 03 Dec 2024 12:10:11 -0500 > > > 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. That could be something we need in order to augment the remapping part: a function suitable to be in auto-mode-alist, which reverts to Fundamental if the "real" mode signals an error of some special kind. Or maybe just some simple recovery code in normal-mode? I thought you proposed something like that in this discussion? > And users could still use `cmake-mode` (or any other alternative) by > configuring `major-mode-remap-alist`. Right.