Nick Dokos <nicholas.dokos <at> hp.com> writes: > > Luke Crook <luke <at> balooga.com> wrote: > > > Jambunathan K <kjambunathan <at> gmail.com> writes: > > > > > > > > > I changed my code to wait until the 'Git' process completes. Luckily "vc- call- > > backend" returns the async process. > > > > ... or you could use a sentinel > > One bit of defensive programming might be to check that status *is* a > process before you do the wait: vc-do-command returns a real status in > the synchronous case, so if you cut-n-paste this code with some other > command that does not use async, it'll blow up. >
I have modified the code to only check the status if the process is actually running; (with-temp-buffer (let ((status (vc-call-backend backend 'print-log files (current-buffer)))) (when (= 0 (process-exit-status status)) (while (not (eq 'exit (process-status status))) (sit-for 1 t))) I'm not sure about using a sentinel though as this is just a callback that is executed when the process completes. Wouldn't the sentinel fire after the source block has returned? Or do you mean to wait until a variable set by the sentinel returns t? -Luke