emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Orgmode] [PATCH] Run a hook when relative timer is continued


From: Christian Moe
Subject: [Orgmode] [PATCH] Run a hook when relative timer is continued
Date: Fri, 17 Dec 2010 14:41:23 +0100
User-agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10.5; en-US; rv:1.9.2.12) Gecko/20101027 Thunderbird/3.1.6


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

----

diff --git a/lisp/org-timer.el b/lisp/org-timer.el
index bac1187..ca0f838 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

--

Christian Moe
E-mail:  address@hidden
Website: http://christianmoe.com



Attachment: org-timer.el.diff
Description: Text document


reply via email to

[Prev in Thread] Current Thread [Next in Thread]