summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2002-05-16 17:28:18 +0000
committerJohn Wiegley <johnw@newartisans.com>2002-05-16 17:28:18 +0000
commit59d1008283f339d6c6d146979c4cff0c6430b095 (patch)
tree530b969e5568e51caf57dc230a544e141c26bec1
parent86493efa7a72ecda178e0ec5e7123c9761a61046 (diff)
miscellaneous fixes
-rw-r--r--PLAN13
-rw-r--r--chess-common.el13
-rw-r--r--chess-display.el18
-rw-r--r--chess-engine.el8
-rw-r--r--chess-game.el6
-rw-r--r--chess-german.el157
-rw-r--r--chess-ics.el22
-rw-r--r--chess-ics1.el3
-rw-r--r--chess-images.el3
-rw-r--r--chess-network.el23
-rw-r--r--chess-pgn.el8
-rw-r--r--chess-plain.el3
-rw-r--r--chess-ply.el9
-rw-r--r--chess.el3
14 files changed, 141 insertions, 148 deletions
diff --git a/PLAN b/PLAN
index 126c11d..9bc2c7d 100644
--- a/PLAN
+++ b/PLAN
@@ -1,16 +1,8 @@
chess-ics
- finish all elements of regular use as a client
- takebacks still aren't working 100%
-- display a notice in the minibuffer when a takeback request is sent
-
-chess-network
-- the client is getting syntax errors
chess-display
-- if I resign, chess-announce announces the last move my opponent
- made!
-- there should be a way to disable popups, yet still have the initial
- display popup in its own frame
- when I checkmate my opponent, the display says "Black ...#"
chess-engine
@@ -20,11 +12,6 @@ chess-engine
chess-irc
- if I move before my opponent has connected, I get a symbol assertion
about "value"
-- if I am the one who submits the game, then the opponent's name
- always shows as Anonymous
-
-chess-pgn
-- make the dependency on font-lock be dynamic
chess-ply
- detect games drawn by three-fold repetition
diff --git a/chess-common.el b/chess-common.el
index ce320b4..4fc26f6 100644
--- a/chess-common.el
+++ b/chess-common.el
@@ -66,6 +66,10 @@
((eq event 'draw)
(chess-message 'draw-offer-declined))
+ ((eq event 'resign)
+ (chess-engine-send nil "resign\n")
+ (chess-game-set-data game 'active nil))
+
((eq event 'new)
(chess-engine-send nil "new\n")
(chess-engine-set-position nil))
@@ -93,13 +97,8 @@
(chess-game-set-tag game "White" chess-full-name)
(chess-game-set-tag game "Black" chess-engine-opponent-name))
- (cond
- ((chess-ply-keyword (car args) :resign)
- (chess-engine-send nil "resign\n"))
- (t
- (chess-engine-send nil (concat (chess-ply-to-algebraic (car args))
- "\n"))))
-
+ (chess-engine-send nil (concat (chess-ply-to-algebraic (car args))
+ "\n"))
(if (chess-game-over-p game)
(chess-game-set-data game 'active nil)))))
diff --git a/chess-display.el b/chess-display.el
index 2faf4b3..6d06e72 100644
--- a/chess-display.el
+++ b/chess-display.el
@@ -16,6 +16,8 @@
:type 'boolean
:group 'chess-display)
+(make-variable-buffer-local 'chess-display-popup)
+
(defcustom chess-display-highlight-legal nil
"If non-nil, highlight legal target squares when a piece is selected."
:type 'boolean
@@ -70,7 +72,6 @@ See `mode-line-format' for syntax details."
(defvar chess-display-side-to-move)
(defvar chess-display-perspective)
(defvar chess-display-event-handler nil)
-(defvar chess-display-no-popup nil)
(defvar chess-display-edit-mode nil)
(defvar chess-display-index-positions nil)
@@ -79,7 +80,6 @@ See `mode-line-format' for syntax details."
(make-variable-buffer-local 'chess-display-side-to-move)
(make-variable-buffer-local 'chess-display-perspective)
(make-variable-buffer-local 'chess-display-event-handler)
-(make-variable-buffer-local 'chess-display-no-popup)
(make-variable-buffer-local 'chess-display-edit-mode)
(make-variable-buffer-local 'chess-display-index-positions)
@@ -252,7 +252,7 @@ also view the same game."
(chess-with-current-buffer display
(funcall chess-display-event-handler 'draw
(chess-display-position nil) chess-display-perspective)
- (if (and popup (not chess-display-no-popup)
+ (if (and popup chess-display-popup
(chess-module-leader-p nil))
(chess-display-popup nil))))
@@ -368,12 +368,12 @@ that is supported by most displays, and is the default mode."
(defun chess-display-enable-popup (display)
"Popup the given DISPLAY, so that it's visible to the user."
(chess-with-current-buffer display
- (setq chess-display-no-popup nil)))
+ (setq chess-display-popup nil)))
(defun chess-display-disable-popup (display)
"Popup the given DISPLAY, so that it's visible to the user."
(chess-with-current-buffer display
- (setq chess-display-no-popup t)))
+ (setq chess-display-popup t)))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
@@ -462,8 +462,7 @@ See `chess-display-type' for the different kinds of displays."
(if (eq event 'move)
(progn
(chess-display-paint-move nil (car args))
- (if (and chess-display-popup
- (not chess-display-no-popup))
+ (if chess-display-popup
(chess-display-popup nil)))
(chess-display-update nil chess-display-popup)))
(if (memq event chess-display-interesting-events)
@@ -984,7 +983,8 @@ to the end or beginning."
(chess-message-catalog 'english
'((editing-directly
- . "Now editing position directly, use S when complete...")))
+ . "Now editing position directly, use S when complete...")
+ (clear-chessboard-q . "Really clear the chessboard? ")))
(defun chess-display-edit-board ()
"Setup the current board for editing."
@@ -1021,7 +1021,7 @@ to the end or beginning."
(defun chess-display-clear-board ()
"Setup the current board for editing."
(interactive)
- (when (y-or-n-p "Really clear the chessboard? ")
+ (when (y-or-n-p (chess-string 'clear-chessboard-q))
(let ((position (chess-display-position nil)))
(dotimes (rank 8)
(dotimes (file 8)
diff --git a/chess-engine.el b/chess-engine.el
index 360ed19..8756962 100644
--- a/chess-engine.el
+++ b/chess-engine.el
@@ -56,7 +56,7 @@
(opp-abort . "Your opponent wants to abort this game, accept? ")
(opp-undo . "Your opponent wants to take back %d moves, accept? ")
(opp-ready . "Your opponent, %s, is now ready to play")
- (opp-ready-a . "Your opponent is now ready to play")
+ (opp-ready-a . "Your opponent is ready to play; pass or make your move")
(opp-draw-acc . "Your draw offer was accepted")
(opp-abort-acc . "Your offer to abort was accepted")
(opp-undo-acc . "Request to undo %d moves was accepted")
@@ -128,7 +128,7 @@
(setq chess-engine-opponent-name (or name "Anonymous"))
(let ((chess-engine-handling-event t))
(chess-engine-set-position nil))
- (chess-engine-command nil 'accept))
+ (chess-engine-command nil 'accept chess-full-name))
(chess-engine-command nil 'decline))))
t)
@@ -162,7 +162,6 @@
(let ((chess-engine-handling-event t))
(chess-message 'opp-resigned)
(chess-game-end game :resign)
- (chess-game-set-data game 'active nil)
t))
((eq event 'draw)
@@ -198,7 +197,8 @@
(when chess-engine-pending-offer
(if (eq chess-engine-pending-offer 'match)
(unless (chess-game-data game 'active)
- (let ((name (and (> (length (car args)) 0) (car args))))
+ (let ((name (and (> (length (car args)) 0)
+ (car args))))
(if name
(chess-message 'opp-ready (car args))
(chess-message 'opp-ready-a))
diff --git a/chess-game.el b/chess-game.el
index 4a82b04..231cc03 100644
--- a/chess-game.el
+++ b/chess-game.el
@@ -316,8 +316,10 @@ progress (nil), if it is drawn, resigned, mate, etc."
:stalemate))
(chess-game-set-tag game "Result" "1/2-1/2"))))
- (chess-game-run-hooks game 'move current-ply)
- (chess-game-run-hooks game 'post-move)))
+ (if (chess-ply-keyword ply :resign)
+ (chess-game-run-hooks game 'resign)
+ (chess-game-run-hooks game 'move current-ply)
+ (chess-game-run-hooks game 'post-move))))
(defsubst chess-game-end (game keyword)
"End the current game, by resignation, draw, etc."
diff --git a/chess-german.el b/chess-german.el
index 8277402..111e57b 100644
--- a/chess-german.el
+++ b/chess-german.el
@@ -21,101 +21,100 @@
(piece-moves . "%s nach %s")
(piece-takes . "%s schlägt %s auf %s")
- (knight-1-done . "Goal: take all the pawns, without letting the queen take your knight")
- (congratulations . "Congratulations!")
- (queen-would-take . "Die Dame würde deinen Springer schlagen!")
- (end-of-puzzles . "Es gibt keine weiteren Puzzles in dieser Sammlung")
+ (add-to-completed . "Cannot add moves to a completed game")
(bad-game-read . "Error reading game at position %d")
- (irc-challenge . "IRC nick of user to challenge: ")
- (irc-waiting . "Now waiting for 'name USER' via /msg, or `M-x chess-irc-engage'")
- (irc-logging-in . "Connected, now logging in as '%s'...")
- (irc-connecting . "Verbindungsaufbau mit IRC server '%s:%d'...")
- (opponent-says . "Dein Gegner sagt: %s")
+ (cannot-mount . "You cannot move pieces on top of each other")
+ (cannot-yet-add . "Cannot insert moves into a game (yet)")
(challenge-whom . "Wehn willst du herausfordern? ")
- (ics-connected . "Verbindungsaufbau mit Internet Chess Server '%s'...done")
- (ics-connecting . "Verbindungsaufbau mit Internet Chess Server '%s'...")
- (ics-server-prompt . "Connect to chess server: ")
- (network-connected . "You have connected; pass now or make your move.")
- (network-waiting . "Now waiting for your opponent to connect...")
- (network-starting . "Starting network client/server...")
- (illegal-move . "Illegal move")
- (draw-offer-declined . "Your draw offer was declined")
- (could-not-find-engine . "Cannot find %s executable; check `%s'")
- (starting-engine-done . "Starting chess program '%s'...done")
- (starting-engine . "Starting chess program '%s'...")
- (chess-disable-autosave . "Disable autosaving for this game? ")
(chess-delete-autosave . "Delete the autosave file? ")
+ (chess-disable-autosave . "Disable autosaving for this game? ")
(chess-read-autosave . "There is a chess autosave file, read it? ")
- (piece-images-loaded . "Loading chess piece images...done")
- (piece-images-loading . "Loading chess piece images...")
- (redrawing-frame-done . "Redrawing chess display with different size...done")
- (redrawing-frame . "Redrawing chess display with different size...")
- (no-images . "Cannot find any piece images; check `chess-images-directory'")
- (no-images-fallback . "Could not find any suitable or properly sized chess images")
- (no-engines-found . "Could not find any chess engines to play against; install gnuchess!")
+ (clarify-piece . "Clarify piece to move by rank or file")
+ (congratulations . "Congratulations!")
+ (could-not-clarify . "Could not determine which piece to use")
+ (could-not-diff . "Could not differentiate piece")
+ (could-not-find-engine . "Cannot find %s executable; check `%s'")
+ (could-not-read-pgn . "Could not read or find a PGN game")
+ (draw-offer . "You offer a draw")
+ (draw-offer-declined . "Your draw offer was declined")
+ (editing-directly . "Now editing position directly, use S when complete...")
+ (end-of-puzzles . "Es gibt keine weiteren Puzzles in dieser Sammlung")
(engine-not-running . "The engine you were using is no longer running")
(failed-start . "Failed to start chess engine process")
- (opp-illegal . "Your opponent states your last command was illegal")
- (opp-undo-ret . "Your opponent has retracted their request to undo %d moves")
- (opp-abort-ret . "Your opponent has retracted their offer to abort")
- (opp-draw-ret . "Your opponent has retracted their draw offer")
- (opp-undo-dec . "Your request to undo %d moves was decline")
- (opp-abort-dec . "Your offer to abort was declined")
- (opp-draw-dec . "Your draw offer was declined")
- (opp-undo-acc . "Request to undo %d moves was accepted")
- (opp-abort-acc . "Your offer to abort was accepted")
- (opp-draw-acc . "Dein Remie Angebot wurde akzeptiert")
- (opp-ready-a . "Dein Anonymer Gegner ist nun bereit zu spielen")
- (opp-ready . "%s ist nun bereits zu spielen")
- (opp-undo . "Dein Gegner will %d Züge zurück nehmen, akzeptierst Du? ")
- (opp-abort . "Dein Gegner will das Spiel abbrechen, akzeptierst Du? ")
- (opp-draw . "Dein Gegner bietet ein Unentschieden an, willst Du annehmen? ")
- (opp-resigned . "Dein Gegner hat aufgegeben")
- (opp-quit . "Your opponent has quit playing")
- (want-to-play-a . "Willst Du eine Partie Schach gegen einen Anonymen Gegner spielen? ")
- (want-to-play . "Willst Du eine Partie Schach gegen %s spielen? ")
- (move-passed . "Your opponent has passed the move to you")
- (now-black . "Dein Gegner hat den ersten Zug gemacht, du bist nun Schwarz")
- (invalid-pgn . "Received invalid PGN text")
- (invalid-fen . "Received invalid FEN string: %s")
- (piece-immobile . "That piece cannot move now")
- (selected-empty . "You cannot select an empty square")
- (wrong-color . "Du kannst die Figuren deines Gegners nicht bewegen")
- (move-not-legal . "That is not a legal move")
- (cannot-mount . "You cannot move pieces on top of each other")
- (editing-directly . "Now editing position directly, use S when complete...")
- (return-to-current . "Use '>' to return to the current position")
- (draw-offer . "You offer a draw")
- (want-to-quit . "Do you really want to quit? ")
+ (game-is-over . "This game is over")
+ (ics-connected . "Verbindungsaufbau mit Internet Chess Server '%s'...done")
+ (ics-connecting . "Verbindungsaufbau mit Internet Chess Server '%s'...")
+ (ics-server-prompt . "Connect to chess server: ")
+ (illegal-move . "Illegal move")
(illegal-notation . "Illegal move notation: %s")
- (san-not-found . "Could not find a matching move")
- (cannot-yet-add . "Cannot insert moves into a game (yet)")
- (no-such-style . "There is no such chessboard display style '%s'")
- (mode-edit . "EDIT")
+ (invalid-fen . "Received invalid FEN string: %s")
+ (invalid-pgn . "Received invalid PGN text")
+ (irc-challenge . "IRC nick of user to challenge: ")
+ (irc-connecting . "Verbindungsaufbau mit IRC server '%s:%d'...")
+ (irc-logging-in . "Connected, now logging in as '%s'...")
+ (irc-waiting . "Now waiting for 'name USER' via /msg, or `M-x chess-irc-engage'")
+ (knight-1-done . "Goal: take all the pawns, without letting the queen take your knight")
+ (mode-black . "Black")
+ (mode-checkmate . "CHECKMATE")
(mode-drawn . "DRAWN")
- (mode-stalemate . "STALEMATE")
+ (mode-edit . "EDIT")
(mode-flag-fell . "FLAG FELL")
(mode-resigned . "RESIGNED")
- (mode-checkmate . "CHECKMATE")
+ (mode-stalemate . "STALEMATE")
(mode-start . "START")
- (mode-black . "Black")
(mode-white . "White")
- (game-is-over . "This game is over")
- (not-your-move . "It is not your turn to move")
- (no-such-module . "There is no module named '%s'")
- (add-to-completed . "Cannot add moves to a completed game")
- (undo-limit-reached . "Cannot undo further")
- (could-not-read-pgn . "Could not read or find a PGN game")
+ (move-from-blank . "Du versuchst eine Figur vom leeren Feld %s zu bewegen")
+ (move-not-legal . "That is not a legal move")
+ (move-passed . "Your opponent has passed the move to you")
+ (network-starting . "Starting network client/server...")
+ (network-waiting . "Now waiting for your opponent to connect...")
+ (no-candidates . "There are no candidate moves for '%s'")
+ (no-engines-found . "Could not find any chess engines to play against; install gnuchess!")
+ (no-images . "Cannot find any piece images; check `chess-images-directory'")
+ (no-images-fallback . "Could not find any suitable or properly sized chess images")
(no-such-database . "There is no such chess database module '%s'")
+ (no-such-module . "There is no module named '%s'")
+ (no-such-style . "There is no such chessboard display style '%s'")
+ (not-your-move . "It is not your turn to move")
+ (now-black . "Dein Gegner hat den ersten Zug gemacht, du bist nun Schwarz")
+ (opp-abort . "Dein Gegner will das Spiel abbrechen, akzeptierst Du? ")
+ (opp-abort-acc . "Your offer to abort was accepted")
+ (opp-abort-dec . "Your offer to abort was declined")
+ (opp-abort-ret . "Your opponent has retracted their offer to abort")
+ (opp-draw . "Dein Gegner bietet ein Unentschieden an, willst Du annehmen? ")
+ (opp-draw-acc . "Dein Remie Angebot wurde akzeptiert")
+ (opp-draw-dec . "Your draw offer was declined")
+ (opp-draw-ret . "Your opponent has retracted their draw offer")
+ (opp-illegal . "Your opponent states your last command was illegal")
+ (opp-quit . "Your opponent has quit playing")
+ (opp-ready . "%s ist nun bereits zu spielen")
+ (opp-ready-a . "Dein Anonymer Gegner ist nun bereit zu spielen")
+ (opp-resigned . "Dein Gegner hat aufgegeben")
+ (opp-undo . "Dein Gegner will %d Züge zurück nehmen, akzeptierst Du? ")
+ (opp-undo-acc . "Request to undo %d moves was accepted")
+ (opp-undo-dec . "Your request to undo %d moves was decline")
+ (opp-undo-ret . "Your opponent has retracted their request to undo %d moves")
+ (opponent-says . "Dein Gegner sagt: %s")
+ (pawn-promote-query . "Promote pawn to queen/rook/knight/bishop? ")
(pgn-parse-error . "Error parsing PGN syntax")
(pgn-read-error . "Error reading move: %s")
- (pawn-promote-query . "Promote pawn to queen/rook/knight/bishop? ")
- (no-candidates . "There are no candidate moves for '%s'")
- (could-not-diff . "Could not differentiate piece")
- (could-not-clarify . "Could not determine which piece to use")
- (clarify-piece . "Clarify piece to move by rank or file")
+ (piece-images-loaded . "Loading chess piece images...done")
+ (piece-images-loading . "Loading chess piece images...")
+ (piece-immobile . "That piece cannot move now")
(piece-unrecognized . "Unrecognized piece identifier")
- (move-from-blank . "Du versuchst eine Figur vom leeren Feld %s zu bewegen")))
+ (queen-would-take . "Die Dame würde deinen Springer schlagen!")
+ (redrawing-frame . "Redrawing chess display with different size...")
+ (redrawing-frame-done . "Redrawing chess display with different size...done")
+ (return-to-current . "Use '>' to return to the current position")
+ (san-not-found . "Could not find a matching move")
+ (selected-empty . "You cannot select an empty square")
+ (starting-engine . "Starting chess program '%s'...")
+ (starting-engine-done . "Starting chess program '%s'...done")
+ (undo-limit-reached . "Cannot undo further")
+ (want-to-play . "Willst Du eine Partie Schach gegen %s spielen? ")
+ (want-to-play-a . "Willst Du eine Partie Schach gegen einen Anonymen Gegner spielen? ")
+ (want-to-quit . "Do you really want to quit? ")
+ (wrong-color . "Du kannst die Figuren deines Gegners nicht bewegen")))
(provide 'chess-german)
diff --git a/chess-ics.el b/chess-ics.el
index 9d5c9bb..dfe9774 100644
--- a/chess-ics.el
+++ b/chess-ics.el
@@ -365,19 +365,15 @@ who is black."
(chess-game-set-tag game "White" chess-full-name)
(chess-game-set-tag game "Black" chess-engine-opponent-name))
- (cond
- ((chess-ply-keyword (car args) :resign)
- (chess-engine-send nil "resign\n"))
- (t
- (let ((move
- (if (chess-ply-any-keyword (car args)
- :castle :long-castle)
- (chess-ply-to-algebraic (car args))
- (concat (chess-index-to-coord
- (car (chess-ply-changes (car args)))) "-"
- (chess-index-to-coord
- (cadr (chess-ply-changes (car args))))))))
- (chess-engine-send nil (concat move "\n")))))
+ (let ((move
+ (if (chess-ply-any-keyword (car args)
+ :castle :long-castle)
+ (chess-ply-to-algebraic (car args))
+ (concat (chess-index-to-coord
+ (car (chess-ply-changes (car args)))) "-"
+ (chess-index-to-coord
+ (cadr (chess-ply-changes (car args))))))))
+ (chess-engine-send nil (concat move "\n")))
(if (chess-game-over-p game)
(chess-game-set-data game 'active nil)))
diff --git a/chess-ics1.el b/chess-ics1.el
index 6b2aa9c..b95cfd4 100644
--- a/chess-ics1.el
+++ b/chess-ics1.el
@@ -46,8 +46,7 @@
((eq event 'initialize) t)
((eq event 'popup)
- (if chess-display-popup
- (funcall chess-ics1-popup-function)))
+ (funcall chess-ics1-popup-function))
((eq event 'draw)
(apply 'chess-ics1-draw args))
diff --git a/chess-images.el b/chess-images.el
index fa01def..58ddcd4 100644
--- a/chess-images.el
+++ b/chess-images.el
@@ -172,8 +172,7 @@ called."
(chess-message 'no-images-fallback)))))
((eq event 'popup)
- (if chess-display-popup
- (funcall chess-images-popup-function)))
+ (funcall chess-images-popup-function))
((eq event 'draw)
(apply 'chess-images-draw args))
diff --git a/chess-network.el b/chess-network.el
index 7fdb2c1..18f1c58 100644
--- a/chess-network.el
+++ b/chess-network.el
@@ -92,7 +92,7 @@
(chess-message-catalog 'english
'((network-starting . "Starting network client/server...")
(network-waiting . "Now waiting for your opponent to connect...")
- (network-connected ."You have connected; pass now or make your move.")))
+ (takeback-sent . "Sent request to undo %d ply(s) to your opponent")))
(defun chess-network-flatten-multiline (str)
(while (string-match "\n" str)
@@ -104,6 +104,9 @@
(setq str (replace-match "\n" t t str)))
str)
+(defvar chess-network-kind)
+(make-variable-buffer-local 'chess-network-kind)
+
(defun chess-network-handler (game event &rest args)
"Initialize the network chess engine."
(unless chess-engine-handling-event
@@ -124,14 +127,14 @@
(open-network-stream "*chess-network*" (current-buffer)
(read-string "Host: ")
(read-string "Port: "))))
- (if (eq which ?s)
- (chess-message 'network-waiting)
- (chess-network-handler game 'match)
- (chess-message 'network-connected))
+ (setq chess-network-kind (if (eq which ?s) 'server 'client))
t))
((eq event 'ready) ; don't set active yet
- (chess-game-run-hooks game 'announce-autosave))
+ (chess-game-run-hooks game 'announce-autosave)
+ (if (eq chess-network-kind 'server)
+ (chess-message 'network-waiting)
+ (chess-network-handler game 'match)))
((eq event 'setup-pos)
(chess-engine-send nil (format "fen %s\n"
@@ -169,10 +172,14 @@
(chess-engine-command nil 'retract))
(setq chess-engine-pending-offer 'undo
chess-engine-pending-arg (car args))
- (chess-engine-send nil (format "takeback %d\n" (car args))))
+
+ (chess-engine-send nil (format "takeback %d\n" (car args)))
+ (chess-message 'takeback-sent (car args)))
((eq event 'accept)
- (chess-engine-send nil "accept\n"))
+ (chess-engine-send nil (if (car args)
+ (format "accept %s\n" (car args))
+ "accept\n")))
((eq event 'decline)
(chess-engine-send nil "decline\n"))
diff --git a/chess-pgn.el b/chess-pgn.el
index af212c5..c720ecf 100644
--- a/chess-pgn.el
+++ b/chess-pgn.el
@@ -237,9 +237,11 @@ If INDENTED is non-nil, indent the move texts."
"\\(\\.\\.\\.\\|" chess-algebraic-regexp "\\)"
"\\(\\s-+\\(" chess-algebraic-regexp "\\)\\)?\\)"))
-(font-lock-add-keywords 'chess-pgn-mode
- (list (list "\\[\\(\\S-+\\)\\s-+\".*\"\\]" 1 'font-lock-keyword-face)
- (cons "\\(1-0\\|0-1\\|\\*\\)$" 'chess-pgn-bold-face)))
+(if (fboundp 'font-lock-add-keywords)
+ (font-lock-add-keywords
+ 'chess-pgn-mode
+ (list (list "\\[\\(\\S-+\\)\\s-+\".*\"\\]" 1 'font-lock-keyword-face)
+ (cons "\\(1-0\\|0-1\\|\\*\\)$" 'chess-pgn-bold-face))))
;;;###autoload
(add-to-list 'auto-mode-alist '("\\.pgn\\'" . chess-pgn-mode))
diff --git a/chess-plain.el b/chess-plain.el
index 084b43f..c794038 100644
--- a/chess-plain.el
+++ b/chess-plain.el
@@ -108,8 +108,7 @@ modify `chess-plain-piece-chars' to avoid real confusion.)"
((eq event 'initialize) t)
((eq event 'popup)
- (if chess-display-popup
- (funcall chess-plain-popup-function)))
+ (funcall chess-plain-popup-function))
((eq event 'draw)
(apply 'chess-plain-draw args))
diff --git a/chess-ply.el b/chess-ply.el
index a016e2e..321da83 100644
--- a/chess-ply.el
+++ b/chess-ply.el
@@ -154,7 +154,7 @@
(if long :long-castle :castle))))))
(chess-message-catalog 'english
- '((pawn-promote-query . "Promote pawn to queen/rook/knight/bishop? ")))
+ '((pawn-promote-query . "Promote to queen? ")))
(defvar chess-ply-checking-mate nil)
@@ -209,8 +209,11 @@ maneuver."
;; promote it to
(when (and (not (memq :promote changes))
(= (if color 0 7) (chess-index-rank (cadr changes))))
- (discard-input)
- (let ((new-piece (if (yes-or-no-p "Promote to queen? ")
+ ;; jww (2002-05-15): This does not always clear ALL
+ ;; input events
+ (discard-input) (sit-for 0) (discard-input)
+ (let ((new-piece (if (yes-or-no-p
+ (chess-string 'pawn-promote-query))
?Q ?N)))
(nconc changes (list :promote (upcase new-piece)))))
diff --git a/chess.el b/chess.el
index 5b735dc..d250ba3 100644
--- a/chess.el
+++ b/chess.el
@@ -186,7 +186,8 @@ available."
(when (car objects)
(mapc 'chess-display-update objects)
(chess-module-set-leader (car objects))
- (chess-display-popup (car objects)))
+ (unless disable-popup
+ (chess-display-popup (car objects))))
(nconc objects (chess-create-modules chess-default-modules
'chess-module-create game))