From 60a567af8697dba07b59969196faa0e368a9764b Mon Sep 17 00:00:00 2001 From: Martin Rudalics Date: Fri, 20 Jun 2025 08:51:58 +0200 Subject: [PATCH] Have 'split-window' forget previous window height (Bug#78835) * lisp/window.el (split-window): When WINDOW has a 'quit-restore' parameter that specifies a previous height to restore, remove that when splitting vertically. It does more harm than good now (Bug#78835). --- lisp/window.el | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lisp/window.el b/lisp/window.el index e372ef8b9bb..f24e581ba1e 100644 --- a/lisp/window.el +++ b/lisp/window.el @@ -5899,6 +5899,16 @@ changed by this function." window (- (if new-parent 1.0 (window-normal-size window horizontal)) new-normal))) + (unless horizontal + (let ((quit-restore (window-parameter window 'quit-restore))) + (when quit-restore + (let ((quad (nth 1 quit-restore))) + (when (and (listp quad) (integerp (nth 3 quad))) + ;; When WINDOW has a 'quit-restore' parameter that + ;; specifies a previous height to restore, remove that + ;; - it does more harm than good now (Bug#78835). + (setf (nth 3 quad) nil)))))) + (let ((new (split-window-internal window new-pixel-size side new-normal refer))) (window--pixel-to-total frame horizontal)