|
From: | Fredrik Unger |
Subject: | Re: [O] Recording Time - org-clock-sum |
Date: | Tue, 18 Nov 2014 11:31:17 +0100 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.2.0 |
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.
[Prev in Thread] | Current Thread | [Next in Thread] |