[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/helm 75a1f4d709 7/7: Avoid duplicate code in previous comm
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/helm 75a1f4d709 7/7: Avoid duplicate code in previous commit |
Date: |
Sun, 17 Mar 2024 07:00:27 -0400 (EDT) |
branch: elpa/helm
commit 75a1f4d70908766b1dab323242144d661464f498
Author: Thierry Volpiatto <thievol@posteo.net>
Commit: Thierry Volpiatto <thievol@posteo.net>
Avoid duplicate code in previous commit
---
helm-files.el | 64 ++++++++++++++++++++++++-----------------------------------
1 file changed, 26 insertions(+), 38 deletions(-)
diff --git a/helm-files.el b/helm-files.el
index 6d50473b77..2699cfc57b 100644
--- a/helm-files.el
+++ b/helm-files.el
@@ -1229,6 +1229,8 @@ ACTION can be `rsync' or any action supported by
`helm-dired-action'."
(length ifiles)
(if (memq action '(symlink relsymlink hardlink))
"from" "to")))
+ (cdir (and (eq action 'compress)
+ (helm-common-dir ifiles)))
helm-ff--move-to-first-real-candidate
helm-display-source-at-screen-top ; prevent setting window-start.
helm-ff-auto-update-initial-value
@@ -1239,44 +1241,30 @@ 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
- (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)))))))
+ (with-helm-display-marked-candidates
+ helm-marked-buffer-name
+ (if cdir
+ (mapcar (lambda (f)
+ (file-relative-name f cdir))
+ 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))))
+ :default (and cdir
+ (expand-file-name
+ (format "%s.tar.gz" (if cand
+ (helm-basename
cand)
+ "new_archive"))
+ cdir))
+ :initial-input (or cdir (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
- [nongnu] elpa/helm updated (e93335b0b9 -> 75a1f4d709), ELPA Syncer, 2024/03/17
- [nongnu] elpa/helm 1dd0bbd8b8 3/7: compress to common directory of input files, ELPA Syncer, 2024/03/17
- [nongnu] elpa/helm 4e0b2f12a9 6/7: Merge branch 'devel', ELPA Syncer, 2024/03/17
- [nongnu] elpa/helm 5370e6c6b4 2/7: Fix mode-line message, ELPA Syncer, 2024/03/17
- [nongnu] elpa/helm f38a6f3c2e 4/7: reduced is-action-compress conditions and cleaned code, ELPA Syncer, 2024/03/17
- [nongnu] elpa/helm 320a22e33d 5/7: Merge pull request #2645 from kkatsuyuki/where-to-compress, ELPA Syncer, 2024/03/17
- [nongnu] elpa/helm 39e955def5 1/7: Docstring only, ELPA Syncer, 2024/03/17
- [nongnu] elpa/helm 75a1f4d709 7/7: Avoid duplicate code in previous commit,
ELPA Syncer <=