Use txt instead of txt as it directly maps to plantuml-server URLs

This commit is contained in:
Carlo Sciolla 2019-05-25 20:32:20 +02:00
parent 7a4e8d7908
commit 6ae98ae7ef
No known key found for this signature in database
GPG Key ID: BA5D71E6F3C580C1
2 changed files with 7 additions and 7 deletions

View File

@ -274,10 +274,10 @@
(defvar plantuml-output-type (defvar plantuml-output-type
(if (not (display-images-p)) (if (not (display-images-p))
"utxt" "txt"
(cond ((image-type-available-p 'svg) "svg") (cond ((image-type-available-p 'svg) "svg")
((image-type-available-p 'png) "png") ((image-type-available-p 'png) "png")
(t "utxt"))) (t "txt")))
"Specify the desired output type to use for generated diagrams.") "Specify the desired output type to use for generated diagrams.")
(defun plantuml-read-output-type () (defun plantuml-read-output-type ()
@ -287,7 +287,7 @@
(append (append
(and (image-type-available-p 'svg) '("svg")) (and (image-type-available-p 'svg) '("svg"))
(and (image-type-available-p 'png) '("png")) (and (image-type-available-p 'png) '("png"))
'("utxt")))) '("txt"))))
(completing-read (format "Output type [%s]: " plantuml-output-type) (completing-read (format "Output type [%s]: " plantuml-output-type)
available-types available-types
nil nil
@ -306,7 +306,7 @@ default output type for new buffers."
(defun plantuml-is-image-output-p () (defun plantuml-is-image-output-p ()
"Return non-nil if the diagram output format is an image, false if it's text based." "Return non-nil if the diagram output format is an image, false if it's text based."
(not (equal "utxt" plantuml-output-type))) (not (equal "txt" plantuml-output-type)))
(defun plantuml-output-type-opt () (defun plantuml-output-type-opt ()
"Create the flag to pass to PlantUML to produce the selected output format." "Create the flag to pass to PlantUML to produce the selected output format."

View File

@ -11,13 +11,13 @@
(defun assert-preview (puml output &optional format) (defun assert-preview (puml output &optional format)
(if format (if format
(setq plantuml-output-type format) (setq plantuml-output-type format)
(setq plantuml-output-type "utxt")) (setq plantuml-output-type "txt"))
(plantuml-preview-string 42 (read-test-file puml)) (plantuml-preview-string 42 (read-test-file puml))
(sleep-for 3) (sleep-for 3)
(should (equal (format-preview-output (replace-regexp-in-string " " "~" (read-test-file output))) (should (equal (format-preview-output (replace-regexp-in-string " " "~" (read-test-file output)))
(format-preview-output (replace-regexp-in-string " " "~" (read-preview-buffer)))))) (format-preview-output (replace-regexp-in-string " " "~" (read-preview-buffer))))))
(ert-deftest preview-utxt-test () (ert-deftest preview-txt-test ()
(setq-local plantuml-jar-path plantuml-test-jar-path) (setq-local plantuml-jar-path plantuml-test-jar-path)
(assert-preview "a-b.puml" "a-b.txt")) (assert-preview "a-b.puml" "a-b.txt"))