unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Alarm clock for emacs
@ 2006-06-26 19:19 Leon
  0 siblings, 0 replies; 7+ messages in thread
From: Leon @ 2006-06-26 19:19 UTC (permalink / raw)


Hi there,

Does anyone know of an alarm clock that runs in emacs?

Thanks.
-- 
Leon

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Alarm clock for emacs
       [not found] <mailman.3374.1151349572.9609.help-gnu-emacs@gnu.org>
@ 2006-06-26 22:56 ` Chris McMahan
  2006-06-27  1:18   ` Leon
  2006-06-27  9:17 ` Mathias Dahl
  1 sibling, 1 reply; 7+ messages in thread
From: Chris McMahan @ 2006-06-26 22:56 UTC (permalink / raw)


You might look into calendar with the diary and appointment capability.

- Chris

Leon <sdl.web@gmail.com> writes:

> Hi there,
>
> Does anyone know of an alarm clock that runs in emacs?
>
> Thanks.
> -- 
> Leon

-- 
     (.   .)
  =ooO=(_)=Ooo=====================================
  Chris McMahan | first_initiallastname@one.dot.net
  =================================================

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Alarm clock for emacs
  2006-06-26 22:56 ` Alarm clock for emacs Chris McMahan
@ 2006-06-27  1:18   ` Leon
  0 siblings, 0 replies; 7+ messages in thread
From: Leon @ 2006-06-27  1:18 UTC (permalink / raw)


Chris McMahan <first_initiallastname@one.dot.net> writes:

> You might look into calendar with the diary and appointment capability.
>
> - Chris
>
> Leon <sdl.web@gmail.com> writes:
>
>> Hi there,
>>
>> Does anyone know of an alarm clock that runs in emacs?
>>
>> Thanks.
>> -- 
>> Leon

Eric Hanchrow has pointed me to appt-add. But he didn't cc to this
group.

Thanks.
-- 
Leon

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Alarm clock for emacs
       [not found] <mailman.3374.1151349572.9609.help-gnu-emacs@gnu.org>
  2006-06-26 22:56 ` Alarm clock for emacs Chris McMahan
