reddit / emacs

Issue with setting up PlantUML

rgmundo524 · 2022-06-19 02:37
Like the title says, I am having an issue setting up plantUML. Particularly I am having an issue with getting a preview from a plantuml org src block. I have tried everything I know to get it working and it keeps giving the error `‘org-plantuml-jar-path’ is not set` when it is. Also if i try to switch from plantuml.jar to using an executable, it still gives me the same error. config snippet ``` ;; #----=[plantuml]=----# (use-package plantuml-mode :mode "(\\.\\(plantuml?\\|uml\\|puml\\)\\'" :config (setq plantuml-executable-path "/nix/store/5iwqfbb371aa1l8lfk3dq1k3lpgklv22-system-path/bin/plantuml") (setq plantuml-default-exec-mode 'executable) ;; (setq plantuml-jar-path (expand-file-name "~/libraries/plantuml-1.2022.5.jar")) ;; (setq plantuml-default-exec-mode 'jar) ;; (setq plantuml-default-exec-mode 'server) (setq plantuml-indent-level 2) (setq my/plantuml-indent-regexp-return "^\s*return\s+.+$") (add-to-list 'auto-mode-alist '("\\.plantuml\\'" . plantuml-mode)) (add-to-list 'auto-mode-alist '("\\.uml\\'" . plantuml-mode))) ``` [screenshot of the issue](https://imgur.com/a/PEAjFtz) even when the jar section is uncommented and the executable section is commented. I have been messing with using a plantuml server instead but I have not gotten it to work. If anyone has any idea of how to help, I would appreciate it. Although I can use the `plantuml` command from a terminal, I would prefer to do it from within the org file. Thanks in advance!
kaushalmodi · 2022-06-19 06:04
As the error says, you need to set `org-plantuml-jar-path`. But it looks like you are setting `plantuml-jar-path` instead. [my config](https://github.com/kaushalmodi/.emacs.d/blob/9dd2db554765b3eed2353ccbe0934a464787919d/setup-files/setup-org.el#L1526) -- As you can see, I'm not doing any extra setup for plantuml except for setting that one variable.
organic-bookworm · 2022-06-19 12:05
I remember this confused me as well, so I'll expand [/u/kaushalmodi](https://www.reddit.com/r/emacs/comments/vfldyd/comment/icx0jcg/) comment just a bit. You use two **independent** things: * [`plantuml-mode`](https://github.com/skuro/plantuml-mode) A package implementing major mode for PlantUML **syntax highlighting**. It also provides utilities for code evaluation, unrelated to `org-mode`. * [`ob-plantuml`](https://orgmode.org/worg/org-contrib/babel/languages/ob-doc-plantuml.html) A library implementing PlantUML code block **evaluation** for `org-mode`. In the snippet provided you only setup variables related to the former. See [PlantUML Code Blocks in Babel](https://orgmode.org/worg/org-contrib/babel/languages/ob-doc-plantuml.html) for setting up `ob-plantuml`. Related user options org-plantuml-exec-mode org-plantuml-jar-path org-plantuml-executable-args org-plantuml-executable-path
rgmundo524 · 2022-06-19 19:25
~~What fustrates me is that the~~ [~~github~~](https://github.com/skuro/plantuml-mode#execution-modes) ~~doesnt have org in front of these variables, ugh...~~ Ahh I see how I messed up. But both of you (u/kaushalmodi & u/organic-bookworm) are right. Thanks
organic-bookworm · 2022-06-19 21:00
> What fustrates me is that the github doesnt have org in front of these variables, ugh... That's why I've emphasized "independent". These two just happen to overlap in functionality... And variable names a bit. You could uninstall `plantuml-mode` and still evaluate Org src blocks, but without syntax highlighting. Or you could drop Org and generate diagrams using `plantuml-mode` own facilities.