emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] 01/01: [gnugo int] Decruft: Streamline game-over handling on SGF


From: Thien-Thi Nguyen
Subject: [elpa] 01/01: [gnugo int] Decruft: Streamline game-over handling on SGF load.
Date: Thu, 17 Apr 2014 10:26:41 +0000

ttn pushed a commit to branch master
in repository elpa.

commit 48fa6220a8eb1873546693fac226c33df83598f9
Author: Thien-Thi Nguyen <address@hidden>
Date:   Thu Apr 17 11:47:45 2014 +0200

    [gnugo int] Decruft: Streamline game-over handling on SGF load.
    
    * packages/gnugo/gnugo.el (gnugo-read-sgf-file):
    Don't bother w/ :game-over here; leave it to ‘gnugo-close-game’.
---
 packages/gnugo/gnugo.el |   17 ++++++-----------
 1 files changed, 6 insertions(+), 11 deletions(-)

diff --git a/packages/gnugo/gnugo.el b/packages/gnugo/gnugo.el
index 559f71f..14969c7 100644
--- a/packages/gnugo/gnugo.el
+++ b/packages/gnugo/gnugo.el
@@ -1865,7 +1865,7 @@ If FILENAME already exists, Emacs confirms that you wish 
to overwrite it."
   (interactive "fSGF file to load: ")
   (when (file-directory-p filename)
     (user-error "Cannot load a directory (try a filename with extension 
.sgf)"))
-  (let (ans play wait samep coll tree)
+  (let (ans play wait samep coll tree game-over)
     ;; problem: requiring GTP `loadsgf' complicates network subproc support;
     ;; todo: skip it altogether when confident about `gnugo/sgf-create'
     (unless (= ?= (aref (setq ans (gnugo--q "loadsgf %s"
@@ -1898,16 +1898,11 @@ If FILENAME already exists, Emacs confirms that you 
wish to overwrite it."
                        0)))
     ;; This is deliberately undocumented for now.
     (gnugo--SZ! (gnugo--root-prop :SZ tree))
-    (let (game-over)
-      (gnugo-put :game-over
-        (setq game-over
-              (or (gnugo--root-prop :RE tree)
-                  (and (equal '("PASS" "PASS") (gnugo-move-history 'two))
-                       'two-passes))))
-      (when (and game-over
-                 ;; (maybe) todo: user var to inhibit (can be slow)
-                 t)
-        (gnugo-close-game nil game-over)))
+    (when (setq game-over (or (gnugo--root-prop :RE tree)
+                              (when (equal '("PASS" "PASS")
+                                           (gnugo-move-history 'two))
+                                'two-passes)))
+      (gnugo-close-game nil game-over))
     (gnugo-refresh t)
     (set-buffer-modified-p nil)
     (gnugo--who-is-who wait play samep)))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]