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-ics1.el | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'chess-ics1.el') diff --git a/chess-ics1.el b/chess-ics1.el index 1d016c8..ef001f2 100644 --- a/chess-ics1.el +++ b/chess-ics1.el @@ -25,7 +25,7 @@ PERSPECTIVE is t for white or nil for black." (erase-buffer) (let* ((position (or disppos (chess-display-position nil))) (inverted (and (null disppos) - (null (chess-display-perspective nil)))) + (not (chess-display-perspective nil)))) (rank (if inverted 7 0)) (file (if inverted 7 0)) beg) @@ -67,11 +67,14 @@ PERSPECTIVE is t for white or nil for black." (defun chess-ics1-highlight (index &optional mode) (if (null (get-buffer-window (current-buffer) t)) (pop-to-buffer (current-buffer))) - (let (beg end) + (let ((inverted (not (chess-display-perspective nil))) + beg end) (save-excursion (goto-char (point-min)) - (goto-line (+ 3 (* 2 (chess-index-rank index)))) - (forward-char (+ 8 (* 4 (chess-index-file index)))) + (let ((rank (chess-index-rank index)) + (file (chess-index-file index))) + (goto-line (+ 3 (* 2 (if inverted (- 7 rank) rank)))) + (forward-char (+ 8 (* 4 (if inverted (- 7 file) file))))) (skip-chars-backward "^|") (setq beg (point)) (skip-chars-forward "^|") -- cgit v1.2.3