From 2ef00c4beddb77e546cdc212cc502c5a9a4bba6c Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Sun, 7 Apr 2002 08:44:00 +0000 Subject: Simplified the event model, and removed session objects. Now everything just revolves around a game. Gnuchess is now playable to the end, except don't make moves that leave your king in check! The engine still doesn't check for this yet. --- chess-pgn.el | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'chess-pgn.el') diff --git a/chess-pgn.el b/chess-pgn.el index 36ce3f0..04a8575 100644 --- a/chess-pgn.el +++ b/chess-pgn.el @@ -18,7 +18,10 @@ ((looking-at chess-algebraic-regexp) (goto-char (match-end 0)) (setq prevpos position) - (let ((ply (chess-game-algebraic-to-ply game (match-string 0)))) + (let* ((move (match-string 0)) + (ply (chess-game-algebraic-to-ply game (match-string 0)))) + (unless ply + (error "Error reading move: %s" move)) (setq position (chess-ply-next-pos ply)) (nconc plies (list ply)))) ((and top-level @@ -138,9 +141,7 @@ If INDENTED is non-nil, indent the move texts." ;; (setq move (buffer-substring-no-properties (point) end) ;; coords (chess-algebraic-to-ply chess-display-position move)) ;; ;; it will just get reinserted again -;; (delete-region (point) end)) -;; (chess-session-event chess-current-session 'move -;; (chess-algebraic-to-ply chess-display-position)))) +;; (delete-region (point) end))) ;; ;; (defun chess-pgn-insert-move (move &optional color sequence) ;; "Insert an algebraic move description into a PGN buffer. -- cgit v1.2.3