* How to pause the relative timer
@ 2009-01-04 14:30 Alan E. Davis
2009-01-05 11:23 ` Alan E. Davis
2009-01-08 11:20 ` Carsten Dominik
0 siblings, 2 replies; 4+ messages in thread
From: Alan E. Davis @ 2009-01-04 14:30 UTC (permalink / raw
To: emacs-orgmode Mailinglist
[-- Attachment #1.1: Type: text/plain, Size: 2272 bytes --]
I jumped into some elisp, and eventually I might get it, but while I think
I'm close, my vacation is over, and I'm going to call "uncle".
Here is some crummy code I started putting together to try to pause the
relative timer in org-timer.el. Can someone give me a nudge, and suggest
what's wrong? (Lot's, I'll wager!). I get the message "time-to-seconds:
Symbol's function definition is void: org-pause-timer-time" when running
org-aed-pause-timer-start after setting with org-aed-pause-timer-pause.
I'll bet there are better ways to do this. I'll figure it out when I have
time.
-------------------%--------------
(defvar org-pause-timer-time nil
"t=X for stopped timer.")
(defun org-aed-pause-timer-pause ()
"Set the time at pause to a variable for later recovery
in org-aed-pause-timer-start"
(interactive)
(let (org-pause-timer-time (current-time))))
(defun org-aed-pause-timer-start ()
"Recover pause start time, do the math, and restart at the new time"
(interactive)
(insert (format
org-timer-format
(org-timer-secs-to-hms
(floor
(- (time-to-seconds (current-time))
(time-to-seconds (org-pause-timer-time))))))))
----------------------------X------------
I have a plan, beyond the mere and obvious utility of being able to pause
the timer. With some help, I've burgled some code and gotten a function to
start vlc asynchronously on a video file from dired. Eventually, I want to
figure out how to pause the vlc process, and pause the org-mode timer at the
same time.
It just occurred to me, however, that it would be even more interesting to
pause the video player and org-mode's timer would put the pause time into
the buffer, to accept a note. Hmmm... FOr that I have to figure out how to
remotely pause vlc and restart. Of course, this kind of project could
easily get out of hand. I'm afraid it's beyond my programming ability, but
it's already interesting.
Frivolous? If anyone wants to look at the "dired-vlc.el" code, I'll send
it, but I would think it's beyond this list's boundaries of interest (if
that's possible).
Thanks for Org-mode, and thanks for being patient.
Alan
--
Alan Davis
"It's never a matter of liking or disliking ..."
---Santa Ynez Chumash Medicine Man
[-- Attachment #1.2: Type: text/html, Size: 2827 bytes --]
[-- Attachment #2: Type: text/plain, Size: 204 bytes --]
_______________________________________________
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
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: How to pause the relative timer
2009-01-04 14:30 How to pause the relative timer Alan E. Davis
@ 2009-01-05 11:23 ` Alan E. Davis
2009-01-05 21:02 ` Carsten Dominik
2009-01-08 11:20 ` Carsten Dominik
1 sibling, 1 reply; 4+ messages in thread
From: Alan E. Davis @ 2009-01-05 11:23 UTC (permalink / raw
To: emacs-orgmode Mailinglist
[-- Attachment #1.1: Type: text/plain, Size: 1831 bytes --]
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
[-- Attachment #1.2: Type: text/html, Size: 3002 bytes --]
[-- Attachment #2: Type: text/plain, Size: 204 bytes --]
_______________________________________________
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
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Re: How to pause the relative timer
2009-01-05 11:23 ` Alan E. Davis
@ 2009-01-05 21:02 ` Carsten Dominik
0 siblings, 0 replies; 4+ messages in thread
From: Carsten Dominik @ 2009-01-05 21:02 UTC (permalink / raw
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
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: How to pause the relative timer
2009-01-04 14:30 How to pause the relative timer Alan E. Davis
2009-01-05 11:23 ` Alan E. Davis
@ 2009-01-08 11:20 ` Carsten Dominik
1 sibling, 0 replies; 4+ messages in thread
From: Carsten Dominik @ 2009-01-08 11:20 UTC (permalink / raw
To: Alan E. Davis; +Cc: emacs-orgmode Mailinglist
Hi Alan,
pausing and continuing the timer is now in the latest git release.
The command is `C-c C-x ,', fir both actions. ALso, the running
timer is now shown in the mode line, use `C-u C-c C-x ,' to really
stop the timer and to remove te display in the mode line.
- Carsten
On Jan 4, 2009, at 3:30 PM, Alan E. Davis wrote:
> I jumped into some elisp, and eventually I might get it, but while I
> think I'm close, my vacation is over, and I'm going to call "uncle".
>
> Here is some crummy code I started putting together to try to pause
> the relative timer in org-timer.el. Can someone give me a nudge,
> and suggest what's wrong? (Lot's, I'll wager!). I get the message
> "time-to-seconds: Symbol's function definition is void: org-pause-
> timer-time" when running org-aed-pause-timer-start after setting
> with org-aed-pause-timer-pause. I'll bet there are better ways to
> do this. I'll figure it out when I have time.
>
>
> -------------------%--------------
> (defvar org-pause-timer-time nil
> "t=X for stopped timer.")
>
> (defun org-aed-pause-timer-pause ()
> "Set the time at pause to a variable for later recovery
> in org-aed-pause-timer-start"
> (interactive)
> (let (org-pause-timer-time (current-time))))
>
> (defun org-aed-pause-timer-start ()
> "Recover pause start time, do the math, and restart at the new time"
> (interactive)
> (insert (format
> org-timer-format
> (org-timer-secs-to-hms
> (floor
> (- (time-to-seconds (current-time))
> (time-to-seconds (org-pause-timer-time))))))))
> ----------------------------X------------
>
>
> I have a plan, beyond the mere and obvious utility of being able to
> pause the timer. With some help, I've burgled some code and gotten
> a function to start vlc asynchronously on a video file from dired.
> Eventually, I want to figure out how to pause the vlc process, and
> pause the org-mode timer at the same time.
>
> It just occurred to me, however, that it would be even more
> interesting to pause the video player and org-mode's timer would put
> the pause time into the buffer, to accept a note. Hmmm... FOr that
> I have to figure out how to remotely pause vlc and restart. Of
> course, this kind of project could easily get out of hand. I'm
> afraid it's beyond my programming ability, but it's already
> interesting.
>
> Frivolous? If anyone wants to look at the "dired-vlc.el" code, I'll
> send it, but I would think it's beyond this list's boundaries of
> interest (if that's possible).
>
> Thanks for Org-mode, and thanks for being patient.
>
> Alan
>
> --
> 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
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2009-01-08 11:20 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-04 14:30 How to pause the relative timer Alan E. Davis
2009-01-05 11:23 ` Alan E. Davis
2009-01-05 21:02 ` Carsten Dominik
2009-01-08 11:20 ` Carsten Dominik
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.