diff options
author | Bastien Guerry <bzg@altern.org> | 2012-07-27 17:24:16 +0200 |
---|---|---|
committer | Bastien Guerry <bzg@altern.org> | 2012-07-27 17:24:16 +0200 |
commit | 796b4ec43bef813fc482ca996e8dc2ee3f09200a (patch) | |
tree | a2850eaeae2175aba25deff1da445ca09c96bda2 | |
parent | eb7a9a1d8d52f54cbe2dfaddda27104841ee9e60 (diff) | |
download | org-mode-796b4ec43bef813fc482ca996e8dc2ee3f09200a.tar.gz |
org-clock.el: Set the marker for `org-clock-history' at a safer position.
* org-clock.el (org-clock-in): Set the marker for
`org-clock-history' at a safer position.
The clock marker stored in `org-clock-history' used to be at the
beginning of the heading. When manually inserting content here,
the marker is not updated because it is *before* the point. So
set the clock marker right after the first "*" of the headline
so that it will always be correctly updated.
-rw-r--r-- | lisp/org-clock.el | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lisp/org-clock.el b/lisp/org-clock.el index 4e85cb3..3e0c586 100644 --- a/lisp/org-clock.el +++ b/lisp/org-clock.el @@ -1146,7 +1146,12 @@ clock in by using the last clock-out time as the start time (goto-char target-pos) (org-back-to-heading t) (or interrupting (move-marker org-clock-interrupted-task nil)) - (org-clock-history-push) + (save-excursion + (forward-char) ;; make sure the marker is not at the + ;; beginning of the heading, since the + ;; user is liking to insert stuff here + ;; manually + (org-clock-history-push)) (org-clock-set-current) (cond ((functionp org-clock-in-switch-to-state) (looking-at org-complex-heading-regexp) |