From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Tino Calancha Newsgroups: gmane.emacs.bugs Subject: bug#24086: 25.1.50; ibuffer-do-view-1 fails to visit in new frame Date: Wed, 14 Sep 2016 00:59:27 +0900 (JST) Message-ID: References: <83eg6froxn.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed X-Trace: blaine.gmane.org 1473782538 16923 195.159.176.226 (13 Sep 2016 16:02:18 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 13 Sep 2016 16:02:18 +0000 (UTC) User-Agent: Alpine 2.20 (DEB 67 2015-01-07) Cc: 24086@debbugs.gnu.org To: Tino Calancha Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Sep 13 18:02:08 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bjq9l-00026Y-17 for geb-bug-gnu-emacs@m.gmane.org; Tue, 13 Sep 2016 18:01:57 +0200 Original-Received: from localhost ([::1]:49833 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bjq9j-00049w-63 for geb-bug-gnu-emacs@m.gmane.org; Tue, 13 Sep 2016 12:01:55 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37121) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bjq80-0002sv-UC for bug-gnu-emacs@gnu.org; Tue, 13 Sep 2016 12:00:13 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bjq7v-0006GD-JU for bug-gnu-emacs@gnu.org; Tue, 13 Sep 2016 12:00:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:32910) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bjq7v-0006Fm-G4 for bug-gnu-emacs@gnu.org; Tue, 13 Sep 2016 12:00:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1bjq7v-0004xu-9u for bug-gnu-emacs@gnu.org; Tue, 13 Sep 2016 12:00:03 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Tino Calancha Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 13 Sep 2016 16:00:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 24086 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 24086-submit@debbugs.gnu.org id=B24086.147378238519021 (code B ref 24086); Tue, 13 Sep 2016 16:00:03 +0000 Original-Received: (at 24086) by debbugs.gnu.org; 13 Sep 2016 15:59:45 +0000 Original-Received: from localhost ([127.0.0.1]:58854 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bjq7Z-0004wf-AL for submit@debbugs.gnu.org; Tue, 13 Sep 2016 11:59:45 -0400 Original-Received: from mail-pf0-f169.google.com ([209.85.192.169]:35532) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bjq7U-0004wP-6T for 24086@debbugs.gnu.org; Tue, 13 Sep 2016 11:59:40 -0400 Original-Received: by mail-pf0-f169.google.com with SMTP id z123so10851960pfz.2 for <24086@debbugs.gnu.org>; Tue, 13 Sep 2016 08:59:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:date:to:cc:subject:in-reply-to:message-id:references :user-agent:mime-version; bh=iUQxEwcdsHIiudKZmijQY4rONYwfgG6SLXuJQou2KxI=; b=Lucu7hGvrWsTMXdcT6IG6Sce4h9JUmGmaRe5WQUHdKvuWCvfjL6v2ZvAW9BWO69wcY ft7zpnoW94yCPfVLWXIqj8SHZeY4nnDrjb1r1EZom6KZFIpuAsb98r4dCwj8arvPJWB9 z3ZsqZB3wmCpGb6TkGgcoYnEWWrbrZEX9X7064tlWiJWXQuUSqp8jIoSwkNJ5R/mL3A0 EGARQJ0jXqkRzheuPR682ckF7+t56Kw7Ap7OdiIzESuJy2fhh5aREw/Vl0FWCEGX8Pqt DA/JmFfk0X4OuQX3ovW+joacnfKD4/4ihBFe6sTumHqKV67n0Pl/U1bIKBSPkk12Wpd6 mrpA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:date:to:cc:subject:in-reply-to:message-id :references:user-agent:mime-version; bh=iUQxEwcdsHIiudKZmijQY4rONYwfgG6SLXuJQou2KxI=; b=gDZKnWSDT+PPxxdS8IFCGY/ltJPlZb/MAjdU6+FpyqJGcpbibdtEJcGwmMY1ZYOKNk OAbjAjQvhdRjik0SOhbQ7llTwI49Klm/oP4i/u5XY3hGZeBW8vuiTvo0pu1/hw6QPQ59 rvCmsd6GlKl5TiLsLmXyalIVmEqZu5PqbSM3+v91zrsoFg/HnwIsANUTMx9i+UPZ6Nd1 pHx5aASgfKoNOl4QFG+pKeh+w6siW0JP83GuUiyit9rCjg3SDJJWeh0c72Higt8y9tIP 4Qogu2NbPb9lPLie+RKA9lY43A0YnfjKogdzRNWF/T+WE+KdQlhpk3KpfXOpzTvblPGv Th4w== X-Gm-Message-State: AE9vXwPlhK/onCKvsSguoZzp79uKxDn1Dzx0RL5Cx4BPjdrB5urqdjlFk83muV60nSc8Wg== X-Received: by 10.98.60.68 with SMTP id j65mr2589896pfa.55.1473782370337; Tue, 13 Sep 2016 08:59:30 -0700 (PDT) Original-Received: from calancha-pc (57.92.100.220.dy.bbexcite.jp. [220.100.92.57]) by smtp.gmail.com with ESMTPSA id c11sm32083763pfk.78.2016.09.13.08.59.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 13 Sep 2016 08:59:29 -0700 (PDT) X-Google-Original-From: Tino Calancha X-X-Sender: calancha@calancha-pc In-Reply-To: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:123261 Archived-At: On Thu, 28 Jul 2016, Tino Calancha wrote: > > > On Wed, 27 Jul 2016, Eli Zaretskii wrote: > >>> From: Tino Calancha >>> 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 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