diff options
Diffstat (limited to 'chess-ics1.el')
| -rw-r--r-- | chess-ics1.el | 11 |
1 files changed, 7 insertions, 4 deletions
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 "^|") |
