Commit 0def0403 authored by Richard M. Stallman's avatar Richard M. Stallman
Browse files

(Fdelete_window): Handle deleting a parent of the selected window.

(Fdelete_window): Mostly undo last change which made `frame' a FRAME_PTR.
Don't initialize `frame' in the declaration.
parent 087f61c8
......@@ -700,9 +700,22 @@ DEFUN ("delete-window", Fdelete_window, Sdelete_window, 0, 1, "",
/* Are we trying to delete any frame's selected window? */
Lisp_Object frame, pwindow;
if (EQ (window, FRAME_SELECTED_WINDOW (frame)))
/* See if the frame's selected window is either WINDOW
or any subwindow of it, by finding all that window's parents
and comparing each one with WINDOW. */
frame = WINDOW_FRAME (XWINDOW (window));
while (!NILP (pwindow))
if (EQ (window, pwindow))
pwindow = XWINDOW (pwindow)->parent;
if (EQ (window, pwindow))
Lisp_Object alternative = Fnext_window (window, Qlambda, Qnil);
......@@ -714,7 +727,7 @@ DEFUN ("delete-window", Fdelete_window, Sdelete_window, 0, 1, "",
if (EQ (window, selected_window))
Fselect_window (alternative);
FRAME_SELECTED_WINDOW (frame) = alternative;
FRAME_SELECTED_WINDOW (XFRAME (frame)) = alternative;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment