Capture stderr separately from the image output

Fix #135
This commit is contained in:
Oleksandr Shulgin 2021-12-14 18:07:55 +01:00
parent ea45a13707
commit 43aeadd996
1 changed files with 21 additions and 12 deletions

View File

@ -324,6 +324,7 @@
(setq found (search-forward ";" nil nil))))))) (setq found (search-forward ";" nil nil)))))))
(defconst plantuml-preview-buffer "*PLANTUML Preview*") (defconst plantuml-preview-buffer "*PLANTUML Preview*")
(defconst plantuml-stderr-buffer "*PLANTUML Stderr*")
(defvar plantuml-output-type (defvar plantuml-output-type
(if (not (display-images-p)) (if (not (display-images-p))
@ -373,21 +374,29 @@ Note that output type `txt' is promoted to `utxt' for better rendering."
(let ((java-args (if (<= 8 (plantuml-jar-java-version)) (let ((java-args (if (<= 8 (plantuml-jar-java-version))
(remove "--illegal-access=deny" plantuml-java-args) (remove "--illegal-access=deny" plantuml-java-args)
plantuml-java-args))) plantuml-java-args)))
(apply #'start-process (apply #'make-process
"PLANTUML" buf plantuml-java-command (list
`(,@java-args :name "PLANTUML"
,(expand-file-name plantuml-jar-path) :buffer buf
,(plantuml-jar-output-type-opt plantuml-output-type) :stderr (get-buffer-create plantuml-stderr-buffer)
,@plantuml-jar-args :command (cons plantuml-java-command
"-p")))) (append java-args
(list (expand-file-name plantuml-jar-path)
(plantuml-jar-output-type-opt plantuml-output-type))
plantuml-jar-args
(list "-p")))))))
(defun plantuml-executable-start-process (buf) (defun plantuml-executable-start-process (buf)
"Run PlantUML as an Emacs process and puts the output into the given buffer (as BUF)." "Run PlantUML as an Emacs process and puts the output into the given buffer (as BUF)."
(apply #'start-process (apply #'make-process
"PLANTUML" buf plantuml-executable-path (list
`(,@plantuml-executable-args :name "PLANTUML"
,(plantuml-jar-output-type-opt plantuml-output-type) :buffer buf
"-p"))) :stderr (get-buffer-create plantuml-stderr-buffer)
:command (cons plantuml-executable-path
(append plantuml-executable-args
(list (plantuml-jar-output-type-opt plantuml-output-type)
"-p"))))))
(defun plantuml-update-preview-buffer (prefix buf) (defun plantuml-update-preview-buffer (prefix buf)
"Show the preview in the preview buffer BUF. "Show the preview in the preview buffer BUF.