[Top][All Lists]

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

Re: Emacs does not listen on w32

From: Stefan Monnier
Subject: Re: Emacs does not listen on w32
Date: Mon, 14 Apr 2008 14:02:59 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux)

> Yes, I know, but I think there are at least two problems here:

> - I do not believe this is the right semantics for WM_CLOSE.

That's what I gathered from your bug-report -;)

> - If you run the above code in a timer (like I did) it is worse. There is no
> way at all to stop it. (Except from Task Manager.)

This is completely independent from WM_CLOSE and is a much more general
problem: any code run from a timer (or other places that set
inhibit-quit, such as jit-lock) should guarantee that it only runs for
a short time (and/or check input-pending-p, or use with-local-quit.

The core of the problem here is that too many programmers don't know
about it, and that there's no (easy) way to automatically catch code
that doesn't follow those guidelines.

> For both these problems I think a change in the semantics for WM_CLOSE (and
> related messages) are the best cure.

For the second problem, you have to realize that it will bite you in
many more cases than just WM_CLOSE.

> - Give Emacs say 4 seconds to finish what it is doing. (The documentation
> for IsHungAppWindow says that an application should be considered hung if it
> does not respond in 5 seconds.) If it did not finish then ask the user
> whether to interrupt or not.

If you have such an infinite loop within a timer code, then Emacs *is*
hung, and it seems perfectly fine to let the OS's IsHungAppWindow deal
with it.


reply via email to

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