summaryrefslogtreecommitdiff
path: root/chess-images.el
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2002-03-28 08:29:09 +0000
committerJohn Wiegley <johnw@newartisans.com>2002-03-28 08:29:09 +0000
commitfc23f824fa3ea525251cf71b6fc0c277c30ed398 (patch)
treeda6d8bceff255867821c1a57fbcbcdc4a3aa3b69 /chess-images.el
parent871e9bb270b35c621265fc56ec582bdd39900e2a (diff)
Made the display code into part of the core library.
Diffstat (limited to 'chess-images.el')
-rw-r--r--chess-images.el9
1 files changed, 7 insertions, 2 deletions
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)