From: Dan Davison <dandavison7@gmail.com>
To: Eric Schulte <schulte.eric@gmail.com>
Cc: emacs-orgmode <emacs-orgmode@gnu.org>
Subject: Re: [BABEL] "unset" :var definitions for subtree
Date: Sun, 13 Feb 2011 21:38:26 +0000 [thread overview]
Message-ID: <m1k4h3399p.fsf@gmail.com> (raw)
In-Reply-To: <87k4h3rdgc.fsf@gmail.com> (Eric Schulte's message of "Sun, 13 Feb 2011 11:28:00 -0700")
"Eric Schulte" <schulte.eric@gmail.com> 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
next prev parent reply other threads:[~2011-02-13 21:38 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-02-07 15:12 [BABEL] "unset" :var definitions for subtree Rainer M Krug
2011-02-10 1:27 ` Eric Schulte
2011-02-10 8:33 ` Rainer M Krug
2011-02-10 16:48 ` Eric Schulte
2011-02-11 9:00 ` Rainer M Krug
2011-02-11 9:32 ` Dan Davison
2011-02-11 10:22 ` Rainer M Krug
2011-02-11 11:55 ` Dan Davison
2011-02-11 12:29 ` Rainer M Krug
2011-02-11 13:49 ` Dan Davison
2011-02-11 13:56 ` Rainer M Krug
2011-02-12 22:54 ` Eric Schulte
2011-02-11 12:19 ` Dan Davison
2011-02-11 12:58 ` Rainer M Krug
2011-02-11 13:41 ` Dan Davison
2011-02-11 14:05 ` Rainer M Krug
2011-02-12 23:12 ` Eric Schulte
2011-02-13 1:21 ` Dan Davison
2011-02-13 18:28 ` Eric Schulte
2011-02-13 21:38 ` Dan Davison [this message]
2011-02-14 19:22 ` Eric Schulte
2011-02-11 14:16 ` Eric Schulte
2011-02-11 14:45 ` Dan Davison
2011-02-12 23:13 ` Eric Schulte
2011-02-13 1:38 ` Dan Davison
2011-02-13 18:33 ` Eric Schulte
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m1k4h3399p.fsf@gmail.com \
--to=dandavison7@gmail.com \
--cc=emacs-orgmode@gnu.org \
--cc=schulte.eric@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.