1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2025-02-05 20:43:08 +00:00

(kill-emacs-query-functions): New variable.

(save-buffers-kill-emacs): Use it.
This commit is contained in:
Richard M. Stallman 1994-02-24 04:00:41 +00:00
parent cedb118cc8
commit 88902b356e

View File

@ -2000,6 +2000,9 @@ If WILDCARD, it also runs the shell specified by `shell-file-name'."
(concat (file-name-as-directory file) ".")
file)))))))
(defvar kill-emacs-query-functions nil
"Functions to call with no arguments to query about killing Emacs.")
(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."
@ -2023,6 +2026,13 @@ With prefix arg, silently save all file-visiting buffers, then kill."
(setq processes (cdr processes)))
(or (not active)
(yes-or-no-p "Active processes exist; kill them and exit anyway? "))))
;; Query the user for other things, perhaps.
(let ((functions kill-emacs-query-functions)
(yes t))
(while (and functions yes)
(setq yes (and yes (funcall (car functions))))
(setq functions (cdr functions)))
yes)
(kill-emacs)))
(define-key ctl-x-map "\C-f" 'find-file)