diff options
| author | John Wiegley <johnw@newartisans.com> | 2002-05-01 21:53:46 +0000 |
|---|---|---|
| committer | John Wiegley <johnw@newartisans.com> | 2002-05-01 21:53:46 +0000 |
| commit | 9110a47188d7cae52a317cf07e73b1e744ad914f (patch) | |
| tree | 44bf38821d0e9be1a5899b40439f9757abbea32e /chess-algebraic.el | |
| parent | ecb9d2a2fcd5befd74f13d072a074f7be83416c8 (diff) | |
*** no comment ***
Diffstat (limited to 'chess-algebraic.el')
| -rw-r--r-- | chess-algebraic.el | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/chess-algebraic.el b/chess-algebraic.el index 071e414..ceb3b8b 100644 --- a/chess-algebraic.el +++ b/chess-algebraic.el @@ -66,7 +66,7 @@ This regexp handles both long and short form.") (let ((color (chess-pos-side-to-move position)) (mate (match-string 9 move)) (piece (aref move 0)) - changes) + changes long-style) (if (eq piece ?O) (setq changes (chess-ply-castling-changes position (= (length (match-string 1 move)) 5))) @@ -75,7 +75,9 @@ This regexp handles both long and short form.") (let ((source (match-string 4 move)) (target (chess-coord-to-index (match-string 6 move)))) (if (and source (= (length source) 2)) - (list (chess-coord-to-index source) target) + (prog1 + (list (chess-coord-to-index source) target) + (setq long-style t)) (if (= (length source) 0) (setq source nil) (setq source (aref source 0))) @@ -114,7 +116,8 @@ This regexp handles both long and short form.") (when trust (if mate (nconc changes (list (if (equal mate "#") :checkmate :check))))) - (nconc changes (list :san move)) + (unless long-style + (nconc changes (list :san move))) (apply 'chess-ply-create position trust changes))))) @@ -182,7 +185,8 @@ If LONG is non-nil, render the move into long notation." san) (t (let ((move (chess-ply--move-text ply long))) - (chess-ply-set-keyword ply :san move) + (unless long + (chess-ply-set-keyword ply :san move)) move))))) (provide 'chess-algebraic) |
