Browse Source

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.

See the discussion in https://list.orgmode.org/orgmode/87y23hr045.fsf@localhost/
Ihor Radchenko 3 năm trước cách đây
mục cha
commit
b5f0efc049
3 tập tin đã thay đổi với 14 bổ sung7 xóa
  1. 5 0
      etc/ORG-NEWS
  2. 7 7
      lisp/ob-plantuml.el
  3. 2 0
      lisp/org-compat.el

+ 5 - 0
etc/ORG-NEWS

@@ -224,6 +224,11 @@ files that are exported to Texinfo.
 
 =org-at-heading-p= now returns t by default on headings inside folds.
 Passing optional argument will produce the old behaviour.
+** Removed or renamed functions and variables
+*** =org-plantump-executable-args= is renamed and applies to jar as well
+
+The new variable name is =org-plantuml-args=.  It now applies to both
+jar PlantUML file and executable.
 
 ** Miscellaneous
 

+ 7 - 7
lisp/ob-plantuml.el

@@ -65,8 +65,8 @@ You can also configure extra arguments via `org-plantuml-executable-args'."
   :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,15 @@ This function is called by `org-babel-execute-src-block'."
 	 (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
+				     "-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

+ 2 - 0
lisp/org-compat.el

@@ -471,6 +471,8 @@ Counting starts at 1."
 (define-obsolete-variable-alias 'org-reveal-start-hook
   'org-fold-reveal-start-hook "9.6")
 (define-obsolete-function-alias 'org-file-url-p 'org-url-p "9.6")
+(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