From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: [PATCH] clock reports: Only include current clocking task when range includes task Date: Mon, 17 May 2010 11:36:21 +0200 Message-ID: <0B970D2C-3E2D-40B6-BCFE-4FCA5487DF0A@gmail.com> References: <87r5lb9t4u.fsf@gollum.intra.norang.ca> <1274062343-8894-1-git-send-email-bernt@norang.ca> Mime-Version: 1.0 (Apple Message framework v936) Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Return-path: Received: from [140.186.70.92] (port=58916 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ODwkP-00012U-1o for emacs-orgmode@gnu.org; Mon, 17 May 2010 05:36:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1ODwkN-00016d-8R for emacs-orgmode@gnu.org; Mon, 17 May 2010 05:36:28 -0400 Received: from mail-wy0-f169.google.com ([74.125.82.169]:63613) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1ODwkN-00016Z-2T for emacs-orgmode@gnu.org; Mon, 17 May 2010 05:36:27 -0400 Received: by wyb40 with SMTP id 40so2020834wyb.0 for ; Mon, 17 May 2010 02:36:24 -0700 (PDT) In-Reply-To: <1274062343-8894-1-git-send-email-bernt@norang.ca> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Bernt Hansen Cc: emacs-orgmode@gnu.org 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. > Emacs-orgmode@gnu.org > http://lists.gnu.org/mailman/listinfo/emacs-orgmode - Carsten