Browse Source

org-clock: Clear org-clock-current-task on clock cancel

* org-mode/lisp/org-clock.el (org-clock-cancel): Clear
`org-clock-current-task' when a clock is canceled.

This variable is used by some mode line packages (e.g.,
spaceline-all-the-icons), so not clearing the variable incorrectly
displays the previous task as ongoing.
Aaron L. Zeng 7 months ago
parent
commit
1b74ae0ba3
1 changed files with 1 additions and 0 deletions
  1. 1 0
      lisp/org-clock.el

+ 1 - 0
lisp/org-clock.el

@@ -1741,6 +1741,7 @@ Optional argument N tells to change by that many units."
       (sit-for 2)))
   (move-marker org-clock-marker nil)
   (move-marker org-clock-hd-marker nil)
+  (setq org-clock-current-task nil)
   (setq global-mode-string
 	(delq 'org-mode-line-string global-mode-string))
   (org-clock-restore-frame-title-format)