From mboxrd@z Thu Jan 1 00:00:00 1970 From: Fredrik Unger Subject: Re: Recording Time - org-clock-sum Date: Tue, 18 Nov 2014 11:31:17 +0100 Message-ID: <546B1FF5.3000400@tree.se> References: <545A5794.8040203@tree.se> <546A3F0D.5020407@tree.se> <87sihhndww.fsf@ucl.ac.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:59766) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xqg4O-00062E-VZ for emacs-orgmode@gnu.org; Tue, 18 Nov 2014 05:31:44 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xqg4H-0002oz-Fj for emacs-orgmode@gnu.org; Tue, 18 Nov 2014 05:31:36 -0500 Received: from smtp1.biggnet.net ([82.145.128.2]:1330) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xqg4H-0002oh-54 for emacs-orgmode@gnu.org; Tue, 18 Nov 2014 05:31:29 -0500 Received: from tree.se ([82.145.144.65]) by smtp1.biggnet.net (IceWarp 9.4.2) with ESMTP (SSL) id EVX30927 for ; Tue, 18 Nov 2014 11:31:27 +0100 Received: from localhost ([::1]) by tree.se with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from ) id 1Xqg46-0007Ij-6J for emacs-orgmode@gnu.org; Tue, 18 Nov 2014 11:31:27 +0100 In-Reply-To: <87sihhndww.fsf@ucl.ac.uk> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Hi, I found a bug when testing larger files. diff --git a/.emacs b/.emacs index 3579b7a..9bb7e8c 100644 --- a/.emacs +++ b/.emacs @@ -255,7 +255,7 @@ (apply 'encode-time (org-parse-time-string te))) ts (if tstart (max ts tstart) ts) te (if tend (min te tend) te) - tl (if (> (- te ts) 0) (append (list ts te) tl)))))) + tl (if (> (- te ts) 0) (append (list ts te) tl) tl))))) (timeuniq (sort tl '<)))))) (defun org-dblock-write:rangereport (params) keeps the list from being set to nil once a day comes that does not account to the day. In my simple example there were just one day. There might be a better way, but these seems to work well for more complex examples as well. It can possibly be improved for speed, but as I only use it on a per month basis, it is fast enough. Fredrik Unger On 11/18/2014 08:52 AM, Eric S Fraga wrote: > On Monday, 17 Nov 2014 at 19:31, Fredrik Unger wrote: >> Hi, >> >> I implemented a couple of functions that provide me with the >> needed timestamps for my timereport [1]. > > Thanks for this. Looks interesting. I don't need this right now but I > will find it quite useful in 2.5 years' time (we need to clock our work > for a year every 3 years -- long story). I've made a note of it. > > Small point: good practice would be to name your emacs lisp code file > with a ".el" suffix. >