1
0
mirror of https://git.savannah.gnu.org/git/emacs/org-mode.git synced 2024-12-28 10:56:57 +00:00

ob-ditaa: now expands tildas in org-ditaa-jar-path

Thanks to John Hendy for pointing out the bad behavior and to Juan
  Pechiar for pointing out the problem in the code

* lisp/ob-ditaa.el (org-babel-execute:ditaa): now expanding
  org-ditaa-jar-path with expand-file-name
This commit is contained in:
Eric Schulte 2010-09-01 18:08:26 -06:00
parent c7ed188859
commit 02e6ee37d3

View File

@ -50,15 +50,18 @@
(defun org-babel-execute:ditaa (body params)
"Execute a block of Ditaa code with org-babel.
This function is called by `org-babel-execute-src-block'."
(let ((result-params (split-string (or (cdr (assoc :results params)) "")))
(out-file (cdr (assoc :file params)))
(cmdline (cdr (assoc :cmdline params)))
(in-file (org-babel-temp-file "ditaa-")))
(let* ((result-params (split-string (or (cdr (assoc :results params)) "")))
(out-file (cdr (assoc :file params)))
(cmdline (cdr (assoc :cmdline params)))
(in-file (org-babel-temp-file "ditaa-"))
(cmd (concat "java -jar "
(shell-quote-argument
(expand-file-name org-ditaa-jar-path))
" " cmdline " " in-file " " out-file)))
(unless (file-exists-p org-ditaa-jar-path)
(error "Could not find ditaa.jar at %s" org-ditaa-jar-path))
(with-temp-file in-file (insert body))
(message (concat "java -jar " org-ditaa-jar-path " " cmdline " " in-file " " out-file))
(shell-command (concat "java -jar " (shell-quote-argument org-ditaa-jar-path) " " cmdline " " in-file " " out-file))
(message cmd) (shell-command cmd)
out-file))
(defun org-babel-prep-session:ditaa (session params)