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: Extending define-derived-mode Date: Thu, 01 Jun 2023 09:39:39 +0300 Message-ID: <835y87elec.fsf@gnu.org> References: <20F07C52-6B39-4B24-8433-82E2226EADA6@gmail.com> <83zg5mf62s.fsf@gnu.org> 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="12944"; mail-complaints-to="usenet@ciao.gmane.io" Cc: casouri@gmail.com, emacs-devel@gnu.org, mickey@masteringemacs.org, theo@thornhill.no, dgutov@yandex.ru To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Jun 01 08:39:12 2023 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 1q4bxo-0003DA-8F for ged-emacs-devel@m.gmane-mx.org; Thu, 01 Jun 2023 08:39:12 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q4bxY-0002wy-Ki; Thu, 01 Jun 2023 02:38:56 -0400 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 1q4bxX-0002u5-EL for emacs-devel@gnu.org; Thu, 01 Jun 2023 02:38:55 -0400 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 1q4bxW-0004kN-OZ; Thu, 01 Jun 2023 02:38:54 -0400 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=plwu/cq8tC0E+qA1iGFhSFB85tKHYSpfW8XtlbeLtvg=; b=aMGn9UmdXiPou/vvZDEC LlXk9Sk6qd0blEPiYTVe3f26IYQBwsepbM86/eWoIWv3cOLBRttizcctIUM4mRecSWqlQdkaIK0GA ShhdCPKor1ksy9MRdc+7lrWSFZGmj6tjR2B/y8u2tl1jrYO7vEnp/8nz/UBxVxhBmDdcH5xCtVzF9 myVRpl5egj621GPeStoP2h4AIF4kmS1B36lEmYGCAOrdl1O+oCIl1T0CtBXfK0Jd4s5VHeb1jm8Or zW4lWZvh/1J151hk0ENOUEtjYXUmWUKljogZR1qQ5kjj7oL5XwwiNK5bOqK2QrnFEmepsCglYZ/MY ogto+1Jb8F5QPA==; 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 1q4bxW-0002Vu-8D; Thu, 01 Jun 2023 02:38:54 -0400 In-Reply-To: (message from Stefan Monnier on Thu, 01 Jun 2023 00:06:54 -0400) 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:306481 Archived-At: > From: Stefan Monnier > Cc: Eli Zaretskii , emacs-devel@gnu.org, > mickey@masteringemacs.org, theo@thornhill.no, dgutov@yandex.ru > Date: Thu, 01 Jun 2023 00:06:54 -0400 > > > Keep in mind that when people try out tree-sitter modes, they are unlikely > > to just throw away their config for the old mode; also since tree-sitter and > > grammars aren’t the easiest to install, people working on multiple machines > > probably want both tree-sitter and no-tree-sitter modes configured and ready > > to go. So I think we’ll see a lot of people having config for both modes (me > > included). > > Good point. It's a good point, indeed, but with some mode pairs is very hard (read: impossible) to achieve. A notable example is c-mode and c-ts-mode: the former has a lot of mode-specific commands and features that cannot be used with the latter, because there's no equivalent infrastructure that supports the same interfaces, and sometimes because the feature makes no sense in a TS-based mode. We try very hard to use the same key bindings and variable names where it does make sense, but the group of features where that is possible is very small. For example, all the enormous set of features we have in CC mode around indentation and its customization cannot be "ported" to c-ts-mode and c++-ts-mode, because the latter is built on completely different analysis of the text. Another example is the ad-hoc support for some frequently-use macro names that CC mode has.