diff options
author | Richard M. Stallman <rms@gnu.org> | 1994-04-06 00:11:17 +0000 |
---|---|---|
committer | Richard M. Stallman <rms@gnu.org> | 1994-04-06 00:11:17 +0000 |
commit | cd898a40cada5dd1ccf1e347258df31c89744b8d (patch) | |
tree | fa2642fb9c99f1b5b70563e1888ca7e777f29372 /lisp | |
parent | ad018058cb533af643acca61fd6f62888f9b6907 (diff) | |
download | emacs-cd898a40cada5dd1ccf1e347258df31c89744b8d.tar.gz |
(timer-kill-emacs-hook): New function.
(kill-emacs-hook): Add the new hook.
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/=timer.el | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lisp/=timer.el b/lisp/=timer.el index c069e13159e..7b1d570c548 100644 --- a/lisp/=timer.el +++ b/lisp/=timer.el @@ -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. |