From ef7472779f356c9d5971ae61451fe4c2f671899d Mon Sep 17 00:00:00 2001 From: Carsten Dominik Date: Tue, 18 Mar 2008 15:15:21 +0100 Subject: [PATCH] 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. --- ChangeLog | 5 +++++ org.el | 6 +++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index a7a3afd90..c2e9376f7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-03-18 Carsten Dominik + + * org.el (org-clock-find-position): Handle special case at end of + buffer. + 2008-03-17 Carsten Dominik * org.el (org-scheduled-past-days): Respect diff --git a/org.el b/org.el index e9d035fc1..d5e9d2a68 100644 --- a/org.el +++ b/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." (org-back-to-heading t) (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)) (cnt 0) first last)