summaryrefslogtreecommitdiff
path: root/chess-engine.el
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2002-04-09 01:11:49 +0000
committerJohn Wiegley <johnw@newartisans.com>2002-04-09 01:11:49 +0000
commita62a682bc83a3146899865d226552d47ce77648d (patch)
treef757484e29a2b0dc6e5dc6a982605fc52dc68d41 /chess-engine.el
parent857af45023d64bf66c6c62a3054df240ff64e292 (diff)
added an IRC bot engine
Diffstat (limited to 'chess-engine.el')
-rw-r--r--chess-engine.el7
1 files changed, 5 insertions, 2 deletions
diff --git a/chess-engine.el b/chess-engine.el
index 1f4c9c9..ad163c0 100644
--- a/chess-engine.el
+++ b/chess-engine.el
@@ -26,9 +26,11 @@
(make-variable-buffer-local 'chess-engine-position)
(make-variable-buffer-local 'chess-engine-game)
+(defvar chess-engine-process nil)
(defvar chess-engine-last-pos nil)
(defvar chess-engine-working nil)
+(make-variable-buffer-local 'chess-engine-process)
(make-variable-buffer-local 'chess-engine-last-pos)
(make-variable-buffer-local 'chess-engine-working)
@@ -84,6 +86,7 @@
(when (processp proc)
(unless (memq (process-status proc) '(run open))
(error "Failed to start chess engine process"))
+ (setq chess-engine-process proc)
(set-process-buffer proc (current-buffer))
(set-process-filter proc 'chess-engine-filter))
(setq chess-engine-current-marker (point-marker)))
@@ -160,7 +163,7 @@
(defun chess-engine-send (engine string)
"Send the given STRING to ENGINE."
(chess-with-current-buffer engine
- (let ((proc (get-buffer-process (current-buffer))))
+ (let ((proc chess-engine-process))
(if proc
(if (memq (process-status proc) '(run open))
(process-send-string proc string)
@@ -170,7 +173,7 @@
(defun chess-engine-submit (engine string)
"Submit the given STRING, so ENGINE sees it in its input stream."
(chess-with-current-buffer engine
- (let ((proc (get-buffer-process (current-buffer))))
+ (let ((proc chess-engine-process))
(if (and (processp proc)
(not (memq (process-status proc) '(run open))))
(error "The engine you were using is no longer running"))