summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2002-04-11 08:13:11 +0000
committerJohn Wiegley <johnw@newartisans.com>2002-04-11 08:13:11 +0000
commit03bbcedb1ea099c772258cdfaa52bd4383abaa00 (patch)
tree37c00e1bb374c4770382a3bd654473656ae54305
parent232756b32dab6030f711b197851c9e4b9540994d (diff)
*** no comment ***
-rw-r--r--TODO54
-rw-r--r--chess-display.el16
-rw-r--r--chess-ics.el4
-rw-r--r--chess-irc.el14
4 files changed, 60 insertions, 28 deletions
diff --git a/TODO b/TODO
index 176bab0..f9d1ab8 100644
--- a/TODO
+++ b/TODO
@@ -5,37 +5,61 @@
clocks
bughouse/crazyhouse
analysis/highlight tools
- scid interaction
+ database interaction (chess-file.el, chess-scid.el)
+ full ICS interaction
+
+----------------------------------------------------------------------
+
+- Make sure chess-pos-move does full validation.
+
+- Have chess-algebraic-to-ply use chess-ply-create, since I can't
+ trust :check and :checkmate anyway.
+
+- Make sure that when chess-algebraic-to-ply is used, and then
+ chess-pos-move is used, that I don't redo all the checks. There
+ should be a way of "blessing" a ply.
- In M-x chess, if chess-images is being used, ensure that
chess-images-directory is valid, otherwise fall back on chess-ics1.
-- Turn on memory gc collection messages, and see how much of a pig
- chess.el is
-
-- Profile!
+- Only use "chess-engine-game" in chess-engine.el. All other modules
+ should call "(chess-engine-game nil)".
- Add CTCP (optional) support to chess-irc.el
-- Use server-side sockets in chess-network, if Emacs supports it
-
- In chess-fen-to-pos, syntax check incoming FEN strings
-- Support auto-saving of games to PGN, and saving them at appropriate
- points
+- Make the mode-line much more informative, with information on who is
+ playing, etc.
+
+- Add the capacity to abort/resign when there is no engine
+
+- Clean/rewrite ics.el
+
+- Make use of the my-color data in chess-game.el to ensure that I only
+ do what I should be doing
+
+----------------------------------------------------------------------
+
+- Turn on memory gc collection messages, and see how much of a pig
+ chess.el is
+
+- Profile! Make as much of chess-game/ply/pos, etc., defsubst as
+ possible.
- Create a series of generic functions and predicates, so that users
can say (chess-position OBJECT) or (chess-move OBJECT), without
needing to know the type of OBJECT.
-- Allow ASCII displays to use a separate frame
+- Change chess-display-set-... to chess-display-set, and make it use
+ the new generic functions.
-- Add the capacity to abort/resign when there is no engine
+- Use server-side sockets in chess-network, if Emacs supports it
-- Rewrite ics.el
+- Support auto-saving of games to PGN, and saving them at appropriate
+ points; this will require database interaction support
-- Make use of the my-color data in chess-game.el to ensure that I only
- do what I should be doing
+- Allow ASCII displays to use a separate frame
- In edit mode, mouse-2 and mouse-3 should provide a drop-down list of
pieces the square can be set to. Cursor movement is really not the
@@ -57,8 +81,6 @@
hook. Then, if you like the result, it call be a `set' on the
original board from the copied board.
-- Make the mode-line much more informative
-
- Resize the chess board on a window resize event, if possible.
- Have a display option that shows legal target squares whenever a
diff --git a/chess-display.el b/chess-display.el
index f62fdbb..4cbd98c 100644
--- a/chess-display.el
+++ b/chess-display.el
@@ -374,10 +374,16 @@ that is supported by most displays, and is the default mode."
:type '(repeat symbol)
:group 'chess-display)
+(defcustom chess-display-boring-events
+ '(set-data set-tags set-tag draw abort undo shutdown)
+ "Events which will not even cause a refresh of the display."
+ :type '(repeat symbol)
+ :group 'chess-display)
+
(defun chess-display-event-handler (game display event &rest args)
"This display module presents a standard chessboard.
See `chess-display-type' for the different kinds of displays."
- (unless (memq event '(set-data set-tags set-tag))
+ (unless (memq event chess-display-boring-events)
(with-current-buffer display
(cond
((eq event 'shutdown)
@@ -428,7 +434,8 @@ See `chess-display-type' for the different kinds of displays."
(define-key map [?E] 'chess-display-edit-board)
(define-key map [?F] 'chess-display-set-from-fen)
(define-key map [?I] 'chess-display-invert)
- (define-key map [?M] 'chess-display-manual-move)
+ ;;(define-key map [?M] 'chess-display-manual-move)
+ (define-key map [?M] 'chess-display-match)
(define-key map [?N] 'chess-display-abort)
(define-key map [?R] 'chess-display-resign)
(define-key map [?S] 'chess-display-shuffle)
@@ -652,6 +659,11 @@ Basically, it means we are playing, not editing or reviewing."
(chess-fischer-random-position))
(ding)))
+(defun chess-display-match (whom)
+ "Resign the current game."
+ (interactive "sWhom do you wish to play? ")
+ (chess-game-run-hooks chess-display-game 'match whom))
+
(defun chess-display-resign ()
"Resign the current game."
(interactive)
diff --git a/chess-ics.el b/chess-ics.el
index cd72142..e4d4464 100644
--- a/chess-ics.el
+++ b/chess-ics.el
@@ -178,6 +178,10 @@ who is black."
nil))
+ ((eq event 'match)
+ (setq chess-engine-pending-offer 'match)
+ (chess-engine-send nil (format "match %s\n" (car args))))
+
((eq event 'move)
(unless chess-ics-ensure-ics12
(comint-send-string (get-buffer-process (current-buffer))
diff --git a/chess-irc.el b/chess-irc.el
index cf00fd8..11cbf75 100644
--- a/chess-irc.el
+++ b/chess-irc.el
@@ -69,6 +69,10 @@
(setq chess-irc-process proc))
nil)
+ ((eq event 'match)
+ (setq chess-irc-opponent (car args))
+ (chess-network-handler 'match (car args)))
+
((eq event 'shutdown)
(chess-engine-send nil "quit")
(process-send-string chess-irc-process "QUIT :Goodbye\n")
@@ -81,16 +85,6 @@
(t
(apply 'chess-network-handler event args))))
-(defun chess-irc-challenge (nick)
- "Begin playing with another chess-irc user with the given NICK.
-NOTE: This function is meant to be called from a display buffer!"
- (interactive "sYour opponent's IRC nick: ")
- (with-current-buffer
- (cdr (assq 'chess-engine-event-handler
- (chess-game-hooks (chess-display-game nil))))
- (setq chess-irc-opponent nick)
- (chess-engine-send nil (format "chess match %s\n" chess-full-name))))
-
;; This filter translates IRC syntax into basic chess-network protocol
(defun chess-irc-filter (proc string)
(let ((buf (process-buffer proc)))