From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stephen Leake Newsgroups: gmane.emacs.devel Subject: Re: Plug treesit.el into other emacs constructs Date: Wed, 14 Dec 2022 15:32:15 -0800 Message-ID: <861qp1tvcw.fsf@stephe-leake.org> References: <87wn6whete.fsf@thornhill.no> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="22819"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Theodor Thornhill , emacs-devel@gnu.org, eliz@gnu.org, casouri@gmail.com To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Dec 15 00:32:56 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 1p5bF8-0005fD-SJ for ged-emacs-devel@m.gmane-mx.org; Thu, 15 Dec 2022 00:32:55 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p5bEs-0002EM-F4; Wed, 14 Dec 2022 18:32:38 -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 1p5bEq-0002ED-CP for emacs-devel@gnu.org; Wed, 14 Dec 2022 18:32:36 -0500 Original-Received: from gproxy3-pub.mail.unifiedlayer.com ([69.89.30.42]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p5bEo-0006oM-At for emacs-devel@gnu.org; Wed, 14 Dec 2022 18:32:36 -0500 Original-Received: from cmgw14.mail.unifiedlayer.com (unknown [10.0.90.129]) by progateway5.mail.pro1.eigbox.com (Postfix) with ESMTP id CB83B10045482 for ; Wed, 14 Dec 2022 23:32:16 +0000 (UTC) Original-Received: from host2007.hostmonster.com ([67.20.76.71]) by cmsmtp with ESMTP id 5bEWpkS8mXEB25bEWpt7qG; Wed, 14 Dec 2022 23:32:16 +0000 X-Authority-Reason: nr=8 X-Authority-Analysis: v=2.4 cv=Ab50o1bG c=1 sm=1 tr=0 ts=639a5d00 a=dWLzHQi6WpdymmZIwiVdBw==:117 a=Fln8i1WyhtedwaIJAdHvmw==:17 a=dLZJa+xiwSxG16/P+YVxDGlgEgI=:19 a=sHyYjHe8cH0A:10:nop_rcvd_month_year a=vvvmwbhNdt4A:10:endurance_base64_authed_username_1 a=iRZporoAAAAA:8 a=yn0sMIHZ07qKvOkwaZoA:9 a=NOBgFS-JBQ2l-kSd6-zu:22 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=stephe-leake.org; s=default; h=Content-Type:MIME-Version:Message-ID:Date: References:In-Reply-To:Subject:Cc:To:From:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=38eeQ+giYLyBPzjk687Ape6lJo8cg4VowPWT71Ses/I=; b=at9V1TABBlH7uwU6BJLAzeCC/V xYUPTBtbDSF5pmWYjyE5NpCQV6X2OrozH1zngcN6X3Vo7aLc4QLIAvNgqvUfAAjmGwH/lxRJKPxEV JNInkG169Dt2QBxB7Z54Q1rCPkJHsS4mwcAtbGuDAggkHGtx6uXaEvJZZs5IZNHEzXXiAJTHuNZIs 1DmgeQfwKsO9ZHWHCVJYMV+eKDhCEHhLla/oFlqw1lQnRnoc8B1KJoKz7BV+dwjfy5juPtF2uxI1p t7IsbXPJuW1uW5njj+HtZF2cSNdwXFcxM96jcWUz/oRF5jTw2nNuL4fkr66+qMPdFd8U5wg3wvqYM +OL0OxUw==; Original-Received: from 135-180-197-170.fiber.dynamic.sonic.net ([135.180.197.170]:54419 helo=DESKTOP-G20DCG1) by host2007.hostmonster.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1p5bEW-004Fsr-7s; Wed, 14 Dec 2022 16:32:16 -0700 In-Reply-To: (Stefan Monnier's message of "Mon, 12 Dec 2022 10:46:17 -0500") X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - host2007.hostmonster.com X-AntiAbuse: Original Domain - gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - stephe-leake.org X-BWhitelist: no X-Source-IP: 135.180.197.170 X-Source-L: No X-Exim-ID: 1p5bEW-004Fsr-7s X-Source-Sender: 135-180-197-170.fiber.dynamic.sonic.net (DESKTOP-G20DCG1) [135.180.197.170]:54419 X-Source-Auth: stephen_leake@stephe-leake.org X-Email-Count: 3 X-Source-Cap: c3RlcGhlbGU7c3RlcGhlbGU7aG9zdDIwMDcuaG9zdG1vbnN0ZXIuY29t X-Local-Domain: yes Received-SPF: pass client-ip=69.89.30.42; envelope-from=stephen_leake@stephe-leake.org; helo=gproxy3-pub.mail.unifiedlayer.com X-Spam_score_int: 16 X-Spam_score: 1.6 X-Spam_bar: + X-Spam_report: (1.6 / 5.0 requ) BAYES_00=-1.9, DKIM_INVALID=0.1, DKIM_SIGNED=0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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:301425 Archived-At: Stefan Monnier writes: > Cool, thanks, a few comments (based on my experience with adding > similar things based on `smie`): > >> ** Forward-sexp: >> Executing C-M-f repeatedly will go from: >> ``` >> public void foo(|String bar, String baz) {} >> ``` >> to >> ``` >> public void foo(String bar|, String baz) {} >> ``` > > That looks wrong. `String` is a valid AST node. Whether it gets a node > in tree-sitter or not, I don't know, but here there are several "sexps" > that start at point and I think `forward-sexp` should be conservative > and keep advancing by the smallest option. ada-mode has something similar; forward-sexp goes to the next labeled keyword. That's more useful than stopping at every little AST node. It relies on markup in the grammar to label the keywords; tree-sitter would need another markup similar to the current indent markup. -- -- Stephe