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

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

[elpa] 02/02: [gnugo] Fix bug: Don't mi suse SGF prop ‘:EV’ for "resign"


From: Thien-Thi Nguyen
Subject: [elpa] 02/02: [gnugo] Fix bug: Don't mi suse SGF prop ‘:EV’ for "resign" state.
Date: Wed, 19 Mar 2014 14:28:01 +0000

ttn pushed a commit to branch master
in repository elpa.

commit fceb8422d76e772889f160353d7fd2c35dfa4a6f
Author: Thien-Thi Nguyen <address@hidden>
Date:   Wed Mar 19 15:31:57 2014 +0100

    [gnugo] Fix bug: Don't misuse SGF prop ‘:EV’ for "resign" state.
    
    * packages/gnugo/gnugo.el (gnugo-push-move): ...here.
    (gnugo-display-final-score): Detect resignation
    via ‘gnugo-move-history’; use ‘:last-mover’ directly.
---
 packages/gnugo/NEWS     |    1 +
 packages/gnugo/gnugo.el |    8 ++------
 2 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/packages/gnugo/NEWS b/packages/gnugo/NEWS
index f891f09..0726540 100644
--- a/packages/gnugo/NEWS
+++ b/packages/gnugo/NEWS
@@ -13,6 +13,7 @@ Hint: (highlight-phrase 
"[0-9][.][0-9][.][0-9]+\\|[0-9]+[.][.][0-9]+"
     - don't special-case property value type ‘none’
     - handle subtrees on write
     - display "resign" as "resign" in move history (amazing!)
+    - avoid clobbering SGF property ‘EV’ on resignation
   - new keybinding for ‘gnugo-undo-one-move’: M-u
   - ‘gnugo-undo-one-move’ can optionally switch colors
   - ‘gnugo-move-history’ returns last two moves w/ RSEL ‘two’
diff --git a/packages/gnugo/gnugo.el b/packages/gnugo/gnugo.el
index c60df4b..f52bf37 100644
--- a/packages/gnugo/gnugo.el
+++ b/packages/gnugo/gnugo.el
@@ -783,8 +783,6 @@ For all other values of RSEL, do nothing and return nil."
     (when userp
       (gnugo-put :last-user-bpos (and (not passp) (not resignp) move)))
     (gnugo-note (if (gnugo--blackp color) :B :W) move (not resignp))
-    (when resignp
-      (gnugo-note :EV "resignation"))
     (when start
       (gnugo-put :last-waiting (cadr (time-subtract now start))))
     (when donep
@@ -1490,10 +1488,8 @@ Also, add the `:RE' SGF property to the root node of the 
game tree."
       (sit-for 3)))
   (let ((b=  "   Black = ")
         (w=  "   White = ")
-        (res (let* ((node (car (aref (gnugo-get :monkey) 0)))
-                    (event (and node (cdr (assq :EV node)))))
-               (and event (string= "resignation" event)
-                    (if (assq :B node) "black" "white"))))
+        (res (when (string= "resign" (gnugo-move-history 'car))
+               (gnugo-get :last-mover)))
         blurb result)
     (if res
         (setq blurb (list



reply via email to

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