From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id nIUvNhhn4mFixgAAgWs5BA (envelope-from ) for ; Sat, 15 Jan 2022 07:18:00 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id KOJGMRhn4mFc4AAAauVa8A (envelope-from ) for ; Sat, 15 Jan 2022 07:18:00 +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 D118237392 for ; Sat, 15 Jan 2022 07:17:59 +0100 (CET) Received: from localhost ([::1]:53226 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n8cNy-0004Tn-87 for larch@yhetil.org; Sat, 15 Jan 2022 01:17:58 -0500 Received: from eggs.gnu.org ([209.51.188.92]:50880) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n8cMA-0004Oo-Uw for emacs-orgmode@gnu.org; Sat, 15 Jan 2022 01:16:08 -0500 Received: from [2607:f8b0:4864:20::629] (port=43798 helo=mail-pl1-x629.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n8cM9-00085t-5V for emacs-orgmode@gnu.org; Sat, 15 Jan 2022 01:16:06 -0500 Received: by mail-pl1-x629.google.com with SMTP id e19so14902655plc.10 for ; Fri, 14 Jan 2022 22:16:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:in-reply-to:references:date:message-id :mime-version; bh=fr+lH3aCEw87b2jv318ezBnJevGoHn32llHN6cHxpoE=; b=Fijl55RHidEtQqNLgK3ZaDIrcjWlFaEj31Ed51p+pDzgPsUZOvEDZtSjw1zLr9n4ab gV0glCkIBQlWXXkRMcq97abOP3qaKAtEbp3CH+z52J8LtnmeXsI7boCqVBLlB+SnoL3R ff3v9cQkIuBCp+Gb7BVCKdxDDLVsDR9gHeMbWZqKu8ANaT8+fmR57w+W3zviIJmAAgYV k8Hiv0KsZhLAIWxnF6ucLzv3BpmA09sESu25+h0dkcBSC7eSKVh5EG1F8JdXrCpOM4oK KuN6JlHg/uWPKuhyYIRa9zEGWj23H4jXjwU7QD0L9dMognSlQLxySTkQhVkOqrkRAHAz gDxw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version; bh=fr+lH3aCEw87b2jv318ezBnJevGoHn32llHN6cHxpoE=; b=7IAbydm45fQQQkPn3iiDM7d2LKxAEy/3Fo5goU+B4Kgx8UVXN/AoC0i97mL7NkM6iF EWr9E+ffwg+xBWyLpvqqAbGD1V7ANbzIeny5xjyZeJ7ZFOBSuKm1wD5zznIh0DdTDtZ3 HcYjTVc4Nm3aEx/KSeYJeIb30sGmJBneheM99himM1RpEPcC1861d5YWeGl0hEYtTbUu n/Uq+qejzKJWRY+b2SPsUILajX24Vub2Hzaz3UV2WEiUdx4QUjRSMEfhUnYOIEW9Aa7t TA8bWMU5TX8fUFpaE+WGBm643XKEpOCOtgZHEV12yxFvBlIjI6UVTF+U/eXsLDAidRqs +psg== X-Gm-Message-State: AOAM533x4VqBCpwzqwM8tsmklHyyZNK3/kIQEtd9WCkHBXEXcNPwDEh2 GgjkGoQVbqlY3hXfZ5nF96E= X-Google-Smtp-Source: ABdhPJzNQOUS9uBGQoTiCBPo49TKo0UIj3o1l7KRBP/oFSJSvYQcL8kmDA9AwWpWn35NqM/hpS7qCA== X-Received: by 2002:a17:902:d2ce:b0:14a:9f24:879d with SMTP id n14-20020a170902d2ce00b0014a9f24879dmr1098202plc.10.1642227363102; Fri, 14 Jan 2022 22:16:03 -0800 (PST) Received: from localhost ([45.128.72.3]) by smtp.gmail.com with ESMTPSA id y31sm7992114pfa.67.2022.01.14.22.16.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Jan 2022 22:16:02 -0800 (PST) From: Ihor Radchenko To: Dejan =?utf-8?Q?Josifovi=C4=87?= Subject: [PATCH] ob-plantuml: Allow setting PlantUML args for jar file In-Reply-To: <5d7eba13-b717-a12a-5f89-7d2c9414917e@gmail.com> References: <5d7eba13-b717-a12a-5f89-7d2c9414917e@gmail.com> Date: Sat, 15 Jan 2022 14:20:26 +0800 Message-ID: <87y23hr045.fsf@localhost> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::629 (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::629; envelope-from=yantar92@gmail.com; helo=mail-pl1-x629.google.com X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, 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: , Cc: emacs-orgmode@gnu.org 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=1642227479; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=fr+lH3aCEw87b2jv318ezBnJevGoHn32llHN6cHxpoE=; b=BjUOM7EIEPm5PYlPX4ivg6dQ/hrYlfN+3jCnTACagjLbLeU4HAKCDY0pS03q9qsSIkUgwc Y3xMzdIU2rLisdqtEgG7Gw0qQSp3Oruq7GFZRy2n5O1THygoHjOGgNqB5ZxVNUuxg5xOCw /LQIsjZzKKnwnvBzUEHy/qxQWCwo5hWDgnvAh5RHjkbtEp52C8GndjltEI5i/1g2s1TCNP MjHtvV6HEH8FWy+GvpIcU7BjBjV2681mftBFR5Gr6bTec/t3hDmeCZzlIX4bOWncczvtLL FB9pA4HBGyGuYy+pdR5Lk5mN0wzivHsEZMXIF1kLAY4I4JXM1NBerzkU2DUUcA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1642227479; a=rsa-sha256; cv=none; b=ifVzANiJ09prxif5Z0puklb0n5dD1Ufswr8JVVZcsBEFbl8K/BfOgi7i1wdwLY3SNwknW5 8YBKezd+hXA1yW8aM7BTZ6I1oV53z2mEDBg6ah96EjIOQBfvhvHj8uHkdLB8c9zkpMiql7 RRTbupdu2GlMPP2HEbThAtxTYvuO1/xGsYWajxPh3OWand6Yr90EUkRAVlY3HUZ1Tmy0EW FUyJOyZH+pwXkzUaJP7WUKjnfrqOIndg4Ak/fC9TQJl9dt8ZgGOkn0oSTguXGpTvSwjocd 70bQI5QqYLO8T6nyWj7lOmAIkAv1iB+ipzER4hBZa9TLYc03iNquwy7vrRhP8A== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=Fijl55RH; dmarc=pass (policy=none) header.from=gmail.com; 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: -9.12 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=Fijl55RH; dmarc=pass (policy=none) header.from=gmail.com; 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: D118237392 X-Spam-Score: -9.12 X-Migadu-Scanner: scn0.migadu.com X-TUID: svaU21peBWJ6 --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Dejan Josifovi=C4=87 writes: > Using PlantUML from jar (org-plantuml-jar-path variable) and latest=20 > org-mode, I wanted to render a diagram containing some Unicode=20 > characters (such as '=E2=8A=A5' and '=E2=88=80'), but the end image had s= ome gibberish=20 > instead. However, > trying this from a standalone file using plantuml-mode[1], the end image= =20 > rendered correctly. Here is some sample code which can reproduce the issu= e: > > #+BEGIN_SRC plantuml :file ./test.png > A -> B: =E2=88=80 characters display correctly is =E2=8A=A5 > #+END_SRC FYI, I am unable to reproduce it on my system. > Comparing ob-plantuml.el and plantuml-mode.el files I found what is the=20 > problem. plantuml-mode has a customizable variable for specifying=20 > arguments when using PlantUML from jar (plantuml-jar-args (list=20 > "-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. I have > searched the mailing list archives, confirmed bugs and help page and=20 > couldn't find anything related. 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. Then, users might do something like (setq org-plantuml-jar-path "/usr/share/plantuml/lib/plantuml.jar") (setq org-plantuml-args (list "-headless" "-theme" "aws-orange")) and set a global PlantUML theme. See the attached patch. It appears that we can simply carry over the executable args to jar (but please test it on other systems!) Best, Ihor --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-ob-plantuml-Allow-setting-PlantUML-args-for-jar-file.patch >From 87accd87fa189198e69632da6081f60bc247ad94 Mon Sep 17 00:00:00 2001 Message-Id: <87accd87fa189198e69632da6081f60bc247ad94.1642227388.git.yantar92@gmail.com> From: Ihor Radchenko Date: Sat, 15 Jan 2022 14:14:36 +0800 Subject: [PATCH] ob-plantuml: Allow setting PlantUML args for jar file * lisp/ob-plantuml.el (org-plantuml-args): Rename `org-plantuml-executable-args' to `org-plantuml-args'. (org-babel-execute:plantuml): Use `org-plantuml-args' when calling jar. * lisp/org-compat.el (org-plantuml-executable-args): Obsolete old variable name. * etc/ORG-NEWS (=org-plantump-executable-args= is renamed and applies to jar as well): Document change. --- etc/ORG-NEWS | 6 ++++++ lisp/ob-plantuml.el | 15 ++++++++------- lisp/org-compat.el | 3 +++ 3 files changed, 17 insertions(+), 7 deletions(-) diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS index 335db4139..d311d495c 100644 --- a/etc/ORG-NEWS +++ b/etc/ORG-NEWS @@ -98,6 +98,12 @@ argument. ~org-get-tags~ now accepts Org element or buffer position as first argument. +** Removed or renamed functions and variables +*** =org-plantump-executable-args= is renamed and applies to jar as well + +The new variable name is =org-plantump-args=. It now applies to both +jar PlantUML file and executable. + ** Miscellaneous *** Styles are customizable in ~biblatex~ citation processor diff --git a/lisp/ob-plantuml.el b/lisp/ob-plantuml.el index d237b0fe3..ddc2ff3dc 100644 --- a/lisp/ob-plantuml.el +++ b/lisp/ob-plantuml.el @@ -65,8 +65,8 @@ (defcustom org-plantuml-executable-path "plantuml" :package-version '(Org . "9.4") :type 'string) -(defcustom org-plantuml-executable-args (list "-headless") - "The arguments passed to plantuml executable when executing PlantUML." +(defcustom org-plantuml-args (list "-headless") + "The arguments passed to plantuml when executing PlantUML." :group 'org-babel :package-version '(Org . "9.4") :type '(repeat string)) @@ -116,15 +116,16 @@ (defun org-babel-execute:plantuml (body params) (java (or (cdr (assq :java params)) "")) (executable (cond ((eq org-plantuml-exec-mode 'plantuml) org-plantuml-executable-path) (t "java"))) - (executable-args (cond ((eq org-plantuml-exec-mode 'plantuml) org-plantuml-executable-args) + (executable-args (cond ((eq org-plantuml-exec-mode 'plantuml) org-plantuml-args) ((string= "" org-plantuml-jar-path) (error "`org-plantuml-jar-path' is not set")) ((not (file-exists-p org-plantuml-jar-path)) (error "Could not find plantuml.jar at %s" org-plantuml-jar-path)) - (t (list java - "-Djava.awt.headless=true" - "-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)))) (full-body (org-babel-plantuml-make-body body params)) (cmd (mapconcat #'identity (append diff --git a/lisp/org-compat.el b/lisp/org-compat.el index 14f6bc8dc..1d6c35e9a 100644 --- a/lisp/org-compat.el +++ b/lisp/org-compat.el @@ -351,6 +351,9 @@ (make-obsolete 'org-attach-expand-link "No longer used" "9.4") (define-obsolete-function-alias 'org-file-url-p 'org-url-p "9.5") +(define-obsolete-variable-alias 'org-plantuml-executable-args 'org-plantuml-args + "Org 9.6") + (defun org-in-fixed-width-region-p () "Non-nil if point in a fixed-width region." (save-match-data -- 2.34.1 --=-=-=--