It seems promising to have a built-in function that performs this action: find and replace all matching text recursively, within your project.
The problem is that it doesn't seem consistent. I am working on a python project that I do not have permission to share, but within the project the function is not idempotent. It will go to different depths on different calls, usually exiting early, the depth of which is usually dependent on which file I call it from. Although, in the mini-buffer it shows parsing of files starting at the parent directory, which I'd expect; it shouldn't matter where you call it from and according to the mini-buffer it doesn't seem to. The number of found matches I'm brought to says otherwise.
I have since had to download projectile
and even after a good run of M-x
project-query-replace-regexp
RET
, projectile
will still find leftover text to replace that I did not skip over intentionally.
Any ideas on why I experience this behavior or how to improve it. I'd rather rely on a built-in than external dependencies. Plus, I only need this feature from projectile, so it's a waste to download an additional package for something I "already have".
I apologize for not having a concrete example to share. If I find this problem in a personal repo, I will fortify the question. I have not had time away from my responsibilites to test further.
Edit:
Oddly, I just ran into the same issue with projectile
. Does it matter what file you start from?
M-x fileloop-continue
when you find an incomplete replacement? You may have somehow exited the query-replace early? And I don't know howproject
decides how a file belongs to a project: maybe the "missed" files are not part of the project and need some action to be added?M-x report-emacs-bug
. IIUC there are not too many users of this command, so without reports some bugs might indeed be lurking around.emacs -Q
(no init file), to repro the problem, saying what you do at each step, what you see then, and what you expected/wanted to see instead.