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

Previous Next

Package: emacs;

Reported by: Miha Rihtaršič <miha <at> kamnitnik.top>

Date: Tue, 4 May 2021 08:52:02 UTC

Severity: normal

Tags: fixed, patch

Fixed in version 28.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 48218 in the body.
You can then email your comments to 48218 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#48218; Package emacs. (Tue, 04 May 2021 08:52:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Miha Rihtaršič <miha <at> kamnitnik.top>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Tue, 04 May 2021 08:52:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Miha Rihtaršič <miha <at> kamnitnik.top>
To: bug-gnu-emacs <at> gnu.org
Cc: Miha Rihtaršič <miha <at> kamnitnik.top>
Subject: [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





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#48218; Package emacs. (Tue, 04 May 2021 09:17:02 GMT) Full text and rfc822 format available.

Message #8 received at 48218 <at> debbugs.gnu.org (full text, mbox):

From: martin rudalics <rudalics <at> gmx.at>
To: Miha Rihtaršič <miha <at> kamnitnik.top>,
 48218 <at> debbugs.gnu.org
Subject: Re: bug#48218: [PATCH] ibuffer.el: Use display-buffer properly
Date: Tue, 4 May 2021 11:16:13 +0200
> 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




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#48218; Package emacs. (Tue, 18 May 2021 15:11:02 GMT) Full text and rfc822 format available.

Message #11 received at 48218 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Miha Rihtaršič <miha <at> kamnitnik.top>
Cc: 48218 <at> debbugs.gnu.org
Subject: Re: bug#48218: [PATCH] ibuffer.el: Use display-buffer properly
Date: Tue, 18 May 2021 17:10:21 +0200
Miha Rihtaršič <miha <at> kamnitnik.top> writes:

> 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

Thanks; applied to Emacs 28.

> (if > your window manager doesn't automatically focus newly created
> frames).

Martin had a comment about this bit, but if I interpreted his comment
correctly, he didn't object to the patch.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Added tag(s) fixed. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Tue, 18 May 2021 15:11:02 GMT) Full text and rfc822 format available.

bug marked as fixed in version 28.1, send any further explanations to 48218 <at> debbugs.gnu.org and Miha Rihtaršič <miha <at> kamnitnik.top> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Tue, 18 May 2021 15:11:03 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#48218; Package emacs. (Tue, 18 May 2021 15:59:01 GMT) Full text and rfc822 format available.

Message #18 received at 48218 <at> debbugs.gnu.org (full text, mbox):

From: martin rudalics <rudalics <at> gmx.at>
To: Lars Ingebrigtsen <larsi <at> gnus.org>, Miha Rihtaršič
 <miha <at> kamnitnik.top>
Cc: 48218 <at> debbugs.gnu.org
Subject: Re: bug#48218: [PATCH] ibuffer.el: Use display-buffer properly
Date: Tue, 18 May 2021 17:58:48 +0200
> Martin had a comment about this bit, but if I interpreted his comment
> correctly, he didn't object to the patch.

Right.  The patch is good IMHO.

martin




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 16 Jun 2021 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 313 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.