From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id KOnvJpiH7WHz1wAAgWs5BA (envelope-from ) for ; Sun, 23 Jan 2022 17:51:36 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id 4XuQH5iH7WEQjwAAG6o9tA (envelope-from ) for ; Sun, 23 Jan 2022 17:51:36 +0100 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 18C5610BB7 for ; Sun, 23 Jan 2022 17:51:36 +0100 (CET) Received: from localhost ([::1]:60492 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nBg5X-0004zU-AC for larch@yhetil.org; Sun, 23 Jan 2022 11:51:35 -0500 Received: from eggs.gnu.org ([209.51.188.92]:54008) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nBg4s-0004wi-NQ for emacs-orgmode@gnu.org; Sun, 23 Jan 2022 11:50:54 -0500 Received: from ciao.gmane.io ([116.202.254.214]:33112) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nBg4q-0002Bz-UN for emacs-orgmode@gnu.org; Sun, 23 Jan 2022 11:50:54 -0500 Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1nBg4p-0004oe-1f for emacs-orgmode@gnu.org; Sun, 23 Jan 2022 17:50:51 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: emacs-orgmode@gnu.org From: Max Nikulin Subject: Re: [PATCH] ob-plantuml: Allow setting PlantUML args for jar file Date: Sun, 23 Jan 2022 23:50:42 +0700 Message-ID: References: <5d7eba13-b717-a12a-5f89-7d2c9414917e@gmail.com> <87y23hr045.fsf@localhost> <1a42304e-47b6-48c3-01b4-6d858ddf7770@gmail.com> <87lezdnpcp.fsf@localhost> <87mtjpz22t.fsf@localhost> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Content-Language: en-US In-Reply-To: <87mtjpz22t.fsf@localhost> Received-SPF: pass client-ip=116.202.254.214; envelope-from=geo-emacs-orgmode@m.gmane-mx.org; helo=ciao.gmane.io X-Spam_score_int: 28 X-Spam_score: 2.8 X-Spam_bar: ++ X-Spam_report: (2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_ADSP_CUSTOM_MED=0.001, FORGED_GMAIL_RCVD=1, FORGED_MUA_MOZILLA=2.309, FREEMAIL_FORGED_FROMDOMAIN=0.248, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, NICE_REPLY_A=-0.001, NML_ADSP_CUSTOM_MED=0.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1642956696; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=89EVzQ5PzgEkrUziRlAzY8PJVQKLAvcmGHGXBU12qrY=; b=geU25Fw5rgaertZCqEJPkynWJY+j6tDK/SIZH1BbpPFGdx4HNQJOlV4w9ixBeW3n+ifpI8 aDDLks81Ki1epa8AGBD8bfim57TYhPpGrT+3SfeSgxPU4jaf7q4SKowmLWj5wMMBMUOTSG BIUAuYKPYnTaFUcyRVgNc5shdniJ48Lv/lNHZF9bVZvvNfWdEbpyN8i4w4swSAssyrqC6s 4yXgResmxteG4PpxW5+Umvz2cCPeejDak/ZKwCqc1beat7WGbV3DlfE2SUijjhzxH5Kciu zDggjirQmAS7eo3huXR+H/Epm9+auv7vsCIABPNsytUNQEBzcbEAGEcmuGV7Eg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1642956696; a=rsa-sha256; cv=none; b=JqneRjR9ngEDct033xA20xyGqfRskFhl6sgyVY2rvU4a32JVdfP2KSyuQsU39jCnHzfJEJ S19aZGIqUjBwrukRlq5Cb4COEtIMT7pWcEdyrr+x0iXsJY0audymEHIsuSBcTveFg69Ffi EWEVvzuIL0rAWtm1woyJvOegujwVdSbMtVv8G5i1UOPk2pY93Vu/kX4vsnRs33YWn1eXan 3z+hLDvePRDjMT/X0kPH/8Jz2CDy2NJeUUeJnWdmdMZDKaEAJfl3wSf/SgXLRlRotklABX ZokZZobVUVGvj3+zUxt4ZQ3Z3kC1fK8ONYFpAodH7CWMzLZYRpkjGwhdH5MSnA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -3.33 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 18C5610BB7 X-Spam-Score: -3.33 X-Migadu-Scanner: scn0.migadu.com X-TUID: q5+jih/hFaaP 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.