]> code.delx.au - gnu-emacs-elpa/commit
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)
commit63688c68872fff0b54e927b765d6a305998a6f91
treee771c53b8d36e2c03f0aea9b97272706e18c5774
parent1088078c55b650ccced95f1419b2ade90ea75d07
Add a couple tests for ivy-read with alists

* 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).
ivy-test.el