[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Problem with `while-no-input'
From: |
Jason Rumney |
Subject: |
Re: Problem with `while-no-input' |
Date: |
Sun, 12 Mar 2006 00:00:35 +0000 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (windows-nt) |
Eli Zaretskii <address@hidden> writes:
>> After looking more closely, I now see that C-g is handled specially in
>> w32fns.c on windows in the function post_character_message. It may be
>> possible to do something in here to make while-not-input work.
>
> I thought about this as well. It should be easy to do that for simple
> keyboard keys, but what about the other input events?
I added the code from keyboard.c for handling Vthrow_on_input to
post_character_message and the mouse button and wheel events. I think
mouse movement should also throw if the mouse is being tracked, but
the code for handling mouse tracking is in w32_read_socket (which is
synchronous and already calls kbd_buffer_store_event_hold), so I have
left that for now.
> Running too much of what keyboard.c does from within
> post_character_message might prove tricky, since
> post_character_message runs in a thread that is different from where
> the Lisp code runs, right?
I think the change I made was safe, as it only touches staticpro'ed
variables. Since that code is called from signal handlers on other
platforms it has some of the same restrictions already, the only extra
thing we have to be careful of on Windows is that it might get part
way through before the time slice is up and the Lisp thread gets
another time slice before it completes (which may involve garbage
collection).