From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Yuan Fu Newsgroups: gmane.emacs.devel Subject: Re: Tree-sitter integration on feature/tree-sitter Date: Mon, 20 Jun 2022 13:01:32 -0700 Message-ID: <4E08A965-8C79-4544-8A0F-2CC2BDEBF194@gmail.com> 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> <83bkunmuds.fsf@gnu.org> Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.100.31\)) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="8957"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Jun 20 22:05: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 1o3Nds-000268-2w for ged-emacs-devel@m.gmane-mx.org; Mon, 20 Jun 2022 22:05:00 +0200 Original-Received: from localhost ([::1]:44114 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o3Ndq-0000Tz-SY for ged-emacs-devel@m.gmane-mx.org; Mon, 20 Jun 2022 16:04:58 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:39998) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o3Nac-0007WX-5t for emacs-devel@gnu.org; Mon, 20 Jun 2022 16:01:38 -0400 Original-Received: from mail-pf1-x436.google.com ([2607:f8b0:4864:20::436]:43895) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o3Naa-0004nb-Hn; Mon, 20 Jun 2022 16:01:37 -0400 Original-Received: by mail-pf1-x436.google.com with SMTP id k127so5925035pfd.10; Mon, 20 Jun 2022 13:01:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=8XbBAgOHo/+XgarWkF49/klZrzXuyjDF/Q8CMM8sCrM=; b=Jpccx1NVNEQTb4r7pnuOIKs0wGrr1INa24td+sXq54GBGIvbup6isQrwUjn55KFgvr 0C9+im4IHEAEy0tFRJdO8yk0x/5LYnyZfAd/dYR2uH+HD+7kXDIUayuWZEnGYuC580Wx 3hg6COTy9igPUAh7A7BW/RHhpVNiOu987RCutp7hvvi5DECCni2b3X6hzMNR5ArXYxu3 HJOo+XdPwj9A1lqcg3xYxCOHIpvTQ190CJXW2TbbY/1eQz2uvQgjOLUpoBxvdXLSRWn5 qDCzadA49rYbC2uCESaXHVYS3Ddf9lLqqU9ZzwS5fe7WGlqBFXPwlPcNp/R/F3RUcvNt t8nA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=8XbBAgOHo/+XgarWkF49/klZrzXuyjDF/Q8CMM8sCrM=; b=bXbj+7v9HXdPYCXQgeC5GNpflI1qhOwl2Z7pMF5/4tG3UtIFVudTz5aILSmJdjYw8h /1LGL/T1Y7k3fIowziFizkN+fv28EzSU6mUOh6an7go6Hpxv7HsmoSwPq7Kz3X9TzX8B acgL5XtGQyTBWV6ELPYggtSgX4iUWz0HhN9zcopm3KL6eYEqHRKY/5DwwcAq6d2AHeT7 HlH0gjh7sioFnpIBspdQRCCUESJ854pdzKdzjbil0gxp1PoD5RZFrqOlhzddx+3pW/Co EhGbfoP5VYIEDms9b6ey4yaF1mGnIsYL68U73LODSglt9Kw487h8zqI+rVxmnRFTRv5N J2aQ== X-Gm-Message-State: AJIora/dV2ahundlBsfr/KBXmNsliQbq4ndVNe3FiU11PChILBR0XY8E pnd/fMYBSWB4nlwr/hlAtiei6++cXn0= X-Google-Smtp-Source: AGRyM1v0IQaUvpPz/WjHjPP1sbFjM1/5NWBWLOKLEI9YTtaU94mxebkNeBKAIEsDC5J9D0G+ib7dkA== X-Received: by 2002:a63:3fce:0:b0:40c:23a5:2827 with SMTP id m197-20020a633fce000000b0040c23a52827mr20319899pga.314.1655755294237; Mon, 20 Jun 2022 13:01:34 -0700 (PDT) Original-Received: from smtpclient.apple ([2600:1700:2ec7:8c90:148c:4bd5:3b97:915d]) by smtp.gmail.com with ESMTPSA id n5-20020a170902d2c500b00163d6164889sm9156350plc.236.2022.06.20.13.01.32 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 20 Jun 2022 13:01:33 -0700 (PDT) In-Reply-To: <83bkunmuds.fsf@gnu.org> X-Mailer: Apple Mail (2.3696.100.31) Received-SPF: pass client-ip=2607:f8b0:4864:20::436; envelope-from=casouri@gmail.com; helo=mail-pf1-x436.google.com 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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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" Xref: news.gmane.io gmane.emacs.devel:291472 Archived-At: > On Jun 20, 2022, at 4:44 AM, Eli Zaretskii wrote: >=20 >> From: Yuan Fu >> Date: Sun, 19 Jun 2022 20:00:49 -0700 >> Cc: emacs-devel@gnu.org >>=20 >>=20 >> 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? >=20 > The latter, please. >=20 > 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? >=20 > 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. >=20 > 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. Major mode should set beginning-of-defun-function to = treesit-beginning-of-defun, not unlike what they already do with major = mode-specific beginning-of-defun functions. This way major mode has the = freedom to decide which treesit features it wants to leverage. >=20 >> 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. >=20 > 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. The second sentence describes treesit-search-beginning, not = treesit-beginning-of-defun, I think you confused the two? Thanks, Yuan