Subject: Re: bug#78737: sit-for behavior changes when byte-compiled

From: Daniel Colascione <[email-masked]>
Date: Fri, 13 Jun 2025 14:51:08 -0400

On June 13, 2025 2:00:31 PM EDT, Stefan Monnier <[email-masked]> wrote:
>>>> What I asked, and still didn't get an answer to, is at what point does
>>>> a program that calls read-event becomes interruptible by a single C-g,
>>>> after the changes on the branch?
>>>It's interrupted if the `C-g` occurs while running the code rather than
>>>while sitting inside `read-event`.  For the tight `while t` loop, it's
>>>virtually never.
>> For clarity's sake, Stefan is describing what's in the branch right now and
>> I'm describing what will be on the branch before it's ready for merging.
>
>I thought the difference was only in terms of "emergency quit", which
>I think is not what Eli referred to when he meant "interruptible".

To be clear, when I say that a Lisp form is interruptible, I mean that it is *possible* to break out of it using enough C-g presses.  For example, this code, which is not interruptible at all in current master,

(while t (read-key))

becomes interruptible, the way I'm defining it, when you press C-g >= N times.

This code is interruptible on both master and in my proposal:

(while t (read-event))

However, on master, you need only one C-g to interrupt it. In the idea we're discussing, you need N (so 2 or 3 or whatever we set N to).

That might seem like a disadvantage of a UI change, but it isn't really because loops like the above don't occur in practice.

>[ I suspect these kinds of differences of intended meaning are
>a significant part of the misunderstandings in this thread.  ]

Yes. I think there's quite a bit of talking past each other.

>        Stefan