summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Goaziou <mail@nicolasgoaziou.fr>2019-02-15 00:20:40 +0100
committerNicolas Goaziou <mail@nicolasgoaziou.fr>2019-02-15 00:20:40 +0100
commitf9015b4bbf754b016737b250fc52741d0ce301fa (patch)
tree4a400146b8b983b228bb6fe9f81bccff24be75a5
parent8fc22d464d2bc4a3397516854375b177835d10bb (diff)
downloadorg-mode-f9015b4bbf754b016737b250fc52741d0ce301fa.tar.gz
Fix last commit
* lisp/org-clock.el (org-clock-out-if-current): Autoload function. * lisp/org.el (org-todo): Do not call `org-clock-out-if-current' if `org-clock' is not loaded yet.
-rw-r--r--lisp/org-clock.el3
-rw-r--r--lisp/org.el3
2 files changed, 4 insertions, 2 deletions
diff --git a/lisp/org-clock.el b/lisp/org-clock.el
index c8de9b6..8d2c64c 100644
--- a/lisp/org-clock.el
+++ b/lisp/org-clock.el
@@ -38,6 +38,7 @@
(declare-function org-table-goto-line "org-table" (n))
(defvar org-frame-title-format-backup frame-title-format)
+(defvar org-state)
(defvar org-time-stamp-formats)
@@ -1982,7 +1983,7 @@ If NOREMOVE is nil, remove this function from the
(remove-hook 'before-change-functions
'org-clock-remove-overlays 'local))))
-(defvar org-state) ;; dynamically scoped into this function
+;;;###autoload
(defun org-clock-out-if-current ()
"Clock out if the current entry contains the running clock.
This is used to stop the clock after a TODO entry is marked DONE,
diff --git a/lisp/org.el b/lisp/org.el
index 2e69f61..2d5486b 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -12259,7 +12259,8 @@ When called through ELisp, arg is also interpreted in the following way:
(when org-auto-align-tags (org-align-tags))
(when org-provide-todo-statistics
(org-update-parent-todo-statistics))
- (org-clock-out-if-current)
+ (when (bound-and-true-p org-clock-out-when-done)
+ (org-clock-out-if-current))
(run-hooks 'org-after-todo-state-change-hook)
(when (and arg (not (member org-state org-done-keywords)))
(setq head (org-get-todo-sequence-head org-state)))