emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/async f1e5912d94: Honor dired-create-destination-dirs (


From: ELPA Syncer
Subject: [elpa] externals/async f1e5912d94: Honor dired-create-destination-dirs (#178)
Date: Wed, 24 May 2023 07:57:29 -0400 (EDT)

branch: externals/async
commit f1e5912d9417e7b62a72e1839b2de7c4e05b1dc4
Author: Thierry Volpiatto <thievol@posteo.net>
Commit: Thierry Volpiatto <thievol@posteo.net>

    Honor dired-create-destination-dirs (#178)
---
 dired-async.el | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)

diff --git a/dired-async.el b/dired-async.el
index 9884852fe2..ababe1d1ef 100644
--- a/dired-async.el
+++ b/dired-async.el
@@ -251,7 +251,7 @@ See `dired-create-files' for the behavior of arguments."
   (setq overwrite-query nil)
   (let ((total (length fn-list))
         failures async-fn-list skipped callback
-        async-quiet-switch)
+        async-quiet-switch create-dir)
     (let (to)
       (dolist (from fn-list)
         (setq to (funcall name-constructor from))
@@ -344,7 +344,16 @@ ESC or `q' to not overwrite any of the remaining files,
                          for destp = (file-exists-p to)
                          do (and bf destp
                                  (with-current-buffer bf
-                                   (set-visited-file-name to t t))))))))
+                                   (set-visited-file-name to t t)))))))
+      (when (boundp 'dired-create-destination-dirs)
+        (setq create-dir
+              (cl-case dired-create-destination-dirs
+                (always 'always)
+                (ask (and (y-or-n-p (format "Create directory `%s'? "
+                                            (if (file-directory-p to)
+                                                to
+                                              (file-name-directory to))))
+                          'always))))))
     ;; Start async process.
     (when async-fn-list
       (process-put
@@ -353,7 +362,8 @@ ESC or `q' to not overwrite any of the remaining files,
                        ,(async-inject-variables 
dired-async-env-variables-regexp)
                        (let ((dired-recursive-copies (quote always))
                              (dired-copy-preserve-time
-                              ,dired-copy-preserve-time))
+                              ,dired-copy-preserve-time)
+                             (dired-create-destination-dirs ',create-dir))
                          (setq overwrite-backup-query nil)
                          ;; Inline `backup-file' as long as it is not
                          ;; available in emacs.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]