Identification of caller for ivy-read #1957
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi,
With
ivy
, projectile usesivy-read
for completion. This function takes a named parameter:caller
that allowsivy
to change its behavior (e.g.ivy-rich
annotations, ordisplay-buffer
behavior). As it stands, projectile always sets this parameter toprojectile-completing-read
.This PR changes it to set a different caller according to what is being read:
projectile-read-project
for a project name,projectile-read-buffer
for a buffer name,projectile-read-file
for a file name,projectile-read-directory
for a directory.Based on the changelog, the purpose appears to be similar to #1892.
It is also similar to what counsel-projectile does, but that package is much larger in scope, and more opinionated. This PR won't change user-facing behavior without additional configuration on their side.
One possible friction point is if a user has already configured eg
ivy-rich
to match on'projectile-completing-read
. Then they will need to adjust their configuration to the new identifiers. If that is a big problem, we can add a configuration variable to make the new behavior opt-in or opt-out.Examples of what can be done (requires additional code)
Show the current branch of the projects (very useful when juggling between multiple worktrees):

Have the same information with

projectile-switch-buffer
as withswitch-buffer
:Before submitting a PR make sure the following things have been done (and denote this
by checking the relevant checkboxes):
eldev test
)M-x checkdoc
warningsThanks!