New hook for clock selection
commit4cfea25f243b1b60fb86bd11ed07164736635ef4
authorBenjamin Drieu <bdrieu@april.org>
Tue, 25 Jan 2011 00:03:48 +0000 (25 00:03 +0000)
committerCarsten Dominik <carsten.dominik@gmail.com>
Tue, 25 Jan 2011 05:53:35 +0000 (25 06:53 +0100)
tree2217c28e6b75ed17eb55feeb22c292593ab4becb
parentc78bf704edee3103a094a6057cf32c75c4f521a4
New hook for clock selection

* lisp/org-clock.el (org-clock-before-select-task-hook): New hook.
(org-clock-select-task): Run new hook.

Hi Org-moders,

I am often frustrated because I clock a lot of things and some of them
are repeated (i.e, coffee, read mails, etc.).  So when I want to clock
time I spend drinking coffee, the best I found was to search for a
headline matching "Coffee".  Or to tag frequent clocks and do some
agenda research on this tag.  Too long.  :-)

So here is a solution for this need : to add a shortcut property to
entries I would like to "bookmark" and insert matching entries in the
org-clock-select-task menu.  This can be done with :

* TODO Pause and drink coffee
  :PROPERTIES:
  :SHORTCUT: p
  :END:

then C-u C-c C-x C-i p.  And voilĂ , "Pause and drink coffee" is clocked!

Here is a patch that adds a hook into org-clock-select-task and a module
that adds the shortcut feature.  I tried to be the least intrusive
possible, if this proves to be useful, the hook trick might not be
needed.

Benj

TINYCHANGE
lisp/org-clock.el