summaryrefslogtreecommitdiff
path: root/chess-images.el
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2002-04-12 07:58:22 +0000
committerJohn Wiegley <johnw@newartisans.com>2002-04-12 07:58:22 +0000
commite66b028def9af45cc545c973255df42c9b90cde1 (patch)
treeb4d7bf33b4aabfee075ff211e3da12456fbeaf70 /chess-images.el
parentcdba8a5aed3bd66e62f348a7064acece342bb68e (diff)
optimizations and bug fixes
Diffstat (limited to 'chess-images.el')
-rw-r--r--chess-images.el27
1 files changed, 11 insertions, 16 deletions
diff --git a/chess-images.el b/chess-images.el
index eca809a..5ab618d 100644
--- a/chess-images.el
+++ b/chess-images.el
@@ -133,11 +133,6 @@ that specialized squares may be used such as marble tiles, etc."
:set 'chess-images-clear-image-cache
:group 'chess-images)
-(defcustom chess-images-popup t
- "If non-nil, popup the chessboard display whenever the opponent moves."
- :type 'boolean
- :group 'chess-images)
-
(defcustom chess-images-popup-function 'chess-images-popup
"The function used to popup a chess-images display.
The current-buffer is set to the display buffer when this function is
@@ -147,27 +142,27 @@ called."
;;; Code:
+(defconst chess-images-piece-names
+ '((?r "rook" 0)
+ (?n "knight" 1)
+ (?b "bishop" 2)
+ (?q "queen" 3)
+ (?k "king" 4)
+ (?p "pawn" 5))
+ "The names and index values of the different pieces.")
+
(defun chess-images-handler (event &rest args)
(cond
((eq event 'initialize)
(chess-images-initialize))
((eq event 'popup)
- (if chess-images-popup
+ (if chess-display-popup
(funcall chess-images-popup-function)))
((eq event 'draw)
(apply 'chess-images-draw args))
((eq event 'highlight)
(apply 'chess-images-highlight args))))
-(defconst chess-images-piece-names
- '((?r "rook" 0)
- (?n "knight" 1)
- (?b "bishop" 2)
- (?q "queen" 3)
- (?k "king" 4)
- (?p "pawn" 5))
- "The names and index values of the different pieces.")
-
(defun chess-images-initialize ()
(let ((map (current-local-map)))
(define-key map [?^] 'chess-images-increase-size)
@@ -197,7 +192,7 @@ called."
(display (and (stringp chess-images-separate-frame)
chess-images-separate-frame)))
;; create the frame whenever necessary
- (chess-display-popup-in-frame display (+ max-char-height 2)
+ (chess-display-popup-in-frame (+ max-char-height 2)
max-char-width))
(chess-display-popup-in-window)))