diff options
-rw-r--r-- | src/emacs.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/emacs.c b/src/emacs.c index f80047e89e7..7a918b8bdf6 100644 --- a/src/emacs.c +++ b/src/emacs.c @@ -2017,7 +2017,10 @@ 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; - run_hook (Qkill_emacs_hook); + if (noninteractive) + safe_run_hooks (Qkill_emacs_hook); + else + run_hook (Qkill_emacs_hook); #ifdef HAVE_X_WINDOWS /* Transfer any clipboards we own to the clipboard manager. */ |