forked from mirrors/org-mode
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.
This commit is contained in:
parent
8da31057eb
commit
57a5ef69b8
22
lisp/org.el
22
lisp/org.el
|
@ -10681,7 +10681,7 @@ For calling through lisp, arg is also interpreted in the following way:
|
||||||
(looking-at " *"))
|
(looking-at " *"))
|
||||||
(let* ((match-data (match-data))
|
(let* ((match-data (match-data))
|
||||||
(startpos (point-at-bol))
|
(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-done org-log-done)
|
||||||
(org-log-repeat org-log-repeat)
|
(org-log-repeat org-log-repeat)
|
||||||
(org-todo-log-states org-todo-log-states)
|
(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)
|
(if (and inherit (if (eq inherit 'selective)
|
||||||
(org-property-inherit-p property)
|
(org-property-inherit-p property)
|
||||||
t))
|
t))
|
||||||
(org-entry-get-with-inheritance property)
|
(org-entry-get-with-inheritance property literal-nil)
|
||||||
(if (member property org-special-properties)
|
(if (member property org-special-properties)
|
||||||
;; We need a special property. Use `org-entry-properties' to
|
;; We need a special property. Use `org-entry-properties' to
|
||||||
;; retrieve it, but specify the wanted property
|
;; 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
|
Note that also `org-entry-get' calls this function, if the INHERIT flag
|
||||||
is set.")
|
is set.")
|
||||||
|
|
||||||
(defun org-entry-get-with-inheritance (property)
|
(defun org-entry-get-with-inheritance (property &optional literal-nil)
|
||||||
"Get entry property, and search higher levels if not present."
|
"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)
|
(move-marker org-entry-property-inherited-from nil)
|
||||||
(let (tmp)
|
(let (tmp)
|
||||||
(save-excursion
|
(save-excursion
|
||||||
|
@ -13520,11 +13524,11 @@ is set.")
|
||||||
(move-marker org-entry-property-inherited-from (point))
|
(move-marker org-entry-property-inherited-from (point))
|
||||||
(throw 'ex tmp))
|
(throw 'ex tmp))
|
||||||
(or (org-up-heading-safe) (throw 'ex nil)))))
|
(or (org-up-heading-safe) (throw 'ex nil)))))
|
||||||
(org-not-nil
|
(setq tmp (or tmp
|
||||||
(or tmp
|
(cdr (assoc property org-file-properties))
|
||||||
(cdr (assoc property org-file-properties))
|
(cdr (assoc property org-global-properties))
|
||||||
(cdr (assoc property org-global-properties))
|
(cdr (assoc property org-global-properties-fixed))))
|
||||||
(cdr (assoc property org-global-properties-fixed)))))))
|
(if literal-nil tmp (org-not-nil tmp)))))
|
||||||
|
|
||||||
(defvar org-property-changed-functions nil
|
(defvar org-property-changed-functions nil
|
||||||
"Hook called when the value of a property has changed.
|
"Hook called when the value of a property has changed.
|
||||||
|
|
Loading…
Reference in New Issue