Function: battery-search-for-one-match-in-files

battery-search-for-one-match-in-files is a byte-compiled function defined in battery.el.gz.

Signature

(battery-search-for-one-match-in-files FILES REGEXP MATCH-NUM)

Documentation

Search REGEXP in the content of the files listed in FILES.

If a match occurred, return the parenthesized expression numbered by MATCH-NUM in the match. Otherwise, return nil.

Source Code

;; Defined in /usr/src/emacs/lisp/battery.el.gz
(defun battery-search-for-one-match-in-files (files regexp match-num)
  "Search REGEXP in the content of the files listed in FILES.
If a match occurred, return the parenthesized expression numbered by
MATCH-NUM in the match.  Otherwise, return nil."
  (with-temp-buffer
    (catch 'found
      (dolist (file files)
	(and (ignore-errors (insert-file-contents file nil nil nil 'replace))
	     (re-search-forward regexp nil t)
	     (throw 'found (match-string match-num)))))))