projectile icon indicating copy to clipboard operation
projectile copied to clipboard

projectile-replace not taking Emacs 27+ path on Emacs 27.2

Open efroemling opened this issue 3 years ago • 1 comments

Expected behavior

Looking at projectile_replace in projectile.el, I would expect the path labeled Emacs 27+ to be taken on my Emacs 27.2 install.

Actual behavior

Instead it appears tags-loop-scan fallback gets used. I have been noticing very buggy behavior with search-and-replace for a while now (very similar to described here) which prompted me to look into this. It seems that (fboundp #'fileloop-continue) is evaluating to nil which causes it to skip the 27 path. If I add a (require 'fileloop) to the top of my .emacs then it instead evaluates to t and the 27 path runs (which consequently seems to get rid of the buggy behavior I have been seeing).

Steps to reproduce the problem

I'm seeing this behavior on my Macs on the latest 27.2 build available from https://emacsformacosx.com as well as with the 27.2 emacs-plus

In projectile.el, temporarily replace the fallback code under the ;; Emacs 25 and 26 comment with (error "SHOULD NOT GET HERE").

Launch clean-slate emacs via emacs -q

Eval the following:

(add-to-list 'load-path "/path/to/your/projectile")
(require 'subr-x)
(require 'projectile)

Now enabling projectile-mode and running "Projectile->Search->Replace in Project" should yield a "SHOULD NOT GET HERE" error. Also, evaluating (fboundp #'fileloop-continue) should show nil.

Projectile version information

Projectile version: Projectile 2.6.0-snapshot

Emacs version

GNU Emacs 27.2 (build 1, aarch64-apple-darwin21.1.0, NS appkit-2113.00 Version 12.0.1 (Build 21A559))

Operating system

macOS Monterey 12.2 (Arm)

efroemling avatar Feb 04 '22 21:02 efroemling

Seems the problem is indeed that we don't try to require fileloop and instead we just assume it was loaded. This should be a simple fix. PR welcome!

bbatsov avatar Mar 16 '22 06:03 bbatsov