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

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

[elpa] externals/async 59f65464c6 1/2: Fix directory creation when dired


From: ELPA Syncer
Subject: [elpa] externals/async 59f65464c6 1/2: Fix directory creation when dired-create-destination-dirs is 'ask
Date: Sun, 28 May 2023 03:57:19 -0400 (EDT)

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

    Fix directory creation when dired-create-destination-dirs is 'ask
---
 dired-async.el | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/dired-async.el b/dired-async.el
index ababe1d1ef..ef65afe6c9 100644
--- a/dired-async.el
+++ b/dired-async.el
@@ -345,15 +345,16 @@ ESC or `q' to not overwrite any of the remaining files,
                          do (and bf destp
                                  (with-current-buffer bf
                                    (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))))))
+      (let ((dirp (file-directory-p to))
+            (dest (file-name-directory to)))
+        (when (boundp 'dired-create-destination-dirs)
+          (setq create-dir
+                (cl-case dired-create-destination-dirs
+                  (always 'always)
+                  (ask (and (null dirp)
+                            (null (file-directory-p dest))
+                            (y-or-n-p (format "Create directory `%s'? " dest)))
+                            'always))))))
     ;; Start async process.
     (when async-fn-list
       (process-put



reply via email to

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