diff options
Diffstat (limited to 'chess-phalanx.el')
| -rw-r--r-- | chess-phalanx.el | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/chess-phalanx.el b/chess-phalanx.el index 270376d..846946e 100644 --- a/chess-phalanx.el +++ b/chess-phalanx.el @@ -28,15 +28,18 @@ (lambda () (error (match-string 1))))))) -(defun chess-phalanx-handler (event &rest args) - (cond - ((eq event 'initialize) - (let ((proc (chess-common-handler 'initialize "phalanx"))) - (process-send-string proc "nopost\n") - proc)) - - (t - (apply 'chess-common-handler event args)))) +(defun chess-phalanx-handler (game event &rest args) + (unless chess-engine-handling-event + (cond + ((eq event 'initialize) + (let ((proc (chess-common-handler game 'initialize "phalanx"))) + (when (and (processp proc) + (eq (process-status proc) 'run)) + (process-send-string proc "nopost\n") + t))) + + (t + (apply 'chess-common-handler game event args))))) (provide 'chess-phalanx) |
