From: jorge.alfaro-murillo@yale.edu (Jorge A. Alfaro-Murillo)
To: emacs-orgmode@gnu.org
Subject: Re: How to set a default language for source blocks?
Date: Tue, 17 Feb 2015 15:09:20 -0500 [thread overview]
Message-ID: <87r3to5mhb.fsf@yale.edu> (raw)
In-Reply-To: CAAjq1mcgqbcEXJoJm_d_8cFGNeZv+1D6Yr=6P3x7F2ohzUUYog@mail.gmail.com
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_EXAMPLE
Then <s followed by TAB, would always get you python for that
file, for example.
Best,
--
Jorge.
next prev parent reply other threads:[~2015-02-17 20:14 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-17 19:44 How to set a default language for source blocks? Grant Rettke
2015-02-17 19:51 ` Rasmus
2015-02-17 20:09 ` Jorge A. Alfaro-Murillo [this message]
2015-02-18 2:26 ` Grant Rettke
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87r3to5mhb.fsf@yale.edu \
--to=jorge.alfaro-murillo@yale.edu \
--cc=emacs-orgmode@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.