0

I try to use C-c ' to call org-edit-src-exit to edit "dot" source code. How could I make graphviz-mode the default major mode on that source code editing buffer?

itsjeyd
  • 5,070
  • 2
  • 30
  • 49
enchanter
  • 884
  • 8
  • 20

2 Answers2

3

I have this in some old files, but I'm not currently using any of it so you'll have to research if it works or if you can fix it to apply here.

(add-to-list 'org-src-lang-modes '("dot" . graphviz-dot))
(org-babel-do-load-languages
 'org-babel-load-languages
 '((dot . t)
   (emacs-lisp . t)
   (latex . t)
   (sh . t)
   ))

Be sure to use C-h f = M-x describe-function and C-h v = M-x describe variable, if you're not already familiar with them. (With cursor on (or to the right of?) expression Emacs will guess what term you mean.) It may help you discover the solution given clues.

Brady Trainor
  • 2,026
  • 20
  • 18
1

The mode for Graphviz is graphviz-dot-mode, and it can be installed from MELPA or Marmalade. After that you can specify the mode in the source block like usual:

#+BEGIN_SRC graphviz-dot
...
#_END_SRC
tungd
  • 14,467
  • 5
  • 41
  • 45