Resume clock at interrupted task when available

This commit is contained in:
Daniel - 2023-12-06 16:31:05 +01:00
parent 479f9dbaf7
commit 416ba934f9
Signed by: dbo
GPG Key ID: 784AA8DF0CCDF625
1 changed files with 16 additions and 11 deletions

View File

@ -426,17 +426,22 @@ should not be clocked."
(let ((parent-task (db/find-parent-task)))
(save-mark-and-excursion
(cond
(parent-task
;; found parent task
(org-with-point-at parent-task
(org-clock-in)))
((and (markerp org-clock-default-task)
(marker-buffer org-clock-default-task))
;; default task is set
(org-with-point-at org-clock-default-task
(org-clock-in)))
(t
(org-clock-in '(4))))))))
((and (markerp org-clock-interrupted-task)
(marker-buffer org-clock-interrupted-task))
;; interrupted task is set
(org-with-point-at org-clock-interrupted-task
(org-clock-in)))
(parent-task
;; found parent task
(org-with-point-at parent-task
(org-clock-in)))
((and (markerp org-clock-default-task)
(marker-buffer org-clock-default-task))
;; default task is set
(org-with-point-at org-clock-default-task
(org-clock-in)))
(t
(org-clock-in '(4))))))))
(defun db/save-current-org-task-to-file ()
"Format currently clocked task and write it to`db/org-clock-current-task-file'."