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

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

[elpa] 01/04: [gnugo sgf int] Consolidate loops.


From: Thien-Thi Nguyen
Subject: [elpa] 01/04: [gnugo sgf int] Consolidate loops.
Date: Fri, 11 Apr 2014 09:24:59 +0000

ttn pushed a commit to branch master
in repository elpa.

commit a47d5d34e761d78c636e3a813a340b2eda365072
Author: Thien-Thi Nguyen <address@hidden>
Date:   Fri Apr 11 10:25:12 2014 +0200

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

diff --git a/packages/gnugo/gnugo.el b/packages/gnugo/gnugo.el
index 2009034..dbbe01a 100644
--- a/packages/gnugo/gnugo.el
+++ b/packages/gnugo/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]