Function: refer-find-entry-in-file

refer-find-entry-in-file is a byte-compiled function defined in refer.el.gz.

Signature

(refer-find-entry-in-file KEYWORDS-LIST FILE &optional OLD-POS)

Source Code

;; Defined in /usr/src/emacs/lisp/textmodes/refer.el.gz
(defun refer-find-entry-in-file (keywords-list file &optional old-pos)
   (message "Scanning %s..." file)
   (expand-file-name file)
   (set-buffer (find-file-noselect file))
   (find-file file)
   (if (not old-pos)
       (goto-char (point-min))
     (goto-char old-pos)
     (forward-paragraph 1))
   (let ((begin (point))
         (end 0)
         (found nil))
     (while (and (not found)
                 (not (eobp)))
       (forward-paragraph 1)
       (setq end (point))
       (setq found
             (seq-every-p (lambda (keyword)
                            (goto-char begin)
                            (re-search-forward keyword end t))
                          keywords-list))
       (if (not found)
           (progn
             (setq begin end)
             (goto-char begin))))
     (if found
         (progn (goto-char begin)
                (re-search-forward "\\W" nil t)
                (message "Scanning %s... found" file))
       (progn (message "Scanning %s... not found" file)
              nil))))