Commit fa8a67e6 authored by Martin Rudalics's avatar Martin Rudalics

Make delete_all_subwindows argument a Lisp_Object.

* window.c (delete_window, Fset_window_configuration): Call
delete_all_subwindows with window as argument.
(delete_all_subwindows): Take a window as argument and not a
structure.  Rewrite.

* window.h: delete_all_subwindows now takes a Lisp_Object as
argument.

* frame.c (delete_frame): Call delete_all_subwindows with root
window as argument.
parent 81d63f1a
......@@ -6,13 +6,21 @@
(window_box_text_cols): Replace with window_body_cols.
(Fwindow_width, Fscroll_left, Fscroll_right): Use
window_body_cols instead of window_box_text_cols.
(delete_window, Fset_window_configuration): Call
delete_all_subwindows with window as argument.
(delete_all_subwindows): Take a window as argument and not a
structure. Rewrite.
* window.h: Extern window_body_cols instead of
window_box_text_cols.
window_box_text_cols. delete_all_subwindows now takes a
Lisp_Object as argument.
* indent.c (compute_motion, Fcompute_motion): Use
window_body_cols instead of window_box_text_cols.
* frame.c (delete_frame): Call delete_all_subwindows with root
window as argument.
2011-06-07 Daniel Colascione <dan.colascione@gmail.com>
* fns.c (Fputhash): Document return value.
......
......@@ -1336,7 +1336,7 @@ delete_frame (Lisp_Object frame, Lisp_Object force)
/* Mark all the windows that used to be on FRAME as deleted, and then
remove the reference to them. */
delete_all_subwindows (XWINDOW (f->root_window));
delete_all_subwindows (f->root_window);
f->root_window = Qnil;
Vframe_list = Fdelq (frame, Vframe_list);
......
......@@ -2001,9 +2001,9 @@ delete_window (register Lisp_Object window)
/* Since we may be deleting combination windows, we must make sure that
not only p but all its children have been marked as deleted. */
if (! NILP (p->hchild))
delete_all_subwindows (XWINDOW (p->hchild));
delete_all_subwindows (p->hchild);
else if (! NILP (p->vchild))
delete_all_subwindows (XWINDOW (p->vchild));
delete_all_subwindows (p->vchild);
/* Mark this window as deleted. */
p->buffer = p->hchild = p->vchild = Qnil;
......@@ -6260,7 +6260,7 @@ the return value is nil. Otherwise the value is t. */)
Save their current buffers in their height fields, since we may
need it later, if a buffer saved in the configuration is now
dead. */
delete_all_subwindows (XWINDOW (FRAME_ROOT_WINDOW (f)));
delete_all_subwindows (FRAME_ROOT_WINDOW (f));
for (k = 0; k < saved_windows->header.size; k++)
{
......@@ -6448,31 +6448,38 @@ the return value is nil. Otherwise the value is t. */)
return (FRAME_LIVE_P (f) ? Qt : Qnil);
}
/* Mark all windows now on frame as deleted
by setting their buffers to nil. */
/* Delete all subwindows reachable via the next, vchild, and hchild
slots of WINDOW. */
void
delete_all_subwindows (register struct window *w)
delete_all_subwindows (Lisp_Object window)
{
register struct window *w;
w = XWINDOW (window);
if (!NILP (w->next))
delete_all_subwindows (XWINDOW (w->next));
if (!NILP (w->vchild))
delete_all_subwindows (XWINDOW (w->vchild));
if (!NILP (w->hchild))
delete_all_subwindows (XWINDOW (w->hchild));
/* Delete WINDOW's siblings (we traverse postorderly). */
delete_all_subwindows (w->next);
w->total_lines = w->buffer; /* See Fset_window_configuration for excuse. */
if (!NILP (w->buffer))
unshow_buffer (w);
/* We set all three of these fields to nil, to make sure that we can
distinguish this dead window from any live window. Live leaf
windows will have buffer set, and combination windows will have
vchild or hchild set. */
w->buffer = Qnil;
w->vchild = Qnil;
w->hchild = Qnil;
if (!NILP (w->vchild))
{
delete_all_subwindows (w->vchild);
w->vchild = Qnil;
}
else if (!NILP (w->hchild))
{
delete_all_subwindows (w->hchild);
w->hchild = Qnil;
}
else if (!NILP (w->buffer))
{
unshow_buffer (w);
unchain_marker (XMARKER (w->pointm));
unchain_marker (XMARKER (w->start));
w->buffer = Qnil;
}
Vwindow_list = Qnil;
}
......
......@@ -770,7 +770,7 @@ EXFUN (Fwindow_dedicated_p, 1);
extern void set_window_height (Lisp_Object, int, int);
extern void set_window_width (Lisp_Object, int, int);
extern void change_window_heights (Lisp_Object, int);
extern void delete_all_subwindows (struct window *);
extern void delete_all_subwindows (Lisp_Object);
extern void freeze_window_starts (struct frame *, int);
extern void grow_mini_window (struct window *, int);
extern void shrink_mini_window (struct window *);
......
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