[elpa] branch master updated (3c20bf4 -> 4943363)

2014-05-20 Thread Stefan Monnier
monnier pushed a change to branch master
in repository elpa.

  from  3c20bf4   [xpm maint] Add some perf ideas to HACKING; nfc.
   new  4943363   Fix up copyright headers; add cl-lib requirement

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/chess/chess-ai.el|2 +-
 packages/chess/chess-algebraic.el |   22 +++---
 packages/chess/chess-announce.el  |   20 ++--
 packages/chess/chess-autosave.el  |   20 ++--
 packages/chess/chess-chat.el  |   23 ---
 packages/chess/chess-clock.el |   20 ++--
 packages/chess/chess-common.el|   21 -
 packages/chess/chess-crafty.el|   20 ++--
 packages/chess/chess-database.el  |   20 ++--
 packages/chess/chess-display.el   |   20 ++--
 packages/chess/chess-eco.el   |4 ++--
 packages/chess/chess-engine.el|   18 --
 packages/chess/chess-epd.el   |4 ++--
 packages/chess/chess-fen.el   |   22 +++---
 packages/chess/chess-file.el  |   22 --
 packages/chess/chess-fruit.el |2 +-
 packages/chess/chess-game.el  |   18 --
 packages/chess/chess-german.el|   20 ++--
 packages/chess/chess-glaurung.el  |2 +-
 packages/chess/chess-gnuchess.el  |   20 ++--
 packages/chess/chess-ics.el   |   12 +++-
 packages/chess/chess-ics1.el  |   20 ++--
 packages/chess/chess-images.el|   18 --
 packages/chess/chess-input.el |   22 +++---
 packages/chess/chess-irc.el   |   20 ++--
 packages/chess/chess-kibitz.el|   22 --
 packages/chess/chess-link.el  |   22 --
 packages/chess/chess-log.el   |   18 --
 packages/chess/chess-message.el   |   20 ++--
 packages/chess/chess-module.el|   20 ++--
 packages/chess/chess-network.el   |   20 ++--
 packages/chess/chess-none.el  |   22 --
 packages/chess/chess-perft.el |2 +-
 packages/chess/chess-pgn.el   |   20 ++--
 packages/chess/chess-phalanx.el   |4 ++--
 packages/chess/chess-plain.el |   20 ++--
 packages/chess/chess-ply.el   |   16 ++--
 packages/chess/chess-polyglot.el  |2 +-
 packages/chess/chess-pos.el   |   16 ++--
 packages/chess/chess-puzzle.el|   20 ++--
 packages/chess/chess-random.el|   22 +++---
 packages/chess/chess-scid.el  |   22 +++---
 packages/chess/chess-sjeng.el |4 ++--
 packages/chess/chess-sound.el |   22 --
 packages/chess/chess-stockfish.el |2 +-
 packages/chess/chess-test.el  |   23 ++-
 packages/chess/chess-transport.el |   22 --
 packages/chess/chess-tutorial.el  |   20 ++--
 packages/chess/chess-ucb.el   |   22 +++---
 packages/chess/chess-uci.el   |2 +-
 packages/chess/chess-var.el   |   18 --
 packages/chess/chess.el   |   11 ---
 52 files changed, 736 insertions(+), 110 deletions(-)



[elpa] branch master updated (4943363 -> a7254df)

2014-05-20 Thread Stefan Monnier
monnier pushed a change to branch master
in repository elpa.

  from  4943363   Fix up copyright headers; add cl-lib requirement
   new  a7254df   * admin/archive-contents.el: Keep both home page a 
repository links.

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:
 admin/archive-contents.el |   51 
 1 files changed, 28 insertions(+), 23 deletions(-)



[elpa] 01/01: * admin/archive-contents.el: Keep both home page a repository links.

2014-05-20 Thread Stefan Monnier
monnier pushed a commit to branch master
in repository elpa.

commit a7254df1cecc7572585a72a8f6e075ca439993f5
Author: Stefan Monnier 
Date:   Tue May 20 11:04:22 2014 -0400

* admin/archive-contents.el: Keep both home page a repository links.
---
 admin/archive-contents.el |   51 
 1 files changed, 28 insertions(+), 23 deletions(-)

