summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Rudalics <rudalics@gmx.at>2022-03-14 10:26:36 +0100
committerMartin Rudalics <rudalics@gmx.at>2022-03-14 10:26:36 +0100
commit15c61cb359bc0021f14fbcc5a2e0eb71fe0261ab (patch)
tree1f0ac88956c6cd1876627baa36293e200c22b1ff
parenta1fa3d24d7f96542530f30c28daf9bf8aaaeae13 (diff)
downloademacs-15c61cb359bc0021f14fbcc5a2e0eb71fe0261ab.tar.gz
Init 'rest' in 'balance-windows-2' (Bug#54380)
* lisp/window.el (balance-windows-2): Give 'rest' an initial value (Bug#54380).
-rw-r--r--lisp/window.el15
1 files changed, 8 insertions, 7 deletions
diff --git a/lisp/window.el b/lisp/window.el
index 54c9eee5f32..dd297a31698 100644
--- a/lisp/window.el
+++ b/lisp/window.el
@@ -5698,12 +5698,12 @@ right, if any."
;;; Balancing windows.
;; The following routine uses the recycled code from an old version of
-;; `window--resize-child-windows'. It's not very pretty, but coding it the way the
-;; new `window--resize-child-windows' code does would hardly make it any shorter or
-;; more readable (FWIW we'd need three loops - one to calculate the
-;; minimum sizes per window, one to enlarge or shrink windows until the
-;; new parent-size matches, and one where we shrink the largest/enlarge
-;; the smallest window).
+;; `window--resize-child-windows'. It's not very pretty, but coding it
+;; the way the new `window--resize-child-windows' code does would hardly
+;; make it any shorter or more readable (FWIW we'd need three loops -
+;; one to calculate the minimum sizes per window, one to enlarge or
+;; shrink windows until the new parent-size matches, and one where we
+;; shrink the largest/enlarge the smallest window).
(defun balance-windows-2 (window horizontal)
"Subroutine of `balance-windows-1'.
WINDOW must be a vertical combination (horizontal if HORIZONTAL
@@ -5714,9 +5714,10 @@ is non-nil)."
(first (window-child window))
(sub first)
(number-of-children 0)
+ (rest 0)
(parent-size (window-new-pixel window))
(total-sum parent-size)
- failed size sub-total sub-delta sub-amount rest)
+ failed size sub-total sub-delta sub-amount)
(while sub
(if (window-size-fixed-p sub horizontal)
(progn