Browse Source

Merge branch 'maint'

Nicolas Goaziou 6 years ago
parent
commit
38121248c9
2 changed files with 4 additions and 2 deletions
  1. 2 1
      lisp/org-clock.el
  2. 2 1
      lisp/org.el

+ 2 - 1
lisp/org-clock.el

@@ -39,6 +39,7 @@
 (declare-function org-dynamic-block-define "org" (type func))
 
 (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,

+ 2 - 1
lisp/org.el

@@ -12148,7 +12148,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)))