diff options
| author | John Wiegley <johnw@newartisans.com> | 2002-05-01 07:50:19 +0000 |
|---|---|---|
| committer | John Wiegley <johnw@newartisans.com> | 2002-05-01 07:50:19 +0000 |
| commit | 08c2fd926a741c21422d3f885eee8b2b274290ba (patch) | |
| tree | 9caa79e1b4591fec9b7601fb0b914b156691255c | |
| parent | 3408e2c4e66ab14dad75e44cd8898250c721c24b (diff) | |
*** no comment ***
| -rw-r--r-- | Makefile | 2 | ||||
| -rw-r--r-- | PLAN | 20 | ||||
| -rw-r--r-- | chess-autosave.el | 31 |
3 files changed, 24 insertions, 29 deletions
@@ -65,4 +65,4 @@ update: dist cvs commit -m "bumped minor rev" chess.el make fullclean lftp -e "cd /incoming; put $(PKG); quit" upload.sourceforge.net - sitecopy + sitecopy -ua @@ -1,3 +1,6 @@ + + BEFORE FINAL RELEASE + chess-ics, chess-kibitz, chess-chat - finish all elements of regular use as a client @@ -7,14 +10,9 @@ chess-ply chess-german - complete translation - BEFORE FINAL RELEASE - - use more asserts throughout the code - break my dependency on cl - - profile - mem profile - - elint - docstring/texi - checkdoc +general +- use more asserts throughout the code +- profile and mem profile +- elint all files +- add docstrings/texi content +- use checkdoc on all files diff --git a/chess-autosave.el b/chess-autosave.el index e93c3bc..fe34433 100644 --- a/chess-autosave.el +++ b/chess-autosave.el @@ -16,17 +16,13 @@ :group 'chess-autosave) (defcustom chess-autosave-database nil - "If non-nil, a chess database file in which completed games are appended." - :type '(choice file (const :tag "Do not save completed games" nil)) - :group 'chess-autosave) - -(defcustom chess-autosave-filter-function nil - "A function called to determine which games are saved in databases. -The function will receive a game object, and usually will make its -determination based on the headers. If it returns a non-nil value, -the game will be stored in the `chess-autosave-database'. -If this variable is set to nil, all games will be saved." - :type '(choice (const :tag "Always save" nil) function) + "If non-nil, a chess database file in which completed games are appended. +If a function, it will receive a game object and is expected to do the +work of saving the game object to whichever database(s) it chooses. +Whether it closes those databases or caches them for later use is up +to the user." + :type '(choice (const :tag "Do not save completed games" nil) + file function) :group 'chess-autosave) (chess-message-catalog 'english @@ -67,12 +63,13 @@ If this variable is set to nil, all games will be saved." (if (not (chess-game-over-p game)) (chess-autosave-write game chess-autosave-file) (erase-buffer) - (if (and chess-autosave-database - (or (null chess-autosave-filter-function) - (funcall chess-autosave-filter-function game))) - (let ((database (chess-database-open chess-autosave-database))) - (chess-database-write database game) - (chess-database-close database))))) + (if chess-autosave-database + (if (functionp chess-autosave-database) + (funcall chess-autosave-database game) + (let ((database (chess-database-open chess-autosave-database))) + (when database + (chess-database-write database game) + (chess-database-close database))))))) ((eq event 'destroy) (set-buffer-modified-p nil) |
