unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#25115: 26.0.50; ibuffer fails to show confirmation buffer when there are side windows
@ 2016-12-05  3:28 Liu Hui
  2016-12-05  7:31 ` martin rudalics
  2022-02-12  8:51 ` Lars Ingebrigtsen
  0 siblings, 2 replies; 13+ messages in thread
From: Liu Hui @ 2016-12-05  3:28 UTC (permalink / raw)
  To: 25115

Hello,

When there are side windows, ibuffer fails to show the comfirmation 
buffer for buffers to be killed.

1. emacs -Q & create a side window by
(pop-to-buffer "test"
                '(display-buffer-in-side-window
                  (side . right)
                  (width . 0.2)))
2. switch to another buffer and M-x ibuffer
3. press 'D', mark two or more buffers for killing
4. press 'x'

then an error 'ibuffer-confirm-operation-on: Cannot split side window or 
parent of side window' is issued.


In GNU Emacs 26.0.50.2 (x86_64-pc-linux-gnu, GTK+ Version 3.18.9)
  of 2016-12-03 built on lgw01-50
Windowing system distributor 'The X.Org Foundation', version 11.0.11804000
System Description:	Ubuntu 16.04.1 LTS





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

* bug#25115: 26.0.50; ibuffer fails to show confirmation buffer when there are side windows
  2016-12-05  3:28 bug#25115: 26.0.50; ibuffer fails to show confirmation buffer when there are side windows Liu Hui
@ 2016-12-05  7:31 ` martin rudalics
       [not found]   ` <d0790209-000a-ea3a-d279-f04d5b0b65d8@gmail.com>
  2022-02-12  8:51 ` Lars Ingebrigtsen
  1 sibling, 1 reply; 13+ messages in thread
From: martin rudalics @ 2016-12-05  7:31 UTC (permalink / raw)
  To: Liu Hui, 25115

 > When there are side windows, ibuffer fails to show the comfirmation buffer for buffers to be killed.
 >
 > 1. emacs -Q & create a side window by
 > (pop-to-buffer "test"
 >                 '(display-buffer-in-side-window
 >                   (side . right)
 >                   (width . 0.2)))
 > 2. switch to another buffer and M-x ibuffer
 > 3. press 'D', mark two or more buffers for killing
 > 4. press 'x'
 >
 > then an error 'ibuffer-confirm-operation-on: Cannot split side window or parent of side window' is issued.
 >
 >
 > In GNU Emacs 26.0.50.2 (x86_64-pc-linux-gnu, GTK+ Version 3.18.9)
 >   of 2016-12-03 built on lgw01-50
 > Windowing system distributor 'The X.Org Foundation', version 11.0.11804000
 > System Description:    Ubuntu 16.04.1 LTS

Thanks for the report.  Since I don't use ibuffer I just tried to follow
your recipe.  In (2) I switched to *Messages* in the side window by
selecting it with the mouse from the Buffers menu.  If, after M-x
ibuffer, I now type ‘D’ in the side window, ibuffer prompts me whether I
really want to kill *Messages* so I miserably failed to "mark two or
more buffers for killing".

If instead in (3) I repeatedly type ‘m’ to mark all buffers listed in
the side window and then type ‘D’, my main window gets split, in the
window at the bottom I get a list of the selected buffers and in the
minibuffer I'm asked whether I really want to kill 3 buffers.  When,
instead of ‘D’ I type ‘x’, I am asked in the minibuffer whether I really
want to kill the buffer at the current line of the side window.

I don't understand the ibuffer code (partly because I don't understand
what an interactive Lisp closure is and how it works).  So if you can't
give me a recipe I can follow it might be best if you debug the ibuffer
code yourself to find out why and how it tries to split the side window.

Finally note that side windows are preferably populated via
‘display-buffer’, so the "switch to another buffer" and "M-x ibuffer" in
step (2) already sound like a bad idea.

Thanks, martin






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

* bug#25115: 26.0.50; ibuffer fails to show confirmation buffer when there are side windows
       [not found]   ` <d0790209-000a-ea3a-d279-f04d5b0b65d8@gmail.com>
