From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.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 oZ2oMTNG6GEqZgAAgWs5BA (envelope-from ) for ; Wed, 19 Jan 2022 18:11:15 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id eNgeLDNG6GGzswAAauVa8A (envelope-from ) for ; Wed, 19 Jan 2022 18:11:15 +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 88ABB3DC50 for ; Wed, 19 Jan 2022 18:11:15 +0100 (CET) Received: from localhost ([::1]:36080 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nAEUM-0005yg-N4 for larch@yhetil.org; Wed, 19 Jan 2022 12:11:14 -0500 Received: from eggs.gnu.org ([209.51.188.92]:36924) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nAEEa-0002AJ-1v for emacs-orgmode@gnu.org; Wed, 19 Jan 2022 11:55:02 -0500 Received: from ciao.gmane.io ([116.202.254.214]:47654) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nAEEY-0007Ib-GB for emacs-orgmode@gnu.org; Wed, 19 Jan 2022 11:54:55 -0500 Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1nAEEV-0003ZK-Tr for emacs-orgmode@gnu.org; Wed, 19 Jan 2022 17:54: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: Wed, 19 Jan 2022 23:54:43 +0700 Message-ID: References: <5d7eba13-b717-a12a-5f89-7d2c9414917e@gmail.com> <87y23hr045.fsf@localhost> <1a42304e-47b6-48c3-01b4-6d858ddf7770@gmail.com> <87lezdnpcp.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:78.0) Gecko/20100101 Thunderbird/78.14.0 In-Reply-To: <87lezdnpcp.fsf@localhost> Content-Language: en-US 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.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.248, 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=1642612275; 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=JSZ/532BA17fyUyuKmv4rJJCoZFe6vI2OciiEzLt2tY=; b=TZRv/wZvRxOqB0tmXdzZ4LYQMKp8zO29/EYTayZF7ph65+ztVB+9IirG1Wcq6puXW0rOH+ mMBdFeVtai3dY/dyqL+quQGLkZQF1z45qpEuFYtNfJl+Y6fd9AD+AXCRuOUHYO2Lq3v1V3 KpFFxbVmO/Jbz3vzVeOetrj5LFfJZpOtAPvfGm/FQXsJcC9UFUZFxJcgYPGNmGrSrstIb1 8r3CMshImEQskZCNCkUSWqgkfXorjTb0xrvZ38Q7Mxao2mhmFGv0UGqJ11Kswf56OnWJxx YHa9T+s8V/7WsNi1+IJCxtsyCYcDpl2gBXgdzIySD9nlgES/Gcb5M7bDkWd8uQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1642612275; a=rsa-sha256; cv=none; b=reI1htlaoEwwiLGQpfWE1RHAcbE9JMsjq3JQ5HUeI+H+6ueQkC711gUTD3QY9OSvh7CLsC Unb0dRLdr8PCroOAHDm/9If9yt3N0ZUtZ8fTzIdvtOtcoNUF8VjjZui8B4hR+ZPuVYq4gb jucWyOZjWzQYNfcRY3yYIBzgkv/3a9tdYxp0xaJJoKfKIlEwLlv9zThsCQu5F4ppKlif4R JgMnp5S4cowlTYpYjsUYw1aqVv7g5pDxpyS3jJR9FONLYcp6QhionqT/07p19b7AC7WE07 DtLRuEIafchYFsRVXwc3Y6yWTscSeqC8ikOHjo5xPAKDAlnAmN4MUZsGufGTMw== 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.02 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: 88ABB3DC50 X-Spam-Score: -3.02 X-Migadu-Scanner: scn0.migadu.com X-TUID: XVwJg1EDuG3Q 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.