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 21:38:26 +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> <87k4h3rdgc.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from [140.186.70.92] (port=45136 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PojeM-0006vZ-NW for emacs-orgmode@gnu.org; Sun, 13 Feb 2011 16:38:35 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PojeL-0002aa-De for emacs-orgmode@gnu.org; Sun, 13 Feb 2011 16:38:34 -0500 Received: from mail-wy0-f169.google.com ([74.125.82.169]:64495) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PojeL-0002aC-6X for emacs-orgmode@gnu.org; Sun, 13 Feb 2011 16:38:33 -0500 Received: by wyj26 with SMTP id 26so4288491wyj.0 for ; Sun, 13 Feb 2011 13:38:32 -0800 (PST) In-Reply-To: <87k4h3rdgc.fsf@gmail.com> (Eric Schulte's message of "Sun, 13 Feb 2011 11:28:00 -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 "Eric Schulte" writes: > [...] >>> 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. >> > > Maybe we should do this sort of exhaustive search for *all* header > argument types. Are there any header arguments aside from :var which > could possibly want to take multiple values collected at different > levels of inheritance? I suppose :results may also take multiple values > which could reasonably be collected across multiple levels of hierarchy. > >> >> 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). >> > > That sounds good to me. Is this code up in a repository somewhere, or > should be send patches back and forth? This is in branch ob-inherit at https://github.com/dandavison/org-devel. I've given you write access to the repo. The branch isn't ready to go yet, just a first pass. Currently, with this file ------------------------------------- #+property: var a=1 #+property: var b=2 * h1 :PROPERTIES: :var: c=3 :END: ** h11 :PROPERTIES: :var: b=4 :END: #+begin_src sh :var d=5 # code here #+end_src ------------------------------------- C-c C-v C-v in the src block gives --------------------------------- c=3 a=1 b=2 d=5 # code here --------------------------------- (so b has the wrong value, but there will be more issues than just that) Dan > > Best -- Eric > >> >> 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 > > _______________________________________________ > 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