unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "Lennart Borgman (gmail)" <lennart.borgman@gmail.com>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: Juanma Barranquero <lekktu@gmail.com>,
	Eli Zaretskii <eliz@gnu.org>,
	jasonr@gnu.org, emacs-devel@gnu.org
Subject: Re: Emacs does not listen on w32
Date: Mon, 14 Apr 2008 18:21:27 +0200	[thread overview]
Message-ID: <48038487.3060201@gmail.com> (raw)
In-Reply-To: <jwviqyko8ki.fsf-monnier+emacs@gnu.org>

Stefan Monnier wrote:
>>>> In any case, the first
>>>> thing to do is to figure out what *really* happened in the first place.
>>>> We don't even know why Emacs didn't respond.  Maybe it has nothing to do
>>>> with the processing of WM_CLOSE.
>>> I don't think the problem was related to WM_CLOSE. What you suggested
>>> is much more likely: a memory leak. Windows tends to be *extremely*
>>> unresponsive on low-memory situations.
> 
>> I think you and Stefan are right about the memory problem but that there are
>> two different problems. In response to Eli's message I tested a simple loop,
>> something like
> 
>>   (let (x y)
>>      (while (not x)
>> 	(setq y (current-time-string))
>>         (when (string= y "something")
>> 	  (setq x t))))
> 
>> Running this Emacs does not hang the pc, but it still does not answer when
>> clicking the [X]. (I could kill it with C-g here though.)
> 
> Yes, that's perfectly normal.  The current semantics of WM_CLOSE (for
> Emacs) is more or less the same as C-x C-c (or C-x 5 0): it waits for
> the current command to finish and then runs another command that deletes
> the frame.

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.

- 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.)

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

For Juanmas very relevant question how this should work I suggest 
something like this:

- 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.


BTW, related to this is WM_QUERYENDSESSION which I believe Emacs 
currently does not handle (or even look at).




  reply	other threads:[~2008-04-14 16:21 UTC|newest]

Thread overview: 49+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-12 15:46 Emacs does not listen on w32 Lennart Borgman (gmail)
2008-04-12 19:32 ` Stefan Monnier
2008-04-13 13:21 ` Jason Rumney
2008-04-13 14:04   ` Lennart Borgman (gmail)
2008-04-13 14:16     ` Juanma Barranquero
2008-04-13 15:19       ` Lennart Borgman (gmail)
2008-04-13 15:42         ` Juanma Barranquero
2008-04-13 15:56           ` Lennart Borgman (gmail)
2008-04-13 16:09             ` Juanma Barranquero
2008-04-13 16:15               ` Lennart Borgman (gmail)
2008-04-13 16:20         ` Eli Zaretskii
2008-04-13 16:37           ` Juanma Barranquero
2008-04-13 20:49           ` Lennart Borgman (gmail)
2008-04-13 21:00             ` Juanma Barranquero
2008-04-13 21:04               ` Lennart Borgman (gmail)
2008-04-13 21:09                 ` Juanma Barranquero
2008-04-13 21:15                   ` Lennart Borgman (gmail)
2008-04-13 21:17                     ` Juanma Barranquero
2008-04-13 21:27                       ` Lennart Borgman (gmail)
2008-04-13 21:21                     ` David Kastrup
2008-04-13 21:33                       ` Lennart Borgman (gmail)
2008-04-13 21:49                         ` Lennart Borgman (gmail)
2008-04-14  1:21               ` Stefan Monnier
2008-04-14  1:38                 ` Juanma Barranquero
2008-04-14  1:43                   ` Juanma Barranquero
2008-04-14  6:46                     ` Lennart Borgman (gmail)
2008-04-14  8:52                       ` Juanma Barranquero
2008-04-14  6:44                   ` Lennart Borgman (gmail)
2008-04-14 13:45                     ` Stefan Monnier
2008-04-14 16:21                       ` Lennart Borgman (gmail) [this message]
2008-04-14 18:02                         ` Stefan Monnier
2008-04-14 19:55                           ` Jason Rumney
2008-04-14 20:37                             ` Lennart Borgman (gmail)
2008-04-14 20:47                               ` Jason Rumney
2008-04-14 21:02                                 ` Lennart Borgman (gmail)
2008-04-14 20:39                             ` Stefan Monnier
2008-04-14 20:11                         ` Jason Rumney
2008-04-14 20:33                           ` Lennart Borgman (gmail)
2008-04-14 21:39                             ` Jason Rumney
2008-04-14 22:03                               ` Lennart Borgman (gmail)
2008-04-14 22:40                         ` Óscar Fuentes
2008-04-14 23:51                           ` Lennart Borgman (gmail)
2008-04-15  0:03                             ` Óscar Fuentes
2008-04-15  0:04                             ` Jason Rumney
2008-04-15 17:53                               ` Lennart Borgman (gmail)
2008-04-13 21:50             ` Eli Zaretskii
2008-04-13 22:10               ` Lennart Borgman (gmail)
  -- strict thread matches above, loose matches on Subject: below --
2008-04-14 10:03 grischka
2008-04-14 13:08 ` Lennart Borgman (gmail)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=48038487.3060201@gmail.com \
    --to=lennart.borgman@gmail.com \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=jasonr@gnu.org \
    --cc=lekktu@gmail.com \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).