From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Mathias Dahl Newsgroups: gmane.emacs.help Subject: Re: Alarm clock for emacs Date: Tue, 27 Jun 2006 11:17:58 +0200 Message-ID: References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1151401260 29684 80.91.229.2 (27 Jun 2006 09:41:00 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 27 Jun 2006 09:41:00 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Jun 27 11:40:58 2006 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1FvA3z-0006ee-7V for geh-help-gnu-emacs@m.gmane.org; Tue, 27 Jun 2006 11:40:55 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FvA3y-0003mG-Oj for geh-help-gnu-emacs@m.gmane.org; Tue, 27 Jun 2006 05:40:54 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 31 Original-X-Trace: individual.net 81GPiSuPbIqTjiqkle2uLgeUoHrZRWTa0D1e1XXSzjJudRh2r0 User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (windows-nt) Cancel-Lock: sha1:TqVk8b+cQFjviLY35YxX4/6B+Fw= Original-Xref: shelby.stanford.edu gnu.emacs.help:140062 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:35687 Archived-At: Leon 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