emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] master 1088078 266/272: When selecting a non-existing key in an a


From: Oleh Krehel
Subject: [elpa] master 1088078 266/272: When selecting a non-existing key in an alist, return that key
Date: Mon, 25 Apr 2016 10:13:29 +0000

branch: master
commit 1088078c55b650ccced95f1419b2ade90ea75d07
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>

    When selecting a non-existing key in an alist, return that key
    
    * ivy.el (ivy-call): Previously, nil was returned.
---
 ivy.el |   13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/ivy.el b/ivy.el
index 8e12408..eee341c 100644
--- 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)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]