]> git.eshelyaron.com Git - emacs.git/commitdiff
(kill-emacs-query-functions): New variable.
authorRichard M. Stallman <rms@gnu.org>
Thu, 24 Feb 1994 04:00:41 +0000 (04:00 +0000)
committerRichard M. Stallman <rms@gnu.org>
Thu, 24 Feb 1994 04:00:41 +0000 (04:00 +0000)
(save-buffers-kill-emacs): Use it.

lisp/files.el

index 7efca8ac1881c21b5cc81242ff2f75248f57508b..aac5ebb1a64253b9cc18e8e07cf6c882fa0f5861 100644 (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)))
 \f
 (define-key ctl-x-map "\C-f" 'find-file)