diff options
author | Eric Schulte <schulte.eric@gmail.com> | 2011-10-30 10:04:17 -0600 |
---|---|---|
committer | Eric Schulte <schulte.eric@gmail.com> | 2011-10-31 12:28:50 -0600 |
commit | 8354fd9e0f5fff04665b2272fff6376b15ec0225 (patch) | |
tree | 4aafb984a5e215a53b7da861e6e0247a0a56c674 | |
parent | 8559a91be887dc2005cb24b27d2dd44bb00c7aaa (diff) | |
download | org-mode-8354fd9e0f5fff04665b2272fff6376b15ec0225.tar.gz |
Allow multi-line properties to be specified in property blocks
#+begin_property
var foo=1,
bar=2,
baz=3,
qux=4
#+end_property
#+begin_src emacs-lisp
(+ foo bar baz qux)
#+end_src
#+results:
: 10
* lisp/org.el (org-set-regexps-and-options): Use property blocks for
multi-line properties.
-rw-r--r-- | lisp/org.el | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/lisp/org.el b/lisp/org.el index 03fa76b..a75f96e 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -4537,8 +4537,16 @@ means to push this value onto the list in the variable.") (setq ext-setup-or-nil (concat (substring ext-setup-or-nil 0 start) "\n" setup-contents "\n" - (substring ext-setup-or-nil start))))) - )))) + (substring ext-setup-or-nil start))))))) + ;; search for property blocks + (goto-char (point-min)) + (while (re-search-forward org-block-regexp nil t) + (when (equal "PROPERTY" (upcase (match-string 1))) + (setq value (replace-regexp-in-string + "[\n\r]" " " (match-string 4))) + (when (string-match "\\(\\S-+\\)\\s-+\\(.*\\)" value) + (push (cons (match-string 1 value) (match-string 2 value)) + props)))))) (org-set-local 'org-use-sub-superscripts scripts) (when cat (org-set-local 'org-category (intern cat)) |