diff options
| -rw-r--r-- | chess-crafty.el | 15 | ||||
| -rw-r--r-- | chess-gnuchess.el | 13 | ||||
| -rw-r--r-- | chess-network.el | 2 | ||||
| -rw-r--r-- | chess.el | 8 |
4 files changed, 31 insertions, 7 deletions
diff --git a/chess-crafty.el b/chess-crafty.el index 0bdc782..50b4dc0 100644 --- a/chess-crafty.el +++ b/chess-crafty.el @@ -8,6 +8,16 @@ (require 'chess-fen) (require 'chess-algebraic) +(defgroup chess-crafty nil + "The publically available chess engine 'crafty'." + :group 'chess-engine) + +(defcustom chess-crafty-path (or (executable-find "crafty") + (executable-find "wcrafty")) + "The path to the crafty executable." + :type 'file + :group 'chess-crafty) + (defvar chess-crafty-now-moving nil) (defvar chess-crafty-regexp-alist @@ -37,9 +47,10 @@ ((eq event 'initialize) (let (proc) (message "Starting chess program 'crafty'...") + (unless chess-crafty-path + (error "Cannot find crafty executable; check `chess-crafty-path'")) (setq proc (start-process "chess-process" (current-buffer) - (or (executable-find "crafty") - (executable-find "wcrafty")))) + chess-crafty-path)) (message "Starting chess program 'crafty'...done") (process-send-string proc (concat "display nogeneral\n" "display nochanges\n" diff --git a/chess-gnuchess.el b/chess-gnuchess.el index ba6e603..48803ea 100644 --- a/chess-gnuchess.el +++ b/chess-gnuchess.el @@ -8,6 +8,15 @@ (require 'chess-fen) (require 'chess-algebraic) +(defgroup chess-gnuchess nil + "The publically available chess engine 'gnuchess'." + :group 'chess-engine) + +(defcustom chess-gnuchess-path (executable-find "gnuchess") + "The path to the gnuchess executable." + :type 'file + :group 'chess-gnuchess) + (defvar chess-gnuchess-now-moving nil) (defvar chess-gnuchess-temp-files nil) (make-variable-buffer-local 'chess-gnuchess-temp-files) @@ -33,8 +42,10 @@ ((eq event 'initialize) (let (proc) (message "Starting chess program 'gnuchess'...") + (unless chess-gnuchess-path + (error "Cannot find gnuchess executable; check `chess-gnuchess-path'")) (setq proc (start-process "chess-process" (current-buffer) - (executable-find "gnuchess"))) + chess-gnuchess-path)) (message "Starting chess program 'gnuchess'...done") (process-send-string proc "nopost\n") proc)) diff --git a/chess-network.el b/chess-network.el index f2dedb2..5127055 100644 --- a/chess-network.el +++ b/chess-network.el @@ -49,7 +49,7 @@ "Initialize the network chess engine." (cond ((eq event 'initialize) - (let ((which (read-char "cAre you the c)lient or s)erver? ")) + (let ((which (read-char "Are you the c)lient or s)erver? ")) proc) (message "Starting network client/server...") (setq proc (if (eq which ?s) @@ -107,10 +107,12 @@ a0 243 (chess-display-create chess-default-display t) game) (let ((engine-module (if arg - (intern-soft (read-string "Engine module to play against: ")) + (intern (or (read-string "Engine module to play against: ") + "chess-none")) chess-default-engine))) - (require engine-module) - (chess-engine-set-game (chess-engine-create engine-module) game)))) + (when engine-module + (require engine-module) + (chess-engine-set-game (chess-engine-create engine-module) game))))) (cons display engine))) ;;;###autoload |
