doomemacs/modules/lang/plantuml/config.el

39 lines
1.3 KiB
EmacsLisp
Raw Normal View History

2017-07-08 23:05:23 +02:00
;;; lang/plantuml/config.el -*- lexical-binding: t; -*-
(use-package! plantuml-mode
:defer t
2018-02-14 07:40:05 -05:00
:init
2018-03-01 11:16:00 +08:00
(setq plantuml-jar-path (concat doom-etc-dir "plantuml.jar")
org-plantuml-jar-path plantuml-jar-path)
2018-02-14 07:40:05 -05:00
:config
(set-popup-rule! "^\\*PLANTUML" :size 0.4 :select nil :ttl 0))
2017-07-08 23:05:23 +02:00
(use-package! flycheck-plantuml
:when (featurep! :tools flycheck)
2017-07-08 23:05:23 +02:00
:after plantuml-mode
:config (flycheck-plantuml-setup))
;;
;; 1. Add `:cmdline -charset utf-8' to org-src-block:plantuml
;;
;; 2. Fix `@start' prefix execute error
;; When `C-c C-c' is executed in org-src-block:plantuml, if the code starts with
;; `@', execution will go wrong. Must be preceded by `\' or `,' to execute
;; normally. This code is automatically added `\' before `@start' when `C-c C-c'
;; is executed, so that the execution can be carried out normally.
;;
(after! ob-plantuml
(defadvice! +plantuml--fix-atstart-in-org-src-blocks-a (args)
:filter-args #'org-babel-execute:plantuml
(cl-destructuring-bind (body params) args
(let* ((origin-body body)
(fix-body
(replace-regexp-in-string
"^\\w*\\(@start\\)"
"\\\\\\1"
origin-body)))
(list fix-body params))))
(add-to-list 'org-babel-default-header-args:plantuml
'(:cmdline . "-charset utf-8")))