Subject: bug#75141: closed (Re: bug#75141: [PATCH] Add button navigation to treesit-explorer)

From: [email-masked] (GNU bug Tracking System)
Date: Sat, 25 Jan 2025 00:07:02 +0000

Your bug report

#75141: [PATCH] Add button navigation to treesit-explorer

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
75141: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=75141
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#75141: [PATCH] Add button navigation to treesit-explorer
From: Stefan Kangas <[email-masked]>
To: Gabriel Santos <[email-masked]>
Cc: Eli Zaretskii <[email-masked]>, Yuan Fu <[email-masked]>, [email-masked]
Date: Fri, 24 Jan 2025 18:06:32 -0600
List-Id: <debbugs-submit.debbugs.gnu.org>

Gabriel Santos <[email-masked]> 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 <[email-masked]>
> 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

Subject: [PATCH] Add button navigation to treesit-explorer
From: Gabriel Santos <[email-masked]>
To: [email-masked]
Date: Fri, 27 Dec 2024 10:54:04 -0300
List-Id: <debbugs-submit.debbugs.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.

Regards,

--
Gabriel Santos

>From d78745581bdf7daf77602eb0bd06b6bdccc3c3c6 Mon Sep 17 00:00:00 2001
From: Gabriel Santos <[email-masked]>
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 multiple
keys for button navigation.
---
 lisp/treesit.el | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/lisp/treesit.el b/lisp/treesit.el
index eb3e26fff7e..9925f8ee014 100644
--- a/lisp/treesit.el
+++ b/lisp/treesit.el
@@ -3907,6 +3907,17 @@ 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
+  "f" #'forward-button
+  "b" #'backward-button
+  "TAB" #'forward-button
+  "<backtab>" #'backward-button)
+
 (defun treesit-explorer-switch-parser (parser)
   "Switch explorer to use PARSER."
   (interactive
-- 
2.47.0