unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Michael Heerdegen <michael_heerdegen@web.de>
Cc: 15042@debbugs.gnu.org, Thierry Volpiatto <thierry.volpiatto@gmail.com>
Subject: bug#15042: 24.3.50; while-no-input and input-pending-p
Date: Wed, 07 Aug 2013 14:02:08 -0400	[thread overview]
Message-ID: <jwvtxj14c5l.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <87wqnx7bnl.fsf@web.de> (Michael Heerdegen's message of "Wed, 07 Aug 2013 17:39:42 +0200")

> 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





  reply	other threads:[~2013-08-07 18:02 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-07 15:39 bug#15042: 24.3.50; while-no-input and input-pending-p Michael Heerdegen
2013-08-07 18:02 ` Stefan Monnier [this message]
2013-08-07 20:48   ` Michael Heerdegen
2013-08-08  1:19     ` Stefan Monnier
2021-08-21 13:50     ` Lars Ingebrigtsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwvtxj14c5l.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=15042@debbugs.gnu.org \
    --cc=michael_heerdegen@web.de \
    --cc=thierry.volpiatto@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).