]> git.eshelyaron.com Git - emacs.git/commitdiff
Avoid kill-emacs-hook errors hanging batch mode
authorGlenn Morris <rgm@gnu.org>
Wed, 24 Jan 2018 01:55:09 +0000 (20:55 -0500)
committerGlenn Morris <rgm@gnu.org>
Wed, 24 Jan 2018 01:55:09 +0000 (20:55 -0500)
* src/emacs.c (Fkill_emacs): Prevent errors from kill-emacs-hook
hanging Emacs in batch mode.  (Bug#29955)

src/emacs.c

index 84cd3ac8c8ae05d344aa674e88ae66ec3b54368d..8ea61b71fb73d19af9ed7c72cb19911eaa457812 100644 (file)
@@ -2024,7 +2024,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.  */