branch: externals/async commit a982ab7a9a72c99b3867a6fb5a123f724ddcadcb Author: Matus Goljer <matus.gol...@gmail.com> Commit: Matus Goljer <matus.gol...@gmail.com>
docs: add note about how to use result of child async-send --- async.el | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/async.el b/async.el index 28b9a87c2b..3761354f73 100644 --- a/async.el +++ b/async.el @@ -400,6 +400,16 @@ When done, the return value is passed to FINISH-FUNC. Example: (message \"Async process done, result should be 222: %s\" result))) +If you call `async-send' from a child process, the message will +be also passed to the FINISH-FUNC. You can test RESULT to see if +it is a message by using `async-message-p'. If nil, it means +this is the final result. Example of the FINISH-FUNC: + + (lambda (result) + (if (async-message-p result) + (message \"Received a message from child process: %s\" result) + (message \"Async process done, result: %s\" result))) + If FINISH-FUNC is nil or missing, a future is returned that can be inspected using `async-get', blocking until the value is ready. Example: