]> code.delx.au - gnu-emacs-elpa/blobdiff - chess-display.el
Correctly indent `chess-with-current-buffer' in lisp-mode.
[gnu-emacs-elpa] / chess-display.el
index c5c8b33198c874aea6ddfbbc6f179a7f194ad5fb..553de49b72e5f43bb7e8d950253c8bd5627350f3 100644 (file)
@@ -7,6 +7,7 @@
 (require 'chess-module)
 (require 'chess-var)
 (require 'chess-input)
+(require 'chess-random)
 
 (defgroup chess-display nil
   "Common code used by chess displays."
@@ -80,6 +81,7 @@ See `mode-line-format' for syntax details."
 (make-variable-buffer-local 'chess-display-index)
 (make-variable-buffer-local 'chess-display-move-text)
 (make-variable-buffer-local 'chess-display-side-to-move)
+(put 'chess-display-side-to-move 'risky-local-variable t)
 (make-variable-buffer-local 'chess-display-perspective)
 (make-variable-buffer-local 'chess-display-event-handler)
 (make-variable-buffer-local 'chess-display-edit-mode)
@@ -365,8 +367,8 @@ If only START is given, it must be in algebraic move notation."
          (chess-error 'game-is-over)))
     (if (= chess-display-index (chess-game-index chess-module-game))
        (let ((chess-display-handling-event t))
-         (chess-display-paint-move nil ply)
          (chess-game-move chess-module-game ply)
+         (chess-display-paint-move nil ply)
          (chess-display-set-index* nil (chess-game-index chess-module-game)))
       ;; jww (2002-03-28): This should beget a variation within the
       ;; game, or alter the game, just as SCID allows
@@ -1085,6 +1087,9 @@ to the end or beginning."
        (funcall chess-display-event-handler 'draw-square
                 (point) (or piece last-command-char) index))))
 
+(unless (fboundp 'event-window)
+  (defalias 'event-point 'ignore))
+
 (defun chess-display-mouse-set-piece (event)
   "Select the piece the user clicked on."
   (interactive "e")