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

2011-03-31 Thread Luke Crook
Eric Schulte schulte.eric at gmail.com writes: Since this could be generally useful would you be willing to add it to the library of babel (org/contrib/babel/library-of-babel.org)? That would be great. If so then if you could supply a few explanatory sentences, I'll add those and the code

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

2011-03-31 Thread Eric Schulte
Luke Crook l...@balooga.com writes: Eric Schulte schulte.eric at gmail.com writes: Since this could be generally useful would you be willing to add it to the library of babel (org/contrib/babel/library-of-babel.org)? That would be great. If so then if you could supply a few explanatory

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

2011-03-30 Thread Jambunathan K
Luke Crook l...@balooga.com writes: I have written the following code that uses the Emacs vc-* commands to generate a commit log. I would like the output of this code to be included when my file is exported. #+begin_src emacs-lisp :var limit= ;; Most of this code is copied from vc.el

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

2011-03-30 Thread Luke Crook
Suvayu Ali fatkasuvayu+linux at gmail.com writes: On Wed, 30 Mar 2011 05:38:41 + (UTC) Luke Crook luke at balooga.com wrote: 1) The code between #+begin_src and #+end_src is exported and not the result of evaluating the code (the commit log). [...] How can I fix (1).

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

2011-03-30 Thread Luke Crook
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

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

2011-03-30 Thread Nick Dokos
Luke Crook l...@balooga.com wrote: Suvayu Ali fatkasuvayu+linux at gmail.com writes: On Wed, 30 Mar 2011 05:38:41 + (UTC) Luke Crook luke at balooga.com wrote: 1) The code between #+begin_src and #+end_src is exported and not the result of evaluating the code (the commit

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

2011-03-30 Thread Nick Dokos
Luke Crook l...@balooga.com wrote: 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

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

2011-03-30 Thread Luke Crook
Nick Dokos nicholas.dokos at hp.com writes: Luke Crook luke at balooga.com wrote: Suvayu Ali fatkasuvayu+linux at gmail.com writes: Have you tried ':exports results' as a header argument? I just tried ':exports results'. But now I get the following error when exporting

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

2011-03-30 Thread Nick Dokos
Luke Crook l...@balooga.com wrote: Nick Dokos nicholas.dokos at hp.com writes: Luke Crook luke at balooga.com wrote: Suvayu Ali fatkasuvayu+linux at gmail.com writes: Have you tried ':exports results' as a header argument? I just tried ':exports results'. But now

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

2011-03-30 Thread Luke Crook
Nick Dokos nicholas.dokos at hp.com writes: Luke Crook luke at balooga.com wrote: 'C-c C-c' at the top of the source block does generate the correct output though. It is just 'C-c C-e export backend' that returns this error. Right: (current-buffer) is not what you think it is when

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

2011-03-30 Thread Luke Crook
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

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

2011-03-30 Thread Luke Crook
Luke Crook luke at balooga.com writes: Nick Dokos nicholas.dokos at hp.com writes: There is a way to get the original buffer during capture, but I don't know of a similar mechanism during export. I hardwired the file name instead, but I got no further than the vc-fileset call: there

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

2011-03-30 Thread Nick Dokos
Luke Crook l...@balooga.com wrote: 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

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

2011-03-30 Thread Eric Schulte
Luke Crook l...@balooga.com writes: Nick Dokos nicholas.dokos at hp.com writes: Luke Crook luke at balooga.com wrote: 'C-c C-c' at the top of the source block does generate the correct output though. It is just 'C-c C-e export backend' that returns this error. Right:

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

2011-03-30 Thread Nick Dokos
Eric Schulte schulte.e...@gmail.com wrote: Yes, this makes sense thanks. I'll create another thread asking how to retrieve the original buffer during the export process. It is true that export takes place in a fresh Org-mode buffer, however the header arguments of Org-mode code

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

2011-03-30 Thread Luke Crook
Eric Schulte schulte.eric at gmail.com writes: Luke Crook luke at balooga.com writes: I have written the following code that uses the Emacs vc-* commands to generate a commit log. Is there a reason this processing takes place using Emacs Lisp rather than a simple shell code block,

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

2011-03-30 Thread Luke Crook
Eric Schulte schulte.eric at gmail.com writes: It is true that export takes place in a fresh Org-mode buffer, however the header arguments of Org-mode code blocks are guaranteed to be evaluated in the original buffer, so a trick like the following can be used to grab the original buffer.

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

2011-03-30 Thread Luke Crook
Luke Crook luke at balooga.com writes: Eric Schulte schulte.eric at gmail.com writes: #+begin_src emacs-lisp :var buf=(buffer-file-name (current-buffer)) :exports both (message buffer %S! buf) #+end_src The following code will now generate the commit log. #+begin_src

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

2011-03-30 Thread Eric Schulte
Luke Crook l...@balooga.com writes: Luke Crook luke at balooga.com writes: Eric Schulte schulte.eric at gmail.com writes: #+begin_src emacs-lisp :var buf=(buffer-file-name (current-buffer)) :exports both (message buffer %S! buf) #+end_src The following code will now