[Top][All Lists]

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

Re: `y-or-n-p' does not wait for input - assumes `n'

From: Kim F. Storm
Subject: Re: `y-or-n-p' does not wait for input - assumes `n'
Date: Thu, 27 Jan 2005 10:10:15 +0100
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/21.3.50 (gnu/linux)

Luc Teirlinck <address@hidden> writes:

> Kim Storm wrote:
>    Wouldn't it be better to fix this in C code so other potential uses of
>    y-or-n-p and yes-or-no-p during track-mouse do not need to be fixed
>    as well ?
> The problem is that `track-mouse' not only messes up y-or-n-p and
> yes-or-no-p.  It messes up all functions that are trying to read user
> input without wanting to track mouse motion.

True.  You cannot know whether a call to read-event expects to
handle mouse-movement, so in general you must assume it does when
invoked while track-mouse.  I.e. you need to be careful if you
use read-event in hooks or timer or async functions.

On the other hand, y-or-n-p never need to handle mouse-movement, so it
seems logical to turn track-mouse off in cases where we know it may
cause problems.  To me it seems much more likely that it is necessary
to call y-or-n-p rather than read-event in async code.

Kim F. Storm <address@hidden> http://www.cua.dk

reply via email to

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