emacs-orgmode
[Top][All Lists]
Advanced

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

[O] Re: Using babel to generate a commit log


From: Luke Crook
Subject: [O] Re: Using babel to generate a commit log
Date: Wed, 30 Mar 2011 07:57:03 +0000 (UTC)
User-agent: Loom/3.14 (http://gmane.org/)

Jambunathan K <kjambunathan <at> gmail.com> writes:

> 
> Luke Crook <luke <at> 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




reply via email to

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