[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master ebac0e9 352/399: ivy.el (ivy--compute-extra-actions): Extr
From: |
Oleh Krehel |
Subject: |
[elpa] master ebac0e9 352/399: ivy.el (ivy--compute-extra-actions): Extract |
Date: |
Sat, 20 Jul 2019 14:57:57 -0400 (EDT) |
branch: master
commit ebac0e93379a54dea4b87eee24b45dff2b776b78
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>
ivy.el (ivy--compute-extra-actions): Extract
Re #2121
---
ivy.el | 38 +++++++++++++++++++++-----------------
1 file changed, 21 insertions(+), 17 deletions(-)
diff --git a/ivy.el b/ivy.el
index 118d346..dcecffe 100644
--- a/ivy.el
+++ b/ivy.el
@@ -323,6 +323,26 @@ ACTIONS that have the same key."
(append (plist-get ivy--actions-list cmd) actions)
:key #'car :test #'equal))))
+(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)))
+ (if extra-actions
+ (cond ((functionp action)
+ `(1
+ ("o" ,action "default")
+ ,@extra-actions))
+ ((null action)
+ `(1
+ ("o" identity "default")
+ ,@extra-actions))
+ (t
+ (delete-dups (append action extra-actions))))
+ action)))
+
(defvar ivy--prompts-list nil)
(defun ivy-set-prompt (caller prompt-fn)
@@ -1937,23 +1957,7 @@ 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 (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)))
- (when extra-actions
- (setq action
- (cond ((functionp action)
- `(1
- ("o" ,action "default")
- ,@extra-actions))
- ((null action)
- `(1
- ("o" identity "default")
- ,@extra-actions))
- (t
- (delete-dups (append action extra-actions)))))))
+ (setq action (ivy--compute-extra-actions action caller))
(setq ivy-marked-candidates nil)
(unless caller
(setq caller this-command))
- [elpa] master 8fc254f 341/399: counsel.el (counsel--setq-doconst): Fix compiler warning, (continued)
- [elpa] master 8fc254f 341/399: counsel.el (counsel--setq-doconst): Fix compiler warning, Oleh Krehel, 2019/07/20
- [elpa] master 1c436f6 347/399: ivy.el (ivy-reverse-i-search): Don't call another ivy-reverse-i-search, Oleh Krehel, 2019/07/20
- [elpa] master 975c2af 348/399: ivy.el (ivy-reverse-i-search): Error when called from top-level, Oleh Krehel, 2019/07/20
- [elpa] master 888b417 350/399: ivy.el (ivy--recompute-index-inhibit): Add, Oleh Krehel, 2019/07/20
- [elpa] master 4c9c14a 356/399: ivy.el (ivy--minibuffer-cleanup): Rename from ivy--cleanup, Oleh Krehel, 2019/07/20
- [elpa] master 4324211 354/399: ivy.el (ivy-read): Factor out transformer-fn, Oleh Krehel, 2019/07/20
- [elpa] master d52c176 351/399: ivy.el (ivy-switch-buffer-kill): Move from "C-c C-k" to "C-k", Oleh Krehel, 2019/07/20
- [elpa] master 7925637 353/399: ivy.el (ivy--compute-extra-candidates): Extract, Oleh Krehel, 2019/07/20
- [elpa] master f6876a7 359/399: ivy.el (ivy-read): Simplify, Oleh Krehel, 2019/07/20
- [elpa] master 460d6e3 355/399: ivy.el (ivy-read): Refactor, Oleh Krehel, 2019/07/20
- [elpa] master ebac0e9 352/399: ivy.el (ivy--compute-extra-actions): Extract,
Oleh Krehel <=
- [elpa] master bae8e46 361/399: ivy.el (ivy--magic-file-doubleslash-directory): Cd remote "/" on "//", Oleh Krehel, 2019/07/20
- [elpa] master a87bdd2 358/399: ivy.el (ivy-read): Refactor, Oleh Krehel, 2019/07/20
- [elpa] master 5e1c468 357/399: ivy.el (ivy--cleanup): Extract, Oleh Krehel, 2019/07/20
- [elpa] master 520fd83 360/399: ivy.el (ivy-read): Simplify, Oleh Krehel, 2019/07/20
- [elpa] master 2d22e05 363/399: doc/ivy.org: Add more info on TRAMP, Oleh Krehel, 2019/07/20
- [elpa] master 180d329 365/399: swiper.el (swiper--re-builder): Improve for char-fold-to-regexp, Oleh Krehel, 2019/07/20
- [elpa] master 4e9e310 368/399: ivy.el (ivy-read): Fix swiper-query-replace not working, Oleh Krehel, 2019/07/20
- [elpa] master a0b71a1 362/399: ivy.el (ivy--magic-tilde-directory): Cd remote "~" on "~", Oleh Krehel, 2019/07/20
- [elpa] master 3af75cf 364/399: swiper.el (swiper--positive-regexps): Extract, Oleh Krehel, 2019/07/20
- [elpa] master 916e281 367/399: ivy.el (ivy-read): Fix bad refactor, Oleh Krehel, 2019/07/20