bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#55382: 28.1; "fileloop-next-file: Read error: Is a directory" when r


From: Dmitry Gutov
Subject: bug#55382: 28.1; "fileloop-next-file: Read error: Is a directory" when running project-query-replace-regexp
Date: Sun, 15 May 2022 04:57:14 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.1

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)





reply via email to

[Prev in Thread] Current Thread [Next in Thread]