branch: elpa/helm
commit 7f0b4a23fb71ab5bd4995fbf69b0de6dda767f7f
Author: Thierry Volpiatto <thie...@posteo.net>
Commit: Thierry Volpiatto <thie...@posteo.net>

    Add clone action to installed packages as well
---
 helm-packages.el | 20 +++++++++++---------
 1 file changed, 11 insertions(+), 9 deletions(-)

diff --git a/helm-packages.el b/helm-packages.el
index 8b53fa781f..6074525be8 100644
--- a/helm-packages.el
+++ b/helm-packages.el
@@ -441,7 +441,8 @@ to avoid errors with outdated packages no more availables."
                                  . helm-packages-package-reinstall)
                                 ("Recompile package(s)" . 
helm-packages-recompile)
                                 ("Uninstall package(s)" . 
helm-packages-uninstall)
-                                ("Isolate package(s)" . 
helm-packages-isolate)))
+                                ("Isolate package(s)" . helm-packages-isolate))
+                      :action-transformer #'helm-packages-action-transformer)
                     (helm-make-source "Available external packages" 
'helm-packages-class
                       :data (cl-loop for p in package-archive-contents
                                      for sym = (car p)
@@ -455,14 +456,7 @@ to avoid errors with outdated packages no more availables."
                       :action '(("Describe package" . helm-packages-describe)
                                 ("Visit homepage" . 
helm-packages-visit-homepage)
                                 ("Install packages(s)" . 
helm-packages-install))
-                      :action-transformer
-                      (lambda (actions candidate)
-                        (if (string= (package-desc-archive
-                                      (package-get-descriptor candidate))
-                                     "melpa")
-                            (append actions
-                                    '(("Clone package" . 
helm-packages-clone-package)))
-                          actions)))
+                      :action-transformer #'helm-packages-action-transformer)
                     (helm-make-source "Available built-in packages" 
'helm-packages-class
                       :data (cl-loop for p in package--builtins
                                      ;; Show only builtins that are available 
as
@@ -476,6 +470,14 @@ to avoid errors with outdated packages no more availables."
                                 ("Install packages(s)" . 
helm-packages-install))))
           :buffer "*helm packages*")))
 
+(defun helm-packages-action-transformer (actions candidate)
+  (if (string= (package-desc-archive
+                (package-get-descriptor candidate))
+               "melpa")
+      (append actions
+              '(("Clone package" . helm-packages-clone-package)))
+    actions))
+
 ;;;###autoload
 (defun helm-finder (&optional arg)
   "Helm interface to find packages by keywords with `finder'.

Reply via email to