reddit / emacs

Indentation question (org, plantuml)

HappyDancingApe · 2022-07-17 11:13
I've been playing with plantuml src in org files to generate drawings. It works great except for one thing, the indentation gets lost when I add nested objects. Where should I look to extend the existing indentation code to handle nested cases? Minor modes enabled in this buffer: Display-Line-Numbers Font-Lock Org-Src Visual-Line The major mode is plantuml mode defined in plantuml-mode.el: Should I be looking at the plantuml major mode first, or the Org-src minor mode to noodle with the indents? Any recommendations on how to approach indentation config? Example showing how the indents get lost: * Components Drawing #+begin_src plantuml :file ComponentDiagram.svg @startuml Component Diagram ' Components component ExternaComponent1 package "Subsystem" { component SubSysComp1 [ Subsystem Component 1 ] package "InternalNestedSubsystem" { package "InternalDoubleNestedSubsystem" { component SubSubComp1 [ Sub-Subsystem Component 1 ] component SubSubComp2 [ Sub-Subsystem Component 2 ] SubSubComp1 -() internalInterface1 internalInterface1 )- SubSubComp2 } ' This lines up correctly } ' This should be one indent to the left } ' This should be all the way to the left @enduml ' This should be all the way to the left instead of indented. #+end_src
jackson15j · 2022-07-18 22:17
Check the issues list: https://github.com/skuro/plantuml-mode/issues for other indentation issues and PRs. However, it looks like the maintainer is not around anymore to merge code in.
HappyDancingApe · 2022-07-20 05:06
In case anyone else runs into this issue, or any indentation issues with plantuml-mode, there is a way to force the indent to move in or out with a comment From the plantuml-mode.el file: ;; - you can though somewhat correct mis-indentation by adding in '-comment lines ;; PLANTUML\_MODE\_INDENT\_INCREASE and/or PLANTUML\_MODE\_INDENT\_DECREASE ;; to increase and/or decrease the level of indentation ;; (Note: the line with the comment should not contain any text matching other indent ;; regexp or this user-control instruction will be ignored; also at most will count ;; per line ...)