summaryrefslogtreecommitdiff
path: root/chess-crafty.el
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2002-03-02 04:20:59 +0000
committerJohn Wiegley <johnw@newartisans.com>2002-03-02 04:20:59 +0000
commit4cd80196667e882dbff4be03c15292417c142aaa (patch)
tree30610d7e3e1357b1116612b2d9a7a680d2b01a45 /chess-crafty.el
parent78bc42be23ca642af88dcedc347169ae1ca17b9b (diff)
Fix to chess engine support.
Diffstat (limited to 'chess-crafty.el')
-rw-r--r--chess-crafty.el37
1 files changed, 17 insertions, 20 deletions
diff --git a/chess-crafty.el b/chess-crafty.el
index 06b5451..d15be54 100644
--- a/chess-crafty.el
+++ b/chess-crafty.el
@@ -10,7 +10,8 @@
"Interface code for playing against crafty. Uses `chess-process'."
:group 'chess)
-(defcustom chess-crafty-command "crafty"
+(defcustom chess-crafty-command (and (require 'executable)
+ (executable-find "crafty"))
"The name of the crafty program."
:type 'string
:group 'chess-crafty)
@@ -22,25 +23,21 @@
(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"))
+ (chess-process session buffer event chess-process-triggers
+ 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)