[elpa] 01/01: [gnugo int] Whitespace, comment munging; nfc.

2014-05-27 Thread Thien-Thi Nguyen
ttn pushed a commit to branch master
in repository elpa.

commit 65dc6dc12ec693e3e01b84d0291c5ca074d8ecc8
Author: Thien-Thi Nguyen 
Date:   Tue May 27 10:30:20 2014 +0200

[gnugo int] Whitespace, comment munging; nfc.
---
 packages/gnugo/gnugo-frolic.el |  116 ++-
 packages/gnugo/gnugo-imgen.el  |   83 +++---
 packages/gnugo/gnugo.el|  237 +--
 3 files changed, 232 insertions(+), 204 deletions(-)

diff --git a/packages/gnugo/gnugo-frolic.el b/packages/gnugo/gnugo-frolic.el
index 69373e8..539dadb 100644
--- a/packages/gnugo/gnugo-frolic.el
+++ b/packages/gnugo/gnugo-frolic.el
@@ -124,8 +124,8 @@ are dimmed.  Type \\[describe-mode] in that buffer for 
details."
  (at (car (aref monkey 0)))
  (bidx (aref monkey 1))
  (valid (cl-map 'vector (lambda (end)
-   (gethash (car end) mnum))
- ends))
+  (gethash (car end) mnum))
+ends))
  (max-move-num (apply 'max (append valid nil)))
  (inhibit-read-only t)
  finish)
@@ -265,33 +265,34 @@ are dimmed.  Type \\[describe-mode] in that buffer for 
details."
(cnxn lanes set)
"\n")))
   (edge heads)
