diff options
author | Nicolas Goaziou <mail@nicolasgoaziou.fr> | 2017-02-03 22:51:56 +0100 |
---|---|---|
committer | Nicolas Goaziou <mail@nicolasgoaziou.fr> | 2017-02-03 22:51:56 +0100 |
commit | 83cea905991b2761f98838cef9b867985d60c637 (patch) | |
tree | 2ae8a6bbd2cbcf8285f6fd7b9f1b2d97d635b429 | |
parent | 9eda09eab43f6d7ebe826a917b26f9bce48d9d29 (diff) | |
download | org-mode-83cea905991b2761f98838cef9b867985d60c637.tar.gz |
org-clock: Do not associate a note to removed zero time CLOCKs
* lisp/org-clock.el (org-clock-out): When a zero time CLOCK is
removed, do not offer to add a note for it.
-rw-r--r-- | lisp/org-clock.el | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/lisp/org-clock.el b/lisp/org-clock.el index b513a93..e681422 100644 --- a/lisp/org-clock.el +++ b/lisp/org-clock.el @@ -1593,18 +1593,19 @@ to, overriding the existing value of `org-clock-out-switch-to-state'." m (floor (/ s 60)) s (- s (* 60 s))) (insert " => " (format "%2d:%02d" h m)) - (when (setq remove (and org-clock-out-remove-zero-time-clocks - (= (+ h m) 0))) - (beginning-of-line 1) - (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) - (when org-log-note-clock-out - (org-add-log-setup - 'clock-out nil nil nil - (concat "# Task: " (org-get-heading t) "\n\n"))) + ;; Possibly remove zero time clocks. However, do not add + ;; a note associated to the CLOCK line in this case. + (cond ((and org-clock-out-remove-zero-time-clocks + (= (+ h m) 0)) + (setq remove t) + (delete-region (line-beginning-position) + (line-beginning-position 2))) + (org-log-note-clock-out + (org-add-log-setup + 'clock-out nil nil nil + (concat "# Task: " (org-get-heading t) "\n\n")))) (when org-clock-mode-line-timer (cancel-timer org-clock-mode-line-timer) (setq org-clock-mode-line-timer nil)) |