]> code.delx.au - gnu-emacs-elpa/commitdiff
When selecting a non-existing key in an alist, return that key
authorOleh Krehel <ohwoeowho@gmail.com>
Fri, 22 Apr 2016 08:31:20 +0000 (10:31 +0200)
committerOleh Krehel <ohwoeowho@gmail.com>
Fri, 22 Apr 2016 08:31:20 +0000 (10:31 +0200)
* ivy.el (ivy-call): Previously, nil was returned.

ivy.el

diff --git a/ivy.el b/ivy.el
index 8e12408f300ce6224cdd4002179dc277cd5626b7..eee341ccff4fe9eee1c67c4147ebbe83a970bef3 100644 (file)
--- a/ivy.el
+++ b/ivy.el
@@ -893,12 +893,13 @@ Example use:
     (let ((action (ivy--get-action ivy-last)))
       (when action
         (let* ((collection (ivy-state-collection ivy-last))
-               (x (if (and (consp collection)
-                           (consp (car collection)))
-                      (cdr (assoc ivy--current collection))
-                    (if (equal ivy--current "")
-                        ivy-text
-                      ivy--current))))
+               (x (cond ((and (consp collection)
+                              (consp (car collection))
+                              (cdr (assoc ivy--current collection))))
+                        ((equal ivy--current "")
+                         ivy-text)
+                        (t
+                         ivy--current))))
           (prog1 (funcall action x)
             (unless (or (eq ivy-exit 'done)
                         (equal (selected-window)