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>
This commit is contained in:
Nicolas Goaziou 2014-12-03 15:24:40 +01:00
parent dcf64c7ee3
commit 83249b668e

View file

@ -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))