From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Newsgroups: gmane.emacs.devel Subject: Problem with `while-no-input' Date: Wed, 8 Mar 2006 12:34:57 +0100 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 1141817934 23762 80.91.229.2 (8 Mar 2006 11:38:54 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 8 Mar 2006 11:38:54 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Mar 08 12:38:50 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 1FGwz9-0000NX-P5 for ged-emacs-devel@m.gmane.org; Wed, 08 Mar 2006 12:37:44 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FGwz5-00037I-Oq for ged-emacs-devel@m.gmane.org; Wed, 08 Mar 2006 06:37:40 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1FGwxF-00035R-7c for emacs-devel@gnu.org; Wed, 08 Mar 2006 06:35:48 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1FGwwf-000333-EA for emacs-devel@gnu.org; Wed, 08 Mar 2006 06:35:24 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FGwwY-00032y-F4 for emacs-devel@gnu.org; Wed, 08 Mar 2006 06:35:02 -0500 Original-Received: from [192.76.162.229] (helo=world1.sdm.de) by monty-python.gnu.org with esmtp (Exim 4.52) id 1FGwzN-0004kl-Lm for emacs-devel@gnu.org; Wed, 08 Mar 2006 06:37:57 -0500 Original-Received: by world1.sdm.de (MTA) via esmtp for from mucns1.muc.sdm.de ([193.102.180.22]) id 1FGwwU-0008GC-SQ; Wed, 08 Mar 2006 12:34:58 +0100 Original-Received: by mucns1.muc.sdm.de (MTA) via esmtp for from localhost ([127.0.0.1] helo=sdmmail1.sdm.de) id 1FGwwU-0000o6-Qe; Wed, 08 Mar 2006 12:34:58 +0100 Original-Received: from mucmail1.sdm.de ([193.102.180.175]) by sdmmail1.sdm.de with Microsoft SMTPSVC(6.0.3790.1830); Wed, 8 Mar 2006 12:34:58 +0100 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/so9EzjbQALTlDQAAOZqbA= Original-To: X-OriginalArrivalTime: 08 Mar 2006 11:34:58.0169 (UTC) FILETIME=[54386690:01C642A4] 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:51358 Archived-At: Hello, A question to `while-no-input': I tried this short test-code: (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))) 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': while-no-input is a Lisp macro in `subr.el'. (while-no-input &rest body) 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. But only C-g interrupts this code but not pressing any key like 'a' = etc... Have i overlooked something or have i misunderstood the documentation of `while-no-input'? Have i misinterpreted the sentence "If input arrives, that ends the execution of body, and `while-no-input' returns t" or what I'm doing wrong? Thanks for your help! I tried this with Emacs 22.0.50.1 compiled on 29.1.2006 for Windows.... Ciao, Klaus