From 9978d3bce41c81f0f6358467a90b9d1d6c95c7a8 Mon Sep 17 00:00:00 2001 From: Martin Rudalics Date: Mon, 17 Feb 2025 09:29:37 +0100 Subject: [PATCH] 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. (cherry picked from commit 310f62a9489b9c00d5e60d2ab16e7dc54afcadb9) --- lisp/window.el | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lisp/window.el b/lisp/window.el index 4359c678540..88c569f684d 100644 --- a/lisp/window.el +++ b/lisp/window.el @@ -1002,6 +1002,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 @@ -5597,6 +5598,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))) -- 2.39.5