@ 2016-12-05 10:16     ` martin rudalics
  2016-12-05 15:08       ` Mark Oteiza
  0 siblings, 1 reply; 13+ messages in thread
From: martin rudalics @ 2016-12-05 10:16 UTC (permalink / raw)
  To: Liu Hui; +Cc: 25115

 > Steps to reproduce:
 >
 > 1. emacs -Q
 > 2. eval the following code in *scratch* to create a side window.
 > (pop-to-buffer "test"
 >                 '(display-buffer-in-side-window
 >                   (side . right)
 >                   (width . 0.2)))
 > 3. Now the side window has been created and selected. Press 'C-x o' to switch to the other window in the left, which displays *scratch*.
 > 4. M-x ibuffer. Then press 'd' to mark two or more buffers for killing.
 > 5. Press 'x'. Then an error 'ibuffer-confirm-operation-on: Cannot split side window or parent of side window' is issued.

Confirmed.  ‘ibuffer-confirm-operation-on’ selects the last window of
the selected frame's ‘window-list’ and tries to split that window.  In
your scenario the last window is the side window and cannot be split by
‘split-window’.

I pushed a fix for that on master, please have a look.

But someone who's using ibuffer on a regular basis should really try to
make it use ‘display-buffer’ instead.  There is absolutely no evidence
that the last window of a frame can be split more easily than the one
used by ibuffer itself and if no window can be split some other window
should be reused for displaying the buffer list.

Thanks again, martin






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

* bug#25115: 26.0.50; ibuffer fails to show confirmation buffer when there are side windows
  2016-12-05 10:16     ` martin rudalics
@ 2016-12-05 15:08       ` Mark Oteiza
  2016-12-05 16:24         ` martin rudalics
  0 siblings, 1 reply; 13+ messages in thread
From: Mark Oteiza @ 2016-12-05 15:08 UTC (permalink / raw)
  To: martin rudalics; +Cc: Liu Hui, 25115

martin rudalics <rudalics@gmx.at> writes:

>> Steps to reproduce:
>>
>> 1. emacs -Q
>> 2. eval the following code in *scratch* to create a side window.
>> (pop-to-buffer "test"
>>                 '(display-buffer-in-side-window
>>                   (side . right)
>>                   (width . 0.2)))
>> 3. Now the side window has been created and selected. Press 'C-x o' to switch to the other window in the left, which displays *scratch*.
>> 4. M-x ibuffer. Then press 'd' to mark two or more buffers for killing.
>> 5. Press 'x'. Then an error 'ibuffer-confirm-operation-on: Cannot split side window or parent of side window' is issued.
>
> Confirmed.  ‘ibuffer-confirm-operation-on’ selects the last window of
> the selected frame's ‘window-list’ and tries to split that window.  In
> your scenario the last window is the side window and cannot be split by
> ‘split-window’.
>
> I pushed a fix for that on master, please have a look.
>
> But someone who's using ibuffer on a regular basis should really try to
> make it use ‘display-buffer’ instead.  There is absolutely no evidence
> that the last window of a frame can be split more easily than the one
> used by ibuffer itself and if no window can be split some other window
> should be reused for displaying the buffer list.

I don't use ibuffer often, but I have been changing instances of
switch-to-buffer to pop-to-buffer-same-window since reading Bug#22244.

Makes me wonder about switch-to-buffer's future





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

* bug#25115: 26.0.50; ibuffer fails to show confirmation buffer when there are side windows
  2016-12-05 15:08       ` Mark Oteiza
@ 2016-12-05 16:24         ` martin rudalics
  2016-12-06 10:20           ` Tino Calancha
  0 siblings, 1 reply; 13+ messages in thread
