emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Fredrik Unger <fred@tree.se>
To: emacs-orgmode@gnu.org
Subject: Re: Recording Time - org-clock-sum
Date: Tue, 18 Nov 2014 11:31:17 +0100	[thread overview]
Message-ID: <546B1FF5.3000400@tree.se> (raw)
In-Reply-To: <87sihhndww.fsf@ucl.ac.uk>

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.
>

      reply	other threads:[~2014-11-18 10:31 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-05 17:00 Recording Time - org-clock-sum Fredrik Unger
2014-11-06  9:14 ` Sebastien Vauban
2014-11-17 18:31 ` Fredrik Unger
2014-11-18  7:52   ` Eric S Fraga
2014-11-18 10:31     ` Fredrik Unger [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=546B1FF5.3000400@tree.se \
    --to=fred@tree.se \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).