From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: [PATCH] Optionally include current clocking task time in clock reports Date: Mon, 1 Mar 2010 11:57:40 +0100 Message-ID: <5F3C02F2-0F11-48DC-8578-FC6382A73847@gmail.com> References: <1267236547-2273-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 mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Nm3Jq-0007MA-DW for emacs-orgmode@gnu.org; Mon, 01 Mar 2010 05:57:46 -0500 Received: from [140.186.70.92] (port=57438 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Nm3Jo-0007L0-NI for emacs-orgmode@gnu.org; Mon, 01 Mar 2010 05:57:45 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Nm3Jn-0006uv-Ih for emacs-orgmode@gnu.org; Mon, 01 Mar 2010 05:57:44 -0500 Received: from mail-ew0-f222.google.com ([209.85.219.222]:44217) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Nm3Jn-0006uq-Bb for emacs-orgmode@gnu.org; Mon, 01 Mar 2010 05:57:43 -0500 Received: by ewy22 with SMTP id 22so1593318ewy.26 for ; Mon, 01 Mar 2010 02:57:42 -0800 (PST) In-Reply-To: <1267236547-2273-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 Really, was it so simple in the end? Thanks, I applied the patch. - Carsten On Feb 27, 2010, at 3:09 AM, Bernt Hansen wrote: > Use a new custom variable org-clock-report-include-clocking-task > which defaults > to nil to keep the original clock reporting behaviour. > --- > This patch is available at git://git.norang.ca/org-mode for-carsten > > lisp/org-clock.el | 12 ++++++++++++ > 1 files changed, 12 insertions(+), 0 deletions(-) > > diff --git a/lisp/org-clock.el b/lisp/org-clock.el > index cb378e6..0244f31 100644 > --- a/lisp/org-clock.el > +++ b/lisp/org-clock.el > @@ -240,6 +240,11 @@ string as argument." > (const :tag "Always" t) > (const :tag "When no clock is running" when-no-clock-is-running))) > > +(defcustom org-clock-report-include-clocking-task nil > + "When non-nil, include the current clocking task time in clock > reports." > + :group 'org-clock > + :type 'boolean) > + > (defvar org-clock-in-prepare-hook nil > "Hook run when preparing the clock. > This hook is run before anything happens to the task that > @@ -1341,6 +1346,13 @@ TSTART and TEND can mark a time range to be > considered." > (setq t1 (+ t1 (string-to-number (match-string 5)) > (* 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 ((time (floor (- (org-float-time) > + (org-float-time org-clock-start-time)) 60))) > + (setq t1 (+ t1 time)))) > (setq level (- (match-end 1) (match-beginning 1))) > (when (or (> t1 0) (> (aref ltimes level) 0)) > (loop for l from 0 to level do > -- > 1.7.0.90.g251a4 > > > > _______________________________________________ > 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