Subject: bug#75079: Window for treesit-explore

From: Juri Linkov <[email-masked]>
Date: Thu, 23 Jan 2025 09:40:44 +0200

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)))