0

I would like to start the countdown function, (org-timer-set-timer) (C-c C-x ;), and trigger an action once the timer is over. Any hints on how this could be achieved? Shall I just use the run-at-time function instead? (This wouldn't show the countdown timer in the mode bar, but I guess I could survive).

  • 1
    org-timer-done-hook? – rpluim Sep 20 '18 at 14:15
  • I know nothing about 'hooks', but thanks for the pointer, it looks like it is like a trigger which is what I think I need. – Mike Anblips Sep 21 '18 at 13:23
3

'hooks' are variables to which you can add functions that will get automatically called, so that you don't need to go changing the original source code to get a behaviour change. This particular one is not documented, apart from its name. You can use it by doing eg:

(defun my-org-timer-hook ()
  (message "My timer done"))
(add-hook 'org-timer-done-hook 'my-org-timer-hook)

See (emacs) Hooks for a fuller explanation.

  • C-h v org-timer-done-hook says "Hook run after countdown timer reaches zero." so strictly speaking, it is documented. Do you mean "documented in the manual"? – NickD Sep 21 '18 at 18:25
  • I somehow missed that, even though I was looking at org-timer.el. Documentation in the manual would be nice. – rpluim Sep 21 '18 at 20:57
  • I doubt that it is going to be documented in the manual: it's a bit too generic, so the general emacs hook documentation that you linked to probably covers it. – NickD Sep 21 '18 at 21:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.