opensubscriber
   Find in this group all groups
 
Unknown more information…

h : help-gnu-emacs@gnu.org 26 July 2006 • 4:18AM -0400

Re: Alarm clock for emacs
by Dieter Wilhelm

REPLY TO AUTHOR
 
REPLY TO GROUP



Mathias Dahl <brakjoller@gmai...> writes:

> Leon <sdl.web@gmai...> 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


_______________________________________________
help-gnu-emacs mailing list
help-gnu-emacs@gnu....
http://lists.gnu.org/mailman/listinfo/help-gnu-emacs

Bookmark with:

Delicious   Digg   reddit   Facebook   StumbleUpon

Related Messages

opensubscriber is not affiliated with the authors of this message nor responsible for its content.