Mercurial > emacs
changeset 35218:b95fc978a72f
(confirm-kill-emacs): New user-option.
(save-buffers-kill-emacs): Ask for final confirmation before
killing Emacs.
author | Gerd Moellmann <gerd@gnu.org> |
---|---|
date | Wed, 10 Jan 2001 20:19:16 +0000 |
parents | 8d68eb1cde3b |
children | 8a8247d83687 |
files | lisp/files.el |
diffstat | 1 files changed, 10 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/lisp/files.el Wed Jan 10 20:18:38 2001 +0000 +++ b/lisp/files.el Wed Jan 10 20:19:16 2001 +0000 @@ -3644,6 +3644,14 @@ but `kill-emacs', the low level primitive, does not. See also `kill-emacs-hook'.") +(defcustom confirm-kill-emacs nil + "Ask for confirmation when leaving Emacs." + :type '(choice (const :tag "Ask with yes-or-no-p" yes-or-no-p) + (const :tag "Ask with y-or-n-p" y-or-n-p) + (const :tag "Don't confirm" nil)) + :group 'emacs + :version "21.1") + (defun save-buffers-kill-emacs (&optional arg) "Offer to save each buffer, then kill this Emacs process. With prefix arg, silently save all file-visiting buffers, then kill." @@ -3670,6 +3678,8 @@ (yes-or-no-p "Active processes exist; kill them and exit anyway? ")))) ;; Query the user for other things, perhaps. (run-hook-with-args-until-failure 'kill-emacs-query-functions) + (or (null confirm-kill-emacs) + (funcall confirm-kill-emacs "Really exit Emacs? ")) (kill-emacs))) ;; We use /: as a prefix to "quote" a file name