[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Problem with `while-no-input'

From: klaus.berndl
Subject: RE: Problem with `while-no-input'
Date: Tue, 25 Apr 2006 11:35:08 +0200

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!


> 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 compiled on 29.1.2006 for
> Windows.... 
> Ciao,
> Klaus
> _______________________________________________
> Emacs-devel mailing list
> address@hidden
> http://lists.gnu.org/mailman/listinfo/emacs-devel

reply via email to

[Prev in Thread] Current Thread [Next in Thread]