From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Leon Newsgroups: gmane.emacs.help Subject: Re: Alarm clock for emacs Date: Tue, 27 Jun 2006 13:57:48 +0100 Organization: Linux Private Site 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 1151413103 5221 80.91.229.2 (27 Jun 2006 12:58:23 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 27 Jun 2006 12:58:23 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Jun 27 14:58:22 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 1FvD92-0007RE-8V for geh-help-gnu-emacs@m.gmane.org; Tue, 27 Jun 2006 14:58:20 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FvD91-0005N2-Kn for geh-help-gnu-emacs@m.gmane.org; Tue, 27 Jun 2006 08:58:19 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1FvD8q-0005Mn-Cg for help-gnu-emacs@gnu.org; Tue, 27 Jun 2006 08:58:08 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1FvD8p-0005MJ-1H for help-gnu-emacs@gnu.org; Tue, 27 Jun 2006 08:58:08 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FvD8o-0005MG-O8 for help-gnu-emacs@gnu.org; Tue, 27 Jun 2006 08:58:06 -0400 Original-Received: from [80.91.229.2] (helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1FvDKu-0001VO-Ra for help-gnu-emacs@gnu.org; Tue, 27 Jun 2006 09:10:37 -0400 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1FvD8i-0007NJ-TD for help-gnu-emacs@gnu.org; Tue, 27 Jun 2006 14:58:00 +0200 Original-Received: from soup.linux.pwf.cam.ac.uk ([193.60.95.74]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 27 Jun 2006 14:58:00 +0200 Original-Received: from sdl.web by soup.linux.pwf.cam.ac.uk with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 27 Jun 2006 14:58:00 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-To: help-gnu-emacs@gnu.org Original-Lines: 40 Original-X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: soup.linux.pwf.cam.ac.uk Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAMAAABg3Am1AAAASFBMVEVTWVFLY0NPeEFbdVJR izxxdm9TozBYnUNvi2dUojptll1nnlWOkYyBoHd5t2OLu3upraafypC0zaTCxMHK4cLb3tns8Ov9 //zfyasXAAAAAWJLR0QAiAUdSAAAAAlwSFlzAAACxQAAAsUBidZ/7wAAAAd0SU1FB9UMCgMZHzAk MO0AAAAddEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIFRoZSBHSU1Q72QlbgAAAaBJREFUSMftlNmS rCAMhpE9yKIG4vu/6ST2crSrq6vm4sxVWyWI5Et+QkDtv3zUF/gC/w2gvq2t1gq1tq3TZ4A6G3rv 5b03tV2hM9Db0xA8HB0cn+t4B2z1YQyn/nDhoQ16ATpLgafjp6KDA/nd1o1OwHaxuwi6jXUspUqY G9BOCt4o4vEUS0uAdABUH479e0HcmlLK7BMeQH1R/qrIax1CKQ3A5sHA6j8K4jZoE+d5LsYIQAAf FWkrfUhpDiEiA4cgsFpreCcIgkn3SBDzsiuSUZiUyzmLLVwVsXtI0cra7aTy2FUX90plJBqrh0kF xietOeQUeMbydMzOTEq5hTdCidFklqNaNh9Unr1WecnyFG9VBv6HA5cFj/JQTZJ2r5XOADaYMu40 xqDhg0MAJe6IbtXEEbRNyRcJ0cE6bN7ke6VRBR6DwVOB8xpsTNEHMSIvALgHsK8MdIjLGdgrzIUX 6iTs5vLoxeHzQPH32NwVGEESrg8rQk4WLv/Oy8DBL15OHGFM2kiKhRBfJ3/09kyjJBHpF7cG7xl9 79Yv8NfAD+fzqBgicsDFAAAAAElFTkSuQmCC User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/21.3 (gnu/linux) Cancel-Lock: sha1:277xRx6sD+Gd8pJ1IyPfAgveSFQ= 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:35691 Archived-At: Mathias Dahl writes: > 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 Emacs hackers are cool. Thanks Mathias. This is a nice example for me to learn elisp. -- Leon