branch: elpa/helm
commit 62f65b350d6a0e23bc6be942e87d9ea2e06b75c8
Author: Thierry Volpiatto <[email protected]>
Commit: Thierry Volpiatto <[email protected]>

    Improve default (M-n) when compressing to archive
    
    Provide all possible extensions while cycling with M-n.
---
 helm-files.el | 18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)

diff --git a/helm-files.el b/helm-files.el
index f4c4e3d7ff3..a15ce4b6129 100644
--- a/helm-files.el
+++ b/helm-files.el
@@ -1366,12 +1366,18 @@ ACTION can be `rsync' or any action supported by 
`helm-dired-action'."
                                   (regexp-quote
                                    (if helm-ff-transformer-show-only-basename
                                        (helm-basename cand) cand))))
-                        :default (and cdir
-                                      (expand-file-name
-                                       (format "%s.tar.gz" (if cand
-                                                               (helm-basename 
cand)
-                                                             "new_archive"))
-                                       cdir))
+                        :default (when cdir
+                                   (mapcar (lambda (x)
+                                             (let ((ext 
(replace-regexp-in-string
+                                                         "[\\']" "" (car x))))
+                                               (expand-file-name
+                                                (format "%s%s"
+                                                        (if cand
+                                                            (helm-basename 
cand)
+                                                          "new_archive")
+                                                        ext)
+                                                cdir)))
+                                           dired-compress-files-alist))
                         :must-match (and cdir (lambda (f) (not 
(file-directory-p f))))
                         :initial-input (or cdir (helm-dwim-target-directory))
                         :history (helm-find-files-history nil :comp-read 
nil))))))

Reply via email to