From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bernt Hansen Subject: Re: Agenda clock reporting Date: Sun, 03 Jan 2010 09:22:14 -0500 Message-ID: <87eim7i7zd.fsf@gollum.intra.norang.ca> References: <87fx73qhxq.fsf@gollum.intra.norang.ca> <01B0D18A-0F04-44A3-A340-50128FFEFC57@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NRRLe-000527-W8 for emacs-orgmode@gnu.org; Sun, 03 Jan 2010 09:22:27 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NRRLb-00050F-6I for emacs-orgmode@gnu.org; Sun, 03 Jan 2010 09:22:26 -0500 Received: from [199.232.76.173] (port=44271 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NRRLb-000506-0C for emacs-orgmode@gnu.org; Sun, 03 Jan 2010 09:22:23 -0500 Received: from mho-01-ewr.mailhop.org ([204.13.248.71]:62679) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NRRLb-0003yN-59 for emacs-orgmode@gnu.org; Sun, 03 Jan 2010 09:22:23 -0500 In-Reply-To: <01B0D18A-0F04-44A3-A340-50128FFEFC57@gmail.com> (Carsten Dominik's message of "Sun\, 3 Jan 2010 14\:24\:59 +0100") 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: Carsten Dominik Cc: Carsten Dominik , emacs-orgmode@gnu.org Carsten Dominik writes: > On Dec 22, 2009, at 2:03 PM, Bernt Hansen wrote: > >> Hi Carsten, >> >> I use the agenda clock report during the end of my day. Would it be >> difficult to have it include the currently clocking task if a clock is >> active? >> >> I clock billable and nonbillable tasks during the day. If I want to >> stop working at 8 billable hours I currently run the clock report and >> then find the current active clock entry (last one on the page with >> l' >> in the agenda) and manually add the time accumulated to the clock >> report >> to see when I'm done for the day. This is a bit tedious and error >> prone. >> >> I'm thinking that since agenda clock reports are not permanent it >> wouldn't hurt to include the current clocking item in the agenda >> report if that is easy to do. I've been digging around in the clock >> report code in my limited spare time but haven't yet made any useful >> progress on this task. >> >> Any pointers on where to make this modification would be appreciated. > > Hi Bernt, > > I think the right place would be `org-clock-sum'. Right now, > this looks only for complete clock lines. You could modify the regexp > to check for incomplete lines (first time stamp only) and then check > if the org-clock-marker points to the current line. If yes, you could > use the current time as the end time and proceed. > > Send me a patch if you get this to work, with a customization variable > to turn this off. > > HTH Yes it does thanks. I found the logic that uses the regexp for parsing the times and summing them in reverse up to the headline in org-clock-sum. I haven't modified the regexp yet but was planning something similar to what you describe above. - org-clock-sum - Runs through headings in reverse order - counts clock entries bottom up to headline - adds a text property to the headline with total time - need to find out if current heading is clocking - add entry for open clock time with closing time to get correct total - regexp needs to match open clock entries - for open clock entry matches set time to zero - reset time if this is the current clocking entry I'll post the patch whenever it gets done. Thanks! Bernt