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)


There is no limitation.

org-src-lang-modes is a variable defined in `org-src.el'.
Its value is shown below.

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

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


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

| improve this answer | |
  • 1
    "you'll see the echo No such language mode: whatever-language-you-want-mode"... except if you have whatever-language-you-want-mode installed. Also, you should probably make it clear that this variable is not the one the OP is looking for, but instead the answer is "all languages for which there is a mode defined". – T. Verron Dec 17 '14 at 15:52

The variable 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.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.