bug#81406: 31.0.90; rotate-windows loses window balance when window-combination-resize is t

Pranshu <[email protected]> Sun, 2 Aug 2026 16:42:15 +1000
Newsgroups gmane.emacs.bugs
Message-ID <CADqFYwbN0McLhM4uruxGxeR0k8t8gY4-P5KOF4gqisjev6U1Xw@mail.gmail.com>
> I added this comment for the case that if someone eventually wants to
> rotate dedicated windows, there's no technical reason against it.
> Currently, if we have two windows, one dedicated one not, what are we
> supposed to do?  With emacs -Q
>
> (progn
>    (split-window)
>    (set-window-dedicated-p nil t)
>    (rotate-windows))
>
> gets me

I think we need to add a error after lines 183-191

(winls (or
                 (seq-filter
                  (lambda (win)
                    (and (window-live-p win)
                         (not (window-dedicated-p win))))
                  (flatten-list win-tree))
                 ;; Do we really care - the window/buffer relationship
                 ;; should not be affected by rotating.
                 (user-error "All windows are dedicated")))

Which would be like (unless (cdr winls) (user-error "Not enough
windows to rotate."))

We could also add custom user variable that allows for rotating
dedicated windows, if we do I think it should be a value such that:
- nil = don't rotate dedicated windows
- 1 = only rotate dedicated windows if all windows are dedicated
- 2 = rotate dedicated windows if only one window is not dedicated
- t = always rotate dedicated windows

Or we could make this a prefix argument. But in my opinion this would
be overengineering, as the user can simply just un dedicate the window
of their use case get's more complex