]> code.delx.au - gnu-emacs-elpa/commitdiff
Use :caller for ivy-re-builders-alist
authorOleh Krehel <ohwoeowho@gmail.com>
Fri, 4 Dec 2015 08:23:19 +0000 (09:23 +0100)
committerOleh Krehel <ohwoeowho@gmail.com>
Fri, 4 Dec 2015 08:23:19 +0000 (09:23 +0100)
* counsel.el (counsel-M-x): Add :caller.

* ivy.el (ivy--reset-state): Use :caller.

counsel.el
ivy.el

index 0ced4b90269d873a9d41e546b20526a1822e1449..e2dc27c644323d8857c77b564719641505119017 100644 (file)
@@ -896,7 +896,8 @@ Optional INITIAL-INPUT is the initial input in the minibuffer."
                   (command-execute (intern cmd) 'record)))
               :sort sort
               :keymap counsel-describe-map
-              :initial-input initial-input)))
+              :initial-input initial-input
+              :caller 'counsel-M-x)))
 
 (declare-function powerline-reset "ext:powerline")
 
diff --git a/ivy.el b/ivy.el
index f2cd67f96ab3f24edd11850668fefedd3e7f8746..7d25c501c42ebf47a1ea0ff46c36ff87f994843e 100644 (file)
--- a/ivy.el
+++ b/ivy.el
@@ -1161,7 +1161,8 @@ This is useful for recursive `ivy-read'."
         (re-builder (ivy-state-re-builder state))
         (dynamic-collection (ivy-state-dynamic-collection state))
         (initial-input (ivy-state-initial-input state))
-        (require-match (ivy-state-require-match state)))
+        (require-match (ivy-state-require-match state))
+        (caller (ivy-state-caller state)))
     (unless initial-input
       (setq initial-input (cdr (assoc this-command
                                       ivy-initial-inputs-alist))))
@@ -1171,6 +1172,8 @@ This is useful for recursive `ivy-read'."
           (or re-builder
               (and (functionp collection)
                    (cdr (assoc collection ivy-re-builders-alist)))
+              (and caller
+                   (cdr (assoc caller ivy-re-builders-alist)))
               (cdr (assoc t ivy-re-builders-alist))
               'ivy--regex))
     (setq ivy--subexps 0)