emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [O] Setting multiple variables for code blocks in one property drawe


From: Eric Schulte
Subject: Re: [O] Setting multiple variables for code blocks in one property drawer
Date: Sat, 18 Feb 2012 08:32:30 -0700
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.93 (gnu/linux)

Viktor Rosenfeld <address@hidden> writes:

> Hi Eric,
>
> thanks for your input. I just pulled the latest code from git and while
> my original example works, the following does not:
>
> :PROPERTIES:
> :var: foo=1
> :var+: bar=2 
> :var+: baz=3
> :END:
>
> #+BEGIN_SRC sh
> echo foo: $foo
> echo bar: $bar
> echo baz: $baz
> #+END_SRC
>

Thanks for reporting, I've just pushed up a fix for this bug.

>
> There also appears to be a difference between quoted and unquoted
> values and commatas. E.g. the following works
>
> :PROPERTIES:
> :var: foo=1
> :var+: bar="2", baz=3
> :END:
>
> #+BEGIN_SRC sh
> echo foo: $foo
> echo bar: $bar
> echo baz: $baz
> #+END_SRC
>
> If I remove the quotes around 2 I get the following error: 
>
>   ad-Orig-error: reference '2,' not found in this buffer
>
> On the other hand, the following version does not produce an error, but
> the value of $baz is not set.
>
> :PROPERTIES:
> :var: foo=1
> :var+: bar="2",
> :var+: baz=3
> :END:
>
> #+BEGIN_SRC sh
> echo foo: $foo
> echo bar: $bar
> echo baz: $baz
> #+END_SRC
>

Yes, the comma results in the 2 not being parsed as a number, which
means that it will then try to be understood by Babel (which thinks
first of a reference unless the value is wrapped in quotes indicating it
is a string).  The moral is to not give references purely numerical
names.

Best,

>
> Cheers,
> Viktor
>
> Eric Schulte wrote:
>
>> Viktor Rosenfeld <address@hidden> writes:
>> 
>> > Hi,
>> >
>> > after following the discussion about the new BABEL syntax I was under
>> > the impression that the following should work to set two variables in
>> > one PROPERTIES drawer:
>> >
>> > :PROPERTIES:
>> > :var: foo=1
>> > :var+: bar=2
>> > :END:
>> >
>> > However, the definition of bar is ignored. It turns out that there can
>> > only be one :var: or :var+: entry in a drawer and the latter can only be
>> > used to append to inherited entries, but not to those defined in the
>> > same drawer. Is this the intended behavior? How would I define multiple
>> > variables in a drawer (except for putting them all on one line)?
>> >
>> > Thanks,
>> > Viktor
>> >
>> 
>> You are correct, I believe this is a bug.  I've just pushed up a fix, so
>> your example above should now work as expected.
>> 
>> Thanks,
>> 
>> -- 
>> Eric Schulte
>> http://cs.unm.edu/~eschulte/
>> 
>

-- 
Eric Schulte
http://cs.unm.edu/~eschulte/



reply via email to

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