aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDmitry Gutov2026-01-24 06:45:00 +0200
committerDmitry Gutov2026-01-24 06:45:32 +0200
commitb7d4681908ff1615501e4b83a4e44c61928a8a9b (patch)
tree45ace245cc507328cb27a93507327b5088d30ae7
parent3b547e4f5dc99dc157b52a059cf234f7a5d15112 (diff)
downloademacs-b7d4681908ff1615501e4b83a4e44c61928a8a9b.tar.gz
emacs-b7d4681908ff1615501e4b83a4e44c61928a8a9b.zip
Stop project-query-replace-regexp failing on directory symlinks
* lisp/progmodes/project.el (project--files-safe): New function. (project-search, project-query-replace-regexp): Use it (bug#78209).
-rw-r--r--lisp/progmodes/project.el13
1 files changed, 9 insertions, 4 deletions
diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el
index bea41c55760..b9b2f84a824 100644
--- a/lisp/progmodes/project.el
+++ b/lisp/progmodes/project.el
@@ -177,9 +177,9 @@
177(require 'cl-generic) 177(require 'cl-generic)
178(require 'cl-lib) 178(require 'cl-lib)
179(require 'seq) 179(require 'seq)
180(require 'generator)
180(eval-when-compile (require 'subr-x)) 181(eval-when-compile (require 'subr-x))
181 182 (defgroup project nil
182(defgroup project nil
183 "Operations on the current project." 183 "Operations on the current project."
184 :version "28.1" 184 :version "28.1"
185 :group 'tools) 185 :group 'tools)
@@ -1593,6 +1593,11 @@ create it if it doesn't already exist."
1593 1593
1594(declare-function fileloop-continue "fileloop" ()) 1594(declare-function fileloop-continue "fileloop" ())
1595 1595
1596(iter-defun project--files-safe ()
1597 (dolist (file (project-files (project-current t)))
1598 (when (file-regular-p file)
1599 (iter-yield file))))
1600
1596;;;###autoload 1601;;;###autoload
1597(defun project-search (regexp) 1602(defun project-search (regexp)
1598 "Search for REGEXP in all the files of the project. 1603 "Search for REGEXP in all the files of the project.
@@ -1602,7 +1607,7 @@ command \\[fileloop-continue]."
1602 (interactive "sSearch (regexp): ") 1607 (interactive "sSearch (regexp): ")
1603 (fileloop-initialize-search 1608 (fileloop-initialize-search
1604 regexp 1609 regexp
1605 (project-files (project-current t)) 1610 (project--files-safe)
1606 'default) 1611 'default)
1607 (fileloop-continue)) 1612 (fileloop-continue))
1608 1613
@@ -1623,7 +1628,7 @@ If you exit the `query-replace', you can later continue the
1623 (list from to)))) 1628 (list from to))))
1624 (fileloop-initialize-replace 1629 (fileloop-initialize-replace
1625 from to 1630 from to
1626 (project-files (project-current t)) 1631 (project--files-safe)
1627 'default) 1632 'default)
1628 (fileloop-continue)) 1633 (fileloop-continue))
1629 1634