X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/169043d6625acab49a9a12fb046321d96036cb7d..96bd07a3226700156fa7d5ec20e9bd6550c95057:/lisp/dired-aux.el diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el index b23b04a45f..4732d9ce85 100644 --- a/lisp/dired-aux.el +++ b/lisp/dired-aux.el @@ -39,7 +39,6 @@ ;; We need macros in dired.el to compile properly, ;; and we call subroutines in it too. (require 'dired) -(require 'cl-lib) ; for cl-mapcan (defvar dired-create-files-failures nil "Variable where `dired-create-files' records failing file names. @@ -2747,16 +2746,23 @@ with the command \\[tags-loop-continue]." ;;;###autoload (defun dired-do-find-regexp (regexp) - "Find all matches for REGEXP in all marked files, recursively." + "Find all matches for REGEXP in all marked files. +For any marked directory, all of its files are searched recursively. +However, files matching `grep-find-ignored-files' and subdirectories +matching `grep-find-ignored-directories' are skipped in the marked +directories. + +REGEXP should use constructs supported by your local `grep' command." (interactive "sSearch marked files (regexp): ") (require 'grep) (defvar grep-find-ignored-files) + (defvar grep-find-ignored-directories) (let* ((files (dired-get-marked-files)) (ignores (nconc (mapcar (lambda (s) (concat s "/")) - vc-directory-exclusion-list) + grep-find-ignored-directories) grep-find-ignored-files)) - (xrefs (cl-mapcan + (xrefs (mapcan (lambda (file) (xref-collect-matches regexp "*" file (and (file-directory-p file) @@ -2768,7 +2774,13 @@ with the command \\[tags-loop-continue]." ;;;###autoload (defun dired-do-find-regexp-and-replace (from to) - "Replace matches of FROM with TO, in all marked files, recursively." + "Replace matches of FROM with TO, in all marked files. +For any marked directory, matches in all of its files are replaced, +recursively. However, files matching `grep-find-ignored-files' +and subdirectories matching `grep-find-ignored-directories' are skipped +in the marked directories. + +REGEXP should use constructs supported by your local `grep' command." (interactive (let ((common (query-replace-read-args