-  (cl-loop with bef
-for ls on forks
-do (let* ((one (car ls))
-  (yes (append
-;; "aft" heads
-(mapcar 'car (cdr ls))
-;; ‘bef’ tails
-(apply 'append (mapcar 'cdr bef
-  (ord (sort one '<))
-  (beg (car ord))
-  (end (car (last ord
- (cl-flet
- ((also (b e) (cnxn (number-sequence b e)
-yes)))
-   (insert
-margin
-(also 0 (1- beg))
-(pad-unless (zerop beg))
-(dashed (number-sequence beg end)
-(lambda (bx)
-  (cond ((memq bx ord) "+")
-((memq bx yes) "|")
-(t "-"
-(pad-unless (>= end width))
-(also (1+ end) (1- width))
-"\n"))
- (push one bef)))
+  (cl-loop
+   with bef
+   for ls on forks
+   do (let* ((one (car ls))
+ (yes (append
+   ;; "aft" heads
+   (mapcar 'car (cdr ls))
+   ;; ‘bef’ tails
+   (apply 'append (mapcar 'cdr bef
+ (ord (sort one '<))
+ (beg (car ord))
+ (end (car (last ord
+(cl-flet
+((also (b e) (cnxn (number-sequence b e)
+   yes)))
+  (insert
+   margin
+   (also 0 (1- beg))
+   (pad-unless (zerop beg))
+   (dashed (number-sequence beg end)
+   (lambda (bx)
+ (cond ((memq bx ord) "+")
+   ((memq bx yes) "|")
+   (t "-"
+   (pad-unless (>= end width))
+   (also (1+ end) (1- width))
+   "\n"))
+(push one bef)))
   (edge (apply 'append tails))
   (aa2u (line-beginning-position
  (- (1+ (length forks
@@ -329,28 +330,30 @@ are dimmed.  Type \\[describe-mode] in that buffer for 
details."
 (when (memq 'require-valid-branch how)
   (unless a
 (user-error "No branch here")))
-(cl-loop with omit = (cdr (assq 'omit how))
-  for (name . value) in `((line   . ,line)
-  (bidx   . ,(aref monkey 1))
-  (monkey . ,monkey)
-  (width  . ,width)
-  (ends   . ,ends)
-  (tree   . ,tree))
-  do (unless (memq name omit)
-   (push value rv)))
+(cl-loop
+ with omit = (cdr (assq 'omit how))
+ for (name . value) in `((line   . ,line)
+ (bidx   . ,(aref monkey 1))
+ (monkey . ,monkey)
+  

[elpa] branch master updated (bd29e9b -> 65dc6dc)

2014-05-27 Thread Thien-Thi Nguyen
ttn pushed a change to branch master
in repository elpa.

  from  bd29e9b   * packages/osc/osc.el (osc-filter): Fix up old `cl' name. 
(osc--test-transport-equality): Mark `path' as unused.
   new  65dc6dc   [gnugo int] Whitespace, comment munging; nfc.

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "adds" were already present in the repository and have only
been added to this reference.


Summary of changes:
 packages/gnugo/gnugo-frolic.el |  116 ++-
 packages/gnugo/gnugo-imgen.el  |   83 +++---
 packages/gnugo/gnugo.el|  237 +--
 3 files changed, 232 insertions(+), 204 deletions(-)



[elpa] branch master updated (65dc6dc -> b151b45)

2014-05-27 Thread Thien-Thi Nguyen
ttn pushed a change to branch master
in repository elpa.

  from  65dc6dc   [gnugo int] Whitespace, comment munging; nfc.
   new  b151b45   [gnugo] Only set AP for modified gametrees in the 
collection.

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "adds" were already present in the repository and have only
been added to this reference.


Summary of changes:
 packages/gnugo/NEWS |1 +
 packages/gnugo/gnugo.el |7 +++
 2 files changed, 4 insertions(+), 4 deletions(-)



[elpa] 01/01: [gnugo] Only set AP for modified gametrees in the collection.

2014-05-27 Thread Thien-Thi Nguyen
ttn pushed a commit to branch master
in repository elpa.

commit b151b45b28bf6dabe0ad9d9efc471634d5e86a65
Author: Thien-Thi Nguyen 
Date:   Tue May 27 11:56:16 2014 +0200

[gnugo] Only set AP for modified gametrees in the collection.

* packages/gnugo/gnugo.el (gnugo-write-sgf-file):
Set root node property :AP here, but only if buffer-modified.
(gnugo, gnugo/sgf-write-file): Don't set root node property :AP.
---
 packages/gnugo/NEWS |1 +
 packages/gnugo/gnugo.el |7 +++
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/packages/gnugo/NEWS b/packages/gnugo/NEWS
index da45ca6..91047fb 100644
--- a/packages/gnugo/NEWS
+++ b/packages/gnugo/NEWS
@@ -46,6 +46,7 @@ NB: "RCS: X..Y " means that the particular release includes
   - GNUGO Board mode now derived from Special mode
   - position arg validated for direct GTP commands ‘undo’, ‘gg-undo’
   - undo commands no longer signal error on overkill
+  - SGF prop ‘AP’ set only for modified gametrees
   - SGF I/O commands change ‘default-directory’
   - performance improvements
   - of interest to hackers (see source, BI => backward incompatible)
diff --git a/packages/gnugo/gnugo.el b/packages/gnugo/gnugo.el
index 3097ce1..e42db33 100644
--- a/packages/gnugo/gnugo.el
+++ b/packages/gnugo/gnugo.el
@@ -1561,6 +1561,9 @@ If FILENAME already exists, Emacs confirms that you wish 
to overwrite it."
   (when (and (file-exists-p filename)
  (not (y-or-n-p "File exists. Continue? ")))
 (user-error "Not writing %s" filename))
+  (when (buffer-modified-p)
+;; take responsibility for our actions
+(gnugo--set-root-prop :AP (cons "gnugo.el" gnugo-version)))
   (gnugo/sgf-write-file (gnugo-get :sgf-collection) filename)
   (gnugo--ok-file filename))
 
@@ -2280,7 +2283,6 @@ See `gnugo-board-mode' for a full list of commands."
 :RU (if (member "--chinese-rules" args)
 "Chinese"
   "Japanese")
-:AP (cons "gnugo.el" gnugo-version)
 :KM komi)
 (let ((ub (gnugo--blackp user-color)))
   (r! (if ub :PW :PB) (concat "GNU Go " (gnugo-query "version"))
@@ -2655,7 +2657,6 @@ A collection is a list of gametrees, each a vector of 
four elements:
 
 (defun gnugo/sgf-write-file (collection filename)
   (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)))
(cl-cdddr full)))
@@ -2723,8 +2724,6 @@ 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
   (let ((ht (gnugo--mkht))
 (leaves (append (gnugo--tree-ends tree) nil)))