branch: externals/ivy-hydra
commit 7dd6bfcc7a8014073a122b7c7ad3ddef77d28c99
Author: Oleh Krehel <[email protected]>
Commit: Oleh Krehel <[email protected]>
ivy.el (ivy-read): Document :extra-props as a plist
* ivy.el (ivy--update-history): Use :extra-props as a plist
Re #2568
Re raxod502/prescient.el#60
---
ivy.el | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/ivy.el b/ivy.el
index d591e8e..cf7141d 100644
--- a/ivy.el
+++ b/ivy.el
@@ -2253,8 +2253,8 @@ list of candidates, and returns the list of matching
candidates.
DYNAMIC-COLLECTION is a boolean specifying whether the list of
candidates is updated after each input by calling COLLECTION.
-EXTRA-PROPS can be used to store collection-specific
-session-specific data.
+EXTRA-PROPS is a plist that can be used to store
+collection-specific session-specific data.
CALLER is a symbol to uniquely identify the caller to `ivy-read'.
It is used, along with COLLECTION, to determine which
@@ -2353,7 +2353,9 @@ customizations apply to the current completion session."
(defun ivy--update-history (hist)
(let ((item
(if (or (string= ivy-text "")
- (eq (ivy-state-extra-props ivy-last) 'ivy-completing-read))
+ (eq
+ (plist-get (ivy-state-extra-props ivy-last) :caller)
+ 'ivy-completing-read))
(ivy-state-current ivy-last)
ivy-text)))
(cond ((equal item ""))
@@ -2649,7 +2651,7 @@ INHERIT-INPUT-METHOD is currently ignored."
:history history
:keymap nil
:dynamic-collection ivy-completing-read-dynamic-collection
- :extra-props 'ivy-completing-read
+ :extra-props '(:caller ivy-completing-read)
:caller (if (and collection (symbolp collection))
collection
this-command))))