delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2016/05/12/16:27:59

X-Recipient: archive-cygwin AT delorie DOT com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:subject:to:references:from:message-id:date
:mime-version:in-reply-to:content-type
:content-transfer-encoding; q=dns; s=default; b=GALnVDXT6hZzJxyc
nf8/Epaesu711SmLJspGP8saDUAoH57Kwk8dDbJ0nXRE5GZaAJTVp1lk1OzYCAtT
k1ibZi/Bl/d/nJVF7hlb7vki7/fYSvrpYm70qW5CBel2KNgsaKQi9jjnNR7rmo75
mCaPXHW1Eoy7NMh+SWBB67wlu5Y=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:subject:to:references:from:message-id:date
:mime-version:in-reply-to:content-type
:content-transfer-encoding; s=default; bh=6QwNzKEbS+nSpAhxQO96Td
gYcgM=; b=vpi+kTN4eLRqppic6JkoymSdTxZyE06rsW5DOuJIxqcmMOSWmTUUav
Gzo7H3fTXAoMYQcioV76x3qbqNN9Nyn+s01U6cO17NRrZAJiAcyjgoHTO1NKn3f9
52UFkKDxo9n5kP6cFmz9fGGZR1DmM4RQX9JQyrkGWf//BGqz48j6w=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 spammy=arrange
X-HELO: limerock02.mail.cornell.edu
X-CornellRouted: This message has been Routed already.
Subject: Re: System shutdown messages
To: cygwin AT cygwin DOT com
References: <d7122da5-24b5-7209-74a9-83d7484872ce AT cornell DOT edu> <6031de0d-846a-f006-3c1a-d2af7cfb4590 AT dronecode DOT org DOT uk>
From: Ken Brown <kbrown AT cornell DOT edu>
Message-ID: <4f17e344-30d9-2859-325e-52ad9f9da2e2@cornell.edu>
Date: Thu, 12 May 2016 16:27:28 -0400
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.1.0
MIME-Version: 1.0
In-Reply-To: <6031de0d-846a-f006-3c1a-d2af7cfb4590@dronecode.org.uk>
X-PMX-Cornell-Gauge: Gauge=XXXXX
X-IsSubscribed: yes

On 5/9/2016 1:20 PM, Jon Turney wrote:
> On 09/05/2016 14:35, Ken Brown wrote:
>> A Cygwin emacs user has asked
>> (http://debbugs.gnu.org/cgi/bugreport.cgi?bug=23483) whether emacs can
>> auto-save files when he shuts down Windows from the Start Menu.  Is
>> there a way for a Cygwin process to listen for Windows system shutdown
>> messages?
>
> This seems entirely possible using the Win32 API.
>
> For emacs-w32, it's probably straightforward to handle WM_ENDSESSION in
> the message loop similarly to WM_CLOSE

This was indeed straightforward, so I went ahead and did it.  But I 
didn't try to do anything for emacs-X11 and emacs-nox because it's more 
complicated, and...

> But I'm not sure that's the best approach, or if wouldn't be more
> appropriate to arrange for SIGTERM to be sent to emacs (or whatever) by
> mintty or the X server when an WM_ENDSESSION is received...

... I hope Someone will do this.

Ken

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019