emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Max Nikulin <manikulin@gmail.com>
To: emacs-orgmode@gnu.org
Subject: Re: [PATCH] ob-plantuml: Allow setting PlantUML args for jar file
Date: Wed, 19 Jan 2022 23:54:43 +0700	[thread overview]
Message-ID: <ss9fol$cmi$1@ciao.gmane.io> (raw)
In-Reply-To: <87lezdnpcp.fsf@localhost>

On 18/01/2022 20:30, Ihor Radchenko wrote:
> Dejan Josifović writes:
> 
>> But, since ob-plantuml already had variable for arguments for executable
>> it fells natural to me to have customizable variables for when using
>> jar. These headers are of course easier, but the user would have to
>> write them on each source block to achieve something that should be
>> globally customizable (like charset).
> 
> FYI, you can customise any header arg globally. See manual page 16.3
> Using Header Arguments.

info "(org) Using Header Arguments" 
https://orgmode.org/manual/Using-Header-Arguments.html

> #!/bin/bash
> gjl_package=plantuml
> gjl_jar="plantuml.jar"
> source /usr/share/java-config-2/launcher/launcher.bash

It seems with with the suggested patch both -Djava.awt.headless=true and 
-headless are passed to jar. I suspect it is either redundant or 
launcher.bash converts "-headless" to "-Djava.awt.headless=true". In 
ubuntu there is no room for special treatment of "-headless" option by 
the shell wrapper:
--- >8 ----
if [ -n "${JAVA_HOME}" ] && [ -x "${JAVA_HOME}/bin/java" ] ; then
     JAVA="${JAVA_HOME}/bin/java"
elif [ -x /usr/bin/java ] ; then
     JAVA=/usr/bin/java
else
     echo Cannot find JVM
     exit 1
fi

$JAVA -jar -Djava.net.useSystemProxies=true 
/usr/share/plantuml/plantuml.jar ${@}
---- 8< ---

> I feel that running headless mode in the ob-plantuml is deliberate.

https://plantuml.com/faq
"Basically, this is because PlantUML needs to have access to some 
graphical resources"

I have no idea what is actually affected.

Which peace of code (java or plantuml.jar) handles "-headless" option? 
This question affects decision if jar and executable wrapper modes may 
share same list of arguments. Plantuml site recommends namely 
-Djava.awt.headless=true. Anyway with or without the patch, 
"-Djava.awt.headless=true" is added unconditionally in the jar mode. I 
would revert that patch and either add it to java header argument or to 
a new defcustom.

Are there cases when :cmdline header argument is not enough and extra 
custom variable org-plantuml-args (org-plantump-executable-args) should 
be used?

Actually I have realized that I do not understand why babel code uses 
mix of defcustom and header arguments. The latter are more flexible and 
may be adjusted per source block. On the other hand they may be set in 
init file. Even java executable and path to jar file may be obtained 
from header arguments.



  reply	other threads:[~2022-01-19 17:11 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-03 22:56 ob-plantuml: Proposal to add 'jar-args' customizable variable Dejan Josifović
2022-01-06 19:53 ` Dejan Josifović
2022-01-07  4:38   ` Ihor Radchenko
2022-01-08 13:14     ` Dejan Josifović
2022-01-09 17:46 ` Andy Moreton
2022-01-10 16:00   ` Dejan Josifović
2022-01-15  6:20 ` [PATCH] ob-plantuml: Allow setting PlantUML args for jar file Ihor Radchenko
2022-01-16  7:53   ` Max Nikulin
2022-01-17 17:19     ` Dejan Josifović
2022-01-18 13:30       ` Ihor Radchenko
2022-01-19 16:54         ` Max Nikulin [this message]
2022-01-21 12:48           ` Ihor Radchenko
2022-01-23 16:50             ` Max Nikulin
2022-05-08  6:48               ` Ihor Radchenko
2022-01-21 22:22           ` Dejan Josifović

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='ss9fol$cmi$1@ciao.gmane.io' \
    --to=manikulin@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --subject='Re: [PATCH] ob-plantuml: Allow setting PlantUML args for jar file' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Code repositories for project(s) associated with this inbox:

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).