summaryrefslogtreecommitdiff
path: root/chess-plain.el
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2002-04-22 19:23:45 +0000
committerJohn Wiegley <johnw@newartisans.com>2002-04-22 19:23:45 +0000
commit62c13bcfa1933274be856ac5840a933bbaca5f27 (patch)
tree81e2d4ab1a749a4d2561e824708abd60a04d67d0 /chess-plain.el
parent171cc1aceb0e9acafe329ff6cd0ca1e2852876ce (diff)
Bug fixes and reducing the TODO list.
Diffstat (limited to 'chess-plain.el')
-rw-r--r--chess-plain.el15
1 files changed, 13 insertions, 2 deletions
diff --git a/chess-plain.el b/chess-plain.el
index 5f1ab4b..084b43f 100644
--- a/chess-plain.el
+++ b/chess-plain.el
@@ -91,11 +91,16 @@ modify `chess-plain-piece-chars' to avoid real confusion.)"
"Face to use for highlighting pieces that have been selected."
:group 'chess-plain)
-(defcustom chess-plain-popup-function 'chess-display-popup-in-window
+(defcustom chess-plain-popup-function 'chess-plain-popup
"The function used to popup a chess-plain display."
:type 'function
:group 'chess-plain)
+(defcustom chess-plain-separate-frame nil
+ "If non-nil, display the chessboard in its own frame."
+ :type 'boolean
+ :group 'chess-plain)
+
;;; Code:
(defun chess-plain-handler (event &rest args)
@@ -115,6 +120,11 @@ modify `chess-plain-piece-chars' to avoid real confusion.)"
((eq event 'highlight)
(apply 'chess-plain-highlight args))))
+(defun chess-plain-popup ()
+ (if chess-plain-separate-frame
+ (chess-display-popup-in-frame 9 (* (1+ chess-plain-spacing) 8) nil t)
+ (chess-display-popup-in-window)))
+
(defun chess-plain-piece-text (piece rank file)
(let ((white-square (= (% (+ file rank) 2) 0)))
(if (eq piece ? )
@@ -141,7 +151,8 @@ modify `chess-plain-piece-chars' to avoid real confusion.)"
(goto-char pos)
(delete-char 1)
(insert (chess-plain-piece-text piece (chess-index-rank index)
- (chess-index-file index)))))
+ (chess-index-file index)))
+ (add-text-properties pos (point) (list 'chess-coord index))))
(defun chess-plain-draw (position perspective)
"Draw the given POSITION from PERSPECTIVE's point of view.