Browse Source

org-clock: Fix generated drawer when `org-clock-into-drawer' is numerical

* lisp/org-clock.el (org-clock-find-position): Create a default
  "LOGBOOK" drawer when `org-clock-into-drawer' is a numeric value.

Reported-by: Carlos Noguera <carlos.francisco.noguera@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/106886>
Nicolas Goaziou 3 years ago
parent
commit
d1786a0908
1 changed files with 4 additions and 4 deletions
  1. 4 4
      lisp/org-clock.el

+ 4 - 4
lisp/org-clock.el

@@ -560,7 +560,7 @@ of a different task.")
 (defun org-clock-drawer-name ()
   "Return clock drawer's name for current entry, or nil."
   (let ((drawer (org-clock-into-drawer)))
-    (cond ((integerp drawer) (org-log-into-drawer))
+    (cond ((integerp drawer) (or (org-log-into-drawer) "LOGBOOK"))
 	  ((stringp drawer) drawer)
 	  (t nil))))
 
@@ -1514,9 +1514,9 @@ line and position cursor in that line."
 	 ;; When a clock drawer needs to be created because of the
 	 ;; number of clock items or simply if it is missing, collect
 	 ;; all clocks in the section and wrap them within the drawer.
-	 ((or drawer
-	      (and (wholenump org-clock-into-drawer)
-		   (>= (1+ count) org-clock-into-drawer)))
+	 ((if (wholenump org-clock-into-drawer)
+	      (>= (1+ count) org-clock-into-drawer)
+	    drawer)
 	  ;; Skip planning line and property drawer, if any.
 	  (org-end-of-meta-data)
 	  (let ((beg (point)))