diff options
author | Carsten Dominik <carsten.dominik@gmail.com> | 2010-12-20 13:18:27 +0100 |
---|---|---|
committer | Carsten Dominik <carsten.dominik@gmail.com> | 2010-12-20 13:18:27 +0100 |
commit | 3ceee2fefefbeb4f210eb3aa0bab62ca879c09f1 (patch) | |
tree | 6d9301e5700d125aea646f2f584af91e5168d7b0 | |
parent | a43055a26fd0bc69bebf6350dc48a777aabbc06d (diff) | |
download | org-mode-3ceee2fefefbeb4f210eb3aa0bab62ca879c09f1.tar.gz |
Timer: Run a hook when relative timer is continued
* lisp/org-timer.el (org-timer-continue-hook): Define the variable
(org-timer-pause-or-continue): Run hook after relative timer is
continued
There was a hook run when the relative timer is paused (and for most
other actions), but none for continuing afterwards.
One use for this would be to pause/continue playback in a media-player
app with the same keystroke used to pause/continue the timer.
TINYCHANGE
Patch by Christian Moe
-rw-r--r-- | lisp/org-timer.el | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lisp/org-timer.el b/lisp/org-timer.el index bac1187..52c9afc 100644 --- a/lisp/org-timer.el +++ b/lisp/org-timer.el @@ -65,6 +65,9 @@ When 0, the user is prompted for a value." (defvar org-timer-pause-hook nil "Hook run before relative timer is paused.") +(defvar org-timer-continue-hook nil + "Hook run after relative timer is continued.") + (defvar org-timer-set-hook nil "Hook run after countdown timer is set.") @@ -128,6 +131,7 @@ With prefix arg STOP, stop it entirely." (org-float-time org-timer-start-time)))) org-timer-pause-time nil) (org-timer-set-mode-line 'on) + (run-hooks 'org-timer-continue-hook) (message "Timer continues at %s" (org-timer-value-string))) (t ;; pause timer |