From 7c0e0189f06d11e1bb92f61de55c3f0d9130f70b Mon Sep 17 00:00:00 2001 From: Carsten Dominik Date: Wed, 1 Oct 2008 21:31:24 +0200 Subject: [PATCH] Fix property inheritance marker. Now the function that retrieves a property with inheritance makes sure that this function does not point anywhere if there was no match. --- lisp/ChangeLog | 10 ++++++++++ lisp/org-colview-xemacs.el | 1 - lisp/org-colview.el | 1 - lisp/org.el | 9 ++++++++- 4 files changed, 18 insertions(+), 3 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 20d00b029..8b3612ac3 100755 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,15 @@ 2008-10-01 Carsten Dominik + * org-colview.el (org-columns-get-format-and-top-level): Remove + resetting the marker. + + * org-colview-xemacs.el (org-columns-get-format-and-top-level): + Remove resetting the marker. + + * org.el (org-entry-property-inherited-from): Improve docstring. + (org-entry-get-with-inheritance): Reset marker before starting the + search. + * org-exp.el (org-infile-export-plist): Allow multiple STYLE lines. 2008-09-30 Carsten Dominik diff --git a/lisp/org-colview-xemacs.el b/lisp/org-colview-xemacs.el index 2ac3e7424..1fe654e86 100644 --- a/lisp/org-colview-xemacs.el +++ b/lisp/org-colview-xemacs.el @@ -821,7 +821,6 @@ around it." (defun org-columns-get-format-and-top-level () (let (fmt) (when (condition-case nil (org-back-to-heading) (error nil)) - (move-marker org-entry-property-inherited-from nil) (setq fmt (org-entry-get nil "COLUMNS" t))) (setq fmt (or fmt org-columns-default-format)) (org-set-local 'org-columns-current-fmt fmt) diff --git a/lisp/org-colview.el b/lisp/org-colview.el index 2ecdfec57..d1ac4691d 100644 --- a/lisp/org-colview.el +++ b/lisp/org-colview.el @@ -624,7 +624,6 @@ around it." (defun org-columns-get-format-and-top-level () (let (fmt) (when (condition-case nil (org-back-to-heading) (error nil)) - (move-marker org-entry-property-inherited-from nil) (setq fmt (org-entry-get nil "COLUMNS" t))) (setq fmt (or fmt org-columns-default-format)) (org-set-local 'org-columns-current-fmt fmt) diff --git a/lisp/org.el b/lisp/org.el index 5c443fcf4..ea687b35f 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -9835,10 +9835,17 @@ VALUES should be a list of strings. Spaces will be protected." (setq s (replace-match "\n" t t s))) s) -(defvar org-entry-property-inherited-from (make-marker)) +(defvar org-entry-property-inherited-from (make-marker) + "Marker pointing to the entry from where a proerty was inherited. +Each call to `org-entry-get-with-inheritance' will set this marker to the +location of the entry where the inheriance search matched. If there was +no match, the marker will point nowhere. +Note that also `org-entry-get' calls this function, if the INHERIT flag +is set.") (defun org-entry-get-with-inheritance (property) "Get entry property, and search higher levels if not present." + (move-marker org-entry-property-inherited-from nil) (let (tmp) (save-excursion (save-restriction