From mboxrd@z Thu Jan 1 00:00:00 1970 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 Message-ID: <87k17p4oi5.fsf@nicolasgoaziou.fr> References: <874kzeijnz.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:50010) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iYo6i-0008T2-La for emacs-orgmode@gnu.org; Sun, 24 Nov 2019 04:23:05 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iYo6h-00058u-F8 for emacs-orgmode@gnu.org; Sun, 24 Nov 2019 04:23:04 -0500 Received: from relay1-d.mail.gandi.net ([217.70.183.193]:35617) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iYo6h-00058A-8t for emacs-orgmode@gnu.org; Sun, 24 Nov 2019 04:23:03 -0500 In-Reply-To: <874kzeijnz.fsf@gmail.com> (Terje Larsen's message of "Fri, 08 Nov 2019 14:26:08 +0100") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: Terje Larsen Cc: emacs-orgmode@gnu.org Hello, Terje Larsen 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