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-ics1.el | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'chess-ics1.el') diff --git a/chess-ics1.el b/chess-ics1.el index ec0c3ed..a5d572f 100644 --- a/chess-ics1.el +++ b/chess-ics1.el @@ -132,7 +132,8 @@ PERSPECTIVE is t for white or nil for black." (goto-char pos))) (defun chess-ics1-highlight (index &optional mode) - (let ((pos (chess-display-index-pos nil index))) + (let ((pos (chess-display-index-pos nil index)) + (piece (chess-pos-piece (chess-display-position nil) index))) (put-text-property pos (save-excursion (goto-char pos) (skip-chars-forward "^|") @@ -140,6 +141,10 @@ PERSPECTIVE is t for white or nil for black." 'face (cond ((eq mode :selected) 'chess-ics1-highlight-face) + ((eq mode :unselected) + (if (> piece ?a) + 'chess-ics1-black-face + 'chess-ics1-white-face)) (t (chess-display-get-face mode)))))) -- cgit v1.2.3