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

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

[elpa] externals/gnugo 283534a 157/357: [gnugo sgf int] Consolidate loop


From: Stefan Monnier
Subject: [elpa] externals/gnugo 283534a 157/357: [gnugo sgf int] Consolidate loops.
Date: Sun, 29 Nov 2020 14:51:11 -0500 (EST)

branch: externals/gnugo
commit 283534ab89292cb5d536d92d77b30317e6f316d0
Author: Thien-Thi Nguyen <ttn@gnu.org>
Commit: Thien-Thi Nguyen <ttn@gnu.org>

    [gnugo sgf int] Consolidate loops.
    
    * packages/gnugo/gnugo.el (gnugo/sgf-write-file):
    ...here, for "taking responsibility" and "write it out".
---
 gnugo.el | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/gnugo.el b/gnugo.el
index 2009034..dbbe01a 100644
--- a/gnugo.el
+++ b/gnugo.el
@@ -2763,12 +2763,8 @@ A collection is a list of gametrees, each a vector of 
four elements:
       tree)))
 
 (defun gnugo/sgf-write-file (collection filename)
-  ;; take responsibility for our actions
-  (let ((me (cons "gnugo.el" gnugo-version)))
-    (dolist (tree collection)
-      (gnugo--set-root-prop :AP me tree)))
-  ;; write it out
   (let ((aft-newline-appreciated '(:AP :GN :PB :PW :HA :KM :RU :RE))
+        (me (cons "gnugo.el" gnugo-version))
         (specs (mapcar (lambda (full)
                          (cons (intern (format ":%s" (car full)))
                                (cdddr full)))
@@ -2835,6 +2831,9 @@ A collection is a list of gametrees, each a vector of 
four elements:
                  (insert ")")))
       (with-temp-buffer
         (dolist (tree collection)
+          ;; take responsibility for our actions
+          (gnugo--set-root-prop :AP me tree)
+          ;; write it out
           (>>tree (gnugo/sgf-hang-from-root tree)))
         (newline)
         (write-file filename)))))



reply via email to

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