Function: ediff-recenter-one-window

ediff-recenter-one-window is a byte-compiled function defined in ediff-util.el.gz.

Signature

(ediff-recenter-one-window BUF-TYPE)

Source Code

;; Defined in /usr/src/emacs/lisp/vc/ediff-util.el.gz
;; this function returns to the window it was called from
;; (which was the control window)
(defun ediff-recenter-one-window (buf-type)
  (if (ediff-valid-difference-p)
      ;; context must be saved before switching to windows A/B/C
      (let* ((ctl-wind (selected-window))
	     (shift (ediff-overlay-start
		     (ediff-get-value-according-to-buffer-type
		      buf-type ediff-narrow-bounds)))
	     (job-name ediff-job-name)
	     (control-buf ediff-control-buffer)
	     (window-name (ediff-get-symbol-from-alist
			   buf-type ediff-window-alist))
	     (window (if (window-live-p (symbol-value window-name))
			 (symbol-value window-name))))

	(if (and window ediff-windows-job)
	    (set-window-start window shift))
	(if window
	    (progn
	      (select-window window)
	      (deactivate-mark)
	      (ediff-position-region
	       (ediff-get-diff-posn buf-type 'beg nil control-buf)
	       (ediff-get-diff-posn buf-type 'end nil control-buf)
	       (ediff-get-diff-posn buf-type 'beg nil control-buf)
	       job-name
	       )))
	(select-window ctl-wind)
	)))