emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] ob-plantuml: Allow setting PlantUML args for jar file


From: Max Nikulin
Subject: Re: [PATCH] ob-plantuml: Allow setting PlantUML args for jar file
Date: Sun, 16 Jan 2022 14:53:22 +0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0

Hi.

Disclaimer: I am neither plantuml nor ditaa user, so my comments may have no sense.

On 15/01/2022 13:20, Ihor Radchenko wrote:
Dejan Josifović writes:

Comparing ob-plantuml.el and plantuml-mode.el files I found what is the
problem. plantuml-mode has a customizable variable for specifying
arguments when using PlantUML from jar (plantuml-jar-args (list
"-charset" "UTF-8" ). The charset arguments is what is needed for
the images to render correctly (I confirmed it by implementing it locally).

I was wondering why such variable doesn't exist in ob-plantuml.

Dejan, have you tried :java or :cmdline header arguments?

Even though I was unable to reproduce your problem (most likely because
my system is different), it sounds like a good idea to allow users to
customise jar args as well.

I agree that arguments should be customizable when the application is launched from jar, but there are already :java argument that is inserted before jar file and :cmdline argument that is appended after it.

Another consideration is that ob-ditaa and ob-plantuml should use similar set of header arguments for additional parameters. They (and third-party packages) may even share some parameters related to java executable location and arguments for tuning of java VM (memory limits, etc.).

See the attached patch. It appears that we can simply carry over the
executable args to jar (but please test it on other systems!)

-                               (t (list java
-                                        "-Djava.awt.headless=true"

(unrelated to this patch) The line above is a recent change, and I do not see a reason why it is not added in a customizable way through appending (:java "-Djava.awt.headless=true") to `org-babel-default-header-args:plantuml'. Maybe I just missed something stupid since I have not tried it.

-                                        "-jar"
-                                        (shell-quote-argument 
(expand-file-name org-plantuml-jar-path))))))
+                               (t `(,java
+                                    "-Djava.awt.headless=true"
+                                    "-jar"
+                                    ,(shell-quote-argument (expand-file-name 
org-plantuml-jar-path))
+                                     ,@org-plantuml-args))))

Is there a case when some arguments are suitable for dedicated binary but should be avoided for jar (when a user has both executable from system package and manually downloaded jar having newer version)? It may be a reason to have separate variables (or header arguments).

I suppose, a part of problem that there are no plantuml and ditaa users and subscribers of this list who are ready to discuss code of related babel packages.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]