Browse Source

Bug fix with starting clock at end of buffer.

There was a problem that in this case the first CLOCK time stamp
is entered in the headline.  Reported by Sebastian Rose.
Carsten Dominik 17 years ago
parent
commit
ef7472779f
2 changed files with 10 additions and 1 deletions
  1. 5 0
      ChangeLog
  2. 5 1
      org.el

+ 5 - 0
ChangeLog

@@ -1,3 +1,8 @@
+2008-03-18  Carsten Dominik  <dominik@science.uva.nl>
+
+	* org.el (org-clock-find-position): Handle special case at end of
+	buffer.
+
 2008-03-17  Carsten Dominik  <dominik@science.uva.nl>
 2008-03-17  Carsten Dominik  <dominik@science.uva.nl>
 
 
 	* org.el (org-scheduled-past-days): Respect
 	* org.el (org-scheduled-past-days): Respect

+ 5 - 1
org.el

@@ -18605,7 +18605,11 @@ If necessary, clock-out of the currently active clock."
   "Find the location where the next clock line should be inserted."
   "Find the location where the next clock line should be inserted."
   (org-back-to-heading t)
   (org-back-to-heading t)
   (catch 'exit
   (catch 'exit
-    (let ((beg (point-at-bol 2)) (end (progn (outline-next-heading) (point)))
+    (let ((beg (save-excursion
+		 (beginning-of-line 2)
+		 (or (bolp) (newline))
+		 (point)))
+	  (end (progn (outline-next-heading) (point)))
 	  (re (concat "^[ \t]*" org-clock-string))
 	  (re (concat "^[ \t]*" org-clock-string))
 	  (cnt 0)
 	  (cnt 0)
 	  first last)
 	  first last)