Function: ediff-get-diff-posn

ediff-get-diff-posn is a byte-compiled function defined in ediff-util.el.gz.

Signature

(ediff-get-diff-posn BUF-TYPE POS &optional N CONTROL-BUF)

Source Code

;; Defined in /usr/src/emacs/lisp/vc/ediff-util.el.gz
;; Returns positions of difference sectors in the BUF-TYPE buffer.
;; BUF-TYPE should be a symbol -- `A', `B', or `C'.
;; POS is either `beg' or `end'--it specifies whether you want the position at
;; the beginning of a difference or at the end.
;;
;; The optional argument N says which difference (default:
;; `ediff-current-difference').  N is the internal difference number (1- what
;; the user sees).  The optional argument CONTROL-BUF says
;; which control buffer is in effect in case it is not the current
;; buffer.
(defun ediff-get-diff-posn (buf-type pos &optional n control-buf)
  (let (diff-overlay)
    (or control-buf
	(setq control-buf (current-buffer)))

    (ediff-with-current-buffer control-buf
      (or n  (setq n ediff-current-difference))
      (if (or (< n 0) (>= n ediff-number-of-differences))
	  (if (> ediff-number-of-differences 0)
	      (error ediff-BAD-DIFF-NUMBER
		     this-command (1+ n) ediff-number-of-differences)
	    (error ediff-NO-DIFFERENCES)))
      (setq diff-overlay (ediff-get-diff-overlay n buf-type)))
    (if (not (ediff-buffer-live-p (overlay-buffer diff-overlay)))
	(error ediff-KILLED-VITAL-BUFFER))
    (if (eq pos 'beg)
	(ediff-overlay-start diff-overlay)
      (ediff-overlay-end diff-overlay))
    ))