unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Dieter Wilhelm <dieter@duenenhof-wilhelm.de>
Cc: help-gnu-emacs@gnu.org
Subject: Re: Alarm clock for emacs
Date: Tue, 25 Jul 2006 22:18:22 +0200	[thread overview]
Message-ID: <878xmhzbe9.fsf@hans.local.net> (raw)
In-Reply-To: <uzmfzgdo9.fsf@gmail.com> (Mathias Dahl's message of "Tue, 27 Jun 2006 11:17:58 +0200")

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

  parent reply	other threads:[~2006-07-25 20:18 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [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 [this message]
2006-06-26 19:19 Leon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=878xmhzbe9.fsf@hans.local.net \
    --to=dieter@duenenhof-wilhelm.de \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).