emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r104526: Make delete_all_subwindows a


From: martin rudalics
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r104526: Make delete_all_subwindows argument a Lisp_Object.
Date: Tue, 07 Jun 2011 14:51:07 +0200
User-agent: Bazaar (2.3.1)

------------------------------------------------------------
revno: 104526
committer: martin rudalics <address@hidden>
branch nick: trunk
timestamp: Tue 2011-06-07 14:51:07 +0200
message:
  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.
modified:
  src/ChangeLog
  src/frame.c
  src/window.c
  src/window.h
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2011-06-07 09:26:21 +0000
+++ b/src/ChangeLog     2011-06-07 12:51:07 +0000
@@ -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  <address@hidden>
 
        * fns.c (Fputhash): Document return value.

=== modified file 'src/frame.c'
--- a/src/frame.c       2011-06-06 13:57:49 +0000
+++ b/src/frame.c       2011-06-07 12:51:07 +0000
@@ -1336,7 +1336,7 @@
 
   /* 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);

=== modified file 'src/window.c'
--- a/src/window.c      2011-06-07 09:26:21 +0000
+++ b/src/window.c      2011-06-07 12:51:07 +0000
@@ -2001,9 +2001,9 @@
   /* 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 @@
         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 @@
   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;
 }

=== modified file 'src/window.h'
--- a/src/window.h      2011-06-07 09:26:21 +0000
+++ b/src/window.h      2011-06-07 12:51:07 +0000
@@ -770,7 +770,7 @@
 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 *);


reply via email to

[Prev in Thread] Current Thread [Next in Thread]