[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master acb0885 031/187: Several minor fixes
From: |
Michael Albinus |
Subject: |
[elpa] master acb0885 031/187: Several minor fixes |
Date: |
Wed, 30 Dec 2015 11:49:31 +0000 |
branch: master
commit acb0885a583128b10caa81650d8f2b29f7ef4f17
Author: John Wiegley <address@hidden>
Commit: John Wiegley <address@hidden>
Several minor fixes
---
async.el | 53 +++++++++++++++++++++++++++--------------------------
1 files changed, 27 insertions(+), 26 deletions(-)
diff --git a/async.el b/async.el
index f20c9af..b7825c7 100644
--- a/async.el
+++ b/async.el
@@ -79,6 +79,20 @@ as follows:
(defalias 'async-inject-environment 'async-inject-variables)
+(defun async-handle-result (func result buf)
+ (if (null func)
+ (progn
+ (set (make-local-variable 'async-callback-value) result)
+ (set (make-local-variable 'async-callback-value-set) t))
+ (unwind-protect
+ (if (and (listp result)
+ (eq 'async-signal (nth 0 result)))
+ (signal (car (nth 1 result))
+ (cdr (nth 1 result)))
+ (funcall func result))
+ (unless async-debug
+ (kill-buffer buf)))))
+
(defun async-when-done (proc &optional change)
"Process sentinal used to retrieve the value from the child process."
(when (eq 'exit (process-status proc))
@@ -95,20 +109,8 @@ as follows:
(set (make-local-variable 'async-callback-value-set) t))
(goto-char (point-max))
(backward-sexp)
- (let ((result (read (current-buffer))))
- (if (and (listp result)
- (eq 'async-signal (car result)))
- (if (eq 'error (car (cdr result)))
- (error (cadr (cdr result)))
- (signal (cadr result)
- (cddr result)))
- (if async-callback
- (prog1
- (funcall async-callback result)
- (unless async-debug
- (kill-buffer (current-buffer))))
- (set (make-local-variable 'async-callback-value) result)
- (set (make-local-variable 'async-callback-value-set) t)))))
+ (async-handle-result async-callback (read (current-buffer))
+ (current-buffer)))
(set (make-local-variable 'async-callback-value) 'error)
(set (make-local-variable 'async-callback-value-set) t)
(error "Async process '%s' failed with exit code %d"
@@ -150,8 +152,7 @@ as follows:
(async--receive-sexp (unless async-send-over-pipe
command-line-args-left))))
(error
- (backtrace)
- (prin1 `(async-signal . ,err))))))
+ (prin1 (list 'async-signal err))))))
(defun async-ready (future)
"Query a FUTURE to see if the ready is ready -- i.e., if no blocking
@@ -171,9 +172,7 @@ FUTURE is returned by `async-start' or
`async-start-process' when
its FINISH-FUNC is nil."
(with-current-buffer (process-buffer future)
(async-wait future)
- (prog1
- async-callback-value
- (kill-buffer (current-buffer)))))
+ (async-handle-result #'identity async-callback-value (current-buffer))))
(defun async-message-p (value)
"Return true of VALUE is an async.el message packet."
@@ -265,14 +264,16 @@ returns nil. It can still be useful, however, as an
argument to
"emacs" (expand-file-name invocation-name
invocation-directory)
,finish-func
- "-Q" "-l" ,(find-library-name "async")
+ "-Q" "-l" ,(funcall (symbol-function 'find-library-name)
+ "async")
"-batch" "-f" "async-batch-invoke"
- ,@(unless async-send-over-pipe
- '((with-temp-buffer
- (async--insert-sexp (list 'quote sexp))
- (buffer-string)))))))
- ,@(if async-send-over-pipe
- `((async--transmit-sexp ,procvar (list 'quote sexp))))
+ (if async-send-over-pipe
+ "<none>"
+ (with-temp-buffer
+ (async--insert-sexp (list 'quote sexp))
+ (buffer-string))))))
+ (if async-send-over-pipe
+ (async--transmit-sexp ,procvar (list 'quote sexp)))
,procvar)))
(defmacro async-sandbox(func)
- [elpa] master dfaddaa 025/187: Use pipes instead of variable passing, (continued)
- [elpa] master dfaddaa 025/187: Use pipes instead of variable passing, Michael Albinus, 2015/12/30
- [elpa] master d771dff 015/187: Added `async-start-process', Michael Albinus, 2015/12/30
- [elpa] master 66610f4 026/187: smtpmail-async: Report status to user when done, Michael Albinus, 2015/12/30
- [elpa] master b7ec203 021/187: Fix for when async.el is byte-compiled, Michael Albinus, 2015/12/30
- [elpa] master 3f870f5 028/187: Show ops in progress `dired-async-in-process-face', Michael Albinus, 2015/12/30
- [elpa] master 1cec376 030/187: Added async-sandbox, Michael Albinus, 2015/12/30
- [elpa] master 24811ee 027/187: Show full backtraces if `async-debug' is non-nil, Michael Albinus, 2015/12/30
- [elpa] master 15f737f 032/187: Propagate non-zero exit codes as errors, Michael Albinus, 2015/12/30
- [elpa] master eda8d32 035/187: * helm-async.el (dired-create-file): Use quote., Michael Albinus, 2015/12/30
- [elpa] master ec1f0e8 034/187: * helm-async.el: let-bind dired-recursive-copies to 'always to avoid hanging on child., Michael Albinus, 2015/12/30
- [elpa] master acb0885 031/187: Several minor fixes,
Michael Albinus <=
- [elpa] master 49f8b81 038/187: * helm-async.el: Update copyright, Michael Albinus, 2015/12/30
- [elpa] master 416c73a 037/187: * helm-async.el (helm-async-be-async): New, allow turning off async., Michael Albinus, 2015/12/30
- [elpa] master 2db438b 029/187: dired-async now shows progress using overlays, Michael Albinus, 2015/12/30
- [elpa] master c472c4a 036/187: * helm-async.el Return file errors in child Emacs., Michael Albinus, 2015/12/30
- [elpa] master eb26295 033/187: * helm-async.el: New, redefine dired-create-file to work with helm and dired., Michael Albinus, 2015/12/30
- [elpa] master c35324c 043/187: Async queue handling has to happen in dired-async, Michael Albinus, 2015/12/30
- [elpa] master ac1b896 040/187: Minor touches, Michael Albinus, 2015/12/30
- [elpa] master ad07ff3 039/187: Merge pull request #1 from thierryvolpiatto/master, Michael Albinus, 2015/12/30
- [elpa] master 6941276 046/187: * helm-async.el (helm-async-processes): use process-name., Michael Albinus, 2015/12/30
- [elpa] master 1647b97 047/187: * async.el (async-start): Use the possible true name of emacs executable., Michael Albinus, 2015/12/30