[elpa] 01/01: fixup! [gnugo int] Decorate w/ plist instead of alist.

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

commit 68786b1861e9a8020b37561c95921a146957db89
Author: Thien-Thi Nguyen 
Date:   Fri Apr 25 00:50:58 2014 +0200

fixup! [gnugo int] Decorate w/ plist instead of alist.
---
 packages/gnugo/gnugo.el |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/packages/gnugo/gnugo.el b/packages/gnugo/gnugo.el
index 6a7cf6c..67fec6b 100644
--- a/packages/gnugo/gnugo.el
+++ b/packages/gnugo/gnugo.el
@@ -1228,6 +1228,7 @@ This fails if the monkey is on the current branch
 
 (defun gnugo--decorate (node &rest plist)
   (loop with tp = (last node)
+with fruit
 while plist
 do (setf
 fruit (list (cons   ; DWR: LtR OoE assumed.



[elpa] branch master updated (1371e55 -> 6018b9b)

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

  from  1371e55   [gnugo int] Move ‘gnugo--passp’ earlier in file.
   new  00c9296   [gnugo int] Drop abstraction: pretty
   new  f1a84fe   [gnugo int] Add abstraction: gnugo--resignp
   new  7d8f456   [gnugo int] Add abstraction: gnugo--no-worries
   new  9060d26   [gnugo] Make undo commands silently handle overkill.
   new  6018b9b   [gnugo int] Snoop ‘--handicap N’ for empty new board.

The 5 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 |   42 +-
 2 files changed, 30 insertions(+), 13 deletions(-)



[elpa] branch master updated (e62a9fd -> fd1ea11)

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

  from  e62a9fd   Change echo statements during build.
   new  fd1ea11   [gnugo int] Decorate w/ plist instead of alist.

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.el |   25 +
 1 files changed, 13 insertions(+), 12 deletions(-)



[elpa] 02/02: Change echo statements during build.

2014-04-24 Thread Barry O'Reilly
epich pushed a commit to branch master
in repository elpa.

commit e62a9fd4ef28208c692edf89bfbf678201bc0031
Author: Barry O'Reilly 
Date:   Thu Apr 24 17:23:01 2014 -0400

Change echo statements during build.
---
 GNUmakefile |6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/GNUmakefile b/GNUmakefile
index f9deecf..eb3ce43 100644
--- a/GNUmakefile
+++ b/GNUmakefile
@@ -107,7 +107,7 @@ autoloads := $(foreach pkg, $(pkgs), $(pkg)/$(notdir 
$(pkg))-autoloads.el)
 
 $(foreach al, $(autoloads), $(eval $(call RULE-srcdeps, $(al
 %-autoloads.el:
-   @echo 'EMACS -f package-generate-autoloads $@'
+   @echo 'Generating autoloads for $@'
@cd $(dir $@); \
  $(EMACS) -l $(CURDIR)/admin/archive-contents.el \
  --eval "(archive--refresh-pkg-file)" \
@@ -129,7 +129,7 @@ elcs := $(call SET-diff, $(naive_elcs), $(patsubst %.el, 
%.elc, $(nbc_els)))
 
 # '(dolist (al (quote ($(patsubst %, "%", $(autoloads) (load 
(expand-file-name al) nil t))'
 %.elc: %.el
-   @echo 'EMACS -f batch-byte-compile $<'
+   @echo 'Byte compiling $<'
@$(EMACS) \
--eval "(setq package-directory-list nil package-user-dir 
\"$(abspath packages)\")" \
--eval '(package-initialize)' \
@@ -151,7 +151,7 @@ $(extra_elcs):; rm $@
 #   $(pkg)/$(notdir $(pkg))-pkg.el))
 # #$(foreach al, $(single_pkgs), $(eval $(call RULE-srcdeps, $(al
 # %-pkg.el: %.el
-#  @echo 'EMACS -f package-generate-description-file $@'
+#  @echo 'Generating description file $@'
 #  @$(EMACS) \
 #  --eval '(require (quote package))' \
 #  --eval '(setq b (find-file-noselect "$<"))' \



[elpa] branch master updated (fd1ea11 -> 68786b1)

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

  from  fd1ea11   [gnugo int] Decorate w/ plist instead of alist.
   new  68786b1   fixup! [gnugo int] Decorate w/ plist instead of alist.

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.el |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)



[elpa] 05/05: [gnugo int] Snoop ‘--handicap N’ for empty new board.

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

commit 6018b9b984e9d96e11f92305812126aab0b39795
Author: Thien-Thi Nguyen 
Date:   Thu Apr 24 20:05:58 2014 +0200

[gnugo int] Snoop ‘--handicap N’ for empty new board.

Regression introduced from 2014-04-19, "Fix bug:
Ensure gametree sync for -l/--infile".

* packages/gnugo/gnugo.el (gnugo): ...here.
---
 packages/gnugo/gnugo.el |   10 ++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/packages/gnugo/gnugo.el b/packages/gnugo/gnugo.el
index e8e7a71..92ccf0b 100644
--- a/packages/gnugo/gnugo.el
+++ b/packages/gnugo/gnugo.el
@@ -2517,6 +2517,16 @@ See `gnugo-board-mode' for a full list of commands."
komi   (gnugo--nquery "get_komi")
handicap   (gnugo--nquery "get_handicap")
board-size (gnugo--nquery "query_boardsize")))
+;; Work around a GNU Go 3.8 (and possibly earlier/later)
+;; bug whereby GTP command ‘get_handicap’ fails to return
+;; the N set by ‘--handicap N’ on the command line.
+(let ((actually (member "--handicap" args)))
+  ;; Checking ‘(zerop handicap)’ first is not strictly
+  ;; necessary; it represents a hope that some day GNU Go
+  ;; will DTRT (or provide rationale for this weird behavior)
+  ;; and become worthy of our trust.
+  (when (and (zerop handicap) actually)
+(setq handicap (string-to-number (cadr actually)
 (r! :SZ board-size
 :DT (format-time-string "%Y-%m-%d")
 :RU (if (member "--chinese-rules" args)



[elpa] 01/05: [gnugo int] Drop abstraction: pretty

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

commit 00c929690be1b6839a3f44909f4a8b6f7f104757
Author: Thien-Thi Nguyen 
Date:   Thu Apr 24 11:42:06 2014 +0200

[gnugo int] Drop abstraction: pretty

* packages/gnugo/gnugo.el (gnugo-move-history pretty):
Delete internal func.
(gnugo-move-history next): Revert to pre-‘pretty’ code.
(gnugo-move-history): For ‘bpos’ RSEL, convert search
condition from two negated string comparisons to one
"normal CC" position detection, and delay ‘as-pos’
call to rv computation.
---
 packages/gnugo/gnugo.el |   12 ++--
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/packages/gnugo/gnugo.el b/packages/gnugo/gnugo.el
index ac0d79b..f0c9dda 100644
--- a/packages/gnugo/gnugo.el
+++ b/packages/gnugo/gnugo.el
@@ -742,9 +742,8 @@ For all other values of RSEL, do nothing and return nil."
  (funcall as-pos x)))
  (remem () (setq node (pop mem)
  mprop (gnugo--move-prop node)))
- (pretty () (setq move (as-pos-maybe (cdr mprop
  (next (byp) (when (remem)
-   (pretty)
+   (setq move (as-pos-maybe (cdr mprop)))
(push (if byp
  (format "%s%s" move (car mprop))
move)
@@ -761,12 +760,13 @@ For all other values of RSEL, do nothing and return nil."
 (`cadr  (nn) (car (nn)))
 (`two (nn) (nn) acc)
 (`bpos (loop with prop = (gnugo--prop<-color color)
+ while mem
  when (and (remem)
(eq prop (car mprop))
-   (pretty)
-   (not (string= "resign" move))
-   (not (gnugo--passp move)))
- return move))
+   (setq move (cdr mprop))
+   ;; i.e., "normal CC" position
+   (= 2 (length move)))
+ return (funcall as-pos move)))
 (_ nil)
 
 (define-derived-mode gnugo-frolic-mode special-mode "GNUGO Frolic"



[elpa] branch master updated (6018b9b -> e62a9fd)

2014-04-24 Thread Barry O'Reilly
epich pushed a change to branch master
in repository elpa.

  from  6018b9b   [gnugo int] Snoop ‘--handicap N’ for empty new board.
   new  afc65ce   Don't allow package-initialize to use ~/.emacs.d
   new  e62a9fd   Change echo statements during build.

The 2 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:
 GNUmakefile |8 
 1 files changed, 4 insertions(+), 4 deletions(-)



[elpa] 04/05: [gnugo] Make undo commands silently handle overkill.

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

commit 9060d26640ec99de649bf1c2a14c83ed8828c064
Author: Thien-Thi Nguyen 
Date:   Thu Apr 24 15:00:37 2014 +0200

[gnugo] Make undo commands silently handle overkill.

It's impolite to reflect impoliteness.  :-D

* packages/gnugo/gnugo.el (gnugo--climb-towards-root):
Don't use ‘gnugo--q/ue’ for GTP "undo"; instead,
use ‘gnugo--q’, detect overkill, and stop looping.
---
 packages/gnugo/NEWS |1 +
 packages/gnugo/gnugo.el |4 ++--
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/packages/gnugo/NEWS b/packages/gnugo/NEWS
index 6898cf0..da24303 100644
--- a/packages/gnugo/NEWS
+++ b/packages/gnugo/NEWS
@@ -33,6 +33,7 @@ NB: "RCS: X..Y " means that the particular release includes
   - new major mode: GNUGO Frolic (gnugo-frolic-mode)
   - 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
   - performance improvements
   - of interest to hackers (see source, BI => backward incompatible)
 - dropped var: ‘gnugo-inhibit-refresh’ (BI)
diff --git a/packages/gnugo/gnugo.el b/packages/gnugo/gnugo.el
index 24adb49..e8e7a71 100644
--- a/packages/gnugo/gnugo.el
+++ b/packages/gnugo/gnugo.el
@@ -1979,8 +1979,8 @@ If FILENAME already exists, Emacs confirms that you wish 
to overwrite it."
(cdr hmm)
 (when (gnugo-get :game-over)
   (gnugo--unclose-game))
-(while (not (eq stop (aref monkey 0)))
-  (gnugo--q/ue "undo")
+(while (and (not (eq stop (aref monkey 0)))
+(gnugo--no-worries (gnugo--q "undo")))
   (pop (aref monkey 0))
   (gnugo-put :last-mover (gnugo-current-player))
   (gnugo-merge-showboard-results)   ; all



[elpa] 02/05: [gnugo int] Add abstraction: gnugo--resignp

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

commit f1a84fe0d81d19098d5a1f19f26804bc15fd4a20
Author: Thien-Thi Nguyen 
Date:   Thu Apr 24 11:49:18 2014 +0200

[gnugo int] Add abstraction: gnugo--resignp

* packages/gnugo/gnugo.el (gnugo--resignp): New defsubst.
(gnugo-move-history, gnugo-push-move, gnugo-refresh)
(gnugo-display-final-score): Use ‘gnugo--resignp’.
---
 packages/gnugo/gnugo.el |   11 +++
 1 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/packages/gnugo/gnugo.el b/packages/gnugo/gnugo.el
index f0c9dda..7fdfaaf 100644
--- a/packages/gnugo/gnugo.el
+++ b/packages/gnugo/gnugo.el
@@ -715,6 +715,9 @@ when you are sure the command cannot fail."
   (+ ?A (- (if (> ?i col) col (1+ col)) ?a))
   (- size (- (aref cc 1) ?a
 
+(defsubst gnugo--resignp (string)
+  (string= "resign" string))
+
 (defsubst gnugo--passp (string)
   (string= "PASS" string))
 
@@ -737,7 +740,7 @@ For all other values of RSEL, do nothing and return nil."
  (as-pos (gnugo--as-pos-func))
  acc node mprop move)
 (cl-flet*
-((as-pos-maybe (x) (if (string= "resign" x)
+((as-pos-maybe (x) (if (gnugo--resignp x)
x
  (funcall as-pos x)))
  (remem () (setq node (pop mem)
@@ -1285,7 +1288,7 @@ This fails if the monkey is on the current branch
   who))
  (start (gnugo-get :waiting-start))
  (now (current-time))
- (resignp (string= "resign" move))
+ (resignp (gnugo--resignp move))
  (passp (gnugo--passp move))
  (head (gnugo-move-history 'car))
  (onep (and head (gnugo--passp head)))
@@ -1455,7 +1458,7 @@ its move."
 (rename-buffer (concat (gnugo-get :diamond)
(if game-over
(format "%s(game over)"
-   (if (string= move "resign")
+   (if (gnugo--resignp move)
(concat move "ation ")
  ""))
  (format "%s(%s to play)"
@@ -2099,7 +2102,7 @@ to the last move, as a comment."
   (sit-for 3)))
   (let ((b=  "   Black = ")
 (w=  "   White = ")
-(res (when (string= "resign" (gnugo-move-history 'car))
+(res (when (gnugo--resignp (gnugo-move-history 'car))
(gnugo-get :last-mover)))
 blurb result)
 (if res



[elpa] 01/02: Don't allow package-initialize to use ~/.emacs.d

2014-04-24 Thread Barry O'Reilly
epich pushed a commit to branch master
in repository elpa.

commit afc65ce7e895db33b504ed8626fe573c24e051ba
Author: Nicolas Richard 
Date:   Thu Apr 24 17:16:10 2014 -0400

Don't allow package-initialize to use ~/.emacs.d
---
 GNUmakefile |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/GNUmakefile b/GNUmakefile
index 2b07767..f9deecf 100644
--- a/GNUmakefile
+++ b/GNUmakefile
@@ -131,7 +131,7 @@ elcs := $(call SET-diff, $(naive_elcs), $(patsubst %.el, 
%.elc, $(nbc_els)))
 %.elc: %.el
@echo 'EMACS -f batch-byte-compile $<'
@$(EMACS) \
-   --eval "(setq package-directory-list '(\"$(abspath packages)\"))" \
+   --eval "(setq package-directory-list nil package-user-dir 
\"$(abspath packages)\")" \
--eval '(package-initialize)' \
-L $(dir $@) -f batch-byte-compile $<
 



[elpa] 01/01: [gnugo int] Decorate w/ plist instead of alist.

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

commit fd1ea1172b34787aa244e7a167e6ce70f69bce2a
Author: Thien-Thi Nguyen 
Date:   Fri Apr 25 00:03:22 2014 +0200

[gnugo int] Decorate w/ plist instead of alist.

* packages/gnugo/gnugo.el (gnugo--decorate):
Rewrite; convert from defsubst to defun.
(gnugo-display-final-score, gnugo-comment)
(gnugo r!): Update accordingly.
---
 packages/gnugo/gnugo.el |   25 +
 1 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/packages/gnugo/gnugo.el b/packages/gnugo/gnugo.el
index 92ccf0b..6a7cf6c 100644
--- a/packages/gnugo/gnugo.el
+++ b/packages/gnugo/gnugo.el
@@ -1226,9 +1226,15 @@ This fails if the monkey is on the current branch
  (substring pos 1))
 (format "%c%c" one two)
 
-(defsubst gnugo--decorate (node alist)
-  ;; NB: ALIST should not have :B or :W keys.
-  (setcdr (last node) alist))
+(defun gnugo--decorate (node &rest plist)
+  (loop with tp = (last node)
+while plist
+do (setf
+fruit (list (cons   ; DWR: LtR OoE assumed.
+ (pop plist)
+ (pop plist)))
+(cdr tp) fruit
+tp   fruit)))
 
 (defun gnugo-close-game (end-time resign)
   (gnugo-put :game-end-time end-time)
@@ -2190,6 +2196,7 @@ to the last move, as a comment."
   (let ((node (car (aref (gnugo-get :monkey) 0
 (gnugo--decorate
  (delq (assq :C node) node)
+ :C
  (with-temp-buffer  ; lame
(insert blurb)
(when (search-backward "\n\nGame start:" nil t)
@@ -2202,7 +2209,7 @@ to the last move, as a comment."
  (rep "territory" "T")
  (rep "captures"  "C")
  (rep "komi"  "K"))
-   `((:C . ,(buffer-string)))
+   (buffer-string)
 (switch-to-buffer (format "%s*GNUGO Final Score*" (gnugo-get :diamond)))
 (erase-buffer)
 (insert blurb)))
@@ -2281,7 +2288,7 @@ If COMMENT is nil or the empty string, remove the 
property entirely."
 (cdr (assq :C node))
   (setq node (delq (assq :C node) node))
   (unless (zerop (length comment))
-(gnugo--decorate node `((:C . ,comment)
+(gnugo--decorate node :C comment)))
 
 (defun gnugo-toggle-abdication ()
   "Toggle abdication, i.e., letting GNU Go play for you.
@@ -2503,13 +2510,7 @@ See `gnugo-board-mode' for a full list of commands."
 (if filename
 (gnugo-read-sgf-file (expand-file-name filename))
   (cl-flet
-  ((r! (&rest plist)
-   (gnugo--decorate
-root (loop  ; hmm, available elsewhere?
-  while plist
-  collect (let* ((k (pop plist))
- (v (pop plist)))
-(cons k v))
+  ((r! (&rest plist) (apply 'gnugo--decorate root plist)))
 (gnugo--SZ!
  (setq root (gnugo--root-node
  (gnugo--plant-and-climb



[elpa] 03/05: [gnugo int] Add abstraction: gnugo--no-worries

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

commit 7d8f45619d427935a56eb1976e25cb65b3ece327
Author: Thien-Thi Nguyen 
Date:   Thu Apr 24 14:41:41 2014 +0200

[gnugo int] Add abstraction: gnugo--no-worries

* packages/gnugo/gnugo.el (gnugo--no-worries): New defsubst.
(gnugo--q/ue): Use ‘gnugo--no-worries’.
---
 packages/gnugo/gnugo.el |5 -
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/packages/gnugo/gnugo.el b/packages/gnugo/gnugo.el
index 7fdfaaf..24adb49 100644
--- a/packages/gnugo/gnugo.el
+++ b/packages/gnugo/gnugo.el
@@ -421,9 +421,12 @@ status of the command.  See also `gnugo-query'."
 (prog1 (substring (process-get proc :srs) 0 -2)
   (process-put proc :srs ""
 
+(defsubst gnugo--no-worries (string)
+  (= ?= (aref string 0)))
+
 (defun gnugo--q/ue (fmt &rest args)
   (let ((ans (apply 'gnugo--q fmt args)))
-(unless (= ?= (aref ans 0))
+(unless (gnugo--no-worries ans)
   (user-error "%s" ans))
 (substring ans 2)))