From 8acdeb7104ad8d90f93c7dca6ee0d32149b32fc1 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Sun, 7 Apr 2013 22:08:45 -0400 Subject: [PATCH] * lisp/emacs-lisp/timer.el (timer-event-handler): Don't retrigger a canceled timer. Fixes: debbugs:14156 --- lisp/ChangeLog | 5 +++++ lisp/emacs-lisp/timer.el | 8 ++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index a2be1055f46..f5cf9d078e7 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2013-04-08 Stefan Monnier + + * emacs-lisp/timer.el (timer-event-handler): Don't retrigger a canceled + timer (bug#14156). + 2013-04-07 Nic Ferrier * emacs-lisp/ert.el (should, should-not, should-error): Add edebug diff --git a/lisp/emacs-lisp/timer.el b/lisp/emacs-lisp/timer.el index 8b019d0a785..8b1dca8cb78 100644 --- a/lisp/emacs-lisp/timer.el +++ b/lisp/emacs-lisp/timer.el @@ -314,8 +314,12 @@ This function is called, by name, directly by the C code." (save-current-buffer (apply (timer--function timer) (timer--args timer))) (error (message "Error in timer: %S" err))) - (if retrigger - (setf (timer--triggered timer) nil))) + (when (and retrigger + ;; If the timer's been canceled, don't "retrigger" it + ;; since it might still be in the copy of timer-list kept + ;; by keyboard.c:timer_check (bug#14156). + (memq timer timer-list)) + (setf (timer--triggered timer) nil))) (error "Bogus timer event")))) ;; This function is incompatible with the one in levents.el. -- 2.39.2