diff options
author | Bastien Guerry <bzg@altern.org> | 2013-04-03 15:20:58 +0200 |
---|---|---|
committer | Bastien Guerry <bzg@altern.org> | 2013-04-03 18:28:29 +0200 |
commit | 00a227c0d2b2ad17777753ed4c46b1f6657a5bab (patch) | |
tree | 292cb5985600ad944be004b24d7fba1fb4b17fc7 | |
parent | 81d354b6c3caf36228015291717a6b72be3e7c4f (diff) | |
download | org-mode-00a227c0d2b2ad17777753ed4c46b1f6657a5bab.tar.gz |
org-clock.el: Set clock markers to nil on clock out/cancel
* org-clock.el (org-resolve-clocks-if-idle): Only try to
resolve last clock if the clock buffer still exists.
(org-clock-out, org-clock-cancel): Set markers to nil.
Thanks to John Wiegley for reporting this bug.
-rw-r--r-- | lisp/org-clock.el | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lisp/org-clock.el b/lisp/org-clock.el index 6eeb32b..eb72dda 100644 --- a/lisp/org-clock.el +++ b/lisp/org-clock.el @@ -1076,7 +1076,7 @@ This is performed after `org-clock-idle-time' minutes, to check if the user really wants to stay clocked in after being idle for so long." (when (and org-clock-idle-time (not org-clock-resolving-clocks) - org-clock-marker) + (marker-buffer org-clock-marker)) (let* ((org-clock-user-idle-seconds (org-user-idle-seconds)) (org-clock-user-idle-start (time-subtract (current-time) @@ -1515,8 +1515,8 @@ to, overriding the existing value of `org-clock-out-switch-to-state'." (delete-region (point) (point-at-eol)) (and (looking-at "\n") (> (point-max) (1+ (point))) (delete-char 1))) - (move-marker org-clock-marker nil) - (move-marker org-clock-hd-marker nil) + (setq org-clock-marker nil) + (setq org-clock-hd-marker nil) (when org-log-note-clock-out (org-add-log-setup 'clock-out nil nil nil nil (concat "# Task: " (org-get-heading t) "\n\n"))) @@ -1647,8 +1647,8 @@ Optional argument N tells to change by that many units." (org-remove-empty-drawer-at "LOGBOOK" (point))) (message "Clock gone, cancel the timer anyway") (sit-for 2))) - (move-marker org-clock-marker nil) - (move-marker org-clock-hd-marker nil) + (setq org-clock-marker nil) + (setq org-clock-hd-marker nil) (setq global-mode-string (delq 'org-mode-line-string global-mode-string)) (setq frame-title-format org-frame-title-format-backup) |