From a521a7a9a7f17730daa6db440aad77431549034a Mon Sep 17 00:00:00 2001 From: Eric Schulte Date: Wed, 15 Feb 2012 08:01:29 -0700 Subject: [PATCH] Accumulate properties from subtree property drawers. * lisp/org.el (org-entry-get): Accumulate properties from subtree property drawers. --- lisp/org.el | 38 ++++++++++++++++++++------------------ 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/lisp/org.el b/lisp/org.el index 8b24cf2a6..e2d5ece44 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -14174,24 +14174,26 @@ when a \"nil\" value can supersede a non-nil value higher up the hierarchy." ;; retrieve it, but specify the wanted property (cdr (assoc property (org-entry-properties nil 'special property))) (let ((range (unless (org-before-first-heading-p) - (org-get-property-block)))) - (when (and range (goto-char (car range))) - ((lambda (val) (when val (if literal-nil val (org-not-nil val)))) - (cond - ((re-search-forward - (org-re-property property) (cdr range) t) - (if (match-end 1) (org-match-string-no-properties 1) "")) - ((re-search-forward - (org-re-property (concat property "+")) (cdr range) t) - (cdr (assoc - property - (org-update-property-plist - (concat property "+") - (if (match-end 1) (org-match-string-no-properties 1) "") - (list (or (assoc property org-file-properties) - (assoc property org-global-properties) - (assoc property org-global-properties-fixed) - )))))))))))))) + (org-get-property-block))) + (props (list (or (assoc property org-file-properties) + (assoc property org-global-properties) + (assoc property org-global-properties-fixed)))) + val) + (flet ((ap (key) + (when (re-search-forward + (org-re-property key) (cdr range) t) + (setq props + (org-update-property-plist + key + (if (match-end 1) + (org-match-string-no-properties 1) "") + props))))) + (when (and range (goto-char (car range))) + (ap property) + (goto-char (car range)) + (ap (concat property "+")) + (setq val (cdr (assoc property props))) + (when val (if literal-nil val (org-not-nil val)))))))))) (defun org-property-or-variable-value (var &optional inherit) "Check if there is a property fixing the value of VAR.