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.... dmj...@jabber.org
Email..... maus.da...@gmail.com

Attachment: pgppO3uUQMJE2.pgp
Description: PGP signature

_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

Reply via email to