@ 2006-06-27  9:17 ` Mathias Dahl
  2006-06-27 12:57   ` Leon
                     ` (2 more replies)
  1 sibling, 3 replies; 7+ messages in thread
From: Mathias Dahl @ 2006-06-27  9:17 UTC (permalink / raw)


Leon <sdl.web@gmail.com> writes:

> Does anyone know of an alarm clock that runs in emacs?

There is now! :) See below:

(defvar alarm-clock-timer nil
  "Keep timer so that the user can cancel the alarm")

(defun alarm-clock-message (text)
  "The actual alarm action"
  (message-box text))

(defun alarm-clock ()
  "Set an alarm.
The time format is the same accepted by `run-at-time'.  For
example \"11:30am\"."
  (interactive)
  (let ((time (read-string "Time: "))
        (text (read-string "Alarm message: ")))
    (setq alarm-clock-timer (run-at-time time nil 'alarm-clock-message text))))

(defun alarm-clock-cancel ()
  "Cancel the alarm clock"
  (interactive)
  (cancel-timer alarm-clock-timer))

It is very simple. It does not, for example, keep track of multiple
alarms so that you can cancel them individually.

/Mathias

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Alarm clock for emacs
  2006-06-27  9:17 ` Mathias Dahl
@ 2006-06-27 12:57   ` Leon
  2006-06-28  0:29   ` B. T. Raven
  2006-07-25 20:18   ` Dieter Wilhelm
  2 siblings, 0 replies; 7+ messages in thread
From: Leon @ 2006-06-27 12:57 UTC (permalink / raw)


Mathias Dahl <brakjoller@gmail.com> writes:

> Leon <sdl.web@gmail.com> writes:
>
>> Does anyone know of an alarm clock that runs in emacs?
>
> There is now! :) See below:
>
> (defvar alarm-clock-timer nil
>   "Keep timer so that the user can cancel the alarm")
>
> (defun alarm-clock-message (text)
>   "The actual alarm action"
>   (message-box text))
>
> (defun alarm-clock ()
>   "Set an alarm.
> The time format is the same accepted by `run-at-time'.  For
> example \"11:30am\"."
>   (interactive)
>   (let ((time (read-string "Time: "))
>         (text (read-string "Alarm message: ")))
>     (setq alarm-clock-timer (run-at-time time nil 'alarm-clock-message text))))
>
> (defun alarm-clock-cancel ()
>   "Cancel the alarm clock"
>   (interactive)
>   (cancel-timer alarm-clock-timer))
>
> It is very simple. It does not, for example, keep track of multiple
> alarms so that you can cancel them individually.
>
> /Mathias

Emacs hackers are cool. Thanks Mathias.

This is a nice example for me to learn elisp.

-- 
Leon

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Alarm clock for emacs
  2006-06-27  9:17 ` Mathias Dahl
  2006-06-27 12:57   ` Leon
@ 2006-06-28  0:29   ` B. T. Raven
  2006-07-25 20:18   ` Dieter Wilhelm
  2 siblings, 0 replies; 7+ messages in thread
From: B. T. Raven @ 2006-06-28  0:29 UTC (permalink / raw)



"Mathias Dahl" <brakjoller@gmail.com> wrote in message
news:uzmfzgdo9.fsf@gmail.com...
> Leon <sdl.web@gmail.com> writes:
>
> > Does anyone know of an alarm clock that runs in emacs?
>
> There is now! :) See below:
>
> (defvar alarm-clock-timer nil
>   "Keep timer so that the user can cancel the alarm")
>
> (defun alarm-clock-message (text)
>   "The actual alarm action"
>   (message-box text))
>
> (defun alarm-clock ()
>   "Set an alarm.
> The time format is the same accepted by `run-at-time'.  For
> example \"11:30am\"."
>   (interactive)
>   (let ((time (read-string "Time: "))
>         (text (read-string "Alarm message: ")))
>     (setq alarm-clock-timer (run-at-time time nil 'alarm-clock-message
text))))
>
> (defun alarm-clock-cancel ()
>   "Cancel the alarm clock"
>   (interactive)
>   (cancel-timer alarm-clock-timer))
>
> It is very simple. It does not, for example, keep track of multiple
> alarms so that you can cancel them individually.
>
> /Mathias

You can also add (ding) or (beep) before the (message-box text) but
apparenty not repeated beeps. Does anyone know of some way of doing this
(... while some-condition obtains [the message-box not closed] issue
repeated sounds). In 22.0 there is play-sound and play-sound-file but not
in 21.3.

Thanks,

Ed.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Alarm clock for emacs
  2006-06-27  9:17 ` Mathias Dahl
  2006-06-27 12:57   ` Leon
  2006-06-28  0:29   ` B. T. Raven
@ 2006-07-25 20:18   ` Dieter Wilhelm
  2 siblings, 0 replies; 7+ messages in thread
From: Dieter Wilhelm @ 2006-07-25 20:18 UTC (permalink / raw)
  Cc: help-gnu-emacs

Mathias Dahl <brakjoller@gmail.com> writes:

> Leon <sdl.web@gmail.com> writes:
>
>> Does anyone know of an alarm clock that runs in emacs?

See Appointments in the Emacs info Calendar/Diary node.

> There is now! :) See below:
>
> (defvar alarm-clock-timer nil
>   "Keep timer so that the user can cancel the alarm")
>
> (defun alarm-clock-message (text)
>   "The actual alarm action"
>   (message-box text))
>
> (defun alarm-clock ()
>   "Set an alarm.
> The time format is the same accepted by `run-at-time'.  For
> example \"11:30am\"."
>   (interactive)
>   (let ((time (read-string "Time: "))
>         (text (read-string "Alarm message: ")))
>     (setq alarm-clock-timer (run-at-time time nil 'alarm-clock-message text))))
>
> (defun alarm-clock-cancel ()
>   "Cancel the alarm clock"
>   (interactive)
>   (cancel-timer alarm-clock-timer))

Nice to see how this can be done.

> It is very simple. It does not, for example, keep track of multiple
> alarms so that you can cancel them individually.

appt does it for you

M-x appt-activate
M-x appt-add
M-x appt-delete

-- 
    Best wishes

    H. Dieter Wilhelm
    Darmstadt, Germany

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2006-07-25 20:18 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <mailman.3374.1151349572.9609.help-gnu-emacs@gnu.org>
2006-06-26 22:56 ` Alarm clock for emacs Chris McMahan
2006-06-27  1:18   ` Leon
2006-06-27  9:17 ` Mathias Dahl
2006-06-27 12:57   ` Leon
2006-06-28  0:29   ` B. T. Raven
2006-07-25 20:18   ` Dieter Wilhelm
2006-06-26 19:19 Leon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).