emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [TASK] Allow customizeable ditaa executable in ob-ditaa.el


From: Max Nikulin
Subject: Re: [TASK] Allow customizeable ditaa executable in ob-ditaa.el
Date: Thu, 9 Nov 2023 19:17:19 +0700
User-agent: Mozilla Thunderbird

On 09/11/2023 10:17, Leo Butler wrote:
While I was reviewing the documentation, ob-doc-ditaa.org, and the
source, ob-ditaa.el, I realized that there is a simple way to run a
script file instead of a jar file.

diff --git a/lisp/ob-ditaa.el b/lisp/ob-ditaa.el
index fa864c7bc..4a2b09cd9 100644
--- a/lisp/ob-ditaa.el
+++ b/lisp/ob-ditaa.el
@@ -100,11 +100,13 @@ (defun org-babel-execute:ditaa (body params)
                     "epstopdf"
                     " " eps-file
                     " -o=" (org-babel-process-file-name out-file))))
+ (jar (org-string-nw-p (if eps org-ditaa-eps-jar-path org-ditaa-jar-path)))
         (cmd (concat org-babel-ditaa-java-cmd
-                     " " java " " org-ditaa-jar-option " "
-                     (shell-quote-argument
-                      (expand-file-name
-                       (if eps org-ditaa-eps-jar-path org-ditaa-jar-path)))
+                     " " java
+                     (and jar
+                          (concat
+                            " " org-ditaa-jar-option " "
+                            (shell-quote-argument (expand-file-name jar))))
                      " " cmdline
                      " " (org-babel-process-file-name in-file)
                      " " (if pdf-cmd

should allow to set :java to

    flatpak-spawn --host toolbox run /usr/bin/ditaa

without abusing of org-ditaa-jar-path. Untested.

It is better to avoid obstacles than to document them.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]