unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: David Kastrup <dak@gnu.org>
Cc: emacs-devel@gnu.org
Subject: Re: Broken sit-for
Date: Sun, 10 Sep 2006 02:28:17 +0200	[thread overview]
Message-ID: <85irjwbm5a.fsf@lola.goethe.zz> (raw)
In-Reply-To: <m3venwlk3h.fsf@kfs-l.imdomain.dk> (Kim F. Storm's message of "Sun\, 10 Sep 2006 01\:02\:26 +0200")

storm@cua.dk (Kim F. Storm) writes:

> storm@cua.dk (Kim F. Storm) writes:
>
>> I agree that (sit-for 0) should return nil if input is pending on entry.
>
> Are there any objections to installing the version of sit-for below:

[...]

> Value is t if waited the full time with no input arriving, and nil otherwise.

>     (sleep-for seconds)
>     t)
>    ((input-pending-p)
>     nil)
>    ((<= seconds 0)
>     (or nodisp (redisplay)))

The doc string for "redisplay" does not specify a return value, so
maybe you should write

     ((<= seconds 0)
      (unless nodisp (redisplay) t))

instead.

>    (t
>     (or nodisp (redisplay))
>     (let ((read (read-event nil nil seconds)))
>       (or (null read)
> 	  (progn (push read unread-command-events) nil))))))

This does not interfere with the myriad of other
unread-command-events like variables we have?  They are sure to be
unused at this point of time?

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum

  reply	other threads:[~2006-09-10  0:28 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-09-06 17:05 Minor fix for life.el Michaël Cadilhac
2006-09-06 18:03 ` David Kastrup
2006-09-06 18:14   ` Michaël Cadilhac
2006-09-06 18:34     ` David Kastrup
2006-09-07 14:27       ` Broken sit-for [was: Re: Minor fix for life.el.] Kim F. Storm
2006-09-08  9:16         ` Broken sit-for Michaël Cadilhac
2006-09-09 23:02         ` Broken sit-for [was: Re: Minor fix for life.el.] Kim F. Storm
2006-09-10  0:28           ` David Kastrup [this message]
2006-09-10  9:18             ` Broken sit-for Michaël Cadilhac
2006-09-10 21:26               ` Kim F. Storm
2006-09-11 14:22                 ` Michaël Cadilhac
2006-09-10 21:06             ` Kim F. Storm

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=85irjwbm5a.fsf@lola.goethe.zz \
    --to=dak@gnu.org \
    --cc=emacs-devel@gnu.org \
    /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).