1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-11-27 07:37:33 +00:00

Init 'rest' in 'balance-windows-2' (Bug#54380)

* lisp/window.el (balance-windows-2): Give 'rest' an initial
value (Bug#54380).
This commit is contained in:
Martin Rudalics 2022-03-14 10:26:36 +01:00
parent a1fa3d24d7
commit 15c61cb359

View File

@ -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