]> git.eshelyaron.com Git - emacs.git/commitdiff
Have 'split-window' forget previous window height (Bug#78835)
authorMartin Rudalics <rudalics@gmx.at>
Fri, 20 Jun 2025 06:51:58 +0000 (08:51 +0200)
committerEshel Yaron <me@eshelyaron.com>
Sun, 22 Jun 2025 08:08:37 +0000 (10:08 +0200)
* 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).

(cherry picked from commit 60a567af8697dba07b59969196faa0e368a9764b)

lisp/window.el

index 60ccc4c839da965169e792cda691ee6c1cd3b843..79babd43d6f93d405ca40563f677a91b5a092eca 100644 (file)
@@ -5847,6 +5847,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)