diff options
| author | Richard M. Stallman | 1994-04-06 00:11:17 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1994-04-06 00:11:17 +0000 |
| commit | e2ec008d003a2492bc375b059d653b955296e047 (patch) | |
| tree | 46bafa6a3689f2df6b3c68307782b9581bdb29d1 | |
| parent | e37f06d7db86fad8daff7b1cba12dda2199556a6 (diff) | |
| download | emacs-e2ec008d003a2492bc375b059d653b955296e047.tar.gz emacs-e2ec008d003a2492bc375b059d653b955296e047.zip | |
(timer-kill-emacs-hook): New function.
(kill-emacs-hook): Add the new hook.
| -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 @@ | |||
| 40 | ;; rescheduling or people who otherwise expect to use the process frequently | 40 | ;; rescheduling or people who otherwise expect to use the process frequently |
| 41 | "If non-nil, don't exit the timer process when no more events are pending.") | 41 | "If non-nil, don't exit the timer process when no more events are pending.") |
| 42 | 42 | ||
| 43 | ;; This should not be necessary, but on some systems, we get | ||
| 44 | ;; unkillable processes without this. | ||
| 45 | ;; It may be a kernel bug, but that's not certain. | ||
| 46 | (defun timer-kill-emacs-hook () | ||
| 47 | (if timer-process | ||
| 48 | (progn | ||
| 49 | (set-process-sentinel timer-process nil) | ||
| 50 | (set-process-filter timer-process nil) | ||
| 51 | (delete-process timer-process)))) | ||
| 52 | (add-hook 'kill-emacs-hook 'timer-kill-emacs-hook) | ||
| 53 | |||
| 43 | ;;;###autoload | 54 | ;;;###autoload |
| 44 | (defun run-at-time (time repeat function &rest args) | 55 | (defun run-at-time (time repeat function &rest args) |
| 45 | "Run a function at a time, and optionally on a regular interval. | 56 | "Run a function at a time, and optionally on a regular interval. |