From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Ihor Radchenko Newsgroups: gmane.emacs.devel Subject: Re: Update on tree-sitter structure navigation Date: Fri, 08 Sep 2023 12:03:58 +0000 Message-ID: <87zg1w98i9.fsf@localhost> References: <5E7F2A94-4377-45C0-8541-7F59F3B54BA1@gmail.com> <87h6odhxs6.fsf@localhost> <87msxzsee1.fsf@localhost> <83v8cn1mse.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="21324"; mail-complaints-to="usenet@ciao.gmane.io" Cc: casouri@gmail.com, emacs-devel@gnu.org, danny@dfreeman.email, theo@thornhill.no, jostein@secure.kjonigsen.net, dev@rjt.dev, wkirschbaum@gmail.com, pedz@easesoftware.com, dgutov@yandex.ru To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Sep 08 14:04:18 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 1qeaDi-0005JG-Cr for ged-emacs-devel@m.gmane-mx.org; Fri, 08 Sep 2023 14:04:18 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qeaCb-0004su-Pu; Fri, 08 Sep 2023 08:03:09 -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 1qeaCZ-0004sh-RK for emacs-devel@gnu.org; Fri, 08 Sep 2023 08:03:08 -0400 Original-Received: from mout02.posteo.de ([185.67.36.66]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qeaCW-0008NT-4H for emacs-devel@gnu.org; Fri, 08 Sep 2023 08:03:07 -0400 Original-Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 6412D240101 for ; Fri, 8 Sep 2023 14:03:01 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1694174581; bh=bXbQsfnZfiXbT/aEcW5MEZIdY/sud8u1BTgqJc18G/Y=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version: Content-Transfer-Encoding:From; b=DEiepNu5sXJ7h6RhWywaOK1KvkCUEtTB1t66o4OCsEfeJkZytvAp3Y5eHH8CYvEXm GIj1RIHIJOOcw48gvbZbVK5EFRAqrhXINwvwVcXp+El2Lht6PMjQsnkHGHVC7gLSGe NXldEAhtxqw5+UxeUhp7f02a4+HABcOGIU+1tW0jebM5SiI0UO3l8ykncJ5lqqLam5 Yx1L7Ww7Pxa2zZRR+NBhDCwaIpDOawMXZZPfYypDjncHFUg0yAN4AujPf2GLVQ+HjC 1OFhso14MuUxvAYJW1fpHA3nyX3eJszHAME1GdVDzR7NQOPXth0kGNrAG2RKzyYx/w Iy3hyqjQTGkbg== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4RhvrM4nWsz6tmv; Fri, 8 Sep 2023 14:02:59 +0200 (CEST) In-Reply-To: <83v8cn1mse.fsf@gnu.org> Received-SPF: pass client-ip=185.67.36.66; envelope-from=yantar92@posteo.net; helo=mout02.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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_MED=-2.3, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=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:310324 Archived-At: Eli Zaretskii writes: >> > Unifying tree-sitter and non-tree-sitter modes creates many problems. = I=E2=80=99m rather thinking about some way to share some configuration betw= een two modes. We=E2=80=99ve had many discussions before with no fruitful c= onclusion. >>=20 >> Any chance you have links to these discussions? > > Here's one: > > https://lists.gnu.org/archive/html/emacs-devel/2022-12/msg01251.html > https://lists.gnu.org/archive/html/emacs-devel/2022-12/msg01293.html Thanks! According to the discussion, the main problem is that interleaving ts-related and ts-unrelated code in the same mode is risky. It is safer to have a dedicated foo-ts-mode rather than modifying the existing foo-mode. However, separate *-ts- and *- modes create a problem when user config tailored for old, non-ts mode will no longer work. For example, c-ts-mode has `c-ts-mode-indent-offset', while cc-mode has c-basic-offset in `c-style-alist'. Ideally, user-facing API should be shared between the modes: defcustoms, faces, and certain high-level functions like `c-set-style'. One might slowly: 1. Add support of foo-mode's defcustoms to foo-ts-mode, when applicable 2. Create a shared API between foo-mode and foo-ts-mode that will call the appropriate implementation depending on which mode is active. --=20 Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at