From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: [PATCH] Run a hook when relative timer is continued Date: Mon, 20 Dec 2010 13:20:45 +0100 Message-ID: <333AF081-EB76-45CC-B9ED-B4A13C90ABCB@gmail.com> References: <4D0B6883.9020908@hf.uio.no> Mime-Version: 1.0 (Apple Message framework v936) Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Return-path: Received: from [140.186.70.92] (port=41682 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PUejf-0004Nx-W4 for emacs-orgmode@gnu.org; Mon, 20 Dec 2010 07:21:05 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PUeja-0001wj-Qv for emacs-orgmode@gnu.org; Mon, 20 Dec 2010 07:21:03 -0500 Received: from mail-bw0-f43.google.com ([209.85.214.43]:37344) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PUeja-0001wf-Kr for emacs-orgmode@gnu.org; Mon, 20 Dec 2010 07:20:58 -0500 Received: by bwz14 with SMTP id 14so3046102bwz.30 for ; Mon, 20 Dec 2010 04:20:54 -0800 (PST) In-Reply-To: <4D0B6883.9020908@hf.uio.no> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: christian.moe@hf.uio.no Cc: emacs-orgmode@gnu.org Applied, thanks. - Carsten On Dec 17, 2010, at 2:41 PM, Christian Moe wrote: > > 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: mail@christianmoe.com > Website: http://christianmoe.com > > > > _______________________________________________ > Emacs-orgmode mailing list > Please use `Reply All' to send replies to the list. > Emacs-orgmode@gnu.org > http://lists.gnu.org/mailman/listinfo/emacs-orgmode