aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1994-02-24 04:00:41 +0000
committerRichard M. Stallman1994-02-24 04:00:41 +0000
commit88902b356e9b11e65625517c0471895e9ace8937 (patch)
tree3330cad3beea752afcdbdad2925eeb3da524e74d
parentcedb118cc84fbf5e53097b7fcc20161909a2b26f (diff)
downloademacs-88902b356e9b11e65625517c0471895e9ace8937.tar.gz
emacs-88902b356e9b11e65625517c0471895e9ace8937.zip
(kill-emacs-query-functions): New variable.
(save-buffers-kill-emacs): Use it.
-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'."
2000 (concat (file-name-as-directory file) ".") 2000 (concat (file-name-as-directory file) ".")
2001 file))))))) 2001 file)))))))
2002 2002
2003(defvar kill-emacs-query-functions nil
2004 "Functions to call with no arguments to query about killing Emacs.")
2005
2003(defun save-buffers-kill-emacs (&optional arg) 2006(defun save-buffers-kill-emacs (&optional arg)
2004 "Offer to save each buffer, then kill this Emacs process. 2007 "Offer to save each buffer, then kill this Emacs process.
2005With prefix arg, silently save all file-visiting buffers, then kill." 2008With 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."
2023 (setq processes (cdr processes))) 2026 (setq processes (cdr processes)))
2024 (or (not active) 2027 (or (not active)
2025 (yes-or-no-p "Active processes exist; kill them and exit anyway? ")))) 2028 (yes-or-no-p "Active processes exist; kill them and exit anyway? "))))
2029 ;; Query the user for other things, perhaps.
2030 (let ((functions kill-emacs-query-functions)
2031 (yes t))
2032 (while (and functions yes)
2033 (setq yes (and yes (funcall (car functions))))
2034 (setq functions (cdr functions)))
2035 yes)
2026 (kill-emacs))) 2036 (kill-emacs)))
2027 2037
2028(define-key ctl-x-map "\C-f" 'find-file) 2038(define-key ctl-x-map "\C-f" 'find-file)