浏览代码

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.
Bastien Guerry 12 年之前
父节点
当前提交
796b4ec43b
共有 1 个文件被更改,包括 6 次插入1 次删除
  1. 6 1
      lisp/org-clock.el

+ 6 - 1
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)