summaryrefslogtreecommitdiff
path: root/lisp/org/ob-plantuml.el
diff options
context:
space:
mode:
authorBastien <bzg@gnu.org>2019-12-03 23:27:04 +0100
committerBastien <bzg@gnu.org>2019-12-03 23:27:04 +0100
commit165f7383822086d465519ebe6e4283723923f097 (patch)
tree820be9480e3d571d766483f564c963037192f6ec /lisp/org/ob-plantuml.el
parent821de968434d2096bdea67dd24301bf6b517aef1 (diff)
downloademacs-165f7383822086d465519ebe6e4283723923f097.tar.gz
emacs-165f7383822086d465519ebe6e4283723923f097.tar.bz2
emacs-165f7383822086d465519ebe6e4283723923f097.zip
Update Org to 9.3
Diffstat (limited to 'lisp/org/ob-plantuml.el')
-rw-r--r--lisp/org/ob-plantuml.el17
1 files changed, 11 insertions, 6 deletions
diff --git a/lisp/org/ob-plantuml.el b/lisp/org/ob-plantuml.el
index 91229a29497..09c9a333463 100644
--- a/lisp/org/ob-plantuml.el
+++ b/lisp/org/ob-plantuml.el
@@ -60,16 +60,19 @@ are expected to be scalar variables."
(defun org-babel-plantuml-make-body (body params)
"Return PlantUML input string.
+
BODY is the content of the source block and PARAMS is a property list
of source block parameters. This function relies on the
`org-babel-expand-body:generic' function to extract `:var' entries
from PARAMS and on the `org-babel-variable-assignments:plantuml'
-function to convert variables to PlantUML assignments."
- (concat
- "@startuml\n"
- (org-babel-expand-body:generic
- body params (org-babel-variable-assignments:plantuml params))
- "\n@enduml"))
+function to convert variables to PlantUML assignments.
+
+If BODY does not contain @startXXX ... @endXXX clauses, @startuml
+... @enduml will be added."
+ (let ((assignments (org-babel-variable-assignments:plantuml params)))
+ (if (string-prefix-p "@start" body t) assignments
+ (format "@startuml\n%s\n@enduml"
+ (org-babel-expand-body:generic body params assignments)))))
(defun org-babel-execute:plantuml (body params)
"Execute a block of plantuml code with org-babel.
@@ -93,6 +96,8 @@ This function is called by `org-babel-execute-src-block'."
" -teps" "")
(if (string= (file-name-extension out-file) "pdf")
" -tpdf" "")
+ (if (string= (file-name-extension out-file) "tex")
+ " -tlatex" "")
(if (string= (file-name-extension out-file) "vdx")
" -tvdx" "")
(if (string= (file-name-extension out-file) "xmi")