summaryrefslogtreecommitdiff
path: root/chess-crafty.el
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2002-03-01 08:08:28 +0000
committerJohn Wiegley <johnw@newartisans.com>2002-03-01 08:08:28 +0000
commit059e5edba1175504698637f734eb5bf975b299fa (patch)
tree95e6f08169d73d1ce763ae90945204783c0132eb /chess-crafty.el
parentf115e4627966ae900aef55cb10f9e6207dbe7adf (diff)
Playing against crafty now works.
Diffstat (limited to 'chess-crafty.el')
-rw-r--r--chess-crafty.el38
1 files changed, 25 insertions, 13 deletions
diff --git a/chess-crafty.el b/chess-crafty.el
index 51ca30a..06b5451 100644
--- a/chess-crafty.el
+++ b/chess-crafty.el
@@ -15,21 +15,33 @@
:type 'string
:group 'chess-crafty)
-;;;###autoload
-(defun chess-crafty (game)
- (chess-process game 'chess-crafty-handler nil
- (if (file-name-absolute-p chess-crafty-command)
- chess-crafty-command
- (executable-find chess-crafty-command))))
-
;;; Code:
-(defun chess-crafty-handler (game buffer command &rest args)
- (unless (apply 'chess-process-handler game buffer command args)
- (ignore
- (if (eq command 'initialize)
- (process-send-string (get-buffer-process buffer)
- "alarm off\nansi off\n")))))
+;;;###autoload
+(defun chess-crafty (session buffer event &rest args)
+ (if (not (eq event 'initialize))
+ (apply 'chess-process session buffer event args)
+ (with-current-buffer
+ (chess-process session buffer event
+ chess-process-triggers
+ (if (file-name-absolute-p chess-crafty-command)
+ chess-crafty-command
+ (executable-find chess-crafty-command)))
+ (process-send-string
+ (get-buffer-process (current-buffer))
+ (concat "display nogeneral\n"
+ "display nochanges\n"
+ "display noextstats\n"
+ "display nohashstats\n"
+ "display nomoves\n"
+ "display nonodes\n"
+ "display noply1\n"
+ "display nostats\n"
+ "display notime\n"
+ "display novariation\n"
+ "alarm off\n"
+ "ansi off\n"))
+ (current-buffer))))
(provide 'chess-crafty)