XEmacs 21.4.15
[chise/xemacs-chise.git.1] / src / window.c
index 7df253c..680c7b8 100644 (file)
@@ -2109,9 +2109,13 @@ will automatically call `save-buffers-kill-emacs'.)
   else if (!NILP (w->vchild))
     delete_all_subwindows (XWINDOW (w->vchild));
 
+  /* Warning: mark_window_as_deleted calls window_unmap_subwindows and
+     therefore redisplay, so it requires the mirror structure to be
+     correct.  We must dirty the mirror before it is called.  */
+  f->mirror_dirty = 1;
+
   mark_window_as_deleted (w);
 
-  f->mirror_dirty = 1;
   return Qnil;
 }
 
@@ -3654,8 +3658,9 @@ make_dummy_parent (Lisp_Object window)
 DEFUN ("split-window", Fsplit_window, 0, 3, "", /*
 Split WINDOW, putting SIZE lines in the first of the pair.
 WINDOW defaults to the selected one and SIZE to half its size.
-If optional third arg HORFLAG is non-nil, split side by side
-and put SIZE columns in the first of the pair.
+If optional third arg HORFLAG is non-nil, split side by side and put
+SIZE columns in the first of the pair. The newly created window is
+returned.
 */
        (window, size, horflag))
 {
@@ -3679,7 +3684,7 @@ and put SIZE columns in the first of the pair.
        /* In the new scheme, we are symmetric with respect to separators
           so there is no need to do weird things here. */
        {
-         psize = WINDOW_WIDTH (o) >> 1;
+         psize = (WINDOW_WIDTH (o) + window_divider_width (o)) >> 1;
          csize = window_pixel_width_to_char_width (o, psize, 0);
         }
       else