GNU bug report logs - #23483
24.5; cygwin emacs w32 doesn not ask to save files when windows shuts down

Previous Next

Package: emacs;

Reported by: "Strozzi, David J." <strozzi2 <at> llnl.gov>

Date: Sun, 8 May 2016 18:19:02 UTC

Severity: wishlist

Found in version 24.5

Done: Ken Brown <kbrown <at> cornell.edu>

Bug is archived. No further changes may be made.

Full log


Message #11 received at 23483 <at> debbugs.gnu.org (full text, mbox):

From: Ken Brown <kbrown <at> cornell.edu>
To: Eli Zaretskii <eliz <at> gnu.org>, "Strozzi, David J." <strozzi2 <at> llnl.gov>
Cc: 23483 <at> debbugs.gnu.org
Subject: Re: bug#23483: 24.5; cygwin emacs w32 doesn not ask to save files
 when windows shuts down
Date: Tue, 10 May 2016 11:16:44 -0400
On 5/8/2016 2:40 PM, Eli Zaretskii wrote:
>> From: "Strozzi, David J." <strozzi2 <at> llnl.gov>
>> Date: Sun, 8 May 2016 13:33:11 +0000
>>
>> I am running the Windows 32 native emacs build that is part of cygwin.
>> Running on Windows 7. When I shut down windows (from the Start Menu),
>> emacs does not ask to save edited files. That means I lose work unless
>> I remember to separately quit emancs manually before shutting down.
>> Not a big deal, but can it be fixed?
> 
> If someone submits patches that listen to system shutdown messages,
> and auto-save files when they arrive, this can be fixed.  Patches
> welcome.

I asked about this on the Cygwin list (https://www.cygwin.com/ml/cygwin/2016-05/msg00085.html).  Based on the response I got, I tried the following, which seems to work:

diff --git a/src/w32fns.c b/src/w32fns.c
index ede8f6b..705b978 100644
--- a/src/w32fns.c
+++ b/src/w32fns.c
@@ -4795,6 +4795,9 @@ w32_wnd_proc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
       my_post_msg (&wmsg, hwnd, msg, wParam, lParam);
       return 0;

+    case WM_ENDSESSION:
+      terminate_due_to_signal (SIGTERM, 0);
+
     case WM_WINDOWPOSCHANGING:
       /* Don't restrict the sizing of any kind of frames.  If the window
         manager doesn't, there's no reason to do it ourselves.  */


Ken





This bug report was last modified 9 years and 8 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.