Browse Source

Bugfix: Allow org-clock-into-drawer to be 1.

Carsten Dominik 11 years ago
parent
commit
651d2e7a14
2 changed files with 6 additions and 1 deletions
  1. 2 0
      lisp/ChangeLog
  2. 4 1
      lisp/org-clock.el

+ 2 - 0
lisp/ChangeLog

@@ -3,6 +3,8 @@
 	* org-clock.el (org-clock-find-position): Do not swallow an item
 	less indented than the CLOCK line itself.
 	(org-clock-in): Push markers to lin after the clock line.
+	(org-clock-find-position): Handle values of
+	`org-clock-into-drawer' smaller than 2.
 
 	* org-exp.el (org-html-level-start): Add a CSS class to section
 	numbers.

+ 4 - 1
lisp/org-clock.el

@@ -395,6 +395,7 @@ the clocking selection, associated with the letter `d'."
 	      last (match-beginning 0)
 	      cnt (1+ cnt)))
       (when (and (integerp org-clock-into-drawer)
+		 last
 		 (>= (1+ cnt) org-clock-into-drawer))
 	;; Wrap current entries into a new drawer
 	(goto-char last)
@@ -420,7 +421,9 @@ the clocking selection, associated with the letter `d'."
 	;; Planning info, skip to after it
 	(beginning-of-line 2)
 	(or (bolp) (newline)))
-      (when (eq t org-clock-into-drawer)
+      (when (or (eq org-clock-into-drawer t)
+		(and (integerp org-clock-into-drawer)
+		     (< org-clock-into-drawer 2)))
 	(insert ":CLOCK:\n:END:\n")
 	(beginning-of-line 0)
 	(org-indent-line-function)