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

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

[elpa] master d6cf677 077/348: ivy.el (ivy-prompt): Add warning


From: Oleh Krehel
Subject: [elpa] master d6cf677 077/348: ivy.el (ivy-prompt): Add warning
Date: Sat, 8 Apr 2017 11:03:30 -0400 (EDT)

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

    ivy.el (ivy-prompt): Add warning
    
    In case someone keeps a 1-arg function in
    `counsel-prompt-function' (old), instead of 0-arg (new).
---
 ivy.el | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/ivy.el b/ivy.el
index df1e0cf..f4ab9ef 100644
--- a/ivy.el
+++ b/ivy.el
@@ -1989,7 +1989,12 @@ The returned value should be the updated PROMPT.")
   "Return the current prompt."
   (let ((fn (plist-get ivy--prompts-list (ivy-state-caller ivy-last))))
     (if fn
-        (funcall fn)
+        (condition-case nil
+            (funcall fn)
+          (error
+           (warn "`counsel-prompt-function' should take 0 args")
+           ;; old behavior
+           (funcall fn (ivy-state-prompt ivy-last))))
       ivy--prompt)))
 
 (defun ivy--insert-prompt ()



reply via email to

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