unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* confirm to exist when click "X" on the window decoration
@ 2009-11-02  7:32 Ender
  2009-11-02 17:18 ` Drew Adams
  2009-11-02 22:16 ` Glenn Morris
  0 siblings, 2 replies; 3+ messages in thread
From: Ender @ 2009-11-02  7:32 UTC (permalink / raw)
  To: help-gnu-emacs

Hi folks,

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.

Thanks in advance.


^ permalink raw reply	[flat|nested] 3+ messages in thread

* RE: confirm to exist when click "X" on the window decoration
  2009-11-02  7:32 confirm to exist when click "X" on the window decoration Ender
@ 2009-11-02 17:18 ` Drew Adams
  2009-11-02 22:16 ` Glenn Morris
  1 sibling, 0 replies; 3+ messages in thread
From: Drew Adams @ 2009-11-02 17:18 UTC (permalink / raw)
  To: 'Ender', help-gnu-emacs

> 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.





^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: confirm to exist when click "X" on the window decoration
  2009-11-02  7:32 confirm to exist when click "X" on the window decoration Ender
  2009-11-02 17:18 ` Drew Adams
@ 2009-11-02 22:16 ` Glenn Morris
  1 sibling, 0 replies; 3+ messages in thread
From: Glenn Morris @ 2009-11-02 22:16 UTC (permalink / raw)
  To: help-gnu-emacs

Ender wrote:

> 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?

(setq confirm-kill-emacs 'yes-or-no-p)

If you want to be prompted by the "X" but not by, eg C-x C-c, you'll
have to do a bit more work.


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-11-02 22:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-02  7:32 confirm to exist when click "X" on the window decoration Ender
2009-11-02 17:18 ` Drew Adams
2009-11-02 22:16 ` Glenn Morris

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).