Browse Source

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.
Carsten Dominik 16 years ago
parent
commit
7c0e0189f0
4 changed files with 18 additions and 3 deletions
  1. 10 0
      lisp/ChangeLog
  2. 0 1
      lisp/org-colview-xemacs.el
  3. 0 1
      lisp/org-colview.el
  4. 8 1
      lisp/org.el

+ 10 - 0
lisp/ChangeLog

@@ -1,5 +1,15 @@
 2008-10-01  Carsten Dominik  <dominik@science.uva.nl>
 
+	* 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  <dominik@science.uva.nl>

+ 0 - 1
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)

+ 0 - 1
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)

+ 8 - 1
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