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

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

[elpa] externals/ivy-hydra 554c178 158/395: ivy.el (ivy-set-actions): Al


From: Basil L. Contovounesios
Subject: [elpa] externals/ivy-hydra 554c178 158/395: ivy.el (ivy-set-actions): Allow to override the default action using "o"
Date: Thu, 25 Feb 2021 08:31:53 -0500 (EST)

branch: externals/ivy-hydra
commit 554c1787c201fbcdf08fca533f9ba47a042c16de
Author: Oleh Krehel <ohwoeowho@gmail.com>
Commit: Oleh Krehel <ohwoeowho@gmail.com>

    ivy.el (ivy-set-actions): Allow to override the default action using "o"
    
    Fixes #2468
---
 ivy.el | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/ivy.el b/ivy.el
index 3fc05d7..9b2fd69 100644
--- a/ivy.el
+++ b/ivy.el
@@ -321,11 +321,16 @@ ACTIONS that have the same key."
 
 (defun ivy--compute-extra-actions (action caller)
   "Add extra actions to ACTION based on CALLER."
-  (let ((extra-actions (cl-delete-duplicates
-                        (append (plist-get ivy--actions-list t)
-                                (plist-get ivy--actions-list this-command)
-                                (plist-get ivy--actions-list caller))
-                        :key #'car :test #'equal)))
+  (let* ((extra-actions (cl-delete-duplicates
+                         (append (plist-get ivy--actions-list t)
+                                 (plist-get ivy--actions-list this-command)
+                                 (plist-get ivy--actions-list caller))
+                         :key #'car :test #'equal))
+         (override-default (assoc "o" extra-actions)))
+    (when override-default
+      (setq action (cadr override-default))
+      (setq extra-actions
+            (assoc-delete-all "o" extra-actions)))
     (if extra-actions
         (cond ((functionp action)
                `(1



reply via email to

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