From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Problem with `while-no-input' Date: Sat, 11 Mar 2006 19:41:32 +0200 Message-ID: References: Reply-To: Eli Zaretskii NNTP-Posting-Host: main.gmane.org X-Trace: sea.gmane.org 1142098937 7570 80.91.229.2 (11 Mar 2006 17:42:17 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 11 Mar 2006 17:42:17 +0000 (UTC) Cc: klaus.berndl@sdm.de, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Mar 11 18:42:15 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 1FI86O-00043b-2v for ged-emacs-devel@m.gmane.org; Sat, 11 Mar 2006 18:42:08 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FI86K-0000je-0Z for ged-emacs-devel@m.gmane.org; Sat, 11 Mar 2006 12:42:00 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1FI864-0000jE-2j for emacs-devel@gnu.org; Sat, 11 Mar 2006 12:41:44 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1FI861-0000hQ-IO for emacs-devel@gnu.org; Sat, 11 Mar 2006 12:41:43 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FI860-0000gv-SQ for emacs-devel@gnu.org; Sat, 11 Mar 2006 12:41:40 -0500 Original-Received: from [192.114.186.17] (helo=gandalf.inter.net.il) by monty-python.gnu.org with esmtp (Exim 4.52) id 1FI89W-0006XU-1q; Sat, 11 Mar 2006 12:45:18 -0500 Original-Received: from nitzan.inter.net.il (nitzan.inter.net.il [192.114.186.20]) by gandalf.inter.net.il (MOS 3.7.1-GA) with ESMTP id ICV07746; Sat, 11 Mar 2006 19:41:32 +0200 (IST) Original-Received: from HOME-C4E4A596F7 (IGLD-83-130-214-30.inter.net.il [83.130.214.30]) by nitzan.inter.net.il (MOS 3.7.3-GA) with ESMTP id CWG99766 (AUTH halo1); Sat, 11 Mar 2006 19:41:31 +0200 (IST) Original-To: Jason Rumney In-reply-to: (message from Jason Rumney on Sat, 11 Mar 2006 12:35:49 +0000) 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:51475 Archived-At: > From: Jason Rumney > Date: Sat, 11 Mar 2006 12:35:49 +0000 > Cc: emacs-devel@gnu.org, storm@cua.dk, klaus.berndl@sdm.de > > Richard Stallman writes: > > > Hmm, would it not better, to enable while-not-input also working with Windows? ;-) > > > > Yes, it would be better, but that may be very difficult. (I don't > > know.) We should document it if we can't fix it. > > I think the relevant code is in keyboard.c in the POLL_FOR_INPUT > conditional blocks. Currently this code handles detection of C-g > according to the comments, I do not know why it manages to do that > without also handling general detection of input. Jason, I'm looking at keyboard.c, and I don't understand what you are saying. Are you saying that POLL_FOR_INPUT code is used by Windows, and that it should handle this case, but currently only handles C-g? Or are you saying that the POLL_FOR_INPUT code detects both C-g and any other sorts of input, but somehow, only on Windows, non-C-g input goes undetected? Anyway, I see in w32fns.c:post_character_message that C-g is handled specially in this function. When we detect C-g, we signal the special interrupt_handle. However, I'm not quite sure who and how sees that this handle is signaled: sys_select isn't called while the body of while-no-input runs in this case, since that body is pure Lisp code, right? What am I missing? I also see in the debugger that, when the while-no-input form runs, w32_read_socket is not called. I think this explains why Emacs doesn't see the input, and doesn't interrupt the form's body: w32_read_socket is the only way to receive input on Windows, right? I think we can arrange for _any_ input to interrupt a while-no-input form, but this needs to be done from w32_wnd_proc (which is in another thread, right?). Do you think this is a good approach?