all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / 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

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.