GNU bug report logs -
#1259
quit-window: does it quit the wrong buffer?
Previous Next
Full log
Message #35 received at 1259 <at> emacsbugs.donarmstrong.com (full text, mbox):
> Is there a reason why you're not calling delete-window-on in all cases?
Just for the case that I have two windows showing the same buffer and
invoke `quit-window' on one of them. In this case I want to leave the
other window alone. (BTW, using `delete-windows-on' for a frame showing
_one_ window is a kludge - but `delete-windows-on' is the only function
I found that handles some corner cases in this area correctly.)
> Why the condition-case only for delete-window?
I don't think it's needed. But delete_window has a strange loop I never
understood completely which can err with "Cannot delete window" and I
wanted to avoid that.
> Also, why the explicit switch-to-buffer?
> Should quit-window switch to the buffer that would be displayed if the
> current buffer was killed or just buried?
That was already in the old version of `quit-window'. Note that when
WINDOW is not the selected window, `bury-buffer' leaves the buffer
displayed in WINDOW. `quit-window' must remove the buffer from WINDOW
even if WINDOW is not selected.
In any case, don't expect too much from `quit-window'. The underlying
logic is too weak to make it more useful. What we really need is a
buffer-local variable say `quit-windows-on' which, when set, triggers
some special code in `set-window-buffer' and `display-buffer'. The
former would simply record in a window-local variable `how-to-quit' the
buffer formerly displayed in the window and `quit-window' could switch
to that buffer, provided its still live.
`display-buffer' would do the same but in addition, when it splits a
window to display the buffer, set `how-to-quit' to t so `quit-window'
could eventually delete that window. A similar solution would have
`quit-window' delete a stand-alone frame popped up by `display-buffer'.
Most of this has been implemented in Lisp in some form or the other but
that's not sufficient. `set-window-buffer' must act on this.
martin
This bug report was last modified 16 years and 285 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.