summaryrefslogtreecommitdiff
path: root/chess-clock.el
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2002-05-01 05:39:41 +0000
committerJohn Wiegley <johnw@newartisans.com>2002-05-01 05:39:41 +0000
commit652c8b322bf058c35eb48b5373976f22e3e3276f (patch)
tree327151f018a3db90e696bd8943506ffe942e9fd0 /chess-clock.el
parent4197d08b7f37f9c1155559897d750ad1f53af241 (diff)
*** no comment ***
Diffstat (limited to 'chess-clock.el')
-rw-r--r--chess-clock.el15
1 files changed, 10 insertions, 5 deletions
diff --git a/chess-clock.el b/chess-clock.el
index cbb5c37..9ef01f7 100644
--- a/chess-clock.el
+++ b/chess-clock.el
@@ -55,19 +55,24 @@
(> (chess-game-index game) 0))
(unless chess-clock-timer
(setq chess-clock-timer
- (run-with-timer 0 1 'chess-clock-tick-tock (current-buffer))))
+ (run-with-timer 0 1 'chess-clock-tick-tock
+ (current-buffer))))
(let ((last-ply (car (last (chess-game-plies game) 2))))
(chess-ply-set-keyword last-ply :white white)
(chess-ply-set-keyword last-ply :black black))))
- (if (and chess-clock-timer (chess-game-over-p game))
- (cancel-timer chess-clock-timer)
- (setq chess-clock-timer nil)))
+ (if (chess-game-over-p game)
+ (chess-clock-handler game 'destroy)))
((eq event 'set-data)
(if (and (eq (car args) 'active)
(not (chess-game-data game 'active)))
- (chess-clock-handler game 'destroy)))))
+ (chess-clock-handler game 'destroy)))
+
+ ((eq event 'destroy)
+ (if chess-clock-timer
+ (cancel-timer chess-clock-timer)
+ (setq chess-clock-timer nil)))))
(defvar chess-clock-tick-tocking nil)