unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#54380: 29.0.50; Unexpected nil value of 'rest' in 'balance-windows-2'
@ 2022-03-14  2:43 Matt Beshara
  2022-03-14  9:30 ` martin rudalics
  0 siblings, 1 reply; 4+ messages in thread
From: Matt Beshara @ 2022-03-14  2:43 UTC (permalink / raw)
  To: 54380

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





^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-03-16  8:17 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-14  2:43 bug#54380: 29.0.50; Unexpected nil value of 'rest' in 'balance-windows-2' Matt Beshara
2022-03-14  9:30 ` martin rudalics
2022-03-15 10:20   ` Matt Beshara
2022-03-16  8:17     ` martin rudalics

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).