[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master e7a6d6a: Merge from origin/emacs-28

From: Stefan Kangas
Subject: master e7a6d6a: Merge from origin/emacs-28
Date: Thu, 16 Dec 2021 00:51:50 -0500 (EST)

branch: master
commit e7a6d6a546e7e56e5a721aac86a19473e4303111
Merge: ab33404 1e57826
Author: Stefan Kangas <stefan@marxist.se>
Commit: Stefan Kangas <stefan@marxist.se>

    Merge from origin/emacs-28
    1e578267fb Fix control buffer window height in 'ediff-setup-control-b...
 lisp/vc/ediff-util.el | 20 +++++++++++++++++++-
 1 file changed, 19 insertions(+), 1 deletion(-)

diff --git a/lisp/vc/ediff-util.el b/lisp/vc/ediff-util.el
index d4660a1..c2b08bd 100644
--- a/lisp/vc/ediff-util.el
+++ b/lisp/vc/ediff-util.el
@@ -521,7 +521,25 @@ to invocation.")
     (insert ediff-help-message)
-    (shrink-window-if-larger-than-buffer)
+    ;; With the fix for Bug#49277 and an 'ediff-setup-windows-plain'
+    ;; layout, the window of the control buffer we want to adjust here
+    ;; is no longer the lower of two windows on their frame both showing
+    ;; that control buffer but rather the bottom-most window in the
+    ;; established ediff layout for that frame.  As a consequence,
+    ;; 'shrink-window-if-larger-than-buffer' will fail to show the whole
+    ;; buffer with 'ediff-toggle-help' because that window's maximum
+    ;; height is not half the height of its frame but the height of the
+    ;; control buffer's window in the established layout (Bug#52504).
+    ;;
+    ;; The form below is an attempt to emulate the behavior of Emacs 27
+    ;; as faithfully as possible in this regard (the use of 'ceiling'
+    ;; mimics the behavior of 'split-window' giving the lower window the
+    ;; residue line when the window to split has an uneven number of
+    ;; lines).
+    (when (and (window-combined-p)
+              (pos-visible-in-window-p (point-min)))
+      (fit-window-to-buffer
+       nil (ceiling (/ (window-total-height (frame-root-window)) 2.0))))
     (or (ediff-multiframe-setup-p)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]