Well there are exceptions to all rules aren't there?

Yes, strictly speaking, for shell scripts, only 'sh' fits with the
<lang>-mode rule. However, that mode is also slightly different from
other language modes in that it supports many shell 'dialects'.

The thing is, the more 'liberal' we are with what we allow as the name
of the source block language, the more complex any additional
functionality becomes - I think your original issue is an example of
this. Allowing 'elisp' seem reasonable, but then other functions which
work with source blocks now also need to know that 'elisp' is an alias
for 'emacs-lisp'.

There are probably other inconsistencies which will 'fail' in some
situations. For example, I wonder about 'javascript' and 'js2'.
Jack Kamm <jackk...@gmail.com> writes:

> Tim Cross <theophil...@gmail.com> writes:
>
>> All other language specifiers comply to the pattern of source block
>> languages being the language major mode name without the '-mode', but
>> there is no elisp-mode.
>
> Sorry to be pedantic, but I think shell source blocks are another
> exception here. They can use various synonyms for the source language,
> such as "shell", "sh", or any other name in org-babel-shell-names. Also,
> while "shell-mode" is a major-mode, it is not the mode used by the
> source buffer -- it is the mode used for the interactive shell created
> by the `shell' command.


--
Tim Cross

Reply via email to