diff options
| author | Lars Ingebrigtsen | 2020-12-07 15:40:23 +0100 |
|---|---|---|
| committer | Lars Ingebrigtsen | 2020-12-07 15:40:23 +0100 |
| commit | b218c8b6b587d4f0629cbe81bf2dba95d07844d0 (patch) | |
| tree | f93a704f6482012ebd67571c9d3d0a03d880b655 /src | |
| parent | 9cef8fc8cdb5e6e18c9cf617eed3808d67ca340e (diff) | |
| download | emacs-b218c8b6b587d4f0629cbe81bf2dba95d07844d0.tar.gz emacs-b218c8b6b587d4f0629cbe81bf2dba95d07844d0.zip | |
Allow shutting down Emacs even if there are errors in kill-emacs-hook
* lisp/subr.el (run-hook-query-error-with-timeout): New function
(bug#28542).
* src/emacs.c (Fkill_emacs): Use it to allow exiting Emacs even if
there are errors in kill-emacs-hook.
(syms_of_emacs): Define the symbol.
Diffstat (limited to 'src')
| -rw-r--r-- | src/emacs.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/emacs.c b/src/emacs.c index d1b010ec7fe..fe09c446c38 100644 --- a/src/emacs.c +++ b/src/emacs.c | |||
| @@ -2368,7 +2368,7 @@ all of which are called before Emacs is actually killed. */ | |||
| 2368 | if (noninteractive) | 2368 | if (noninteractive) |
| 2369 | safe_run_hooks (Qkill_emacs_hook); | 2369 | safe_run_hooks (Qkill_emacs_hook); |
| 2370 | else | 2370 | else |
| 2371 | run_hook (Qkill_emacs_hook); | 2371 | call1 (Qrun_hook_query_error_with_timeout, Qkill_emacs_hook); |
| 2372 | 2372 | ||
| 2373 | #ifdef HAVE_X_WINDOWS | 2373 | #ifdef HAVE_X_WINDOWS |
| 2374 | /* Transfer any clipboards we own to the clipboard manager. */ | 2374 | /* Transfer any clipboards we own to the clipboard manager. */ |
| @@ -2890,6 +2890,8 @@ syms_of_emacs (void) | |||
| 2890 | DEFSYM (Qrisky_local_variable, "risky-local-variable"); | 2890 | DEFSYM (Qrisky_local_variable, "risky-local-variable"); |
| 2891 | DEFSYM (Qkill_emacs, "kill-emacs"); | 2891 | DEFSYM (Qkill_emacs, "kill-emacs"); |
| 2892 | DEFSYM (Qkill_emacs_hook, "kill-emacs-hook"); | 2892 | DEFSYM (Qkill_emacs_hook, "kill-emacs-hook"); |
| 2893 | DEFSYM (Qrun_hook_query_error_with_timeout, | ||
| 2894 | "run-hook-query-error-with-timeout"); | ||
| 2893 | 2895 | ||
| 2894 | #ifdef HAVE_UNEXEC | 2896 | #ifdef HAVE_UNEXEC |
| 2895 | defsubr (&Sdump_emacs); | 2897 | defsubr (&Sdump_emacs); |