summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Schulte <eric.schulte@gmx.com>2012-01-11 10:14:24 -0700
committerEric Schulte <eric.schulte@gmx.com>2012-01-11 10:14:49 -0700
commit313b70e139602109c9e2a7fc1bbc974032449b01 (patch)
tree2c115a3c41fb36624485912cbf3ce90710551e28
parentbebf66c652d561868c0d59b6dd36757bf12060ec (diff)
downloadorg-mode-313b70e139602109c9e2a7fc1bbc974032449b01.tar.gz
fix bug in property list updates
* lisp/org.el (org-update-property-plist): Fix bug in property list updates.
-rw-r--r--lisp/org.el11
1 files changed, 6 insertions, 5 deletions
diff --git a/lisp/org.el b/lisp/org.el
index 748a2e3..fcfc35c 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -4446,11 +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."
- (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))
+ (let* ((appending (string= "+" (substring key (- (length key) 1))))
+ (key (if appending (substring key 0 (- (length key) 1)) key))
+ (remainder (org-remove-if (lambda (p) (string= (car p) key)) props))
+ (previous (cdr (assoc key props))))
+ (if appending
+ (cons (cons key (if previous (concat previous " " val) val)) remainder)
(cons (cons key val) remainder))))
(defconst org-block-regexp