bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#48218: [PATCH] ibuffer.el: Use display-buffer properly


From: Miha Rihtaršič
Subject: bug#48218: [PATCH] ibuffer.el: Use display-buffer properly
Date: Tue, 4 May 2021 10:54:43 +0200

Minor simplification for C-o command in ibuffer.
C-o can pop up a new frame under some display-buffer configurations.
In this case, `pop-to-buffer' focuses the new frame, but `select-window'
usually fails to focus the original frame. This simple patch fixes that (if
your window manager doesn't automatically focus newly created frames).


---
* lisp/ibuffer.el (ibuffer-visit-buffer-other-window-noselect): Use
display-buffer instead of pop-to-buffer and selecting the old window.
---
 lisp/ibuffer.el | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/lisp/ibuffer.el b/lisp/ibuffer.el
index b484dd717c..c80222ed0f 100644
--- a/lisp/ibuffer.el
+++ b/lisp/ibuffer.el
@@ -988,9 +988,7 @@ ibuffer-visit-buffer-other-window
   (let ((buf (ibuffer-current-buffer t)))
     (bury-buffer (current-buffer))
     (if noselect
-       (let ((curwin (selected-window)))
-         (pop-to-buffer buf)
-         (select-window curwin))
+        (display-buffer buf)
       (switch-to-buffer-other-window buf))))
 
 (defun ibuffer-visit-buffer-other-window-noselect ()
-- 
2.31.1






reply via email to

[Prev in Thread] Current Thread [Next in Thread]