]> code.delx.au - gnu-emacs-elpa/commitdiff
Add a couple tests for ivy-read with alists
authorOleh Krehel <ohwoeowho@gmail.com>
Fri, 22 Apr 2016 08:39:08 +0000 (10:39 +0200)
committerOleh Krehel <ohwoeowho@gmail.com>
Fri, 22 Apr 2016 08:39:28 +0000 (10:39 +0200)
* ivy-test.el (ivy-read): Add tests.

To summarize how it works:

1. Only the keys of the alist are offered for completion, not the values
- this is the standard Emacs behavior.

2. `ivy-read' will return the selected key, not the value or the cons
cell.

3. When :action is specified, it will be called with the value
corresponding to the selected key. Not the key, and not the cons.

This allows keys to work as aliases for the actual data, and :action
arguments to be simple functions that deal with data (i.e. not having to
deal with the `cdr' of the passed argument).


No differences found