Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document that ivy-read's action function does not necessarily take a string argument #2201

Closed
alphapapa opened this issue Aug 16, 2019 · 1 comment

Comments

@alphapapa
Copy link

alphapapa commented Aug 16, 2019

The docstring and manual for ivy-read say that its action argument is a function that takes a string as its argument, e.g.:

ACTION is a function to call after selecting a candidate.
It takes the candidate, which is a string, as its only argument.

But if the collection is an alist, the action function receives the entire cons as its argument, not only the key string.

This is misleading, but it's also a minor barrier to entry. For example, I thought that I would have to do the assoc myself based on the string, while Ivy actually handles that itself.

@abo-abo
Copy link
Owner

abo-abo commented Aug 22, 2019

Thanks.

astoff pushed a commit to astoff/swiper that referenced this issue Jan 1, 2021
The ACTION arg is a cons cell for an alist COLLECTION.

Fixes abo-abo#2201
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants