Вопрос

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?

Это было полезно?

Решение

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.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top