From fde9ea1637b3cb0e26f0217a691b4a5536f14345 Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Wed, 1 May 2002 00:07:17 +0000 Subject: Tiny code rearrangement. If chess-ply-castling-changes fails, no ply create will be attempted. --- chess-algebraic.el | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/chess-algebraic.el b/chess-algebraic.el index 848a97c..071e414 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 ply) + changes) (if (eq piece ?O) (setq changes (chess-ply-castling-changes position (= (length (match-string 1 move)) 5))) @@ -110,13 +110,13 @@ This regexp handles both long and short form.") (if promotion (nconc changes (list :promote (aref promotion 0)))))) - (when trust - (if mate - (nconc changes (list (if (equal mate "#") :checkmate :check)))) - (nconc changes (list :san move))) + (when changes + (when trust + (if mate + (nconc changes (list (if (equal mate "#") :checkmate :check))))) + (nconc changes (list :san move)) - (assert changes) - (or ply (apply 'chess-ply-create position trust changes))))) + (apply 'chess-ply-create position trust changes))))) (defsubst chess-ply--move-text (ply long) (or (and (chess-ply-keyword ply :castle) "O-O") -- cgit v1.2.3