On 11.05.2022 23:50, Alex Broekhof wrote:
Hitting this error when trying to run project-query-replace-regexp.
The project I'm working under has git submodules, if that could cause
any issues? (Redacted some of the directories and search strings)
```
Debugger entered--Lisp error: (file-error "Read error" "Is a
directory" "/Users/x/x/x/common/x")
insert-file-contents("/Users/x/x/x/common/x" nil)
fileloop-next-file(t)
fileloop-continue()
project-query-replace-regexp("x::x::x::x" "y::y::y::y")
funcall-interactively(project-query-replace-regexp "x::x::x::x"
"y::y::y::y")
call-interactively(project-query-replace-regexp nil nil)
command-execute(project-query-replace-regexp)
Hi! This is arguably a but of the project-vc's project-files
implementation, but there's no obvious way to fix it without
compromising performance. And yes, it's related to submodules.
Try this patch please:
diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el
index 6c50135358..be9532b649 100644
--- a/lisp/progmodes/project.el
+++ b/lisp/progmodes/project.el
@@ -1088,7 +1088,9 @@ project-query-replace-regexp
(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
+ (cl-delete-if-not #'file-regular-p (project-files (project-current t)))
+ 'default)
(fileloop-continue))
(defvar compilation-read-command)