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: Tree-sitter and major mode inheritance Date: Sun, 20 Nov 2022 09:05:55 +0200 Message-ID: <83a64m6r70.fsf@gnu.org> References: <0249C656-21C8-49F2-B979-A1894BF80637@gmail.com> <1B76E73A-0DCD-456E-9F28-0E90723DA66D@gmail.com> <83sfif8cl2.fsf@gnu.org> <43E997E4-3449-4974-AB8C-BD5A4AA8A738@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="1323"; mail-complaints-to="usenet@ciao.gmane.io" Cc: dgutov@yandex.ru, emacs-devel@gnu.org, monnier@iro.umontreal.ca, theo@thornhill.no To: Yuan Fu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Nov 20 08:06:11 2022 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 1oweP4-00007N-L3 for ged-emacs-devel@m.gmane-mx.org; Sun, 20 Nov 2022 08:06:10 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oweOl-0003D6-2p; Sun, 20 Nov 2022 02:05: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 1oweOi-0003Bd-3b for emacs-devel@gnu.org; Sun, 20 Nov 2022 02:05:48 -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 1oweOh-0003fU-KT; Sun, 20 Nov 2022 02:05:47 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=sh6V5wMFMtPqVD4p6ndroOWo5hx7MHTOTxvWZukg+wM=; b=GkIYF2jXxG0TIDIUdwT6 iE/STUfVj5k3JJVssBAhFpTYBbzh+TcqRo/B8/6PNchOTb5etQ6b5A5ezNKhREam967polYjH2Lq5 UInxttlLPknqOEgq4qf8rPP7I7hNn6xGqk6eqxl55gtbtwPE9lyS+VhKwE12oqaGH5YAqSmF6Jbgf z2HLTRZ4Cgrxbu8/LEs7J4TNpaQf/EnC5en62mPA2ym3FUmw+O2YAm0Kzo4FPNLSAUERdX3sdHuUt wKVNNSSouEpZQzel+TS2vZZ5MKe0rSUBdcXMkItpqfz1CLLmskLp4nbCMljyvm/Z8kxMUDq7/Vq/b gz+2bFhsrngxCg==; Original-Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oweOh-0004qq-35; Sun, 20 Nov 2022 02:05:47 -0500 In-Reply-To: <43E997E4-3449-4974-AB8C-BD5A4AA8A738@gmail.com> (message from Yuan Fu on Sat, 19 Nov 2022 13:49:50 -0800) 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:300229 Archived-At: > From: Yuan Fu > Date: Sat, 19 Nov 2022 13:49:50 -0800 > Cc: Eli Zaretskii , > emacs-devel@gnu.org, > monnier@iro.umontreal.ca, > theo@thornhill.no > > > > > On Nov 19, 2022, at 1:39 PM, Dmitry Gutov wrote: > > > > On 19.11.2022 12:26, Eli Zaretskii wrote: > >>> From: Yuan Fu > >>> Date: Sat, 19 Nov 2022 01:41:47 -0800 > >>> Cc: Stefan Monnier, > >>> Eli Zaretskii, > >>> Theodor Thornhill > >>> > >>> Anyway, does anyone think this is a good/bad idea? Should I go implement this on css, js, c, etc? It can also be the other way around: instead of having c-mode being the virtual mode, we can leave c-mode as-is, and have a c-base-mode inherited by c-mode and c-ts-mode. And similarly rss-base-mode, rss-mode, and rss-ts-mode. > >> I'd prefer leaving the original modes as-is. That should cause less > >> compatibility problems, I think. > > > > Eli, what's your solution for the problem, then? > > > > E.g. js-mode enables tree-sitter, and installs some stuff based on it. > > > > But js2-mode inherits from js-mode (meaning, it will run the same setup code, and then some of its own), yet it has its own parser. Which will cause all sorts of conflicts with tree-sitter. > > Actually, that’s evidence supporting his preference: js-mode will remain to be the native implementation, so inheriting from it is exactly as before. Js-ts-mode will install tree-sitter stuff. And js-base-mode wouldn’t do much. Why do we need js-base-mode? what will it do?