GNU bug report logs - #75079
Default parser for treesit-explore

Previous Next

Package: emacs;

Reported by: Juri Linkov <juri <at> linkov.net>

Date: Wed, 25 Dec 2024 08:12:02 UTC

Severity: normal

Fixed in version 31.0.50

Done: Juri Linkov <juri <at> linkov.net>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Yuan Fu <casouri <at> gmail.com>
To: Juri Linkov <juri <at> linkov.net>
Cc: 75079 <at> debbugs.gnu.org
Subject: bug#75079: Window for treesit-explore
Date: Mon, 27 Jan 2025 17:48:05 -0800

> On Jan 22, 2025, at 11:40 PM, Juri Linkov <juri <at> linkov.net> wrote:
> 
> BTW, wouldn't it be nicer to display the treesit-explore window
> below the current buffer, this would keep the user's window layout:
> 
> diff --git a/lisp/treesit.el b/lisp/treesit.el
> index 8d86d142e3f..a22c335ae22 100644
> --- a/lisp/treesit.el
> +++ b/lisp/treesit.el
> @@ -4122,7 +4224,8 @@ treesit-explorer-switch-parser
>     (user-error "Not in `treesit-explore-mode'"))
>   (setq-local treesit--explorer-parser parser)
>   (display-buffer treesit--explorer-buffer
> -                  (cons nil '((inhibit-same-window . t))))
> +                  '(display-buffer-below-selected
> +                    (inhibit-same-window . t)))
>   (setq-local treesit--explorer-last-node nil)
>   (treesit--explorer-refresh))
> 
> @@ -4176,7 +4279,9 @@ treesit-explore
>   (interactive)
>   (if (and treesit-explore-mode
>            (buffer-live-p treesit--explorer-buffer))
> -      (display-buffer treesit--explorer-buffer '(nil (inhibit-same-window . t)))
> +      (display-buffer treesit--explorer-buffer
> +                      '(display-buffer-below-selected
> +                        (inhibit-same-window . t)))
>     (treesit-explore-mode)))

It’s hard to say what’s the ideal layout here. My personal preference is for the explorer window to show up in “the other window”. Since I usually have to side-by-side window, “the other window” will be on the left or right. And I’ll be sad if Emacs splits my window vertically to show a new window below.

IOW I think it’s best to use the “default” display behavior that user configured for and probably prefers.

Yuan



This bug report was last modified 177 days ago.

Previous Next


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