[Top][All Lists]

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

Re: y-or-n-p-with-timeout

From: Luc Teirlinck
Subject: Re: y-or-n-p-with-timeout
Date: Tue, 9 Nov 2004 17:16:12 -0600 (CST)

Richard Stallman wrote:

   Anyway, please tell me if you know of a good use for this function.
   If I don't hear of one, I will mark it obsolete.

feedmail.el uses `y-or-n-p-with-timeout' at a couple of places.  It
falls back on the regular `y-or-no-p' for Emacs versions for which
`y-or-n-p-with-timeout' is not defined.  If I understand correctly it
will _automatically_ fall back on the regular `y-or-no-p' behavior on
platforms and in situations where `y-or-n-p-with-timeout' is broken.
It would seem that this is exactly the desired behavior in such

y-or-n-p-with-timeout does not exactly do a lot:

(defun y-or-n-p-with-timeout (prompt seconds default-value)
  "Like (y-or-n-p PROMPT), with a timeout.
If the user does not answer after SECONDS seconds, return DEFAULT-VALUE."
  (with-timeout (seconds default-value)
    (y-or-n-p prompt)))

If `y-or-n-p-with-timeout' is broken on some platforms in certain
situations does this not automatically imply that `with-timeout' is
broken on these same platforms in those same situations?



reply via email to

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