Function: project-or-external-find-regexp

project-or-external-find-regexp is an autoloaded, interactive and byte-compiled function defined in project.el.gz.

Signature

(project-or-external-find-regexp REGEXP)

Documentation

Find all matches for REGEXP in the project roots or external roots.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/project.el.gz
;;;###autoload
(defun project-or-external-find-regexp (regexp)
  "Find all matches for REGEXP in the project roots or external roots."
  (interactive (list (project--read-regexp)))
  (require 'xref)
  (let* ((pr (project-current t))
         (default-directory (project-root pr))
         ;; TODO: Make use of `project-files-relative-names' by
         ;; searching each root separately (maybe in parallel, too).
         (files
          (project-files pr (cons
                             (project-root pr)
                             (project-external-roots pr)))))
    (xref-show-xrefs
     (apply-partially #'project--find-regexp-in-files regexp files)
     nil)))