From mboxrd@z Thu Jan 1 00:00:00 1970 From: Brian van den Broek Subject: defining a clocktable in a capture template with absolute timespan computed relative to today Date: Tue, 17 Apr 2012 10:57:40 +0200 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Return-path: Received: from eggs.gnu.org ([208.118.235.92]:56929) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SK4F3-0005av-Ch for emacs-orgmode@gnu.org; Tue, 17 Apr 2012 04:58:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SK4Ex-0001vr-1W for emacs-orgmode@gnu.org; Tue, 17 Apr 2012 04:58:28 -0400 Received: from mail-ob0-f169.google.com ([209.85.214.169]:56677) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SK4Ew-0001vg-Pf for emacs-orgmode@gnu.org; Tue, 17 Apr 2012 04:58:22 -0400 Received: by obbeh20 with SMTP id eh20so3326245obb.0 for ; Tue, 17 Apr 2012 01:58:20 -0700 (PDT) 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 Hi all, I've been experimenting with a new means of using org to plan my day at the outset and, at the end of it, to easily review how close I have come to accomplishing what I planned. For that second component, I want a clocktable covering the day to allow for an easy review of what I have accomplished. Since I am an extreme night-owl, I want the table to cover 8:00 of the day to 8:00 of the next one. (Things I do at 0:300 I think of as having been part of the previous day.) This is easy enough to accomplish manually. Today's, for instance, is defined as #+BEGIN: clocktable :maxlevel 4 :scope agenda :tstart "<2012-04-17 08:00>" :tend "<2012-04-18 Wed 08:00>" :fileskip0 #+END: I've defined a capture template to produce, in a datetree, the boiler-plate for my daily planning and for the end of day review. As yet, the best I have managed for the clocktable is to include (some aspects omitted): #+BEGIN: clocktable :tstart \"<%(format-time-string \"%Y-%m-%d\" (current-time)) 08:00>\" :tend \"<%(format-time-string \"%Y-%m-%d\" (current-time)) 08:00>\" :fileskip0 #+END: This still needs some fiddling to get the :tend parameter right as it defines it as exactly the same as the :tstart. What I need is something that fulfils the intent of :tend \"<%(format-time-string \"%Y-%m-%d\" (+ oneday (current-time))) 08:00>\". However, the docstring of (current-time) reads: Return the current time, as the number of seconds since 1970-01-01 00:00:00. The time is returned as a list of three integers. The first has the most significant 16 bits of the seconds, while the second has the least significant 16 bits. The third integer gives the microsecond count. My meagre elisp means that I will have to spend quite some time figuring out how to add 1 day to the return value of (current-time). So: 1) Is there an org-native way that I have overlooked to define a clock-table in a capture template that has the relative time-span that I desire? 2) If not, would someone please take pity on my poor elisp and give me the push to bring home my definition? Thanks and best, Brian vdB PS I suspect that this will wrap badly. Apologies if so; I hope the intent is nonetheless clear.