Function: diff-find-text
diff-find-text is a byte-compiled function defined in diff-mode.el.gz.
Signature
(diff-find-text TEXT)
Documentation
Return the buffer position (BEG . END) of the nearest occurrence of TEXT.
If TEXT isn't found, nil is returned.
Source Code
;; Defined in /usr/src/emacs/lisp/vc/diff-mode.el.gz
(defun diff-find-text (text)
"Return the buffer position (BEG . END) of the nearest occurrence of TEXT.
If TEXT isn't found, nil is returned."
(let* ((orig (point))
(forw (and (search-forward text nil t)
(cons (match-beginning 0) (match-end 0))))
(back (and (goto-char (+ orig (length text)))
(search-backward text nil t)
(cons (match-beginning 0) (match-end 0)))))
;; Choose the closest match.
(if (and forw back)
(if (> (- (car forw) orig) (- orig (car back))) back forw)
(or back forw))))