GNU bug report logs - #75141
[PATCH] Add button navigation to treesit-explorer

Previous Next

Package: emacs;

Reported by: Gabriel Santos <gabrielsantosdesouza <at> disroot.org>

Date: Fri, 27 Dec 2024 13:55:02 UTC

Severity: wishlist

Tags: patch

Done: Stefan Kangas <stefankangas <at> gmail.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 75141 in the body.
You can then email your comments to 75141 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#75141; Package emacs. (Fri, 27 Dec 2024 13:55:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Gabriel Santos <gabrielsantosdesouza <at> disroot.org>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Fri, 27 Dec 2024 13:55:03 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Gabriel Santos <gabrielsantosdesouza <at> disroot.org>
To: bug-gnu-emacs <at> gnu.org
Subject: [PATCH] Add button navigation to treesit-explorer
Date: Fri, 27 Dec 2024 10:54:04 -0300
[Message part 1 (text/plain, inline)]
Greetings,

Currently, the only way to navigate through treesit-explorer is by the
use of C-n and C-p. Since this buffer is full of buttons, I decided to
add button navigation to it.

This patch adds button navigation to treesit-explorer, for the following
keys:

* forward-button
- f
- n
- TAB

* backward-button
- b
- p
- <backtab>

* Points of discussion

Maybe that's too many keys? The only ones I think that don't really fit
that much are "f" and "b", because they can also go down, but there's no
harm in having extra keys.

Regards,

--
Gabriel Santos

[0001-Add-button-navigation-to-treesit-explorer.patch (text/x-patch, attachment)]

