>From 9aa5fb535b54df5a35c26d89f3e9ddb0e335def0 Mon Sep 17 00:00:00 2001 From: Aliaksey Artamonau Date: Mon, 8 Jan 2018 16:53:20 +0300 Subject: [PATCH] org-clock.el: Fix one time continuous clock in * org-clock.el (org-clock-in): Abort after calling `org-clock-in' recursively with `org-clock-continuously' set. Without the change the recursive call to `org-clock-in' would insert a clock of last clock-out, but then the original call would continue by inserting another clock at current-time. As a result of that, clocking out uses the latter of the two clocks and leaves the other one dangling. TINYCHANGE --- lisp/org-clock.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lisp/org-clock.el b/lisp/org-clock.el index 370473017..010304484 100644 --- a/lisp/org-clock.el +++ b/lisp/org-clock.el @@ -1235,7 +1235,8 @@ the default behavior." (when (equal select '(64)) ;; Set start-time to `org-clock-out-time' (let ((org-clock-continuously t)) - (org-clock-in nil org-clock-out-time))) + (org-clock-in nil org-clock-out-time) + (throw 'abort nil))) (when (equal select '(4)) (setq selected-task (org-clock-select-task "Clock-in on task: ")) -- 2.15.1