Browse Source

org-clock: Fix clocking when `org-clock-into-drawer' is a number

* lisp/org-clock.el (org-clock-find-position): Check if
  `org-clock-into-drawer' is a number when inserting the first clock.

Reported-by: Rainer Stengele <rainer.stengele@online.de>
<http://permalink.gmane.org/gmane.emacs.orgmode/93128>
Nicolas Goaziou 5 years ago
parent
commit
83249b668e
1 changed files with 3 additions and 1 deletions
  1. 3 1
      lisp/org-clock.el

+ 3 - 1
lisp/org-clock.el

@@ -1473,7 +1473,9 @@ line and position cursor in that line."
 	    (forward-line))
 	  (unless (bolp) (insert "\n"))
 	  ;; Create a new drawer if necessary.
-	  (when org-clock-into-drawer
+	  (when (and org-clock-into-drawer
+		     (or (not (wholenump org-clock-into-drawer))
+			 (< org-clock-into-drawer 2)))
 	    (let ((beg (point)))
 	      (insert ":" drawer ":\n:END:\n")
 	      (org-indent-region beg (point))