summaryrefslogtreecommitdiff
path: root/doc/lispref/os.texi
diff options
context:
space:
mode:
authorLars Ingebrigtsen <larsi@gnus.org>2022-04-17 13:37:51 +0200
committerLars Ingebrigtsen <larsi@gnus.org>2022-04-17 13:37:51 +0200
commit5be9a9cacfaae1959c4b95c45c146044a181ad20 (patch)
tree23e138d4719a46cf36538c89ca7cc694a387bc6a /doc/lispref/os.texi
parent0829c6836eff14dda0cf8b3047376967f7b000f4 (diff)
downloademacs-5be9a9cacfaae1959c4b95c45c146044a181ad20.tar.gz
Add a new command `restart-emacs'
* doc/lispref/os.texi (Killing Emacs): Document it. * lisp/files.el (save-buffers-kill-emacs): Add new RESTART parameter. (restart-emacs): New function. * src/emacs.c (terminate_due_to_signal, Fkill_emacs): Take an optional RESTART parameter. * test/lisp/files-tests.el (files-tests-save-buffers-kill-emacs--confirm-kill-processes): * src/xterm.c (x_connection_closed): * src/xsmfns.c (Fhandle_save_session): * src/keyboard.c (Fcommand_error_default_function, command_loop) (command_loop_1, read_menu_command, read_event_from_main_queue) (read_key_sequence, quit_throw_to_read_char): * src/eval.c (process_quit_flag): Adjust Fkill_emacs callers.
Diffstat (limited to 'doc/lispref/os.texi')
-rw-r--r--doc/lispref/os.texi13
1 files changed, 12 insertions, 1 deletions
diff --git a/doc/lispref/os.texi b/doc/lispref/os.texi
index 8366689640f..eea0ab8f6bc 100644
--- a/doc/lispref/os.texi
+++ b/doc/lispref/os.texi
@@ -699,7 +699,7 @@ If you started Emacs from a terminal, the parent process normally
resumes control. The low-level primitive for killing Emacs is
@code{kill-emacs}.
-@deffn Command kill-emacs &optional exit-data
+@deffn Command kill-emacs &optional exit-data restart
This command calls the hook @code{kill-emacs-hook}, then exits the
Emacs process and kills it.
@@ -714,6 +714,10 @@ input) can read them.
If @var{exit-data} is neither an integer nor a string, or is omitted,
that means to use the (system-specific) exit status which indicates
successful program termination.
+
+If @var{restart} is non-@code{nil}, instead of just exiting at the
+end, start a new Emacs process, using the same command line arguments
+as the currently running Emacs process.
@end deffn
@cindex SIGTERM
@@ -756,6 +760,13 @@ the remaining functions in this hook. Calling @code{kill-emacs}
directly does not run this hook.
@end defopt
+@deffn Command restart-emacs
+This command does the same as @code{save-buffers-kill-emacs}, but
+instead of just killing the current Emacs process at the end, it'll
+restart a new Emacs process, using the same command line arguments as
+the currently running Emacs process.
+@end deffn
+
@node Suspending Emacs
@subsection Suspending Emacs
@cindex suspending Emacs