Subject: Re: bug#24086: 25.1.50; ibuffer-do-view-1 fails to visit in new frame

From: Tino Calancha <[email-masked]>
Date: Thu, 28 Jul 2016 22:52:05 +0900 (JST)

On Wed, 27 Jul 2016, Eli Zaretskii wrote:

>> From: Tino Calancha <[email-masked]>
>> 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.