|
From: | Jorge A. Alfaro-Murillo |
Subject: | Re: [O] How to set a default language for source blocks? |
Date: | Tue, 17 Feb 2015 15:09:20 -0500 |
User-agent: | Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux) |
Hi, Grant. Grant Rettke writes:
It would be simpler to say "this whole document will be R source blocks, unless I specify other wise". I looked at [the spec]. I wanted to obtain this behavior. I couldn't figure out how. Is it possible?
The problem is that if there is nothing after #+BEGIN_SRC, then org-babel-get-src-block-info returns nil. Probably you would have to modify org-babel-get-src-block-info so that it returns a default when there is nothing after #+BEGIN_SRC. But isn't it easier to set org-structure-template-alist as a local buffer variable, say in the first line of your file something like:
#+BEGIN_EXAMPLE# -*- org-structure-template-alist: '(("s" "#+BEGIN_SRC python\n?\n#+END_SRC")) -*-
#+END_EXAMPLEThen <s followed by TAB, would always get you python for that file, for example.
Best, -- Jorge.
[Prev in Thread] | Current Thread | [Next in Thread] |