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

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

[elpa] master c472c4a 036/187: * helm-async.el Return file errors in chi


From: Michael Albinus
Subject: [elpa] master c472c4a 036/187: * helm-async.el Return file errors in child Emacs.
Date: Wed, 30 Dec 2015 11:49:32 +0000

branch: master
commit c472c4ae561cd61589f07ddb876b9eb65e18a114
Author: Thierry Volpiatto <address@hidden>
Commit: Thierry Volpiatto <address@hidden>

    * helm-async.el Return file errors in child Emacs.
---
 helm-async.el |   26 +++++++++++++++++++++-----
 1 files changed, 21 insertions(+), 5 deletions(-)

diff --git a/helm-async.el b/helm-async.el
index 3cb40b3..9fe680e 100644
--- a/helm-async.el
+++ b/helm-async.el
@@ -59,6 +59,11 @@ Should take same args as `message'."
   :group 'helm-async
   :type  'function)
 
+(defcustom helm-async-log-file "/tmp/helm-async.log"
+  "Where file errors are printed."
+  :group 'helm-async
+  :type 'string)
+
 (defface helm-async-message
     '((t (:foreground "yellow")))
   "Face used for mode-line message.")
@@ -86,8 +91,15 @@ Should take same args as `message'."
   "Callback function used for operation handled by `dired-create-file'."
   (helm-async-mode -1)
   (when helm-async-operation
-    (funcall helm-async-message-function "Asynchronous %s of %s file(s) done"
-             (car helm-async-operation) (cadr helm-async-operation))))
+    (if (file-exists-p helm-async-log-file)
+        (progn
+          (pop-to-buffer (get-buffer-create "*helm async*"))
+          (erase-buffer)
+          (insert "Error: ")
+          (insert-file-contents helm-async-log-file)
+          (delete-file helm-async-log-file))
+        (funcall helm-async-message-function "Asynchronous %s of %s file(s) 
done"
+                 (car helm-async-operation) (cadr helm-async-operation)))))
 
 (defun helm-async-maybe-kill-ftp ()
   "Return a form to kill ftp process in child emacs."
@@ -186,9 +198,13 @@ ESC or `q' to not overwrite any of the remaining files,
     (async-start `(lambda ()
                     (require 'cl) (require 'dired-aux)
                     ,(async-inject-variables helm-async-env-variables-regexp)
-                    (let ((dired-recursive-copies (quote always)))
-                      (loop for (f . d) in (quote ,async-fn-list)
-                            do (funcall (quote ,file-creator) f d t)))
+                    (condition-case err
+                        (let ((dired-recursive-copies (quote always)))
+                          (loop for (f . d) in (quote ,async-fn-list)
+                                do (funcall (quote ,file-creator) f d t)))
+                      (file-error
+                       (with-temp-file ,helm-async-log-file
+                         (insert (format "%S" err)))))
                     ,(helm-async-maybe-kill-ftp))
                  callback)
     (cond



reply via email to

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