diff options
author | Eric Schulte <eric.schulte@gmx.com> | 2012-01-06 11:20:11 -0700 |
---|---|---|
committer | Eric Schulte <eric.schulte@gmx.com> | 2012-01-06 11:20:48 -0700 |
commit | 369fa6d874d37db8174c425e18c5351ddb7a8f52 (patch) | |
tree | 494831804d73dc83de6e105888b67a69fb601a8d | |
parent | d270cfcf74b557522711922873efcfa9587523f0 (diff) | |
download | org-mode-369fa6d874d37db8174c425e18c5351ddb7a8f52.tar.gz |
only the last value for any specific property is kept
* lisp/org.el (org-update-property-plist): Remove old instances of
property when adding a new value for property.
-rw-r--r-- | lisp/org.el | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lisp/org.el b/lisp/org.el index 3b06347..748a2e3 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -4446,12 +4446,12 @@ means to push this value onto the list in the variable.") (defun org-update-property-plist (key val props) "Update PROPS with KEY and VAL." - (if (string= "+" (substring key (- (length key) 1))) - (let* ((key (substring key 0 (- (length key) 1))) - (previous (cdr (assoc key props)))) - (cons (cons key (concat previous " " val)) - (org-remove-if (lambda (p) (string= (car p) key)) props))) - (cons (cons key val) props))) + (let ((remainder (org-remove-if (lambda (p) (string= (car p) key)) props))) + (if (string= "+" (substring key (- (length key) 1))) + (let* ((key (substring key 0 (- (length key) 1))) + (previous (cdr (assoc key props)))) + (cons (cons key (concat previous " " val)) remainder)) + (cons (cons key val) remainder)))) (defconst org-block-regexp "^[ \t]*#\\+begin_?\\([^ \n]+\\)\\(\\([^\n]+\\)\\)?\n\\([^\000]+?\\)#\\+end_?\\1[ \t]*$" |