Subject: bug#1259: quit-window does not kill the window

From: "Juanma Barranquero" <[email-masked]>
Date: Thu, 13 Nov 2008 17:40:55 +0100

Martin, I'm afraid I missed this comment by you:

"`quit-window' looks fishy in a number of regards: The `delete-frame'
stuff needs other_visible_frames to work correctly but this is not
available in Elisp.  I plan to commit somthing like the version below.
Could people please test whether it breaks their favorite use of this?"

But yes, it breaks one of my favorite uses.

The docstring previously said:

"If WINDOW is non-nil, it specifies a window; we delete that window,
and the buffer that is killed or buried is the one in that window."

Now, it says:

"If WINDOW
is dedicated or a minibuffer window, delete it and, if it's the
only window on its frame, delete its frame as well provided there
are other frames left.  Otherwise, display some other buffer in
the window."

I was using the previously documented behavior. I have a function

(defun quit-buffer-and-window ()
   (interactive)
   (quit-window nil (selected-window)))

(I assign it to "q" in many modes). Now,

  C-x 2 C-x o M-x quit-buffer-and-window <ENTER>

leaves me with two windows.

  Juanma