[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] ob-plantuml: Support for plantuml as well as the current jav
From: |
Nicolas Goaziou |
Subject: |
Re: [PATCH] ob-plantuml: Support for plantuml as well as the current java+jar solution |
Date: |
Sun, 24 Nov 2019 10:22:58 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) |
Hello,
Terje Larsen <address@hidden> writes:
> And also see attached within this mail.
Thank you.
Could you rebase it on top of "next" branch and add an entry in
ORG-NEWS, section "Org 9.4" about it?
> +(defcustom org-plantuml-exec-mode 'jar
> + "Method to use for PlantUML diagram generation.
> +`jar' means to use java together with the JAR.
> +The JAR can be configured via `org-plantuml-jar-path'.
> +
> +`plantuml' means to use the PlantUML executable.
> +The executable can be configured via `org-plantuml-executable-path'.
> +You can also configure extra arguments via `org-plantuml-executable-args'."
> + :group 'org-babel
> + :version "24.1"
Please use
:package-version '(Org . "9.4")
instead.
> +(defcustom org-plantuml-executable-path "plantuml"
> + "Path to the PlantUML executable."
File name of the PlantUML executable.
> +(defcustom org-plantuml-executable-args (list "-headless")
> + "The arguments passed to plantuml executable when executing PlantUML."
> + :group 'org-babel
> + :version "24.1"
See above.
> + (executable-args (cond ((eq org-plantuml-exec-mode 'plantuml)
> org-plantuml-executable-args)
> + (t (cond ((string= "" org-plantuml-jar-path)
> + (error "`org-plantuml-jar-path' is
> not set"))
> + ((not (file-exists-p
> org-plantuml-jar-path))
> + (error "Could not find plantuml.jar
> at %s" org-plantuml-jar-path))
> + (t (list java
> + "-jar"
> + (shell-quote-argument
> + (expand-file-name
> org-plantuml-jar-path))))))))
Could you merge the two `cond' in `executable-args'?
> + (cmd (string-join
> + (append
> + (list executable)
> + executable-args
> + (cond ((string= (file-name-extension out-file) "png")
> '("-tpng"))
> + ((string= (file-name-extension out-file) "svg")
> '("-tsvg"))
> + ((string= (file-name-extension out-file) "eps")
> '("-teps"))
> + ((string= (file-name-extension out-file) "pdf")
> '("-tpdf"))
> + ((string= (file-name-extension out-file) "tex")
> '("-tlatex"))
> + ((string= (file-name-extension out-file) "vdx")
> '("-tvdx"))
> + ((string= (file-name-extension out-file) "xmi")
> '("-txmi"))
> + ((string= (file-name-extension out-file) "scxml")
> '("-tscxml"))
> + ((string= (file-name-extension out-file) "html")
> '("-thtml"))
> + ((string= (file-name-extension out-file) "txt")
> '("-ttxt"))
> + ((string= (file-name-extension out-file) "utxt")
> '("-utxt")))
Could you use
(pcase (file-name-extension out-file)
("png" ...)
...)
instead?
Regards,
--
Nicolas Goaziou