[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#24086: 25.1.50; ibuffer-do-view-1 fails to visit in new frame
From: |
Eli Zaretskii |
Subject: |
bug#24086: 25.1.50; ibuffer-do-view-1 fails to visit in new frame |
Date: |
Wed, 27 Jul 2016 20:06:12 +0300 |
> From: Tino Calancha <tino.calancha@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.