]> git.eshelyaron.com Git - emacs.git/commitdiff
project-query-replace-regexp: Filter out non-regular files
authorDmitry Gutov <dgutov@yandex.ru>
Sat, 4 Jun 2022 00:13:42 +0000 (03:13 +0300)
committerDmitry Gutov <dgutov@yandex.ru>
Sat, 4 Jun 2022 00:13:42 +0000 (03:13 +0300)
* lisp/progmodes/project.el (project-query-replace-regexp):
Filter out non-regular files (bug#55382).

lisp/progmodes/project.el

index 4dc4762176a01c77fd567a834ff1e47d41739bdd..6e0874bfc32d1504820975b0d00105aa02e1c71d 100644 (file)
@@ -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)