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

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

[elpa] master a8d009f 6/6: [gnugo] Make ‘C-u F’ store additional SGF pr


From: Thien-Thi Nguyen
Subject: [elpa] master a8d009f 6/6: [gnugo] Make ‘C-u F’ store additional SGF properties.
Date: Tue, 14 Feb 2017 12:28:40 -0500 (EST)

branch: master
commit a8d009f1cfe70d363d603f4c43c811a22e4b9393
Author: Thien-Thi Nguyen <address@hidden>
Commit: Thien-Thi Nguyen <address@hidden>

    [gnugo] Make ‘C-u F’ store additional SGF properties.
    
    * packages/gnugo/gnugo.el (gnugo-display-final-score):
    When invoked w/ prefix arg, store also in last node, the SGF
    properties ‘TB’, ‘TW’, ‘MA’ and ‘DD’ with respective values,
    each a list of points, for black territory, white territory,
    seki stones, and dead stones.  However, if a particular list
    is empty, delete that property from the node.
---
 packages/gnugo/gnugo.el | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/packages/gnugo/gnugo.el b/packages/gnugo/gnugo.el
index 1583228..59e14a4 100644
--- a/packages/gnugo/gnugo.el
+++ b/packages/gnugo/gnugo.el
@@ -1791,6 +1791,7 @@ to the last move, as a comment."
         (w=  "   White = ")
         (res (when (gnugo--resignp (gnugo-move-history 'car))
                (gnugo-get :last-mover)))
+        (seed (gnugo-get :scoring-seed))
         blurb result)
     (if res
         (setq blurb (list
@@ -1805,7 +1806,6 @@ to the last move, as a comment."
       (let* ((g-over (gnugo-get :game-over))
              (live   (gnugo-aqr 'live g-over))
              (dead   (gnugo-aqr 'dead g-over))
-             (seed   (gnugo-get :scoring-seed))
              (terr-q (format "final_status_list %%s_territory %d" seed))
              (terr   "territory")
              (capt   "captures")
@@ -1872,6 +1872,18 @@ to the last move, as a comment."
     (gnugo--set-root-prop :RE result)
     (when comment
       (let ((node (car (aref (gnugo-get :monkey) 0))))
+        (cl-loop
+         for (prop . what) in '((:TB . black_territory)
+                                (:TW . white_territory)
+                                (:MA . seki)
+                                (:DD . dead))
+         do (let ((ls (gnugo-lsquery "final_status_list %s %s"
+                                     what seed)))
+              (delq (assq prop node) node)
+              (when ls
+                (gnugo--decorate
+                 node prop (mapcar (gnugo--as-cc-func)
+                                   ls)))))
         (gnugo--decorate
          (delq (assq :C node) node)
          :C



reply via email to

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