From: Ken Brown <kbrown@cornell.edu>
To: Eli Zaretskii <eliz@gnu.org>, "Strozzi, David J." <strozzi2@llnl.gov>
Cc: 23483@debbugs.gnu.org
Subject: 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 [thread overview]
Message-ID: <d23d49e3-837e-6990-f95d-b7d4922fa915@cornell.edu> (raw)
In-Reply-To: <83a8k0e6l3.fsf@gnu.org>
On 5/8/2016 2:40 PM, Eli Zaretskii wrote:
>> From: "Strozzi, David J." <strozzi2@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
next prev parent reply other threads:[~2016-05-10 15:16 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-08 13:33 bug#23483: 24.5; cygwin emacs w32 doesn not ask to save files when windows shuts down Strozzi, David J.
2016-05-08 18:40 ` Eli Zaretskii
2016-05-10 15:16 ` Ken Brown [this message]
2016-05-10 16:32 ` Eli Zaretskii
2016-05-12 13:57 ` Ken Brown
2016-05-12 16:56 ` Eli Zaretskii
2016-05-12 19:58 ` Ken Brown
2016-05-13 16:22 ` Strozzi, David J.
2016-05-13 17:46 ` Eli Zaretskii
2016-05-13 18:05 ` Ken Brown
2016-05-13 20:02 ` Strozzi, David J.
2016-05-13 23:12 ` Ken Brown
2016-05-14 7:56 ` Eli Zaretskii
2016-05-14 7:22 ` Eli Zaretskii
2016-05-14 20:02 ` Strozzi, David J.
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=d23d49e3-837e-6990-f95d-b7d4922fa915@cornell.edu \
--to=kbrown@cornell.edu \
--cc=23483@debbugs.gnu.org \
--cc=eliz@gnu.org \
--cc=strozzi2@llnl.gov \
/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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.