X-Git-Url: https://code.delx.au/gnu-emacs-elpa/blobdiff_plain/1c57dc30997ac2d1bf06630238b1d517d88e573f..228ec4bb351a9e14e338b9cb09eeb4809957c909:/dired-async.el diff --git a/dired-async.el b/dired-async.el index be6a68ff0..a6a1add7d 100644 --- a/dired-async.el +++ b/dired-async.el @@ -127,10 +127,13 @@ Should take same args as `message'." (when operation (if (file-exists-p dired-async-log-file) (progn - (pop-to-buffer (get-buffer-create "*dired async*")) - (erase-buffer) + (pop-to-buffer (get-buffer-create dired-log-buffer)) + (goto-char (point-max)) + (setq inhibit-read-only t) (insert "Error: ") (insert-file-contents dired-async-log-file) + (special-mode) + (shrink-window-if-larger-than-buffer) (delete-file dired-async-log-file)) (run-with-timer 0.1 nil @@ -150,9 +153,10 @@ Should take same args as `message'." (dired-plural-s total)))) ;; Finally send the success message. (funcall dired-async-message-function - "Asynchronous %s of %s file(s) on %s file(s) done" + "Asynchronous %s of %s on %s file%s done" 'dired-async-message - (car operation) (cadr operation) total)))))) + (car operation) (cadr operation) + total (dired-plural-s total))))))) (defun dired-async-maybe-kill-ftp () "Return a form to kill ftp process in child emacs." @@ -264,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)) @@ -291,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))