summaryrefslogtreecommitdiff
path: root/chess-ics.el
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2002-04-26 08:31:16 +0000
committerJohn Wiegley <johnw@newartisans.com>2002-04-26 08:31:16 +0000
commitb6f3fae4d6f47c4098c31059a93dc6cd23cc2c74 (patch)
tree48bdea1837d93c049800713911bcda9ff24a70ca /chess-ics.el
parent6fe3209092928da896f2f5aa7e8bc648efc2e47c (diff)
bug fixes
Diffstat (limited to 'chess-ics.el')
-rw-r--r--chess-ics.el16
1 files changed, 16 insertions, 0 deletions
diff --git a/chess-ics.el b/chess-ics.el
index 1341ae1..4b9c896 100644
--- a/chess-ics.el
+++ b/chess-ics.el
@@ -83,6 +83,11 @@ The format of each entry is:
(lambda ()
(let ((chess-engine-pending-offer 'my-undo))
(funcall chess-engine-response-handler 'accept)))))
+ (cons "\\(\\S-+\\) resigns}"
+ (function
+ (lambda ()
+ (if (string= (match-string 1) chess-engine-opponent-name)
+ (funcall chess-engine-response-handler 'resign)))))
(cons "Illegal move (\\([^)]+\\))\\."
(function
(lambda ()
@@ -258,6 +263,10 @@ who is black."
(chess-game-set-data game 'my-color (if (= 1 (nth 6 info))
color
(not color)))
+ (setq chess-engine-opponent-name
+ (if (= 1 (nth 6 info))
+ (nth 3 info)
+ (nth 2 info)))
(chess-game-set-data game 'active t)
(chess-game-set-data game 'white-remaining (nth 4 info))
(chess-game-set-data game 'black-remaining (nth 5 info)))
@@ -274,6 +283,11 @@ who is black."
(buffer-substring-no-properties begin end)))
(goto-char begin)
(delete-region begin end)
+ (save-excursion
+ (while (and (forward-line -1)
+ (or (looking-at "^[ \t]*$")
+ (looking-at "^[^% \t\n\r]+%\\s-*$")))
+ (delete-region (match-beginning 0) (1+ (match-end 0)))))
;; we need to counter the forward-line in chess-engine-filter
(unless error
(forward-line -1)))
@@ -333,6 +347,8 @@ who is black."
(comint-send-string (get-buffer-process (current-buffer))
(car args)))
+ ((eq event 'set-index))
+
(t
(apply 'chess-network-handler game event args)))))