emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* defining a clocktable in a capture template with absolute timespan computed relative to today
@ 2012-04-17  8:57 Brian van den Broek
  2012-04-27  3:52 ` Ippei FURUHASHI
  0 siblings, 1 reply; 5+ messages in thread
From: Brian van den Broek @ 2012-04-17  8:57 UTC (permalink / raw)
  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.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: defining a clocktable in a capture template with absolute timespan computed relative to today
  2012-04-17  8:57 defining a clocktable in a capture template with absolute timespan computed relative to today Brian van den Broek
@ 2012-04-27  3:52 ` Ippei FURUHASHI
  2012-04-30 17:29   ` Brian van den Broek
  0 siblings, 1 reply; 5+ messages in thread
From: Ippei FURUHASHI @ 2012-04-27  3:52 UTC (permalink / raw)
  To: Brian van den Broek; +Cc: emacs-orgmode

Hi Brian,

Brian van den Broek <brian.van.den.broek@gmail.com> 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

where the current-time is:

#+BEGIN_SRC elisp
(format-time-string "%Y-%m-%d" (current-time))
#+END_SRC

#+RESULTS:
: 2012-04-27


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

HTH,
IP


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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: defining a clocktable in a capture template with absolute timespan computed relative to today
  2012-04-27  3:52 ` Ippei FURUHASHI
@ 2012-04-30 17:29   ` Brian van den Broek
  2012-05-01 18:45     ` Ippei FURUHASHI
  2012-05-02 21:44     ` Bernt Hansen
  0 siblings, 2 replies; 5+ messages in thread
From: Brian van den Broek @ 2012-04-30 17:29 UTC (permalink / raw)
  To: Ippei FURUHASHI; +Cc: emacs-orgmode

On 27 April 2012 05:52, Ippei FURUHASHI <top.tuna+orgmode@gmail.com> wrote:
> Hi Brian,
>
> Brian van den Broek <brian.van.den.broek@gmail.com> 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

<snip>

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: defining a clocktable in a capture template with absolute timespan computed relative to today
  2012-04-30 17:29   ` Brian van den Broek
@ 2012-05-01 18:45     ` Ippei FURUHASHI
  2012-05-02 21:44     ` Bernt Hansen
  1 sibling, 0 replies; 5+ messages in thread
From: Ippei FURUHASHI @ 2012-05-01 18:45 UTC (permalink / raw)
  Cc: emacs-orgmode

Hi Brian,

Brian van den Broek <brian.van.den.broek@gmail.com> writes:

> On 27 April 2012 05:52, Ippei FURUHASHI <top.tuna+orgmode@gmail.com> wrote:
>> Hi Brian,
>>
>> Brian van den Broek <brian.van.den.broek@gmail.com> 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
>
> <snip>
>
> 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 :-)
>
It's my pleasure.

>>> 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.
Thanks for sharing it.

According to your instruction, I filled in the table.
This table has both the plan and the results.
|-------------------------+---------------------------|
| Task                  * | Pomos                   * |
|-------------------------+---------------------------|
| Plan the day            | (X) blah blah blah        |
| Some Task               | [X][ ]                    |
| Work on Textbook        | [X][X] [X][X] ++          |
|-------------------------+---------------------------|

To save or to gain the time for ongoing substantial tasks, you need the
clocktable.  That's why you review the table as well as the clocktable.

For me, your logging system looks like another (visual) expression of
- Effort
- clock time
- priority (to filter tasks).
It's reasonable.

> 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
Thanks again for sharing it.

Best,
IP

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: defining a clocktable in a capture template with absolute timespan computed relative to today
  2012-04-30 17:29   ` Brian van den Broek
  2012-05-01 18:45     ` Ippei FURUHASHI
@ 2012-05-02 21:44     ` Bernt Hansen
  1 sibling, 0 replies; 5+ messages in thread
From: Bernt Hansen @ 2012-05-02 21:44 UTC (permalink / raw)
  To: Brian van den Broek; +Cc: Ippei FURUHASHI, emacs-orgmode

Brian van den Broek <brian.van.den.broek@gmail.com> writes:

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

For this maybe try clocking the task in with an effort estimate of 2
hours and CLOCK_MODELINE_TOTAL property set to 'today'

--8<---------------cut here---------------start------------->8---
* TODO Work on some task for 2 hours daily
:PROPERTIES:
:CLOCK_MODELINE_TOTAL: today
:Effort: 2:00
:END:
[2012-05-02 Wed 17:41]
--8<---------------cut here---------------end--------------->8---

then you can easily see how much time you've spent on the task on the
modeline daily as you work on it (and what your limit/target amount is)

HTH,
Bernt

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-05-02 21:44 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-17  8:57 defining a clocktable in a capture template with absolute timespan computed relative to today Brian van den Broek
2012-04-27  3:52 ` Ippei FURUHASHI
2012-04-30 17:29   ` Brian van den Broek
2012-05-01 18:45     ` Ippei FURUHASHI
2012-05-02 21:44     ` Bernt Hansen

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