Browse Source

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
Aliaksey Artamonau 1 year ago
parent
commit
0a8711a0a5
1 changed files with 2 additions and 1 deletions
  1. 2 1
      lisp/org-clock.el

+ 2 - 1
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: "))