all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: martin rudalics <rudalics@gmx.at>
To: David Reitter <david.reitter@gmail.com>
Cc: 1259@emacsbugs.donarmstrong.com
Subject: bug#1259: quit-window: does it quit the wrong buffer?
Date: Tue, 04 Nov 2008 19:15:40 +0100	[thread overview]
Message-ID: <4910914C.3070009@gmx.at> (raw)
In-Reply-To: <4727ECB9-A38C-4717-AFE5-2CED845C1C50@gmail.com>

 > 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







  reply	other threads:[~2008-11-04 18:15 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <4909D5D9.60300@gmx.at>
2008-10-27  1:19 ` bug#1259: quit-window: does it quit the wrong buffer? David Reitter
2008-10-27 10:31   ` martin rudalics
2008-10-27 15:01     ` David Reitter
2008-10-27 17:07       ` martin rudalics
2008-11-04 17:40         ` David Reitter
2008-11-04 18:15           ` martin rudalics [this message]
2008-10-30 15:50   ` bug#1259: marked as done (quit-window: does it quit the wrong buffer?) Emacs bug Tracking System

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4910914C.3070009@gmx.at \
    --to=rudalics@gmx.at \
    --cc=1259@emacsbugs.donarmstrong.com \
    --cc=david.reitter@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.