From 355c8b5810cd66c2c41e8479d301af76a3ff9bdb Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Thu, 28 Apr 2016 15:34:51 +0200 Subject: [PATCH] Make kill-emacs-query-functions into defcustom * lisp/files.el (save-buffers-kill-terminal): Mention `save-buffers-kill-emacs' (bug#10794). (kill-emacs-query-functions): Made into a defcustom. --- lisp/files.el | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lisp/files.el b/lisp/files.el index d5b34af86ba..2857f6dfcac 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -6663,11 +6663,14 @@ message to that effect instead of signaling an error." ;; Simulate the message printed by `ls'. (insert (format "%s: No such file or directory\n" file)))) -(defvar kill-emacs-query-functions nil +(defcustom kill-emacs-query-functions nil "Functions to call with no arguments to query about killing Emacs. If any of these functions returns nil, killing Emacs is canceled. `save-buffers-kill-emacs' calls these functions, but `kill-emacs', -the low level primitive, does not. See also `kill-emacs-hook'.") +the low level primitive, does not. See also `kill-emacs-hook'." + :type 'hook + :version "25.2" + :group 'convenience) (defcustom confirm-kill-emacs nil "How to ask for confirmation when leaving Emacs. @@ -6726,7 +6729,8 @@ if any returns nil. If `confirm-kill-emacs' is non-nil, calls it." (defun save-buffers-kill-terminal (&optional arg) "Offer to save each buffer, then kill the current connection. -If the current frame has no client, kill Emacs itself. +If the current frame has no client, kill Emacs itself using +`save-buffers-kill-emacs'. With prefix ARG, silently save all file-visiting buffers, then kill. -- 2.39.2