[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] 172/255: re-organized how files are loaded
From: |
Eric Schulte |
Subject: |
[elpa] 172/255: re-organized how files are loaded |
Date: |
Sun, 16 Mar 2014 01:02:42 +0000 |
eschulte pushed a commit to branch go
in repository elpa.
commit f7299ffdb859de6bd71840681494e158473f9e60
Author: Eric Schulte <address@hidden>
Date: Sat Jun 9 18:05:25 2012 -0600
re-organized how files are loaded
---
back-ends/gnugo.el | 2 +-
back-ends/gtp.el | 2 +-
back-ends/igs.el | 2 +-
back-ends/sgf.el | 2 +-
go.el => go-api.el | 20 ++------------------
go-board.el | 2 +-
go-tests.el | 7 -------
go.el | 47 +++++++++--------------------------------------
8 files changed, 16 insertions(+), 68 deletions(-)
diff --git a/back-ends/gnugo.el b/back-ends/gnugo.el
index af707d0..57e7054 100644
--- a/back-ends/gnugo.el
+++ b/back-ends/gnugo.el
@@ -26,7 +26,7 @@
;; Boston, MA 02110-1301, USA.
;;; CODE:
-(require 'go)
+(require 'go-api)
(require 'gtp)
(require 'comint)
diff --git a/back-ends/gtp.el b/back-ends/gtp.el
index 425107c..a6e1c73 100644
--- a/back-ends/gtp.el
+++ b/back-ends/gtp.el
@@ -32,7 +32,7 @@
;; The GMP command set may be implemented as an extension.
;; Code:
-(require 'go)
+(require 'go-api)
(defun gtp-expand-color (turn)
(case turn
diff --git a/back-ends/igs.el b/back-ends/igs.el
index 0668078..6078fa9 100644
--- a/back-ends/igs.el
+++ b/back-ends/igs.el
@@ -30,7 +30,7 @@
;; http://www.pandanet.co.jp/English/commands/term/Summary.html
;; Code:
-(require 'go)
+(require 'go-api)
(defvar igs-telnet-command "telnet"
"Telnet command used by igs.")
diff --git a/back-ends/sgf.el b/back-ends/sgf.el
index 0acac5d..265860d 100644
--- a/back-ends/sgf.el
+++ b/back-ends/sgf.el
@@ -30,7 +30,7 @@
;; This file implements an `go-trans' interface into an SGF file.
;; Code:
-(require 'go)
+(require 'go-api)
(defun sgf-nthcdr (sgf index)
(let ((part sgf))
diff --git a/go.el b/go-api.el
similarity index 81%
copy from go.el
copy to go-api.el
index 42ac954..4f213c8 100644
--- a/go.el
+++ b/go-api.el
@@ -1,4 +1,4 @@
-;;; go.el --- Play GO, translate and transfer between GO back ends
+;;; go-api.el --- a uniform API for communication between GO back-ends
;; Copyright (C) 2012 Eric Schulte <address@hidden>
@@ -39,9 +39,6 @@
(require 'go-util)
(require 'eieio)
-(declare-function go-board "go-board" (back-end &rest trackers))
-(declare-function gnugo-start-process "gnugo.el" (&rest options))
-
(put 'unsupported-back-end-command
'error-conditions
'(error unsupported-back-end-command))
@@ -57,19 +54,6 @@
(defgeneric ,set-name (back-end new))
(defsetf ,name ,set-name))))
-(defun play-go (&optional level)
- "Play a game of GO against gnugo.
-Optional argument LEVEL specifies gnugo's level of play."
- (interactive "P")
- (with-current-buffer
- (go-board
- (make-instance 'gnugo
- :buffer (apply #'gnugo-start-process
- (when level
- (list "--level" (number-to-string level)))))
- (make-instance 'sgf))
- (setq *autoplay* t)))
-
;; setf'able back-end access
(defgeneric-w-setf go-size "Access BACK-END size.")
(defgeneric-w-setf go-name "Access BACK-END name.")
@@ -88,4 +72,4 @@ Optional argument LEVEL specifies gnugo's level of play."
(defgeneric go-reset (back-end) "Send reset to BACK-END.")
(defgeneric go-quit (back-end) "Quit the BACK-END.")
-(provide 'go)
+(provide 'go-api)
diff --git a/go-board.el b/go-board.el
index 515552f..34b071e 100644
--- a/go-board.el
+++ b/go-board.el
@@ -26,7 +26,7 @@
;; Boston, MA 02110-1301, USA.
;;; Code:
-(require 'go)
+(require 'go-api)
(require 'go-board-faces)
(defvar *history* nil "Holds the board history for a GO buffer.")
diff --git a/go-tests.el b/go-tests.el
index dbff230..076fd49 100644
--- a/go-tests.el
+++ b/go-tests.el
@@ -28,13 +28,6 @@
;;; Code:
(require 'ert)
(require 'go)
-(require 'go-board)
-(require 'go-board-faces)
-(require 'gtp)
-(require 'gnugo)
-(require 'sgf)
-(require 'sgf2el)
-(require 'igs)
;;; sgf2el tests
diff --git a/go.el b/go.el
index 42ac954..5980172 100644
--- a/go.el
+++ b/go.el
@@ -36,26 +36,15 @@
;; - TODO: the IGS protocol
;;; Code:
-(require 'go-util)
-(require 'eieio)
-
-(declare-function go-board "go-board" (back-end &rest trackers))
-(declare-function gnugo-start-process "gnugo.el" (&rest options))
-
-(put 'unsupported-back-end-command
- 'error-conditions
- '(error unsupported-back-end-command))
-
-(defmacro ignoring-unsupported (&rest body)
- `(condition-case err ,@body
- (unsupported-back-end-command nil)))
-
-(defmacro defgeneric-w-setf (name doc)
- (let ((set-name (intern (concat "set-" (symbol-name name)))))
- `(progn
- (defgeneric ,name (back-end) ,doc)
- (defgeneric ,set-name (back-end new))
- (defsetf ,name ,set-name))))
+(require 'go-util "go-util.el")
+(require 'go-api "go-api.el")
+(require 'go-board "go-board.el")
+(require 'go-board-faces "go-board-faces.el")
+(require 'gtp "back-ends/gtp.el")
+(require 'gnugo "back-ends/gnugo.el")
+(require 'sgf "back-ends/sgf.el")
+(require 'sgf2el "back-ends/sgf2el.el")
+(require 'igs "back-ends/igs.el")
(defun play-go (&optional level)
"Play a game of GO against gnugo.
@@ -70,22 +59,4 @@ Optional argument LEVEL specifies gnugo's level of play."
(make-instance 'sgf))
(setq *autoplay* t)))
-;; setf'able back-end access
-(defgeneric-w-setf go-size "Access BACK-END size.")
-(defgeneric-w-setf go-name "Access BACK-END name.")
-(defgeneric-w-setf go-move "Access current BACK-END move.")
-(defgeneric-w-setf go-labels "Access current BACK-END labels.")
-(defgeneric-w-setf go-comment "Access current BACK-END comment.")
-(defgeneric-w-setf go-alt "Access current BACK-END alternative move.")
-(defgeneric-w-setf go-color "Access current BACK-END turn color.")
-(defgeneric-w-setf go-player-name "Access current BACK-END player name.")
-(defgeneric-w-setf go-player-time "Access current BACK-END player time.")
-
-;; sending messages to the back-end
-(defgeneric go-undo (back-end) "Send undo to BACK-END.")
-(defgeneric go-pass (back-end) "Send pass to BACK-END.")
-(defgeneric go-resign (back-end) "Send resign to BACK-END.")
-(defgeneric go-reset (back-end) "Send reset to BACK-END.")
-(defgeneric go-quit (back-end) "Quit the BACK-END.")
-
(provide 'go)
- [elpa] 166/255: board images working with backgrounds, (continued)
- [elpa] 166/255: board images working with backgrounds, Eric Schulte, 2014/03/15
- [elpa] 173/255: start gnugo process when object is created, Eric Schulte, 2014/03/15
- [elpa] 167/255: cleanup images in board faces, Eric Schulte, 2014/03/15
- [elpa] 170/255: fix spacing of labels when using image for display, Eric Schulte, 2014/03/15
- [elpa] 174/255: quit the main back-end as well, Eric Schulte, 2014/03/15
- [elpa] 160/255: removing stones/ directory, Eric Schulte, 2014/03/15
- [elpa] 175/255: support for playing different types of games, Eric Schulte, 2014/03/15
- [elpa] 157/255: images of stones, Eric Schulte, 2014/03/15
- [elpa] 177/255: future tasks, Eric Schulte, 2014/03/15
- [elpa] 182/255: reverse order of sizes, Eric Schulte, 2014/03/15
- [elpa] 172/255: re-organized how files are loaded,
Eric Schulte <=
- [elpa] 156/255: chunking responses from IGS server into full lines, Eric Schulte, 2014/03/15
- [elpa] 183/255: explicit connection method for back-end objects, Eric Schulte, 2014/03/15
- [elpa] 179/255: track and display prisoners, Eric Schulte, 2014/03/15
- [elpa] 184/255: safer and automatic quitting, Eric Schulte, 2014/03/15
- [elpa] 186/255: better interactive debugging, Eric Schulte, 2014/03/15
- [elpa] 191/255: don't throw error when backend passes, Eric Schulte, 2014/03/15
- [elpa] 185/255: remove dependencies on org-mode functions, Eric Schulte, 2014/03/15
- [elpa] 176/255: task managment, Eric Schulte, 2014/03/15
- [elpa] 178/255: process igs "tell" messages, Eric Schulte, 2014/03/15
- [elpa] 181/255: NOTES #+option, Eric Schulte, 2014/03/15