diff options
| author | John Wiegley <johnw@newartisans.com> | 2002-04-14 21:18:56 +0000 |
|---|---|---|
| committer | John Wiegley <johnw@newartisans.com> | 2002-04-14 21:18:56 +0000 |
| commit | b3d24ad95aaa81040fc2f4eab468e9aceee37bd3 (patch) | |
| tree | 85895895d66fccc6c0c0b4059884cfcf6bb4ca34 /chess-pgn.el | |
| parent | d5e9f0a3c531104936728c5a599dde77c67319b0 (diff) | |
*** no comment ***
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 67ec901..230dc18 100644 --- a/chess-pgn.el +++ b/chess-pgn.el @@ -66,11 +66,12 @@ (chess-parse-pgn))) (defun chess-parse-pgn () - (when (search-forward "[" nil t) + (when (or (looking-at "\\[") + (and (search-forward "[" nil t) + (goto-char (match-beginning 0)))) (let ((game (chess-game-create))) - (setcar game nil) - (backward-char) - (while (looking-at "^\\s-*\\[\\(\\S-+\\)\\s-+\\(\".+?\"\\)\\][ \t\n]+") + (chess-game-set-tags game nil) + (while (looking-at "\\[\\(\\S-+\\)\\s-+\\(\".+?\"\\)\\][ \t\n]+") (chess-game-set-tag game (match-string-no-properties 1) (read (match-string-no-properties 2))) (goto-char (match-end 0))) |
