help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

waiting for asynchronous processes


From: Perry Smith
Subject: waiting for asynchronous processes
Date: Sat, 15 Oct 2011 12:20:44 -0500

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


reply via email to

[Prev in Thread] Current Thread [Next in Thread]