From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: Re: How to pause the relative timer Date: Mon, 5 Jan 2009 22:02:34 +0100 Message-ID: <8D3BA36F-3D58-415D-8214-188F9077B13C@uva.nl> References: <7bef1f890901040630r333dc928r547d77a195f2dc34@mail.gmail.com> <7bef1f890901050323s23c949fdxa0e6fdbb08b08120@mail.gmail.com> Mime-Version: 1.0 (Apple Message framework v929.2) Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LJwav-0001X5-Qm for emacs-orgmode@gnu.org; Mon, 05 Jan 2009 16:02:41 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LJwat-0001Ve-SN for emacs-orgmode@gnu.org; Mon, 05 Jan 2009 16:02:40 -0500 Received: from [199.232.76.173] (port=44648 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LJwat-0001VW-IT for emacs-orgmode@gnu.org; Mon, 05 Jan 2009 16:02:39 -0500 Received: from ik-out-1112.google.com ([66.249.90.180]:64381) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LJwas-0003fi-Rk for emacs-orgmode@gnu.org; Mon, 05 Jan 2009 16:02:39 -0500 Received: by ik-out-1112.google.com with SMTP id b32so1676918ika.2 for ; Mon, 05 Jan 2009 13:02:37 -0800 (PST) In-Reply-To: <7bef1f890901050323s23c949fdxa0e6fdbb08b08120@mail.gmail.com> 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: "Alan E. Davis" Cc: emacs-orgmode Mailinglist Hi Alan, I like to be able to pause the timer, very nice, this will make its way into Org one way or another. About talking to the VLC process - maybe it is easier to just send signals to the process, with `stop-process' and `continue' process, because this will work for any process, not just a specific player. - Carsten On Jan 5, 2009, at 12:23 PM, Alan E. Davis wrote: > Hello: > > I have been able to put together a tentative solution to this > problem of pausing the relative timer. > > It needs work, but perhaps one will be forgiven for posting it > (below). It has mostly been stolen, as anyone will see: > > > ---------------- Code -------------- > (defvar org-timer-pause-time nil > "t=0 for pause") > > (defvar org-timer-pause-restart-time nil > "t=last for pause") > > (defun org-aed-pause-timer-pause () > "Set the time of the pause timer to the start time > of the pause interval." > (interactive) > (setq org-timer-pause-time (current-time)) > (let ((ind 0)) > (save-excursion > (skip-chars-backward " \n\t") > (condition-case nil > (progn > (org-beginning-of-item) > (setq ind (org-get-indentation))) > (error nil))) > (or (bolp) (newline)) > (org-indent-line-to ind) > (insert "- paused: ") > (org-timer))) > > (defvar scnds nil) > > (defun org-aed-pause-timer-restart () > "Get current time, calculate pause interval, do the math, > and reset org-timer-start-time" > (interactive) > ; (setq org-timer-start-time > ; (seconds-to-time > ; (+ (time-to-seconds org-timer-start-time) > (setq scnds (time-to-seconds org-timer-start-time)) > (setq org-timer-start-time > (seconds-to-time > (+ scnds > (- > (time-to-seconds (current-time)) > (time-to-seconds org-timer-pause-time))))) > (let ((ind 0)) > (save-excursion > (skip-chars-backward " \n\t") > (condition-case nil > (progn > (org-beginning-of-item) > (setq ind (org-get-indentation))) > (error nil))) > (or (bolp) (newline)) > (org-indent-line-to ind) > (insert "- pause off: ") > (org-timer))) > > ------------END Code ---------------%--------------------- > > > > > -- > Alan Davis > > "It's never a matter of liking or disliking ..." > ---Santa Ynez Chumash Medicine Man > > _______________________________________________ > Emacs-orgmode mailing list > Remember: use `Reply All' to send replies to the list. > Emacs-orgmode@gnu.org > http://lists.gnu.org/mailman/listinfo/emacs-orgmode