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: Sat, 11 Mar 2006 22:45:11 +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 1142117310 2676 80.91.229.2 (11 Mar 2006 22:48:30 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 11 Mar 2006 22:48:30 +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 23:48:05 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 1FICrY-000432-Hy for ged-emacs-devel@m.gmane.org; Sat, 11 Mar 2006 23:47:06 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FICrV-0006oX-VT for ged-emacs-devel@m.gmane.org; Sat, 11 Mar 2006 17:47:02 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1FICrH-0006lC-NE for emacs-devel@gnu.org; Sat, 11 Mar 2006 17:46:47 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1FICrF-0006iE-Tt for emacs-devel@gnu.org; Sat, 11 Mar 2006 17:46:47 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FICrF-0006i2-Ou for emacs-devel@gnu.org; Sat, 11 Mar 2006 17:46:45 -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 1FICuo-0007Ne-1S; Sat, 11 Mar 2006 17:50:26 -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 k2BMke5K029913; Sat, 11 Mar 2006 22:46:40 GMT Original-Received: from TONKOTSU-RAMEN (tonkotsu-ramen.jasonrumney.net [10.0.0.28]) by wanchan.jasonrumney.net (Postfix) with ESMTP id BF98F32; Sat, 11 Mar 2006 22:46:39 +0000 (GMT) Original-To: Eli Zaretskii In-Reply-To: (Eli Zaretskii's message of "Sat, 11 Mar 2006 19:41:32 +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:51494 Archived-At: Eli Zaretskii writes: > 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? Yes. If async input can be handled on other platforms, then it should be possible to handle input in w32_wnd_proc instead of passing it on to be handled by w32_read_socket. But there may be a simpler fix of setting a flag in post_character_message if noone has time to look at that immediately.