property names ending in plus accumulate
commit3af89e696a32afcc39f2e3bdb6132ac588d530ae
authorEric Schulte <schulte.eric@gmail.com>
Mon, 7 Nov 2011 21:49:42 +0000 (7 14:49 -0700)
committerEric Schulte <schulte.eric@gmail.com>
Tue, 15 Nov 2011 15:56:24 +0000 (15 08:56 -0700)
tree1cca42444e6d7c9a571b1fda87f7974f2edac839
parent7e93b90f8816346a16ad49cee22870b17c05b211
property names ending in plus accumulate

This results in the following behavior.

  #+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

  * overwriting a file-wide property
    :PROPERTIES:
    :var:      foo=7
    :END:

  #+begin_src emacs-lisp
    foo
  #+end_src

  #+results:
  : 7

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

  #+results:
  : foo=7

  * appending to a file-wide property
    :PROPERTIES:
    :var+:      baz=3
    :END:

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

  #+results:
  : 6

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

  #+results:
  : foo=1 bar=2 baz=3

* lisp/org.el (org-update-property-plist): Updates a given property
  list with a property name and a property value.
  (org-set-regexps-and-options): Use org-update-property-plist.
  (org-entry-get): Use org-update-property-plist.
* testing/examples/property-inheritance.org: Example file for testing
  appending property behavior.
* testing/lisp/test-property-inheritance.el: Tests of appending
  property behavior.
* lisp/ob.el (org-babel-balanced-split): Allow splitting on single
  characters as well as groups of two characters.
  (org-babel-parse-multiple-vars): Split variables on single spaces.
lisp/ob.el
lisp/org.el
testing/examples/property-inheritance.org [new file with mode: 0644]
testing/lisp/test-property-inheritance.el [new file with mode: 0644]