From 51cf0ef745fe30a34b6072ef6ca4d3ae6f8b90c0 Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Mon, 8 Apr 2002 09:01:59 +0000 Subject: *** no comment *** --- chess-plain.el | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) (limited to 'chess-plain.el') diff --git a/chess-plain.el b/chess-plain.el index 466ba9b..6b70e63 100644 --- a/chess-plain.el +++ b/chess-plain.el @@ -70,7 +70,7 @@ PERSPECTIVE is t for white or nil for black." (pos (point))) (erase-buffer) (let* ((position (chess-display-position nil)) - (inverted (null (chess-display-perspective nil))) + (inverted (not (chess-display-perspective nil))) (rank (if inverted 7 0)) (file (if inverted 7 0)) beg) @@ -119,16 +119,22 @@ PERSPECTIVE is t for white or nil for black." (defun chess-plain-highlight (index &optional mode) (if (null (get-buffer-window (current-buffer) t)) (pop-to-buffer (current-buffer))) - (save-excursion - (beginning-of-line) - (goto-line (if chess-plain-draw-border - (+ 2 (chess-index-rank index)) - (1+ (chess-index-rank index)))) - (forward-char (if chess-plain-draw-border - (1+ (chess-index-file index)) - (chess-index-file index))) - (put-text-property (point) (1+ (point)) 'face - 'chess-display-highlight-face))) + (let ((inverted (not (chess-display-perspective nil)))) + (save-excursion + (beginning-of-line) + (let ((rank (chess-index-rank index)) + (file (chess-index-file index))) + (if inverted + (setq rank (- 7 rank) + file (- 7 file))) + (goto-line (if chess-plain-draw-border + (+ 2 rank) + (1+ rank))) + (forward-char (if chess-plain-draw-border + (1+ file) + file))) + (put-text-property (point) (1+ (point)) 'face + 'chess-display-highlight-face)))) (provide 'chess-plain) -- cgit v1.2.3