Severity set to 'wishlist' from 'normal' Request was from Stefan Kangas <stefankangas <at> gmail.com> to control <at> debbugs.gnu.org. (Thu, 02 Jan 2025 01:25:01 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#75141; Package emacs. (Sat, 04 Jan 2025 11:59:02 GMT) Full text and rfc822 format available.

Message #10 received at 75141 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Gabriel Santos <gabrielsantosdesouza <at> disroot.org>,
 Yuan Fu <casouri <at> gmail.com>
Cc: 75141 <at> debbugs.gnu.org
Subject: Re: bug#75141: [PATCH] Add button navigation to treesit-explorer
Date: Sat, 04 Jan 2025 13:57:51 +0200
> Date: Fri, 27 Dec 2024 10:54:04 -0300
> From:  Gabriel Santos via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <bug-gnu-emacs <at> gnu.org>
> 
> Greetings,
> 
> Currently, the only way to navigate through treesit-explorer is by the
> use of C-n and C-p. Since this buffer is full of buttons, I decided to
> add button navigation to it.
> 
> This patch adds button navigation to treesit-explorer, for the following
> keys:
> 
> * forward-button
> - f
> - n
> - TAB
> 
> * backward-button
> - b
> - p
> - <backtab>
> 
> * Points of discussion
> 
> Maybe that's too many keys? The only ones I think that don't really fit
> that much are "f" and "b", because they can also go down, but there's no
> harm in having extra keys.

Thanks.

Yuan, any comments?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#75141; Package emacs. (Sat, 04 Jan 2025 20:03:02 GMT) Full text and rfc822 format available.

Message #13 received at 75141 <at> debbugs.gnu.org (full text, mbox):

From: Yuan Fu <casouri <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 75141 <at> debbugs.gnu.org, Gabriel Santos <gabrielsantosdesouza <at> disroot.org>
Subject: Re: bug#75141: [PATCH] Add button navigation to treesit-explorer
Date: Sat, 4 Jan 2025 12:02:46 -0800

> On Jan 4, 2025, at 3:57 AM, Eli Zaretskii <eliz <at> gnu.org> wrote:
> 
>> Date: Fri, 27 Dec 2024 10:54:04 -0300
>> From:  Gabriel Santos via "Bug reports for GNU Emacs,
>> the Swiss army knife of text editors" <bug-gnu-emacs <at> gnu.org>
>> 
>> Greetings,
>> 
>> Currently, the only way to navigate through treesit-explorer is by the
>> use of C-n and C-p. Since this buffer is full of buttons, I decided to
>> add button navigation to it.
>> 
>> This patch adds button navigation to treesit-explorer, for the following
>> keys:
>> 
>> * forward-button
>> - f
>> - n
>> - TAB
>> 
>> * backward-button
>> - b
>> - p
>> - <backtab>
>> 
>> * Points of discussion
>> 
>> Maybe that's too many keys? The only ones I think that don't really fit
>> that much are "f" and "b", because they can also go down, but there's no
>> harm in having extra keys.
> 
> Thanks.
> 
> Yuan, any comments?

Sounds good! Though would using both f/b and n/p for the same thing a bit wasteful? Maybe we can start with n/p TAB/<backtab>?

Yuan



Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#75141; Package emacs. (Sat, 04 Jan 2025 20:27:02 GMT) Full text and rfc822 format available.

Message #16 received at 75141 <at> debbugs.gnu.org (full text, mbox):

From: Gabriel Santos <gabrielsantosdesouza <at> disroot.org>
To: Yuan Fu <casouri <at> gmail.com>, Eli Zaretskii <eliz <at> gnu.org>
Cc: 75141 <at> debbugs.gnu.org
Subject: Re: bug#75141: [PATCH] Add button navigation to treesit-explorer
Date: Sat, 04 Jan 2025 17:25:54 -0300
>Sounds good! Though would using both f/b and n/p for the same thing a bit wasteful? Maybe we can start with n/p TAB/<backtab>?

Yes, that seems to be best, I'll update the patch now.

--
Gabriel Santos




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#75141; Package emacs. (Sat, 04 Jan 2025 21:18:02 GMT) Full text and rfc822 format available.

Message #19 received at 75141 <at> debbugs.gnu.org (full text, mbox):

From: Gabriel Santos <gabrielsantosdesouza <at> disroot.org>
To: 75141 <at> debbugs.gnu.org
Cc: Eli Zaretskii <eliz <at> gnu.org>, Yuan Fu <casouri <at> gmail.com>
Subject: Re: bug#75141: [PATCH] Add button navigation to treesit-explorer
Date: Sat, 04 Jan 2025 18:17:10 -0300
[Message part 1 (text/plain, inline)]
Here is the updated patch, with "f" and "b" removed.

--
Gabriel Santos

[0001-Add-button-navigation-to-treesit-explorer.patch (text/x-patch, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#75141; Package emacs. (Wed, 08 Jan 2025 14:33:02 GMT) Full text and rfc822 format available.

Message #22 received at 75141 <at> debbugs.gnu.org (full text, mbox):

From: Gabriel Santos <gabrielsantosdesouza <at> disroot.org>
To: Yuan Fu <casouri <at> gmail.com>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 75141 <at> debbugs.gnu.org
Subject: Re: bug#75141: [PATCH] Add button navigation to treesit-explorer
Date: Wed, 08 Jan 2025 11:31:52 -0300
>Thanks! Have signed the copyright assignment? If you have, I’ll apply it to master.

Yes, I've signed the copyright assignment. You can apply the patch. Happy to be contributing!

--
Gabriel Santos




Reply sent to Stefan Kangas <stefankangas <at> gmail.com>:
You have taken responsibility. (Sat, 25 Jan 2025 00:07:02 GMT) Full text and rfc822 format available.

Notification sent to Gabriel Santos <gabrielsantosdesouza <at> disroot.org>:
bug acknowledged by developer. (Sat, 25 Jan 2025 00:07:02 GMT) Full text and rfc822 format available.

Message #27 received at 75141-done <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefankangas <at> gmail.com>
To: Gabriel Santos <gabrielsantosdesouza <at> disroot.org>
Cc: Eli Zaretskii <eliz <at> gnu.org>, Yuan Fu <casouri <at> gmail.com>,
 75141-done <at> debbugs.gnu.org
Subject: Re: bug#75141: [PATCH] Add button navigation to treesit-explorer
Date: Fri, 24 Jan 2025 18:06:32 -0600
Gabriel Santos <gabrielsantosdesouza <at> disroot.org> writes:

> Here is the updated patch, with "f" and "b" removed.

Thanks!  It seems like Yuan already installed it, but never closed the
bug.  So I'm doing that now.

>
> --
> Gabriel Santos
>
>>From 1224d220985edd9de0731b26c0be96eb9f6b35a1 Mon Sep 17 00:00:00 2001
> From: Gabriel Santos <gabrielsantosdesouza <at> disroot.org>
> Date: Fri, 27 Dec 2024 10:43:20 -0300
> Subject: [PATCH] Add button navigation to treesit-explorer
>
> * lisp/treesit.el (treesit--explorer-tree-mode-map):
> Define it as a child of special-mode-map,
> adding keys for button navigation.
> ---
>  lisp/treesit.el | 10 ++++++++++
>  1 file changed, 10 insertions(+)
>
> diff --git a/lisp/treesit.el b/lisp/treesit.el
> index e643eb48654..ef27a370bc2 100644
> --- a/lisp/treesit.el
> +++ b/lisp/treesit.el
> @@ -4041,6 +4041,16 @@ covers point.  PARSER-NAME are unique."
>    "Mode for displaying syntax trees for `treesit-explore-mode'."
>    nil)
>
> +(defvar-keymap treesit--explorer-tree-mode-map
> +  :doc "Keymap for the treesit tree explorer.
> +
> +Navigates from button to button."
> +  :parent special-mode-map
> +  "n" #'forward-button
> +  "p" #'backward-button
> +  "TAB" #'forward-button
> +  "<backtab>" #'backward-button)
> +
>  (defun treesit-explorer-switch-parser (parser)
>    "Switch explorer to use PARSER."
>    (interactive




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 22 Feb 2025 12:24:25 GMT) Full text and rfc822 format available.

This bug report was last modified 174 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.