summaryrefslogtreecommitdiff
path: root/chess-engine.el
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2002-04-15 00:58:29 +0000
committerJohn Wiegley <johnw@newartisans.com>2002-04-15 00:58:29 +0000
commit7365cd3c961dece991bc67017afcc917359be69a (patch)
treef8ad41f8fc7d508a6c3b2324a184b91b0bdea65c /chess-engine.el
parente15c5ad70e32debce094a3c53caf875afb648338 (diff)
*** no comment ***
Diffstat (limited to 'chess-engine.el')
-rw-r--r--chess-engine.el33
1 files changed, 17 insertions, 16 deletions
diff --git a/chess-engine.el b/chess-engine.el
index d0a9951..4d9613b 100644
--- a/chess-engine.el
+++ b/chess-engine.el
@@ -144,14 +144,14 @@
((eq event 'setup-game)
(when (car args)
;; we don't want the `setup-game' event coming back to us
- (let ((chess-engine-handling-event t))
- (let ((chess-game-inhibit-events t))
- (chess-engine-set-game nil (car args))
- (chess-game-set-data chess-engine-game 'active t)
- (if (string= chess-full-name
- (chess-game-tag chess-engine-game "White"))
- (chess-game-set-data chess-engine-game 'my-color t)
- (chess-game-set-data chess-engine-game 'my-color nil))))
+ (let ((chess-engine-handling-event t)
+ (chess-game-inhibit-events t))
+ (chess-engine-set-game nil (car args))
+ (chess-game-set-data chess-engine-game 'active t)
+ (if (string= chess-full-name
+ (chess-game-tag chess-engine-game "White"))
+ (chess-game-set-data chess-engine-game 'my-color t)
+ (chess-game-set-data chess-engine-game 'my-color nil)))
t))
((eq event 'quit)
@@ -406,15 +406,16 @@
(defun chess-engine-event-handler (game engine event &rest args)
"Handle any commands being sent to this instance of this module."
(unless chess-engine-handling-event
- (chess-with-current-buffer engine
- (apply chess-engine-event-handler event args))
-
- (cond
- ((eq event 'shutdown)
- (chess-engine-destroy engine))
+ (let (result)
+ (chess-with-current-buffer engine
+ (setq result (apply chess-engine-event-handler event args)))
+ (cond
+ ((eq event 'shutdown)
+ (chess-engine-destroy engine))
- ((eq event 'destroy)
- (chess-engine-detach-game engine)))))
+ ((eq event 'destroy)
+ (chess-engine-detach-game engine)))
+ result)))
(defun chess-engine-sentinal (proc event)
(when (buffer-live-p (process-buffer proc))