unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#24086: 25.1.50; ibuffer-do-view-1 fails to visit in new frame
@ 2016-07-27 11:32 Tino Calancha
  2016-07-27 17:06 ` Eli Zaretskii
  0 siblings, 1 reply; 6+ messages in thread
From: Tino Calancha @ 2016-07-27 11:32 UTC (permalink / raw)
  To: 24086


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@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

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;





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

end of thread, other threads:[~2016-09-23  6:26 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-07-27 11:32 bug#24086: 25.1.50; ibuffer-do-view-1 fails to visit in new frame Tino Calancha
2016-07-27 17:06 ` Eli Zaretskii
2016-07-28 13:52   ` Tino Calancha
2016-09-13 15:59     ` Tino Calancha
2016-09-23  6:24       ` Tino Calancha
2016-09-23  6:26         ` Tino Calancha

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).