summaryrefslogtreecommitdiff
path: root/lisp/ob-ditaa.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/ob-ditaa.el')
-rw-r--r--lisp/ob-ditaa.el18
1 files changed, 11 insertions, 7 deletions
diff --git a/lisp/ob-ditaa.el b/lisp/ob-ditaa.el
index 26f0e4f..888cafc 100644
--- a/lisp/ob-ditaa.el
+++ b/lisp/ob-ditaa.el
@@ -90,6 +90,14 @@ This function is called by `org-babel-execute-src-block'."
(java (cdr (assoc :java params)))
(in-file (org-babel-temp-file "ditaa-"))
(eps (cdr (assoc :eps params)))
+ (eps-file (when eps
+ (org-babel-process-file-name (concat in-file ".eps"))))
+ (pdf-cmd (when (and (or (string= (file-name-extension out-file) "pdf")
+ (cdr (assoc :pdf params))))
+ (concat
+ "epstopdf"
+ " " eps-file
+ " -o=" (org-babel-process-file-name out-file))))
(cmd (concat org-babel-ditaa-java-cmd
" " java " " org-ditaa-jar-option " "
(shell-quote-argument
@@ -97,13 +105,9 @@ This function is called by `org-babel-execute-src-block'."
(if eps org-ditaa-eps-jar-path org-ditaa-jar-path)))
" " cmdline
" " (org-babel-process-file-name in-file)
- " " (org-babel-process-file-name out-file)))
- (pdf-cmd (when (and (or (string= (file-name-extension out-file) "pdf")
- (cdr (assoc :pdf params))))
- (concat
- "epstopdf"
- " " (org-babel-process-file-name (concat in-file ".eps"))
- " -o=" (org-babel-process-file-name out-file)))))
+ " " (if pdf-cmd
+ eps-file
+ (org-babel-process-file-name 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))