branch: elpa/helm commit 7ad76573eed0377f557c9bfc30e12b81d9628fcf Author: Thierry Volpiatto <thie...@posteo.net> Commit: Thierry Volpiatto <thie...@posteo.net>
Ask and show destinations in mcp --- helm-files.el | 42 +++++++++++++++++++++++------------------- 1 file changed, 23 insertions(+), 19 deletions(-) diff --git a/helm-files.el b/helm-files.el index 22458b2657..b6f57fbd19 100644 --- a/helm-files.el +++ b/helm-files.el @@ -6034,25 +6034,29 @@ be directories." (cl-incf skipped)) else do (cl-incf skipped)) (when operations - (async-start - `(lambda () - (require 'cl-lib) - (cl-loop with copies = 0 - with skipped = ,skipped - for (file dest overwrite) in ',operations - do (condition-case _err - (progn - (copy-file file dest overwrite) - (cl-incf copies)) - (file-error (cl-incf skipped))) - finally return (list file copies skipped))) - (lambda (result) - (let ((copied (nth 1 result))) - (message "Mcp done, %s %s of %s done, %s files skipped" - copied (if (> copied 1) - "copies" "copy") - (helm-basename (nth 0 result)) - (nth 2 result))))))))) + (with-helm-display-marked-candidates + helm-marked-buffer-name + (mapcar #'abbreviate-file-name targets) + (when (y-or-n-p (format "Copy `%s' to directories?" file)) + (async-start + `(lambda () + (require 'cl-lib) + (cl-loop with copies = 0 + with skipped = ,skipped + for (file dest overwrite) in ',operations + do (condition-case _err + (progn + (copy-file file dest overwrite) + (cl-incf copies)) + (file-error (cl-incf skipped))) + finally return (list file copies skipped))) + (lambda (result) + (let ((copied (nth 1 result))) + (message "Mcp done, %s %s of %s done, %s files skipped" + copied (if (> copied 1) + "copies" "copy") + (helm-basename (nth 0 result)) + (nth 2 result))))))))))) (helm-make-command-from-action helm-ff-run-mcp "Copy the car of marked candidates to the remaining marked candidates."