aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/dired-aux.el21
1 files changed, 14 insertions, 7 deletions
diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el
index fb1ad6266d6..ce967b0735f 100644
--- a/lisp/dired-aux.el
+++ b/lisp/dired-aux.el
@@ -2957,6 +2957,8 @@ with the command \\[tags-loop-continue]."
2957 2957
2958(declare-function xref--show-xrefs "xref") 2958(declare-function xref--show-xrefs "xref")
2959(declare-function xref-query-replace-in-results "xref") 2959(declare-function xref-query-replace-in-results "xref")
2960(declare-function project--files-in-directory "project")
2961(declare-function project--find-regexp-in-files "project")
2960 2962
2961;;;###autoload 2963;;;###autoload
2962(defun dired-do-find-regexp (regexp) 2964(defun dired-do-find-regexp (regexp)
@@ -2975,19 +2977,24 @@ REGEXP should use constructs supported by your local `grep' command."
2975 (require 'xref) 2977 (require 'xref)
2976 (defvar grep-find-ignored-files) 2978 (defvar grep-find-ignored-files)
2977 (declare-function rgrep-find-ignored-directories "grep" (dir)) 2979 (declare-function rgrep-find-ignored-directories "grep" (dir))
2978 (let* ((files (dired-get-marked-files nil nil nil nil t)) 2980 (let* ((marks (dired-get-marked-files nil nil nil nil t))
2979 (ignores (nconc (mapcar 2981 (ignores (nconc (mapcar
2980 #'file-name-as-directory 2982 #'file-name-as-directory
2981 (rgrep-find-ignored-directories default-directory)) 2983 (rgrep-find-ignored-directories default-directory))
2982 grep-find-ignored-files)) 2984 grep-find-ignored-files))
2983 (fetcher 2985 (fetcher
2984 (lambda () 2986 (lambda ()
2985 (let ((xrefs (mapcan 2987 (let (files xrefs)
2986 (lambda (file) 2988 (mapc
2987 (xref-collect-matches regexp "*" file 2989 (lambda (mark)
2988 (and (file-directory-p file) 2990 (if (file-directory-p mark)
2989 ignores))) 2991 (setq files (nconc
2990 files))) 2992 (project--files-in-directory mark ignores "*")
2993 files))
2994 (push mark files)))
2995 (nreverse marks))
2996 (setq xrefs
2997 (project--find-regexp-in-files regexp files))
2991 (unless xrefs 2998 (unless xrefs
2992 (user-error "No matches for: %s" regexp)) 2999 (user-error "No matches for: %s" regexp))
2993 xrefs)))) 3000 xrefs))))