annotate lisp/=timer.el @ 28764:a94b3ce0fa8c

*** empty log message ***
author Gerd Moellmann <gerd@gnu.org>
date Sat, 29 Apr 2000 19:35:00 +0000
parents c91cf5d2b95f
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
14402
64e80af54f06 Sun Jan 28 20:55:10 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu>
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
1 ;;; timers.el --- run a function with args at some time in future
657
fec3f9a1e3e5 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 584
diff changeset
2
14402
64e80af54f06 Sun Jan 28 20:55:10 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu>
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
3 ;; Copyright (C) 1996 Free Software Foundation, Inc.
840
113281b361ec *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 807
diff changeset
4
807
4f28bd14272c *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 657
diff changeset
5 ;; Maintainer: FSF
45
a55a3ac41924 Initial revision
root <root>
parents:
diff changeset
6
a55a3ac41924 Initial revision
root <root>
parents:
diff changeset
7 ;; This file is part of GNU Emacs.
a55a3ac41924 Initial revision
root <root>
parents:
diff changeset
8
a55a3ac41924 Initial revision
root <root>
parents:
diff changeset
9 ;; GNU Emacs is free software; you can redistribute it and/or modify
a55a3ac41924 Initial revision
root <root>
parents:
diff changeset
10 ;; it under the terms of the GNU General Public License as published by
807
4f28bd14272c *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 657
diff changeset
11 ;; the Free Software Foundation; either version 2, or (at your option)
45
a55a3ac41924 Initial revision
root <root>
parents:
diff changeset
12 ;; any later version.
a55a3ac41924 Initial revision
root <root>
parents:
diff changeset
13
a55a3ac41924 Initial revision
root <root>
parents:
diff changeset
14 ;; GNU Emacs is distributed in the hope that it will be useful,
a55a3ac41924 Initial revision
root <root>
parents:
diff changeset
15 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
a55a3ac41924 Initial revision
root <root>
parents:
diff changeset
16 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
a55a3ac41924 Initial revision
root <root>
parents:
diff changeset
17 ;; GNU General Public License for more details.
a55a3ac41924 Initial revision
root <root>
parents:
diff changeset
18
a55a3ac41924 Initial revision
root <root>
parents:
diff changeset
19 ;; You should have received a copy of the GNU General Public License
14169
83f275dcd93a Update FSF's address.
Erik Naggum <erik@naggum.no>
parents: 10041
diff changeset
20 ;; along with GNU Emacs; see the file COPYING. If not, write to the
83f275dcd93a Update FSF's address.
Erik Naggum <erik@naggum.no>
parents: 10041
diff changeset
21 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
83f275dcd93a Update FSF's address.
Erik Naggum <erik@naggum.no>
parents: 10041
diff changeset
22 ;; Boston, MA 02111-1307, USA.
45
a55a3ac41924 Initial revision
root <root>
parents:
diff changeset
23
2319
d98c49df2acd Added or corrected Commentary section
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 2086
diff changeset
24 ;;; Commentary:
d98c49df2acd Added or corrected Commentary section
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 2086
diff changeset
25
d98c49df2acd Added or corrected Commentary section
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 2086
diff changeset
26 ;; This package gives you the capability to run Emacs Lisp commands at
3591
507f64624555 Apply typo patches from Paul Eggert.
Jim Blandy <jimb@redhat.com>
parents: 3352
diff changeset
27 ;; specified times in the future, either as one-shots or periodically.
2319
d98c49df2acd Added or corrected Commentary section
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 2086
diff changeset
28 ;; The single entry point is `run-at-time'.
d98c49df2acd Added or corrected Commentary section
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 2086
diff changeset
29
807
4f28bd14272c *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 657
diff changeset
30 ;;; Code:
4f28bd14272c *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 657
diff changeset
31
14402
64e80af54f06 Sun Jan 28 20:55:10 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu>
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
32 ;; Layout of a timer vector:
64e80af54f06 Sun Jan 28 20:55:10 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu>
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
33 ;; [triggered-p trigger-high trigger-low delta-secs function args]
2447
6ff9eee5cdc9 * timer.el (timer-program): New defconst.
Jim Blandy <jimb@redhat.com>
parents: 2319
diff changeset
34
14402
64e80af54f06 Sun Jan 28 20:55:10 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu>
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
35 (defun timer-create ()
64e80af54f06 Sun Jan 28 20:55:10 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu>
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
36 "Create a timer object."
64e80af54f06 Sun Jan 28 20:55:10 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu>
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
37 (let ((timer (make-vector 7 nil)))
64e80af54f06 Sun Jan 28 20:55:10 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu>
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
38 (aset timer 0 (make-vector 1 'timer-event))
64e80af54f06 Sun Jan 28 20:55:10 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu>
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
39 timer))
64e80af54f06 Sun Jan 28 20:55:10 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu>
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
40
64e80af54f06 Sun Jan 28 20:55:10 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu>
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
41 (defun timerp (object)
64e80af54f06 Sun Jan 28 20:55:10 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu>
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
42 "Return t if OBJECT is a timer."
64e80af54f06 Sun Jan 28 20:55:10 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu>
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
43 (and (vectorp object) (= (length object) 7)))
45
a55a3ac41924 Initial revision
root <root>
parents:
diff changeset
44
14402
64e80af54f06 Sun Jan 28 20:55:10 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu>
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
45 (defun timer-set-time (timer time &optional delta)
64e80af54f06 Sun Jan 28 20:55:10 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu>
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
46 "Set the trigger time of TIMER to TIME.
64e80af54f06 Sun Jan 28 20:55:10 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu>
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
47 TIME must be in the internal format returned by, e.g., `current-time'
64e80af54f06 Sun Jan 28 20:55:10 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu>
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
48 If optional third argument DELTA is a non-zero integer make the timer
64e80af54f06 Sun Jan 28 20:55:10 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu>
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
49 fire repeatedly that menu seconds apart."
64e80af54f06 Sun Jan 28 20:55:10 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu>
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
50 (or (timerp timer)
64e80af54f06 Sun Jan 28 20:55:10 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu>
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
51 (error "Invalid timer"))
64e80af54f06 Sun Jan 28 20:55:10 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu>
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
52 (aset timer 1 (car time))
64e80af54f06 Sun Jan 28 20:55:10 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu>
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
53 (aset timer 2 (if (consp (cdr time)) (car (cdr time)) (cdr time)))
64e80af54f06 Sun Jan 28 20:55:10 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu>
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
54 (aset timer 3 (if (consp (cdr time)) (nth 2 time) 0))
64e80af54f06 Sun Jan 28 20:55:10 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu>
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
55 (aset timer 4 (and (integerp delta) (> delta 0) delta))
64e80af54f06 Sun Jan 28 20:55:10 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu>
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
56 timer)
9641
284c46319091 (timer-error, timer-abnormal-termination,
Richard M. Stallman <rms@gnu.org>
parents: 8044
diff changeset
57
284c46319091 (timer-error, timer-abnormal-termination,
Richard M. Stallman <rms@gnu.org>
parents: 8044
diff changeset
58
14402
64e80af54f06 Sun Jan 28 20:55:10 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu>
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
59 (defun timer-inc-time (timer secs &optional usecs)
64e80af54f06 Sun Jan 28 20:55:10 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu>
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
60 "Increment the time set in TIMER by SECS seconds and USECS microseconds.
64e80af54f06 Sun Jan 28 20:55:10 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu>
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
61 SECS may be a fraction."
64e80af54f06 Sun Jan 28 20:55:10 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu>
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
62 (or usecs (setq usecs 0))
64e80af54f06 Sun Jan 28 20:55:10 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu>
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
63 (if (floatp secs)
64e80af54f06 Sun Jan 28 20:55:10 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu>
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
64 (let* ((integer (floor secs))
64e80af54f06 Sun Jan 28 20:55:10 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu>
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
65 (fraction (floor (* 1000000 (- secs integer)))))
64e80af54f06 Sun Jan 28 20:55:10 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu>
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
66 (setq usecs fraction secs integer)))
64e80af54f06 Sun Jan 28 20:55:10 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu>
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
67 (let ((newusecs (+ (aref timer 3) usecs)))
64e80af54f06 Sun Jan 28 20:55:10 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu>
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
68 (aset timer 3 (mod newusecs 1000000))
64e80af54f06 Sun Jan 28 20:55:10 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu>
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
69 (setq secs (+ secs (/ newusecs 1000000))))
64e80af54f06 Sun Jan 28 20:55:10 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu>
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
70 (let ((newlow (+ (aref timer 2) secs))
64e80af54f06 Sun Jan 28 20:55:10 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu>
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
71 (newhigh (aref timer 1)))
64e80af54f06 Sun Jan 28 20:55:10 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu>
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
72 (setq newhigh (+ newhigh (/ newlow 65536))
64e80af54f06 Sun Jan 28 20:55:10 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu>
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
73 newlow (logand newlow 65535))
64e80af54f06 Sun Jan 28 20:55:10 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu>
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
74 (aset timer 1 newhigh)
64e80af54f06 Sun Jan 28 20:55:10 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu>
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
75 (aset timer 2 newlow)))
64e80af54f06 Sun Jan 28 20:55:10 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu>
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
76
64e80af54f06 Sun Jan 28 20:55:10 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu>
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
77 (defun timer-set-time-with-usecs (timer time usecs &optional delta)
64e80af54f06 Sun Jan 28 20:55:10 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu>
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
78 "Set the trigger time of TIMER to TIME.
64e80af54f06 Sun Jan 28 20:55:10 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu>
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
79 TIME must be in the internal format returned by, e.g., `current-time'
64e80af54f06 Sun Jan 28 20:55:10 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu>
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
80 If optional third argument DELTA is a non-zero integer make the timer
64e80af54f06 Sun Jan 28 20:55:10 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu>
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
81 fire repeatedly that menu seconds apart."
64e80af54f06 Sun Jan 28 20:55:10 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu>
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
82 (or (timerp timer)
64e80af54f06 Sun Jan 28 20:55:10 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu>
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
83 (error "Invalid timer"))
64e80af54f06 Sun Jan 28 20:55:10 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu>
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
84 (aset timer 1 (car time))
64e80af54f06 Sun Jan 28 20:55:10 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu>
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
85 (aset timer 2 (if (consp (cdr time)) (car (cdr time)) (cdr time)))
64e80af54f06 Sun Jan 28 20:55:10 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu>
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
86 (aset timer 3 usecs)
64e80af54f06 Sun Jan 28 20:55:10 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu>
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
87 (aset timer 4 (and (integerp delta) (> delta 0) delta))
64e80af54f06 Sun Jan 28 20:55:10 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu>
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
88 timer)
6693
3661fe3c03d7 (timer-kill-emacs-hook): New function.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
89
14402
64e80af54f06 Sun Jan 28 20:55:10 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu>
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
90 (defun timer-set-function (timer function &optional args)
64e80af54f06 Sun Jan 28 20:55:10 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu>
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
91 "Make TIMER call FUNCTION with optional ARGS when triggering."
64e80af54f06 Sun Jan 28 20:55:10 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu>
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
92 (or (timerp timer)
64e80af54f06 Sun Jan 28 20:55:10 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu>
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
93 (error "Invalid timer"))
64e80af54f06 Sun Jan 28 20:55:10 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu>
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
94 (aset timer 5 function)
64e80af54f06 Sun Jan 28 20:55:10 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu>
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
95 (aset timer 6 args)
64e80af54f06 Sun Jan 28 20:55:10 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu>
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
96 timer)
64e80af54f06 Sun Jan 28 20:55:10 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu>
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
97
64e80af54f06 Sun Jan 28 20:55:10 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu>
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
98 (defun timer-activate (timer)
64e80af54f06 Sun Jan 28 20:55:10 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu>
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
99 "Put TIMER on the list of active timers."
64e80af54f06 Sun Jan 28 20:55:10 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu>
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
100 (if (and (timerp timer)
64e80af54f06 Sun Jan 28 20:55:10 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu>
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
101 (integerp (aref timer 1))
64e80af54f06 Sun Jan 28 20:55:10 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu>
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
102 (integerp (aref timer 2))
64e80af54f06 Sun Jan 28 20:55:10 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu>
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
103 (integerp (aref timer 3))
64e80af54f06 Sun Jan 28 20:55:10 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu>
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
104 (aref timer 5))
64e80af54f06 Sun Jan 28 20:55:10 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu>
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
105 (let ((timers timer-list)
64e80af54f06 Sun Jan 28 20:55:10 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu>
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
106 last)
64e80af54f06 Sun Jan 28 20:55:10 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu>
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
107 ;; Skip all timers to trigger before the new one.
64e80af54f06 Sun Jan 28 20:55:10 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu>
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
108 (while (and timers
64e80af54f06 Sun Jan 28 20:55:10 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu>
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
109 (or (> (aref timer 1) (aref (car timers) 1))
64e80af54f06 Sun Jan 28 20:55:10 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu>
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
110 (and (= (aref timer 1) (aref (car timers) 1))
64e80af54f06 Sun Jan 28 20:55:10 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu>
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
111 (> (aref timer 2) (aref (car timers) 2)))
64e80af54f06 Sun Jan 28 20:55:10 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu>
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
112 (and (= (aref timer 1) (aref (car timers) 1))
64e80af54f06 Sun Jan 28 20:55:10 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu>
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
113 (= (aref timer 2) (aref (car timers) 2))
64e80af54f06 Sun Jan 28 20:55:10 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu>
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
114 (> (aref timer 3) (aref (car timers) 3)))))
64e80af54f06 Sun Jan 28 20:55:10 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu>
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
115 (setq last timers
64e80af54f06 Sun Jan 28 20:55:10 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu>
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
116 timers (cdr timers)))
64e80af54f06 Sun Jan 28 20:55:10 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu>
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
117 ;; Insert new timer after last which possibly means in front of queue.
64e80af54f06 Sun Jan 28 20:55:10 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu>
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
118 (if last
64e80af54f06 Sun Jan 28 20:55:10 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu>
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
119 (setcdr last (cons timer timers))
64e80af54f06 Sun Jan 28 20:55:10 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu>
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
120 (setq timer-list (cons timer timers)))
64e80af54f06 Sun Jan 28 20:55:10 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu>
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
121 (aset timer 0 nil)
64e80af54f06 Sun Jan 28 20:55:10 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu>
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
122 nil)
64e80af54f06 Sun Jan 28 20:55:10 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu>
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
123 (error "Invalid or uninitialized timer")))
64e80af54f06 Sun Jan 28 20:55:10 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu>
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
124
64e80af54f06 Sun Jan 28 20:55:10 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu>
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
125 (defun cancel-timer (timer)
64e80af54f06 Sun Jan 28 20:55:10 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu>
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
126 "Remove TIMER from the list of active timers."
64e80af54f06 Sun Jan 28 20:55:10 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu>
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
127 (or (timerp timer)
64e80af54f06 Sun Jan 28 20:55:10 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu>
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
128 (error "Invalid timer"))
64e80af54f06 Sun Jan 28 20:55:10 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu>
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
129 (setq timer-list (delq timer timer-list))
64e80af54f06 Sun Jan 28 20:55:10 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu>
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
130 nil)
64e80af54f06 Sun Jan 28 20:55:10 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu>
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
131
64e80af54f06 Sun Jan 28 20:55:10 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu>
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
132 (defun cancel-function-timers (function)
64e80af54f06 Sun Jan 28 20:55:10 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu>
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
133 "Cancel all timers scheduled by `run-at-time' which would run FUNCTION."
64e80af54f06 Sun Jan 28 20:55:10 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu>
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
134 (interactive "aCancel timers of function: ")
64e80af54f06 Sun Jan 28 20:55:10 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu>
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
135 (let ((tail timer-list))
64e80af54f06 Sun Jan 28 20:55:10 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu>
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
136 (while tail
64e80af54f06 Sun Jan 28 20:55:10 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu>
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
137 (if (eq (aref (car tail) 5) function)
64e80af54f06 Sun Jan 28 20:55:10 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu>
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
138 (setq timer-list (delq (car tail) timer-list)))
64e80af54f06 Sun Jan 28 20:55:10 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu>
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
139 (setq tail (cdr tail)))))
64e80af54f06 Sun Jan 28 20:55:10 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu>
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
140
64e80af54f06 Sun Jan 28 20:55:10 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu>
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
141 ;; Set up the common handler for all timer events. Since the event has
64e80af54f06 Sun Jan 28 20:55:10 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu>
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
142 ;; the timer as parameter we can still distinguish. Note that using
64e80af54f06 Sun Jan 28 20:55:10 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu>
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
143 ;; special-event-map ensures that event timer events that arrive in the
64e80af54f06 Sun Jan 28 20:55:10 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu>
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
144 ;; middle of a key sequence being entered are still handled correctly.
64e80af54f06 Sun Jan 28 20:55:10 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu>
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
145 (define-key special-event-map [timer-event] 'timer-event-handler)
64e80af54f06 Sun Jan 28 20:55:10 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu>
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
146 (defun timer-event-handler (event)
64e80af54f06 Sun Jan 28 20:55:10 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu>
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
147 "Call the handler for the timer in the event EVENT."
64e80af54f06 Sun Jan 28 20:55:10 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu>
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
148 (interactive "e")
64e80af54f06 Sun Jan 28 20:55:10 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu>
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
149 (let ((timer (cdr-safe event)))
64e80af54f06 Sun Jan 28 20:55:10 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu>
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
150 (if (timerp timer)
64e80af54f06 Sun Jan 28 20:55:10 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu>
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
151 (progn
64e80af54f06 Sun Jan 28 20:55:10 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu>
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
152 ;; Delete from queue.
64e80af54f06 Sun Jan 28 20:55:10 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu>
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
153 (cancel-timer timer)
64e80af54f06 Sun Jan 28 20:55:10 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu>
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
154 ;; Run handler
64e80af54f06 Sun Jan 28 20:55:10 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu>
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
155 (apply (aref timer 5) (aref timer 6))
64e80af54f06 Sun Jan 28 20:55:10 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu>
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
156 ;; Re-schedule if requested.
64e80af54f06 Sun Jan 28 20:55:10 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu>
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
157 (if (aref timer 4)
64e80af54f06 Sun Jan 28 20:55:10 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu>
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
158 (progn
64e80af54f06 Sun Jan 28 20:55:10 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu>
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
159 (timer-inc-time timer (aref timer 4) 0)
64e80af54f06 Sun Jan 28 20:55:10 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu>
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
160 (timer-activate timer))))
64e80af54f06 Sun Jan 28 20:55:10 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu>
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
161 (error "Bogus timer event"))))
64e80af54f06 Sun Jan 28 20:55:10 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu>
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
162
584
4cd7543be581 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 45
diff changeset
163 ;;;###autoload
45
a55a3ac41924 Initial revision
root <root>
parents:
diff changeset
164 (defun run-at-time (time repeat function &rest args)
a55a3ac41924 Initial revision
root <root>
parents:
diff changeset
165 "Run a function at a time, and optionally on a regular interval.
a55a3ac41924 Initial revision
root <root>
parents:
diff changeset
166 Arguments are TIME, REPEAT, FUNCTION &rest ARGS.
14402
64e80af54f06 Sun Jan 28 20:55:10 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu>
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
167 TIME is a string like \"11:23pm\" or a value from `encode-time'.
45
a55a3ac41924 Initial revision
root <root>
parents:
diff changeset
168 REPEAT, an integer number of seconds, is the interval on which to repeat
14402
64e80af54f06 Sun Jan 28 20:55:10 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu>
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
169 the call to the function. If REPEAT is nil or 0, call it just once."
45
a55a3ac41924 Initial revision
root <root>
parents:
diff changeset
170 (interactive "sRun at time: \nNRepeat interval: \naFunction: ")
2086
3daa7f080f2b (run-at-time): Allow an integer as TIME.
Richard M. Stallman <rms@gnu.org>
parents: 1983
diff changeset
171
14402
64e80af54f06 Sun Jan 28 20:55:10 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu>
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
172 ;; Handle "11:23pm" and the like. Interpret it as meaning today
64e80af54f06 Sun Jan 28 20:55:10 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu>
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
173 ;; which admittedly is rather stupid if we have passed that time
64e80af54f06 Sun Jan 28 20:55:10 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu>
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
174 ;; already. Unfortunately we don't have a `parse-time' function
64e80af54f06 Sun Jan 28 20:55:10 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu>
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
175 ;; to do the right thing.
64e80af54f06 Sun Jan 28 20:55:10 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu>
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
176 (if (stringp time)
64e80af54f06 Sun Jan 28 20:55:10 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu>
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
177 (progn
64e80af54f06 Sun Jan 28 20:55:10 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu>
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
178 (require 'diary-lib)
64e80af54f06 Sun Jan 28 20:55:10 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu>
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
179 (let ((hhmm (diary-entry-time time))
64e80af54f06 Sun Jan 28 20:55:10 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu>
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
180 (now (decode-time)))
64e80af54f06 Sun Jan 28 20:55:10 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu>
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
181 (if (< hhmm 0)
64e80af54f06 Sun Jan 28 20:55:10 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu>
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
182 (setq time 'bad)
64e80af54f06 Sun Jan 28 20:55:10 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu>
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
183 (setq time
64e80af54f06 Sun Jan 28 20:55:10 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu>
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
184 (encode-time 0 (% hhmm 100) (/ hhmm 100) (nth 3 now)
64e80af54f06 Sun Jan 28 20:55:10 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu>
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
185 (nth 4 now) (nth 5 now) (nth 8 now)))))))
64e80af54f06 Sun Jan 28 20:55:10 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu>
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
186
64e80af54f06 Sun Jan 28 20:55:10 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu>
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
187 ;; Special case: nil means "now" and is useful when repeting.
64e80af54f06 Sun Jan 28 20:55:10 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu>
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
188 (if (null time)
64e80af54f06 Sun Jan 28 20:55:10 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu>
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
189 (setq time (current-time)))
64e80af54f06 Sun Jan 28 20:55:10 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu>
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
190
64e80af54f06 Sun Jan 28 20:55:10 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu>
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
191 (or (consp time)
64e80af54f06 Sun Jan 28 20:55:10 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu>
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
192 (error "Invalid time format"))
45
a55a3ac41924 Initial revision
root <root>
parents:
diff changeset
193
14402
64e80af54f06 Sun Jan 28 20:55:10 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu>
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
194 (or (null repeat)
64e80af54f06 Sun Jan 28 20:55:10 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu>
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
195 (natnump repeat)
64e80af54f06 Sun Jan 28 20:55:10 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu>
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
196 (error "Invalid repetition interval"))
64e80af54f06 Sun Jan 28 20:55:10 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu>
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
197
64e80af54f06 Sun Jan 28 20:55:10 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu>
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
198 (let ((timer (timer-create)))
64e80af54f06 Sun Jan 28 20:55:10 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu>
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
199 (timer-set-time timer time repeat)
64e80af54f06 Sun Jan 28 20:55:10 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu>
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
200 (timer-set-function timer function args)
64e80af54f06 Sun Jan 28 20:55:10 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu>
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
201 (timer-activate timer)))
45
a55a3ac41924 Initial revision
root <root>
parents:
diff changeset
202
14403
c91cf5d2b95f (run-after-delay): Add autoload cookie.
Richard M. Stallman <rms@gnu.org>
parents: 14402
diff changeset
203 ;;;###autoload
c91cf5d2b95f (run-after-delay): Add autoload cookie.
Richard M. Stallman <rms@gnu.org>
parents: 14402
diff changeset
204 (defun run-after-delay (secs repeat function &rest args)
c91cf5d2b95f (run-after-delay): Add autoload cookie.
Richard M. Stallman <rms@gnu.org>
parents: 14402
diff changeset
205 "Perform an action after a delay of SECS seconds.
14402
64e80af54f06 Sun Jan 28 20:55:10 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu>
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
206 Repeat the action every REPEAT seconds, if REPEAT is non-nil.
14403
c91cf5d2b95f (run-after-delay): Add autoload cookie.
Richard M. Stallman <rms@gnu.org>
parents: 14402
diff changeset
207 SECS and REPEAT need not be integers.
14402
64e80af54f06 Sun Jan 28 20:55:10 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu>
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
208 The action is to call FUNCTION with arguments ARGS."
64e80af54f06 Sun Jan 28 20:55:10 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu>
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
209 (interactive "sRun after delay (seconds): \nNRepeat interval: \naFunction: ")
64e80af54f06 Sun Jan 28 20:55:10 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu>
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
210
64e80af54f06 Sun Jan 28 20:55:10 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu>
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
211 (or (null repeat)
14403
c91cf5d2b95f (run-after-delay): Add autoload cookie.
Richard M. Stallman <rms@gnu.org>
parents: 14402
diff changeset
212 (and (numberp repeat) (>= repeat 0))
14402
64e80af54f06 Sun Jan 28 20:55:10 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu>
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
213 (error "Invalid repetition interval"))
45
a55a3ac41924 Initial revision
root <root>
parents:
diff changeset
214
14402
64e80af54f06 Sun Jan 28 20:55:10 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu>
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
215 (let ((timer (timer-create)))
64e80af54f06 Sun Jan 28 20:55:10 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu>
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
216 (timer-set-time timer (current-time))
14403
c91cf5d2b95f (run-after-delay): Add autoload cookie.
Richard M. Stallman <rms@gnu.org>
parents: 14402
diff changeset
217 (timer-inc-time timer secs)
14402
64e80af54f06 Sun Jan 28 20:55:10 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu>
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
218 (timer-set-function timer function args)
64e80af54f06 Sun Jan 28 20:55:10 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu>
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
219 (timer-activate timer)))
64e80af54f06 Sun Jan 28 20:55:10 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu>
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
220
64e80af54f06 Sun Jan 28 20:55:10 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu>
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
221 (provide 'timers)
45
a55a3ac41924 Initial revision
root <root>
parents:
diff changeset
222
14402
64e80af54f06 Sun Jan 28 20:55:10 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu>
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
223 ;;; timers.el ends here