Subject: Re: bug#76317: Emacs 31.0.50 4b28c41c4f2b on feature/igc branch; :window-sides-vertical doesn't take effect

From: martin rudalics <[email-masked]>
Date: Sun, 16 Feb 2025 11:09:36 +0100

>> (defun show-side-window ()
 >>    (display-buffer-in-side-window
 >>      (get-buffer "~/.emacs.d/init.el")
 >>      '((side . left)
 >>         (slot . 0)))
 >>    (display-buffer-in-side-window
 >>      (get-buffer "~/.emacs.d/init.el")
 >>      '((side . bottom)
 >>         (slot . 0))))
 >>
 >> (progn
 >>    (setq window-sides-vertical nil)
 >>    (show-side-window)) ;;; eval this first,  I expect left side window
 >> occupy full height, and yes.

No.  When 'window-sides-vertical' is nil, the bottom side window should
occupy full width.  The bug is here.

 >> (progn
 >>    (setq window-sides-vertical t)
 >>    (show-side-window)) ;; then eval this, I expect bottom window occupy
 >> full width, but not???
 >> ```
 >>
 >> I expect window-sides-vertical can control bottom side window occupy
 >> full frame width, but not. I think this is a bug.

OTOH this is OK.

The bug was introduced with the fix for Bug#73627, the release version
should not have it.  Please try the attached patch.

Thanks, martin
diff --git a/lisp/window.el b/lisp/window.el
index 290b5cae64d..1204103e83c 100644
--- a/lisp/window.el
+++ b/lisp/window.el
@@ -1003,6 +1003,7 @@ window--make-major-side-window
 	 ;; 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 @@ split-window
        ;; 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)))