diff --git a/admin/archive-contents.el b/admin/archive-contents.el
index 241f1ad..96ecb76 100644
--- a/admin/archive-contents.el
+++ b/admin/archive-contents.el
@@ -161,6 +161,9 @@ Currently only refreshes the ChangeLog files."
   dir (expand-file-name "packages/" srcdir)
 ))
 
+(defconst archive-default-url-format "http://elpa.gnu.org/packages/%s.html";)
+(defconst archive-default-url-re (format archive-default-url-format ".*"))
+
 (defun archive--metadata (dir pkg)
   "Return a list (SIMPLE VERSION DESCRIPTION REQ EXTRAS),
 where SIMPLE is non-nil if the package is simple;
@@ -193,7 +196,7 @@ PKG is the name of the package and DIR is the directory 
where it is."
  (simple (if pt (equal pt "simple") (= (length files) 1)))
  (keywords (lm-keywords-list))
  (url (or (lm-header "url")
-  (format "http://elpa.gnu.org/packages/%s.html"; pkg)))
+  (format archive-default-url-format pkg)))
  (req
   (if requires-str
   (mapcar 'archive--convert-require
@@ -422,28 +425,30 @@ Rename DIR/ to PKG-VERS/, and return the descriptor."
 (replace-regexp-in-string "&" "&" txt)))
 
 (defun archive--insert-repolinks (name srcdir mainsrcfile url)
-  (if url
-  (insert (format "Origin: %s\n"
-  url (archive--quote url)))
-(let* ((externals
-(with-temp-buffer
-  (insert-file-contents
-   (expand-file-name "../../../elpa/externals-list" srcdir))
-  (read (current-buffer
-   (external (eq :external (nth 1 (assoc name externals
-   (git-sv "http://git.savannah.gnu.org/";)
-   (urls (if external
- '("cgit/emacs/elpa.git/?h=externals/"
-   
"gitweb/?p=emacs/elpa.git;a=shortlog;h=refs/heads/externals/")
-   '("cgit/emacs/elpa.git/tree/packages/"
- "gitweb/?p=emacs/elpa.git;a=tree;f=packages/"
-  (insert (format
-   (concat "Browse repository: %s"
-   " or %s\n")
-   (concat git-sv (nth 0 urls) name)
-   'CGit
-   (concat git-sv (nth 1 urls) name)
-   'Gitweb)
+  (when url
+(insert (format "Home page: %s\n"
+url (archive--quote url)))
+(when (string-match archive-default-url-re url)
+  (setq url nil)))
+  (let* ((externals
+  (with-temp-buffer
+(insert-file-contents
+ (expand-file-name "../../../elpa/externals-list" srcdir))
+(read (current-buffer
+ (external (eq :external (nth 1 (assoc name externals
+ (git-sv "http://git.savannah.gnu.org/";)
+ (urls (if external
+   '("cgit/emacs/elpa.git/?h=externals/"
+ 
"gitweb/?p=emacs/elpa.git;a=shortlog;h=refs/heads/externals/")
+ '("cgit/emacs/elpa.git/tree/packages/"
+   "gitweb/?p=emacs/elpa.git;a=tree;f=packages/"
+(insert (format
+ (concat (format "Browse %srepository: " (if url "ELPA's " ""))
+ "%s or %s\n")
+ (concat git-sv (nth 0 urls) name)
+ 'CGit
+ (concat git-sv (nth 1 urls) name)
+ 'Gitweb
 
 (defun archive--html-make-pkg (pkg files)
   (let* ((name (symbol-name (car pkg)))



[elpa] branch master updated (a7254df -> 327dc5a)

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

  from  a7254df   * admin/archive-contents.el: Keep both home page a 
repository links.
   new  327dc5a   [gnugo imgen] New feature: gnugo-imgen

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-imgen.el |  243 +
 packages/gnugo/gnugo.el   |4 +-
 2 files changed, 245 insertions(+), 2 deletions(-)
 create mode 100644 packages/gnugo/gnugo-imgen.el



[elpa] 01/01: [gnugo imgen] New feature: gnugo-imgen

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

commit 327dc5ae650741f211c3ba4d215af070673f91ef
Author: Thien-Thi Nguyen 
Date:   Wed May 21 06:15:01 2014 +0200

[gnugo imgen] New feature: gnugo-imgen

* packages/gnugo/gnugo-imgen.el: New file.
* packages/gnugo/gnugo.el [Package-Requires]: Mention ‘xpm’.
---
 packages/gnugo/gnugo-imgen.el |  243 +
 packages/gnugo/gnugo.el   |4 +-
 2 files changed, 245 insertions(+), 2 deletions(-)

diff --git a/packages/gnugo/gnugo-imgen.el b/packages/gnugo/gnugo-imgen.el
new file mode 100644
index 000..0954c40
--- /dev/null
+++ b/packages/gnugo/gnugo-imgen.el
@@ -0,0 +1,243 @@
+;;; gnugo-imgen.el --- image generation -*- lexical-binding: t -*-
+
+;; Copyright (C) 2014  Free Software Foundation, Inc.
+
+;; Author: Thien-Thi Nguyen 
+;; Maintainer: Thien-Thi Nguyen 
+
+;; This program is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+
+;; This program is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with this program.  If not, see .
+
+;;; Commentary:
+
+;; This file provides func `gnugo-imgen-create-xpms', suitable as
+;; value for `gnugo-xpms', and several variables to configure it:
+;;
+;;  `gnugo-imgen-styles'
+;;  `gnugo-imgen-style'
+;;  `gnugo-imgen-sizing-function'
+;;
+;; There is also one command: `gnugo-imgen-clear-cache'.
+
+;;; Code:
+
+(require 'xpm)
+(require 'xpm-m2z)
+(require 'cl-lib)
+
+(defvar gnugo-imgen-styles
+  '((d-bump ; thanks
+ :background "#C7C75252"
+ :grid-lines "#"
+ :circ-edges "#C6C6C3C3C6C6"
+ :white-fill "#"
+ :black-fill "#")
+(ttn; this guy must live in a cave
+ :background "#"
+ :grid-lines "#"
+ :circ-edges "#"
+ :white-fill "#"
+ :black-fill "#"))
+  "Alist of styles suitable for `gnugo-imgen-create-xpms'.
+The key is a symbol naming the style.  The value is a plist.
+Here is a list of recognized keywords and their meanings:
+
+ :background -- string that names a color in XPM format, such as
+ :grid-lines\"#\" or \"black\"; the special string
+ :circ-edges\"None\" makes that component transparent
+ :white-fill
+ :black-fill
+
+All keywords are required and color values cannot be nil.
+This restriction may be lifted in the future.")
+
+(defvar gnugo-imgen-style nil
+  "Which style in `gnugo-imgen-styles' to use.
+If nil, `gnugo-imgen-create-xpms' defaults to the first one.")
+
+(defvar gnugo-imgen-sizing-function 'gnugo-imgen-fit-window-height
+  "Function to compute XPM image size from board size.
+This is called with one arg, integer BOARD-SIZE, and should return
+a number (float or integer), the number of pixels for the side of
+a square position on the board.  A value less than 8 is taken as 8.")
+
+(defvar gnugo-imgen-cache (make-hash-table :test 'equal))
+
+(defun gnugo-imgen-clear-cache ()
+  "Clear the cache."
+  (interactive)
+  (clrhash gnugo-imgen-cache))
+
+(defun gnugo-imgen-fit-window-height (board-size)
+  "Return the dimension (in pixels) of a square for BOARD-SIZE.
+This uses the TOP and BOTTOM components as returned by
+`window-inside-absolute-pixel-edges' and subtracts twice
+the `frame-char-height' (to leave space for the grid)."
+  (destructuring-bind (L top R bot)
+  (window-inside-absolute-pixel-edges)
+(ignore L R)
+(/ (float (- bot top (* 2 (frame-char-height
+   board-size)))
+
+(defconst gnugo-imgen-palette '((32 . :background)
+(?. . :grid-lines)
+(?X . :circ-edges)
+(?- . :black-fill)
+(?+ . :white-fill)))
+
+(defun gnugo-imgen-create-xpms-1 (square style)
+  (let* ((kws (mapcar 'cdr gnugo-imgen-palette))
+ (roles (mapcar 'symbol-name kws))
+ (palette (loop
+   for px in (mapcar 'car gnugo-imgen-palette)
+   for role in roles
+   collect (cons px (format "s %s" role
+ (resolved (loop
+with parms = (copy-sequence style)
+for role in roles
+for kw in kws
+collect (cons role (plist-get parms kw
+ (sq-m1 (1- square))
+ (half (/ sq-m1 2.0))
+ (half-m1 (truncate (- half 0.5)))
+ (half-p1 (truncate