From 42ee862d33b3e2a84f1f370d3f7ff84f3ff7ad66 Mon Sep 17 00:00:00 2001 From: Bastien Guerry Date: Tue, 18 Mar 2014 14:47:09 +0100 Subject: [PATCH] org.el (org-entry-get): Fix inheritance problem * org.el (org-entry-get): Only try to combine file properties with local properties when the property drawer contains such local property, not when the property drawer exists. Before the fix, `org-entry-get' behavior was inconsistent, returning `nil' when looking for a property in a subtree with no property drawer, and returning the global properties in a subtree with a property drawer, independantly of whether this property drawer contained a reference to the property we are checking against or not. As a side-effect, inheritance was broken for the case that Ilya reported in commit 475f2f53, because `org-entry-get' returned a value (with the global properties of the file) too early. Thanks to Ilya for raising this bug and to Achim for pointing out that the previous fix was wrong. --- lisp/org.el | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lisp/org.el b/lisp/org.el index d52d5a26b..0aab575d2 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -15324,7 +15324,13 @@ when a \"nil\" value can supersede a non-nil value higher up the hierarchy." (cdr (assoc property (org-entry-properties nil 'special property))) (org-with-wide-buffer (let ((range (org-get-property-block))) - (when (and range (not (eq (car range) (cdr range)))) + (when (and range (not (eq (car range) (cdr range))) + (save-excursion + (goto-char (car range)) + (re-search-forward + (concat (org-re-property property) "\\|" + (org-re-property (concat property "+"))) + (cdr range) t))) (let* ((props (list (or (assoc property org-file-properties) (assoc property org-global-properties)