bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#54380: 29.0.50; Unexpected nil value of 'rest' in 'balance-windows-2


From: Matt Beshara
Subject: bug#54380: 29.0.50; Unexpected nil value of 'rest' in 'balance-windows-2'
Date: Mon, 14 Mar 2022 13:43:36 +1100
User-agent: mu4e 1.6.10; emacs 29.0.50

Attempting to use ‘balance-windows’ in a frame displaying many windows, two of which are displaying buffers which both have the buffer-local variable ‘window-size-fixed’ set to t, fails with the error “Wrong type argument: number-or-marker-p, nil”. This error is produced by line 5765 of window.el, “(while (and sub (> rest 0))”. It appears that the code in this function always expects ‘rest’ to have a non-nil value, but in this case ‘rest’ is nil. Modifying line 5765 to read “(while (and sub rest (> rest 0))” so that it checks ‘rest’ is non-nil before attemping to call ‘>’ seems to fix it. I haven’t attached a patch as a patch for a one-line diff seems excessive, but if it would be useful, I can provide one.

Steps to replicate:
1. emacs -Q
2. C-x 2
3. C-x o
4. C-u 10 M-x shrink-window
5. M-: (setq-local window-size-fixed t)
6. C-x o
7. C-x b *Messages*
8. C-x 3
9. C-x o
10. C-x C-f /tmp/test
11. C-u 10 C-x {
12. M-: (setq-local window-size-fixed t)
13. C-x o
14. C-x o
15. C-x 2
16. C-x 2
17. C-x 2
18. C-x 3
19. C-x 3
20. M-x balance-windows-area ;; This works as one would expect
21. M-x balance-windows      ;; This produces an error





reply via email to

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