diff options
| author | John Wiegley <johnw@newartisans.com> | 2002-04-07 08:44:00 +0000 |
|---|---|---|
| committer | John Wiegley <johnw@newartisans.com> | 2002-04-07 08:44:00 +0000 |
| commit | 2ef00c4beddb77e546cdc212cc502c5a9a4bba6c (patch) | |
| tree | f20a250ce3e162fd5580696528d7b8251cdcfcf4 /chess-pgn.el | |
| parent | b148d84be1c3bd781c4fd11dd0a928fbeeda28fd (diff) | |
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.
Diffstat (limited to 'chess-pgn.el')
| -rw-r--r-- | chess-pgn.el | 9 |
1 files changed, 5 insertions, 4 deletions
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. |
