]> git.eshelyaron.com Git - emacs.git/commitdiff
(timer-kill-emacs-hook): New function.
authorRichard M. Stallman <rms@gnu.org>
Wed, 6 Apr 1994 00:11:17 +0000 (00:11 +0000)
committerRichard M. Stallman <rms@gnu.org>
Wed, 6 Apr 1994 00:11:17 +0000 (00:11 +0000)
(kill-emacs-hook): Add the new hook.

lisp/timer.el

index c069e13159eaa8e951886c77f3bdcf15db0745ea..7b1d570c548e1f0661404379d136c30de32fda51 100644 (file)
   ;; 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.