[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 242ae73 068/187: * helm-async.el: Fix error handling.
From: |
Michael Albinus |
Subject: |
[elpa] master 242ae73 068/187: * helm-async.el: Fix error handling. |
Date: |
Wed, 30 Dec 2015 11:49:44 +0000 |
branch: master
commit 242ae734273162f4ec027618610a099c9a73557b
Author: Thierry Volpiatto <address@hidden>
Commit: Thierry Volpiatto <address@hidden>
* helm-async.el: Fix error handling.
---
helm-async.el | 52 ++++++++++++++++++++++++++--------------------------
1 files changed, 26 insertions(+), 26 deletions(-)
diff --git a/helm-async.el b/helm-async.el
index dc001a8..de5d88b 100644
--- a/helm-async.el
+++ b/helm-async.el
@@ -125,7 +125,7 @@ This allow to turn off async features provided to this
package."
(unless (> (length processes) 1)
(helm-async-mode -1))))
-(defun helm-async-after-file-create ()
+(defun helm-async-after-file-create (len-flist)
"Callback function used for operation handled by `dired-create-file'."
(unless (helm-async-processes)
;; Turn off mode-line notification
@@ -141,8 +141,8 @@ This allow to turn off async features provided to this
package."
(delete-file helm-async-log-file))
(run-with-timer
0.1 nil
- helm-async-message-function "Asynchronous %s of %s file(s) done"
- (car helm-async-operation) (cadr helm-async-operation)))))
+ helm-async-message-function "Asynchronous %s of %s file(s) on %s
file(s) done"
+ (car helm-async-operation) (cadr helm-async-operation) len-flist))))
(defun helm-async-maybe-kill-ftp ()
"Return a form to kill ftp process in child emacs."
@@ -182,8 +182,8 @@ old file was marked."
(setq helm-async-operation nil)
(let (dired-create-files-failures failures async-fn-list
skipped (success-count 0) (total (length fn-list))
- (callback '(lambda (&optional ignore)
- (helm-async-after-file-create))))
+ (callback `(lambda (&optional ignore)
+ (helm-async-after-file-create ,(length fn-list)))))
(let (to overwrite-query
overwrite-backup-query) ; for dired-handle-overwrite
(dolist (from fn-list)
@@ -263,19 +263,7 @@ ESC or `q' to not overwrite any of the remaining files,
failures)
(dired-log "%s `%s' to `%s' failed:\n%s\n"
operation from to err)))))))))
- (when (and async-fn-list helm-async-be-async)
- (async-start `(lambda ()
- (require 'cl) (require 'dired-aux)
- ,(async-inject-variables helm-async-env-variables-regexp)
- (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))
+ ;; Handle error happening in host emacs.
(cond
(dired-create-files-failures
(setq failures (nconc failures dired-create-files-failures))
@@ -297,14 +285,26 @@ ESC or `q' to not overwrite any of the remaining files,
operation (length skipped) total
(dired-plural-s total))
skipped))
- (t
- (if (and async-fn-list helm-async-be-async)
- (progn
- (helm-async-mode 1)
- (setq helm-async-operation (list operation (length fn-list)))
- (message "%s proceeding asynchronously..." operation))
- (message "%s: %s file%s"
- operation success-count (dired-plural-s success-count))))))
+ (t (message "%s: %s file%s"
+ operation success-count (dired-plural-s success-count))))
+ ;; Start async process.
+ (when (and async-fn-list helm-async-be-async)
+ (async-start `(lambda ()
+ (require 'cl) (require 'dired-aux)
+ ,(async-inject-variables helm-async-env-variables-regexp)
+ (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)
+ ;; Run mode-line notifications while process running.
+ (helm-async-mode 1)
+ (setq helm-async-operation (list operation (length async-fn-list)))
+ (message "%s proceeding asynchronously..." operation)))
(unless helm-async-be-async
(dired-move-to-filename)))
- [elpa] master 3ac941a 042/187: Move async.el testing code into its own module, (continued)
- [elpa] master 3ac941a 042/187: Move async.el testing code into its own module, Michael Albinus, 2015/12/30
- [elpa] master 9585ae1 058/187: * helm-async.el (helm-async-env-variables-regexp): Fix for copying from android devices., Michael Albinus, 2015/12/30
- [elpa] master 3544948 064/187: * helm-async.el (dired-create-files): No need to backquote callback., Michael Albinus, 2015/12/30
- [elpa] master 8d38306 063/187: * helm-async.el: Untabify and reindent., Michael Albinus, 2015/12/30
- [elpa] master c029934 066/187: * helm-async.el: Add comments about incompatibility with dired-async.el and async-file.el., Michael Albinus, 2015/12/30
- [elpa] master fb8f10b 065/187: * helm-async.el (dired-create-files): Handle `dired-recursive-copies' when async too., Michael Albinus, 2015/12/30
- [elpa] master bcffaeb 067/187: * helm-async.el (dired-create-file): Revert changes in fb8f10b., Michael Albinus, 2015/12/30
- [elpa] master 8e05e02 070/187: Prevent accidental creation of lexical closures., Michael Albinus, 2015/12/30
- [elpa] master 9c02acd 069/187: Add test for #17., Michael Albinus, 2015/12/30
- [elpa] master 5ef546a 071/187: Have test file add its own directory to load path, Michael Albinus, 2015/12/30
- [elpa] master 242ae73 068/187: * helm-async.el: Fix error handling.,
Michael Albinus <=
- [elpa] master 93b05a9 073/187: More robust evaluation and closure-protection of start-func, Michael Albinus, 2015/12/30
- [elpa] master ba705c6 076/187: Add test for handling different ways of passing a function, Michael Albinus, 2015/12/30
- [elpa] master b6d990d 075/187: Add lexbind test, Michael Albinus, 2015/12/30
- [elpa] master f6d7a74 074/187: Merge pull request #18 from DarwinAwardWinner/lexbind-fix, Michael Albinus, 2015/12/30
- [elpa] master 9b5bb5c 072/187: Add more comprehensive testing for anti-closure feature, Michael Albinus, 2015/12/30
- [elpa] master 204750d 081/187: Revert "* helm-async.el: Fix error handling.", Michael Albinus, 2015/12/30
- [elpa] master b05c63a 083/187: Don't rely on async.el being in load-path., Michael Albinus, 2015/12/30
- [elpa] master 374f514 079/187: Complete the docstring for "async--get-function", Michael Albinus, 2015/12/30
- [elpa] master 9704eb8 080/187: Merge pull request #21 from DarwinAwardWinner/lexbind-fix, Michael Albinus, 2015/12/30
- [elpa] master 4a7b07b 084/187: Merge pull request #23 from DarwinAwardWinner/no-load-path-fix, Michael Albinus, 2015/12/30