From: Dmitry Gutov Date: Sat, 4 Jun 2022 00:13:42 +0000 (+0300) Subject: project-query-replace-regexp: Filter out non-regular files X-Git-Tag: emacs-29.0.90~1910^2~255 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=db82347269373793107b762d8c3de6b725eaf717;p=emacs.git project-query-replace-regexp: Filter out non-regular files * lisp/progmodes/project.el (project-query-replace-regexp): Filter out non-regular files (bug#55382). --- diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el index 4dc4762176a..6e0874bfc32 100644 --- a/lisp/progmodes/project.el +++ b/lisp/progmodes/project.el @@ -1092,7 +1092,12 @@ If you exit the `query-replace', you can later continue the (query-replace-read-args "Query replace (regexp)" t t))) (list from to)))) (fileloop-initialize-replace - from to (project-files (project-current t)) 'default) + from to + ;; XXX: Filter out Git submodules, which are not regular files. + ;; `project-files' can return those, which is arguably suboptimal, + ;; but removing them eagerly has performance cost. + (cl-delete-if-not #'file-regular-p (project-files (project-current t))) + 'default) (fileloop-continue)) (defvar compilation-read-command)