summaryrefslogtreecommitdiff
path: root/chess-autosave.el
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2002-04-15 05:40:38 +0000
committerJohn Wiegley <johnw@newartisans.com>2002-04-15 05:40:38 +0000
commitef7c29d679c6aaf8dda55772e65800097c46f163 (patch)
tree543f39f09bfaa6d44606804c18babff26470d4f8 /chess-autosave.el
parent6fbcc92505250d896b5d408483822b115bc614c7 (diff)
*** no comment ***
Diffstat (limited to 'chess-autosave.el')
-rw-r--r--chess-autosave.el13
1 files changed, 7 insertions, 6 deletions
diff --git a/chess-autosave.el b/chess-autosave.el
index 8652070..58a07c0 100644
--- a/chess-autosave.el
+++ b/chess-autosave.el
@@ -19,13 +19,13 @@
'((chess-read-autosave . "There is a chess autosave file, read it? ")
(chess-delete-autosave . "Delete the autosave file? ")))
-(defun chess-autosave-handler (event &rest args)
+(defun chess-autosave-handler (game event &rest args)
(cond
((eq event 'initialize)
(if (file-readable-p chess-autosave-file)
(if (y-or-n-p (chess-string 'chess-read-autosave))
(prog1
- (chess-game-copy-game chess-display-game
+ (chess-game-copy-game game
(chess-read-game chess-autosave-file))
(delete-file chess-autosave-file))
(ignore
@@ -33,13 +33,14 @@
(delete-file chess-autosave-file)))))
(kill-buffer (current-buffer))
(set-buffer (find-file-noselect chess-autosave-file t))
- (current-buffer))
+ t)
((eq event 'post-move)
- (chess-autosave-write chess-display-game chess-autosave-file))
+ (chess-autosave-write game chess-autosave-file))
- ((eq event 'shutdown)
- (delete-file chess-autosave-file))))
+ ((eq event 'destroy)
+ (if (file-readable-p chess-autosave-file)
+ (delete-file chess-autosave-file)))))
(defun chess-autosave-write (game file)
"Write a chess GAME to FILE as raw Lisp."