From mboxrd@z Thu Jan 1 00:00:00 1970 From: Brian van den Broek Subject: Re: defining a clocktable in a capture template with absolute timespan computed relative to today Date: Mon, 30 Apr 2012 19:29:03 +0200 Message-ID: References: <80haw595tc.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Return-path: Received: from eggs.gnu.org ([208.118.235.92]:43063) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SOuQ0-0000X0-DE for emacs-orgmode@gnu.org; Mon, 30 Apr 2012 13:29:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SOuPy-000126-9J for emacs-orgmode@gnu.org; Mon, 30 Apr 2012 13:29:47 -0400 Received: from mail-ob0-f169.google.com ([209.85.214.169]:63599) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SOuPx-00011g-W4 for emacs-orgmode@gnu.org; Mon, 30 Apr 2012 13:29:46 -0400 Received: by obbwd18 with SMTP id wd18so1753993obb.0 for ; Mon, 30 Apr 2012 10:29:44 -0700 (PDT) In-Reply-To: <80haw595tc.fsf@gmail.com> 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: Ippei FURUHASHI Cc: emacs-orgmode On 27 April 2012 05:52, Ippei FURUHASHI wrote: > Hi Brian, > > Brian van den Broek writes: >> how to add 1 day to the return value of (current-time). > > This hard coding is out of org-mode range, > > #+BEGIN_SRC elisp > (format-time-string "%Y-%m-%d" (time-add (current-time) (seconds-to-time (* 24 60 60)))) > #+END_SRC > > #+RESULTS: > : 2012-04-28 Hi IP, Thanks for the reply and apologies for the delay in my response; I was traveling. Thanks too for the code sample. It does exactly what was desired. (I expect I ought to have been able to dig that up for myself, so a double thanks :-) >> 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. > I'm very interested. How do you compare your plan with results? I was experimenting with planning tasks at the beginning of the day by assigning a number of .5 hour blocks to them at the outset of the day and then simply visually inspecting a clock table for the day at day's end to see how well I managed to adhere to the intent. I have something like this in my org-capture-templates definition: #+BEGIN_SRC elisp ("p" "Plan the Day" entry (file+datetree "log.org") "* Plan and Work Log for %(format-time-string \"%Y-%m-%d\" (current-time)) :plan: :PROPERTIES: :entered: %U :END: |-----------------------------------+-----------------------------| | Task * | Pomos * | |-----------------------------------+-----------------------------| | [[id:de721347-0896-41d3-84d0-da824332c71c][Plan the day]] | ( ) %i | | [[id:898a9827-2d51-4fd7-8e07-4ff678a83e19][Some Task]] | [ ][ ] | | [[id:f30fc641-5e22-4329-8b9b-58dd26c28f54][Work on Textbook]] | [ ][ ] [ ][ ] | |-----------------------------------+-----------------------------| #+BEGIN: clocktable :maxlevel 4 :scope agenda :tstart \"<%(format-time-string \"%Y-%m-%d %a\" (current-time)) 08:00>\" :tend \"<%(format-time-string \"%Y-%m-%d %a\" (time-add (current-time) (seconds-to-time (* 24 60 60)))) 08:00>\" :link t :narrow 60! :indent t :tcolumns 3 :fileskip0 #+END: * Day's End :journal: " :empty-lines 1 :clock-in t :clock-resume t) ))) #+END_SRC (I am an extreme night owl, so 08:00 is a good place to mark the day change for me. I have '(setq org-extend-today-until 8)' in my .emacs.) Several constant tasks are built into the capture template, and each day I would add to and subtract from the daily plan as appropriate. I use '( )' to mark a .5 hour block that I estimated would be sufficient for the task at issue and a '[ ]' for a .5 hour block devoted to an ongoing substantial task. As I consume the blocks, I change them to '(X)' and '[X]'. For tasks where I underestimated the time needed, I use ' + ' to separate the second estimate. Tasks where I overestimated have the unconsumed '( )' left as is. At the end of the day, I update the clock table, and judge how well my plans were followed by a simple visual scan. I also fill out a "diary" type entry under the headline at the end of the capture template. After doing this for a while, I abandoned it as having too much overhead for how I am presently working. I am on leave from a college teaching job for this academic year, and most of the projects that I am working on are large ongoing ones that I want to work on each day, but don't have broken down into estimate-able subtasks. (For instance, I am writing a textbook; I want to spend at least 2 hours a day on that, and will keep doing so until it is done, but there are no detailed subtasks suitable for estimation.) There is little flux and it is easy enough to tell by use of the clock table alone how well I am living up to my intentions. I will try this method again next semester when I am back to teaching and have more smaller tasks that are suitable for estimation (e.g., "Prepare Tuesday's lecture notes"). In any case, I don't aspire to do anything more robust than a quick visual inspection at the end of the day to see how my day matched my plans. Best, Brian vdB