문제

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