From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Newsgroups: gmane.emacs.devel Subject: RE: Problem with `while-no-input' Date: Tue, 25 Apr 2006 11:35:08 +0200 Message-ID: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-Trace: sea.gmane.org 1145957750 15459 80.91.229.2 (25 Apr 2006 09:35:50 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 25 Apr 2006 09:35:50 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Apr 25 11:35:43 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 1FYJxB-0008E5-FP for ged-emacs-devel@m.gmane.org; Tue, 25 Apr 2006 11:35:30 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FYJxA-0000JA-IB for ged-emacs-devel@m.gmane.org; Tue, 25 Apr 2006 05:35:28 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1FYJwy-0000Io-Tv for emacs-devel@gnu.org; Tue, 25 Apr 2006 05:35:16 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1FYJwx-0000IH-63 for emacs-devel@gnu.org; Tue, 25 Apr 2006 05:35:16 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FYJwx-0000IE-2S for emacs-devel@gnu.org; Tue, 25 Apr 2006 05:35:15 -0400 Original-Received: from [192.76.162.229] (helo=world1.sdm.de) by monty-python.gnu.org with esmtp (Exim 4.52) id 1FYJzN-0002sP-Ce for emacs-devel@gnu.org; Tue, 25 Apr 2006 05:37:45 -0400 Original-Received: by world1.sdm.de (MTA) via esmtp for from mucns1.muc.sdm.de ([193.102.180.22]) id 1FYJwr-0003gk-P6; Tue, 25 Apr 2006 11:35:09 +0200 Original-Received: by mucns1.muc.sdm.de (MTA) via esmtp for from localhost ([127.0.0.1] helo=sdmmail1.sdm.de) id 1FYJwr-0007z9-NA; Tue, 25 Apr 2006 11:35:09 +0200 Original-Received: from mucmail1.sdm.de ([193.102.180.175]) by sdmmail1.sdm.de with Microsoft SMTPSVC(6.0.3790.1830); Tue, 25 Apr 2006 11:35:09 +0200 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Problem with `while-no-input' Thread-Index: AcZCZ9nNXI0cq/fbRi6qg/so9EzjbQALTlDQAAOZqbAJadWx0A== Original-To: , X-OriginalArrivalTime: 25 Apr 2006 09:35:09.0076 (UTC) FILETIME=[8B03DD40:01C6684B] 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:53367 Archived-At: after running a current build of CVS-Emacs with Windows NT and testing the short test-snippet below with this current build i got new results: Now this code is also interrupted by any keypress (not only after C-g as in a previous build) - Fine! But pressing/releasing mouse-buttons does still not interrupt this code! First after a keypress it is interrupted and then first the queued mouse-click is performed before the pressed key is inserted in the = buffer (that key which has interrupted this code). Is this behavior intended? If yes, why? Would it not better also enabling mouse-interruption? But nevertheless many thanks for your efforts to make it interruptable = by key! Ciao, Klaus > I tried this short test-code: >=20 > (defun klaus-test-input () > (interactive) > (let ((result nil) > (i 0)) > (setq result (while-no-input > (while t > (setq i (1+ i))))) > (message "Klaus: %s" result))) >=20 > I expected this to being interrupted by any user-interaction (e.g. > keypress etc..) and setting result to t according to the docstring of > `while-no-input':=20 >=20 > while-no-input is a Lisp macro in `subr.el'. > (while-no-input &rest body) >=20 > Execute body only as long as there's no pending input. > If input arrives, that ends the execution of body, > and `while-no-input' returns t. Quitting makes it return nil. > If body finishes, `while-no-input' returns whatever value body > produced.=20 >=20 > But only C-g interrupts this code but not pressing any key like 'a' > etc...=20 >=20 > Have i overlooked something or have i misunderstood the documentation > of `while-no-input'? Have i misinterpreted the sentence "If input > arrives,=20 > that ends the execution of body, and `while-no-input' returns t" or > what=20 > I'm doing wrong? >=20 > Thanks for your help! >=20 > I tried this with Emacs 22.0.50.1 compiled on 29.1.2006 for > Windows....=20 >=20 > Ciao, > Klaus >=20 >=20 > _______________________________________________ > Emacs-devel mailing list > Emacs-devel@gnu.org > http://lists.gnu.org/mailman/listinfo/emacs-devel