help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: confirm to exist when click "X" on the window decoration


From: Drew Adams
Subject: RE: confirm to exist when click "X" on the window decoration
Date: Mon, 2 Nov 2009 09:18:28 -0800

> Sometimes I click the "X" on the emacs window decoration by mistake,
> emacs will exist without any prompt/waring when there are no file
> changes in all opening buffers. I want to know if there are anyway to
> make emacs ask to confirm to exist on this situation? Generally I used
> to exist emacs by "C-x C-c". If I click the "X", this should always be
> a mistake.

I use this:

(add-hook 'kill-emacs-query-functions
          (lambda () (y-or-n-p "Do you really want to exit Emacs? "))
          'append)

That lets you click the X to delete a window, but if it's the last window, then
you are queried to confirm that you want to quit Emacs.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]