[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/async 666066d 14/60: Merge pull request #72 from jwiegl
From: |
Stefan Monnier |
Subject: |
[elpa] externals/async 666066d 14/60: Merge pull request #72 from jwiegley/Fix_async_ready |
Date: |
Tue, 8 Oct 2019 10:11:29 -0400 (EDT) |
branch: externals/async
commit 666066d30a420d86801d8380f5991f2b82471107
Merge: 54977d6 d1273c8
Author: John Wiegley <address@hidden>
Commit: GitHub <address@hidden>
Merge pull request #72 from jwiegley/Fix_async_ready
Fix and clarify async-ready, async-get and async-wait (#71).
---
async.el | 24 ++++++++++++++++--------
1 file changed, 16 insertions(+), 8 deletions(-)
diff --git a/async.el b/async.el
index 0bb45fa..30476e2 100644
--- a/async.el
+++ b/async.el
@@ -169,24 +169,32 @@ as follows:
(prin1 (list 'async-signal err)))))))
(defun async-ready (future)
- "Query a FUTURE to see if the ready is ready -- i.e., if no blocking
+ "Query a FUTURE to see if it is ready.
+
+I.e., if no blocking
would result from a call to `async-get' on that FUTURE."
(and (memq (process-status future) '(exit signal))
- (with-current-buffer (process-buffer future)
- async-callback-value-set)))
+ (let ((buf (process-buffer future)))
+ (if (buffer-live-p buf)
+ (with-current-buffer buf
+ async-callback-value-set)
+ t))))
(defun async-wait (future)
"Wait for FUTURE to become ready."
(while (not (async-ready future))
- (sit-for 0.05)))
+ (sleep-for 0.05)))
(defun async-get (future)
- "Get the value from an asynchronously function when it is ready.
+ "Get the value from process FUTURE when it is ready.
FUTURE is returned by `async-start' or `async-start-process' when
its FINISH-FUNC is nil."
- (async-wait future)
- (with-current-buffer (process-buffer future)
- (async-handle-result #'identity async-callback-value (current-buffer))))
+ (and future (async-wait future))
+ (let ((buf (process-buffer future)))
+ (when (buffer-live-p buf)
+ (with-current-buffer buf
+ (async-handle-result
+ #'identity async-callback-value (current-buffer))))))
(defun async-message-p (value)
"Return true of VALUE is an async.el message packet."
- [elpa] externals/async 0190fb8 05/60: Allow passing any value to async-let bindings., (continued)
- [elpa] externals/async 0190fb8 05/60: Allow passing any value to async-let bindings., Stefan Monnier, 2019/10/08
- [elpa] externals/async 9ff4d18 12/60: Revert renaming of async-wait to async--wait (#71)., Stefan Monnier, 2019/10/08
- [elpa] externals/async d1273c8 13/60: Using sleep-for instead of sit-for in async-wait prevent infloop (#71)., Stefan Monnier, 2019/10/08
- [elpa] externals/async 8bc0678 01/60: Fix home url in *pkg.el., Stefan Monnier, 2019/10/08
- [elpa] externals/async a2196f7 03/60: Add `async-let' macro, Stefan Monnier, 2019/10/08
- [elpa] externals/async 1dd865c 09/60: Add some documentation in README for async-let., Stefan Monnier, 2019/10/08
- [elpa] externals/async 57f5d81 06/60: Allow passing multiple forms to async-let, Stefan Monnier, 2019/10/08
- [elpa] externals/async 31b1691 02/60: Don't query in set-visited-file-name., Stefan Monnier, 2019/10/08
- [elpa] externals/async 8242878 08/60: Merge pull request #69 from jwiegley/async_let, Stefan Monnier, 2019/10/08
- [elpa] externals/async 2018523 15/60: Inject nsm-* vars in smtp-mail for emacs-25+ (#75)., Stefan Monnier, 2019/10/08
- [elpa] externals/async 666066d 14/60: Merge pull request #72 from jwiegley/Fix_async_ready,
Stefan Monnier <=
- [elpa] externals/async 54977d6 10/60: Improve formatting in README., Stefan Monnier, 2019/10/08
- [elpa] externals/async e1a3735 20/60: Merge branch 'master' of github.com:jwiegley/emacs-async, Stefan Monnier, 2019/10/08
- [elpa] externals/async d6222c2 22/60: Ensure wdired-use-interactive-rename is disabled., Stefan Monnier, 2019/10/08
- [elpa] externals/async d422df5 24/60: Add new var to allow calling emacs with -Q or -q (#80)., Stefan Monnier, 2019/10/08
- [elpa] externals/async c3b297f 27/60: Merge pull request #83 from darkfeline/lighter, Stefan Monnier, 2019/10/08
- [elpa] externals/async 4e894a2 16/60: Update README., Stefan Monnier, 2019/10/08
- [elpa] externals/async 324549b 36/60: Merge pull request #94 from astahlman/auto-select-coding, Stefan Monnier, 2019/10/08
- [elpa] externals/async d13c0bc 35/60: Choose coding system based on environment, Stefan Monnier, 2019/10/08
- [elpa] externals/async 890b38f 18/60: Add makefile., Stefan Monnier, 2019/10/08
- [elpa] externals/async afd1ad5 39/60: Allow removing text properties in strings when injecting, Stefan Monnier, 2019/10/08