diff options
Diffstat (limited to 'src/window.c')
| -rw-r--r-- | src/window.c | 51 |
1 files changed, 29 insertions, 22 deletions
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 | |||
| 6454 | void | 6453 | void |
| 6455 | delete_all_subwindows (register struct window *w) | 6454 | delete_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 | } |