emacs-devel
[Top][All Lists]
Advanced

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

Re: Making while interruptable


From: Lennart Borgman
Subject: Re: Making while interruptable
Date: Tue, 7 Jul 2009 01:46:37 +0200

On Tue, Jul 7, 2009 at 1:26 AM, Miles Bader<address@hidden> wrote:
> Lennart Borgman <address@hidden> writes:
>>>> The idea is that the user with some let bound variable can control how
>>>> every call to `while' handles pending input. If pending input is
>>>> detected then `while' will throw to a catch symbol that is let bound
>>>> by the user.
>>>
>>> This is very, very, bad.  It _will_ screw up lots of code in hard to
>>> debug and confusing ways.
>>
>> Could you tell me exactly why you think so?  Are you aware of that I
>> placed the code for interruption at the same place as QUIT is placed
>> in the c code. So I assumed that it was ok to jump out there
>
> Most code is not prepared to deal with random non-local control
> transfers.  In such cases, a quit _also_ has the potential to screw
> something up, but a quit is much much rarer, is explicitly invoked by
> the user, and the user knows that after quitting, things may be in a
> funny state (it's an emergency action of sorts).  This limits the
> problem enough that it's something we can live with.
>
> The mere presence of _input_ on the other hand is _normal_, and your
> flag is not connected with any explicit user action.  So with your
> system, the number of unexpected non-local control transfers would go
> _way_ up, and would not be obviously connected with any user action.

Thanks, yes, that is of course correct. However this mechanism would
just be used only for code that you are running in a timer - in cases
where the code does not explicitly handle pending input. Of course,
changing that code is better, but you can not always do that.




reply via email to

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