emacs-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[debbugs-tracker] bug#14479: closed ([PATCH] Infinite loop when error in


From: GNU bug Tracking System
Subject: [debbugs-tracker] bug#14479: closed ([PATCH] Infinite loop when error in auto-save-hook)
Date: Thu, 13 Jun 2013 05:14:02 +0000

Your message dated Thu, 13 Jun 2013 01:13:36 -0400
with message-id <address@hidden>
and subject line Re: bug#14479: [PATCH] Infinite loop when error in 
auto-save-hook
has caused the debbugs.gnu.org bug report #14479,
regarding [PATCH] Infinite loop when error in auto-save-hook
to be marked as done.

(If you believe you have received this mail in error, please contact
address@hidden)


-- 
14479: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=14479
GNU Bug Tracking System
Contact address@hidden with problems
--- Begin Message --- Subject: [PATCH] Infinite loop when error in auto-save-hook Date: Sun, 26 May 2013 18:21:32 -0700 (PDT)
Put in init.el:
(setq inhibit-startup-screen t)
(add-hook 'auto-save-hook (lambda () (error "Foo")))
(setq auto-save-interval 30)
(switch-to-buffer "*Messages*")

Start Emacs 24.3, then press any key 31 times. It prints "Foo" and begins 
benchmarking an autosave retry loop, on my system about 300 retries/second, 
because Fdo_auto_save fails when it tries to run auto-save-hook, so it never 
gets to record_auto_save which updates last_auto_save, which is what's supposed 
to prevent the retries via keyboard.c line 2608.

The patch below fixes it. Unlike the case for post-command-hook, removing the 
offending auto-save hook isn't vital, but I think it's the best thing to do. 
Anyway, continuing the autosave despite the error is vital, and safe_run_hooks 
is the easiest way to accomplish both.

--- emacs-24.3/src/fileio.c
+++ emacs-24.3/src/fileio.c
@@ -5445,7 +5445,7 @@
      point to non-strings reached from Vbuffer_alist.  */
 
   hook = intern ("auto-save-hook");
-  Frun_hooks (1, &hook);
+  safe_run_hooks (hook);
 
   if (STRINGP (Vauto_save_list_file_name))
     {




--- End Message ---
--- Begin Message --- Subject: Re: bug#14479: [PATCH] Infinite loop when error in auto-save-hook Date: Thu, 13 Jun 2013 01:13:36 -0400 User-agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/)
Version: 24.4

Thanks; applied.


--- End Message ---

reply via email to

[Prev in Thread] Current Thread [Next in Thread]