From: martin rudalics @ 2016-12-05 16:24 UTC (permalink / raw)
  To: Mark Oteiza; +Cc: Liu Hui, 25115

 > I don't use ibuffer often, but I have been changing instances of
 > switch-to-buffer to pop-to-buffer-same-window since reading Bug#22244.
 >
 > Makes me wonder about switch-to-buffer's future

This is not primarily about ‘switch-to-buffer’.  It's about displaying a
list of items (file or buffer names, completions, ispell's choices, ...)
in a buffer, temporarily showing that buffer in a window and then
proceeding in reaction to user input.  ‘dired-mark-pop-up’ is a typical
function for this purpose.

ibuffer apparently uses the last window in ‘window-list’ to show the
buffer at the bottom of the frame, something ‘display-buffer-at-bottom’
should handle well.  But I'd like to hear the opinion of a long time
user of ‘ibuffer’ before actually changing this.

Also, ‘ibuffer-confirm-operation-on’ does ‘fit-window-to-buffer’ and I'd
prefer fixing bug#25055 first before reintroducing it somewhere else ;-)

martin






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

* bug#25115: 26.0.50; ibuffer fails to show confirmation buffer when there are side windows
  2016-12-05 16:24         ` martin rudalics
@ 2016-12-06 10:20           ` Tino Calancha
  2016-12-06 14:28             ` martin rudalics
  0 siblings, 1 reply; 13+ messages in thread
From: Tino Calancha @ 2016-12-06 10:20 UTC (permalink / raw)
  To: martin rudalics; +Cc: Mark Oteiza, Liu Hui, 25115

martin rudalics <rudalics@gmx.at> writes:

>> I don't use ibuffer often, but I have been changing instances of
>> switch-to-buffer to pop-to-buffer-same-window since reading Bug#22244.
>>
>> Makes me wonder about switch-to-buffer's future
>
> ibuffer apparently uses the last window in ‘window-list’ to show the
> buffer at the bottom of the frame, something ‘display-buffer-at-bottom’
> should handle well.  But I'd like to hear the opinion of a long time
> user of ‘ibuffer’ before actually changing this.
Your patch has perfect sense to me.  Indeed i wrote an almost identical
fix but you were faster than me.

Regards,
Tino





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

* bug#25115: 26.0.50; ibuffer fails to show confirmation buffer when there are side windows
  2016-12-06 10:20           ` Tino Calancha
@ 2016-12-06 14:28             ` martin rudalics
  2016-12-06 22:45               ` Tino Calancha
  2016-12-12  5:22               ` Liu Hui
  0 siblings, 2 replies; 13+ messages in thread
From: martin rudalics @ 2016-12-06 14:28 UTC (permalink / raw)
  To: Tino Calancha; +Cc: Mark Oteiza, Liu Hui, 25115

 > Your patch has perfect sense to me.  Indeed i wrote an almost identical
 > fix but you were faster than me.

Damn.  Next time I'll wait a day or two :-(

But we still don't know what this ‘window-list’ stuff is all about.  I'd
rather have asked ‘walk-window-tree-1’ on the main window to return the
last window it sees, but consider the following emacs -Q scenario:

C-x 2
C-x o
M-x ibuffer
m
m
D

The confirmation buffer appears above the ibuffer buffer.  I doubt that
such behavior is intentional but since I'm no ibuffer user ...

martin






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

* bug#25115: 26.0.50; ibuffer fails to show confirmation buffer when there are side windows
  2016-12-06 14:28             ` martin rudalics
@ 2016-12-06 22:45               ` Tino Calancha
  2016-12-07  8:15                 ` martin rudalics
  2016-12-12  5:22               ` Liu Hui
  1 sibling, 1 reply; 13+ messages in thread
From: Tino Calancha @ 2016-12-06 22:45 UTC (permalink / raw)
  To: martin rudalics; +Cc: Mark Oteiza, 25115, Tino Calancha, Liu Hui

[-- Attachment #1: Type: text/plain, Size: 1170 bytes --]



On Tue, 6 Dec 2016, martin rudalics wrote:

>> Your patch has perfect sense to me.  Indeed i wrote an almost identical
>> fix but you were faster than me.
>
> Damn.  Next time I'll wait a day or two :-(
>
> But we still don't know what this ‘window-list’ stuff is all about.  I'd
> rather have asked ‘walk-window-tree-1’ on the main window to return the
> last window it sees, but consider the following emacs -Q scenario:
>
> C-x 2
> C-x o
> M-x ibuffer
> m
> m
> D
>
> The confirmation buffer appears above the ibuffer buffer.  I doubt that
> such behavior is intentional but since I'm no ibuffer user ...

I think it shows the author preference for, if possible,
display *Ibuffer confirmation* in other window that
the one showing Ibuffer.

If the current frame just has a window showing
Ibuffer, then *Ibuffer confirmation* is shown in that
same window:

emacs -Q
M-x ibuffer RET
d d x

emacs -Q
C-x b test RET
M-x ibuffer RET
H
M-x other-frame RET
d d x

If we cannot show *Ibuffer confirmation* in the side window,
because it's not allow to split it, it's more useful to chose
another window, i.e., to follow your patch, instead of signal
an error.

Tino

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

* bug#25115: 26.0.50; ibuffer fails to show confirmation buffer when there are side windows
  2016-12-06 22:45               ` Tino Calancha
@ 2016-12-07  8:15                 ` martin rudalics
  0 siblings, 0 replies; 13+ messages in thread
From: martin rudalics @ 2016-12-07  8:15 UTC (permalink / raw)
  To: Tino Calancha; +Cc: Mark Oteiza, Liu Hui, 25115

 >> The confirmation buffer appears above the ibuffer buffer.  I doubt that
 >> such behavior is intentional but since I'm no ibuffer user ...
 >
 > I think it shows the author preference for, if possible,
 > display *Ibuffer confirmation* in other window that
 > the one showing Ibuffer.

Then why not simply split the Ibuffer window itself instead of the last
window of ‘window-list’?

 > If the current frame just has a window showing
 > Ibuffer, then *Ibuffer confirmation* is shown in that
 > same window:
 >
 > emacs -Q
 > M-x ibuffer RET
 > d d x

Not here.  That single window gets split.

martin






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

* bug#25115: 26.0.50; ibuffer fails to show confirmation buffer when there are side windows
  2016-12-06 14:28             ` martin rudalics
  2016-12-06 22:45               ` Tino Calancha
@ 2016-12-12  5:22               ` Liu Hui
  2016-12-12  9:59                 ` martin rudalics
  1 sibling, 1 reply; 13+ messages in thread
From: Liu Hui @ 2016-12-12  5:22 UTC (permalink / raw)
  To: martin rudalics; +Cc: Mark Oteiza, 25115, Tino Calancha


> C-x 2
> C-x o
> M-x ibuffer
> m
> m
> D
>
> The confirmation buffer appears above the ibuffer buffer.  I doubt that
> such behavior is intentional but since I'm no ibuffer user ...

I have seldom noticed this because I usually do C-x 1 
(delete-other-windows) before operating buffers using ibuffer, but 
displaying the confirmation buffer above, or in other unrelated windows, 
is strange indeed.

IMO, displaying the confirmation buffer just above the minibuffer 
waiting for user input, or by splitting ibuffer itself (like Dired*), is 
better.


--------
* I just found Dired seems not to preserve the window height with the 
similar steps, and have submitted a bug report.





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

* bug#25115: 26.0.50; ibuffer fails to show confirmation buffer when there are side windows
  2016-12-12  5:22               ` Liu Hui
@ 2016-12-12  9:59                 ` martin rudalics
  2016-12-12 10:09                   ` Tino Calancha
  0 siblings, 1 reply; 13+ messages in thread
From: martin rudalics @ 2016-12-12  9:59 UTC (permalink / raw)
  To: Liu Hui; +Cc: Mark Oteiza, 25115, Tino Calancha

 > IMO, displaying the confirmation buffer just above the minibuffer
 > waiting for user input, or by splitting ibuffer itself (like Dired*),
 > is better.

I leave it to Tino to deal with this.  IIUC ibuffer has a dedicated
community and I don't want to interfere with longstanding behaviors.

martin






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

* bug#25115: 26.0.50; ibuffer fails to show confirmation buffer when there are side windows
  2016-12-12  9:59                 ` martin rudalics
@ 2016-12-12 10:09                   ` Tino Calancha
  0 siblings, 0 replies; 13+ messages in thread
From: Tino Calancha @ 2016-12-12 10:09 UTC (permalink / raw)
  To: martin rudalics; +Cc: Mark Oteiza, 25115, Tino Calancha, Liu Hui



On Mon, 12 Dec 2016, martin rudalics wrote:

>> IMO, displaying the confirmation buffer just above the minibuffer
>> waiting for user input, or by splitting ibuffer itself (like Dired*),
>> is better.
>
> I leave it to Tino to deal with this.  IIUC ibuffer has a dedicated
> community and I don't want to interfere with longstanding behaviors.
Thank you.  I would like to follow the 'Principle of Minimum Interaction', 
that is, i am happy to modify one file whenever it fix a bug or provide
a new useful feature.  Other than that, i tend to prefer accepting
the original author's design.





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

* bug#25115: 26.0.50; ibuffer fails to show confirmation buffer when there are side windows
  2016-12-05  3:28 bug#25115: 26.0.50; ibuffer fails to show confirmation buffer when there are side windows Liu Hui
  2016-12-05  7:31 ` martin rudalics
@ 2022-02-12  8:51 ` Lars Ingebrigtsen
  1 sibling, 0 replies; 13+ messages in thread
From: Lars Ingebrigtsen @ 2022-02-12  8:51 UTC (permalink / raw)
  To: Liu Hui; +Cc: 25115

Liu Hui <liuhui1610@gmail.com> writes:

> When there are side windows, ibuffer fails to show the comfirmation
> buffer for buffers to be killed.
>
> 1. emacs -Q & create a side window by
> (pop-to-buffer "test"
>                '(display-buffer-in-side-window
>                  (side . right)
>                  (width . 0.2)))
> 2. switch to another buffer and M-x ibuffer
> 3. press 'D', mark two or more buffers for killing
> 4. press 'x'
>
> then an error 'ibuffer-confirm-operation-on: Cannot split side window
> or parent of side window' is issued.

