From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Philip Kaludercic Newsgroups: gmane.emacs.devel Subject: Re: Suggesting that feature/tree-sitter be merged (was Re: Tree-sitter and major mode inheritance) Date: Sat, 19 Nov 2022 07:09:49 +0000 Message-ID: <87o7t35sjm.fsf@posteo.net> References: <0249C656-21C8-49F2-B979-A1894BF80637@gmail.com> <874juvhoyi.fsf@posteo.net> <72C5E060-76D5-45C7-80E8-C794468DAAB8@gmail.com> 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="35376"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Jostein =?utf-8?Q?Kj=C3=B8nigsen?= , emacs-devel , Theodor Thornhill , Eli Zaretskii , jostein@kjonigsen.net To: Yuan Fu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Nov 19 08:10:35 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 1owHzm-00090B-SO for ged-emacs-devel@m.gmane-mx.org; Sat, 19 Nov 2022 08:10:34 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1owHz9-0007NW-M2; Sat, 19 Nov 2022 02:09:55 -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 1owHz8-0007NM-OF for emacs-devel@gnu.org; Sat, 19 Nov 2022 02:09:54 -0500 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 1owHz6-0006wW-HX for emacs-devel@gnu.org; Sat, 19 Nov 2022 02:09:54 -0500 Original-Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 53A27240101 for ; Sat, 19 Nov 2022 08:09:50 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1668841790; bh=RRsWtOagUP07XY0GPrVirf4f/LLY6lV6HFD/n3EMCYE=; h=From:To:Cc:Subject:Date:From; b=ZxYtBQOFm9jvI+0cEJ2Tey+9OgCqytMZYnzNbX70W6qDo71ZW8LNjaJYdChEvYq3K qg6I4xhEa6EY8XxYfO33IEyRXb2DM09onuVue2sJGivsu86Q02VCznBz20ZMJY4Eh9 3gByc1qeLXG3v7yrQwgPlPbFL2BfU8Z9J7UqvfHfvdzRSJHVweTWmllh3My0WkQetS nhEpNTkSR8dd6u0mCV+c4CPPWcxYp9wrl8/rfnKI7wQkjs7MqZW9/3KKBYnMkrRck/ cX1LtMR8XH2zAHCswIqF7oL3l+kdS9gsEQP1k+lm76Paawvr68KA1MJCVGNmn4VMgF 0r28wStsb5+DQ== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4NDlCJ4M30z9rxF; Sat, 19 Nov 2022 08:09:48 +0100 (CET) In-Reply-To: <72C5E060-76D5-45C7-80E8-C794468DAAB8@gmail.com> (Yuan Fu's message of "Fri, 18 Nov 2022 14:58:17 -0800") Received-SPF: pass client-ip=185.67.36.66; envelope-from=philipk@posteo.net; helo=mout02.posteo.de X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable 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:300135 Archived-At: Yuan Fu writes: >> On Nov 18, 2022, at 2:34 PM, Philip Kaludercic wrot= e: >>=20 >> Jostein Kj=C3=B8nigsen writes: >>=20 >>> Instead of waiting for "every" major-mode to be re-implemented into a >>> tree-sitter derivative in the feature/tree-sitter branch before we >>> merge... How about we just accept the current "core" tree-sitter >>> implementation as good enough, and consider merging that to git master >>> as is. >>=20 >> I think this sounds like a good idea -- as someone who has mostly just >> been following the discussions. The core bindings and major modes that >> are based on these are separate issues, with a clear dependency linked >> them. >>=20 >> As an aside: This might also be a good opportunity to clean up some of >> the current major mode implementations and make them more consistent. >> The issue with custom options to enable tree-sitter for every major mode >> has revealed an inherent duplication of features. There are other >> inconsistencies, especially regarding bindings for equivalent operations >> (e.g. in interpreted language with a repl, how to load function into the >> current session: Lisp, Prolog, Python all differ in minor details). > > I=E2=80=99ve though of this too, other things are indent level, and > documentation. I wrote ghelp[1] to get a uniform interface for getting > documentation in different major modes (because I don=E2=80=99t have the = heart > to understand and modify help.el). A builtin, unified documentation > system would be nice, like eldoc. But eldoc is for at-point short and > quick signature/doc more than for full-fledged documentation like > help.el. I suppose you forgot the link: https://github.com/casouri/ghelp. Perhaps it could be added to ELPA, and one day to the core? >> I can imagine a more specialised `define-generic-mode' could be of use >> here, along with more "abstract" major modes for various types of >> programming languages (using `prog-mode' as a base to add >> `compiled-prog-mode' that has generic commands for building program, >> `interpreted-prog-mode' that has generic commands for REPL >> communication, ...), where the tree-sitter configuration would be one of >> the attributes these modes would specify. > > Sounds nice. Though what do you mean by =E2=80=9Cone of the attributes=E2= =80=9D? If we think of this as a declarative block, something like (define-prog-mode foo :type 'compiled :syntax (tree-sitter-syntax 'foo) :doc-func #'foo-get-docs ...) would have a list of attributes (what kind of a programming language, how to indent, how to fetch documentation, ...), one of which would be how syntax and fontification is calculated. >>> How about it? Are there any good arguments for NOT merging >>> feature/tree-sitter at this point? :) >>=20 >> The current branch has major modes, should these be deleted before >> merging? > > I think they can stay, we=E2=80=99ll work on them and improve them before= branch is cut. Ok, sounds good. > Yuan