Fix Bugs 16351 and 16383 when rounding in balance-windows-2.
authorMartin Rudalics <rudalics@gmx.at>
Tue, 7 Jan 2014 17:16:24 +0000 (18:16 +0100)
committerMartin Rudalics <rudalics@gmx.at>
Tue, 7 Jan 2014 17:16:24 +0000 (18:16 +0100)
* window.el (balance-windows-2): While rounding don't give a
window more than the remainder.  Bug#16351, Bug#16383.

lisp/ChangeLog
lisp/window.el

index 88afaec..add146f 100644 (file)
@@ -1,3 +1,8 @@
+2014-01-07  Martin Rudalics  <rudalics@gmx.at>
+
+       * window.el (balance-windows-2): While rounding don't give a
+       window more than the remainder.  Bug#16351, Bug#16383.
+
 2014-01-07  Glenn Morris  <rgm@gnu.org>
 
        * menu-bar.el (menu-bar-help-extra-packages): Remove.
index 6ecb55a..d1d8a5e 100644 (file)
@@ -4541,7 +4541,7 @@ is non-nil)."
     (setq sub first)
     (while (and sub (> rest 0))
       (unless (window--resize-child-windows-skip-p window)
-       (set-window-new-pixel sub char-size t)
+       (set-window-new-pixel sub (min rest char-size) t)
        (setq rest (- rest char-size)))
       (setq sub (window-right sub)))
 
@@ -4550,7 +4550,7 @@ is non-nil)."
     (setq sub first)
     (while (and sub (> rest 0))
       (unless (eq (window-new-normal sub) 'ignore)
-       (set-window-new-pixel sub char-size t)
+       (set-window-new-pixel sub (min rest char-size) t)
        (setq rest (- rest char-size)))
       (setq sub (window-right sub)))