Subject: Re: bug#15042: 24.3.50; while-no-input and input-pending-p

From: Stefan Monnier <[email-masked]>
Date: Wed, 07 Aug 2013 14:02:08 -0400

> 1.  `input-pending-p' can (and does) return t in cases were no input is
> pending (see the doc).  In such cases, `while-no-input' just returns t,
> although no input was given.  This contradicts the doc, is not useful
> and the behavior is unforeseeable.

Those cases where it immediately returns t should hopefully be very
similar to those cases where it stops in the middle even tho the event
that interrupted it is "ignorable".

> 2.  Even if `input-pending-p' would not give false alarm sometimes - why
> needs `while-no-input' to use it?

while-no-input is for code which should runs "transparently" without
preventing the user from running his commands.  So if the user has
already typed the next key before we even get to while-no-input, we
definitely should not enter the while-no-input, since while-no-input
is implemented such that it is only interrupted by *new* input.

> With the current implementation, I have to `discard-input' if I don't
> want this.

Can you give an example where you'd want to do that?

I experienced that
 
 (while-no-input code ...)

is sometimes semantically equivalent to

 t

without any input.

        Stefan