In org-mode, is there a variable/const/whatever containing a list of all languages supported in "BEGIN/END_SRC" blocks?
Are there any other methods to list them? (except parsing a list of ob-*.el files)
Emacs Stack Exchange is a question and answer site for those using, extending or developing Emacs. It only takes a minute to sign up.Sign up to join this community
There is no limitation.
org-src-lang-modes is a variable defined in `org-src.el'. Its value is shown below. Documentation: Alist mapping languages to their major mode. The key is the language name, the value is the string that should be inserted as the name of the major mode. For many languages this is simple, but for language where this is not the case, this variable provides a way to simplify things on the user side. For example, there is no ocaml-mode in Emacs, but the mode to use is `tuareg-mode'. You can customize this variable. Value: (("ocaml" . tuareg) ("elisp" . emacs-lisp) ("ditaa" . artist) ("asymptote" . asy) ("dot" . fundamental) ("sqlite" . sql) ("calc" . fundamental) ("C" . c) ("cpp" . c++) ("C++" . c++) ("screen" . shell-script))
If there is no built in support,
org-mode will try to find a mode named after whatever you named the source block. That is, if you have a source block such as:
#+BEGIN_SRC whatever-language-you-want #+END_SRC
And you press
C-c ' inside it, you'll see the echo
No such language mode: whatever-language-you-want-mode.
For Babel evaluation support, see: http://orgmode.org/manual/Languages.html#Languages
org-babel-load-languages lists all the languages that can currently be evaluated in a org-mode buffer. The default is just
emacs-lisp. More may (will) be available but won't be evaluatable by default.
You still get syntax highlighting of other languages as long as the corresponding major mode is installed.