]> code.delx.au - gnu-emacs-elpa/commitdiff
Handle errors file by file instead of returning on first error.
authorThierry Volpiatto <thierry.volpiatto@gmail.com>
Tue, 3 May 2016 16:17:02 +0000 (18:17 +0200)
committerThierry Volpiatto <thierry.volpiatto@gmail.com>
Tue, 3 May 2016 16:17:02 +0000 (18:17 +0200)
* dired-async.el (dired-async-create-files): Do it.

dired-async.el

index c6ff0b9e3d96560e2eac075aa75839a4682256f3..a6a1add7dbb7869849cc961e91be5993d7eb3d86 100644 (file)
@@ -268,7 +268,6 @@ ESC or `q' to not overwrite any of the remaining files,
       (async-start `(lambda ()
                       (require 'cl-lib) (require 'dired-aux) (require 'dired-x)
                       ,(async-inject-variables dired-async-env-variables-regexp)
-                      (condition-case err
                           (let ((dired-recursive-copies (quote always))
                                 (dired-copy-preserve-time
                                  ,dired-copy-preserve-time))
@@ -295,11 +294,14 @@ ESC or `q' to not overwrite any of the remaining files,
                             ;; Now run the FILE-CREATOR function on files.
                             (cl-loop with fn = (quote ,file-creator)
                                      for (from . dest) in (quote ,async-fn-list)
-                                     do (funcall fn from dest t)))
-                        (file-error
-                         (dired-log "%s: %s\n" (car err) (cdr err))
-                         (dired-log t)
-                         (with-current-buffer dired-log-buffer
+                                     do (condition-case err
+                                            (funcall fn from dest t)
+                                          (file-error
+                                           (dired-log "%s: %s\n" (car err) (cdr err)))
+                                          nil))
+                        (when (get-buffer dired-log-buffer)
+                          (dired-log t)
+                          (with-current-buffer dired-log-buffer
                            (write-region (point-min) (point-max)
                                          ,dired-async-log-file))))
                       ,(dired-async-maybe-kill-ftp))