Subject: Re: bug#4128:

From: Jason Rumney <[email-masked]>
Date: Thu, 13 Aug 2009 00:01:22 +0800

David Reitter wrote:
>> However, binding anything to a power-off command within Emacs sounds
>> like a bad idea.
>
> In the contrary, not reacting to the ns-power-off message would be a 
> bad idea because it would stall and then cancel shutdown (and probably 
> log out as well) on OS X.  The app needs to react correctly to that, 
> and that is to quit while asking the user whether to save unsaved 
> buffers.

The impression I got from the bug report was that a command 
`ns-power-off' was being bound to a key in Emacs. But it sounds 
dangerous to make such an event a lisp level event and allow arbitrary 
user code to delay or prevent shutdown of the system. On Windows, the 
equivalent event auto-saves all buffers and exits, in a way that is not 
held up by an infinite lisp loop in user code.