]> code.delx.au - gnu-emacs-elpa/blobdiff - chess-algebraic.el
added castling keywords
[gnu-emacs-elpa] / chess-algebraic.el
index 09f8b30eedb6284e6be75faf93363dc8395a1a62..737a4d0d3606f3a0d7fbbfb67f09306530606266 100644 (file)
@@ -116,12 +116,8 @@ If LONG is non-nil, render the move into long notation."
           (color (chess-pos-side-to-move pos)) str
           (notation
            (if (setq str
-                     (and (= (upcase from-piece) ?K)
-                          (= from (chess-rf-to-index (if color 7 0) 4))
-                          (if (= to (chess-rf-to-index (if color 7 0) 6))
-                              "O-O"
-                            (if (= to (chess-rf-to-index (if color 7 0) 2))
-                                "O-O-O"))))
+                     (if (memq :castle changes) "O-O"
+                       (if (memq :long-castle changes) "O-O-O")))
                str
              (let ((candidates (chess-search-position pos to from-piece))
                    (rank 0) (file 0)