# HG changeset patch # User Richard M. Stallman # Date 765591077 0 # Node ID 3661fe3c03d7caefc10f96c36f0ad32c744599d7 # Parent 43a79400a664710ac39198d107d153d4aa4c63b5 (timer-kill-emacs-hook): New function. (kill-emacs-hook): Add the new hook. diff -r 43a79400a664 -r 3661fe3c03d7 lisp/=timer.el --- a/lisp/=timer.el Tue Apr 05 23:49:15 1994 +0000 +++ b/lisp/=timer.el Wed Apr 06 00:11:17 1994 +0000 @@ -40,6 +40,17 @@ ;; rescheduling or people who otherwise expect to use the process frequently "If non-nil, don't exit the timer process when no more events are pending.") +;; This should not be necessary, but on some systems, we get +;; unkillable processes without this. +;; It may be a kernel bug, but that's not certain. +(defun timer-kill-emacs-hook () + (if timer-process + (progn + (set-process-sentinel timer-process nil) + (set-process-filter timer-process nil) + (delete-process timer-process)))) +(add-hook 'kill-emacs-hook 'timer-kill-emacs-hook) + ;;;###autoload (defun run-at-time (time repeat function &rest args) "Run a function at a time, and optionally on a regular interval.