From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dan Davison Subject: Re: [BABEL] "unset" :var definitions for subtree Date: Sun, 13 Feb 2011 01:21:32 +0000 Message-ID: References: <4D500BEC.1080300@gmail.com> <87bp2koeir.fsf@gmail.com> <4D53A2D2.2080300@gmail.com> <87r5bfn8dg.fsf@gmail.com> <4D553291.9090700@gmail.com> <4D554239.1020701@gmail.com> <877hd44zin.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from [140.186.70.92] (port=39692 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PoQek-0003w5-Dn for emacs-orgmode@gnu.org; Sat, 12 Feb 2011 20:21:43 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PoQej-00080w-6Q for emacs-orgmode@gnu.org; Sat, 12 Feb 2011 20:21:42 -0500 Received: from mail-ww0-f49.google.com ([74.125.82.49]:40307) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PoQej-00080m-06 for emacs-orgmode@gnu.org; Sat, 12 Feb 2011 20:21:41 -0500 Received: by wwb17 with SMTP id 17so3810612wwb.30 for ; Sat, 12 Feb 2011 17:21:40 -0800 (PST) In-Reply-To: <877hd44zin.fsf@gmail.com> (Eric Schulte's message of "Sat, 12 Feb 2011 16:12:27 -0700") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Eric Schulte Cc: emacs-orgmode , Rainer M Krug "Eric Schulte" writes: > [...] >>> It seems that what you want to do can be described as disabling >>> inheritance of the :var properties for a specific block. >> >> Agreed - that would solve my problem. >> >>> So I'm suggesting that it may be more parsimonious to do this with >>> the existing Org inheritance mechanisms than to introduce new babel >>> header arguments specifically for this purpose. >> >> Agreed here. >> > > If this is possible, then I'm all for it, however I do not think that it > is currently possible to "disinherit" specific properties. Note: do to > the way babel collects properties, I don't think that temporarily > changing the value of `org-use-property-inheritance' will be sufficient. > > [...] >>>> >>>> So how can I now define multiple variables? >>> >>> I don't know :) >> >> Could Eric help here? >> >>> >>>> in a properties drawer multiple :var does not work? Could you give a >>>> simple example how to define variables A and B? >>> >>> Yes, I've always been a bit uncomfortable with this. As Eric says, Org >>> properties are supposed to be a bit like a hash, with unique keys. >> >> So based on this, I can only define a single variable per properties drawer? >> > > I'm not sure how this should be solved. Would it be possible/desirable > to allow multiple settings of the same key in Org-mode properties? That > seems like it could be a destructive change across all of Org-mode. > Maybe we could extend the :var header argument to support the following > syntax... > > #+begin_src emacs-lisp :var A=1 B=3 > ;; code > #+end_src > > or > > ** two vars in a properties block > :PROPERTIES: > :var: test1=7 test2=8 > :END: > > That shouldn't be overly difficult, and should solve our requirements. Yes, that looks good. In the following Org file --------------------------------------- #+property: :var a=1 b=2 * h1 :PROPERTIES: :var: c=3 :END: ** h11 :PROPERTIES: :var: d=4 e=5 b=7 :END: #+begin_src sh :var f=6 # code here #+end_src --------------------------------------- if we follow programming languages by analogy then the behavior we should aim for is for variables a,b,c,d,e to all be set in the src block, with b having the value 7. I've made a start on a patch to do that -- it involves treating :var differently from other header args. Whereas normal property inheritance searches up the tree until the specified property is encountered, my patch searches up the tree to the root, collecting all the :var assignments encountered. So perhaps we should go for a solution involving both the new ":var a=1 b=2" syntax (to allow multiple :var in the same block), and the pluralistic inheritance described above (to allow :var to be collected from all levels in the hierarchy). Dan > > Sound good? -- Eric > > _______________________________________________ > Emacs-orgmode mailing list > Please use `Reply All' to send replies to the list. > Emacs-orgmode@gnu.org > http://lists.gnu.org/mailman/listinfo/emacs-orgmode