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
  0 siblings, 1 reply; 2+ 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	[flat|nested] 2+ messages in thread

* bug#48218: [PATCH] ibuffer.el: Use display-buffer properly
  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
  0 siblings, 0 replies; 2+ messages in thread
From: martin rudalics @ 2021-05-04  9:16 UTC (permalink / raw)
  To: Miha Rihtaršič, 48218

 > This simple patch fixes that (if
 > your window manager doesn't automatically focus newly created frames

If it does we could apply one of these

(make-frame '((no-accept-focus . t)))

(make-frame '((no-focus-on-map . t)))

but I didn't have the time to look into this.  It would require
experimenting with a number of window managers and their default
settings and customizations.

 > ).

martin





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

end of thread, other threads:[~2021-05-04  9:16 UTC | newest]

Thread overview: 2+ 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

unofficial mirror of bug-gnu-emacs@gnu.org 

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://yhetil.org/emacs-bugs/0 emacs-bugs/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 emacs-bugs emacs-bugs/ https://yhetil.org/emacs-bugs \
		bug-gnu-emacs@gnu.org
	public-inbox-index emacs-bugs

Example config snippet for mirrors.
Newsgroups are available over NNTP:
	nntp://news.yhetil.org/yhetil.emacs.bugs
	nntp://news.gmane.io/gmane.emacs.bugs


code repositories for project(s) associated with this inbox:

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

AGPL code for this site: git clone http://ou63pmih66umazou.onion/public-inbox.git