aboutsummaryrefslogtreecommitdiff
path: root/projectile.el
diff options
context:
space:
mode:
authorBozhidar Batsov <bozhidar@batsov.dev>2026-02-14 12:42:37 +0200
committerBozhidar Batsov <bozhidar@batsov.dev>2026-02-14 12:42:37 +0200
commit20228dd981f4467be1033dfad1cfe13d2aa9be9b (patch)
tree5741de529edc6a633ae7be34e4b758e5d4957f92 /projectile.el
parenta7223f2015b7d3bd7930997f9966c92b1cd83471 (diff)
Fix projectile-replace on Emacs 27+ (#1748, #1741)
Two bugs in projectile-replace: 1. fileloop is autoloaded but never required, so (fboundp #'fileloop-continue) returns nil and the function falls back to the legacy Emacs 25/26 code path even on Emacs 27+. Fix by requiring fileloop before the check. 2. fileloop-initialize-replace expects a regexp, but projectile-replace is documented to do literal replacement. Fix by wrapping the search term with regexp-quote.
Diffstat (limited to 'projectile.el')
-rw-r--r--projectile.el3
1 files changed, 2 insertions, 1 deletions
diff --git a/projectile.el b/projectile.el
index 1f52080..ed78865 100644
--- a/projectile.el
+++ b/projectile.el
@@ -4960,9 +4960,10 @@ on which to run the replacement."
(projectile-prepend-project-name
(format "Replace %s with: " old-text))))
(files (projectile-files-with-string old-text directory file-ext)))
+ (require 'fileloop nil t)
(if (fboundp #'fileloop-continue)
;; Emacs 27+
- (progn (fileloop-initialize-replace old-text new-text files 'default)
+ (progn (fileloop-initialize-replace (regexp-quote old-text) new-text files 'default)
(fileloop-continue))
;; Emacs 25 and 26
;;