From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Schulte Subject: Re: Setting multiple variables for code blocks in one property drawer Date: Sat, 25 Feb 2012 12:11:18 -0700 Message-ID: <87ipiuenjd.fsf@gmx.com> References: <20120209124619.GA29989@kenny.local> <87haysuo20.fsf@gmx.com> <20120215191245.GA20893@client194-112.wlan.hu-berlin.de> <87ty2orw7b.fsf@gmx.com> <20120220114320.GA8866@client195-190.wlan.hu-berlin.de> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([208.118.235.92]:54327) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S1N1m-0001xr-HQ for emacs-orgmode@gnu.org; Sat, 25 Feb 2012 14:11:36 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S1N1h-0002ZN-AC for emacs-orgmode@gnu.org; Sat, 25 Feb 2012 14:11:30 -0500 Received: from mailout-us.gmx.com ([74.208.5.67]:42334 helo=mailout-us.mail.com) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1S1N1h-0002ZF-3y for emacs-orgmode@gnu.org; Sat, 25 Feb 2012 14:11:25 -0500 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Hi, Viktor Rosenfeld writes: > Hi Eric, > > Eric Schulte wrote: > >> Viktor Rosenfeld 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. > > Thanks for your fix. The above example now works for me. > > However, I've noticed a problem with inheriting var properties. They are > inherited in a child task only if the child task itself has no var > property. Is this the intended behavior? See the example below. > Yes, The example below is the intended behavior. The property mechanism is not tailored to variable setting, but is rather a general mechanism for the concatenation of property strings. Any property specification unless it is postfixed with a "+" will /reset/ the value of that property to its current value. However try replacing > :var: foo="a" with > :var+: foo="a" which is valid and should work for your use case below. There are still some lingering issues with inheritance and Org-mode properties which I may try to address one of these days. Cheers, > > Cheers, > Viktor > > * Parent task > :PROPERTIES: > :var: foo="1" > :var+: bar="2" > :END: > ** Child task without own properties > > #+BEGIN_SRC sh > echo foo: $foo > echo bar: $bar > #+END_SRC > > #+RESULTS: > | foo: | 1 | > | bar: | 2 | > > ** Child task with own properties > :PROPERTIES: > :var: foo="a" > :END: > > #+BEGIN_SRC sh > echo foo: $foo > echo bar: $bar > #+END_SRC > > #+RESULTS: > | foo: | a | > | bar: | | > > -- Eric Schulte http://cs.unm.edu/~eschulte/