When ignoring parameters let 'split-window' split root window (Bug#76317)

This fixes a behavior introduced by the fix of Bug#73527 that splits the
main window when the caller asks for splitting the root window.

* lisp/window.el (window--make-major-side-window): Bind
'ignore-window-parameters' to t so 'split-window' won't mess
with the WINDOW argument when it specifies the root window.
(split-window): If 'ignore-window-parameters' is non-nil, don't
try to split the main window instead of the root window.
This commit is contained in:
Martin Rudalics 2025-02-17 09:29:37 +01:00
parent 2d59974da7
commit 310f62a948

View file

@ -1003,6 +1003,7 @@ and may be called only if no window on SIDE exists yet."
;; window and not make a new parent window unless needed.
(window-combination-resize 'side)
(window-combination-limit nil)
(ignore-window-parameters t)
(window (split-window-no-error next-to nil on-side))
(alist (if (assq 'dedicated alist)
alist
@ -5649,6 +5650,7 @@ changed by this function."
;; frame's root window, split the frame's main window instead
;; (Bug#73627).
((and (eq window (frame-root-window frame))
(not ignore-window-parameters)
(window-with-parameter 'window-side nil frame))
(throw 'done (split-window (window-main-window frame)
size side pixelwise refer)))