]> code.delx.au - gnu-emacs-elpa/commitdiff
Handle error also on host when async-list of file is empty.
authorThierry Volpiatto <thierry.volpiatto@gmail.com>
Sat, 30 Apr 2016 20:20:17 +0000 (22:20 +0200)
committerThierry Volpiatto <thierry.volpiatto@gmail.com>
Sat, 30 Apr 2016 20:20:17 +0000 (22:20 +0200)
* dired-async.el (dired-async-create-files): Do it.
When only one file and user answer no handle error on host.

dired-async.el

index c4dca0852ed09da00278f288a27ba88d7c826b0b..c18ec539212204fda1a17891cf1bdec18b557c8c 100644 (file)
@@ -229,6 +229,23 @@ ESC or `q' to not overwrite any of the remaining files,
                         (dired-log "%s `%s' to `%s' failed"
                                    operation from to)))
                   (push (cons from to) async-fn-list)))))
+      ;; When async-fn-list is empty that's mean only one file
+      ;; had to be copied and user finally answer NO.
+      ;; In this case async process will never start and callback
+      ;; will have no chance to run, so notify failures here.
+      (unless async-fn-list
+        (cond (failures
+               (funcall dired-async-message-function
+                        "%s failed for %d of %d file%s"
+                        'dired-async-failures
+                        operation (length failures)
+                        total (dired-plural-s total)))
+              (skipped
+               (funcall dired-async-message-function
+                        "%s: %d of %d file%s skipped"
+                        'dired-async-failures
+                        operation (length skipped) total
+                        (dired-plural-s total)))))
       ;; Setup callback.
       (setq callback
             (lambda (&optional _ignore)