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 emacs-lisp :var limit=-1 :var buf=(buffer-name (current-buffer))
:exports results
;; Most of this code is copied from vc.el vc-print-log
(when (vc-find-backend-function (vc-backend (buffer-file-name (get-buffer buf)))
'print-log)
(let ((limit -1)
(vc-fileset nil)
(backend nil)
(files nil))
(with-current-buffer (get-buffer buf)
(setq vc-fileset (vc-deduce-fileset t)) ;FIXME: Why t? --Stef
(setq backend (car vc-fileset))
(setq files (cadr vc-fileset)))
(with-temp-buffer
(let ((status (vc-call-backend backend
'print-log
files
(current-buffer))))
(when (and (processp status) ;; Make sure status is a process
(= 0 (process-exit-status status))) ;; And that it has not
terminated
(while (not (eq 'exit (process-status status))) ;; Loop and sleep
until complete
(sit-for 1 t)))
(buffer-string)))))
#+end_src