Do not clock into interrupted task when it's the default task

Clocking into the default task should only happend as last resort.
This commit is contained in:
Daniel Borchmann 2024-12-14 10:32:02 +01:00
parent 661c5f9b22
commit 3a397139f2
No known key found for this signature in database
GPG Key ID: 784AA8DF0CCDF625

View File

@ -438,6 +438,12 @@ user for the next task to clock into."
(cond (cond
((and (markerp org-clock-interrupted-task) ((and (markerp org-clock-interrupted-task)
(marker-buffer org-clock-interrupted-task) (marker-buffer org-clock-interrupted-task)
;; Ensure that interrupted task is not the default task; in this case, we prefer to
;; continue with parent tasks instead.
(or (not (markerp org-clock-default-task))
(not (marker-buffer org-clock-default-task))
(not (= org-clock-interrupted-task
org-clock-default-task)))
(org-with-point-at org-clock-interrupted-task (org-with-point-at org-clock-interrupted-task
(not (member (nth 2 (org-heading-components)) (not (member (nth 2 (org-heading-components))
org-done-keywords)))) org-done-keywords))))