summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarsten Dominik <carsten.dominik@gmail.com>2009-05-28 19:49:11 +0200
committerCarsten Dominik <carsten.dominik@gmail.com>2009-05-28 19:49:11 +0200
commit5ce1c5708f7e46556aa00c11bca05b2765592afc (patch)
treea891fddede7f4455dc3f8318861f53a25a56b588
parent9efd83adddaac7004a5fc556e8144bb74d5295f1 (diff)
downloadorg-mode-5ce1c5708f7e46556aa00c11bca05b2765592afc.tar.gz
Clocking: Fix bug in the new cocking code
The cursor could move while collecting the total time for the current subtree.
-rwxr-xr-xlisp/ChangeLog3
-rw-r--r--lisp/org-clock.el9
2 files changed, 8 insertions, 4 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 39b41ca..f57d1c5 100755
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,8 @@
2009-05-28 Carsten Dominik <carsten.dominik@gmail.com>
+ * org-clock.el (org-clock-sum-current-item): Fix positioning bug
+ when retrieving total clocked time in the subtree.
+
* org.el (org-quoting-blocks): New variable.
2009-05-27 Carsten Dominik <carsten.dominik@gmail.com>
diff --git a/lisp/org-clock.el b/lisp/org-clock.el
index a6bd08d..2c14050 100644
--- a/lisp/org-clock.el
+++ b/lisp/org-clock.el
@@ -289,10 +289,11 @@ pointing to it."
(defun org-clock-sum-current-item ()
"Returns time, clocked on current item in total"
- (save-restriction
- (org-narrow-to-subtree)
- (org-clock-sum)
- org-clock-file-total-minutes))
+ (save-excursion
+ (save-restriction
+ (org-narrow-to-subtree)
+ (org-clock-sum)
+ org-clock-file-total-minutes)))
(defun org-clock-get-clock-string ()
"Form a clock-string, that will be show in the mode line.