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

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

[elpa] 01/02: [gnugo] Fix bug: On load, follow mainline through subtrees


From: Thien-Thi Nguyen
Subject: [elpa] 01/02: [gnugo] Fix bug: On load, follow mainline through subtrees.
Date: Thu, 20 Mar 2014 16:24:50 +0000

ttn pushed a commit to branch master
in repository elpa.

commit a82c75c2ba6cdc5daaecee2ce5fcd1d1bbd21bad
Author: Thien-Thi Nguyen <address@hidden>
Date:   Thu Mar 20 15:29:35 2014 +0100

    [gnugo] Fix bug: On load, follow mainline through subtrees.
    
    * packages/gnugo/gnugo.el (gnugo-read-sgf-file):
    For move count loop, don't stop at first subtree;
    instead, recognize its non-nodeness and recurse into it.
---
 packages/gnugo/NEWS     |    1 +
 packages/gnugo/gnugo.el |    5 +++++
 2 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/packages/gnugo/NEWS b/packages/gnugo/NEWS
index 37a9d19..38220a7 100644
--- a/packages/gnugo/NEWS
+++ b/packages/gnugo/NEWS
@@ -14,6 +14,7 @@ Hint: (highlight-phrase 
"[0-9][.][0-9][.][0-9]+\\|[0-9]+[.][.][0-9]+"
     - handle subtrees on write
     - display "resign" as "resign" in move history (amazing!)
     - avoid clobbering SGF property ‘EV’ on resignation
+    - follow main line in subtrees on read
   - new keybinding for ‘gnugo-undo-one-move’: M-u
   - ‘gnugo-undo-one-move’ can optionally arrange for you to play next
   - ‘gnugo-move-history’ returns last two moves w/ RSEL ‘two’
diff --git a/packages/gnugo/gnugo.el b/packages/gnugo/gnugo.el
index f52bf37..053d8aa 100644
--- a/packages/gnugo/gnugo.el
+++ b/packages/gnugo/gnugo.el
@@ -1340,6 +1340,11 @@ If FILENAME already exists, Emacs confirms that you wish 
to overwrite it."
            (count 0)
            mem node play game-over)
       (while (setq node (car loc))
+        ;; A gametree must have at least one node prior to the first
+        ;; sub-gametree (if any), so we need check the CAR only once.
+        (unless (symbolp (caar node))
+          (setq loc node
+                node (car loc)))
         (when (setq play (or (assq :B node)
                              (assq :W node)))
           ;; SGF[4] allows "" to mean PASS.  For now,



reply via email to

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