From 3a397139f214b4957447e5877abfa7a9c6821bbe Mon Sep 17 00:00:00 2001 From: Daniel Borchmann Date: Sat, 14 Dec 2024 10:32:02 +0100 Subject: [PATCH] Do not clock into interrupted task when it's the default task Clocking into the default task should only happend as last resort. --- site-lisp/db-org.el | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/site-lisp/db-org.el b/site-lisp/db-org.el index 7c53150..27c2f4c 100644 --- a/site-lisp/db-org.el +++ b/site-lisp/db-org.el @@ -438,6 +438,12 @@ user for the next task to clock into." (cond ((and (markerp 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 (not (member (nth 2 (org-heading-components)) org-done-keywords))))