]> code.delx.au - gnu-emacs-elpa/blobdiff - chess-file.el
Add examples for chess-plain and chess-ics1 to the manual.
[gnu-emacs-elpa] / chess-file.el
index 30565af981e409fb6a28b21f607300af05ffeee0..1b3028b9b4ae1ffc96514c21bb78c5fae978b9d1 100644 (file)
@@ -1,10 +1,33 @@
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;
-;; A game database that stores PGN format games or EPD format positions in
-;; a single file.
+;;; chess-file.el --- Handle chess databases stored in PGN or EPD files
+
+;; Copyright (C) 2002, 2004, 2014  Free Software Foundation, Inc.
+
+;; Author: John Wiegley <johnw@gnu.org>
+;; Maintainer: Mario Lang <mlang@delysid.org>
+;; Keywords: files, games
+
+;; This program is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+
+;; This program is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; A game database that stores PGN or EPD format positions in a single file.
 ;;
 ;; This is basically what you expect from a file ending in .pgn or .epd.
-;;
+
+;;; Code:
+
+(require 'chess-fen)
 
 (defvar chess-file-locations nil
   "A list of starting positions of individual records of this collection.")
@@ -81,7 +104,7 @@ inbetween of individual records.")
    ((eq event 'write)
     (goto-char (point-max))
     (while (memq (char-before) '(?  ?\t ?\n ?\r))
-      (delete-backward-char 1))
+      (delete-char -1))
     (apply 'insert (nth 4 (assq chess-file-type chess-file-types)))
     (push (point) chess-file-locations)
     (funcall (nth 3 (assq chess-file-type chess-file-types)) (car args))