summaryrefslogtreecommitdiff
path: root/chess-ics.el
diff options
context:
space:
mode:
authordickmao <dick.r.chiang@gmail.com>2018-08-27 17:00:35 -0400
committerdickmao <dick.r.chiang@gmail.com>2018-09-06 09:24:10 -0400
commit3222b53d942daa404852e5148ba9d3ebb8fe96d0 (patch)
tree37e2af6242423e57adbbc1238433f58c92ac9bd0 /chess-ics.el
parent67339d896aa65d75272b80134a8128276c8c6a0f (diff)
Pre-moves
To activate, look for Chess Display Allow Pre Moves in: M-x customize-group chess-display Tested via: make test make test24 (requires evim)
Diffstat (limited to 'chess-ics.el')
-rw-r--r--chess-ics.el11
1 files changed, 6 insertions, 5 deletions
diff --git a/chess-ics.el b/chess-ics.el
index 51ce1e0..9cc5c99 100644
--- a/chess-ics.el
+++ b/chess-ics.el
@@ -376,7 +376,7 @@ standard position). In those cases, this variable should be set to nil.")
(lambda ()
(funcall #'chess-engine-default-handler 'undo
(string-to-number (match-string 1))))))
- (cons "The game has been aborted on move [^.]+\\."
+ (cons "\\S-+ has aborted the game on move [^.]+\\."
(function
(lambda ()
(let ((chess-engine-pending-offer 'abort))
@@ -386,7 +386,7 @@ standard position). In those cases, this variable should be set to nil.")
(lambda ()
(funcall #'chess-engine-default-handler 'accept))))
(cons ;; resign announcement
- "{Game \\([0-9]+\\) (\\(\\S-+\\) vs\\. \\(\\S-+\\)) \\(\\S-+\\) resigns}"
+ "{Game \\([0-9]+\\) (\\(\\S-+\\) vs\\. \\(\\S-+\\)) \\(\\S-+\\) \\(resigns\\|forfeits by disconnection\\)}"
(function
(lambda ()
(let ((chess-engine-handling-event t)
@@ -403,9 +403,10 @@ standard position). In those cases, this variable should be set to nil.")
(cons "\\(\\S-+\\) forfeits on time}"
(function
(lambda ()
- (if (string= (match-string 1) chess-engine-opponent-name)
- (funcall #'chess-engine-default-handler 'flag-fell)
- (funcall #'chess-engine-default-handler 'call-flag t)))))
+ (let ((opponent-p (not (string= chess-ics-handle (match-string 1)))))
+ (if opponent-p
+ (funcall #'chess-engine-default-handler 'flag-fell)
+ (funcall #'chess-engine-default-handler 'call-flag t))))))
(cons "Illegal move (\\([^)]+\\))\\."
(function
(lambda ()