Question

I use the Emacs org-mode for clocking in and out of work and I would like to automate some specific tasks every time I clock out. For example, I have a shell script to push repositories to a version control system and I would like to do this automatically when I'm finished working (i.e. when I clock out). This could be extended to every time you clock in as well (e.x. whenever I clock in I want to open my e-mail client automatically).

Any ideas on how to write Emacs lisp in my .emacs file to accomplish this?

Was it helpful?

Solution

You could write a function that does what you need to have done, and add it to org-clock-out-hook. Perhaps something like this (untested):

(defun my-on-org-clock-out ()
  (shell-command "commit-everything.sh"))

(add-hook 'org-clock-out-hook 'my-on-org-clock-out)

Likewise, there is a hook called org-clock-in-hook.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top