Function: ediff-jump-to-difference-at-point
ediff-jump-to-difference-at-point is an interactive and byte-compiled
function defined in ediff-util.el.gz.
Signature
(ediff-jump-to-difference-at-point ARG)
Documentation
Go to difference closest to the point in buffer A, B, or C.
The buffer depends on last command character (a, b, or c) that invoked this
command. For instance, if the command was ga then the point value in buffer
A is used.
With a prefix argument ARG, synchronize all files around the current point position in the specified buffer.
Key Bindings
Source Code
;; Defined in /usr/src/emacs/lisp/vc/ediff-util.el.gz
(defun ediff-jump-to-difference-at-point (arg)
"Go to difference closest to the point in buffer A, B, or C.
The buffer depends on last command character \(a, b, or c) that invoked this
command. For instance, if the command was `ga' then the point value in buffer
A is used.
With a prefix argument ARG, synchronize all files around the
current point position in the specified buffer."
(interactive "P")
(ediff-barf-if-not-control-buffer)
(let* ((buf-type (ediff-char-to-buftype last-command-event))
(buffer (ediff-get-buffer buf-type))
(pt (ediff-with-current-buffer buffer (point)))
(diff-no (ediff-diff-at-point buf-type nil (if arg 'after)))
(past-last-diff (< ediff-number-of-differences diff-no))
(beg (if past-last-diff
(ediff-with-current-buffer buffer (point-max))
(ediff-get-diff-posn buf-type 'beg (1- diff-no))))
ctl-wind wind-A wind-B wind-C
shift)
(if past-last-diff
(ediff-jump-to-difference -1)
(ediff-jump-to-difference diff-no))
(setq ctl-wind (selected-window)
wind-A ediff-window-A
wind-B ediff-window-B
wind-C ediff-window-C)
(if arg
(progn
(ediff-with-current-buffer buffer
(setq shift (- beg pt)))
(select-window wind-A)
(if past-last-diff (goto-char (point-max)))
(condition-case nil
(backward-char shift) ; noerror, if beginning of buffer
(error))
(recenter)
(select-window wind-B)
(if past-last-diff (goto-char (point-max)))
(condition-case nil
(backward-char shift) ; noerror, if beginning of buffer
(error))
(recenter)
(if (window-live-p wind-C)
(progn
(select-window wind-C)
(if past-last-diff (goto-char (point-max)))
(condition-case nil
(backward-char shift) ; noerror, if beginning of buffer
(error))
(recenter)
))
(select-window ctl-wind)
))
))