summaryrefslogtreecommitdiff
path: root/lisp/vc/ediff-util.el
diff options
context:
space:
mode:
authorPo Lu <luangruo@yahoo.com>2021-12-16 17:57:56 +0800
committerPo Lu <luangruo@yahoo.com>2021-12-16 17:57:56 +0800
commit32b9b22f66b1afcc614d5f76860d56d5630c5bc4 (patch)
tree5ce3d153e5b772c00855a0798c212462d4ae2ff2 /lisp/vc/ediff-util.el
parent81d2e846a801a45befe911146469a983af8438c6 (diff)
parent0b43e7a49327ce32c67648eb898551002f135ef5 (diff)
downloademacs-32b9b22f66b1afcc614d5f76860d56d5630c5bc4.tar.gz
emacs-32b9b22f66b1afcc614d5f76860d56d5630c5bc4.tar.bz2
emacs-32b9b22f66b1afcc614d5f76860d56d5630c5bc4.zip
Merge remote-tracking branch 'origin/master' into feature/pgtk
Diffstat (limited to 'lisp/vc/ediff-util.el')
-rw-r--r--lisp/vc/ediff-util.el20
1 files changed, 19 insertions, 1 deletions
diff --git a/lisp/vc/ediff-util.el b/lisp/vc/ediff-util.el
index d4660a179e6..c2b08bd31af 100644
--- a/lisp/vc/ediff-util.el
+++ b/lisp/vc/ediff-util.el
@@ -521,7 +521,25 @@ to invocation.")
(erase-buffer)
(ediff-set-help-message)
(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)
(ediff-indent-help-message))
(ediff-set-help-overlays)