From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Jason Rumney Newsgroups: gmane.emacs.devel Subject: Re: Problem with `while-no-input' Date: Sun, 12 Mar 2006 00:00:35 +0000 Message-ID: References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1142121785 15272 80.91.229.2 (12 Mar 2006 00:03:05 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 12 Mar 2006 00:03:05 +0000 (UTC) Cc: emacs-devel@gnu.org, klaus.berndl@sdm.de Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Mar 12 01:03:02 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1FIE2v-0003Ny-0S for ged-emacs-devel@m.gmane.org; Sun, 12 Mar 2006 01:02:53 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FIE2u-00031D-Ln for ged-emacs-devel@m.gmane.org; Sat, 11 Mar 2006 19:02:52 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1FIE2H-0002nJ-43 for emacs-devel@gnu.org; Sat, 11 Mar 2006 19:02:13 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1FIE2F-0002mO-9K for emacs-devel@gnu.org; Sat, 11 Mar 2006 19:02:12 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FIE2F-0002mI-3e for emacs-devel@gnu.org; Sat, 11 Mar 2006 19:02:11 -0500 Original-Received: from [194.106.33.237] (helo=outmail.freedom2surf.net) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1FIE5n-0004G9-UH; Sat, 11 Mar 2006 19:05:52 -0500 Original-Received: from wanchan.jasonrumney.net (i-83-67-23-108.freedom2surf.net [83.67.23.108]) by outmail.freedom2surf.net (8.12.10/8.12.10) with ESMTP id k2C0255K009614; Sun, 12 Mar 2006 00:02:05 GMT Original-Received: from TONKOTSU-RAMEN (tonkotsu-ramen.jasonrumney.net [10.0.0.28]) by wanchan.jasonrumney.net (Postfix) with ESMTP id CB61432; Sun, 12 Mar 2006 00:02:04 +0000 (GMT) Original-To: Eli Zaretskii In-Reply-To: (Eli Zaretskii's message of "Sat, 11 Mar 2006 23:55:52 +0200") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (windows-nt) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:51508 Archived-At: Eli Zaretskii 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).