1

I have been using projectile-ripgrep for a few months and I'm pretty happy with it. A few days ago I was testing some of is options and the default search for ripgrep (what I see in the minibuffer) changed from:

[my-project] Ripgrep search for (default my_function): 

to:

[my-project] Ripgrep search for: my_function

I find it a bit annoying since I like how it used to suggest the search (same as when you do a query-replace), meaning that if I did not enter any character, it would search the suggested term. Now that term is already part of the input, so if I want to search for something else I have to delete it first.

I am not sure how I changed this and I am not able to set it back to how it was. Any ideas?

2

I've figured out why this is happening to your environment after reading your comments below.

There are two projectile-ripgrep (package projectile & package projectile-ripgrep). Whichever is loaded second in order is being used, hence the different behavior on your machine.


Original answer:

(I don't have enough reputation to add a comment.)

Which version of projectile are you using? Are we looking at the same code here?

If so, could you try playing around with the following expression and see what happens? (Both in your current settings and emacs -Q)

 (read-string (format "%s%s: " "prefix " "(default label)") nil nil "default retval")

  • According to my package-list-packages: projectile: 20200710.947 and projectile-ripgrep 20180914.1500. So I think it is updated and we should be looking at the same code. If I eval-region that expression, I get: prefix (default label): which seems the expected result. – makeMonday Nov 5 '20 at 9:40
  • Ok, just in case, I updated all my packages (including projectile up to 20201030.1132) and it went back to the previous way 🎉 I'm still not sure why it changed before. – makeMonday Nov 5 '20 at 10:00
  • I restarted emacs to check if it would stay the same and no, it is sticking with the search without default. So it looks like it might be something in my .emacs, but I am not sure what. – makeMonday Nov 5 '20 at 10:09
  • Perhaps you could try stepping through the code using Edebug and see what happens. – TerryTsao Nov 5 '20 at 15:29
  • @makeMonday I think I've figured out what's going on here. I'll rewrite the answer. – TerryTsao Nov 6 '20 at 2:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.