(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.
/* 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;
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++)
{
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;
}
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 *);