(I'm going through old bug reports that unfortunately weren't resolved
at the time.)

Skimming this bug report, it seems like the reported bug was fixed (and
indeed I can't reproduce it in the current Emacs), and then the
discussion went on to other things, but the bug report was left open, so
I'm closing it now.  If there's anything more to be done here, please
respond to the debbugs address, and we'll reopen.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





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

end of thread, other threads:[~2022-02-12  8:51 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-12-05  3:28 bug#25115: 26.0.50; ibuffer fails to show confirmation buffer when there are side windows Liu Hui
2016-12-05  7:31 ` martin rudalics
     [not found]   ` <d0790209-000a-ea3a-d279-f04d5b0b65d8@gmail.com>
2016-12-05 10:16     ` martin rudalics
2016-12-05 15:08       ` Mark Oteiza
2016-12-05 16:24         ` martin rudalics
2016-12-06 10:20           ` Tino Calancha
2016-12-06 14:28             ` martin rudalics
2016-12-06 22:45               ` Tino Calancha
2016-12-07  8:15                 ` martin rudalics
2016-12-12  5:22               ` Liu Hui
2016-12-12  9:59                 ` martin rudalics
2016-12-12 10:09                   ` Tino Calancha
2022-02-12  8:51 ` Lars Ingebrigtsen

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