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))))
	 wind-A wind-B wind-C
	 shift)
    (if past-last-diff
	(ediff-jump-to-difference -1)
      (ediff-jump-to-difference diff-no))
    (setq wind-A ediff-window-A
	  wind-B ediff-window-B
	  wind-C ediff-window-C)
    (if arg
	(save-selected-window
	  (setq shift (- beg pt))
          (ediff-with-live-window wind-A
            (when past-last-diff (goto-char (point-max)))
            (ignore-errors (backward-char shift))
	    (recenter))
          (ediff-with-live-window wind-B
            (when past-last-diff (goto-char (point-max)))
            (ignore-errors (backward-char shift))
            (recenter))
	  (ediff-with-live-window wind-C
            (when past-last-diff (goto-char (point-max)))
            (ignore-errors (backward-char shift))
	    (recenter))))))