From 3222b53d942daa404852e5148ba9d3ebb8fe96d0 Mon Sep 17 00:00:00 2001 From: dickmao Date: Mon, 27 Aug 2018 17:00:35 -0400 Subject: Pre-moves To activate, look for Chess Display Allow Pre Moves in: M-x customize-group chess-display Tested via: make test make test24 (requires evim) --- chess-input.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'chess-input.el') diff --git a/chess-input.el b/chess-input.el index ce7b348..7d94940 100644 --- a/chess-input.el +++ b/chess-input.el @@ -40,12 +40,14 @@ (defvar chess-input-moves-pos nil) (defvar chess-input-moves nil) (defvar chess-input-position-function nil) +(defvar chess-input-my-color-function nil) (defvar chess-input-move-function nil) (make-variable-buffer-local 'chess-input-move-string) (make-variable-buffer-local 'chess-input-moves-pos) (make-variable-buffer-local 'chess-input-moves) (make-variable-buffer-local 'chess-input-position-function) +(make-variable-buffer-local 'chess-input-my-color-function) (make-variable-buffer-local 'chess-input-move-function) (defun chess-input-test-move (ply) @@ -90,7 +92,7 @@ (defun chess-input-shortcut (&optional display-only) (interactive) (let* ((position (funcall chess-input-position-function)) - (color (chess-pos-side-to-move position)) + (color (funcall chess-input-my-color-function)) char) (unless (memq last-command '(chess-input-shortcut chess-input-shortcut-delete)) -- cgit v1.2.3