From 83249b668e4d2ef73d7591972c762b2fa1ed7ef4 Mon Sep 17 00:00:00 2001 From: Nicolas Goaziou Date: Wed, 3 Dec 2014 15:24:40 +0100 Subject: [PATCH] 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 --- lisp/org-clock.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lisp/org-clock.el b/lisp/org-clock.el index 46540d247..a39581384 100644 --- a/lisp/org-clock.el +++ b/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)) -- 2.11.4.GIT