diff --git a/lisp/org-clock.el b/lisp/org-clock.el index b1041e2..467ffc4 100644 --- a/lisp/org-clock.el +++ b/lisp/org-clock.el @@ -244,6 +244,7 @@ to add an effort property.") (defvar org-clock-heading "") (defvar org-clock-heading-for-remember "") (defvar org-clock-start-time "") +(defvar org-clock-used-in-this-session nil) (defvar org-clock-left-over-time nil "If non-nil, user cancelled a clock; this is when leftover time started.") @@ -953,6 +954,7 @@ the clocking selection, associated with the letter `d'." (setq org-clock-idle-timer (run-with-timer 60 60 'org-resolve-clocks-if-idle)) (message "Clock starts at %s - %s" ts msg-extra) + (setq org-clock-used-in-this-session t) (run-hooks 'org-clock-in-hook))))))) (defun org-clock-mark-default-task () @@ -1824,7 +1826,7 @@ This function is made for clock tables." "Persist various clock-related data to disk. The details of what will be saved are regulated by the variable `org-clock-persist'." - (when org-clock-persist + (when (and org-clock-persist org-clock-used-in-this-session) (let (b) (with-current-buffer (find-file (expand-file-name org-clock-persist-file)) (progn