summaryrefslogtreecommitdiff
path: root/chess-display.el
diff options
context:
space:
mode:
authorMario Lang <mlang@delysid.org>2004-02-18 17:55:11 +0000
committerMario Lang <mlang@delysid.org>2004-02-18 17:55:11 +0000
commit744dd039689fe098b58e71f5faa94bc4a38e7f9d (patch)
tree8a63493d5ddcdfbd8719a5495e8b88874c6db004 /chess-display.el
parent9f2dba6078e4d31534bf9de6ed0d9ec9b2846bff (diff)
(chess-display-highlight-passed-pawns): New
interactive function.
Diffstat (limited to 'chess-display.el')
-rw-r--r--chess-display.el12
1 files changed, 10 insertions, 2 deletions
diff --git a/chess-display.el b/chess-display.el
index b925908..93ba575 100644
--- a/chess-display.el
+++ b/chess-display.el
@@ -85,7 +85,7 @@ See `mode-line-format' for syntax details."
(make-variable-buffer-local 'chess-display-index-positions)
(defvar chess-display-handling-event nil
- "If non-nil, chess-display is aleady handling the event. This variable
+ "If non-nil, chess-display is already handling the event. This variable
is used to avoid reentrancy.")
(defvar chess-display-style)
@@ -122,7 +122,7 @@ of the board, if non-nil, the board is viewed from White's perspective."
(defalias 'chess-display-destroy 'chess-module-destroy)
(defun chess-display-clone (display style perspective)
- (let ((new-display (chess-display-create chess-module-game
+ (let ((new-display (chess-display-create (chess-display-game display)
style perspective)))
;; the display will have already been updated by the `set-' calls,
;; it's just not visible yet
@@ -390,6 +390,14 @@ that is supported by most displays, and is the default mode."
(chess-display-highlight nil "pale green"
(chess-ply-target ply)))))
+(defun chess-display-highlight-passed-pawns (&optional display)
+ (interactive)
+ (mapc
+ (lambda (index) (chess-display-highlight display index :selected))
+ (append
+ (chess-pos-passed-pawns (chess-display-position display) t)
+ (chess-pos-passed-pawns (chess-display-position display) nil))))
+
(defun chess-display-popup (display)
"Popup the given DISPLAY, so that it's visible to the user."
(chess-with-current-buffer display