Commit fa8a67e6 authored by Martin Rudalics's avatar Martin Rudalics
Browse files

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