unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#48218: [PATCH] ibuffer.el: Use display-buffer properly
@ 2021-05-04  8:54 Miha Rihtaršič via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2021-05-04  9:16 ` martin rudalics
  2021-05-18 15:10 ` Lars Ingebrigtsen
  0 siblings, 2 replies; 4+ messages in thread
From: Miha Rihtaršič via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2021-05-04  8:54 UTC (permalink / raw)
  To: 48218; +Cc: Miha Rihtaršič

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






^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-05-18 15:58 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-04  8:54 bug#48218: [PATCH] ibuffer.el: Use display-buffer properly Miha Rihtaršič via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-05-04  9:16 ` martin rudalics
2021-05-18 15:10 ` Lars Ingebrigtsen
2021-05-18 15:58   ` martin rudalics

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).