unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Nicer way to wake sit-for up?
@ 2006-06-08 10:31 spamfilteraccount
  2006-06-08 11:28 ` Johan Bockgård
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: spamfilteraccount @ 2006-06-08 10:31 UTC (permalink / raw)


I have a code where the command loop executes a command which is
waiting for arriving data with sit-for. When the data arrives from the
network a callback is invoked and I wake sit-for up with a dummy event
like this:

the callback:

  ...
  (setq unread-command-events (cons 'data-arrived
unread-command-events))
  ...


the command:

  ...
  (sit-for 5)
  (if (eq (car unread-command-events) 'data-arrived)
    (setq unread-command-events (cdr unread-command-events)))
  ...


It works, but feels a bit clumsy. Is it a simpler or nicer way to do
this?

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2006-06-09  8:40 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-06-08 10:31 Nicer way to wake sit-for up? spamfilteraccount
2006-06-08 11:28 ` Johan Bockgård
2006-06-08 12:53 ` Kim F. Storm
     [not found] ` <mailman.2764.1149780214.9609.help-gnu-emacs@gnu.org>
2006-06-08 15:34   ` David Kastrup
2006-06-09  8:40     ` spamfilteraccount

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).