aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorPhilipp Stephani2016-09-27 20:47:23 +0200
committerPhilipp Stephani2016-10-01 14:25:27 +0200
commitb661efd90d9bd57430761b0e87fcc8723ec24814 (patch)
tree2808dd470064a2ac929dd28804359886a650f9ad /test
parente1c5422e7bc2fbe0ecf5ab501b39d32fac61e747 (diff)
downloademacs-b661efd90d9bd57430761b0e87fcc8723ec24814.tar.gz
emacs-b661efd90d9bd57430761b0e87fcc8723ec24814.zip
Make querying to kill processes customizable
Introduce a new customization option, `confirm-kill-processes', that users can set to nil if they don't want Emacs to nag them about killing processes. * lisp/files.el (confirm-kill-processes): New customization option. (save-buffers-kill-emacs): Use customization option. * test/lisp/files-tests.el (files-test--save-buffers-kill-emacs--confirm-kill-processes): Add test for new customization option. * doc/emacs/entering.texi (Exiting): Document new user option. * doc/lispref/processes.texi (Query Before Exit): Document new user option. * etc/NEWS: Document new user option.
Diffstat (limited to 'test')
-rw-r--r--test/lisp/files-tests.el23
1 files changed, 23 insertions, 0 deletions
diff --git a/test/lisp/files-tests.el b/test/lisp/files-tests.el
index 479848abb23..80d5e5befbc 100644
--- a/test/lisp/files-tests.el
+++ b/test/lisp/files-tests.el
@@ -197,5 +197,28 @@ form.")
197 (setenv "FOO" foo-env) 197 (setenv "FOO" foo-env)
198 (setenv "BAR" bar-env)))) 198 (setenv "BAR" bar-env))))
199 199
200(ert-deftest files-test--save-buffers-kill-emacs--confirm-kill-processes ()
201 "Test that `save-buffers-kill-emacs' honors
202`confirm-kill-processes'."
203 (cl-letf* ((yes-or-no-p-prompts nil)
204 ((symbol-function #'yes-or-no-p)
205 (lambda (prompt)
206 (push prompt yes-or-no-p-prompts)
207 nil))
208 (kill-emacs-args nil)
209 ((symbol-function #'kill-emacs)
210 (lambda (&optional arg) (push arg kill-emacs-args)))
211 (process
212 (make-process
213 :name "sleep"
214 :command (list
215 (expand-file-name invocation-name invocation-directory)
216 "-batch" "-Q" "-eval" "(sleep-for 1000)")))
217 (confirm-kill-processes nil))
218 (save-buffers-kill-emacs)
219 (kill-process process)
220 (should-not yes-or-no-p-prompts)
221 (should (equal kill-emacs-args '(nil)))))
222
200(provide 'files-tests) 223(provide 'files-tests)
201;;; files-tests.el ends here 224;;; files-tests.el ends here