]> code.delx.au - gnu-emacs-elpa/commitdiff
Call ivy-set-actions with t to affect all commands
authorOleh Krehel <ohwoeowho@gmail.com>
Tue, 5 Jan 2016 18:12:29 +0000 (19:12 +0100)
committerOleh Krehel <ohwoeowho@gmail.com>
Tue, 5 Jan 2016 18:12:29 +0000 (19:12 +0100)
* ivy.el (ivy-read): Update.

Example:

(ivy-set-actions
 t
 '(("i" insert "insert")))

Now an "insert" action will be available for all `ivy-read' sessions
when pressing "M-o".

Fixes #337

ivy.el

diff --git a/ivy.el b/ivy.el
index 244d81931e9f9cb4d7f8bc46bd8e8273902eabcb..b83c7b4b2abd69f88e5c64b250b266a7fa56effd 100644 (file)
--- a/ivy.el
+++ b/ivy.el
@@ -1100,7 +1100,8 @@ candidates is updated after each input by calling COLLECTION.
 CALLER is a symbol to uniquely identify the caller to `ivy-read'.
 It is used, along with COLLECTION, to determine which
 customizations apply to the current completion session."
-  (let ((extra-actions (plist-get ivy--actions-list this-command)))
+  (let ((extra-actions (append (plist-get ivy--actions-list t)
+                               (plist-get ivy--actions-list this-command))))
     (when extra-actions
       (setq action
             (if (functionp action)