From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: Agenda clock reporting Date: Sun, 3 Jan 2010 16:44:38 +0100 Message-ID: References: <87fx73qhxq.fsf@gollum.intra.norang.ca> <01B0D18A-0F04-44A3-A340-50128FFEFC57@gmail.com> <87eim7i7zd.fsf@gollum.intra.norang.ca> <2728B4EE-06FA-409C-9065-01F388554411@gmail.com> <87aawvi4fx.fsf@gollum.intra.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 1NRSdL-0007ku-I3 for emacs-orgmode@gnu.org; Sun, 03 Jan 2010 10:44:47 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NRSdG-0007kN-Eu for emacs-orgmode@gnu.org; Sun, 03 Jan 2010 10:44:46 -0500 Received: from [199.232.76.173] (port=37145 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NRSdG-0007kK-6q for emacs-orgmode@gnu.org; Sun, 03 Jan 2010 10:44:42 -0500 Received: from mail-ew0-f224.google.com ([209.85.219.224]:58390) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NRSdF-00064G-N9 for emacs-orgmode@gnu.org; Sun, 03 Jan 2010 10:44:41 -0500 Received: by ewy24 with SMTP id 24so17162144ewy.26 for ; Sun, 03 Jan 2010 07:44:40 -0800 (PST) In-Reply-To: <87aawvi4fx.fsf@gollum.intra.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: Carsten Dominik , emacs-orgmode@gnu.org On Jan 3, 2010, at 4:38 PM, Bernt Hansen wrote: > Carsten Dominik writes: > >> On Jan 3, 2010, at 3:22 PM, Bernt Hansen wrote: >> >>> Carsten Dominik writes: >>> >>>> 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 >> >> Yes, the alternative approach would be to *not* modify the regexp, >> but >> to >> check if org-clock-hd-marker points to the current headline and then >> add the time since the clock started (in `org-clock-start-time') to >> the appropriate >> field in the ltimes vector before extracting the total time. So you >> would do >> this as the first thing when you find a headline, and the proceed >> normally. >> >> Sounds simpler than modifying the regexp and would not cause any >> problems >> with other incomplete clock entries that may have been left behind >> and >> never >> properly resolved...... > > That does sound simpler ... I'll give that a try. In fact, you only need to add the time to t1, not to the ltimes vector..... - Carsten