From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dieter Wilhelm Newsgroups: gmane.emacs.help Subject: Re: Alarm clock for emacs Date: Tue, 25 Jul 2006 22:18:22 +0200 Message-ID: <878xmhzbe9.fsf@hans.local.net> References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1153905602 10333 80.91.229.2 (26 Jul 2006 09:20:02 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 26 Jul 2006 09:20:02 +0000 (UTC) Cc: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Jul 26 11:19:55 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 1G5fYN-00085U-Vb for geh-help-gnu-emacs@m.gmane.org; Wed, 26 Jul 2006 11:19:44 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1G5fYN-0007IT-CX for geh-help-gnu-emacs@m.gmane.org; Wed, 26 Jul 2006 05:19:43 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1G5fXx-00070j-Kd for help-gnu-emacs@gnu.org; Wed, 26 Jul 2006 05:19:17 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1G5fXt-0006xC-NA for help-gnu-emacs@gnu.org; Wed, 26 Jul 2006 05:19:15 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1G5fXs-0006ww-J2 for help-gnu-emacs@gnu.org; Wed, 26 Jul 2006 05:19:12 -0400 Original-Received: from [212.227.126.177] (helo=moutng.kundenserver.de) by monty-python.gnu.org with esmtp (Exim 4.52) id 1G5fZN-0004RU-QL for help-gnu-emacs@gnu.org; Wed, 26 Jul 2006 05:20:46 -0400 Original-Received: from [84.167.0.163] (helo=duenenhof-wilhelm.de) by mrelayeu.kundenserver.de (node=mrelayeu2) with ESMTP (Nemesis), id 0MKwtQ-1G5fXp3vY0-0001fy; Wed, 26 Jul 2006 11:19:10 +0200 Original-Received: by duenenhof-wilhelm.de (Postfix, from userid 1000) id 44C684A904; Tue, 25 Jul 2006 22:18:22 +0200 (CEST) Original-To: Mathias Dahl In-Reply-To: (Mathias Dahl's message of "Tue, 27 Jun 2006 11:17:58 +0200") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) X-Provags-ID: kundenserver.de abuse@kundenserver.de login:d7ab225b98a136e1c2910381f940ecb9 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:36233 Archived-At: Mathias Dahl writes: > Leon 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