Skip to content

Commit

Permalink
Replace a version check with a presence check
Browse files Browse the repository at this point in the history
  • Loading branch information
bbatsov committed Oct 21, 2019
1 parent 6e30501 commit 2900fd0
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions projectile.el
Original file line number Diff line number Diff line change
Expand Up @@ -3480,7 +3480,9 @@ to run the replacement."
(projectile-prepend-project-name
(format "Replace %s with: " old-text))))
(files (projectile-files-with-string old-text directory)))
(if (version< emacs-version "27")
(if (fboundp #'fileloop-continue)
;; Emacs 25 and 26
;;
;; Adapted from `tags-query-replace' for literal strings (not regexp)
(progn
(setq tags-loop-scan `(let ,(unless (equal old-text (downcase old-text))
Expand All @@ -3493,9 +3495,9 @@ to run the replacement."
tags-loop-operate `(perform-replace ',old-text ',new-text t nil nil
nil multi-query-replace-map))
(tags-loop-continue (or (cons 'list files) t)))
(progn
(fileloop-initialize-replace old-text new-text files 'default)
(fileloop-continue)))))
;; Emacs 27+
(fileloop-initialize-replace old-text new-text files 'default)
(fileloop-continue))))

;;;###autoload
(defun projectile-replace-regexp (&optional arg)
Expand Down

0 comments on commit 2900fd0

Please sign in to comment.