From fc23f824fa3ea525251cf71b6fc0c277c30ed398 Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Thu, 28 Mar 2002 08:29:09 +0000 Subject: Made the display code into part of the core library. --- chess-images.el | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'chess-images.el') diff --git a/chess-images.el b/chess-images.el index 2a0a602..44baabd 100644 --- a/chess-images.el +++ b/chess-images.el @@ -232,14 +232,19 @@ jww (2001-06-23): This is still not fully implemented." (set-buffer-modified-p nil) (goto-char pos))) -(defun chess-images-highlight (pos index &optional mode) +(defun chess-images-highlight (index &optional mode) "Highlight the piece on BOARD at INDEX, using the given MODE. Common modes are: `selected' show that the piece has been selected for movement. `unselected' show that the piece has been unselected." (if (null (get-buffer-window (current-buffer) t)) (chess-images-popup-board)) - (let ((highlight (copy-alist (get-text-property pos 'display)))) + (let* ((pos (save-excursion + (beginning-of-line) + (goto-line (1+ (chess-index-rank index))) + (forward-char (* 2 (chess-index-file index))) + (point))) + (highlight (copy-alist (get-text-property pos 'display)))) (setcar (last highlight) (list (cons "light_square" chess-images-highlight-color) (cons "dark_square" chess-images-highlight-color) -- cgit v1.2.3