emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [O] About commit named "Allow multi-line properties to be specified


From: Eric Schulte
Subject: Re: [O] About commit named "Allow multi-line properties to be specified in property blocks"
Date: Tue, 01 Nov 2011 13:02:05 -0600
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.90 (gnu/linux)

Christian Moe <address@hidden> writes:

> On 11/1/11 5:58 PM, Eric Schulte wrote:
>
>>>>  so assuming "var" is an accumulating property, then
>>>>
>>>> #+property: var foo=1
>>>> #+property: var bar=2
>>>>
>>>> would result in `org-file-properties' having the following value
>>>>
>>>>    (("var" . "foo=1 bar=1"))
>
> Given this:
>
> ---
>
>
> #+property: var foo=1
> #+property: var bar=2
>
> * Heading
>    :PROPERTIES:
>    :var: foo=3
>    :END:
>
>
> ---
>
> Would it result in (("var" . "foo=3 bar=2"))?
>

Good catch Christian, I get the following behavior, currently seems the
property-block specification overwrites the global property.  I'll have
to update my patch to append at the subheading level as well.

#+property: var foo=1
#+property: var bar=2

#+begin_src emacs-lisp
  (+ foo bar)
#+end_src

#+results:
: 3

#+begin_src emacs-lisp
  (org-entry-get (point) "var" t)
#+end_src

#+results:
: foo=1, bar=2

* heading
  :PROPERTIES:
  :var:      foo=4
  :END:

#+begin_src emacs-lisp
  foo
#+end_src

#+results:
: 4

#+begin_src emacs-lisp
  (org-entry-get (point) "var" t)
#+end_src

#+results:
: foo=4
As for variable handling, I think the solution is to ensure that on the
code-block side of things, a var string like "foo=3, bar=2, foo=1"
results in,

foo=1
bar=2

that is, subtree variable definitions will pre-empty earlier definitions
of the same variable..

Best -- Eric

>
> Yours,
> Christian

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

reply via email to

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