diff options
author | Carsten Dominik <carsten.dominik@gmail.com> | 2010-07-02 15:49:40 +0200 |
---|---|---|
committer | Carsten Dominik <carsten.dominik@gmail.com> | 2010-07-02 15:49:40 +0200 |
commit | 57a5ef69b8c867bc69aacb4cc146c1d5f7ea55a4 (patch) | |
tree | 5326d1db9579c9606019866ed65df036fc5601e8 | |
parent | 8da31057eb0952889858c6e52c6e291596b5bee5 (diff) | |
download | org-mode-57a5ef69b8c867bc69aacb4cc146c1d5f7ea55a4.tar.gz |
Repair the working of a LOGGING property value `nil'
* lisp/org.el (org-entry-get-with-inheritance): New argument LITERAL-NIL.
(org-entry-get): Pass `literal-nil' into
`org-entry-get-with-inheritance'.
(org-todo): React to nil values of the LOGGING property.
-rw-r--r-- | lisp/org.el | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/lisp/org.el b/lisp/org.el index ae426e7..00c680e 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -10681,7 +10681,7 @@ For calling through lisp, arg is also interpreted in the following way: (looking-at " *")) (let* ((match-data (match-data)) (startpos (point-at-bol)) - (logging (save-match-data (org-entry-get nil "LOGGING" t))) + (logging (save-match-data (org-entry-get nil "LOGGING" t t))) (org-log-done org-log-done) (org-log-repeat org-log-repeat) (org-todo-log-states org-todo-log-states) @@ -13396,7 +13396,7 @@ when a \"nil\" value can supercede a non-nil value higher up the hierarchy." (if (and inherit (if (eq inherit 'selective) (org-property-inherit-p property) t)) - (org-entry-get-with-inheritance property) + (org-entry-get-with-inheritance property literal-nil) (if (member property org-special-properties) ;; We need a special property. Use `org-entry-properties' to ;; retrieve it, but specify the wanted property @@ -13506,8 +13506,12 @@ 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." +(defun org-entry-get-with-inheritance (property &optional literal-nil) + "Get entry property, and search higher levels if not present. +The search will stop at the first ancestor which has the property defined. +If the value found is \"nil\", return nil to show that the property +should be considered as undefined (this is the meaning of nil here). +However, if LITERAL-NIL is set, return the string value \"nil\" instead." (move-marker org-entry-property-inherited-from nil) (let (tmp) (save-excursion @@ -13520,11 +13524,11 @@ is set.") (move-marker org-entry-property-inherited-from (point)) (throw 'ex tmp)) (or (org-up-heading-safe) (throw 'ex nil))))) - (org-not-nil - (or tmp - (cdr (assoc property org-file-properties)) - (cdr (assoc property org-global-properties)) - (cdr (assoc property org-global-properties-fixed))))))) + (setq tmp (or tmp + (cdr (assoc property org-file-properties)) + (cdr (assoc property org-global-properties)) + (cdr (assoc property org-global-properties-fixed)))) + (if literal-nil tmp (org-not-nil tmp))))) (defvar org-property-changed-functions nil "Hook called when the value of a property has changed. |