diff options
| author | Stéphane Marks <shipmints@gmail.com> | 2026-04-30 15:34:23 -0400 |
|---|---|---|
| committer | Yuan Fu <casouri@gmail.com> | 2026-05-07 21:35:46 -0700 |
| commit | 060451d6e0b3c91882c62ae1a574125c1f448487 (patch) | |
| tree | d326bd09d5733d93c1b56563dd4b5dc52c481c75 /java/org/gnu/emacs/EmacsDialogButtonLayout.java | |
| parent | 48b064a2aa3bb25137c31aac9994cd2d36fe71c2 (diff) | |
treesit-explore-mode usability improvements (bug#80935)
Improve the usability of treesit-explore-mode.
- Prompt for the primary parser first, if there is one, rather
than the first in the list reported by 'treesit-parser-list'.
Previously, in a multi-parser buffer like 'markdown-ts-mode', one
had to hunt for the primary parser.
- Kill the tree buffer and its window if the source buffer is
killed or 'treesit-explore-mode'. Previously, when
'treesit-explore-mode' is disabled in the source buffer, its
companion explorer tree buffer was left dangling and window
open (with an unrelated buffer).
- Improve 'treesit--explorer-refresh-1' to recenter the window
around the selected nodes when the selected region in the source
buffer changes. Previously, one had to navigate manually to find
the corresponding highlighted node in the tree window which may
be far away from that the source buffer's region represents.
- Disable 'treesit-explore-mode' in the source buffer if its
companion tree buffer is killed. Previously,
'treesit-explore-mode' remained active in the source buffer in
an effectively unusable state.
- Disable 'treesit-explore-mode' if the user quits
'completing-read' in 'treesit-explorer-switch-parser' when
enabling the mode. Previously, 'treesit-explore-mode' was left
enabled after quit.
- New command to switch back and forth between the source buffer
and tree buffer windows to make navigating more convenient.
Previously, in a multi-window frame, one had to navigate to/from
these two related windows in a more cumbersome way.
- New command to quit 'treesit-explore-mode' and
'treesit--explorer-tree-mode' and handle buffer and window
cleanup.
* lisp/treesit.el (treesit--explorer-refresh-1): Recenter the
window, if amenable, to the node selected in the source buffer.
(treesit--explorer-kill-explorer-buffer): Remove function.
(treesit--explorer-generate-parser-alist): Prioritize the
primary parser, if there is one.
(treesit--explorer-tree-mode-cleanup): New defun.
(treesit-explore-quit): New command.
(treesit-explorer-tree-window): New defun.
(treesit-explorer-source-buffer-window): New defun.
(treesit-explore-mode-map): Revise key bindings.
(treesit--explorer-tree-mode-map): Revise key bindings.
(treesit--explorer-tree-mode): New keymap.
(treesit-explorer-switch-parser): Add a default to
completing-read.
(treesit-explore-mode): Guard completing read quit. Wire up the
new cleanup functions.
Diffstat (limited to 'java/org/gnu/emacs/EmacsDialogButtonLayout.java')
0 files changed, 0 insertions, 0 deletions
