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: Sun, 23 Jan 2022 23:50:42 +0700	[thread overview]
Message-ID: <ssk114$hhb$1@ciao.gmane.io> (raw)
In-Reply-To: <87mtjpz22t.fsf@localhost>

On 21/01/2022 19:48, Ihor Radchenko wrote:
> Max Nikulin writes:

I have reordered some parts of your message

> I do not see much point customising this particular argument. We _do
> not_ want plantuml in gui mode. Ever. Otherwise, babel behaviour will be
> unpredictable. If we make it customizeable, the only "benefit" would be
> allowing users to shoot their own leg.

I have tried plantuml and it does not start in GUI mode unless -gui 
option is specified. I admit it might be not so kind in the past. If you 
mean the following thread

Sun Lin. Subject: [PATCH] Fix DISPLAY error on exporting org with 
plantuml to html. Sat, 16 Oct 2021 03:25:40 +0000 (UTC) 
https://list.orgmode.org/388850760.3644614.1634354740816@mail.yahoo.com/

than it is some strange use case. A lot of applications behave 
incorrectly when DISPLAY environment variable has invalid value. So it 
is responsibility of the user to reset it. On the other hand I believe 
that nobody is still using e.g. remote font server and headless mode 
might be a bit more reproducible (e.g. screen dpi can not affect result).

Actually you patch makes headless mode customizable and I do not 
consider it as shooting somebody's foot:

> +(defcustom org-plantuml-args (list "-headless")

So in my opinion dropping "-Djava.awt.headless=true" is just a step to 
more consistent behavior for jar/wrapper modes.

> if (argsArray.length > 0 && argsArray[0].equalsIgnoreCase("-headless")) {
> 			System.setProperty("java.awt.headless", "true");
> 		}

Thank you it makes thing more clear. By the way, latest wrapper in 
ubuntu has the following code

---- >8 ----
HEADLESS=
[ -z "$DISPLAY" ] && HEADLESS=-Djava.awt.headless=true

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

> I realise that the current situation is kind of awkward. Maybe we should
> encourage ob-* libraries to use special header args instead of
> defcustoms and modify built-in libraries in this spirit. Would you be
> interested to write a feature request?

I do not have clear vision how it should work yet. I am afraid that even 
if I were dump current state of ideas, they would be lost and nobody 
would remind about them when the question would be risen next time.

I do not object concerning common `org-plantuml-args' variable. Earlier 
I had in mind that user might have incompatible versions of plantuml 
installed as executable wrapper and available as another jar. Separate 
args variable might make it easier to switch between wrapper/jar modes. 
I do not think it is a case that must be supported, anyway it is 
currently impossible to switch mode through header arguments, e.g. to 
demonstrate version difference.

On 15/01/2022 13:20, Ihor Radchenko wrote:
> Dejan Josifović writes:
> 
>> Using PlantUML from jar (org-plantuml-jar-path variable) and latest 
>> org-mode, I wanted to render a diagram containing some Unicode 
>> characters (such as '⊥' and '∀'), but the end image had some gibberish 
>> instead.
>>
>> #+BEGIN_SRC plantuml :file ./test.png
>> A -> B: ∀ characters display correctly is ⊥
>> #+END_SRC
> 
> FYI, I am unable to reproduce it on my system.

Default charset depends on locale:

LANG=C plantuml -h | grep charset
     -charset xxx	To use a specific charset (default is US-ASCII)

plantuml -h | grep charset
     -charset xxx	To use a specific charset (default is UTF-8)

echo $LANG
en_US.UTF-8

To wrap up, I suggest (and I do not insist) to drop 
"-Djava.awt.headless=true" since "-headless" is anyway added in jar 
mode. Those who desperately need namely "-Djava.awt.headless=true" (for 
some unknown to me reason) may customize :java header argument. I do not 
see any real problem with the change, just a minor improvement.



  reply	other threads:[~2022-01-23 16:51 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
2022-01-21 12:48           ` Ihor Radchenko
2022-01-23 16:50             ` Max Nikulin [this message]
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='ssk114$hhb$1@ciao.gmane.io' \
    --to=manikulin@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public 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).