lang/plantuml: force ob-plantuml to build w/ plantuml-mode
It is more sophisticated and robust.
This commit is contained in:
parent
fa9001aacb
commit
0b1f3567a3
2 changed files with 57 additions and 23 deletions
|
@ -1,12 +1,17 @@
|
|||
;;; lang/plantuml/config.el -*- lexical-binding: t; -*-
|
||||
|
||||
(use-package! plantuml-mode
|
||||
:defer t
|
||||
:commands plantuml-download-jar
|
||||
:init
|
||||
(setq plantuml-jar-path (concat doom-etc-dir "plantuml.jar")
|
||||
org-plantuml-jar-path plantuml-jar-path)
|
||||
:config
|
||||
(set-popup-rule! "^\\*PLANTUML" :size 0.4 :select nil :ttl 0))
|
||||
(set-popup-rule! "^\\*PLANTUML" :size 0.4 :select nil :ttl 0)
|
||||
|
||||
(setq plantuml-default-exec-mode
|
||||
(cond ((executable-find "plantuml") 'executable)
|
||||
((file-exists-p plantuml-jar-path) 'jar)
|
||||
(plantuml-default-exec-mode))))
|
||||
|
||||
|
||||
(use-package! flycheck-plantuml
|
||||
|
@ -16,19 +21,9 @@
|
|||
|
||||
|
||||
(after! ob-plantuml
|
||||
(defadvice! +plantuml--fix-atstart-in-org-src-blocks-a (args)
|
||||
"Fix error when executing plantuml src blocks in org-mode for code that
|
||||
begins with '@'. This character needs to be escaped with a backslash or comma
|
||||
for the block to execute correctly, so we do it automatically."
|
||||
:filter-args #'org-babel-execute:plantuml
|
||||
(cl-destructuring-bind (body params) args
|
||||
(let* ((origin-body body)
|
||||
(fix-body
|
||||
(replace-regexp-in-string
|
||||
"^[[:blank:]\n]*\\(@start\\)"
|
||||
"\\\\\\1"
|
||||
origin-body)))
|
||||
(list fix-body params))))
|
||||
|
||||
;; HACK We force ob-plantuml to use `plantuml-mode''s building mechanism,
|
||||
;; which is more sophisticated.
|
||||
(advice-add #'org-babel-execute:plantuml
|
||||
:override #'+plantuml-org-babel-execute:plantuml-a)
|
||||
(add-to-list 'org-babel-default-header-args:plantuml
|
||||
'(:cmdline . "-charset utf-8")))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue