summaryrefslogtreecommitdiff
path: root/lisp/vc/ediff-wind.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/vc/ediff-wind.el')
-rw-r--r--lisp/vc/ediff-wind.el92
1 files changed, 38 insertions, 54 deletions
diff --git a/lisp/vc/ediff-wind.el b/lisp/vc/ediff-wind.el
index fc6ea944ae1..bc6aa288508 100644
--- a/lisp/vc/ediff-wind.el
+++ b/lisp/vc/ediff-wind.el
@@ -89,25 +89,25 @@ provided functions are written."
(function :tag "Other function"))
:version "24.3")
-;; indicates if we are in a multiframe setup
-(ediff-defvar-local ediff-multiframe nil "")
-
-;; Share of the frame occupied by the merge window (buffer C)
-(ediff-defvar-local ediff-merge-window-share 0.45 "")
-
-;; The control window.
-(ediff-defvar-local ediff-control-window nil "")
-;; Official window for buffer A
-(ediff-defvar-local ediff-window-A nil "")
-;; Official window for buffer B
-(ediff-defvar-local ediff-window-B nil "")
-;; Official window for buffer C
-(ediff-defvar-local ediff-window-C nil "")
-;; Official window for buffer Ancestor
-(ediff-defvar-local ediff-window-Ancestor nil "")
-;; Ediff's window configuration.
-;; Used to minimize the need to rearrange windows.
-(ediff-defvar-local ediff-window-config-saved "" "")
+(ediff-defvar-local ediff-multiframe nil
+ "Indicates if we are in a multiframe setup.")
+
+(ediff-defvar-local ediff-merge-window-share 0.45
+ "Share of the frame occupied by the merge window (buffer C).")
+
+(ediff-defvar-local ediff-control-window nil
+ "The control window.")
+(ediff-defvar-local ediff-window-A nil
+ "Official window for buffer A.")
+(ediff-defvar-local ediff-window-B nil
+ "Official window for buffer B.")
+(ediff-defvar-local ediff-window-C nil
+ "Official window for buffer C.")
+(ediff-defvar-local ediff-window-Ancestor nil
+ "Official window for buffer Ancestor.")
+(ediff-defvar-local ediff-window-config-saved ""
+ "Ediff's window configuration.
+Used to minimize the need to rearrange windows.")
;; Association between buff-type and ediff-window-*
(defconst ediff-window-alist
@@ -176,9 +176,9 @@ In this case, Ediff will use those frames to display these buffers."
"Frame parameters for displaying Ediff Control Panel.
Used internally---not a user option.")
-;; position of the mouse; used to decide whether to warp the mouse into ctl
-;; frame
-(ediff-defvar-local ediff-mouse-pixel-position nil "")
+(ediff-defvar-local ediff-mouse-pixel-position nil
+ "Position of the mouse.
+Used to decide whether to warp the mouse into control frame.")
;; not used for now
(defvar ediff-mouse-pixel-threshold 30
@@ -227,12 +227,10 @@ customization of the default."
;; Wide frame display
-;; t means Ediff is using wide display
-(ediff-defvar-local ediff-wide-display-p nil "")
-;; keeps frame config for toggling wide display
+(ediff-defvar-local ediff-wide-display-p nil
+ "If t, Ediff is using wide display.")
(ediff-defvar-local ediff-wide-display-orig-parameters nil
- "Frame parameters to be restored when the user wants to toggle the wide
-display off.")
+ "Frame parameters to restore when toggling the wide display off.")
(ediff-defvar-local ediff-wide-display-frame nil
"Frame to be used for wide display.")
(ediff-defvar-local ediff-make-wide-display-function #'ediff-make-wide-display
@@ -243,8 +241,8 @@ frame parameters in `ediff-wide-display-orig-parameters'.
The variable `ediff-wide-display-frame' should be set to contain
the frame used for the wide display.")
-;; Frame used for the control panel in a windowing system.
-(ediff-defvar-local ediff-control-frame nil "")
+(ediff-defvar-local ediff-control-frame nil
+ "Frame used for the control panel in a windowing system.")
(defcustom ediff-prefer-iconified-control-frame nil
"If t, keep control panel iconified when help message is off.
@@ -400,7 +398,8 @@ keyboard input to go into icons."
;; skip dedicated and unsplittable frames
(ediff-destroy-control-frame control-buffer)
(let ((window-min-height 1)
- split-window-function wind-width-or-height
+ (window-combination-resize t)
+ split-window-function
three-way-comparison
wind-A-start wind-B-start wind-A wind-B wind-C)
(with-current-buffer control-buffer
@@ -419,22 +418,12 @@ keyboard input to go into icons."
(select-window (next-window nil 'ignore-minibuf)))
(delete-other-windows)
(set-window-dedicated-p (selected-window) nil)
- (split-window-vertically)
- (ediff-select-lowest-window)
- (ediff-setup-control-buffer control-buffer)
;; go to the upper window and split it betw A, B, and possibly C
(other-window 1)
(switch-to-buffer buf-A)
(setq wind-A (selected-window))
- (if three-way-comparison
- (setq wind-width-or-height
- (/ (if (eq split-window-function #'split-window-vertically)
- (window-height wind-A)
- (window-width wind-A))
- 3)))
-
- (funcall split-window-function wind-width-or-height)
+ (funcall split-window-function)
(if (eq (selected-window) wind-A)
(other-window 1))
@@ -443,7 +432,7 @@ keyboard input to go into icons."
(if three-way-comparison
(progn
- (funcall split-window-function) ; equally
+ (funcall split-window-function)
(if (eq (selected-window) wind-B)
(other-window 1))
(switch-to-buffer buf-C)
@@ -461,7 +450,9 @@ keyboard input to go into icons."
(set-window-start wind-A wind-A-start)
(set-window-start wind-B wind-B-start)))
- (ediff-select-lowest-window)
+ (select-window (display-buffer-in-direction
+ control-buffer
+ '((direction . bottom))))
(ediff-setup-control-buffer control-buffer)
))
@@ -746,6 +737,7 @@ keyboard input to go into icons."
(and (not (frame-live-p frame-A))
(or ctl-frame-exists-p
(eq frame-B (selected-frame))))))
+ (window-combination-resize t)
wind-A-start wind-B-start
designated-minibuffer-frame)
@@ -758,7 +750,7 @@ keyboard input to go into icons."
'B ediff-narrow-bounds))))
(if use-same-frame
- (let (wind-width-or-height) ; this affects 3way setups only
+ (progn
(if (and (eq frame-A frame-B) (frame-live-p frame-A))
(select-frame frame-A)
;; avoid dedicated and non-splittable windows
@@ -767,15 +759,7 @@ keyboard input to go into icons."
(switch-to-buffer buf-A)
(setq wind-A (selected-window))
- (if three-way-comparison
- (setq wind-width-or-height
- (/
- (if (eq split-window-function #'split-window-vertically)
- (window-height wind-A)
- (window-width wind-A))
- 3)))
-
- (funcall split-window-function wind-width-or-height)
+ (funcall split-window-function)
(if (eq (selected-window) wind-A)
(other-window 1))
(switch-to-buffer buf-B)
@@ -858,7 +842,7 @@ keyboard input to go into icons."
(defun ediff-skip-unsuitable-frames (&optional ok-unsplittable)
"Skip unsplittable frames and frames that have dedicated windows.
-create a new splittable frame if none is found."
+Create a new splittable frame if none is found."
(if (ediff-window-display-p)
(let ((wind-frame (window-frame))
seen-windows)