branch: elpa/helm
commit f38a6f3c2e8891f484ae92bbdd34ad1d5cf0b950
Author: Kiso Katsuyuki <[email protected]>
Commit: Kiso Katsuyuki <[email protected]>
reduced is-action-compress conditions and cleaned code
---
helm-files.el | 64 +++++++++++++++++++++++++++++++++++------------------------
1 file changed, 38 insertions(+), 26 deletions(-)
diff --git a/helm-files.el b/helm-files.el
index ef8dff2915..c03eac7649 100644
--- a/helm-files.el
+++ b/helm-files.el
@@ -1239,32 +1239,44 @@ ACTION can be `rsync' or any action supported by
`helm-dired-action'."
(helm-actions-inherit-frame-settings t)
helm-use-frame-when-more-than-two-windows
(dest (or target
- (with-helm-display-marked-candidates
- helm-marked-buffer-name
- (if (eq action 'compress)
- (mapcar
- (lambda (f)
- (file-relative-name f (helm-common-dir ifiles)))
- ifiles)
- (helm-ff--count-and-collect-dups ifiles))
- (with-helm-current-buffer
- (helm-read-file-name
- prompt
- :preselect (when cand
- (format
helm-ff-last-expanded-candidate-regexp
- (regexp-quote
- (if
helm-ff-transformer-show-only-basename
- (helm-basename cand) cand))))
- :initial-input (if (eq action 'compress)
- (helm-common-dir ifiles)
- (helm-dwim-target-directory))
- :default (when (eq action 'compress)
- (expand-file-name
- (format "%s.tar.gz" (if cand
- (helm-basename
cand)
- "new_archive"))
- (helm-common-dir ifiles)))
- :history (helm-find-files-history nil :comp-read
nil))))))
+ (if (eq action 'compress)
+ (let ((cdir (helm-common-dir ifiles)))
+ (with-helm-display-marked-candidates
+ helm-marked-buffer-name
+ (mapcar
+ (lambda (f)
+ (file-relative-name f cdir))
+ ifiles)
+ (with-helm-current-buffer
+ (helm-read-file-name
+ prompt
+ :preselect
+ (when cand
+ (format helm-ff-last-expanded-candidate-regexp
+ (regexp-quote
+ (if
helm-ff-transformer-show-only-basename
+ (helm-basename cand) cand))))
+ :initial-input cdir
+ :default (expand-file-name
+ (format "%s.tar.gz" (if cand
+ (helm-basename
cand)
+ "new_archive"))
+ cdir)
+ :history (helm-find-files-history nil :comp-read
nil)))))
+ (with-helm-display-marked-candidates
+ helm-marked-buffer-name
+ (helm-ff--count-and-collect-dups ifiles)
+ (with-helm-current-buffer
+ (helm-read-file-name
+ prompt
+ :preselect
+ (when cand
+ (format helm-ff-last-expanded-candidate-regexp
+ (regexp-quote
+ (if helm-ff-transformer-show-only-basename
+ (helm-basename cand) cand))))
+ :initial-input (helm-dwim-target-directory)
+ :history (helm-find-files-history nil :comp-read
nil)))))))
(dest-dir-p (file-directory-p dest))
(dest-dir (if dest-dir-p dest (helm-basedir dest))))
;; We still need to handle directory creation for Emacs version < 27.1 that