emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] How to set a default language for source blocks?


From: Rasmus
Subject: Re: [O] How to set a default language for source blocks?
Date: Tue, 17 Feb 2015 20:51:53 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux)

Grant Rettke <address@hidden> 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

[Prev in Thread] Current Thread [Next in Thread]