1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2025-01-18 18:05:07 +00:00

Make previous Fkill_emacs change safer

* src/emacs.c (Fkill_emacs): Don't run `kill-emacs-hook' if it's nil.
This commit is contained in:
Lars Ingebrigtsen 2020-12-07 17:26:49 +01:00
parent 1537a8c863
commit 8b1693f689

View File

@ -2365,10 +2365,13 @@ all of which are called before Emacs is actually killed. */
/* Fsignal calls emacs_abort () if it sees that waiting_for_input is
set. */
waiting_for_input = 0;
if (noninteractive)
safe_run_hooks (Qkill_emacs_hook);
else
call1 (Qrun_hook_query_error_with_timeout, Qkill_emacs_hook);
if (!NILP (find_symbol_value (Qkill_emacs_hook)))
{
if (noninteractive)
safe_run_hooks (Qkill_emacs_hook);
else
call1 (Qrun_hook_query_error_with_timeout, Qkill_emacs_hook);
}
#ifdef HAVE_X_WINDOWS
/* Transfer any clipboards we own to the clipboard manager. */