eschulte pushed a commit to branch go
in repository elpa.

commit ff15acfccafd868cff835b179d1b5d2ae72b131b
Author: Eric Schulte <[email protected]>
Date:   Tue May 21 10:08:44 2013 -0600

    added interface function to view an SGF file
---
 go.el |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/go.el b/go.el
index 974f2b6..c63757c 100644
--- a/go.el
+++ b/go.el
@@ -71,4 +71,12 @@
       (unless (equal (class-of back-end) 'sgf)
         (setq *autoplay* t)))))
 
+(defun view-sgf (&optional file)
+  "View an SGF file."
+  (interactive "fSGF file: ")
+  (let* ((sgf (make-instance 'sgf :self (sgf2el-file-to-el file) :index '(0)))
+         (buffer (go-board sgf)))
+    (with-current-buffer buffer
+      (setf (index *back-end*) (list 0)))))
+
 (provide 'go)

Reply via email to