From: akrl <akrl@sdf.org>
To: help-gnu-emacs@gnu.org
Subject: about async process
Date: Sat, 25 Aug 2018 18:15:50 +0000 [thread overview]
Message-ID: <xjfbm9qe2i1.fsf@sdf.org> (raw)
Hi all,
the question is: when is the process buffer updated after an async
process finish to execute?
This is what I'm trying to do:
(make-thread (lambda ()
(let ((prc
(start-process-shell-command "test"
"out-buff"
"echo foo")))
(while (not (equal (process-status prc)
'exit))
(thread-yield))
(with-current-buffer "out-buff"
(print (buffer-string))
(sleep-for 0.1)
(print (buffer-string))))))
I'm trying to execut an async process in a thread yielding till this has
finished and then reading the output.
When I execute this code the first print is printing "" and just the
second print after the sleep il latching the output I would expect.
So my question is when is the output buffer updated and if ther's a way to
ensure this has happend or to request for it?
Bests and thanks
Andrea
--
akrl@sdf.org
next reply other threads:[~2018-08-25 18:15 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-25 18:15 akrl [this message]
2018-08-25 18:39 ` about async process Eli Zaretskii
[not found] ` <mailman.5535.1535223078.1292.help-gnu-emacs@gnu.org>
2018-08-25 19:51 ` akrl
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xjfbm9qe2i1.fsf@sdf.org \
--to=akrl@sdf.org \
--cc=help-gnu-emacs@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.