From: Perry Smith <pedzsan@gmail.com>
To: help-gnu-emacs List <help-gnu-emacs@gnu.org>
Subject: waiting for asynchronous processes
Date: Sat, 15 Oct 2011 12:20:44 -0500 [thread overview]
Message-ID: <C218972F-12B5-4044-BA25-1ECC959E9A34@gmail.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 671 bytes --]
I was trying to write a keyboard macro that included using grep and the first hit that it found. The problem was that I had to wait for the grep to finish. I'm not sure why but (sit-for 1) didn't work.
I started looking for a built in way to wait for an asynchronous command to complete and discovered that I had written one long long time ago in a galaxy far far away.
> (defun wait-for-async-process ( proc )
> "Wait for PROC to finish"
> (while (null (eq (process-status proc) 'exit))
> (accept-process-output)))
I went ahead and looked for something like it in the distribution but didn't see it.
I'm curious if I overlooked it.
pedz
[-- Attachment #2: Type: text/html, Size: 1250 bytes --]
next reply other threads:[~2011-10-15 17:20 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-10-15 17:20 Perry Smith [this message]
2011-10-15 22:24 ` waiting for asynchronous processes Štěpán Němec
2011-10-16 0:17 ` Perry Smith
2011-10-16 1:15 ` Štěpán Němec
2011-10-16 1:49 ` Perry Smith
2011-10-16 9:16 ` Štěpán Němec
2011-10-16 12:49 ` Perry Smith
2011-10-16 9:21 ` Thien-Thi Nguyen
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=C218972F-12B5-4044-BA25-1ECC959E9A34@gmail.com \
--to=pedzsan@gmail.com \
--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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).