all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: lawrence mitchell <wence@gmx.li>
Subject: tea (was: multithreading in Elisp?)
Date: Sat, 07 Jun 2003 11:53:14 +0100	[thread overview]
Message-ID: <?fnord?87of1a40rp.fsf@ID-97657.usr.dfncis.de> (raw)
In-Reply-To: 02a2ev8k6p7k0cr6n66rlt7bpmr8lvt6mv@4ax.com

Michael M Mason wrote:

[...]

> Being a Brit, I couldn't help noticing the rather serious bug in the
> above code snippet.  I hope you won't mind me offering an improved
> version:-

This one looks more reasonable,  I notice you slow down in the
afternoon though.  Is this a bug?

> (defun tea-time ()
>   (message "It's time for tea!"))
> (run-at-time "9:30am" nil 'tea-time)
> (run-at-time "10:00am" nil 'tea-time)
> (run-at-time "11:00am" nil 'tea-time)
> (run-at-time "11:30am" nil 'tea-time)
> (run-at-time "12:00am" nil 'tea-time)
> (run-at-time "1:00pm" nil 'tea-time)
> (run-at-time "2:00pm" nil 'tea-time)
> (run-at-time "3:00pm" nil 'tea-time)
> (run-at-time "3:30pm" nil 'tea-time)
> (run-at-time "4:00pm" nil 'tea-time)
> (run-at-time "5:00pm" nil 'tea-time)

This of course, may be simplified to
(run-at-time "9:30am" (* 30 60) 'tea-time)

You missed one:
(defun close-of-play (&optional reason)
  (call-stumps)
  (run-hooks 'close-of-play-hooks)
  (and reason (message "%s stopped play." reason)))

(if rain-stopped-play
    (close-of-play "Rain")
    (run-at-time "6:00pm" nil 'close-of-play))

HTH
-- 
lawrence mitchell <wence@gmx.li>

      reply	other threads:[~2003-06-07 10:53 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-06-01 18:46 multithreading in Elisp? Florian von Savigny
2003-06-02  8:19 ` Kai Großjohann
2003-06-03 13:14   ` Florian von Savigny
2003-06-03 13:19     ` David Kastrup
2003-06-06 12:10     ` Kai Großjohann
2003-06-06 23:52       ` Michael M Mason
2003-06-07 10:53         ` lawrence mitchell [this message]

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

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

  git send-email \
    --in-reply-to='?fnord?87of1a40rp.fsf@ID-97657.usr.dfncis.de' \
    --to=wence@gmx.li \
    /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.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.