Delay mode variable initialization until mode is loaded.

This commit is contained in:
Your Name 2016-10-16 13:37:20 -05:00
parent b931a42237
commit 04a2e7d5d9
1 changed files with 34 additions and 32 deletions

View File

@ -273,7 +273,8 @@ Uses prefix (as PREFIX) to choose where to display it:
(plantuml-preview-region prefix)
(plantuml-preview-buffer prefix)))
(unless plantuml-kwdList
(defun plantuml-init-once ()
(unless plantuml-kwdList
(plantuml-init)
(defvar plantuml-types-regexp (concat "^\\s *\\(" (regexp-opt plantuml-types 'words) "\\|\\<\\(note\\s +over\\|note\\s +\\(left\\|right\\|bottom\\|top\\)\\s +\\(of\\)?\\)\\>\\|\\<\\(\\(left\\|center\\|right\\)\\s +\\(header\\|footer\\)\\)\\>\\)"))
(defvar plantuml-keywords-regexp (concat "^\\s *" (regexp-opt plantuml-keywords 'words) "\\|\\(<\\|<|\\|\\*\\|o\\)\\(\\.+\\|-+\\)\\|\\(\\.+\\|-+\\)\\(>\\||>\\|\\*\\|o\\)\\|\\.\\{2,\\}\\|-\\{2,\\}"))
@ -304,7 +305,7 @@ Uses prefix (as PREFIX) to choose where to display it:
(setq plantuml-types-regexp nil)
(setq plantuml-keywords-regexp nil)
(setq plantuml-builtins-regexp nil)
(setq plantuml-preprocessors-regexp nil))
(setq plantuml-preprocessors-regexp nil)))
(defun plantuml-complete-symbol ()
"Perform keyword completion on word before cursor."
@ -338,6 +339,7 @@ Uses prefix (as PREFIX) to choose where to display it:
Shortcuts Command Name
\\[plantuml-complete-symbol] `plantuml-complete-symbol'"
(plantuml-init-once)
(make-local-variable 'plantuml-output-type)
(set (make-local-variable 'comment-start-skip) "\\('+\\|/'+\\)\\s *")
(set (make-local-variable 'comment-start) "/'")