diff options
| author | John Wiegley <johnw@newartisans.com> | 2002-04-22 19:23:45 +0000 |
|---|---|---|
| committer | John Wiegley <johnw@newartisans.com> | 2002-04-22 19:23:45 +0000 |
| commit | 62c13bcfa1933274be856ac5840a933bbaca5f27 (patch) | |
| tree | 81e2d4ab1a749a4d2561e824708abd60a04d67d0 /chess-autosave.el | |
| parent | 171cc1aceb0e9acafe329ff6cd0ca1e2852876ce (diff) | |
Bug fixes and reducing the TODO list.
Diffstat (limited to 'chess-autosave.el')
| -rw-r--r-- | chess-autosave.el | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/chess-autosave.el b/chess-autosave.el index f8f7369..909e315 100644 --- a/chess-autosave.el +++ b/chess-autosave.el @@ -16,23 +16,26 @@ (chess-message-catalog 'english '((chess-read-autosave . "There is a chess autosave file, read it? ") - (chess-delete-autosave . "Delete the autosave file? "))) + (chess-delete-autosave . "Delete the autosave file? ") + (chess-disable-autosave . "Disable autosaving for this game? "))) (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 - game (chess-autosave-read chess-autosave-file)) - (delete-file chess-autosave-file)) - (ignore - (if (y-or-n-p (chess-string 'chess-delete-autosave)) - (delete-file chess-autosave-file))))) - (kill-buffer (current-buffer)) - (set-buffer (find-file-noselect chess-autosave-file t)) - t) + (let ((result t)) + (if (file-readable-p chess-autosave-file) + (if (y-or-n-p (chess-string 'chess-read-autosave)) + (progn + (chess-game-copy-game game (chess-autosave-read + chess-autosave-file)) + (delete-file chess-autosave-file)) + (if (y-or-n-p (chess-string 'chess-delete-autosave)) + (delete-file chess-autosave-file) + (if (y-or-n-p (chess-string 'chess-disable-autosave)) + (setq result nil))))) + (kill-buffer (current-buffer)) + (set-buffer (find-file-noselect chess-autosave-file t)) + result)) ((eq event 'post-move) (chess-autosave-write game chess-autosave-file)) |
