From mboxrd@z Thu Jan 1 00:00:00 1970 From: Luke Crook Subject: Re: Using babel to generate a commit log Date: Wed, 30 Mar 2011 18:08:10 +0000 (UTC) Message-ID: References: <814o6l9l9e.fsf@gmail.com> <8526.1301492596@alphaville.dokosmarshall.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Return-path: Received: from [140.186.70.92] (port=38659 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q4zor-0003Zz-4v for emacs-orgmode@gnu.org; Wed, 30 Mar 2011 14:12:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q4zoi-0002Zj-Fv for emacs-orgmode@gnu.org; Wed, 30 Mar 2011 14:08:30 -0400 Received: from lo.gmane.org ([80.91.229.12]:51208) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q4zoi-0002Ze-8z for emacs-orgmode@gnu.org; Wed, 30 Mar 2011 14:08:28 -0400 Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1Q4zof-000374-Hp for emacs-orgmode@gnu.org; Wed, 30 Mar 2011 20:08:25 +0200 Received: from 147.21.8.1 ([147.21.8.1]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 30 Mar 2011 20:08:25 +0200 Received: from luke by 147.21.8.1 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 30 Mar 2011 20:08:25 +0200 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Nick Dokos hp.com> writes: > > Luke Crook balooga.com> wrote: > > > Jambunathan K 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