summaryrefslogtreecommitdiff
path: root/lisp/files.el
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1994-02-24 04:00:41 +0000
committerRichard M. Stallman <rms@gnu.org>1994-02-24 04:00:41 +0000
commit88902b356e9b11e65625517c0471895e9ace8937 (patch)
tree3330cad3beea752afcdbdad2925eeb3da524e74d /lisp/files.el
parentcedb118cc84fbf5e53097b7fcc20161909a2b26f (diff)
downloademacs-88902b356e9b11e65625517c0471895e9ace8937.tar.gz
(kill-emacs-query-functions): New variable.
(save-buffers-kill-emacs): Use it.
Diffstat (limited to 'lisp/files.el')
-rw-r--r--lisp/files.el10
1 files changed, 10 insertions, 0 deletions
diff --git a/lisp/files.el b/lisp/files.el
index 7efca8ac188..aac5ebb1a64 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -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)