diff options
| author | John Wiegley <johnw@newartisans.com> | 2002-04-08 08:33:32 +0000 |
|---|---|---|
| committer | John Wiegley <johnw@newartisans.com> | 2002-04-08 08:33:32 +0000 |
| commit | 110d1880915bf26b13a8309419a67bf272b34d4d (patch) | |
| tree | 8f5febc9dbbe7c84f0a8b1e13eb463f47a3a33cf | |
| parent | b0714ff514de8db1c49d48f18b7a8d25e9cf9200 (diff) | |
*** no comment ***
| -rw-r--r-- | TODO | 2 | ||||
| -rw-r--r-- | chess-engine.el | 5 | ||||
| -rw-r--r-- | chess-network.el | 6 |
3 files changed, 11 insertions, 2 deletions
@@ -14,6 +14,8 @@ - Resize ascii windows after popup, so that the whole board is minimally visible +- Need a way to resign, request a draw, etc. + ---------------------------------------------------------------------- - Port image display code to XEmacs diff --git a/chess-engine.el b/chess-engine.el index 4b6fc4c..eb61b17 100644 --- a/chess-engine.el +++ b/chess-engine.el @@ -143,7 +143,10 @@ (defun chess-engine-send (engine string) (chess-with-current-buffer engine - (process-send-string (get-buffer-process (current-buffer)) string))) + (let ((proc (get-buffer-process (current-buffer)))) + (if (and proc (memq (process-status proc) '(run open))) + (process-send-string proc string) + (error "The engine you are using is no longer running"))))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; diff --git a/chess-network.el b/chess-network.el index 5127055..6ef4126 100644 --- a/chess-network.el +++ b/chess-network.el @@ -31,7 +31,11 @@ (let* ((position (chess-fen-to-pos (match-string 1))) (ply (chess-ply-create position))) (chess-game-set-plies (chess-engine-game nil) - (list ply)))))))) + (list ply)))))) + (cons "QUIT" + (function + (lambda () + (message "Your opponent has quit playing")))))) (defun chess-network-perform-move () (let ((position (chess-engine-position nil)) |
