[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: read-event in batch mode

From: Stefan Monnier
Subject: Re: read-event in batch mode
Date: Fri, 31 Jan 2014 10:34:23 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

> The "keyboard buffer" is a misnomer: that's actually the Emacs event
> queue, where all kinds of events end up, and from which they are read
> and processed.  Why is it a good idea to have more than one event
> queue?

Because some events should be processed in a particular order and others
in a different order.  They correspond to different "threads" of
execution.  The "keyboard buffer" normally corresponds to events coming
from the user, so their relative ordering is very important and should
not be changed.

But D-Bus events or file-notification events may be triggered by
processing that's completely independent/asynchronous from the user's
actions, so they should be processed by Emacs without having to wait for
previous user-events to be processed.

The typical use case: user types a command which involves communication
over D-Bus, then hit key "b", then the first command starts, sends
some D-Bus message, waits for the answer: if the answer comes after key
"b", we're in a "deadlock" where "b" won't be processed before the
command is completed, but the command won't complete before the D-Bus
answer is received and processed.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]