emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Orgmode] [PATCH] clock reports: Only include current clocking task


From: Carsten Dominik
Subject: Re: [Orgmode] [PATCH] clock reports: Only include current clocking task when range includes task
Date: Mon, 17 May 2010 11:36:21 +0200

Applied, thanks.

- Carsten

On May 17, 2010, at 4:12 AM, Bernt Hansen wrote:

When org-clock-report-include-clocking-task is set we always add the
current clocking task to the clock report.  This is incorrect if you
are looking at an agenda clock report for a time range that does not
include the current clocking task (e.g. yesterday or last week).

Now we only include the current clocking task if the clock report
date range includes the current clocking task start time.
---
Update patch without the debug call to the (message)

This patch is available at git://git.norang.ca/org-mode.git for- carsten

-Bernt

lisp/org-clock.el |   13 ++++++++-----
1 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/lisp/org-clock.el b/lisp/org-clock.el
index 504f0c9..07e2e45 100644
--- a/lisp/org-clock.el
+++ b/lisp/org-clock.el
@@ -1396,12 +1396,15 @@ nil are excluded from the clock summation."
                      (* 60 (string-to-number (match-string 4))))))
         (t ;; A headline
          ;; Add the currently clocking item time to the total
-         (when (and org-clock-report-include-clocking-task
-                    (equal (org-clocking-buffer) (current-buffer))
-                    (equal (marker-position org-clock-hd-marker) (point)))
+ (let ((org-clock-start-time-as-float (org-float-time org-clock- start-time)))
+           (when (and org-clock-report-include-clocking-task
+                      (equal (org-clocking-buffer) (current-buffer))
+                      (equal (marker-position org-clock-hd-marker) (point))
+                      (>= org-clock-start-time-as-float tstart)
+                      (<= org-clock-start-time-as-float tend))
              (let ((time (floor (- (org-float-time)
-                                   (org-float-time org-clock-start-time)) 60)))
-               (setq t1 (+ t1 time))))
+                                   org-clock-start-time-as-float) 60)))
+               (setq t1 (+ t1 time)))))
          (let* ((headline-forced
                  (get-text-property (point)
:org-clock-force-headline- inclusion))
--
1.7.1.86.g0e460


_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
address@hidden
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

- Carsten






reply via email to

[Prev in Thread] Current Thread [Next in Thread]