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-ics2.el | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'chess-ics2.el') diff --git a/chess-ics2.el b/chess-ics2.el index a052bea..18ff7dc 100644 --- a/chess-ics2.el +++ b/chess-ics2.el @@ -169,13 +169,20 @@ PERSPECTIVE is t for white or nil for black." (goto-char pos))) (defun chess-ics2-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 2)) (point)) 'face (cond ((eq mode :selected) 'chess-ics2-highlight-face) + ((eq mode :unselected) + (if (> piece ?a) + (if (= a 0) 'chess-ics2-black-face + 'chess-ics2-black-face-alt) + (if (= a 0) 'chess-ics2-white-face + 'chess-ics2-white-face-alt))) (t (chess-display-get-face mode)))))) -- cgit v1.2.3