aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Rudalics2011-06-07 14:51:07 +0200
committerMartin Rudalics2011-06-07 14:51:07 +0200
commitfa8a67e67454a900e4cf7b93fed96f27ea41b1b8 (patch)
tree3508a1b1b1d4a18ad171cf885e8f378b115955cc
parent81d63f1a46e650d576a071c7126acde3e886c078 (diff)
downloademacs-fa8a67e67454a900e4cf7b93fed96f27ea41b1b8.tar.gz
emacs-fa8a67e67454a900e4cf7b93fed96f27ea41b1b8.zip
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.
-rw-r--r--src/ChangeLog10
-rw-r--r--src/frame.c2
-rw-r--r--src/window.c51
-rw-r--r--src/window.h2
4 files changed, 40 insertions, 25 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 5e51d8c6a76..c7bcdec0512 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -6,13 +6,21 @@
6 (window_box_text_cols): Replace with window_body_cols. 6 (window_box_text_cols): Replace with window_body_cols.
7 (Fwindow_width, Fscroll_left, Fscroll_right): Use 7 (Fwindow_width, Fscroll_left, Fscroll_right): Use
8 window_body_cols instead of window_box_text_cols. 8 window_body_cols instead of window_box_text_cols.
9 (delete_window, Fset_window_configuration): Call
10 delete_all_subwindows with window as argument.
11 (delete_all_subwindows): Take a window as argument and not a
12 structure. Rewrite.
9 13
10 * window.h: Extern window_body_cols instead of 14 * window.h: Extern window_body_cols instead of
11 window_box_text_cols. 15 window_box_text_cols. delete_all_subwindows now takes a
16 Lisp_Object as argument.
12 17
13 * indent.c (compute_motion, Fcompute_motion): Use 18 * indent.c (compute_motion, Fcompute_motion): Use
14 window_body_cols instead of window_box_text_cols. 19 window_body_cols instead of window_box_text_cols.
15 20
21 * frame.c (delete_frame): Call delete_all_subwindows with root
22 window as argument.
23
162011-06-07 Daniel Colascione <dan.colascione@gmail.com> 242011-06-07 Daniel Colascione <dan.colascione@gmail.com>
17 25
18 * fns.c (Fputhash): Document return value. 26 * fns.c (Fputhash): Document return value.
diff --git a/src/frame.c b/src/frame.c
index 68984a68d52..71881265b44 100644
--- a/src/frame.c
+++ b/src/frame.c
@@ -1336,7 +1336,7 @@ delete_frame (Lisp_Object frame, Lisp_Object force)
1336 1336
1337 /* Mark all the windows that used to be on FRAME as deleted, and then 1337 /* Mark all the windows that used to be on FRAME as deleted, and then
1338 remove the reference to them. */ 1338 remove the reference to them. */
1339 delete_all_subwindows (XWINDOW (f->root_window)); 1339 delete_all_subwindows (f->root_window);
1340 f->root_window = Qnil; 1340 f->root_window = Qnil;
1341 1341
1342 Vframe_list = Fdelq (frame, Vframe_list); 1342 Vframe_list = Fdelq (frame, Vframe_list);
diff --git a/src/window.c b/src/window.c
index 43635fe5a6b..ee62f57ee07 100644
--- a/src/window.c
+++ b/src/window.c
@@ -2001,9 +2001,9 @@ delete_window (register Lisp_Object window)
2001 /* Since we may be deleting combination windows, we must make sure that 2001 /* Since we may be deleting combination windows, we must make sure that
2002 not only p but all its children have been marked as deleted. */ 2002 not only p but all its children have been marked as deleted. */
2003 if (! NILP (p->hchild)) 2003 if (! NILP (p->hchild))
2004 delete_all_subwindows (XWINDOW (p->hchild)); 2004 delete_all_subwindows (p->hchild);
2005 else if (! NILP (p->vchild)) 2005 else if (! NILP (p->vchild))
2006 delete_all_subwindows (XWINDOW (p->vchild)); 2006 delete_all_subwindows (p->vchild);
2007 2007
2008 /* Mark this window as deleted. */ 2008 /* Mark this window as deleted. */
2009 p->buffer = p->hchild = p->vchild = Qnil; 2009 p->buffer = p->hchild = p->vchild = Qnil;
@@ -6260,7 +6260,7 @@ the return value is nil. Otherwise the value is t. */)
6260 Save their current buffers in their height fields, since we may 6260 Save their current buffers in their height fields, since we may
6261 need it later, if a buffer saved in the configuration is now 6261 need it later, if a buffer saved in the configuration is now
6262 dead. */ 6262 dead. */
6263 delete_all_subwindows (XWINDOW (FRAME_ROOT_WINDOW (f))); 6263 delete_all_subwindows (FRAME_ROOT_WINDOW (f));
6264 6264
6265 for (k = 0; k < saved_windows->header.size; k++) 6265 for (k = 0; k < saved_windows->header.size; k++)
6266 { 6266 {
@@ -6448,31 +6448,38 @@ the return value is nil. Otherwise the value is t. */)
6448 return (FRAME_LIVE_P (f) ? Qt : Qnil); 6448 return (FRAME_LIVE_P (f) ? Qt : Qnil);
6449} 6449}
6450 6450
6451/* Mark all windows now on frame as deleted 6451/* Delete all subwindows reachable via the next, vchild, and hchild
6452 by setting their buffers to nil. */ 6452 slots of WINDOW. */
6453
6454void 6453void
6455delete_all_subwindows (register struct window *w) 6454delete_all_subwindows (Lisp_Object window)
6456{ 6455{
6456 register struct window *w;
6457
6458 w = XWINDOW (window);
6459
6457 if (!NILP (w->next)) 6460 if (!NILP (w->next))
6458 delete_all_subwindows (XWINDOW (w->next)); 6461 /* Delete WINDOW's siblings (we traverse postorderly). */
6459 if (!NILP (w->vchild)) 6462 delete_all_subwindows (w->next);
6460 delete_all_subwindows (XWINDOW (w->vchild));
6461 if (!NILP (w->hchild))
6462 delete_all_subwindows (XWINDOW (w->hchild));
6463 6463
6464 w->total_lines = w->buffer; /* See Fset_window_configuration for excuse. */ 6464 w->total_lines = w->buffer; /* See Fset_window_configuration for excuse. */
6465 6465
6466 if (!NILP (w->buffer)) 6466 if (!NILP (w->vchild))
6467 unshow_buffer (w); 6467 {
6468 6468 delete_all_subwindows (w->vchild);
6469 /* We set all three of these fields to nil, to make sure that we can 6469 w->vchild = Qnil;
6470 distinguish this dead window from any live window. Live leaf 6470 }
6471 windows will have buffer set, and combination windows will have 6471 else if (!NILP (w->hchild))
6472 vchild or hchild set. */ 6472 {
6473 w->buffer = Qnil; 6473 delete_all_subwindows (w->hchild);
6474 w->vchild = Qnil; 6474 w->hchild = Qnil;
6475 w->hchild = Qnil; 6475 }
6476 else if (!NILP (w->buffer))
6477 {
6478 unshow_buffer (w);
6479 unchain_marker (XMARKER (w->pointm));
6480 unchain_marker (XMARKER (w->start));
6481 w->buffer = Qnil;
6482 }
6476 6483
6477 Vwindow_list = Qnil; 6484 Vwindow_list = Qnil;
6478} 6485}
diff --git a/src/window.h b/src/window.h
index 7f937e92284..37d22bd7a76 100644
--- a/src/window.h
+++ b/src/window.h
@@ -770,7 +770,7 @@ EXFUN (Fwindow_dedicated_p, 1);
770extern void set_window_height (Lisp_Object, int, int); 770extern void set_window_height (Lisp_Object, int, int);
771extern void set_window_width (Lisp_Object, int, int); 771extern void set_window_width (Lisp_Object, int, int);
772extern void change_window_heights (Lisp_Object, int); 772extern void change_window_heights (Lisp_Object, int);
773extern void delete_all_subwindows (struct window *); 773extern void delete_all_subwindows (Lisp_Object);
774extern void freeze_window_starts (struct frame *, int); 774extern void freeze_window_starts (struct frame *, int);
775extern void grow_mini_window (struct window *, int); 775extern void grow_mini_window (struct window *, int);
776extern void shrink_mini_window (struct window *); 776extern void shrink_mini_window (struct window *);