GNU bug report logs -
#24086
25.1.50; ibuffer-do-view-1 fails to visit in new frame
Previous Next
Reported by: Tino Calancha <tino.calancha <at> gmail.com>
Date: Wed, 27 Jul 2016 11:34:02 UTC
Severity: normal
Found in version 25.1.50
Done: Tino Calancha <tino.calancha <at> gmail.com>
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 24086 in the body.
You can then email your comments to 24086 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#24086
; Package
emacs
.
(Wed, 27 Jul 2016 11:34:02 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Tino Calancha <tino.calancha <at> gmail.com>
:
New bug report received and forwarded. Copy sent to
bug-gnu-emacs <at> gnu.org
.
(Wed, 27 Jul 2016 11:34:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
When the argument TYPE is 'other-frame, it should visit
the buffer in a new frame.
emacs -Q --eval="(progn (require 'ibuffer) (setq ibuffer-expert t) (ibuffer))"
H
M-: (length (frame-list)) RET
=> 1
In GNU Emacs 25.1.50.3 (x86_64-pc-linux-gnu, GTK+ Version 3.20.6)
of 2016-07-27 built on calancha-pc
Repository revision: e0d425976e3a83585db9a586687897fe1ac6455f
Windowing system distributor 'The X.Org Foundation', version 11.0.11804000
System Description: Debian GNU/Linux testing (stretch)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
From eb3bc5f0c65788677eb0150533a33dcc14e30d95 Mon Sep 17 00:00:00 2001
From: Tino Calancha <tino.calancha <at> gmail.com>
Date: Wed, 27 Jul 2016 20:23:56 +0900
Subject: [PATCH] Ibuffer: View buffer in other frame
* lisp/ibuffer.el (ibuffer-do-view-1):
Use another frame when TYPE equals 'other-frame (Bug#24086).
---
lisp/ibuffer.el | 21 +++++++++++++--------
1 file changed, 13 insertions(+), 8 deletions(-)
diff --git a/lisp/ibuffer.el b/lisp/ibuffer.el
index 8e24629..2816aee 100644
--- a/lisp/ibuffer.el
+++ b/lisp/ibuffer.el
@@ -1143,17 +1143,22 @@ ibuffer-do-view-horizontally
(ibuffer-do-view-1 (if other-frame 'other-frame 'horizontally)))
(defun ibuffer-do-view-1 (type)
- (let ((marked-bufs (ibuffer-get-marked-buffers)))
+ (let ((marked-bufs (ibuffer-get-marked-buffers))
+ (confirm t))
(when (null marked-bufs)
(setq marked-bufs (list (ibuffer-current-buffer t))))
- (unless (and (eq type 'other-frame)
+ (when (and (eq type 'other-frame)
(not ibuffer-expert)
- (> (length marked-bufs) 3)
- (not (y-or-n-p (format "Really create a new frame for %s
buffers? "
- (length marked-bufs)))))
- (set-buffer-modified-p nil)
- (delete-other-windows)
- (switch-to-buffer (pop marked-bufs))
+ (> (length marked-bufs) 3))
+ (setq confirm
+ (y-or-n-p (format "Really create a new frame for %s buffers?
"
+ (length marked-bufs)))))
+
+ (when confirm
+ (unless (eq type 'other-frame)
+ (set-buffer-modified-p nil)
+ (delete-other-windows)
+ (switch-to-buffer (pop marked-bufs)))
(let ((height (/ (1- (if (eq type 'horizontally) (frame-width)
(frame-height)))
(1+ (length marked-bufs)))))
--
2.8.1
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#24086
; Package
emacs
.
(Wed, 27 Jul 2016 17:07:02 GMT)
Full text and
rfc822 format available.
Message #8 received at 24086 <at> debbugs.gnu.org (full text, mbox):
> From: Tino Calancha <tino.calancha <at> gmail.com>
> Date: Wed, 27 Jul 2016 20:32:40 +0900 (JST)
>
> When the argument TYPE is 'other-frame, it should visit
> the buffer in a new frame.
Not unconditionally, though. There are clearly some conditions in the
code under which the above should not happen.
> emacs -Q --eval="(progn (require 'ibuffer) (setq ibuffer-expert t) (ibuffer))"
Invoking this command, I get an error:
Wrong type argument: window-live-p, nil
> (defun ibuffer-do-view-1 (type)
> - (let ((marked-bufs (ibuffer-get-marked-buffers)))
> + (let ((marked-bufs (ibuffer-get-marked-buffers))
> + (confirm t))
> (when (null marked-bufs)
> (setq marked-bufs (list (ibuffer-current-buffer t))))
> - (unless (and (eq type 'other-frame)
> + (when (and (eq type 'other-frame)
> (not ibuffer-expert)
> - (> (length marked-bufs) 3)
> - (not (y-or-n-p (format "Really create a new frame for %s
> buffers? "
> - (length marked-bufs)))))
> - (set-buffer-modified-p nil)
> - (delete-other-windows)
> - (switch-to-buffer (pop marked-bufs))
> + (> (length marked-bufs) 3))
> + (setq confirm
> + (y-or-n-p (format "Really create a new frame for %s buffers?
> "
> + (length marked-bufs)))))
> +
> + (when confirm
> + (unless (eq type 'other-frame)
> + (set-buffer-modified-p nil)
> + (delete-other-windows)
> + (switch-to-buffer (pop marked-bufs)))
> (let ((height (/ (1- (if (eq type 'horizontally) (frame-width)
> (frame-height)))
> (1+ (length marked-bufs)))))
Does the change have to be this complicated? AFAICT, the error is
just in the wrong logic of combining the conditions. Right?
Thanks.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#24086
; Package
emacs
.
(Thu, 28 Jul 2016 13:53:02 GMT)
Full text and
rfc822 format available.
Message #11 received at 24086 <at> debbugs.gnu.org (full text, mbox):
On Wed, 27 Jul 2016, Eli Zaretskii wrote:
>> From: Tino Calancha <tino.calancha <at> gmail.com>
>> Date: Wed, 27 Jul 2016 20:32:40 +0900 (JST)
>>
>> When the argument TYPE is 'other-frame, it should visit
>> the buffer in a new frame.
>
> Not unconditionally, though. There are clearly some conditions in the
> code under which the above should not happen.
Exactly. I wrote that sentence thinking on 'ibuffer-do-view-other-frame';
i realize the bug while calling this command.
> Does the change have to be this complicated? AFAICT, the error is
> just in the wrong logic of combining the conditions. Right?
Well, maybe someone more skillful could come with
something fancier :-)
The reason why my patch looks bigger that one could
expect is because:
1) I understand better the logic written in my patch:
it reads more explicit what the logic is doing, IMO.
2) It is also fixing the expected behaviour of
'ibuffer-do-view-other-frame'.
The orig version of 'ibuffer-do-view-1', once 'unless' condition
evaluates nil, pops to the first marked buffer in the selected window
(regardless of the value of TYPE). Then, the rest of marked buffers
are visited in a new frame if TYPE equals to 'other-frame.
That's wrong: if TYPE equals 'other-frame, all marked buffers
should be visited in a new frame.
Otherwise, if you have just one marked buffer, and you call
'ibuffer-do-view-other-frame' (bound to H), Emacs visit this buffer
in the same frame.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#24086
; Package
emacs
.
(Tue, 13 Sep 2016 16:00:03 GMT)
Full text and
rfc822 format available.
Message #14 received at 24086 <at> debbugs.gnu.org (full text, mbox):
On Thu, 28 Jul 2016, Tino Calancha wrote:
>
>
> On Wed, 27 Jul 2016, Eli Zaretskii wrote:
>
>>> From: Tino Calancha <tino.calancha <at> gmail.com>
>>> Date: Wed, 27 Jul 2016 20:32:40 +0900 (JST)
>>>
>>> When the argument TYPE is 'other-frame, it should visit
>>> the buffer in a new frame.
>>
>> Not unconditionally, though. There are clearly some conditions in the
>> code under which the above should not happen.
> Exactly. I wrote that sentence thinking on 'ibuffer-do-view-other-frame'; i
> realize the bug while calling this command.
>
>> Does the change have to be this complicated? AFAICT, the error is
>> just in the wrong logic of combining the conditions. Right?
> Well, maybe someone more skillful could come with
> something fancier :-)
>
> The orig version of 'ibuffer-do-view-1', once 'unless' condition
> evaluates nil, pops to the first marked buffer in the selected window
> (regardless of the value of TYPE). Then, the rest of marked buffers
> are visited in a new frame if TYPE equals to 'other-frame.
>
> That's wrong: if TYPE equals 'other-frame, all marked buffers
> should be visited in a new frame.
> Otherwise, if you have just one marked buffer, and you call
> 'ibuffer-do-view-other-frame' (bound to H), Emacs visit this buffer
> in the same frame.
From previous patch, I have renamed the local var 'confirm' to 'abort';
i have dropped an empty line and fixed the indentation.
If there are no further objections i will push this patch to master in
a few days.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
From 314762928c53abc439c7bc0616bd024a829a8319 Mon Sep 17 00:00:00 2001
From: Tino Calancha <tino.calancha <at> gmail.com>
Date: Wed, 14 Sep 2016 00:53:02 +0900
Subject: [PATCH] Ibuffer: View buffer in other frame
* lisp/ibuffer.el (ibuffer-do-view-1):
Use another frame when TYPE equals 'other-frame (Bug#24086).
---
lisp/ibuffer.el | 22 +++++++++++++---------
1 file changed, 13 insertions(+), 9 deletions(-)
diff --git a/lisp/ibuffer.el b/lisp/ibuffer.el
index 8e24629..a180512 100644
--- a/lisp/ibuffer.el
+++ b/lisp/ibuffer.el
@@ -1143,17 +1143,21 @@ ibuffer-do-view-horizontally
(ibuffer-do-view-1 (if other-frame 'other-frame 'horizontally)))
(defun ibuffer-do-view-1 (type)
- (let ((marked-bufs (ibuffer-get-marked-buffers)))
+ (let ((marked-bufs (ibuffer-get-marked-buffers))
+ abort)
(when (null marked-bufs)
(setq marked-bufs (list (ibuffer-current-buffer t))))
- (unless (and (eq type 'other-frame)
- (not ibuffer-expert)
- (> (length marked-bufs) 3)
- (not (y-or-n-p (format "Really create a new frame for %s
buffers? "
- (length marked-bufs)))))
- (set-buffer-modified-p nil)
- (delete-other-windows)
- (switch-to-buffer (pop marked-bufs))
+ (when (and (eq type 'other-frame)
+ (not ibuffer-expert)
+ (> (length marked-bufs) 3))
+ (setq abort
+ (not (y-or-n-p (format "Really create a new frame for %s
buffers? "
+ (length marked-bufs))))))
+ (unless abort
+ (unless (eq type 'other-frame)
+ (set-buffer-modified-p nil)
+ (delete-other-windows)
+ (switch-to-buffer (pop marked-bufs)))
(let ((height (/ (1- (if (eq type 'horizontally) (frame-width)
(frame-height)))
(1+ (length marked-bufs)))))
--
2.9.3
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
In GNU Emacs 25.1.50.1 (x86_64-pc-linux-gnu, GTK+ Version 3.21.5)
of 2016-09-13
Repository revision: 3988ceaa1cfa2022443906750cbb30127a1e161f
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#24086
; Package
emacs
.
(Fri, 23 Sep 2016 06:25:02 GMT)
Full text and
rfc822 format available.
Message #17 received at 24086 <at> debbugs.gnu.org (full text, mbox):
On Wed, 14 Sep 2016, Tino Calancha wrote:
> If there are no further objections i will push this patch to master in
> a few days.
I have pushed to master the following much simple patch:
From 87925f1125acf95439e4563f9a30864cadf7cafb Mon Sep 17 00:00:00 2001
From: Tino Calancha <tino.calancha <at> gmail.com>
Date: Fri, 23 Sep 2016 15:16:15 +0900
Subject: [PATCH] ibuffer-do-view-other-frame: Display each buffer in a new
frame
* lisp/ibuffer.el (ibuffer-do-view-1):
When TYPE equals 'other-frame, then display each buffer
in a new frame (Bug#24086).
---
lisp/ibuffer.el | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/lisp/ibuffer.el b/lisp/ibuffer.el
index 0336f1d..e965535 100644
--- a/lisp/ibuffer.el
+++ b/lisp/ibuffer.el
@@ -1143,17 +1143,17 @@ ibuffer-do-view-horizontally
(ibuffer-do-view-1 (if other-frame 'other-frame 'horizontally)))
(defun ibuffer-do-view-1 (type)
- (let ((marked-bufs (ibuffer-get-marked-buffers)))
- (when (null marked-bufs)
- (setq marked-bufs (list (ibuffer-current-buffer t))))
+ (let ((marked-bufs (or (ibuffer-get-marked-buffers)
+ (list (ibuffer-current-buffer t)))))
(unless (and (eq type 'other-frame)
(not ibuffer-expert)
(> (length marked-bufs) 3)
(not (y-or-n-p (format "Really create a new frame for %s
buffers? "
(length marked-bufs)))))
- (set-buffer-modified-p nil)
- (delete-other-windows)
- (switch-to-buffer (pop marked-bufs))
+ (unless (eq type 'other-frame)
+ (set-buffer-modified-p nil)
+ (delete-other-windows)
+ (switch-to-buffer (pop marked-bufs)))
(let ((height (/ (1- (if (eq type 'horizontally) (frame-width)
(frame-height)))
(1+ (length marked-bufs)))))
--
2.9.3
Repository revision: 0041ce81897ef837d04674b634720645379f3b18
Reply sent
to
Tino Calancha <tino.calancha <at> gmail.com>
:
You have taken responsibility.
(Fri, 23 Sep 2016 06:27:01 GMT)
Full text and
rfc822 format available.
Notification sent
to
Tino Calancha <tino.calancha <at> gmail.com>
:
bug acknowledged by developer.
(Fri, 23 Sep 2016 06:27:01 GMT)
Full text and
rfc822 format available.
Message #22 received at 24086-done <at> debbugs.gnu.org (full text, mbox):
Fixed in master branch as commit: 87925f11
On Fri, 23 Sep 2016, Tino Calancha wrote:
> On Wed, 14 Sep 2016, Tino Calancha wrote:
>
>> If there are no further objections i will push this patch to master in
>> a few days.
>
> I have pushed to master the following much simple patch:
>
>
> From 87925f1125acf95439e4563f9a30864cadf7cafb Mon Sep 17 00:00:00 2001
> From: Tino Calancha <tino.calancha <at> gmail.com>
> Date: Fri, 23 Sep 2016 15:16:15 +0900
> Subject: [PATCH] ibuffer-do-view-other-frame: Display each buffer in a new
> frame
>
> * lisp/ibuffer.el (ibuffer-do-view-1):
> When TYPE equals 'other-frame, then display each buffer
> in a new frame (Bug#24086).
> ---
> lisp/ibuffer.el | 12 ++++++------
> 1 file changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/lisp/ibuffer.el b/lisp/ibuffer.el
> index 0336f1d..e965535 100644
> --- a/lisp/ibuffer.el
> +++ b/lisp/ibuffer.el
> @@ -1143,17 +1143,17 @@ ibuffer-do-view-horizontally
> (ibuffer-do-view-1 (if other-frame 'other-frame 'horizontally)))
>
> (defun ibuffer-do-view-1 (type)
> - (let ((marked-bufs (ibuffer-get-marked-buffers)))
> - (when (null marked-bufs)
> - (setq marked-bufs (list (ibuffer-current-buffer t))))
> + (let ((marked-bufs (or (ibuffer-get-marked-buffers)
> + (list (ibuffer-current-buffer t)))))
> (unless (and (eq type 'other-frame)
> (not ibuffer-expert)
> (> (length marked-bufs) 3)
> (not (y-or-n-p (format "Really create a new frame for %s
> buffers? "
> (length marked-bufs)))))
> - (set-buffer-modified-p nil)
> - (delete-other-windows)
> - (switch-to-buffer (pop marked-bufs))
> + (unless (eq type 'other-frame)
> + (set-buffer-modified-p nil)
> + (delete-other-windows)
> + (switch-to-buffer (pop marked-bufs)))
> (let ((height (/ (1- (if (eq type 'horizontally) (frame-width)
> (frame-height)))
> (1+ (length marked-bufs)))))
> --
> 2.9.3
>
>
> Repository revision: 0041ce81897ef837d04674b634720645379f3b18
>
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Fri, 21 Oct 2016 11:24:03 GMT)
Full text and
rfc822 format available.
This bug report was last modified 8 years and 303 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.