Open dieggsy opened 7 years ago
Sorry for late reply.
Seems like the docstring of async-start
is wrong or at least confusing.
async-wait
is not really meant to be use alone, AFAIU it is an internal function which should be renamed with internal prefix i.e async--wait
.
What you want to use here, I guess is async-get
, which is meant to be used on a FUTURE (the result of an async-start
call) called with a nil callback, e.g
(async-get
(async-start
(lambda () (message "hello") )
nil))
And perhaps there is a bug here when it returns error "selecting deleted buffer" with a call like this:
(async-get
(async-start
(lambda () (message "hello") )
'ignore))
@jwiegley WDYT
And I am wrong about async-wait
which should not be internal as I said above, it is useful to as its name say to wait the FUTURE is ready to send its result:
(let ((proc (async-start
(lambda () (message "hello")))))
(async-wait proc)
(async-get proc))
@jwiegley can you clarify about async-wait
usage ? Perhaps an example in the test file ?
The documentation for
async-start
says:But I'm finding some errors when this is the case. As minimal examples:
and
Both return the error
selecting deleted buffer
.