From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?UTF-8?Q?Jo=C3=A3o_Paulo_Labegalini_de_Carvalho?= Newsgroups: gmane.emacs.devel Subject: Re: New defun navigation for tree-sitter (Was: Code navigation for sh-mode with Tree-sitter) Date: Fri, 16 Dec 2022 09:24:45 -0700 Message-ID: References: <1B9F9B3A-A757-4A65-9653-CD0112EB8895@gmail.com> <5BB6E79A-B1FA-40F4-B48A-DADF63A30DDC@gmail.com> <0B190C0C-24BE-490C-9C7D-1439B77EE9D5@gmail.com> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="00000000000004d60b05eff46996" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="25994"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Stefan Monnier , Alan Mackenzie , emacs-devel@gnu.org To: Yuan Fu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Dec 16 17:26:07 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 1p6DXD-0006VU-Ns for ged-emacs-devel@m.gmane-mx.org; Fri, 16 Dec 2022 17:26:07 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p6DWJ-0003WJ-1m; Fri, 16 Dec 2022 11:25:11 -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 1p6DW8-0003Op-6P for emacs-devel@gnu.org; Fri, 16 Dec 2022 11:25:03 -0500 Original-Received: from mail-ej1-x634.google.com ([2a00:1450:4864:20::634]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p6DW6-0000J5-GN for emacs-devel@gnu.org; Fri, 16 Dec 2022 11:24:59 -0500 Original-Received: by mail-ej1-x634.google.com with SMTP id x22so7289224ejs.11 for ; Fri, 16 Dec 2022 08:24:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=od1KOpkoizut5byCmH/S5NylSCLQurXy7cV6acBakwg=; b=p7s4QXjJmM0nXya/jR3Bi9Au8SOGixKk3ABZI8FmnR6h0BzoeHLLxDoFD1XXs7tUgN q8oVVTyqorGioybMb1RTxFdm4zpc8AOt7BR0gejJ+XUFOM2uJnlqzT6pqjWm036mEQob YZR+46Vl5jnLP410Eo4mMv+BcchozVLm540GrepkMT47Uo06oIAlkEfO92oMULnZ1mWf IqTSBr89mxhQM9wzL8THesLeH15GKp3JuOdPt6gnHSc9R5neHRpp9nrQmf+4ws7XUfOz QDYSKclFdZyrpJ7zDh7OD7/jeFJeo6fo8nWS5OHM7asmX/8+t0uA21hOhy4Bz+5nSW1P GvRw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=od1KOpkoizut5byCmH/S5NylSCLQurXy7cV6acBakwg=; b=tL5vuVPwRf7d+0dvTpFrpiP4y1Yk7I+qcjilh6FQz0t6mVnLd7hSu2Jc/0Jcfnk5Il eZV+AWF4IgFrST6O9Js++VPruvOGqb2B0W3wujPbQeFloKhDtCNNKvoPVrMeLrBblewo oXUrNasDeB4x6hHYU9VgFM7K+jQBF59XMrQgKqNsb4BG+2Xl4tNcolHtda1jq+R6vZPn IMkZ+BkFWqaqLvQLHmAyCHnE7+2P1LR2v8Pvb+sNfgyhT4jrHZFLwl05kKk3XSojtUSL YUlOQ6BBNI9QgbG/NYldmB79OpZ97Dl4eStM1Ri8p8cdZrVp+Q+GeL9erYg6elSuIiYb nQ7g== X-Gm-Message-State: ANoB5pmcKXrdrvRs+tNvtqk8IFuPi+k8EiMkaOdIy5llzDXGdhKAC6Fd s5noqyTF3T+V99DJ952nH07kkSIYxNmT8r/7UpI= X-Google-Smtp-Source: AA0mqf4Ib41KxAv/e4yOxKXitwGqipT8H0mW8ZtNXTyrMUDm6oPwSh8GjBlEXz7uM1Vw9d+CpP8EukVqH8MGjyErDCw= X-Received: by 2002:a17:906:5784:b0:7c0:e987:cd6d with SMTP id k4-20020a170906578400b007c0e987cd6dmr18252685ejq.429.1671207896535; Fri, 16 Dec 2022 08:24:56 -0800 (PST) In-Reply-To: Received-SPF: pass client-ip=2a00:1450:4864:20::634; envelope-from=jaopaulolc@gmail.com; helo=mail-ej1-x634.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, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, 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:301502 Archived-At: --00000000000004d60b05eff46996 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Thanks Yuan, I pulled your changes and navigation now works out of the box. On Thu, Dec 15, 2022 at 6:49 PM Yuan Fu wrote: > > > > On Dec 13, 2022, at 11:46 AM, Jo=C3=A3o Paulo Labegalini de Carvalho < > jaopaulolc@gmail.com> wrote: > > > > > > > > On Tue, Dec 13, 2022 at 11:56 AM Yuan Fu wrote: > > I will repurpose two functions, treesit-beginning-of-defun/end, and mak= e > treesit-major-mode-setup set them up automatically. I=E2=80=99m thinking = about > remapping beginning/end-of-defun to their tree-sitter counterparts in > (current-local-map), in treesit-major-mode-setup. That way major modes > don=E2=80=99t need to explicitly bind tree-sitter functions in their keym= aps. > > > > That would be great. A very clean solution IMO. > > No one seem to object, so I made the change on emacs-29. Now tree-sitter > major modes should all use the new navigation commands. > > Yuan --=20 Jo=C3=A3o Paulo L. de Carvalho Ph.D Computer Science | IC-UNICAMP | Campinas , SP - Brazil Postdoctoral Research Fellow | University of Alberta | Edmonton, AB - Canad= a joao.carvalho@ic.unicamp.br joao.carvalho@ualberta.ca --00000000000004d60b05eff46996 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Thanks Yuan,

I pulled your changes and navigation n= ow works out of the box.

On Thu, Dec 15, 2022 at 6:49 PM Yuan Fu <casouri@gmail.com> wrote:


> On Dec 13, 2022, at 11:46 AM, Jo=C3=A3o Paulo Labegalini de Carvalho &= lt;jaopaulolc@gma= il.com> wrote:
>
>
>
> On Tue, Dec 13, 2022 at 11:56 AM Yuan Fu <casouri@gmail.com> wrote:
> I will repurpose two functions, treesit-beginning-of-defun/end, and ma= ke treesit-major-mode-setup set them up automatically. I=E2=80=99m thinking= about remapping beginning/end-of-defun to their tree-sitter counterparts i= n (current-local-map), in treesit-major-mode-setup. That way major modes do= n=E2=80=99t need to explicitly bind tree-sitter functions in their keymaps.=
>
> That would be great. A very clean solution IMO.

No one seem to object, so I made the change on emacs-29. Now tree-sitter ma= jor modes should all use the new navigation commands.

Yuan


--
Jo=C3=A3o Paulo L. de Carvalho
Ph.D Computer Science | =C2=A0IC-UNICAM= P | Campinas , SP - Brazil
Postdoctoral Research Fellow | University of = Alberta | Edmonton, AB - Canada
--00000000000004d60b05eff46996--