[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] 115/255: uniform gnugo prefix
From: |
Eric Schulte |
Subject: |
[elpa] 115/255: uniform gnugo prefix |
Date: |
Sun, 16 Mar 2014 01:02:30 +0000 |
eschulte pushed a commit to branch go
in repository elpa.
commit 64fd6d02fc83150c9b6552854cf0a841c10b8fe2
Author: Eric Schulte <address@hidden>
Date: Sun May 27 16:34:09 2012 -0600
uniform gnugo prefix
---
gnugo.el | 38 +++++++++++++++++---------------------
go-board.el | 2 +-
go-tests.el | 4 ++--
3 files changed, 20 insertions(+), 24 deletions(-)
diff --git a/gnugo.el b/gnugo.el
index a04f8c3..ab4e0f0 100644
--- a/gnugo.el
+++ b/gnugo.el
@@ -1,4 +1,4 @@
-;;; go-gnugo.el --- functions for interaction with a gnugo process using gtp
+;;; gnugo.el --- gnugo GO back-end
;; Copyright (C) 2008 2012 Eric Schulte <address@hidden>
@@ -25,53 +25,49 @@
;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
;; Boston, MA 02110-1301, USA.
-;;; Comments:
-
-;; Interaction with gnugo
-
;;; CODE:
(require 'go-util)
(require 'gtp)
(require 'comint)
-(defun go-gnugo-gtp-commands ()
+(defun gnugo-gtp-commands ()
"Return a list of the gnugo GTP commands."
(split-string
(substring
(shell-command-to-string
- (format "echo list_commands | %s --mode gtp" go-gnugo-program))
+ (format "echo list_commands | %s --mode gtp" gnugo-program))
2 -2) "\n"))
-(defvar go-gnugo-program "gnugo"
+(defvar gnugo-program "gnugo"
"path to gnugo executable")
-(defvar go-gnugo-process-name "gnugo"
+(defvar gnugo-process-name "gnugo"
"name for the gnugo process")
-(defun go-gnugo-start-process (&rest options)
+(defun gnugo-start-process (&rest options)
(let ((buffer (apply 'make-comint
- go-gnugo-process-name
- go-gnugo-program nil
+ gnugo-process-name
+ gnugo-program nil
"--mode" "gtp" "--quiet"
options)))
(with-current-buffer buffer (comint-mode))
buffer))
-(defun go-gnugo-command-to-string (gnugo command)
+(defun gnugo-command-to-string (gnugo command)
"Send command to gnugo process and return gnugo's results as a string"
(interactive "sgnugo command: ")
- (go-gnugo-input-command gnugo command)
- (go-gnugo-last-output gnugo))
+ (gnugo-input-command gnugo command)
+ (gnugo-last-output gnugo))
-(defun go-gnugo-input-command (gnugo command)
+(defun gnugo-input-command (gnugo command)
"Pass COMMAND to the gnugo process running in the buffer of GNUGO."
(with-current-buffer (buffer gnugo)
(goto-char (process-mark (get-buffer-process (current-buffer))))
(insert command)
(comint-send-input))
- (go-gnugo-wait-for-output gnugo))
+ (gnugo-wait-for-output gnugo))
-(defun go-gnugo-wait-for-output (gnugo)
+(defun gnugo-wait-for-output (gnugo)
(with-current-buffer (buffer gnugo)
(while (progn
(goto-char comint-last-input-end)
@@ -80,7 +76,7 @@
(error (match-string 1)))
(accept-process-output (get-buffer-process (current-buffer))))))
-(defun go-gnugo-last-output (gnugo)
+(defun gnugo-last-output (gnugo)
(with-current-buffer (buffer gnugo)
(comint-show-output)
(org-babel-clean-text-properties
@@ -92,6 +88,6 @@
((buffer :initarg :buffer :accessor buffer :initform nil)))
(defmethod gtp-command ((gnugo gnugo) command)
- (go-gnugo-command-to-string gnugo command))
+ (gnugo-command-to-string gnugo command))
-(provide 'go-gnugo)
+(provide 'gnugo)
diff --git a/go-board.el b/go-board.el
index ba5b072..d0eb59c 100644
--- a/go-board.el
+++ b/go-board.el
@@ -336,7 +336,7 @@
(let ((*autoplay* t))
(go-board
(make-instance 'gnugo
- :buffer (apply #'go-gnugo-start-process
+ :buffer (apply #'gnugo-start-process
(when level
(list "--level" (number-to-string level))))))))
diff --git a/go-tests.el b/go-tests.el
index 159d9c3..d5b7bd9 100644
--- a/go-tests.el
+++ b/go-tests.el
@@ -30,7 +30,7 @@
(require 'sgf2el)
(require 'go-board)
(require 'gtp)
-(require 'go-gnugo)
+(require 'gnugo)
(require 'sgf)
(require 'ert)
@@ -168,7 +168,7 @@
(unwind-protect
(progn
(setf *gnugo* (make-instance 'gnugo))
- (setf (buffer *gnugo*) (go-gnugo-start-process))
+ (setf (buffer *gnugo*) (gnugo-start-process))
,@body)
(let ((kill-buffer-query-functions nil))
(should (kill-buffer (buffer *gnugo*)))))))
- [elpa] 126/255: sketching out passing, (continued)
- [elpa] 126/255: sketching out passing, Eric Schulte, 2014/03/15
- [elpa] 124/255: highlighting last move and added pass function, Eric Schulte, 2014/03/15
- [elpa] 123/255: working towards savings games in SGF format, Eric Schulte, 2014/03/15
- [elpa] 127/255: documentation tweaks, Eric Schulte, 2014/03/15
- [elpa] 129/255: igs message types from igs.c, Eric Schulte, 2014/03/15
- [elpa] 118/255: cleanup in go.el, Eric Schulte, 2014/03/15
- [elpa] 130/255: adding a file for tracking development notes, Eric Schulte, 2014/03/15
- [elpa] 128/255: starting to flesh out igs support, Eric Schulte, 2014/03/15
- [elpa] 119/255: test cleanup, Eric Schulte, 2014/03/15
- [elpa] 132/255: moving char-to-num and num-to-char to util, Eric Schulte, 2014/03/15
- [elpa] 115/255: uniform gnugo prefix,
Eric Schulte <=
- [elpa] 134/255: notes, Eric Schulte, 2014/03/15
- [elpa] 131/255: transitioning IGS interface to use client mode, Eric Schulte, 2014/03/15
- [elpa] 140/255: board propagates setf'd moves to trackers, Eric Schulte, 2014/03/15
- [elpa] 137/255: setf method for aget, Eric Schulte, 2014/03/15
- [elpa] 133/255: igs using a process filter for asynch processing, Eric Schulte, 2014/03/15
- [elpa] 136/255: two small fixes, Eric Schulte, 2014/03/15
- [elpa] 135/255: stubbed out API interface for go-board, Eric Schulte, 2014/03/15
- [elpa] 139/255: fixed off-by-one in igs moves & tracking last move, Eric Schulte, 2014/03/15
- [elpa] 138/255: igs can track a current game and apply moves, Eric Schulte, 2014/03/15
- [elpa] 142/255: TODO igs probably needs to periodically ping the server, Eric Schulte, 2014/03/15