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 07:57:03 +0000 (UTC) Message-ID: References: <814o6l9l9e.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Return-path: Received: from [140.186.70.92] (port=38423 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q4qKD-0001kP-RG for emacs-orgmode@gnu.org; Wed, 30 Mar 2011 04:00:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q4qK6-0006G2-Hi for emacs-orgmode@gnu.org; Wed, 30 Mar 2011 04:00:15 -0400 Received: from lo.gmane.org ([80.91.229.12]:42189) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q4qK6-0006Fw-6S for emacs-orgmode@gnu.org; Wed, 30 Mar 2011 04:00:14 -0400 Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1Q4qJy-00012H-Jp for emacs-orgmode@gnu.org; Wed, 30 Mar 2011 10:00:06 +0200 Received: from pool-173-55-252-200.lsanca.fios.verizon.net ([173.55.252.200]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 30 Mar 2011 10:00:06 +0200 Received: from luke by pool-173-55-252-200.lsanca.fios.verizon.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 30 Mar 2011 10:00:06 +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 Jambunathan K gmail.com> writes: > > Luke Crook balooga.com> writes: > > > 2) I have to add at delay of at least 5 seconds (set-for 5 t) as vc-git calls > > "git log" as an asynchronous process. If not for the delay then babel > > immediately returns an empty buffer and the "vc-call-backend" process never > > completes. > > > > Is there a better way that I can accomplish (2) ? > > Quick hints if you are willing to settle for some hacks. > > In vc-do-command, you may have to set OKSTATUS to 0. Track > `vc-disable-async-diff' in vc.el and vc-svn.el for possible hints. > I changed my code to wait until the 'Git' process completes. Luckily "vc-call- backend" returns the async process. #+begin_src emacs-lisp :var limit="" :file test.log :exports results ;; Most of this code is copied from vc.el vc-print-log (when (vc-find-backend-function (vc-backend (buffer-file-name (current-buffer))) 'print-log) (let* ((limit (if (numberp limit) limit vc-log-show-limit)) (vc-fileset (vc-deduce-fileset t)) ;FIXME: Why t? --Stef (backend (car vc-fileset)) (files (cadr vc-fileset))) (with-temp-buffer (let ((status (vc-call-backend backend 'print-log files (current-buffer)))) (while (not (eq 'exit (process-status status))) (sit-for 1 t)) (buffer-string))))) #+end_src -Luke