Grant Rettke <g...@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


Reply via email to