From: Eric Schulte <schulte.eric@gmail.com>
To: Sebastien Vauban <wxhgmqzgwmuf@spammotel.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: [babel] VC-Log does not run correctly
Date: Thu, 08 Sep 2011 09:04:48 -0600 [thread overview]
Message-ID: <87sjo76p52.fsf@gmail.com> (raw)
In-Reply-To: 80pqjbce60.fsf@somewhere.org
Hi Seb,
Off the top of my head I would recommend first running the vc-log code
block interactively to see how it behaves, then possibly expanding the
code block with C-c C-v v, copying the results to your scratch buffer,
evaluating the resulting elisp with edebug (C-M-x with a prefix
argument), which will then allow you to step through the code execution
statement by statement. This should help to pinpoint the problem.
Hope this helps -- Eric
"Sebastien Vauban" <wxhgmqzgwmuf@spammotel.com> writes:
> #+TITLE: Last VC Log
> #+AUTHOR: Seb Vauban
> #+DATE: 2011-09-08
> #+LANGUAGE: en
> #+OPTIONS: num:nil toc:nil
>
> * Abstract
>
> I'm trying to get, from the VC backend (currently SVN in my case), the name
> and date of the last committer. Eventually, as well the last log message.
>
> Therefore, I try to use the =vc-log= function in the Library of Babel, copied
> back in this buffer, for the sake of simplicity.
>
> When calling =C-c C-e b= on this buffer, I get asked by Emacs:
>
> "Buffer has a running process; kill it? (yes or no)"
>
> - If I don't say anything, the export process is just hanging in the blue...
>
> - If I say yes, the export process really begins, but there is no vc log
> inserted where I expect it.
>
> - Exactly the same (as if I say yes) happens if I say no: export goes on, but
> no vc log!
>
> What could go wrong here?
>
> * Org Source
>
> #+source: vc-log
> #+headers: :var limit=-1
> #+headers: :var buf=(buffer-name (current-buffer))
> #+begin_src emacs-lisp :exports none
> ;; Most of this code is copied from vc.el vc-print-log
> (require 'vc)
> (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))) ; which has not terminated
> (while (not (eq 'exit (process-status status)))
> (sit-for 1 t)))
> (buffer-string)))))
> #+end_src
>
> Last edited by XXX on XXX
>
> #+call: vc-log()
>
> * HTML Result
>
> #+begin_src html
> Last VC Log
> Org Source
>
> Last edited by XXX on XXX
>
> Working file: c:/home/sva/ecm.org
>
> Date: 2011-09-08
>
> Author: Seb Vauban
> Validate XHTML 1.0
> #+end_src
>
> As you can see, there is no vc log at all, well the header of the vc log
> buffer:
>
> "Working file: c:/home/sva/ecm.org"
>
> * Messages buffer
>
> #+begin_src text
> Export buffer:
> Exporting...
> Running svn status -v ecm.html in foreground...
> Running svn status -v ecm.html...OK = 0
> Position saved to mark ring, go back with M-x org-mark-ring-goto.
> (info) +-> Requiring `help-fns'... already loaded [6 times]
> executing Emacs-Lisp code block (vc-log)...
>
> (buf (quote "ecm.org"))
>
> (limit (quote -1))
>
> Running svn log -rHEAD:0 ecm.org in background... done
> "Working file: c:/home/sva/ecm.org
> "
> (info) +-> Requiring `help-fns'... already loaded
> executing Emacs-Lisp code block...
>
> (results (quote "Working file: c:/home/sva/ecm.org
> "))
>
> Code block evaluation complete.
> org-babel-exp processing...
> org-babel-exp processing...
> Exporting...
> Saving file c:/home/sva/ecm.html...
> Wrote c:/home/sva/ecm.html
> Running svn status -v ecm.html in foreground...
> Running svn status -v ecm.html...OK = 0
> Exporting... done
> #+end_src
>
> Any idea on how to help me going further with this?
>
> Best regards,
> Seb
--
Eric Schulte
http://cs.unm.edu/~eschulte/
next prev parent reply other threads:[~2011-09-08 15:16 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-09-08 14:16 [babel] VC-Log does not run correctly Sebastien Vauban
2011-09-08 15:04 ` Eric Schulte [this message]
2011-09-09 14:50 ` Sebastien Vauban
2011-09-12 12:18 ` Sebastien Vauban
2011-09-09 15:08 ` suvayu ali
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87sjo76p52.fsf@gmail.com \
--to=schulte.eric@gmail.com \
--cc=emacs-orgmode@gnu.org \
--cc=wxhgmqzgwmuf@spammotel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.