[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Orgmode] clock based context settings
From: |
David Maus |
Subject: |
Re: [Orgmode] clock based context settings |
Date: |
Wed, 20 Jan 2010 09:30:41 +0100 |
User-agent: |
Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (Gojō) APEL/10.7 Emacs/23.1.91 (i486-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) |
Hi Richard,
At Tue, 19 Jan 2010 23:16:08 +0100,
Richard Riley wrote:
>
>
> I would like to be able to execute arbitrary elisp when I clock in or
> out of a certain org.item This would be very, very useful for defining
> variables or even keystrokes on a "per project" basis. Ideally it would
> work using inheritance so if an item does not have something then the
> project or file level values would be used.
>
> e.g at the file level:
>
> #+CLOCKINEXEC: (setq curr-url "project1.com")
>
> Or at the org item level
>
> ** touch up picture of the org logo
> :PROPERTIES:
> :CLOCKINEXEC: (setq curr-url "org-mode.com/images")
> :END:
>
> Would others think this might be useful or is there another way/approach
> to achieve something similar?
You could use the org-clock-hooks `org-clock-in-hook',
`org-clock-out-hook' and `org-clock-cancel-hook' in combination with a
function that checks for the desired conditions and sets the variables
accordingly.
A question that came in my mind: What happens if you clock out or
cancel a clock? Are the variables kept or set to a default value? Or
to the value they had before clocking in?
Regards
-- David
--
OpenPGP... 0x99ADB83B5A4478E6
Jabber.... address@hidden
Email..... address@hidden
pgpLKiZ7Kv1mQ.pgp
Description: PGP signature