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 integration on feature/tree-sitter Date: Mon, 20 Jun 2022 14:44:47 +0300 Message-ID: <83bkunmuds.fsf@gnu.org> References: <2c2746e5f2558a87e8eab6f0914264a020173a9d.camel@pm.me> <27630AA3-8026-4E24-8852-ACCD9325B99D@gmail.com> <0E9E702B-B07C-4794-8498-29B9320E14CC@gmail.com> <83letvq0ii.fsf@gnu.org> <6EA831D3-A9C9-4346-B1E8-7748BAB285E2@gmail.com> <83czf7pocp.fsf@gnu.org> <83tu8io5i5.fsf@gnu.org> <83edzmnymo.fsf@gnu.org> <211D7584-1B0C-4A37-8ADF-08E1942BA719@gmail.com> <83zgi9mcu4.fsf@gnu.org> <70DEA4FC-2F93-4890-9F13-6C00D7278065@gmail.com> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="16288"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Yuan Fu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Jun 20 13:47:00 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 1o3Frw-00045g-1j for ged-emacs-devel@m.gmane-mx.org; Mon, 20 Jun 2022 13:47:00 +0200 Original-Received: from localhost ([::1]:60324 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o3Fru-0005tx-RR for ged-emacs-devel@m.gmane-mx.org; Mon, 20 Jun 2022 07:46:58 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:45194) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o3Fq3-0004xe-SC for emacs-devel@gnu.org; Mon, 20 Jun 2022 07:45:04 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:46470) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o3Fq3-0008So-Gy; Mon, 20 Jun 2022 07:45:03 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=jowfQBCM+E3pER/UapR8qZELNUJTttSXUxtaG8Hj2KI=; b=T3sdiRi0Ks66 r8j0bX38UgxJo4nyLIfADH4rXN09kB3zlV60ohDZ3qY/fpHDukC9paqIJs0YfU1qy7PXBe/Hglkck ecVntYppmJuAVBwfCCSqhygbt82aLOiJKAkW2y1j9ir8Kjp03ZefkvF8LXojuPRX30uRJxAKYuc68 ih2zk+JaQhRV9i9daHRv61apbVwNf52Cb1QrlxQt5ruwcoxlS8OLuNI72Ixyou/LGpIB+S2H0VFyG zY9NP+/QRqq0XqhV0M7ax+f1CT/nlmQC57v+damkQR/0+16I7+JKZAMCjKG65o1oAAKIFu69k9NA/ C0khP2qMIb1phsU5nslWIQ==; Original-Received: from [87.69.77.57] (port=1345 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 1o3Fq2-0005Hz-8G; Mon, 20 Jun 2022 07:45:03 -0400 In-Reply-To: <70DEA4FC-2F93-4890-9F13-6C00D7278065@gmail.com> (message from Yuan Fu on Sun, 19 Jun 2022 20:00:49 -0700) 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" Xref: news.gmane.io gmane.emacs.devel:291460 Archived-At: > From: Yuan Fu > Date: Sun, 19 Jun 2022 20:00:49 -0700 > Cc: emacs-devel@gnu.org > > > I added navigation functions like treesit-beginning/end-of-defun, and added search functions like treesit-search-beginning/end. Now I wonder where should I put them in the manual, do I put them under the treesit section (Parsing Program Source), or under the relevant existing sections in the manual? The latter, please. But why do we need a separate description for the tree-sitter variants? Shouldn't that be automatically supported by beginning/end-of-defun, once some switch is thrown to enable tree-sitter? And if beginning/end-of-defun is for some reason too low-level/basic for this role (but if you think so, please explain why), then I think we need higher-level functions that by default are just thin wrappers around beginning/end-of-defun, and will call tree-sitter versions when Emacs is configured to do so. I mean, it would be very cumbersome to request that each and every major mode which wants to use tree-sitter will have to explicitly call treesit-SOMETHING everywhere. > Treesit-beginning/end-of-defun jumps to the beginning/end of the current defun form, treesit-search-beginning searches for a query and stops at the beginning/end of the node that matched the query. So you are saying treesit-beginning/end-of-defun don't actually look for beginning and end of a function, but for beginning and end of a more abstract entity? Then perhaps it would be wrong to have "defun" in their names? And in that case, maybe a separate section (under "Motion") is better after all, since this is no longer "List Motion", strictly speaking. Thanks.