]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/buff-menu.el: Force other-window commands to use other window.
authorJuri Linkov <juri@linkov.net>
Sat, 10 Feb 2024 17:56:39 +0000 (19:56 +0200)
committerEshel Yaron <me@eshelyaron.com>
Sun, 11 Feb 2024 16:32:56 +0000 (17:32 +0100)
(Buffer-menu-other-window, Buffer-menu-switch-other-window):
Let-bind 'display-buffer-overriding-action' to
'(nil (inhibit-same-window . t))' that will force the buffer
to be displayed in another window in any case (bug#68978).

(cherry picked from commit 3e5aba883770312536ca7a8f289bf679e55802f5)

lisp/buff-menu.el

index 10ea99eae9ae35bb321005d25f588f811b43b46d..e13c3b56b4e051a3aa1f3a3fd4d310a0b62a6b0a 100644 (file)
@@ -592,13 +592,17 @@ If UNMARK is non-nil, unmark them."
 (defun Buffer-menu-other-window ()
   "Select this line's buffer in other window, leaving buffer menu visible."
   (interactive nil Buffer-menu-mode)
-  (switch-to-buffer-other-window (Buffer-menu-buffer t)))
+  (let ((display-buffer-overriding-action
+         '(nil (inhibit-same-window . t))))
+    (switch-to-buffer-other-window (Buffer-menu-buffer t))))
 
 (defun Buffer-menu-switch-other-window ()
   "Make the other window select this line's buffer.
 The current window remains selected."
   (interactive nil Buffer-menu-mode)
-  (display-buffer (Buffer-menu-buffer t) t))
+  (let ((display-buffer-overriding-action
+         '(nil (inhibit-same-window . t))))
+    (display-buffer (Buffer-menu-buffer t) t)))
 
 (defun Buffer-menu-2-window ()
   "Select this line's buffer, with previous buffer in second window."