From: Rasmus <rasmus@gmx.us>
To: emacs-orgmode@gnu.org
Subject: Re: How to set a default language for source blocks?
Date: Tue, 17 Feb 2015 20:51:53 +0100 [thread overview]
Message-ID: <87r3to48py.fsf@gmx.us> (raw)
In-Reply-To: CAAjq1mcgqbcEXJoJm_d_8cFGNeZv+1D6Yr=6P3x7F2ohzUUYog@mail.gmail.com
Grant Rettke <gcr@wisdomandwonder.com> writes:
> Just read [this] question. It is interesting. We always want to optimize
> our documents. Re-use reduces errors. Defining `:header-args:foo:
> :session *bar*' is a great example. Rather than having to type it 100
> times all over, just do it once. It never occurred to be that we might
> want to default the language for a source block. It should have. 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? I didn't look
> at the parser, is that the right place to look to answer questions like
> this?
You don't have to check the implementation, you can simply check the Org
syntax¹.
Blocks
Like greater blocks, pattern for blocks is:
#+BEGIN_NAME DATA
CONTENTS
#+END_NAME
NAME cannot contain any whitespace character.
[...] If it is “SRC”, it will be a “source block” [...]
DATA can contain any character but a new line. It can be ommitted,
unless the block is a “source block”. In this case, it must follow the
pattern “LANGUAGE SWITCHES ARGUMENTS”, where SWITCHES and ARGUMENTS
are optional.
—Rasmus
Footnotes:
¹ http://orgmode.org/worg/dev/org-syntax.html
--
The right to be left alone is a human right
next prev parent reply other threads:[~2015-02-17 19:52 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 [this message]
2015-02-17 20:09 ` Jorge A. Alfaro-Murillo
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
List information: https://www.orgmode.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87r3to48py.fsf@gmx.us \
--to=rasmus@gmx.us \
--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 public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).