[elpa] master e84d1bf: Support for connecting to remote session bus

2016-07-22 Thread Mario Lang
branch: master
commit e84d1bfa74ef03c967fe4fc96e65fbae9b8941d0
Author: Mario Lang 
Commit: Mario Lang 

Support for connecting to remote session bus
---
 packages/systemd/systemd.el |   25 +
 1 file changed, 21 insertions(+), 4 deletions(-)

diff --git a/packages/systemd/systemd.el b/packages/systemd/systemd.el
index 0c213ca..a7e377c 100644
--- a/packages/systemd/systemd.el
+++ b/packages/systemd/systemd.el
@@ -61,15 +61,32 @@
   (string (string-to-number (match-string 1 string) 16)) t t string)))
   string)
 
-(defun systemd-remote-bus (host &optional address)
-  (unless address
-(setq address "unix:path=/run/dbus/system_bus_socket"))
+(defun systemd-remote-bus (host &optional bus)
+  "Construct a D-Bus bus address suitable for connecting to a remote D-Bus
+instance (via ssh) running on HOST.  Optional argument BUS specifies
+the D-Bus instance to connect to on the remote host.  The keywords
+:system and :session indicate to connect to the remote system or session
+bus, respectively.  If a string is given, that particular D-Bus address is used
+on the remote host.  When not specified, the remote system bus is used."
+  (setq bus
+   (pcase bus
+ ((or `nil `:system)
+  "unix:path=/run/dbus/system_bus_socket")
+ (`:session
+  (with-temp-buffer
+(let ((default-directory (concat "/scpx:" host ":/")))
+  (shell-command "[ -e $XDG_RUNTIME_DIR/bus ] && echo -n 
$XDG_RUNTIME_DIR/bus" t)
+  (when (not (zerop (buffer-size)))
+(buffer-string)
+ (_ bus)))
+  (unless bus
+(error "Unable to determine remote session bus address."))
   (concat "unixexec:"
   "path=ssh"
   ",argv1=-xT"
   ",argv2=" (systemd-escape-dbus-address host)
   ",argv3=systemd-stdio-bridge"
-  ",argv4=" (systemd-escape-dbus-address (concat "--bus-path=" 
address
+  ",argv4=" (systemd-escape-dbus-address (concat "--bus-path=" bus
 
 (defconst systemd-dbus-service "org.freedesktop.systemd1")
 (defconst systemd-dbus-path "/org/freedesktop/systemd1")



[elpa] master 5d72b7e: [systemd] Use `process-file' instead of `shell-command'

2016-07-22 Thread Mario Lang
branch: master
commit 5d72b7e0e18753050de2a8a31ba182325abbbaf7
Author: Mario Lang 
Commit: Mario Lang 

[systemd] Use `process-file' instead of `shell-command'
---
 packages/systemd/systemd.el |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/packages/systemd/systemd.el b/packages/systemd/systemd.el
index a7e377c..ac940b1 100644
--- a/packages/systemd/systemd.el
+++ b/packages/systemd/systemd.el
@@ -74,8 +74,8 @@ on the remote host.  When not specified, the remote system 
bus is used."
   "unix:path=/run/dbus/system_bus_socket")
  (`:session
   (with-temp-buffer
-(let ((default-directory (concat "/scpx:" host ":/")))
-  (shell-command "[ -e $XDG_RUNTIME_DIR/bus ] && echo -n 
$XDG_RUNTIME_DIR/bus" t)
+(let ((default-directory (concat "/scpx:" host ":")))
+  (process-file "/bin/sh" nil t nil "-c" "[ -e 
$XDG_RUNTIME_DIR/bus ] && echo -n $XDG_RUNTIME_DIR/bus")
   (when (not (zerop (buffer-size)))
 (buffer-string)
  (_ bus)))



[elpa] master 1e3a439: Use user-emacs-directory.

2016-08-01 Thread Mario Lang
branch: master
commit 1e3a4396ea61d71b69eb9678417db5b3f4de0bb0
Author: Mario Lang 
Commit: Mario Lang 

Use user-emacs-directory.
---
 packages/async/async-bytecomp.el |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/packages/async/async-bytecomp.el b/packages/async/async-bytecomp.el
index 2c96da0..9ee3071 100644
--- a/packages/async/async-bytecomp.el
+++ b/packages/async/async-bytecomp.el
@@ -51,7 +51,7 @@ the symbol `all', in this case packages are always compiled 
asynchronously."
   :group 'async
   :type '(repeat (choice symbol)))
 
-(defvar async-byte-compile-log-file "~/.emacs.d/async-bytecomp.log")
+(defvar async-byte-compile-log-file (expand-file-name "async-bytecomp.log" 
user-emacs-directory))
 
 ;;;###autoload
 (defun async-byte-recompile-directory (directory &optional quiet)



[elpa] master a5038a2 1/2: Very slightly improve performance

2016-08-02 Thread Mario Lang
branch: master
commit a5038a2ee05561ba6e586fc5a63e8ba9187fba93
Author: Mario Lang 
Commit: Mario Lang 

Very slightly improve performance

* packages/poker/poker.el (poker-hand-value): Use `delete-dups' instead of
`cl-delete-duplicates' and avoid an unnecessary call to `ash'.
---
 packages/poker/poker.el |   36 ++--
 1 file changed, 18 insertions(+), 18 deletions(-)

diff --git a/packages/poker/poker.el b/packages/poker/poker.el
index 9de00d3..c908bb6 100644
--- a/packages/poker/poker.el
+++ b/packages/poker/poker.el
@@ -99,25 +99,25 @@ The highest possible value is therefore #x8CBA98 and the 
lowest is #x053210."
(lambda (lhs rhs) (or (> (car lhs) (car rhs))
  (and (= (car lhs) (car rhs))
   (> (cdr lhs) (cdr 
rhs)))
-(ranks-length nil))
+(ranks-length (length rank-counts)))
 (setq ranks (mapcar #'cdr rank-counts)
- rank-counts (mapcar #'car rank-counts)
- ranks-length (length ranks))
-(logior (ash (cond
- ((equal rank-counts '(2 1 1 1)) 1)
- ((eq ranks-length 5)
-  (let ((straight (or (when (and (eq (nth 0 ranks) 12)
-  (eq (nth 1 ranks) 3))
- (setq ranks '(3 2 1 0 0)))
-   (eq (- (nth 0 ranks) (nth 4 ranks)) 4)))
- (flush (eq (length (cl-delete-duplicates
- (mapcar #'poker-card-suit hand))) 
1)))
- (cond ((and straight flush) 8) (flush 5) (straight 4) (t 
0
- ((equal rank-counts '(2 2 1)) 2)
- ((equal rank-counts '(3 1 1)) 3)
- ((equal rank-counts '(3 2)) 6)
- ((equal rank-counts '(4 1)) 7))
-20)
+ rank-counts (mapcar #'car rank-counts))
+(logior (cond
+((eq ranks-length 4) #x10)
+((eq ranks-length 5)
+ (let ((straight (or (when (and (eq (nth 0 ranks) 12)
+(eq (nth 1 ranks) 3))
+   (setq ranks '(3 2 1 0 0)))
+ (eq (- (nth 0 ranks) (nth 4 ranks)) 4)))
+   (flush (not (cdr (delete-dups (mapcar #'poker-card-suit 
hand))
+   (cond ((and straight flush) #x80)
+ (straight #x40)
+ (flush #x50)
+ (t 0
+((equal rank-counts '(2 2 1)) #x20)
+((equal rank-counts '(3 1 1)) #x30)
+((equal rank-counts '(3 2)) #x60)
+((equal rank-counts '(4 1)) #x70))
(ash (nth 0 ranks) 16)
(ash (nth 1 ranks) 12)
(if (> ranks-length 2) (ash (nth 2 ranks) 8) 0)



[elpa] master ad8d826 2/2: Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs/elpa

2016-08-02 Thread Mario Lang
branch: master
commit ad8d826e80836478286b55247639b1288d35f47f
Merge: a5038a2 1f9393b
Author: Mario Lang 
Commit: Mario Lang 

Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs/elpa
---
 packages/loc-changes/el-get-install.el |  104 
 packages/stream/stream.el  |   14 -
 2 files changed, 12 insertions(+), 106 deletions(-)

diff --git a/packages/loc-changes/el-get-install.el 
b/packages/loc-changes/el-get-install.el
deleted file mode 100644
index 86c55ec..000
--- a/packages/loc-changes/el-get-install.el
+++ /dev/null
@@ -1,104 +0,0 @@
-(eval-when-compile
-  (defvar el-get-sources)
-)
-
-(declare-function el-get-post-install 'el-get)
-
-(add-to-list 'load-path "~/.emacs.d/el-get/el-get")
-
-;;; el-get-install.el --- installer for the lazy
-;;
-;; Copyright (C) 2010 Dimitri Fontaine
-;;
-;; Author: Dimitri Fontaine 
-;; URL: http://www.emacswiki.org/emacs/el-get.el
-;; Created: 2010-06-17
-;; Keywords: emacs package elisp install elpa git git-svn bzr cvs apt-get fink 
http http-tar
-;; Licence: WTFPL, grab your copy here: http://sam.zoy.org/wtfpl/
-;;
-;; This file is NOT part of GNU Emacs.
-;;
-;; bootstrap your el-get installation, the goal is then to use el-get to
-;; update el-get.
-;;
-;; So the idea is that you copy/paste this code into your *scratch* buffer,
-;; hit C-j, and you have a working el-get.
-
-(let ((el-get-root
-   (file-name-as-directory
-   (or (bound-and-true-p el-get-dir)
-   (concat (file-name-as-directory user-emacs-directory) "el-get")
-
-  (when (file-directory-p el-get-root)
-(add-to-list 'load-path el-get-root))
-
-  ;; try to require el-get, failure means we have to install it
-  (unless (require 'el-get nil t)
-(unless (file-directory-p el-get-root)
-  (make-directory el-get-root t))
-
-(let* ((package   "el-get")
-  (buf   (switch-to-buffer "*el-get bootstrap*"))
-  (pdir  (file-name-as-directory (concat el-get-root package)))
-  (git   (or (executable-find "git")
- (error "Unable to find `git'")))
-  (url   (or (bound-and-true-p el-get-git-install-url)
- "http://github.com/dimitri/el-get.git";))
-  (default-directory el-get-root)
-  (process-connection-type nil)   ; pipe, no pty (--no-progress)
-
-  ;; First clone el-get
-  (status
-   (call-process
-git nil `(,buf t) t "--no-pager" "clone" "-v" url package)))
-
-  (unless (zerop status)
-   (error "Couldn't clone el-get from the Git repository: %s" url))
-
-  ;; switch branch if we have to
-  (let* ((branch (cond
-  ;; Check if a specific branch is requested
-  ((bound-and-true-p el-get-install-branch))
-  ;; Check if master branch is requested
-  ((boundp 'el-get-master-branch) "master")
-  ;; Read the default branch from the el-get recipe
-  ((plist-get (with-temp-buffer
-(insert-file-contents-literally
- (expand-file-name "recipes/el-get.rcp" 
pdir))
-(read (current-buffer)))
-  :branch))
-  ;; As a last resort, use the master branch
-  ("master")))
- (remote-branch (format "origin/%s" branch))
- (default-directory pdir)
- (bstatus
-   (if (string-equal branch "master")
- 0
- (call-process git nil (list buf t) t "checkout" "-t" 
remote-branch
-(unless (zerop bstatus)
-  (error "Couldn't `git checkout -t %s`" branch)))
-
-  (add-to-list 'load-path pdir)
-  (load package)
-  (let ((el-get-default-process-sync t) ; force sync operations for 
installer
-(el-get-verbose t)); let's see it all
-(el-get-post-install "el-get"))
-  (with-current-buffer buf
-   (goto-char (point-max))
-   (insert "\nCongrats, el-get is installed and ready to serve!")
-
-
-(declare-function el-get 'el-get)
-
-;; now either el-get is `require'd already, or have been `load'ed by the
-;; el-get installer.
-(setq
- el-get-sources
- '(el-get  ; el-get is self-hosting
-   loc-changes ; loc marks in buffers
-   load-relative   ; load emacs lisp relative to emacs source
-   test-simple ; simple test framework
-   ))
-
-;; install new packages and init already installed packages
-(el-

[elpa] master a275e71: Improve poker-hand-value performance by 25%

2016-08-03 Thread Mario Lang
branch: master
commit a275e71c6ef8e3ece445d53582491fc606304d1b
Author: Mario Lang 
Commit: Mario Lang 

Improve poker-hand-value performance by 25%

Avoid unnecessary calls to poker-card-suit in flush check.
---
 packages/poker/poker.el |   13 +
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/packages/poker/poker.el b/packages/poker/poker.el
index c908bb6..61888ae 100644
--- a/packages/poker/poker.el
+++ b/packages/poker/poker.el
@@ -109,11 +109,16 @@ The highest possible value is therefore #x8CBA98 and the 
lowest is #x053210."
 (eq (nth 1 ranks) 3))
(setq ranks '(3 2 1 0 0)))
  (eq (- (nth 0 ranks) (nth 4 ranks)) 4)))
-   (flush (not (cdr (delete-dups (mapcar #'poker-card-suit 
hand))
+   (flush (let ((suit (poker-card-suit (car hand)))
+(tail (cdr hand)))
+(while (and tail
+(eq suit (poker-card-suit (car tail
+  (setq tail (cdr tail)))
+(not tail
(cond ((and straight flush) #x80)
- (straight #x40)
- (flush #x50)
- (t 0
+ (straight #x40)
+ (flush#x50)
+ (t  0
 ((equal rank-counts '(2 2 1)) #x20)
 ((equal rank-counts '(3 1 1)) #x30)
 ((equal rank-counts '(3 2)) #x60)



[elpa] master 87f30ef 2/2: Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs/elpa

2016-08-04 Thread Mario Lang
branch: master
commit 87f30ef8a74139e763f4248b7d1bc531b585186e
Merge: 87c8aaa d68f312
Author: Mario Lang 
Commit: Mario Lang 

Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs/elpa
---
 packages/realgud/.gitignore |1 +
 packages/realgud/INSTALL|  250 ---
 packages/realgud/INSTALL.md |5 +
 packages/realgud/Makefile.am|2 +-
 packages/realgud/THANKS |2 +-
 packages/realgud/autogen.sh |1 +
 packages/realgud/common.mk  |   10 --
 packages/realgud/common.mk.in   |   25 +++
 packages/realgud/configure.ac   |1 +
 packages/realgud/realgud.el |4 +
 packages/realgud/test/Makefile.am   |1 -
 packages/realgud/test/bt-helper.el  |1 -
 packages/realgud/test/test-buf-cmd.el   |1 +
 packages/realgud/test/test-regexp-gdb.el|1 +
 packages/realgud/test/test-regexp-rdebug.el |4 +
 15 files changed, 45 insertions(+), 264 deletions(-)

diff --git a/packages/realgud/.gitignore b/packages/realgud/.gitignore
index 125299c..843d43b 100644
--- a/packages/realgud/.gitignore
+++ b/packages/realgud/.gitignore
@@ -7,6 +7,7 @@
 /README
 /aclocal.m4
 /autom4te.cache
+/common.mk
 /config.log
 /config.status
 /configure
diff --git a/packages/realgud/INSTALL b/packages/realgud/INSTALL
deleted file mode 100644
index 0ea147f..000
--- a/packages/realgud/INSTALL
+++ /dev/null
@@ -1,250 +0,0 @@
-Installation Instructions
-*
-
-Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005,
-2006, 2007, 2008, 2009 Free Software Foundation, Inc.
-
-   Copying and distribution of this file, with or without modification,
-are permitted in any medium without royalty provided the copyright
-notice and this notice are preserved.  This file is offered as-is,
-without warranty of any kind.
-
-Basic Installation
-==
-
-   Briefly, the shell commands `./configure && make' should configure,
-and build this package.  If that succeeds `make install' will install
-the package. However on some systems you may need root privileges, you 
-may have to use `sudo make install' or perhaps `su root' beforehand.
-
-
-   See http://wiki.github.com/realgud/realgud/how-to-install for more
-detail as to how to install this package.
-
-Generic Information
-===
-
-   The `configure' shell script attempts to guess correct values for
-various system-dependent variables used during compilation.  It uses
-those values to create a `Makefile' in each directory of the package.
-It also creates a shell script `config.status' that you can run in
-the future to recreate the current configuration, and a file
-`config.log' containing compiler output (useful mainly for debugging
-`configure').
-
-   The configure script can also use an optional file (typically
-called `config.cache' and enabled with `--cache-file=config.cache' or
-simply `-C') that saves the results of its tests to speed up
-reconfiguring.  Caching is disabled by default to prevent problems
-with accidental use of stale cache files.
-
-   If you need to do unusual things to compile the package, please try
-to figure out how `configure' could check whether to do them, and mail
-diffs or instructions to the address given in the `README' so they can
-be considered for the next release.  If you are using the cache, and at
-some point `config.cache' contains results you don't want to keep, you
-may remove or edit it.
-
-   The file `configure.ac' is used to create `configure' by a program
-called `autoconf'.  You need `configure.ac' if you want to change it
-or regenerate `configure' using a newer version of `autoconf'.
-
-   The simplest way to compile this package is:
-
-  1. `cd' to the directory containing the package's source code and type
- `./configure' to configure the package for your system.
-
- Running `configure' might take a while.  While running, it prints
- some messages telling which features it is checking for.
-
-  2. Type `make' to compile the package.
-
-  3. Optionally, type `make check' to run any self-tests that come with
- the package, generally using the just-built uninstalled binaries.
-
-  4. Type `make install' to install the programs and any data files and
- documentation.  When installing into a prefix owned by root, it is
- recommended that the package be configured and built as a regular
- user, and only the `make install' phase executed with root
- privileges.
-
-  5. You can remove the compiled Emacs Lisp files and other derived
- files from the source code directory by typing `make clean'.  To
- also remove the files that `configure' created (so you ca

[elpa] master 87c8aaa 1/2: Improve performance of poker-hand-value by a factor of 4

2016-08-04 Thread Mario Lang
branch: master
commit 87c8aaaf72326f0fd3c9fbb1a9dd6a050890ce3a
Author: Mario Lang 
Commit: Mario Lang 

Improve performance of poker-hand-value by a factor of 4

`cl-count' is unnecessarily expensive, as it at least uses `length' and 
`nthcdr'
which we really don't need in this performance cricital code path.
Rewriting it without `cl-count' turns up another opportunity to speed up,
as we actually don't need to check the whole list to count occurances of
unique elements.  For one, we can start counting from 1 (not 0) if
we encounter the first element, and we only need to check the rest of the
list of cards.  Also, stop using `mapcar' with `poker-card-rank'
to allow it to actually be inlined.  This turns out to make poker-hand-value
*a lot* faster. Mission accomplished.
---
 packages/poker/poker.el |   22 --
 1 file changed, 16 insertions(+), 6 deletions(-)

diff --git a/packages/poker/poker.el b/packages/poker/poker.el
index 61888ae..d2896e7 100644
--- a/packages/poker/poker.el
+++ b/packages/poker/poker.el
@@ -93,15 +93,25 @@ RANK is one of `poker-ranks' and SUIT is one of 
`poker-suits'."
 The result is a 24 bit integer where the leftmost 4 bits (0-8) indicate the 
type
 of hand, and the remaining nibbles are rank values of decisive cards.
 The highest possible value is therefore #x8CBA98 and the lowest is #x053210."
-  (let* ((ranks (mapcar #'poker-card-rank hand))
-(rank-counts (sort (mapcar (lambda (rank) (cons (cl-count rank ranks) 
rank))
-   (cl-remove-duplicates ranks))
+  (let* ((rank-counts (sort (let ((cards hand) result)
+ (while cards
+   (let ((rank (poker-card-rank (car cards
+ (unless (rassq rank result)
+   (push (cons (let ((count 1))
+ (dolist (card (cdr cards) 
count)
+   (when (eq (poker-card-rank 
card)
+ rank)
+ (setq count (1+ count)
+   rank)
+ result)))
+   (setq cards (cdr cards)))
+ result)
(lambda (lhs rhs) (or (> (car lhs) (car rhs))
  (and (= (car lhs) (car rhs))
   (> (cdr lhs) (cdr 
rhs)))
-(ranks-length (length rank-counts)))
-(setq ranks (mapcar #'cdr rank-counts)
- rank-counts (mapcar #'car rank-counts))
+(ranks-length (length rank-counts))
+(ranks (mapcar #'cdr rank-counts)))
+(setq rank-counts (mapcar #'car rank-counts))
 (logior (cond
 ((eq ranks-length 4) #x10)
 ((eq ranks-length 5)



[elpa] master fe4bf34: Add a pre-flop hand strength table and an ert test for poker-hand-value

2016-08-05 Thread Mario Lang
branch: master
commit fe4bf34d509d5fdaa18ba9a9b2a0a48f1cabf7a9
Author: Mario Lang 
Commit: Mario Lang 

Add a pre-flop hand strength table and an ert test for poker-hand-value

Precalculated pre-flop starting hand values with 1^6 iterations.
Adjust `poker-strength' to use them when appropriate.
---
 packages/poker/poker.el |  318 +++
 1 file changed, 265 insertions(+), 53 deletions(-)

diff --git a/packages/poker/poker.el b/packages/poker/poker.el
index d2896e7..9bfe16b 100644
--- a/packages/poker/poker.el
+++ b/packages/poker/poker.el
@@ -57,6 +57,176 @@
  ((eq rank 'queen) #xD)
  ((eq rank 'king)  #XE)
  (trank
+(defconst poker-pre-flop-starting-hands
+  '((AA 0.8551 0.7375 0.6422 0.5622 0.4946 0.4388 0.3907 0.349 0.3134 0.2828)
+(KK 0.8273 0.692 0.586 0.5022 0.4331 0.3785 0.332 0.2951 0.2638 0.2386)
+(QQ 0.8017 0.6536 0.5387 0.4525 0.3829 0.3298 0.2878 0.2535 0.2265 0.2045)
+(JJ 0.7781 0.6166 0.496 0.4072 0.3406 0.2904 0.2511 0.2214 0.1984 0.181)
+(TT 0.7538 0.5807 0.4568 0.3689 0.3044 0.2577 0.2238 0.1979 0.1771 0.1626)
+(99 0.7251 0.541 0.4159 0.33 0.2709 0.2293 0.1989 0.1767 0.1605 0.1483)
+(88 0.6965 0.5052 0.3808 0.2995 0.2443 0.2084 0.1818 0.1634 0.1499 0.1391)
+(AKs 0.6787 0.5185 0.425 0.3655 0.3216 0.2876 0.2602 0.2362 0.2179 0.2004)
+(AQs 0.6718 0.5059 0.4104 0.3492 0.3056 0.272 0.2451 0.2228 0.2042 0.1884)
+(77 0.6674 0.47 0.3492 0.2728 0.2231 0.1912 0.1685 0.1524 0.141 0.1331)
+(AJs 0.6637 0.495 0.398 0.3365 0.2927 0.2591 0.2337 0.2131 0.1956 0.1813)
+(AK 0.6614 0.4933 0.3965 0.334 0.29 0.2556 0.2257 0.2027 0.183 0.1647)
+(ATs 0.6575 0.4845 0.388 0.3266 0.2827 0.2508 0.2259 0.2057 0.1888 0.1747)
+(AQ 0.6532 0.4804 0.3804 0.3175 0.2726 0.2376 0.2101 0.1858 0.1683 0.1521)
+(AJ 0.6467 0.4673 0.3673 0.3029 0.258 0.2241 0.197 0.1752 0.1569 0.1414)
+(KQs 0.6438 0.4828 0.3937 0.3377 0.2947 0.2639 0.2374 0.2156 0.1977 0.1825)
+(A9s 0.6404 0.4606 0.3617 0.2999 0.2574 0.2263 0.2032 0.184 0.1689 0.1556)
+(66 0.6394 0.4383 0.3205 0.2499 0.2054 0.178 0.1582 0.145 0.1353 0.1278)
+(AT 0.6389 0.4582 0.3555 0.2918 0.2467 0.2134 0.1878 0.1664 0.1492 0.1347)
+(KJs 0.6365 0.4712 0.3824 0.3244 0.2829 0.2513 0.2265 0.2071 0.1893 0.1755)
+(A8s 0.633 0.4531 0.354 0.2915 0.2498 0.219 0.1972 0.1785 0.1638 0.1511)
+(KTs 0.6302 0.4631 0.3713 0.3137 0.2736 0.2418 0.2185 0.1991 0.184 0.1703)
+(A7s 0.6261 0.4434 0.3436 0.2827 0.2425 0.2123 0.1908 0.1732 0.1592 0.1477)
+(KQ 0.6254 0.4559 0.3644 0.3051 0.2626 0.2289 0.2038 0.1814 0.1632 0.1476)
+(A9 0.6208 0.4325 0.3282 0.2635 0.2192 0.1866 0.1631 0.1429 0.127 0.1146)
+(A5s 0.6182 0.4351 0.3396 0.2804 0.2413 0.2142 0.1928 0.1757 0.1621 0.1513)
+(KJ 0.6167 0.4443 0.3509 0.291 0.2484 0.2166 0.1916 0.1702 0.1528 0.1387)
+(A6s 0.6162 0.4318 0.3326 0.2743 0.2351 0.2073 0.1867 0.1697 0.1564 0.1451)
+(QJs 0.6138 0.455 0.3702 0.3156 0.2762 0.2453 0.2211 0.2019 0.1855 0.1721)
+(A8 0.6132 0.4234 0.3185 0.2537 0.2109 0.1794 0.1557 0.1368 0.1216 0.1096)
+(K9s 0.613 0.439 0.3458 0.2865 0.2474 0.2179 0.1955 0.1764 0.1616 0.1501)
+(55 0.6097 0.4074 0.2951 0.2291 0.1908 0.1655 0.1491 0.1365 0.1291 0.1219)
+(KT 0.6095 0.4344 0.3391 0.2795 0.2377 0.2062 0.182 0.1623 0.1463 0.133)
+(A4s 0.6091 0.4264 0.3308 0.2737 0.2366 0.2094 0.1882 0.172 0.1584 0.1474)
+(QTs 0.6076 0.4459 0.3607 0.3052 0.2658 0.237 0.2141 0.1956 0.1803 0.1675)
+(A7 0.6049 0.4124 0.3085 0.2448 0.2018 0.1723 0.1499 0.1312 0.1164 0.1052)
+(A3s 0.6008 0.4184 0.323 0.2675 0.2316 0.204 0.1847 0.1685 0.1555 0.1443)
+(K8s 0.5985 0.4194 0.3251 0.2685 0.2291 0.2015 0.1799 0.1634 0.1499 0.1393)
+(A5 0.5976 0.4047 0.3026 0.2409 0.2012 0.1734 0.1514 0.1336 0.1196 0.1084)
+(A6 0.5945 0.4012 0.2965 0.2347 0.194 0.1654 0.1443 0.1275 0.113 0.1022)
+(QJ 0.5937 0.4274 0.34 0.2836 0.2426 0.2115 0.1873 0.167 0.1503 0.1374)
+(A2s 0.5928 0.4081 0.3147 0.2597 0.2244 0.1985 0.1793 0.1629 0.1503 0.1397)
+(K7s 0.5927 0.4121 0.3174 0.2617 0.224 0.1961 0.1761 0.1594 0.1461 0.1359)
+(K9 0.5922 0.4092 0.3108 0.251 0.21 0.1798 0.1562 0.138 0.123 0.1105)
+(Q9s 0.5909 0.4223 0.3346 0.2789 0.2404 0.2122 0.1898 0.1725 0.1592 0.1476)
+(JTs 0.5894 0.4354 0.3532 0.3017 0.2633 0.2351 0.2124 0.1954 0.1807 0.1688)
+(A4 0.5876 0.3943 0.2932 0.2339 0.1949 0.1673 0.146 0.1295 0.1164 0.105)
+(QT 0.5863 0.4173 0.3283 0.2712 0.2323 0.2017 0.1778 0.1589 0.1448 0.1325)
+(K6s 0.5858 0.4038 0.3101 0.2543 0.2173 0.1918 0.1719 0.1556 0.1434 0.1332)
+(A3 0.5784 0.3846 0.2848 0.2266 0.1894 0.1616 0.1416 0.1249 0.1122 0.1014)
+(K5s 0.5776 0.3947 0.3024 0.2488 0.2136 0.1876 0.1683 0.1531 0.1408 0.1309)
+(44 0.577 0.3741 0.2686 0.2114 0.1776 0.1564 0.1432 0.133 0.1256 0.11

[elpa] master daaaadf: Set default number of iterations to 300

2016-08-05 Thread Mario Lang
branch: master
commit ddf5433967b1c1ca8665e209b6de4b32db76
Author: Mario Lang 
Commit: Mario Lang 

Set default number of iterations to 300

Accidentally set too high in previous commit.
---
 packages/poker/poker.el |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/packages/poker/poker.el b/packages/poker/poker.el
index 9bfe16b..a630baf 100644
--- a/packages/poker/poker.el
+++ b/packages/poker/poker.el
@@ -446,7 +446,7 @@ The optional number of OPPONENTS defaults to 1."
   (nth (or opponents 1)
(assq (poker-starting-hand-name pocket)
  poker-pre-flop-starting-hands)))
-  (let ((wins 0) (iterations 1000))
+  (let ((wins 0) (iterations 300))
(dotimes (i iterations)
  (let ((deck (poker-random-deck))
(players (make-vector (or opponents 1) nil)))



[elpa] master b24a4b1: [poker] Version 0.2, update copyright years and add todo

2016-08-11 Thread Mario Lang
branch: master
commit b24a4b18b8ca1bf225be7b8db16ff61028e633b1
Author: Mario Lang 
Commit: Mario Lang 

[poker] Version 0.2, update copyright years and add todo
---
 packages/poker/poker.el |   10 --
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/packages/poker/poker.el b/packages/poker/poker.el
index a630baf..fbfa78c 100644
--- a/packages/poker/poker.el
+++ b/packages/poker/poker.el
@@ -1,10 +1,10 @@
 ;;; poker.el --- Texas hold 'em poker
 
-;; Copyright (C) 2014  Free Software Foundation, Inc.
+;; Copyright (C) 2014, 2016  Free Software Foundation, Inc.
 
 ;; Author: Mario Lang 
 ;; Maintainer: Mario Lang 
-;; Version: 0.1
+;; Version: 0.2
 ;; Keywords: games
 
 ;; This program is free software; you can redistribute it and/or modify
@@ -24,6 +24,12 @@
 
 ;; poker.el provides Texas hold 'em poker gameplay for Emacs.
 
+;;; Todo:
+
+;; * Provide a better user interface.  A buffer should be used to keep
+;;   the state and visual representation of a table/game.
+;; * Smarter AIs.
+
 ;;; Requires:
 
 (require 'cl-lib)



[elpa] master 3d0eb58: Adjust for NOAA server changes.

2016-09-27 Thread Mario Lang
branch: master
commit 3d0eb5819af4af256e0160eda84f301275876631
Author: Mark Oteiza 
Commit: Mario Lang 

Adjust for NOAA server changes.
---
 packages/metar/metar.el |   32 +++-
 1 file changed, 15 insertions(+), 17 deletions(-)

diff --git a/packages/metar/metar.el b/packages/metar/metar.el
index b6989ea..570e6b1 100644
--- a/packages/metar/metar.el
+++ b/packages/metar/metar.el
@@ -83,7 +83,7 @@
 (const :tag "Degree Kelvin" degK)
 (const :tag "Degree Fahrenheit" degF)
 
-(defcustom metar-stations-info-url "http://weather.noaa.gov/data/nsd_bbsss.txt";
+(defcustom metar-stations-info-url 
"http://tgftp.nws.noaa.gov/data/nsd_.txt";
   "URL to use for retrieving station meta information."
   :group 'metar
   :type 'string)
@@ -117,23 +117,21 @@ If this variable is nil, the information is retrieved 
from the Internet."
  (split-string entry ";"))
(split-string (buffer-string) "\n")
(setq metar-stations nil)
-   (while data
- (when (and (nth 7 (car data)) (nth 8 (car data))
-(not (string= (nth 2 (car data)) "")))
+   (dolist (entry data)
+ (when (and (nth 7 entry) (nth 8 entry)
+(not (string= (nth 0 entry) "")))
(setq metar-stations
  (append
-  (let ((item (car data)))
-(list
- (list (cons 'code (nth 2 item))
-   (cons 'name (nth 3 item))
-   (cons 'country (nth 5 item))
-   (cons 'latitude
- (metar-station-convert-dms-to-deg (nth 7 
item)))
-   (cons 'longitude
- (metar-station-convert-dms-to-deg (nth 8 
item)))
-   (cons 'altitude (string-to-number (nth 12 item))
-  metar-stations)))
- (setq data (cdr data)))
+  (list
+(list (cons 'code (nth 0 entry))
+  (cons 'name (nth 3 entry))
+  (cons 'country (nth 5 entry))
+  (cons 'latitude
+(metar-station-convert-dms-to-deg (nth 7 
entry)))
+  (cons 'longitude
+(metar-station-convert-dms-to-deg (nth 8 
entry)))
+  (cons 'altitude (string-to-number (nth 11 entry)
+  metar-stations
;; (unless metar-timer
;;   (setq metar-timer
;;  (run-with-timer 600 nil (lambda () (setq metar-stations nil)
@@ -281,7 +279,7 @@ It must have the signature of `math-convert-units', which 
is the default."
  pure
 
 (defcustom metar-url
-  "http://weather.noaa.gov/pub/data/observations/metar/stations/%s.TXT";
+  "http://tgftp.nws.noaa.gov/data/observations/metar/stations/%s.TXT";
   "URL used to fetch station specific information.
 %s is replaced with the 4 letter station code."
   :group 'metar



[elpa] master d56dd03: Improve single precision floating point serialisation

2019-12-18 Thread Mario Lang
branch: master
commit d56dd0378c5f8a582066c636599be1f297691142
Author: Mario Lang 
Commit: Mario Lang 

Improve single precision floating point serialisation

* packages/osc/osc.el: Update copyright years and author email.
* (osc-insert-float32): Use `copysign' and `isnan'.
---
 packages/osc/osc.el | 12 +---
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/packages/osc/osc.el b/packages/osc/osc.el
index 9f92b17..316b532 100644
--- a/packages/osc/osc.el
+++ b/packages/osc/osc.el
@@ -1,8 +1,8 @@
 ;;; osc.el --- Open Sound Control protocol library
 
-;; Copyright (C) 2014  Free Software Foundation, Inc.
+;; Copyright (C) 2014-2019  Free Software Foundation, Inc.
 
-;; Author: Mario Lang 
+;; Author: Mario Lang 
 ;; Version: 0.1
 ;; Keywords: comm, processes, multimedia
 
@@ -57,15 +57,13 @@
 (defun osc-insert-float32 (value)
   (let (s (e 0) f)
 (cond
- ((string= (format "%f" value) (format "%f" -0.0))
-  (setq s 1 f 0))
- ((string= (format "%f" value) (format "%f" 0.0))
-  (setq s 0 f 0))
+ ((= value 0.0)
+  (setq s (if (< (copysign 1.0 value) 0) 1 0) f 0))
  ((= value 1.0e+INF)
   (setq s 0 e 255 f (1- (expt 2 23
  ((= value -1.0e+INF)
   (setq s 1 e 255 f (1- (expt 2 23
- ((string= (format "%f" value) (format "%f" 0.0e+NaN))
+ ((isnan value)
   (setq s 0 e 255 f 1))
  (t
   (setq s (if (>= value 0.0)



[elpa] master 4db95ab: Concatenate messages instead of using a temp-buffer and buffer-string

2019-12-19 Thread Mario Lang
branch: master
commit 4db95ab266983bf89adcd17d17b91aee1a1b43b4
Author: Mario Lang 
Commit: Mario Lang 

Concatenate messages instead of using a temp-buffer and buffer-string

* packages/osc/osc.el: (osc-float32, osc-int32, osc-string): New functions.
* (osc-insert-float32, osc-insert-int32, osc-insert-string): Remove.
* (osc-send-message): Adjust.
---
 packages/osc/osc.el | 59 +
 1 file changed, 32 insertions(+), 27 deletions(-)

diff --git a/packages/osc/osc.el b/packages/osc/osc.el
index 316b532..e88f135 100644
--- a/packages/osc/osc.el
+++ b/packages/osc/osc.el
@@ -51,10 +51,11 @@
 
 (require 'cl-lib)
 
-(defun osc-insert-string (string)
-  (insert string 0 (make-string (- 3 (% (length string) 4)) 0)))
+(defun osc-string (string)
+  (setq string (encode-coding-string string 'binary))
+  (concat string (make-string (1+ (- 3 (% (length string) 4))) 0)))
 
-(defun osc-insert-float32 (value)
+(defun osc-float32 (value)
   (let (s (e 0) f)
 (cond
  ((= value 0.0)
@@ -73,18 +74,17 @@
   (if (= e 0) (while (< (* f (expt 2.0 e)) 1.0) (setq e (1+ e
   (setq f (round (* (1- (* f (expt 2.0 e))) (expt 2 23)))
e (+ (* -1 e) 127
-(insert (+ (lsh s 7) (lsh (logand e #XFE) -1))
-   (+ (lsh (logand e #X01) 7) (lsh (logand f #X7F) -16))
-   (lsh (logand f #XFF00) -8)
-   (logand f #XFF
+(unibyte-string (+ (lsh s 7) (lsh (logand e #XFE) -1))
+   (+ (lsh (logand e #X01) 7) (lsh (logand f #X7F) -16))
+   (lsh (logand f #XFF00) -8)
+   (logand f #XFF
 
-(defun osc-insert-int32 (value)
+(defun osc-int32 (value)
   (let (bytes)
 (dotimes (i 4)
   (push (% value 256) bytes)
   (setq value (/ value 256)))
-(dolist (byte bytes)
-  (insert byte
+(apply 'unibyte-string bytes)))
 
 ;;;###autoload
 (defun osc-make-client (host port)
@@ -99,23 +99,28 @@
 ;;;###autoload
 (defun osc-send-message (client path &rest args)
   "Send an OSC message from CLIENT to the specified PATH with ARGS."
-  (with-temp-buffer
-(set-buffer-multibyte nil)
-(osc-insert-string path)
-(osc-insert-string
- (apply 'concat "," (mapcar (lambda (arg)
- (cond
-  ((floatp arg) "f")
-  ((integerp arg) "i")
-  ((stringp arg) "s")
-  (t (error "Invalid argument: %S" arg
-   args)))
-(dolist (arg args)
-  (cond
-   ((floatp arg) (osc-insert-float32 arg))
-   ((integerp arg) (osc-insert-int32 arg))
-   ((stringp arg) (osc-insert-string arg
-(process-send-string client (buffer-string
+  (process-send-string
+   client
+   (apply
+'concat
+(osc-string path)
+(osc-string
+ (apply
+  'concat ","
+  (mapcar (lambda (arg)
+   (cond
+((floatp arg) "f")
+((integerp arg) "i")
+((stringp arg) "s")
+(t (error "Invalid argument: %S" arg
+ args)))
+(mapcar
+ (lambda (arg)
+   (cond
+   ((floatp arg) (osc-float32 arg))
+   ((integerp arg) (osc-int32 arg))
+   ((stringp arg) (osc-string arg
+ args
 
 (defun osc-read-string ()
   (let ((pos (point)) string)



[elpa] master dcb301b 1/2: Support for binary blobs

2019-12-19 Thread Mario Lang
branch: master
commit dcb301bb9894e2862183317622e6207bc0b8e8ed
Author: Mario Lang 
Commit: Mario Lang 

Support for binary blobs

* packages/osc/osc.el: (osc-blob, osc-read-blob): New functions.
* (osc-send-message, osc-filter): Adjust.
---
 packages/osc/osc.el | 25 ++---
 1 file changed, 22 insertions(+), 3 deletions(-)

diff --git a/packages/osc/osc.el b/packages/osc/osc.el
index e88f135..5450751 100644
--- a/packages/osc/osc.el
+++ b/packages/osc/osc.el
@@ -35,7 +35,7 @@
 
 ;; BUGS/TODO:
 ;;
-;; * Timetags and binary blobs are not supported yet.
+;; * Timetags are not supported yet.
 
 ;; Usage:
 ;;
@@ -55,6 +55,12 @@
   (setq string (encode-coding-string string 'binary))
   (concat string (make-string (1+ (- 3 (% (length string) 4))) 0)))
 
+(defun osc-blob (vector)
+  (let ((length (length vector)))
+(concat (osc-int32 length)
+   vector
+   (make-string (% (- 4 (% length 4)) 4) 0
+
 (defun osc-float32 (value)
   (let (s (e 0) f)
 (cond
@@ -112,6 +118,7 @@
 ((floatp arg) "f")
 ((integerp arg) "i")
 ((stringp arg) "s")
+((vectorp arg) "b")
 (t (error "Invalid argument: %S" arg
  args)))
 (mapcar
@@ -119,7 +126,8 @@
(cond
((floatp arg) (osc-float32 arg))
((integerp arg) (osc-int32 arg))
-   ((stringp arg) (osc-string arg
+   ((stringp arg) (osc-string arg))
+   ((vectorp arg) (osc-blob arg
  args
 
 (defun osc-read-string ()
@@ -129,6 +137,16 @@
 (forward-char (- 4 (% (length string) 4)))
 string))
 
+(defun osc-read-blob ()
+  (let* ((length (osc-read-int32))
+(pos (point))
+(vector (progn
+  (forward-char length)
+  (string-to-vector (buffer-substring pos (point)
+(padding (% (- 4 (% length 4)) 4)))
+(forward-char padding)
+vector))
+
 (defun osc-read-int32 ()
   (let ((value 0))
 (dotimes (i 4)
@@ -179,13 +197,14 @@ the generic handler for SERVER."
   (goto-char (point-min))
   (let ((path (osc-read-string)))
(if (not (string= path "#bundle"))
-   (when (looking-at ",")
+   (when (= (char-after) ?,)
  (save-excursion
(apply (osc-server-get-handler proc path)
   path
   (mapcar
(lambda (type)
  (cl-case type
+   (?b (osc-read-blob))
(?f (osc-read-float32))
(?i (osc-read-int32))
(?s (osc-read-string



[elpa] master 2604824 2/2: Release version 0.2

2019-12-19 Thread Mario Lang
branch: master
commit 2604824e5dfbe1ba23210f9d5c966fd8918832c4
Author: Mario Lang 
Commit: Mario Lang 

Release version 0.2
---
 packages/osc/osc.el | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/packages/osc/osc.el b/packages/osc/osc.el
index 5450751..a63d382 100644
--- a/packages/osc/osc.el
+++ b/packages/osc/osc.el
@@ -3,7 +3,7 @@
 ;; Copyright (C) 2014-2019  Free Software Foundation, Inc.
 
 ;; Author: Mario Lang 
-;; Version: 0.1
+;; Version: 0.2
 ;; Keywords: comm, processes, multimedia
 
 ;; This program is free software; you can redistribute it and/or modify
@@ -39,11 +39,11 @@
 
 ;; Usage:
 ;;
-;; Client: (setq my-client (osc-make-client "localhost" 7770))
+;; Client: (setq my-client (osc-make-client "127.0.0.1" 7770))
 ;; (osc-send-message my-client "/osc/path" 1.5 1.0 5 "done")
 ;; (delete-process my-client)
 ;;
-;; Server: (setq my-server (osc-make-server "localhost" 7770
+;; Server: (setq my-server (osc-make-server "127.0.0.1" 7770
 ;;  (lambda (path &rest args)
 ;;(message "OSC %s: %S" path args
 



[elpa] master updated (4db95ab -> 2604824)

2019-12-19 Thread Mario Lang
mlang pushed a change to branch master.

  from  4db95ab   Concatenate messages instead of using a temp-buffer and 
buffer-string
   new  dcb301b   Support for binary blobs
   new  2604824   Release version 0.2


Summary of changes:
 packages/osc/osc.el | 31 +--
 1 file changed, 25 insertions(+), 6 deletions(-)



[elpa] externals/chess 7193c24 2/2: * chess-network.el (chess-network-handler): Use `executable-find'.

2020-09-19 Thread Mario Lang
branch: externals/chess
commit 7193c24769d463ae8920a2f8143f8cc3d0122eb1
Author: Mario Lang 
Commit: Mario Lang 

* chess-network.el (chess-network-handler): Use `executable-find'.
---
 chess-network.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/chess-network.el b/chess-network.el
index c9a6b3d..16f7aa7 100644
--- a/chess-network.el
+++ b/chess-network.el
@@ -144,7 +144,7 @@
  (string-to-number
   (read-string "Port: ")))
(start-process "*chess-network*"
-  (current-buffer) "/usr/bin/nc"
+  (current-buffer) (executable-find "nc")
   "-l" "-p" (read-string "Port: ")))
(open-network-stream "*chess-network*" (current-buffer)
 (read-string "Host: ")



[elpa] externals/chess updated (31a581b -> 7193c24)

2020-09-19 Thread Mario Lang
mlang pushed a change to branch externals/chess.

  from  31a581b   * chess-pgn.el (chess-pgn-parse): Fix unescaped character 
literal
   new  2d797ff   * chess-game.el (chess-game-ply): Fix docstring.
   new  7193c24   * chess-network.el (chess-network-handler): Use 
`executable-find'.


Summary of changes:
 chess-game.el| 2 +-
 chess-network.el | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)



[elpa] externals/chess 2d797ff 1/2: * chess-game.el (chess-game-ply): Fix docstring.

2020-09-19 Thread Mario Lang
branch: externals/chess
commit 2d797ff3a3e9d8e0019feec7fa99a34b5d15ad42
Author: Mario Lang 
Commit: Mario Lang 

* chess-game.el (chess-game-ply): Fix docstring.
---
 chess-game.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/chess-game.el b/chess-game.el
index d86f159..06b99fb 100644
--- a/chess-game.el
+++ b/chess-game.el
@@ -222,7 +222,7 @@ if INDEX is nil)."
 
 (defun chess-game-ply (game &optional index)
   "Return a ply of GAME.
-If INDEX is non-nil, the last played ply is returned."
+If INDEX is nil, the last played ply is returned."
   (cl-assert game)
   (if index
   (nth index (chess-game-plies game))



[elpa] 01/01: Add new simple package poker.el.

2014-05-17 Thread Mario Lang
mlang pushed a commit to branch master
in repository elpa.

commit ef28a81e024a280c65016ec2088ebebb8dacda4d
Author: Mario Lang 
Date:   Sun May 18 00:15:27 2014 +0200

Add new simple package poker.el.
---
 packages/poker/poker.el |  862 +++
 1 files changed, 862 insertions(+), 0 deletions(-)

diff --git a/packages/poker/poker.el b/packages/poker/poker.el
new file mode 100644
index 000..d57a851
--- /dev/null
+++ b/packages/poker/poker.el
@@ -0,0 +1,862 @@
+;;; poker.el --- Texas hold'em poker
+
+;; Copyright (C) 2014  Free Software Foundation, Inc.
+
+;; Author: Mario Lang 
+;; Maintainer: Mario Lang 
+;; Version: 0.1
+;; Keywords: games
+
+;; 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 <http://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; poker.el provides texas hold'em poker gameplay for Emacs.
+
+;;; Requires:
+
+(require 'cl-lib)
+(require 'cookie1)
+(require 'ert)
+
+;;; Compatibility:
+
+(eval-and-compile
+  (unless (fboundp 'cookie-shuffle-vector)
+(defalias 'cookie-shuffle-vector 'shuffle-vector)))
+
+;;; Constants:
+
+(defconst poker-ranks '(2 3 4 5 6 7 8 9 10 jack queen king ace))
+(defconst poker-suits '(clubs diamonds hearts spades))
+(defconst poker-deck (cl-loop for card from 0 to 51 collect card))
+(defconst poker-unicode-cards
+  (let ((unicode-suit '((clubs . #xD0) (diamonds . #XC0)
+   (hearts . #XB0) (spades . #XA0
+(apply #'vector
+  (cl-loop for suit in poker-suits
+   nconc
+   (cl-loop for rank in poker-ranks
+collect
+(logior #x1f000
+(cdr (assq suit unicode-suit))
+(cond
+ ((eq rank 'ace)   #x1)
+ ((eq rank 'jack)  #xB)
+ ((eq rank 'queen) #xD)
+ ((eq rank 'king)  #XE)
+ (trank
+
+;;; Code:
+
+(defsubst poker-make-card (rank suit)
+  "Make a poker card from RANK and SUIT.
+RANK is one of `poker-ranks' and SUIT is one of `poker-suits'."
+  (cl-assert (memq rank poker-ranks))
+  (cl-assert (memq suit poker-suits))
+  (+ (* (cl-position suit poker-suits) 13) (cl-position rank poker-ranks)))
+
+(defsubst poker-card-rank (card)
+  "The rank (a integer from 0 to 12) of a poker CARD."
+  (cl-check-type card (integer 0 51))
+  (% card 13))
+
+(defsubst poker-card-suit (card)
+  "The suit (an integer from 0 to 3) of a poker CARD."
+  (cl-check-type card (integer 0 51))
+  (/ card 13))
+
+(defsubst poker-card-name (card)
+  "The name of a poker CARD (a string of two characters)."
+  (cl-check-type card (integer 0 51))
+  (concat (aref ["2" "3" "4" "5" "6" "7" "8" "9" "T" "J" "Q" "K" "A"]
+   (poker-card-rank card))
+ (aref ["c" "d" "h" "s"] (poker-card-suit card
+
+(defun poker-card-unicode (card)
+  "The Unicode character for a poker CARD."
+  (aref poker-unicode-cards card))
+
+(defun poker-hand-value (hand)
+  "Calculate the value of a given 5 card poker HAND.
+The result is a 24 bit integer where the leftmost 4 bits (0-8) indicate the 
type
+of hand, and the remaining nibbles are rank values of decisive cards.
+The highest possible value is therefore #x8CBA98 and the lowest is #x053210."
+  (let* ((ranks (mapcar #'poker-card-rank hand))
+(rank-counts (sort (mapcar (lambda (rank) (cons (cl-count rank ranks) 
rank))
+   (cl-remove-duplicates ranks))
+   (lambda (lhs rhs) (or (> (car lhs) (car rhs))
+ (and (= (car lhs) (car rhs))
+  (> (cdr lhs) (cdr 
rhs)))
+(ranks-length nil))
+(setq ranks (mapcar #'cdr rank-counts)
+ rank-counts (mapcar #'car rank-counts)
+ ranks-length (length ranks))
+(logior (ash (cond
+ 

[elpa] branch master updated (b66b467 -> ef28a81)

2014-05-17 Thread Mario Lang
mlang pushed a change to branch master
in repository elpa.

  from  b66b467   [xpm maint] Add HACKING; nfc.
   new  ef28a81   Add new simple package poker.el.

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/poker/poker.el |  862 +++
 1 files changed, 862 insertions(+), 0 deletions(-)
 create mode 100644 packages/poker/poker.el



[elpa] branch master updated (43ce3a8 -> a2d6129)

2014-05-18 Thread Mario Lang
mlang pushed a change to branch master
in repository elpa.

  from  43ce3a8   [gnugo int] Accomodate XPM w/ :color-symbols property.
   new  a2d6129   Initial import of chess.el.

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/.elpaignore|5 +
 packages/chess/Makefile   |   26 +
 packages/chess/chess-ai.el|  342 ++
 packages/chess/chess-algebraic.el |  205 +
 packages/chess/chess-announce.el  |  125 +
 packages/chess/chess-autosave.el  |  141 +
 packages/chess/chess-chat.el  |   48 +
 packages/chess/chess-clock.el |  104 +
 packages/chess/chess-common.el|  109 +
 packages/chess/chess-crafty.el|  163 +
 packages/chess/chess-database.el  |  100 +
 packages/chess/chess-display.el   | 1261 +
 packages/chess/chess-eco.el   |  142 +
 packages/chess/chess-eco.fen  |2 +
 packages/chess/chess-eco.pos  |10565 +
 packages/chess/chess-engine.el|  458 ++
 packages/chess/chess-epd.el   |  145 +
 packages/chess/chess-fen.el   |  140 +
 packages/chess/chess-file.el  |  105 +
 packages/chess/chess-fruit.el |   59 +
 packages/chess/chess-game.el  |  333 ++
 packages/chess/chess-german.el|  121 +
 packages/chess/chess-glaurung.el  |   59 +
 packages/chess/chess-gnuchess.el  |   83 +
 packages/chess/chess-ics.el   | 1085 
 packages/chess/chess-ics1.el  |  139 +
 packages/chess/chess-images.el|  569 ++
 packages/chess/chess-input.el |  138 +
 packages/chess/chess-irc.el   |  148 +
 packages/chess/chess-kibitz.el|   68 +
 packages/chess/chess-link.el  |   84 +
 packages/chess/chess-log.el   |   20 +
 packages/chess/chess-message.el   |   46 +
 packages/chess/chess-module.el|  108 +
 packages/chess/chess-network.el   |  220 +
 packages/chess/chess-none.el  |   28 +
 packages/chess/chess-perft.el |  225 +
 packages/chess/chess-pgn.el   |  426 ++
 packages/chess/chess-phalanx.el   |   68 +
 packages/chess/chess-plain.el |  311 ++
 packages/chess/chess-ply.el   |  474 ++
 packages/chess/chess-polyglot.bin |  Bin 0 -> 10 bytes
 packages/chess/chess-polyglot.el  |  549 ++
 packages/chess/chess-pos.el   | 1131 
 packages/chess/chess-puzzle.el|  105 +
 packages/chess/chess-random.el|   65 +
 packages/chess/chess-scid.el  |  211 +
 packages/chess/chess-sjeng.el |  121 +
 packages/chess/chess-sound.el |  110 +
 packages/chess/chess-stockfish.el |   70 +
 packages/chess/chess-test.el  |   73 +
 packages/chess/chess-transport.el |   43 +
 packages/chess/chess-tutorial.el  |   45 +
 packages/chess/chess-ucb.el   |   90 +
 packages/chess/chess-uci.el   |  141 +
 packages/chess/chess-var.el   |   89 +
 packages/chess/chess.el   |  231 +
 packages/chess/chess.info | 1542 ++
 packages/chess/chess.texi | 1576 ++
 packages/chess/dir|   18 +
 60 files changed, 25208 insertions(+), 0 deletions(-)
 create mode 100644 packages/chess/.elpaignore
 create mode 100644 packages/chess/Makefile
 create mode 100644 packages/chess/chess-ai.el
 create mode 100644 packages/chess/chess-algebraic.el
 create mode 100644 packages/chess/chess-announce.el
 create mode 100644 packages/chess/chess-autosave.el
 create mode 100644 packages/chess/chess-chat.el
 create mode 100644 packages/chess/chess-clock.el
 create mode 100644 packages/chess/chess-common.el
 create mode 100644 packages/chess/chess-crafty.el
 create mode 100644 packages/chess/chess-database.el
 create mode 100644 packages/chess/chess-display.el
 create mode 100644 packages/chess/chess-eco.el
 create mode 100644 packages/chess/chess-eco.fen
 create mode 100644 packages/chess/chess-eco.pos
 create mode 100644 packages/chess/chess-engine.el
 create mode 100644 packages/chess/chess-epd.el
 create mode 100644 packages/chess/chess-fen.el
 create mode 100644 packages/chess/chess-file.el
 create mode 100644 packages/chess/chess-fruit.el
 create mode 100644 packages/chess/chess-game.el
 create mode 100644 packages/chess/chess-german.el
 create mode 100644 packages/chess/chess-glaurung.el
 create mode 100644 packages/chess/chess-gnuchess.el
 create mode 100644 packages/chess/chess-ics.el
 create mode 100644 packages/chess/chess-ics1.el
 create mode 100644 packages/chess/chess-images.el
 create mode 100644 packages/chess/chess-input.el
 create mode 100644 packages/chess/chess-irc.el
 create mode 100644 packages/chess/chess-kibitz.el
 create mode 100644 packages/chess/chess-link.el
 create mode 100644 packages/chess/chess-log.el
 create mode 100644 packages/chess/chess-message.el
 create mode 100644 packages/chess/chess-module.el
 create mode 100644 packages/chess/chess-network.el
 create mode 100644 packages/che

[elpa] branch master updated (74183c5 -> 62451e0)

2014-05-21 Thread Mario Lang
mlang pushed a change to branch master
in repository elpa.

  from  74183c5   * .gitignore: Add ergoemacs-mode.
   new  62451e0   Move chess.el to externals/chess branch.

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:
 externals-list|1 +
 packages/chess/.elpaignore|5 -
 packages/chess/Makefile   |   26 -
 packages/chess/chess-ai.el|  342 --
 packages/chess/chess-algebraic.el |  221 -
 packages/chess/chess-announce.el  |  141 -
 packages/chess/chess-autosave.el  |  157 -
 packages/chess/chess-chat.el  |   65 -
 packages/chess/chess-clock.el |  120 -
 packages/chess/chess-common.el|  128 -
 packages/chess/chess-crafty.el|  179 -
 packages/chess/chess-database.el  |  116 -
 packages/chess/chess-display.el   | 1277 -
 packages/chess/chess-eco.el   |  142 -
 packages/chess/chess-eco.fen  |2 -
 packages/chess/chess-eco.pos  |10565 -
 packages/chess/chess-engine.el|  472 --
 packages/chess/chess-epd.el   |  145 -
 packages/chess/chess-fen.el   |  156 -
 packages/chess/chess-file.el  |  123 -
 packages/chess/chess-fruit.el |   59 -
 packages/chess/chess-game.el  |  347 --
 packages/chess/chess-german.el|  137 -
 packages/chess/chess-glaurung.el  |   59 -
 packages/chess/chess-gnuchess.el  |   99 -
 packages/chess/chess-ics.el   | 1087 
 packages/chess/chess-ics1.el  |  155 -
 packages/chess/chess-images.el|  583 --
 packages/chess/chess-input.el |  154 -
 packages/chess/chess-irc.el   |  164 -
 packages/chess/chess-kibitz.el|   86 -
 packages/chess/chess-link.el  |  102 -
 packages/chess/chess-log.el   |   34 -
 packages/chess/chess-message.el   |   62 -
 packages/chess/chess-module.el|  124 -
 packages/chess/chess-network.el   |  236 -
 packages/chess/chess-none.el  |   46 -
 packages/chess/chess-perft.el |  225 -
 packages/chess/chess-pgn.el   |  442 --
 packages/chess/chess-phalanx.el   |   68 -
 packages/chess/chess-plain.el |  327 --
 packages/chess/chess-ply.el   |  486 --
 packages/chess/chess-polyglot.bin |  Bin 10 -> 0 bytes
 packages/chess/chess-polyglot.el  |  549 --
 packages/chess/chess-pos.el   | 1143 
 packages/chess/chess-puzzle.el|  121 -
 packages/chess/chess-random.el|   81 -
 packages/chess/chess-scid.el  |  227 -
 packages/chess/chess-sjeng.el |  121 -
 packages/chess/chess-sound.el |  128 -
 packages/chess/chess-stockfish.el |   70 -
 packages/chess/chess-test.el  |   94 -
 packages/chess/chess-transport.el |   61 -
 packages/chess/chess-tutorial.el  |   61 -
 packages/chess/chess-ucb.el   |  106 -
 packages/chess/chess-uci.el   |  141 -
 packages/chess/chess-var.el   |  103 -
 packages/chess/chess.el   |  228 -
 packages/chess/chess.info | 1542 --
 packages/chess/chess.texi | 1576 --
 packages/chess/dir|   18 -
 61 files changed, 1 insertions(+), 25834 deletions(-)
 delete mode 100644 packages/chess/.elpaignore
 delete mode 100644 packages/chess/Makefile
 delete mode 100644 packages/chess/chess-ai.el
 delete mode 100644 packages/chess/chess-algebraic.el
 delete mode 100644 packages/chess/chess-announce.el
 delete mode 100644 packages/chess/chess-autosave.el
 delete mode 100644 packages/chess/chess-chat.el
 delete mode 100644 packages/chess/chess-clock.el
 delete mode 100644 packages/chess/chess-common.el
 delete mode 100644 packages/chess/chess-crafty.el
 delete mode 100644 packages/chess/chess-database.el
 delete mode 100644 packages/chess/chess-display.el
 delete mode 100644 packages/chess/chess-eco.el
 delete mode 100644 packages/chess/chess-eco.fen
 delete mode 100644 packages/chess/chess-eco.pos
 delete mode 100644 packages/chess/chess-engine.el
 delete mode 100644 packages/chess/chess-epd.el
 delete mode 100644 packages/chess/chess-fen.el
 delete mode 100644 packages/chess/chess-file.el
 delete mode 100644 packages/chess/chess-fruit.el
 delete mode 100644 packages/chess/chess-game.el
 delete mode 100644 packages/chess/chess-german.el
 delete mode 100644 packages/chess/chess-glaurung.el
 delete mode 100644 packages/chess/chess-gnuchess.el
 delete mode 100644 packages/chess/chess-ics.el
 delete mode 100644 packages/chess/chess-ics1.el
 delete mode 100644 packages/chess/chess-images.el
 delete mode 100644 packages/chess/chess-input.el
 delete mode 100644 packages/chess/chess-irc.el
 delete mode 100644 packages/chess/chess-kibitz.el
 delete mode 100644 packages/chess/chess-link.el
 delete mode 100644 packages/chess/chess-log.el
 delete mode 100644 packages/chess/chess-message.el
 delete mode 100644 packages/chess/chess-module.el
 delete mode 100644 packages/chess/chess-network

[elpa] branch master updated (62451e0 -> 4c0ae95)

2014-05-21 Thread Mario Lang
mlang pushed a change to branch master
in repository elpa.

  from  62451e0   Move chess.el to externals/chess branch.
   new  4c0ae95   Add packages/chess to .gitignore.

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



[elpa] 01/01: Add packages/chess to .gitignore.

2014-05-21 Thread Mario Lang
mlang pushed a commit to branch master
in repository elpa.

commit 4c0ae95a66eb83bb403f1182532116b2a75a653b
Author: Mario Lang 
Date:   Wed May 21 22:46:41 2014 +0200

Add packages/chess to .gitignore.
---
 .gitignore |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/.gitignore b/.gitignore
index c24ae92..5de4b9d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -7,6 +7,7 @@ packages/*/*-pkg.el
 
 # External packages with their own .git tree.
 packages/auctex
+packages/chess
 packages/dismal
 packages/rudel
 packages/w3



[elpa] branch externals/chess updated (239405f -> ad29c2d)

2014-05-21 Thread Mario Lang
mlang pushed a change to branch externals/chess
in repository elpa.

  from  239405f   Remove old file.
   new  ad29c2d   Add XBoard-based XPM piece images.

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:
 pieces|1 -
 pieces/xboard/bdd108.xpm  |  117 
 pieces/xboard/bdd116.xpm  |  125 +
 pieces/xboard/bdd129.xpm  |  138 ++
 pieces/xboard/bdd21.xpm   |   30 ++
 pieces/xboard/bdd25.xpm   |   34 +++
 pieces/xboard/bdd29.xpm   |   38 +++
 pieces/xboard/bdd33.xpm   |   42 +++
 pieces/xboard/bdd37.xpm   |   46 
 pieces/xboard/bdd40.xpm   |   49 
 pieces/xboard/bdd45.xpm   |   54 
 pieces/xboard/bdd49.xpm   |   58 
 pieces/xboard/bdd54.xpm   |   63 +
 pieces/xboard/bdd58.xpm   |   67 +
 pieces/xboard/bdd64.xpm   |   73 +
 pieces/xboard/bdd72.xpm   |   81 ++
 pieces/xboard/bdd80.xpm   |   89 ++
 pieces/xboard/bdd87.xpm   |   96 +++
 pieces/xboard/bdd95.xpm   |  104 +++
 pieces/xboard/bdl108.xpm  |  117 
 pieces/xboard/bdl116.xpm  |  125 +
 pieces/xboard/bdl129.xpm  |  138 ++
 pieces/xboard/bdl21.xpm   |   30 ++
 pieces/xboard/bdl25.xpm   |   34 +++
 pieces/xboard/bdl29.xpm   |   38 +++
 pieces/xboard/bdl33.xpm   |   42 +++
 pieces/xboard/bdl37.xpm   |   46 
 pieces/xboard/bdl40.xpm   |   49 
 pieces/xboard/bdl45.xpm   |   54 
 pieces/xboard/bdl49.xpm   |   58 
 pieces/xboard/bdl54.xpm   |   63 +
 pieces/xboard/bdl58.xpm   |   67 +
 pieces/xboard/bdl64.xpm   |   73 +
 pieces/xboard/bdl72.xpm   |   81 ++
 pieces/xboard/bdl80.xpm   |   89 ++
 pieces/xboard/bdl87.xpm   |   96 +++
 pieces/xboard/bdl95.xpm   |  104 +++
 pieces/xboard/bld108.xpm  |  117 
 pieces/xboard/bld116.xpm  |  125 +
 pieces/xboard/bld129.xpm  |  138 ++
 pieces/xboard/bld21.xpm   |   30 ++
 pieces/xboard/bld25.xpm   |   34 +++
 pieces/xboard/bld29.xpm   |   38 +++
 pieces/xboard/bld33.xpm   |   42 +++
 pieces/xboard/bld37.xpm   |   43 +++
 pieces/xboard/bld40.xpm   |   49 
 pieces/xboard/bld45.xpm   |   54 
 pieces/xboard/bld49.xpm   |   58 
 pieces/xboard/bld54.xpm   |   63 +
 pieces/xboard/bld58.xpm   |   67 +
 pieces/xboard/bld64.xpm   |   73 +
 pieces/xboard/bld72.xpm   |   81 ++
 pieces/xboard/bld80.xpm   |   89 ++
 pieces/xboard/bld87.xpm   |   96 +++
 pieces/xboard/bld95.xpm   |  104 +++
 pieces/xboard/bll108.xpm  |  117 
 pieces/xboard/bll116.xpm  |  125 +
 pieces/xboard/bll129.xpm  |  138 ++
 pieces/xboard/bll21.xpm   |   30 ++
 pieces/xboard/bll25.xpm   |   34 +++
 pieces/xboard/bll29.xpm   |   38 +++
 pieces/xboard/bll33.xpm   |   42 +++
 pieces/xboard/bll37.xpm   |   43 +++
 pieces/xboard/bll40.xpm   |   49 
 pieces/xboard/bll45.xpm   |   54 
 pieces/xboard/bll49.xpm   |   58 
 pieces/xboard/bll54.xpm   |   63 +
 pieces/xboard/bll58.xpm   |   67 +
 pieces/xboard/bll64.xpm   |   73 +
 pieces/xboard/bll72.xpm   |   81 ++
 pieces/xboard/bll80.xpm   |   89 ++
 pieces/xboard/bll87.xpm   |   96 +++
 pieces/xboard/bll95.xpm   |  104 +++
 pieces/xboard/convbm  |   35 +++
 pieces/xboard/convbm.sed  |4 +
 pieces/xboard/convbm2.sed |5 +
 pieces/xboard/kdd108.xpm  |  117 
 pieces/xboard/kdd116.xpm  |  125 +
 pieces/xboard/kdd129.xpm  |  138 ++
 pieces/xboard/kdd21.xpm   |   30 ++
 pieces/xboard/kdd25.xpm   |   34 +++
 pieces/xboard/kdd29.xpm   |   38 +++
 pieces/xboard/kdd33.xpm   |   42 +++
 pieces/xboard/kdd37.xpm   |   46 
 pieces/xboard/kdd40.xpm   |   46 
 pieces/xboard/kdd45.xpm   |   54 
 pieces/xboard/kdd49.xpm   |   58 
 pieces/xboard/kdd54.xpm   |   63 +
 pieces/xboard/kdd58.xpm   |   67 +
 pieces/xboard/kdd64.xpm   |   73 +
 pieces/xboard/kdd72.xpm   |   81 ++
 pieces/xboard/kdd80.xpm   |   89 ++
 pieces/xboard/kdd87.xpm   |   96 +++
 pieces/xboard/kdd95.xpm   |  104 +++
 pieces/xboard/kdl108.xpm  |  117 
 pieces/xboard/kdl116.xpm  |  125 +
 pieces/xboard/kdl129.xpm  |  138 ++
 pieces/xboard/kdl21.xpm   |   30 ++
 pieces/xboard/kdl25.xpm   |   34 +++
 pieces/xboard/kdl29.xpm   |   38 +++
 pieces/xboard/kdl33.xpm   |   42 +++
 pieces/xboard/kdl37.xpm   |   46 
 pieces/xboard/kdl40.xpm   |   46 
 pieces/xboard/kdl45.xpm   |   54 
 pieces/xboard/kdl49.xpm   |   58 
 pieces/xboard/kdl54.xpm   |   63 +
 pieces/xboard/kdl58.xpm   |   67 +
 pieces/xboard/kdl64.xpm   |   73 +
 pieces/xboard/kdl72.xpm   |   81 ++
 pieces/xboard/kdl80.xpm   |   89 ++
 pieces/xboard/kdl87.xpm   |   96 +++
 pieces/xboard/kdl95.xpm   |  104 +++
 pieces/xboard/kld108.xpm  |  117 
 pieces/xboard/kld116.xpm  |  125 +

[elpa] branch externals/chess updated (ad29c2d -> 7f66100)

2014-05-21 Thread Mario Lang
mlang pushed a change to branch externals/chess
in repository elpa.

  from  ad29c2d   Add XBoard-based XPM piece images.
   new  7f66100   Put .git and .gitignore in .elpaignore and remove 
obsolete .exclude file.

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:
 .elpaignore |2 ++
 .exclude|6 --
 2 files changed, 2 insertions(+), 6 deletions(-)
 delete mode 100644 .exclude



[elpa] 01/01: Put .git and .gitignore in .elpaignore and remove obsolete .exclude file.

2014-05-21 Thread Mario Lang
mlang pushed a commit to branch externals/chess
in repository elpa.

commit 7f66100444935bede8eb5298e6788d62edbe4fcc
Author: Mario Lang 
Date:   Wed May 21 23:18:44 2014 +0200

Put .git and .gitignore in .elpaignore and remove obsolete .exclude file.
---
 .elpaignore |2 ++
 .exclude|6 --
 2 files changed, 2 insertions(+), 6 deletions(-)

diff --git a/.elpaignore b/.elpaignore
index 69bbebd..6566c6a 100644
--- a/.elpaignore
+++ b/.elpaignore
@@ -1,3 +1,5 @@
+.git
+.gitignore
 .elpaignore
 chess-eco.pos
 chess-test.el
diff --git a/.exclude b/.exclude
deleted file mode 100644
index 73cf5b1..000
--- a/.exclude
+++ /dev/null
@@ -1,6 +0,0 @@
-CVS
-ICS-interaction
-.exclude
-.cvsignore
-pieces
-sounds



[elpa] branch master updated (4c0ae95 -> 3aa66fc)

2014-05-21 Thread Mario Lang
mlang pushed a change to branch master
in repository elpa.

  from  4c0ae95   Add packages/chess to .gitignore.
   new  3aa66fc   Make sure removal of $(ARCHIVE_TMP)/packages/$(pkg) does 
not prompt interactively.

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



[elpa] 01/01: Make sure removal of $(ARCHIVE_TMP)/packages/$(pkg) does not prompt interactively.

2014-05-21 Thread Mario Lang
mlang pushed a commit to branch master
in repository elpa.

commit 3aa66fc408d73f063b19332643c5bb43f2bc2512
Author: Mario Lang 
Date:   Wed May 21 23:27:44 2014 +0200

Make sure removal of $(ARCHIVE_TMP)/packages/$(pkg) does not prompt 
interactively.
---
 GNUmakefile |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/GNUmakefile b/GNUmakefile
index 4df319d..03a25f2 100644
--- a/GNUmakefile
+++ b/GNUmakefile
@@ -55,7 +55,7 @@ process-archive:
  if [ -d $$pt ]; then  \
  echo "Creating tarball $${pt}.tar" && \
  tar -cf $${pt}.tar $$pt -X "$$ignore";\
- rm -r $${pt}; \
+ rm -rf $${pt};\
  fi;   \
  done
mkdir -p archive/packages



[elpa] branch externals/chess updated (7f66100 -> f772980)

2014-05-21 Thread Mario Lang
mlang pushed a change to branch externals/chess
in repository elpa.

  from  7f66100   Put .git and .gitignore in .elpaignore and remove 
obsolete .exclude file.
   new  f772980   Remove unrelated file.

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:
 INSTALL |  109 ---
 1 files changed, 0 insertions(+), 109 deletions(-)
 delete mode 100644 INSTALL



[elpa] 01/01: Remove unrelated file.

2014-05-21 Thread Mario Lang
mlang pushed a commit to branch externals/chess
in repository elpa.

commit f7729807339e6c1758085d3e9985060ebd555fd6
Author: Mario Lang 
Date:   Wed May 21 23:29:04 2014 +0200

Remove unrelated file.
---
 INSTALL |  109 ---
 1 files changed, 0 insertions(+), 109 deletions(-)

diff --git a/INSTALL b/INSTALL
deleted file mode 100644
index 803434e..000
--- a/INSTALL
+++ /dev/null
@@ -1,109 +0,0 @@
-Installing Eshell
-=
-
-THE SHORT FORM
---
-
-Here's exactly what to do, with no explanation why.
-
-  1. M-x load-file RET eshell-auto.el RET
-  2. ESC : (add-to-list 'load-path "") RET
-  3. ESC : (add-to-list 'load-path "") RET
-  4. M-x eshell RET ; should see a version banner displayed
-  5. ls RET ; confirm that you see a file listing
-  6. eshell-test RET; confirm that everything runs correctly
-; use `M-x eshell-report-bug' if not
-  7. cd ${dirname (locate-library "eshell-auto")} RET
-  8. find-file Makefile RET
-  9. [edit the Makefile to reflect your site]
- 10. M-x eshell RET
- 11. make install RET
- 12. find-file $user-init-file RET
- 13. [add the following lines to your .emacs file]
-   (add-to-list 'load-path "")
-   (load "eshell-auto")
- 14. M-x eshell RET
- 15. customize-option #'eshell-modules-list RET
- 16. [select the extension modules you prefer]
- 17. [restart Emacs!]
- 18. M-x info RET m Eshell RET  ; read the manual and enjoy!
-
-THE LONG FORM
--
-
- 1. Before building and installing Eshell, it is important to test
-that it will work properly on your system.  To do this, first load
-`eshell-auto', which will define certain autoloads required to run
-Eshell.  This can be done using the command `M-x load-file', and
-then selecting the file "eshell-auto.el".
-
- 2. In order for Emacs to find Eshell's files, the Eshell directory
-must be added to the `load-path' variable.  This can be done
-within Emacs by typing:
-
-ESC : (add-to-list 'load-path "") RET
-ESC : (add-to-list 'load-path "") RET
- 
- 2. Start Eshell from the distributed sources, using default settings,
-by typing `M-x eshell'.
-
- 3. Verify that Eshell is functional by typing "ls" followed by RET.
-You should have already seen a version banner announcing the
-version number of this release, followed by a prompt.
-
- 4. Run the test suite by typing "eshell-test" followed by RET in the
-Eshell buffer.  It is important that Emacs be left alone while the
-tests are running, since extraneous command input may cause some
-of the tests to fail (they were never intended to run in the
-background).  If all of the tests pass, Eshell should work just
-fine on your system.  If any of the tests fail, please send e-mail
-to the Eshell maintainer using the command `M-x eshell-report-bug'.
-
- 5. Edit the file `Makefile' in the directory containing the Eshell
-sources to reflect the location of certain Emacs dircetories at
-your site.  The only things you really have to change are the
-definitions of `lispdir' and `infodir'.  The elisp files will be
-copied to `lispdir', and the info file to `infodir'.
-
- 6. Type `make install' in the directory containing the Eshell
-sources.  This will byte-compile all of the `.el' files and copy
-both the source and compiled versions to the directories specified
-in the previous step.  It will also copy the info file, and add a
-corresponding entry to your "dir" file -- if install-info can be
-found.
-
-If you only want to create the compiled elisp files, but don't
-want to install them, you can type just `make' instead.
-
- 7. Add the directory into which Eshell was installed to your
-`load-path' variable.  This can be done by adding the following
-line to your .emacs file:
-
-(add-to-list 'load-path "/usr/local/share/emacs/site-lisp/eshell")
-
-The actual directory on your system may differ.
-
- 8. To install Eshell privately, edit your .emacs file; to install
-Eshell site-wide, edit the file `site-start.el' in your site-lisp
-directory (usually `/usr/local/share/emacs/site-lisp' or something
-similar).  In either case enter the following line into the
-appropriate file:
-
-(load "eshell-auto")
-
- 9. Restart Emacs.  After restarting, customize the variable
-`eshell-modules-list'.  This variable selects which Eshell
-extension modules you want to use.  You will find documentation on
-each of those modules in the Info manual.
-
-10. Re

[elpa] branch externals/chess updated (f772980 -> c479a3a)

2014-05-21 Thread Mario Lang
mlang pushed a change to branch externals/chess
in repository elpa.

  from  f772980   Remove unrelated file.
   new  c479a3a   .elpaignore: doc/ not just doc/chess.texi such that no 
empty subdir is left in tarball.

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:
 .elpaignore |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)



[elpa] 01/01: .elpaignore: doc/ not just doc/chess.texi such that no empty subdir is left in tarball.

2014-05-21 Thread Mario Lang
mlang pushed a commit to branch externals/chess
in repository elpa.

commit c479a3a823797be911270016bb0c5781c9ecdcbb
Author: Mario Lang 
Date:   Wed May 21 23:31:53 2014 +0200

.elpaignore: doc/ not just doc/chess.texi such that no empty subdir is left 
in tarball.
---
 .elpaignore |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/.elpaignore b/.elpaignore
index 6566c6a..1f21478 100644
--- a/.elpaignore
+++ b/.elpaignore
@@ -3,5 +3,5 @@
 .elpaignore
 chess-eco.pos
 chess-test.el
-doc/chess.texi
+doc
 Makefile



[elpa] branch externals/chess updated (c479a3a -> 4bca321)

2014-05-21 Thread Mario Lang
mlang pushed a change to branch externals/chess
in repository elpa.

  from  c479a3a   .elpaignore: doc/ not just doc/chess.texi such that no 
empty subdir is left in tarball.
   new  4bca321   Remove obsolte file.

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:
 run-tests.sh |   28 
 1 files changed, 0 insertions(+), 28 deletions(-)
 delete mode 100755 run-tests.sh



[elpa] 01/01: Remove obsolte file.

2014-05-21 Thread Mario Lang
mlang pushed a commit to branch externals/chess
in repository elpa.

commit 4bca321179a0a12666c862513e123829a314da8f
Author: Mario Lang 
Date:   Wed May 21 23:49:32 2014 +0200

Remove obsolte file.
---
 run-tests.sh |   28 
 1 files changed, 0 insertions(+), 28 deletions(-)

diff --git a/run-tests.sh b/run-tests.sh
deleted file mode 100755
index 95719aa..000
--- a/run-tests.sh
+++ /dev/null
@@ -1,28 +0,0 @@
-#!/bin/sh
-
-CPUS=8
-SOURCE=$HOME/src/emacs-chess
-PRODUCTS=$HOME/Products/emacs-chess
-EMACS=/Applications/MacPorts/Emacs.app/Contents/MacOS/Emacs
-
-# No need to change these values
-TOTAL=4209433
-PART=$((TOTAL / CPUS))
-
-for i in $(seq 1 $CPUS); do
-# Make sure the sources are all up to date
-rsync -av --delete --exclude=.git/ --delete-excluded \
-   $SOURCE/ $PRODUCTS/$i/
-
-(cd $PRODUCTS/$i; rm -f chess-test; make EMACS=$EMACS; \
- nice -n 20 make EMACS=$EMACS \
-   START=$(((i - 1) * PART)) COUNT=$PART check > test.out 2>&1) &
-done
-
-wait
-
-for i in $(seq 1 $CPUS); do
-cat $PRODUCTS/$i/test.out >> test.out
-done
-
-cat test.out



[elpa] branch externals/chess updated (4bca321 -> bab74a1)

2014-05-21 Thread Mario Lang
mlang pushed a change to branch externals/chess
in repository elpa.

  from  4bca321   Remove obsolte file.
   new  bab74a1   Add obsolete ChangeLog to .elpaignore.

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



[elpa] 01/01: Add obsolete ChangeLog to .elpaignore.

2014-05-21 Thread Mario Lang
mlang pushed a commit to branch externals/chess
in repository elpa.

commit bab74a1024352ac75677e3e7db9ca0449938cf90
Author: Mario Lang 
Date:   Thu May 22 00:39:05 2014 +0200

Add obsolete ChangeLog to .elpaignore.
---
 .elpaignore |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/.elpaignore b/.elpaignore
index 1f21478..b34bc39 100644
--- a/.elpaignore
+++ b/.elpaignore
@@ -4,4 +4,5 @@
 chess-eco.pos
 chess-test.el
 doc
+ChangeLog
 Makefile



[elpa] branch externals/chess updated (588157a -> 75e41be)

2014-05-22 Thread Mario Lang
mlang pushed a change to branch externals/chess
in repository elpa.

  from  588157a   * chess-perft.el: Fix up copyright header.
   new  75e41be   README and chess.el Commentary have largely identical 
text.

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:
 README   |   25 -
 chess.el |8 ++--
 2 files changed, 6 insertions(+), 27 deletions(-)
 delete mode 100644 README



[elpa] 01/01: README and chess.el Commentary have largely identical text.

2014-05-22 Thread Mario Lang
mlang pushed a commit to branch externals/chess
in repository elpa.

commit 75e41be63e2995633fd81ddd33a04795ff3aef9d
Author: Mario Lang 
Date:   Thu May 22 11:53:47 2014 +0200

README and chess.el Commentary have largely identical text.

Sync README into Commentary.
---
 README   |   25 -
 chess.el |8 ++--
 2 files changed, 6 insertions(+), 27 deletions(-)

diff --git a/README b/README
deleted file mode 100644
index f04a3b4..000
--- a/README
+++ /dev/null
@@ -1,25 +0,0 @@
-Welcome to chess.el, a client and library for playing Chess from
-Emacs.
-
-chess.el is an Emacs Lisp library and several clients on top of the
-underlying library functionality for performing various activities
-related to the game of chess.
-
-You can play against an external chess program such as gnuchess,
-crafty, phalanx or sjeng.  All of them are publically available, and
-chess.el will automatically detect which one you have installed,
-provided they have standard executable program names, and are in a
-located in a directory which is part of the PATH.  See the
-customisable variable `chess-default-engine'.
-
-You can also play against another human or computer over the internet
-(through a direct Emacs-to-Emacs connection, or on one of the Internet
-Chess Servers like freechess.org or chessclub.com), or even against a
-very simple chess thinking module implemented in pure Emacs Lisp.
-
-chess.el also provides a mode for editing Portable Game Notation (PGN)
-files.
-
-To improve your chessaility, you might also like to have a look at
-chess-puzzle, which allows you to solve chess puzzle collections (in
-PGN or EPD format) against one of the engines you have installed.
diff --git a/chess.el b/chess.el
index 440f29d..9aabf7b 100644
--- a/chess.el
+++ b/chess.el
@@ -30,6 +30,10 @@
 
 ;; Welcome to Emacs Chess, a chess playing module for GNU Emacs.
 ;;
+;; chess.el is an Emacs Lisp library and several clients on top of the
+;; underlying library functionality for performing various activities
+;; related to the game of chess.
+;;
 ;; Type `M-x chess', and play chess against one of the default engine modules.
 ;;
 ;; Type `C-u M-x chess' to select a specific engine.
@@ -44,9 +48,9 @@
 ;; `chess-pgn-mode' provides a text-mode derived mode which can display the
 ;; chess position at point.
 ;;
-;; If you are new to Chess, `M-x chess-tutorial' provides a simple knight
+;; To improve your chessaility, `M-x chess-tutorial' provides a simple knight
 ;; movement exercise to get you started, and `M-x chess-puzzle' can be used
-;; to solve puzzle collections.
+;; to solve puzzle collections in EPD or PGN format.
 ;;
 ;; There are some different types of chessboard display modules available.
 ;; * A simple character based display (chess-plain).



[elpa] branch externals/chess updated (75e41be -> 57e0eb3)

2014-05-22 Thread Mario Lang
mlang pushed a change to branch externals/chess
in repository elpa.

  from  75e41be   README and chess.el Commentary have largely identical 
text.
   new  57e0eb3   Correct year.

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:
 AUTHORS |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)



[elpa] 01/01: Correct year.

2014-05-22 Thread Mario Lang
mlang pushed a commit to branch externals/chess
in repository elpa.

commit 57e0eb3317b1327cea10049748b01b26eb8e584d
Author: Mario Lang 
Date:   Thu May 22 11:58:17 2014 +0200

Correct year.
---
 AUTHORS |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/AUTHORS b/AUTHORS
index 2d78c45..5c35b41 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -22,7 +22,7 @@ moved to other things.  I hope you enjoy using it as much as 
I did making it.
 John Wiegley 
 
 
-Further: Around 2005, another player came on the scene: Mario Lang.  Mario is
+Further: Around 2004, another player came on the scene: Mario Lang.  Mario is
 unable to see, but Emacs Chess's design made it possible for me to integrate
 the display code with his braille viewer.  He still plays chess with it to
 this day, as it is the only client that allows him to do so.  He has also



[elpa] branch master updated (15f7732 -> 5315891)

2014-05-22 Thread Mario Lang
mlang pushed a change to branch master
in repository elpa.

  from  15f7732   [maint] Fix bug: Rewrite PKG-VER extraction.
   new  5315891   [quarter-plane] Fix typo in Commentary.

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/quarter-plane/quarter-plane.el |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)



[elpa] 01/01: [quarter-plane] Fix typo in Commentary.

2014-05-22 Thread Mario Lang
mlang pushed a commit to branch master
in repository elpa.

commit 5315891e4f09097b10632a350ea66a6ba8201bed
Author: Mario Lang 
Date:   Thu May 22 12:37:38 2014 +0200

[quarter-plane] Fix typo in Commentary.
---
 packages/quarter-plane/quarter-plane.el |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/packages/quarter-plane/quarter-plane.el 
b/packages/quarter-plane/quarter-plane.el
index f73fd4e..3cb70d9 100644
--- a/packages/quarter-plane/quarter-plane.el
+++ b/packages/quarter-plane/quarter-plane.el
@@ -24,7 +24,7 @@
 ;; This package provides Quarter Plane mode, a minor mode which
 ;; provides Picture mode style editing (treating the screen as a
 ;; semi-infinite quarter-plane).  Unlike Picture mode, it is a minor
-;; modes (see the Emacs manual for the documentation of Picture mode).
+;; mode (see the Emacs manual for the documentation of Picture mode).
 ;; Type M-x quarter-plane-mode to enable Quarter Plane mode in the
 ;; current buffer, and M-x global-quarter-plane-mode to enable it
 ;; globally.



[elpa] 02/02: Remove URL field as this is now the official repo.

2014-05-23 Thread Mario Lang
mlang pushed a commit to branch externals/chess
in repository elpa.

commit 0adcf9bd54a26ca09b6b5eb7e0843ce9089b1d03
Author: Mario Lang 
Date:   Fri May 23 23:57:43 2014 +0200

Remove URL field as this is now the official repo.

Also, remove duplicated Description field.
---
 chess.el |   10 +++---
 1 files changed, 3 insertions(+), 7 deletions(-)

diff --git a/chess.el b/chess.el
index 0a4aff2..4b38526 100644
--- a/chess.el
+++ b/chess.el
@@ -1,16 +1,12 @@
-;;; chess.el --- Play chess in Emacs
+;;; chess.el --- Play chess in GNU Emacs
 
 ;; Copyright (C) 2001, 2014 Free Software Foundation, Inc.
 
-;; Emacs Lisp Archive Entry
-;; Filename: chess.el
+;; Author: John Wiegley 
+;; Maintainer: Mario Lang 
 ;; Version: 0
 ;; Package-Requires: ((cl-lib "0.5"))
 ;; Keywords: games
-;; Author: John Wiegley 
-;; Maintainer: Mario Lang 
-;; Description: Play chess in Emacs
-;; URL: https://github.com/jwiegley/emacs-chess/
 ;; Compatibility: Emacs24
 
 ;; This program is free software; you can redistribute it and/or modify



[elpa] branch externals/chess updated (b891e7c -> 0adcf9b)

2014-05-23 Thread Mario Lang
mlang pushed a change to branch externals/chess
in repository elpa.

  from  b891e7c   * chess.el: Use new "Version: 0" convention.
   new  8921876   Add a sentence about chess-network to package long 
description.
   new  0adcf9b   Remove URL field as this is now the official repo.

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



[elpa] 01/02: Add a sentence about chess-network to package long description.

2014-05-23 Thread Mario Lang
mlang pushed a commit to branch externals/chess
in repository elpa.

commit 8921876b68c8a8435ee5ea922b3b02a0339691bb
Author: Mario Lang 
Date:   Fri May 23 23:56:57 2014 +0200

Add a sentence about chess-network to package long description.
---
 chess.el |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/chess.el b/chess.el
index 304d821..0a4aff2 100644
--- a/chess.el
+++ b/chess.el
@@ -42,6 +42,8 @@
 ;; There is also an Emacs based chess computer module (ai) which does not
 ;; require any external programs.  However, the internal AI is not very strong.
 ;;
+;; To play against another human on a different machine running GNU Emacs,
+;; type `C-u M-x chess RET network RET'.
 ;; To play on one of the internet chess servers, type `M-x chess-ics'.
 ;;
 ;; If you'd like to view or edit Portable Game Notation (PGN) files,



[elpa] 01/01: chess-network: Put cursor in echo-area when prompting.

2014-05-23 Thread Mario Lang
mlang pushed a commit to branch externals/chess
in repository elpa.

commit bb2654e3c743f088afca39a0779b40eb550e4443
Author: Mario Lang 
Date:   Sat May 24 00:36:34 2014 +0200

chess-network: Put cursor in echo-area when prompting.
---
 chess-network.el |5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/chess-network.el b/chess-network.el
index 6de3978..a5f3ef4 100644
--- a/chess-network.el
+++ b/chess-network.el
@@ -131,8 +131,9 @@
   (unless chess-engine-handling-event
 (cond
  ((eq event 'initialize)
-  (let ((which (read-char "Are you the c)lient or s)erver? "))
-   proc)
+  (let* ((cursor-in-echo-area t)
+(which (read-char "Are you the c)lient or s)erver? "))
+proc)
(chess-message 'network-starting)
(setq proc
  (if (eq which ?s)



[elpa] branch externals/chess updated (0adcf9b -> bb2654e)

2014-05-23 Thread Mario Lang
mlang pushed a change to branch externals/chess
in repository elpa.

  from  0adcf9b   Remove URL field as this is now the official repo.
   new  bb2654e   chess-network: Put cursor in echo-area when prompting.

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:
 chess-network.el |5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)



[elpa] 01/01: Convert remaining `assert' to `cl-assert'.

2014-05-23 Thread Mario Lang
mlang pushed a commit to branch externals/chess
in repository elpa.

commit ae907cb0adfbacb381a06ad2c7770f5a28dba15c
Author: Mario Lang 
Date:   Sat May 24 03:15:19 2014 +0200

Convert remaining `assert' to `cl-assert'.
---
 chess-algebraic.el |6 +-
 chess-crafty.el|4 +-
 chess-epd.el   |6 +-
 chess-game.el  |  104 +--
 chess-module.el|2 +-
 chess-pgn.el   |2 +-
 chess-ply.el   |   42 ++--
 chess-var.el   |   24 ++--
 8 files changed, 94 insertions(+), 96 deletions(-)

diff --git a/chess-algebraic.el b/chess-algebraic.el
index d90bc11..4a5e11c 100644
--- a/chess-algebraic.el
+++ b/chess-algebraic.el
@@ -90,8 +90,8 @@ This regexp handles both long and short form.")
 
 (defun chess-algebraic-to-ply (position move &optional trust)
   "Convert the algebraic notation MOVE for POSITION to a ply."
-  (assert (vectorp position))
-  (assert (stringp move))
+  (cl-assert (vectorp position))
+  (cl-assert (stringp move))
   (let ((case-fold-search nil))
 (when (string-match chess-algebraic-regexp-entire move)
   (let ((color (chess-pos-side-to-move position))
@@ -213,7 +213,7 @@ This regexp handles both long and short form.")
 (defun chess-ply-to-algebraic (ply &optional long)
   "Convert the given PLY to algebraic notation.
 If LONG is non-nil, render the move into long notation."
-  (assert (listp ply))
+  (cl-assert (listp ply))
   (or (and (not long) (chess-ply-keyword ply :san))
   (and (null (chess-ply-source ply)) "")
   (let ((move (chess-ply--move-text ply long)))
diff --git a/chess-crafty.el b/chess-crafty.el
index 11245b6..53ff416 100644
--- a/chess-crafty.el
+++ b/chess-crafty.el
@@ -164,10 +164,10 @@
(chess-engine-send nil "hard\n")
  (chess-engine-send nil "easy\n")))
((eq (car args) 'search-depth)
-   (assert (and (integerp (cadr args)) (>= (cadr args) 0)))
+   (cl-assert (and (integerp (cadr args)) (>= (cadr args) 0)))
(chess-engine-send nil (format "sd %d\n" (cadr args
((eq (car args) 'search-time)
-   (assert (and (integerp (cadr args)) (> (cadr args) 0)))
+   (cl-assert (and (integerp (cadr args)) (> (cadr args) 0)))
(chess-engine-send nil (format "st %d\n" (cadr args))
 
  (t
diff --git a/chess-epd.el b/chess-epd.el
index ac2c0b8..12b4eda 100644
--- a/chess-epd.el
+++ b/chess-epd.el
@@ -44,11 +44,11 @@
(value (cdr annotation)))
 (cond
  ((or (eq opcode 'am) (eq opcode 'bm))
-  (assert (consp value))
+  (cl-assert (consp value))
   (format "%S %s;"
  opcode (mapconcat #'chess-ply-to-string value " ")))
  ((eq opcode 'ce)
-  (assert (integerp value))
+  (cl-assert (integerp value))
   (format "%S %d;" opcode value))
  ((or (eq opcode 'pv) (eq opcode 'sv))
   (format "%S %s;"
@@ -59,7 +59,7 @@
 (defun chess-pos-to-epd (position)
   "Convert a chess POSITION to a string representation in extended
 position description format."
-  (assert position)
+  (cl-assert position)
   (concat (chess-pos-to-fen position)
  (when (consp (chess-pos-annotations position))
(concat " "
diff --git a/chess-game.el b/chess-game.el
index 741f664..334ec70 100644
--- a/chess-game.el
+++ b/chess-game.el
@@ -44,19 +44,19 @@
 
 (defsubst chess-game-hooks (game)
   "Return the event hooks associated with GAME."
-  (assert game)
+  (cl-assert game)
   (car game))
 
 (defsubst chess-game-set-hooks (game hooks)
   "Set the event hooks associated with GAME."
-  (assert game)
-  (assert (or hooks (eq hooks nil)))
+  (cl-assert game)
+  (cl-assert (or hooks (eq hooks nil)))
   (setcar game hooks))
 
 (defun chess-game-add-hook (game function &optional data prepend)
   "Add to GAME an event hook FUNCTION."
-  (assert game)
-  (assert function)
+  (cl-assert game)
+  (cl-assert function)
   (let ((hooks (chess-game-hooks game)))
 (if (null hooks)
(chess-game-set-hooks game (list (cons function data)))
@@ -68,8 +68,8 @@
   "Remove from GAME all event hooks that match FUNCTION.
 If DATA is specified, only remove those hooks whose associated data
 matches."
-  (assert game)
-  (assert function)
+  (cl-assert game)
+  (cl-assert function)
   (let* ((hooks (chess-game-hooks game))
 (h hooks) last-hook)
 (while h
@@ -85,7 +85,7 @@ matches."
 
 (defsubst chess-game-run-hooks (game &rest args)
   "Run the event hooks of GAME and pass ARGS."
-  (assert game)
+  (cl-assert game)
   (unless chess-game-inhibit-events
 (let (result)
   (dolist (hook (chess-game-hooks game) result)
@@ -93,29 +93,29 @@ matches."
 
 (defsubst chess-game-tags (

[elpa] branch externals/chess updated (bb2654e -> ae907cb)

2014-05-23 Thread Mario Lang
mlang pushed a change to branch externals/chess
in repository elpa.

  from  bb2654e   chess-network: Put cursor in echo-area when prompting.
   new  ae907cb   Convert remaining `assert' to `cl-assert'.

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:
 chess-algebraic.el |6 +-
 chess-crafty.el|4 +-
 chess-epd.el   |6 +-
 chess-game.el  |  104 +--
 chess-module.el|2 +-
 chess-pgn.el   |2 +-
 chess-ply.el   |   42 ++--
 chess-var.el   |   24 ++--
 8 files changed, 94 insertions(+), 96 deletions(-)



[elpa] 01/01: Add osc.el.

2014-05-23 Thread Mario Lang
mlang pushed a commit to branch master
in repository elpa.

commit 7da6741f270fd2404f0d62b5ea3b1d70eb5f2898
Author: Mario Lang 
Date:   Sat May 24 04:01:52 2014 +0200

Add osc.el.
---
 packages/osc/osc.el |  237 +++
 1 files changed, 237 insertions(+), 0 deletions(-)

diff --git a/packages/osc/osc.el b/packages/osc/osc.el
new file mode 100644
index 000..e214f8d
--- /dev/null
+++ b/packages/osc/osc.el
@@ -0,0 +1,237 @@
+;;; osc.el --- Open Sound Control protocol library
+
+;; Copyright (C) 2014  Free Software Foundation, Inc.
+
+;; Author: Mario Lang 
+;; Version: 0.1
+;; Keywords: comm, processes, multimedia
+
+;; 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 <http://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; OpenSound Control ("OSC") is a protocol for communication among
+;; computers, sound synthesizers, and other multimedia devices that is
+;; optimized for modern networking technology and has been used in many
+;; application areas.
+
+;; This package implements low-level functionality for OSC clients and servers.
+;; In particular:
+;; * `osc-make-client' and `osc-make-server' can be used to create process 
objects.
+;; * `osc-send-message' encodes and sends OSC messages from a client process.
+;; * `osc-server-set-handler' can be used to change handlers for particular
+;;   OSC paths on a server process object on the fly.
+
+;; BUGS/TODO:
+;;
+;; * Timetags and binary blobs are not supported yet.
+
+;; Usage:
+;;
+;; Client: (setq my-client (osc-make-client "localhost" 7770))
+;; (osc-send-message my-client "/osc/path" 1.5 1.0 5 "done")
+;; (delete-process my-client)
+;;
+;; Server: (setq my-server (osc-make-server "localhost" 7770
+;;  (lambda (path &rest args)
+;;(message "OSC %s: %S" path args
+
+;;; Code:
+
+(require 'cl-lib)
+
+(defun osc-insert-string (string)
+  (insert string 0 (make-string (- 3 (% (length string) 4)) 0)))
+
+(defun osc-insert-float32 (value)
+  (let (s (e 0) f)
+(cond
+ ((string= (format "%f" value) (format "%f" -0.0))
+  (setq s 1 f 0))
+ ((string= (format "%f" value) (format "%f" 0.0))
+  (setq s 0 f 0))
+ ((= value 1.0e+INF)
+  (setq s 0 e 255 f (1- (expt 2 23
+ ((= value -1.0e+INF)
+  (setq s 1 e 255 f (1- (expt 2 23
+ ((string= (format "%f" value) (format "%f" 0.0e+NaN))
+  (setq s 0 e 255 f 1))
+ (t
+  (setq s (if (>= value 0.0)
+ (progn (setq f value) 0)
+   (setq f (* -1 value)) 1))
+  (while (>= (* f (expt 2.0 e)) 2.0) (setq e (1- e)))
+  (if (= e 0) (while (< (* f (expt 2.0 e)) 1.0) (setq e (1+ e
+  (setq f (round (* (1- (* f (expt 2.0 e))) (expt 2 23)))
+   e (+ (* -1 e) 127
+(insert (+ (lsh s 7) (lsh (logand e #XFE) -1))
+   (+ (lsh (logand e #X01) 7) (lsh (logand f #X7F) -16))
+   (lsh (logand f #XFF00) -8)
+   (logand f #XFF
+
+(defun osc-insert-int32 (value)
+  (let (bytes)
+(dotimes (i 4)
+  (push (% value 256) bytes)
+  (setq value (/ value 256)))
+(dolist (byte bytes)
+  (insert byte
+
+;;;###autoload
+(defun osc-make-client (host port)
+  "Create an OSC client process which talks to HOST and PORT."
+  (make-network-process
+   :name "OSCclient"
+   :coding 'binary
+   :host host
+   :service port
+   :type 'datagram))
+
+;;;###autoload
+(defun osc-send-message (client path &rest args)
+  "Send an OSC message from CLIENT to the specified PATH with ARGS."
+  (with-temp-buffer
+(set-buffer-multibyte nil)
+(osc-insert-string path)
+(osc-insert-string
+ (apply 'concat "," (mapcar (lambda (arg)
+ (cond
+  ((floatp arg) "f")
+  ((integerp arg) "i")
+  ((stringp arg) "s")
+  (t (error "Invalid argument: %S" arg
+   args)))
+(dolist (arg args)
+  (cond
+   ((floatp arg) (osc-insert-float32 arg))
+   ((integerp arg) (osc-insert-int32 arg))
+   ((s

[elpa] branch master updated (8180b45 -> 7da6741)

2014-05-23 Thread Mario Lang
mlang pushed a change to branch master
in repository elpa.

  from  8180b45   [gnugo int] Fix up gnugo-frolic.el ‘require’ forms.
   new  7da6741   Add osc.el.

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/osc/osc.el |  237 +++
 1 files changed, 237 insertions(+), 0 deletions(-)
 create mode 100644 packages/osc/osc.el



[elpa] 02/02: Merge branch 'externals/chess' of git+ssh://git.sv.gnu.org/srv/git/emacs/elpa into externals/chess

2014-05-24 Thread Mario Lang
mlang pushed a commit to branch externals/chess
in repository elpa.

commit 1f39fc44c6cdb6586f7c6c2cf7672367c1fd798c
Merge: a84f9bb d3cd718
Author: Mario Lang 
Date:   Sun May 25 01:39:03 2014 +0200

Merge branch 'externals/chess' of 
git+ssh://git.sv.gnu.org/srv/git/emacs/elpa into externals/chess

 .gitignore |2 +
 chess-algebraic.el |3 +-
 chess-autosave.el  |6 ++--
 chess-chat.el  |2 +-
 chess-crafty.el|1 -
 chess-display.el   |   78 ++--
 chess-eco.el   |7 +---
 chess-engine.el|6 ++-
 chess-game.el  |3 +-
 chess-ics.el   |3 +-
 chess-ics1.el  |4 +-
 chess-images.el|   11 +--
 chess-kibitz.el|2 +
 chess-module.el|5 +--
 chess-pgn.el   |   27 --
 chess-plain.el |2 +-
 chess-ply.el   |   17 ++
 chess-polyglot.el  |6 +--
 chess-pos.el   |   16 --
 chess-puzzle.el|8 +++--
 chess-sound.el |7 ++--
 chess-test.el  |3 +-
 chess-tutorial.el  |2 +-
 chess-var.el   |2 +-
 24 files changed, 98 insertions(+), 125 deletions(-)




[elpa] branch externals/chess updated (d3cd718 -> 1f39fc4)

2014-05-24 Thread Mario Lang
mlang pushed a change to branch externals/chess
in repository elpa.

  from  d3cd718   Don't require `cl'.  Miscellaneous cleanups from compiler 
warnings. * .gitignore: Add ELPA's chess-autoloads.el and chess-pkg.el. * 
chess-var.el: * chess-test.el: * chess-game.el: * chess-eco.el: Don't require 
`cl'. * chess-sound.el (chess-sound-handler): Remove unused var `text'. * 
chess-puzzle.el (chess-display-handling-event): Declare. * chess-pos.el 
(chess-pos-passed-pawns): Remove unused var `bias'. (chess--add-candidate): 
Define as a macro rather than a defsubs [...]
   new  a84f9bb   Encode promotions when sending ICS moves.
   new  1f39fc4   Merge branch 'externals/chess' of 
git+ssh://git.sv.gnu.org/srv/git/emacs/elpa into externals/chess

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:
 chess-ics.el |   22 --
 1 files changed, 12 insertions(+), 10 deletions(-)



[elpa] 01/02: Encode promotions when sending ICS moves.

2014-05-24 Thread Mario Lang
mlang pushed a commit to branch externals/chess
in repository elpa.

commit a84f9bbc1959e8fca4c2d76594d17707f7b62ba3
Author: Mario Lang 
Date:   Sun May 25 01:37:57 2014 +0200

Encode promotions when sending ICS moves.

* chess.ics.el: (chess-ics-handler) Encode promotion like =Q when handling
the move event.
---
 chess-ics.el |   22 --
 1 files changed, 12 insertions(+), 10 deletions(-)

diff --git a/chess-ics.el b/chess-ics.el
index 13f40c3..6f94454 100644
--- a/chess-ics.el
+++ b/chess-ics.el
@@ -1051,17 +1051,19 @@ This function should be put on 
`comint-preoutput-filter-functions'."
nil (format "match %s\n"
   (read-string (chess-string 'challenge-whom)
 
- ;; this handler is taken from chess-common; we need to send long
- ;; algebraic notation to the ICS server, not short
+ ;; we need to send long algebraic notation to the ICS server, not short
  ((eq event 'move)
-  (chess-ics-send
-   (if (chess-ply-any-keyword (car args) :castle :long-castle)
-  (chess-ply-to-algebraic (car args))
-(concat (chess-index-to-coord
- (chess-ply-source (car args))) "-"
- (chess-index-to-coord
-  (chess-ply-target (car args)
-   (chess-game-data game 'ics-buffer))
+  (let ((ply (car args)))
+   (chess-ics-send
+(if (chess-ply-any-keyword ply :castle :long-castle)
+(chess-ply-to-algebraic ply)
+  (concat (chess-index-to-coord (chess-ply-source ply))
+  "-"
+  (chess-index-to-coord (chess-ply-target ply))
+  (if (characterp (chess-ply-keyword ply :promote))
+  (format "=%c" (chess-ply-keyword ply :promote))
+"")))
+(chess-game-data game 'ics-buffer)))
   (if (chess-game-over-p game)
  (chess-game-set-data game 'active nil)))
 



[elpa] branch externals/chess updated (1f39fc4 -> e1f3b1d)

2014-05-24 Thread Mario Lang
mlang pushed a change to branch externals/chess
in repository elpa.

  from  1f39fc4   Merge branch 'externals/chess' of 
git+ssh://git.sv.gnu.org/srv/git/emacs/elpa into externals/chess
   new  e1f3b1d   Let chess-input handle promotions.

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:
 chess-display.el |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)



[elpa] 01/01: Let chess-input handle promotions.

2014-05-24 Thread Mario Lang
mlang pushed a commit to branch externals/chess
in repository elpa.

commit e1f3b1dc0196efd75f466e844cef596920c75dc4
Author: Mario Lang 
Date:   Sun May 25 02:12:10 2014 +0200

Let chess-input handle promotions.

* chess-display.el (chess-display-mode-map): Bind = to chess-input-shortcut.
---
 chess-display.el |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/chess-display.el b/chess-display.el
index 45e54aa..cd1c802 100644
--- a/chess-display.el
+++ b/chess-display.el
@@ -635,7 +635,7 @@ See `chess-display-type' for the different kinds of 
displays."
   ?1 ?2 ?3 ?4 ?5 ?6 ?7 ?8
   ?r ?n ?b ?q ?k
   ?R ?N ?B ?Q ?K
-  ?o ?O ?x))
+  ?o ?O ?x ?=))
   (define-key map (vector key) 'chess-input-shortcut))
 (define-key map [backspace] 'chess-input-shortcut-delete)
 



[elpa] 01/01: Make = optional when entering promotions.

2014-05-24 Thread Mario Lang
mlang pushed a commit to branch externals/chess
in repository elpa.

commit e0457d8d2cc1aaacd1c723633846833c74dc3b6a
Author: Mario Lang 
Date:   Sun May 25 02:33:16 2014 +0200

Make = optional when entering promotions.

* chess-input.el (chess-input-test-move): Rework nested if hell as cond
and make = optional in addition to x.
---
 chess-input.el |   18 --
 1 files changed, 8 insertions(+), 10 deletions(-)

diff --git a/chess-input.el b/chess-input.el
index e782066..46d3793 100644
--- a/chess-input.el
+++ b/chess-input.el
@@ -52,16 +52,14 @@
   (while (and (< i l) (< x xl))
(let ((move-char (aref move i))
  (entry-char (aref chess-input-move-string x)))
- (if (and (= move-char ?x)
-  (/= entry-char ?x))
- (setq i (1+ i))
-   (if (/= entry-char (if (< entry-char ?a)
-  move-char
-(downcase move-char)))
-   (setq match nil i l)
- (setq i (1+ i) x (1+ x)))
-(if match
-   move-ply)))
+ (cond
+  ((or (and (= move-char ?x) (/= entry-char ?x))
+   (and (= move-char ?=) (/= entry-char ?=)))
+   (setq i (1+ i)))
+  ((/= entry-char (if (< entry-char ?a) move-char (downcase 
move-char)))
+   (setq match nil i l))
+  (t (setq i (1+ i) x (1+ x)))
+(when match move-ply)))
 
 (defsubst chess-input-display-moves (&optional move-list)
   (if (> (length chess-input-move-string) 0)



[elpa] branch externals/chess updated (e1f3b1d -> e0457d8)

2014-05-24 Thread Mario Lang
mlang pushed a change to branch externals/chess
in repository elpa.

  from  e1f3b1d   Let chess-input handle promotions.
   new  e0457d8   Make = optional when entering promotions.

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:
 chess-input.el |   18 --
 1 files changed, 8 insertions(+), 10 deletions(-)



[elpa] branch externals/chess updated (e0457d8 -> 95323a6)

2014-05-25 Thread Mario Lang
mlang pushed a change to branch externals/chess
in repository elpa.

  from  e0457d8   Make = optional when entering promotions.
   new  95323a6   Simplify chess-input-moves.

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:
 chess-input.el |   56 ++--
 1 files changed, 26 insertions(+), 30 deletions(-)



[elpa] 01/01: Simplify chess-input-moves.

2014-05-25 Thread Mario Lang
mlang pushed a commit to branch externals/chess
in repository elpa.

commit 95323a695528aaf53f6eaac3736f6da4f6af424b
Author: Mario Lang 
Date:   Sun May 25 15:39:46 2014 +0200

Simplify chess-input-moves.

chess-ply-to-algebraic already caches the generated string in the :san ply 
keyword.
So there is no need to keep the ply *and* algebraic text in 
chess-input-moves.
Call chess-ply-to-algebraic whereever necessary, and just keep
the plies in chess-input-moves.

Result: A bit cleaner to read, and less consing.
---
 chess-input.el |   56 ++--
 1 files changed, 26 insertions(+), 30 deletions(-)

diff --git a/chess-input.el b/chess-input.el
index 46d3793..a75a94d 100644
--- a/chess-input.el
+++ b/chess-input.el
@@ -39,12 +39,11 @@
 (make-variable-buffer-local 'chess-input-position-function)
 (make-variable-buffer-local 'chess-input-move-function)
 
-(defun chess-input-test-move (move-ply)
-  "Return the given MOVE if it matches the user's current input."
-  (let* ((move (cdr move-ply))
+(defun chess-input-test-move (ply)
+  "Return the given PLY if it matches the user's current input."
+  (let* ((move (chess-ply-to-algebraic ply))
 (i 0) (x 0) (l (length move))
-(xl (length chess-input-move-string))
-(match t))
+(xl (length chess-input-move-string)))
 (unless (or (and (equal (downcase chess-input-move-string) "ok")
 (string-match "\\`O-O[+#]?\\'" move))
(and (equal (downcase chess-input-move-string) "oq")
@@ -57,14 +56,14 @@
(and (= move-char ?=) (/= entry-char ?=)))
(setq i (1+ i)))
   ((/= entry-char (if (< entry-char ?a) move-char (downcase 
move-char)))
-   (setq match nil i l))
+   (setq ply nil i l))
   (t (setq i (1+ i) x (1+ x)))
-(when match move-ply)))
+ply))
 
 (defsubst chess-input-display-moves (&optional move-list)
   (if (> (length chess-input-move-string) 0)
   (message "[%s] %s" chess-input-move-string
-  (mapconcat 'cdr
+  (mapconcat #'chess-ply-to-algebraic
  (or move-list
  (delq nil (mapcar 'chess-input-test-move
(cdr chess-input-moves
@@ -105,27 +104,24 @@
(cons
 char
 (sort
- (mapcar
-  (function
-   (lambda (ply)
- (cons ply (chess-ply-to-algebraic ply
-  (if (eq char ?b)
-  (append (chess-legal-plies
-   position :piece (if color ?P ?p) :file 1)
-  (chess-legal-plies
-   position :piece (if color ?B ?b)))
-(if (and (>= char ?a)
- (<= char ?h))
-(chess-legal-plies position
-   :piece (if color ?P ?p)
-   :file (- char ?a))
-  (chess-legal-plies position
- :piece (if color
-(upcase char)
-  (downcase char))
+ (if (eq char ?b)
+ (append (chess-legal-plies
+  position :piece (if color ?P ?p) :file 1)
+ (chess-legal-plies
+  position :piece (if color ?B ?b)))
+   (if (and (>= char ?a)
+(<= char ?h))
+   (chess-legal-plies position
+  :piece (if color ?P ?p)
+  :file (- char ?a))
+ (chess-legal-plies position
+:piece (if color
+   (upcase char)
+ (downcase char)
  (function
   (lambda (left right)
-(string-lessp (cdr left) (cdr right))
+(string-lessp (chess-ply-to-algebraic left)
+  (chess-ply-to-algebraic right))
   (let ((moves (delq nil (mapcar 'chess-input-test-move
 (cdr chess-input-moves)
 (cond
@@ -135,10 +131,10 @@
  ;; case, always take the b-pawn move; to select the bishop
  ;; move, use B to begin the keyboard shortcut
  (and (= (length moves) 2)
-  (string= (downcase (cdr (car moves)))
-   (downcase (cdr (cadr moves
+ 

[elpa] 01/01: Improve chess-input.el Commentary.

2014-05-25 Thread Mario Lang
mlang pushed a commit to branch externals/chess
in repository elpa.

commit 0ba0bd2f85d6f54f768294f3f7888f4b6fcbdfee
Author: Mario Lang 
Date:   Sun May 25 16:09:47 2014 +0200

Improve chess-input.el Commentary.
---
 chess-input.el |   17 +
 1 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/chess-input.el b/chess-input.el
index a75a94d..ce7b348 100644
--- a/chess-input.el
+++ b/chess-input.el
@@ -1,6 +1,10 @@
 ;;; chess-input.el --- Keyboard entry of algebraic notation, using shortcut 
notation
 
-;; Copyright (C) 2014 Free Software Foundation, Inc.
+;; Copyright (C) 2002, 2005, 2014 Free Software Foundation, Inc.
+
+;; Author: John Wiegley 
+;; Maintainer: Mario Lang 
+;; Keywords: games
 
 ;; This 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
@@ -17,9 +21,14 @@
 
 ;;; Commentary:
 
-;; This scheme was adapted from the way SCID
-;; (http://scid.sourceforge.net), by Shane Hudson, behaves.  It's the
-;; only way to move your pieces around!
+;; This scheme was adapted from the way SCID (<http://scid.sourceforge.net/>),
+;; by Shane Hudson, behaves.  It is based on standard algebraic notation.
+;; You do not need to type all characters from the corresponding SAN of a move,
+;; chess-input will automatically pick the move once it is unambiguous.
+;;
+;; Additionally, optional characters from SAN are treated as such.
+;; You do not need to type x or =, although you can, if you prefer to.
+;; For instance, "bxc8=N#" can be selected by typing `b c 8 n'.
 
 ;;; Code:
 



[elpa] branch externals/chess updated (95323a6 -> 0ba0bd2)

2014-05-25 Thread Mario Lang
mlang pushed a change to branch externals/chess
in repository elpa.

  from  95323a6   Simplify chess-input-moves.
   new  0ba0bd2   Improve chess-input.el Commentary.

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:
 chess-input.el |   17 +
 1 files changed, 13 insertions(+), 4 deletions(-)



[elpa] 01/01: Remove chess-ply-allow-interactive-query.

2014-05-25 Thread Mario Lang
mlang pushed a commit to branch externals/chess
in repository elpa.

commit d3c4eb4058c275b205fb63139a703cdf1c543c13
Author: Mario Lang 
Date:   Sun May 25 16:53:20 2014 +0200

Remove chess-ply-allow-interactive-query.

Now that chess-input can correctly handle promotions, this hack can and
should be removed.  chess-legal-plies will now always generate all possible
promotions, and chess-input can select among them.
---
 chess-ai.el  |   95 ++---
 chess-display.el |3 +-
 chess-german.el  |1 -
 chess-ics.el |2 -
 chess-perft.el   |   12 ++
 chess-ply.el |   44 
 6 files changed, 67 insertions(+), 90 deletions(-)

diff --git a/chess-ai.el b/chess-ai.el
index bc6f400..b0a0bcf 100644
--- a/chess-ai.el
+++ b/chess-ai.el
@@ -250,54 +250,53 @@ for all leave nodes of the resulting tree.
 A `cons' cell is returned where `cdr' is the supposedly best move from POSITION
 and `car' is the score of that move.  If there is no legal move from POSITION
 \(or DEPTH is 0), `cdr' will be nil."
-  (let ((chess-ply-allow-interactive-query nil))
-(if (zerop depth)
-   (cons (funcall eval-fn position) nil)
-  (let ((plies (let ((chess-ai-mobility nil)
-(chess-ai-quiescence nil))
-(sort
- (mapcar
-  (lambda (ply)
-(chess-ply-set-keyword
- ply :score
- (- (chess-ai-search (chess-ply-next-pos ply)
- 1
- (1+ most-negative-fixnum)
- most-positive-fixnum
- #'chess-ai-eval-static)))
-ply)
-  (chess-legal-plies
-   position :color (chess-pos-side-to-move position)))
- (lambda (lhs rhs)
-   (> (chess-ply-keyword lhs :score)
-  (chess-ply-keyword rhs :score)))
-   (if (null plies)
-   (cons (funcall eval-fn position) nil)
- (let* ((best-ply (car plies))
-(progress (make-progress-reporter
-   (format "Thinking... (%s) "
-   (chess-ply-to-algebraic best-ply))
-   0 (length plies
-   (cl-loop for i from 1
-for ply in plies
-do (let ((value (- (chess-ai-search
-(chess-ply-next-pos ply)
-(1- depth) (- upper-bound) (- 
lower-bound)
-eval-fn
- (progress-reporter-update progress i)
-   (accept-process-output nil 0.05)
- (when (> value lower-bound)
-   (setq lower-bound value
- best-ply ply)
-   (progress-reporter-force-update
-progress
-i
-(format "Thinking... (%s {cp=%d}) "
-(chess-ply-to-algebraic best-ply)
-lower-bound
-until (>= lower-bound upper-bound))
-   (progress-reporter-done progress)
-   (cons lower-bound best-ply)))
+  (if (zerop depth)
+  (cons (funcall eval-fn position) nil)
+(let ((plies (let ((chess-ai-mobility nil)
+  (chess-ai-quiescence nil))
+  (sort
+   (mapcar
+(lambda (ply)
+  (chess-ply-set-keyword
+   ply :score
+   (- (chess-ai-search (chess-ply-next-pos ply)
+   1
+   (1+ most-negative-fixnum)
+   most-positive-fixnum
+   #'chess-ai-eval-static)))
+  ply)
+(chess-legal-plies
+ position :color (chess-pos-side-to-move position)))
+   (lambda (lhs rhs)
+ (> (chess-ply-keyword lhs :score)
+(chess-ply-keyword rhs :score)))
+  (if (null plies)
+ (cons (funcall eval-fn position) nil)
+   (let* ((best-ply (car plies))
+  (progress (make-progress-reporter
+ (format "Thinking... (%s) "
+ (chess-ply-to-algebraic best-ply))
+ 0 (length plies
+ (cl-loop for i from 1
+

[elpa] branch externals/chess updated (0ba0bd2 -> d3c4eb4)

2014-05-25 Thread Mario Lang
mlang pushed a change to branch externals/chess
in repository elpa.

  from  0ba0bd2   Improve chess-input.el Commentary.
   new  d3c4eb4   Remove chess-ply-allow-interactive-query.

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:
 chess-ai.el  |   95 ++---
 chess-display.el |3 +-
 chess-german.el  |1 -
 chess-ics.el |2 -
 chess-perft.el   |   12 ++
 chess-ply.el |   44 
 6 files changed, 67 insertions(+), 90 deletions(-)



[elpa] branch externals/chess updated (d3c4eb4 -> 9718b73)

2014-05-25 Thread Mario Lang
mlang pushed a change to branch externals/chess
in repository elpa.

  from  d3c4eb4   Remove chess-ply-allow-interactive-query.
   new  9718b73   Remove setting of obsolte variable 
ibuffer-maybe-show-regexps

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:
 chess-display.el |5 +
 1 files changed, 1 insertions(+), 4 deletions(-)



[elpa] 01/01: Remove setting of obsolte variable ibuffer-maybe-show-regexps

2014-05-25 Thread Mario Lang
mlang pushed a commit to branch externals/chess
in repository elpa.

commit 9718b730640d3e334aa52251cd8731d3d4959f2f
Author: Mario Lang 
Date:   Sun May 25 19:57:13 2014 +0200

Remove setting of obsolte variable ibuffer-maybe-show-regexps
---
 chess-display.el |5 +
 1 files changed, 1 insertions(+), 4 deletions(-)

diff --git a/chess-display.el b/chess-display.el
index acc103c..2936a9d 100644
--- a/chess-display.el
+++ b/chess-display.el
@@ -972,14 +972,11 @@ The key bindings available in this mode are:
(chess-game-run-hooks chess-module-game 'undo count))
 (ding)))
 
-(defvar ibuffer-maybe-show-regexps)
-
 (defun chess-display-list-buffers ()
   "List all buffders related to this display's current game."
   (interactive)
   (let ((chess-game chess-module-game)
-(lb-command (lookup-key ctl-x-map [(control ?b)]))
-(ibuffer-maybe-show-regexps nil))
+(lb-command (lookup-key ctl-x-map [(control ?b)])))
 ;; FIXME: Running "whatever code is bound to `C-x b'" (which could really
 ;; be anything, if the user is using a completely different key layout, as
 ;; in Evil, ErgoEmacs, or whatnot) while rebinding buffer-list is



[elpa] 01/01: After 10 years of preparation, release 2.0.0.

2014-05-25 Thread Mario Lang
mlang pushed a commit to branch externals/chess
in repository elpa.

commit 1e7c274b88ed2deb5dc6bc5973aaab984d4a228a
Author: Mario Lang 
Date:   Sun May 25 22:19:11 2014 +0200

After 10 years of preparation, release 2.0.0.
---
 chess.el |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/chess.el b/chess.el
index 4b38526..b64bd20 100644
--- a/chess.el
+++ b/chess.el
@@ -4,7 +4,7 @@
 
 ;; Author: John Wiegley 
 ;; Maintainer: Mario Lang 
-;; Version: 0
+;; Version: 2.0.0
 ;; Package-Requires: ((cl-lib "0.5"))
 ;; Keywords: games
 ;; Compatibility: Emacs24
@@ -88,7 +88,7 @@
   "An Emacs chess playing program."
   :group 'games)
 
-(defconst chess-version "2.0b6"
+(defconst chess-version "2.0.0"
   "The version of the Emacs chess program.")
 
 (defcustom chess-default-display



[elpa] branch externals/chess updated (9718b73 -> 1e7c274)

2014-05-25 Thread Mario Lang
mlang pushed a change to branch externals/chess
in repository elpa.

  from  9718b73   Remove setting of obsolte variable 
ibuffer-maybe-show-regexps
   new  1e7c274   After 10 years of preparation, release 2.0.0.

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:
 chess.el |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)



[elpa] 01/02: Add metar.el.

2014-05-26 Thread Mario Lang
mlang pushed a commit to branch master
in repository elpa.

commit 8aadf0c0d68e6cbff0fca08dc78d86eea642bbb8
Author: Mario Lang 
Date:   Sun May 25 00:02:45 2014 +0200

Add metar.el.
---
 packages/metar/metar.el |  508 +++
 1 files changed, 508 insertions(+), 0 deletions(-)

diff --git a/packages/metar/metar.el b/packages/metar/metar.el
new file mode 100644
index 000..3a04b47
--- /dev/null
+++ b/packages/metar/metar.el
@@ -0,0 +1,508 @@
+;;; metar.el --- Retrieve and decode METAR weather information
+
+;; Copyright (C) 2007, 2014  Free Software Foundation, Inc.
+
+;; Author: Mario Lang 
+;; Version: 0
+;; Package-Requires: ((cl-lib "0.5"))
+;; Keywords: comm
+
+;; 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 <http://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; Run `M-x metar RET' to get a simple weather report from weather.noaa.gov.
+;; The value of `calendar-latitude' and `calendar-longitude' will be used to
+;; automatically determine a nearby station.  If these variables are not set,
+;; you will be prompted to enter the location manually.
+;;
+;; With `C-u M-x metar RET', country and station name need to be entered.
+;; `C-u C-u M-x metar RET' will prompt for the METAR station code (4 letters).
+;;
+;; For programmatic access to decoded weather reports, use:
+;;
+;;   (metar-decode (metar-get-record "CODE"))
+
+;;; Code:
+
+(require 'cl-lib)
+(require 'rx)
+(require 'solar)
+(require 'url)
+
+(defvar metar-stations-info-url "http://weather.noaa.gov/data/nsd_bbsss.txt";
+  "URL to use for retrieving station meta information.")
+
+(defvar metar-stations nil
+  "Variable containing (cached) METAR station information.
+Use the function `metar-stations' to get the actual station list.")
+
+(defun metar-stations ()
+  "Retrieve a list of METAR stations.
+Results are cached in variable `metar-stations'.
+If this variable is nil, the information is retrieved from the Internet."
+  (or metar-stations
+  (let ((data (with-temp-buffer
+   (url-insert-file-contents metar-stations-info-url)
+   (mapcar (lambda (entry)
+ (split-string entry ";"))
+   (split-string (buffer-string) "\n")
+   (setq metar-stations nil)
+   (while data
+ (when (and (nth 7 (car data)) (nth 8 (car data))
+(not (string= (nth 2 (car data)) "")))
+   (setq metar-stations
+ (append
+  (let ((item (car data)))
+(list
+ (list (cons 'code (nth 2 item))
+   (cons 'name (nth 3 item))
+   (cons 'country (nth 5 item))
+   (cons 'latitude
+ (when (string-match 
"^\\([0-9]+\\)-\\([0-9]+\\)\\(-[0-9]+\\)?\\([NS]\\)" (nth 7 item))
+ (funcall (if (string= (match-string 4 
(nth 7 item)) "N") #'+ #'-)
+  (+ (string-to-number 
(match-string 1 (nth 7 item)))
+ (/ (string-to-number 
(match-string 2 (nth 7 item)))
+60.0)
+   (cons 'longitude
+ (when (string-match 
"^\\([0-9]+\\)-\\([0-9]+\\)\\(-[0-9]+\\)?\\([WE]\\)" (nth 8 item))
+   (funcall (if (string= (match-string 4 (nth 
8 item)) "E") #'+ #'-)
+(+ (string-to-number (match-string 
1 (nth 8 item)))
+   (/ (string-to-number 
(match-string 2 (nth 8 item)))
+  60.0)
+   (cons 'altitude (string-to-number (nth 12 item))
+  metar-stations)))
+ (setq data (cdr data)))
+   ;; (unless metar-timer
+   ;;   (setq metar-timer
+   ;;  (run-with-timer 600 nil (lambda () (setq metar-stations nil)
+   metar-stations)))
+
+(defun metar-stations-get (station-code key)
+  "Get m

[elpa] branch master updated (4aee70d -> fab13fe)

2014-05-26 Thread Mario Lang
mlang pushed a change to branch master
in repository elpa.

  from  4aee70d   [aa2u maint] Mention TAB infelicity in HACKING; nfc.
   new  8aadf0c   Add metar.el.
   new  fab13fe   Fix phenomena decoding

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:
 packages/metar/metar.el |  509 +++
 1 files changed, 509 insertions(+), 0 deletions(-)
 create mode 100644 packages/metar/metar.el



[elpa] 02/02: Fix phenomena decoding

2014-05-26 Thread Mario Lang
mlang pushed a commit to branch master
in repository elpa.

commit fab13fef39e68b3511d5c5d73673022fe73bc9b0
Author: Mario Lang 
Date:   Mon May 26 14:55:58 2014 +0200

Fix phenomena decoding
---
 packages/metar/metar.el |5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/packages/metar/metar.el b/packages/metar/metar.el
index 3a04b47..cbba5f8 100644
--- a/packages/metar/metar.el
+++ b/packages/metar/metar.el
@@ -388,7 +388,7 @@ If no record was found for STATION, nil is returned."
 (cons 'humidity humidity)
 (cons 'pressure pressure))
(when (metar-phenomena codes)
-(list 'phenomena (metar-phenomena codes)))
+(list (cons 'phenomena (metar-phenomena codes
 
 (defun metar-magnus-formula-humidity-from-dewpoint (temperature dewpoint)
   "Calculate relative humidity (in %) from TEMPERATURE and DEWPOINT (in
@@ -450,7 +450,8 @@ Otherwise, determine the best station via 
latitude/longitude."
   (cadr (assoc 'temperature info))
   (cadr (assoc 'humidity info))
   (if (assoc 'phenomena info)
-  (concat ", " (cdr (assoc 'phenomena info)))
+  (concat "\n" "Phenomena: "
+  (cdr (assoc 'phenomena info)))
 ""))
(message "No weather information found, sorry.")
   



[elpa] 01/01: Fix chess-polyglot to work on 32-bit Emacsen.

2014-05-26 Thread Mario Lang
mlang pushed a commit to branch externals/chess
in repository elpa.

commit 3ba4ea465affe6de3b15ff02b341e470152ab975
Author: Mario Lang 
Date:   Mon May 26 20:21:10 2014 +0200

Fix chess-polyglot to work on 32-bit Emacsen.

Splitting 64-bit values up into 32-bit fixnums does not always work on
32-bit Emacsen due to the tagging bits.  A key is now a
list of 4 16-bit values, instead of a cons of 32-bit values.
---
 NEWS  |   17 ++-
 chess-polyglot.el |  563 +++--
 2 files changed, 297 insertions(+), 283 deletions(-)

diff --git a/NEWS b/NEWS
index 2f82b12..6a359e7 100644
--- a/NEWS
+++ b/NEWS
@@ -1,11 +1,20 @@
--*- mode: text; outline-layout: (1 :) -*-
-
 This is the NEWS file for Emacs Chess, a chess client and analysis library
 written in Emacs Lisp.
 
-Please note that proper documentation is still on its way.
 
-* Release 2.0:
+* Release 2.0.1:
+
+** chess-polyglot now works on 32-bit platforms.
+
+
+* Release 2.0.0:
 
 Began keeping this file.  See doc/chess.info for information about Emacs
 Chess.
+
+
+Local variables:
+coding: utf-8
+mode: outline
+paragraph-separate: "[ ]*$"
+end:
diff --git a/chess-polyglot.el b/chess-polyglot.el
index f1e5d44..a6be4ae 100644
--- a/chess-polyglot.el
+++ b/chess-polyglot.el
@@ -23,7 +23,7 @@
 ;; The polyglot book format uses a 64 bit zorbist hash to encode positions.
 ;; Since 2 bits are used for tagging in Emacs Lisp, 64 bit values can not be
 ;; represented as fixnums.  So we split the 64 bit value up into equally sized
-;; chunks (32 bit fixnums for now).  781 predefined zorbist hash keys are
+;; chunks (16 bit fixnums).  781 predefined zorbist hash keys are
 ;; stored as constants (see `chess-polyglot-zorbist-keys') and used to 
calculate
 ;; zorbist hashes from positions.
 
@@ -74,9 +74,9 @@ polyglot book file.")
 
 (defsubst chess-polyglot-read-key ()
   "Read a polyglot position hash (a 64 bit value) from the current buffer.
-A `cons' with the most significant 32 bits in `car' and the least significant
-32 bits in `cdr' is returned."
-  (cons (chess-polyglot-read-octets 4) (chess-polyglot-read-octets 4)))
+A list with 16-bit values (most significant first) is returned."
+  (list (chess-polyglot-read-octets 2) (chess-polyglot-read-octets 2)
+   (chess-polyglot-read-octets 2) (chess-polyglot-read-octets 2)))
 
 (defun chess-polyglot-read-move ()
   "Read a polyglot move (a 32 bit value) from the current buffer.
@@ -133,8 +133,11 @@ On reaching end or beginning of buffer, stop and signal 
error."
 
 (defsubst chess-polyglot-key-<= (lhs rhs)
   "Non-nil if the polyglot key LHS is less than or equal to RHS."
-  (or (< (car lhs) (car rhs))
-  (and (= (car lhs) (car rhs)) (<= (cdr lhs) (cdr rhs)
+  (while (and lhs rhs (= (car lhs) (car rhs)))
+(setq lhs (cdr lhs) rhs (cdr rhs)))
+  (if (and (null lhs) (null rhs))
+  t
+(<= (car lhs) (car rhs
 
 (defun chess-polyglot-read-moves (key)
   "Read all moves associated with KEY from the current buffer."
@@ -157,271 +160,267 @@ On reaching end or beginning of buffer, stop and signal 
error."
 moves))
 
 (defconst chess-polyglot-zorbist-keys
-  [(2637767806 . 863464769) (720845184 . 95069639) (1155203408 . 610415943)
-   (2618685246 . 1655139042) (1971536997 . 1218186377) (848342074 . 540017087)
-   (263957791 . 1627660921) (3896152207 . 4076560586) (226391645 . 1484086288)
-   (436746274 . 3467632685) (2516964848 . 3797861296) (3491888988 . 3510251221)
-   (1086189917 . 1248276018) (18044180 . 1876255637) (157236 . 1190386149)
-   (597658413 . 2146900428) (97624494 . 2243205793) (1738507407 . 1854916977)
-   (1950989311 . 2149575947) (2098318769 . 3283594736) (2194108574 . 
2015279052)
-   (4079062812 . 2500884588) (856979699 . 2941369318) (1270058469 . 3877737539)
-   (2858720366 . 3170717948) (2378012835 . 1387254795) (2278688587 . 
2178388503)
-   (435406673 . 3555273441) (3031118064 . 1655806655) (2063925420 . 1107589828)
-   (3376753832 . 436852829) (615148625 . 1302492416) (1285502018 . 1963045959)
-   (346460119 . 1016137793) (2803604355 . 1176288659) (55085973 . 2968618255)
-   (1669016372 . 4287873088) (164740250 . 1037634196) (896886403 . 883023163)
-   (1935551383 . 2764331555) (410153072 . 4055711755) (533441746 . 1505690343)
-   (3541084098 . 3466290517) (3214426080 . 4267541060) (2675233103 . 
1951705124)
-   (1374411850 . 3115986997) (1552073989 . 3684348154) (4244110986 . 875606593)
-   (844343081 . 3115990494) (2356462440 . 135999605) (3116133511 . 377238503)
-   (2129956651 . 2197966368) (299173332 . 3276914047) (1701379241 . 745972291)
-   (1306570996 . 254977976) (2530644806 . 214138461) (1122123979 . 1667800879)
-   (1831591130 . 3801192033) (1116211970 . 920967505) (1594837592 . 2551651254)
-   (972591349 . 2046373768) (2479207924 . 1935030411) (1675376029 . 2367888248)

[elpa] branch externals/chess updated (1e7c274 -> 3ba4ea4)

2014-05-26 Thread Mario Lang
mlang pushed a change to branch externals/chess
in repository elpa.

  from  1e7c274   After 10 years of preparation, release 2.0.0.
   new  3ba4ea4   Fix chess-polyglot to work on 32-bit Emacsen.

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:
 NEWS  |   17 ++-
 chess-polyglot.el |  563 +++--
 2 files changed, 297 insertions(+), 283 deletions(-)



[elpa] 02/02: Merge branch 'master' of git+ssh://git.sv.gnu.org/srv/git/emacs/elpa

2014-05-28 Thread Mario Lang
mlang pushed a commit to branch master
in repository elpa.

commit f9898329cc8e6cf52a2e47b39a8b54fb94652d6d
Merge: 741860f 4fb5acb
Author: Mario Lang 
Date:   Wed May 28 10:41:17 2014 +0200

Merge branch 'master' of git+ssh://git.sv.gnu.org/srv/git/emacs/elpa

 packages/gnugo/gnugo.el |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)



[elpa] branch master updated (4fb5acb -> f989832)

2014-05-28 Thread Mario Lang
mlang pushed a change to branch master
in repository elpa.

  from  4fb5acb   [gnugo int] Bump required ‘xpm’ version to "1.0.1".
   new  741860f   Use calc-units to convert units to a user-defined setting 
(WIP)
   new  f989832   Merge branch 'master' of 
git+ssh://git.sv.gnu.org/srv/git/emacs/elpa

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:
 packages/metar/metar.el |   34 --
 1 files changed, 28 insertions(+), 6 deletions(-)



[elpa] 01/02: Use calc-units to convert units to a user-defined setting (WIP)

2014-05-28 Thread Mario Lang
mlang pushed a commit to branch master
in repository elpa.

commit 741860fb1d62c2b07b6a96f220fbf3fbaa57c23b
Author: Mario Lang 
Date:   Tue May 27 17:09:01 2014 +0200

Use calc-units to convert units to a user-defined setting (WIP)

Covers wind speed and air pressure for now, more to come.
---
 packages/metar/metar.el |   34 --
 1 files changed, 28 insertions(+), 6 deletions(-)

diff --git a/packages/metar/metar.el b/packages/metar/metar.el
index 43a72db..5c4410a 100644
--- a/packages/metar/metar.el
+++ b/packages/metar/metar.el
@@ -36,11 +36,15 @@
 
 ;;; Code:
 
+(require 'calc)
+(require 'calc-units)
 (require 'cl-lib)
 (require 'rx)
 (require 'solar)
 (require 'url)
 
+(defvar metar-units '((speed . kph) (pressure . bar)))
+
 (defvar metar-stations-info-url "http://weather.noaa.gov/data/nsd_bbsss.txt";
   "URL to use for retrieving station meta information.")
 
@@ -217,8 +221,6 @@ record.")
 REturn a cons where `car' is the time of the measurement (as an emacs-lsip
 time value) and `cdr' is a string containing the actual METAR code.
 If no record was found for STATION, nil is returned."
-  (unless (string-match "^[A-Z][A-Z0-9][A-Z0-9][A-Z0-9]$" station)
-(signal 'error "Invalid station code"))
   (with-temp-buffer
 (url-insert-file-contents (metar-url station))
 (when (re-search-forward (format metar-record-regexp station) nil t)
@@ -331,9 +333,9 @@ If no record was found for STATION, nil is returned."
   (when (and (match-string 4 info) (match-string 5 info))
 (list :from (metar-degrees (string-to-number (match-string 4 
info)))
   :to (metar-degrees (string-to-number (match-string 5 
info)))
- (list :speed (metar-knots (string-to-number (match-string 2 info
+ (list :speed (metar-convert-unit (concat (match-string 2 info) "knot") 
(cdr (assq 'speed metar-units
  (when (match-string 3 info)
-   (list :gusts (metar-knots (string-to-number (match-string 3 info
+   (list :gust (metar-convert-unit (concat (match-string 3 info) "knot") 
(cdr (assq 'speed metar-units
 
 (defconst metar-visibility-regexp
   (rx symbol-start (group (1+ digit)) (optional (group "SM")) symbol-end))
@@ -367,8 +369,12 @@ If no record was found for STATION, nil is returned."
 
 (defun metar-pressure (info)
   (when (string-match metar-pressure-regexp info)
-(cons (string-to-number (match-string 2 info))
- (if (string= (match-string 1 info) "Q") 'hPa 'inHg
+(metar-convert-unit (cond
+((string= (match-string 1 info) "Q")
+ (concat "(" (match-string 2 info) " / 1000) bar"))
+((string= (match-string 1 info) "A")
+ (concat "(" (match-string 2 info) " / 100) inHg")))
+   (cdr (assq 'pressure metar-units)
 
 (defun metar-decode (record)
   "Return a lisp structure describing the weather information in RECORD."
@@ -504,5 +510,21 @@ Otherwise, determine the best station via 
latitude/longitude."
   (when (> count 0)
(/ (float temp-sum) count)
 
+(defun metar-convert-unit (value new-unit)
+  "Convert VALUE to NEW-UNIT.
+VALUE is a string with the value followed by the unit, like \"5 knot\"
+and NEW-UNIT should be a unit name like \"kph\" or similar."
+  (cl-check-type value string)
+  (cl-check-type new-unit (or string symbol))
+  (cl-multiple-value-bind (value unit)
+  (split-string
+   (math-format-value
+   (math-convert-units (math-simplify (math-read-expr value))
+   (math-read-expr (cl-etypecase new-unit
+ (string new-unit)
+ (symbol (symbol-name 
new-unit))
+   " ")
+(cons (string-to-number value) (intern unit
+
 (provide 'metar)
 ;;; metar.el ends here



[elpa] branch master updated (970f2b0 -> d08069b)

2014-05-29 Thread Mario Lang
mlang pushed a change to branch master
in repository elpa.

  from  970f2b0   [aa2u] Release: 1.9
   new  d08069b   [metar] Make the length unit configurable (clouds) and 
simplify pressure conversion

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/metar/metar.el |   20 
 1 files changed, 12 insertions(+), 8 deletions(-)



[elpa] 01/01: [metar] Make the length unit configurable (clouds) and simplify pressure conversion

2014-05-29 Thread Mario Lang
mlang pushed a commit to branch master
in repository elpa.

commit d08069bc34c129b5a4be2e8c90271eb2f6bffd50
Author: Mario Lang 
Date:   Thu May 29 14:40:32 2014 +0200

[metar] Make the length unit configurable (clouds) and simplify pressure 
conversion
---
 packages/metar/metar.el |   20 
 1 files changed, 12 insertions(+), 8 deletions(-)

diff --git a/packages/metar/metar.el b/packages/metar/metar.el
index 5c4410a..60bc129 100644
--- a/packages/metar/metar.el
+++ b/packages/metar/metar.el
@@ -43,7 +43,9 @@
 (require 'solar)
 (require 'url)
 
-(defvar metar-units '((speed . kph) (pressure . bar)))
+(defvar metar-units '((length . m)
+ (pressure . bar)
+ (speed . kph)))
 
 (defvar metar-stations-info-url "http://weather.noaa.gov/data/nsd_bbsss.txt";
   "URL to use for retrieving station meta information.")
@@ -247,7 +249,9 @@ If no record was found for STATION, nil is returned."
 (while (string-match metar-could-regexp info from)
   (setq from (match-end 0)
clouds (push (append (list (match-string 1 info)
-  (string-to-number (match-string 2 info)))
+  (metar-convert-unit
+   (concat (match-string 2 info) " ft")
+   (cdr (assq 'length metar-units
 (when (match-string 3 info)
   (list (match-string 3 info
 clouds)))
@@ -369,12 +373,12 @@ If no record was found for STATION, nil is returned."
 
 (defun metar-pressure (info)
   (when (string-match metar-pressure-regexp info)
-(metar-convert-unit (cond
-((string= (match-string 1 info) "Q")
- (concat "(" (match-string 2 info) " / 1000) bar"))
-((string= (match-string 1 info) "A")
- (concat "(" (match-string 2 info) " / 100) inHg")))
-   (cdr (assq 'pressure metar-units)
+(metar-convert-unit
+ (concat (match-string 2 info)
+(cond
+ ((string= (match-string 1 info) "Q") "hPa")
+ ((string= (match-string 1 info) "A") "cinHg")))
+ (cdr (assq 'pressure metar-units)
 
 (defun metar-decode (record)
   "Return a lisp structure describing the weather information in RECORD."



[elpa] branch master updated (d08069b -> 9a44292)

2014-05-29 Thread Mario Lang
mlang pushed a change to branch master
in repository elpa.

  from  d08069b   [metar] Make the length unit configurable (clouds) and 
simplify pressure conversion
   new  9a44292   [metar] defcustom for metar-units

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/metar/metar.el |   96 +++---
 1 files changed, 65 insertions(+), 31 deletions(-)



[elpa] 01/01: [metar] defcustom for metar-units

2014-05-29 Thread Mario Lang
mlang pushed a commit to branch master
in repository elpa.

commit 9a44292c89fede1a68f2b2ba196474f0190a5851
Author: Mario Lang 
Date:   Fri May 30 00:16:08 2014 +0200

[metar] defcustom for metar-units
---
 packages/metar/metar.el |   96 +++---
 1 files changed, 65 insertions(+), 31 deletions(-)

diff --git a/packages/metar/metar.el b/packages/metar/metar.el
index 60bc129..4909f00 100644
--- a/packages/metar/metar.el
+++ b/packages/metar/metar.el
@@ -43,9 +43,37 @@
 (require 'solar)
 (require 'url)
 
-(defvar metar-units '((length . m)
- (pressure . bar)
- (speed . kph)))
+(defcustom metar-units '((length . m)
+(pressure . hPa)
+(speed . kph)
+(temperature . degC))
+  "Default measurement units to use when reporting weather information."
+  :type '(list (cons :format "%v"
+(const :tag "Length: " length)
+(choice (const :tag "Meter" m)
+(const :tag "Inch" in)
+(const :tag "Foot" ft)
+(const :tag "Yard" yd)
+(const :tag "Mile" mi)))
+  (cons :format "%v"
+(const :tag "Pressure:" pressure)
+(choice (const :tag "Pascal" Pa)
+(const :tag "Hecto pascal" hPa)
+(const :tag "Bar" bar)
+(const :tag "Inch of mercury" inHg)
+(const :tag "Standard atmosphere" atm)
+(const :tag "Meter of mercury" mHg)
+(const :tag "Punds per square inch" psi)))
+  (cons :format "%v"
+(const :tag "Speed:" speed)
+(choice (const :tag "Kilometers per hour" kph)
+(const :tag "Miles per hour" mph)
+(const :tag "Knot" knot)))
+  (cons :format "%v"
+(const :tag "Temperature:" temperature)
+(choice (const :tag "Degree Celsius" degC)
+(const :tag "Degree Kelvin" degK)
+(const :tag "Degree Fahrenheit" degF)
 
 (defvar metar-stations-info-url "http://weather.noaa.gov/data/nsd_bbsss.txt";
   "URL to use for retrieving station meta information.")
@@ -193,13 +221,34 @@ If no match if found, nil is returned."
   (when station-code
(cons station-code (round best-distance))
 
-(defun metar-temp-to-number (string)
-  "Convert a METAR temperature to a number."
-  (if (= (aref string 0) ?M)
-  (- (string-to-number (substring string 1)))
-(string-to-number string)))
+(defun metar-convert-unit (value new-unit)
+  "Convert VALUE to NEW-UNIT.
+VALUE is a string with the value followed by the unit, like \"5 knot\"
+and NEW-UNIT should be a unit name like \"kph\" or similar."
+  (cl-check-type value string)
+  (cl-check-type new-unit (or string symbol))
+  (cl-multiple-value-bind (value unit)
+  (split-string
+   (math-format-value
+   (math-convert-units (math-simplify (math-read-expr value))
+   (math-read-expr
+(cl-etypecase new-unit
+  (string new-unit)
+  (symbol (symbol-name new-unit))
+   " ")
+(cons (string-to-number value) (intern unit
 
-(defvar metar-url 
"http://weather.noaa.gov/pub/data/observations/metar/stations/%s.TXT";
+(defun metar-convert-temperature (string)
+  "Convert a METAR temperature."
+  (metar-convert-unit
+   (concat (if (= (aref string 0) ?M)
+  (concat "-" (substring string 1))
+string)
+  "degC")
+   (cdr (assq 'temperature metar-units
+
+(defvar metar-url
+  "http://weather.noaa.gov/pub/data/observations/metar/stations/%s.TXT";
   "URL used to fetch station specific information.
 %s is replaced with the 4 letter station code.")
 
@@ -354,18 +403,19 @@ If no record was found for STATION, nil is returned."
 
 (defun metar-temperature (info)
   (when (string-match metar-temperature-and-dewpoint-regexp info)
-(cons (metar-temp-to-number (match-string 1 info)) 'celsius)))
+(metar-convert-temperature (match-string 1 info
 
 (defun metar-dewpoint (info)
   (when (string-match metar-temperature-and-dewpoint-regexp info)
-(cons (me

[elpa] 04/04: Merge branch 'master' of git+ssh://git.sv.gnu.org/srv/git/emacs/elpa

2014-05-30 Thread Mario Lang
mlang pushed a commit to branch master
in repository elpa.

commit 9a378dacf0b34221bb7c252dc20ff70b388fbb31
Merge: bf2c2a3 9a44292
Author: Mario Lang 
Date:   Fri May 30 14:02:45 2014 +0200

Merge branch 'master' of git+ssh://git.sv.gnu.org/srv/git/emacs/elpa

 README |4 +-
 admin/archive-contents.el  |   70 +-
 admin/forward-diffs.py |   10 +-
 packages/ada-mode/NEWS |   19 +
 packages/ada-mode/README   |4 +-
 packages/ada-mode/ada-gnat-xref.el |4 +-
 packages/ada-mode/ada-grammar-wy.el| 2671 ++--
 packages/ada-mode/ada-mode.el  |   89 +-
 packages/ada-mode/ada-mode.info|   81 +-
 packages/ada-mode/ada-wisi.el  |9 +-
 packages/ada-mode/gnat-core.el |   12 +-
 packages/ada-mode/gnat-inspect.el  |   12 +-
 packages/ada-mode/gpr-mode.el  |   11 -
 packages/ada-mode/gpr-query.el |   25 +-
 packages/ascii-art-to-unicode/HACKING  |1 +
 packages/ascii-art-to-unicode/NEWS |4 +
 .../ascii-art-to-unicode/ascii-art-to-unicode.el   |   25 +-
 packages/gnugo/NEWS|1 +
 packages/gnugo/gnugo-frolic.el |  203 +-
 packages/gnugo/gnugo-imgen.el  |   91 +-
 packages/gnugo/gnugo.el|  416 ++--
 packages/metar/metar.el|  568 +
 packages/nlinum/nlinum.el  |   13 +-
 packages/osc/osc.el|  237 ++
 24 files changed, 2805 insertions(+), 1775 deletions(-)



[elpa] 01/04: [quarter-plane] Fix typo in Commentary.

2014-05-30 Thread Mario Lang
mlang pushed a commit to branch master
in repository elpa.

commit 60ae18ef2c62ea5eb4d07d536532375a76548316
Author: Mario Lang 
Date:   Thu May 22 12:35:24 2014 +0200

[quarter-plane] Fix typo in Commentary.
---
 GNUmakefile |2 +-
 packages/quarter-plane/quarter-plane.el |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/GNUmakefile b/GNUmakefile
index 03a25f2..7d88843 100644
--- a/GNUmakefile
+++ b/GNUmakefile
@@ -54,7 +54,7 @@ process-archive:
  fi;   \
  if [ -d $$pt ]; then  \
  echo "Creating tarball $${pt}.tar" && \
- tar -cf $${pt}.tar $$pt -X "$$ignore";\
+ tar -cf $${pt}.tar $$pt --exclude-vcs -X "$$ignore";  \
  rm -rf $${pt};\
  fi;   \
  done
diff --git a/packages/quarter-plane/quarter-plane.el 
b/packages/quarter-plane/quarter-plane.el
index f73fd4e..3cb70d9 100644
--- a/packages/quarter-plane/quarter-plane.el
+++ b/packages/quarter-plane/quarter-plane.el
@@ -24,7 +24,7 @@
 ;; This package provides Quarter Plane mode, a minor mode which
 ;; provides Picture mode style editing (treating the screen as a
 ;; semi-infinite quarter-plane).  Unlike Picture mode, it is a minor
-;; modes (see the Emacs manual for the documentation of Picture mode).
+;; mode (see the Emacs manual for the documentation of Picture mode).
 ;; Type M-x quarter-plane-mode to enable Quarter Plane mode in the
 ;; current buffer, and M-x global-quarter-plane-mode to enable it
 ;; globally.



[elpa] 02/04: Merge branch 'master' of git+ssh://git.sv.gnu.org/srv/git/emacs/elpa

2014-05-30 Thread Mario Lang
mlang pushed a commit to branch master
in repository elpa.

commit 89e811c2db286f3b493775c5b7f5e43881f4ba2e
Merge: 60ae18e 5315891
Author: Mario Lang 
Date:   Thu May 22 14:07:42 2014 +0200

Merge branch 'master' of git+ssh://git.sv.gnu.org/srv/git/emacs/elpa




[elpa] 03/04: Merge branch 'master' of git+ssh://git.sv.gnu.org/srv/git/emacs/elpa

2014-05-30 Thread Mario Lang
mlang pushed a commit to branch master
in repository elpa.

commit bf2c2a3d2a4af5c851152c3ac16af1d5dbe964d1
Merge: 89e811c 995856a
Author: Mario Lang 
Date:   Thu May 22 23:50:09 2014 +0200

Merge branch 'master' of git+ssh://git.sv.gnu.org/srv/git/emacs/elpa

 admin/update-archive.sh |5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)



[elpa] branch master updated (9a44292 -> 9a378da)

2014-05-30 Thread Mario Lang
mlang pushed a change to branch master
in repository elpa.

  from  9a44292   [metar] defcustom for metar-units
   new  60ae18e   [quarter-plane] Fix typo in Commentary.
   new  89e811c   Merge branch 'master' of 
git+ssh://git.sv.gnu.org/srv/git/emacs/elpa
   new  bf2c2a3   Merge branch 'master' of 
git+ssh://git.sv.gnu.org/srv/git/emacs/elpa
   new  9a378da   Merge branch 'master' of 
git+ssh://git.sv.gnu.org/srv/git/emacs/elpa

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



[elpa] branch master updated (53b7279 -> e868fe0)

2014-05-30 Thread Mario Lang
mlang pushed a change to branch master
in repository elpa.

  from  53b7279   [xpm] Release: 1.0.2
   new  9444f39   [metar] Fix humidity calculation when Fahrenheit is used
   new  cd38e56   Merge branch 'master' of 
git+ssh://git.sv.gnu.org/srv/git/emacs/elpa
   new  e868fe0   Merge branch 'master' of 
git+ssh://git.sv.gnu.org/srv/git/emacs/elpa

The 3 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/metar/metar.el |   25 +
 1 files changed, 17 insertions(+), 8 deletions(-)



[elpa] 02/03: Merge branch 'master' of git+ssh://git.sv.gnu.org/srv/git/emacs/elpa

2014-05-30 Thread Mario Lang
mlang pushed a commit to branch master
in repository elpa.

commit cd38e56117ee6b81ea54edea3be0b95941d73148
Merge: 9444f39 9a378da
Author: Mario Lang 
Date:   Fri May 30 14:59:31 2014 +0200

Merge branch 'master' of git+ssh://git.sv.gnu.org/srv/git/emacs/elpa

 GNUmakefile |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)



[elpa] 03/03: Merge branch 'master' of git+ssh://git.sv.gnu.org/srv/git/emacs/elpa

2014-05-30 Thread Mario Lang
mlang pushed a commit to branch master
in repository elpa.

commit e868fe0795a945133202d335e9e051f122a4ee91
Merge: cd38e56 53b7279
Author: Mario Lang 
Date:   Fri May 30 23:06:10 2014 +0200

Merge branch 'master' of git+ssh://git.sv.gnu.org/srv/git/emacs/elpa

 packages/xpm/NEWS   |3 +++
 packages/xpm/xpm.el |8 ++--
 2 files changed, 5 insertions(+), 6 deletions(-)



[elpa] 01/03: [metar] Fix humidity calculation when Fahrenheit is used

2014-05-30 Thread Mario Lang
mlang pushed a commit to branch master
in repository elpa.

commit 9444f39279adf613110f4b7ab600bc1edc1f0701
Author: Mario Lang 
Date:   Fri May 30 11:30:50 2014 +0200

[metar] Fix humidity calculation when Fahrenheit is used
---
 packages/metar/metar.el |   25 +
 1 files changed, 17 insertions(+), 8 deletions(-)

diff --git a/packages/metar/metar.el b/packages/metar/metar.el
index 4909f00..02e27aa 100644
--- a/packages/metar/metar.el
+++ b/packages/metar/metar.el
@@ -72,7 +72,8 @@
   (cons :format "%v"
 (const :tag "Temperature:" temperature)
 (choice (const :tag "Degree Celsius" degC)
-(const :tag "Degree Kelvin" degK)
+;; calc-units doesn't convert degC to degK
+;(const :tag "Degree Kelvin" degK)
 (const :tag "Degree Fahrenheit" degF)
 
 (defvar metar-stations-info-url "http://weather.noaa.gov/data/nsd_bbsss.txt";
@@ -238,14 +239,16 @@ and NEW-UNIT should be a unit name like \"kph\" or 
similar."
" ")
 (cons (string-to-number value) (intern unit
 
-(defun metar-convert-temperature (string)
-  "Convert a METAR temperature."
+(defun metar-convert-temperature (string &optional unit)
+  "Convert a METAR temperature.
+If optional argument UNIT is provided, convert to that unit, otherwise,
+consult `metar-units'."
   (metar-convert-unit
(concat (if (= (aref string 0) ?M)
   (concat "-" (substring string 1))
 string)
   "degC")
-   (cdr (assq 'temperature metar-units
+   (or unit (cdr (assq 'temperature metar-units)
 
 (defvar metar-url
   "http://weather.noaa.gov/pub/data/observations/metar/stations/%s.TXT";
@@ -413,8 +416,9 @@ If no record was found for STATION, nil is returned."
   (when (string-match metar-temperature-and-dewpoint-regexp info)
 (cons (round
   (metar-magnus-formula-humidity-from-dewpoint
-   (save-match-data (car (metar-convert-temperature (match-string 1 
info
-   (car (metar-convert-temperature (match-string 3 info)
+   (save-match-data (car (metar-convert-temperature
+  (match-string 1 info) 'degC)))
+   (car (metar-convert-temperature (match-string 3 info) 'degC
  'percent)))
 
 (defconst metar-pressure-regexp
@@ -503,11 +507,16 @@ Otherwise, determine the best station via 
latitude/longitude."
 nil t
 (let ((info (metar-decode (metar-get-record station
   (if info
- (message "%d minutes ago at %s: %d°C, %d%% relative humidity%s"
-  (/ (truncate (float-time (time-since (cdr (assoc 'timestamp 
info) 60)
+ (message "%d minutes ago at %s: %d°%c, %d%% relative humidity%s"
+  (/ (truncate (float-time (time-since
+(cdr (assoc 'timestamp info)
+ 60)
   (or (metar-stations-get (cdr (assoc 'station info)) 'name)
   (cdr (assoc 'station info)))
   (cadr (assoc 'temperature info))
+  (cond
+   ((eq (cdr (assq 'temperature metar-units)) 'degC) ?C)
+   ((eq (cdr (assq 'temperature metar-units)) 'degF) ?F))
   (cadr (assoc 'humidity info))
   (if (assoc 'phenomena info)
   (concat "\n" "Phenomena: "



[elpa] branch master updated (e868fe0 -> 649b00a)

2014-05-31 Thread Mario Lang
mlang pushed a change to branch master
in repository elpa.

  from  e868fe0   Merge branch 'master' of 
git+ssh://git.sv.gnu.org/srv/git/emacs/elpa
   new  649b00a   [metar] Fix metar-convert-temperature to actually DTRT

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/metar/metar.el |  182 ++-
 1 files changed, 131 insertions(+), 51 deletions(-)



[elpa] 01/01: [metar] Fix metar-convert-temperature to actually DTRT

2014-05-31 Thread Mario Lang
mlang pushed a commit to branch master
in repository elpa.

commit 649b00a437b346d4b283e09690be71bbb6b54a34
Author: Mario Lang 
Date:   Sat May 31 21:17:15 2014 +0200

[metar] Fix metar-convert-temperature to actually DTRT
---
 packages/metar/metar.el |  182 ++-
 1 files changed, 131 insertions(+), 51 deletions(-)

diff --git a/packages/metar/metar.el b/packages/metar/metar.el
index 02e27aa..182e805 100644
--- a/packages/metar/metar.el
+++ b/packages/metar/metar.el
@@ -30,24 +30,32 @@
 ;; With `C-u M-x metar RET', country and station name need to be entered.
 ;; `C-u C-u M-x metar RET' will prompt for the METAR station code (4 letters).
 ;;
+;; Customize `metar-units' to change length, speed, temperature or pressure
+;; units to your liking.
+;;
 ;; For programmatic access to decoded weather reports, use:
 ;;
 ;;   (metar-decode (metar-get-record "CODE"))
 
 ;;; Code:
 
-(require 'calc)
 (require 'calc-units)
 (require 'cl-lib)
+(require 'format-spec)
 (require 'rx)
 (require 'solar)
 (require 'url)
 
+(defgroup metar ()
+  "METAR weather reports."
+  :group 'net-utils)
+
 (defcustom metar-units '((length . m)
 (pressure . hPa)
 (speed . kph)
 (temperature . degC))
   "Default measurement units to use when reporting weather information."
+  :group 'metar
   :type '(list (cons :format "%v"
 (const :tag "Length: " length)
 (choice (const :tag "Meter" m)
@@ -72,17 +80,51 @@
   (cons :format "%v"
 (const :tag "Temperature:" temperature)
 (choice (const :tag "Degree Celsius" degC)
-;; calc-units doesn't convert degC to degK
-;(const :tag "Degree Kelvin" degK)
+(const :tag "Degree Kelvin" degK)
 (const :tag "Degree Fahrenheit" degF)
 
-(defvar metar-stations-info-url "http://weather.noaa.gov/data/nsd_bbsss.txt";
-  "URL to use for retrieving station meta information.")
+(defcustom metar-stations-info-url "http://weather.noaa.gov/data/nsd_bbsss.txt";
+  "URL to use for retrieving station meta information."
+  :group 'metar
+  :type 'string)
 
 (defvar metar-stations nil
   "Variable containing (cached) METAR station information.
 Use the function `metar-stations' to get the actual station list.")
 
+(defun metar-station-convert-latitude (string)
+  (when (string-match (rx string-start
+ (group (1+ digit))
+ ?-
+ (group (1+ digit))
+ (optional ?- (group (1+ digit)))
+ (group (char ?N ?S))
+ string-end) string)
+(funcall (if (string= (match-string 4 string) "N") #'+ #'-)
+(+ (string-to-number (match-string 1 string))
+   (/ (string-to-number (match-string 2 string))
+  60.0)
+   (if (match-string 3 string)
+   (/ (string-to-number (match-string 3 string)) 3600.0)
+ 0)
+
+(defun metar-station-convert-longitude (string)
+  (when (string-match (rx string-start
+ (group (1+ digit))
+ ?-
+ (group (1+ digit))
+ (optional ?- (group (1+ digit)))
+ (group (char ?E ?W))
+ string-end) string)
+(funcall (if (string= (match-string 4 string) "E") #'+ #'-)
+(+ (string-to-number (match-string 1 string))
+   (/ (string-to-number (match-string 2 string))
+  60.0)
+   (if (match-string 3 string)
+   (/ (string-to-number (match-string 3 string))
+  3600.0)
+ 0)
+
 (defun metar-stations ()
   "Retrieve a list of METAR stations.
 Results are cached in variable `metar-stations'.
@@ -105,17 +147,9 @@ If this variable is nil, the information is retrieved from 
the Internet."
(cons 'name (nth 3 item))
(cons 'country (nth 5 item))
(cons 'latitude
- (when (string-match 
"^\\([0-9]+\\)-\\([0-9]+\\)\\(-[0-9]+\\)?\\([NS]\\)" (nth 7 item))
- (funcall (if (string= (match-string 4 
(nth 7 item)) "N") #'+ #'-)
-  (+ (string-to-number 
(match-string 1 (nth 7 item)))
- 

[elpa] branch master updated (590892e -> 1585aa0)

2014-06-02 Thread Mario Lang
mlang pushed a change to branch master
in repository elpa.

  from  590892e   Merge branch 'master' of 
git+ssh://git.sv.gnu.org/srv/git/emacs/elpa
   new  1585aa0   [metar] Unify station lat/lon conversion.

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/metar/metar.el |   35 ---
 1 files changed, 8 insertions(+), 27 deletions(-)



[elpa] 01/01: [metar] Unify station lat/lon conversion.

2014-06-02 Thread Mario Lang
mlang pushed a commit to branch master
in repository elpa.

commit 1585aa024853b06815ea2da4a03cc7e7fe4dd2a7
Author: Mario Lang 
Date:   Mon Jun 2 22:26:34 2014 +0200

[metar] Unify station lat/lon conversion.
---
 packages/metar/metar.el |   35 ---
 1 files changed, 8 insertions(+), 27 deletions(-)

diff --git a/packages/metar/metar.el b/packages/metar/metar.el
index 182e805..82b83b7 100644
--- a/packages/metar/metar.el
+++ b/packages/metar/metar.el
@@ -92,39 +92,20 @@
   "Variable containing (cached) METAR station information.
 Use the function `metar-stations' to get the actual station list.")
 
-(defun metar-station-convert-latitude (string)
+(defun metar-station-convert-dms-to-deg (string)
+  "Convert degrees, minutes and optional seconds, to degrees."
   (when (string-match (rx string-start
- (group (1+ digit))
- ?-
- (group (1+ digit))
+ (group (1+ digit)) ?- (group (1+ digit))
  (optional ?- (group (1+ digit)))
- (group (char ?N ?S))
+ (group (char ?N ?E ?S ?W))
  string-end) string)
-(funcall (if (string= (match-string 4 string) "N") #'+ #'-)
+(funcall (if (memq (aref (match-string 4 string) 0) '(?N ?E)) #'+ #'-)
 (+ (string-to-number (match-string 1 string))
-   (/ (string-to-number (match-string 2 string))
-  60.0)
+   (/ (string-to-number (match-string 2 string)) 60.0)
(if (match-string 3 string)
(/ (string-to-number (match-string 3 string)) 3600.0)
  0)
 
-(defun metar-station-convert-longitude (string)
-  (when (string-match (rx string-start
- (group (1+ digit))
- ?-
- (group (1+ digit))
- (optional ?- (group (1+ digit)))
- (group (char ?E ?W))
- string-end) string)
-(funcall (if (string= (match-string 4 string) "E") #'+ #'-)
-(+ (string-to-number (match-string 1 string))
-   (/ (string-to-number (match-string 2 string))
-  60.0)
-   (if (match-string 3 string)
-   (/ (string-to-number (match-string 3 string))
-  3600.0)
- 0)
-
 (defun metar-stations ()
   "Retrieve a list of METAR stations.
 Results are cached in variable `metar-stations'.
@@ -147,9 +128,9 @@ If this variable is nil, the information is retrieved from 
the Internet."
(cons 'name (nth 3 item))
(cons 'country (nth 5 item))
(cons 'latitude
- (metar-station-convert-latitude (nth 7 item)))
+ (metar-station-convert-dms-to-deg (nth 7 
item)))
(cons 'longitude
- (metar-station-convert-longitude (nth 8 
item)))
+ (metar-station-convert-dms-to-deg (nth 8 
item)))
(cons 'altitude (string-to-number (nth 12 item))
   metar-stations)))
  (setq data (cdr data)))



[elpa] branch externals/chess updated (3ba4ea4 -> f37f79b)

2014-06-03 Thread Mario Lang
mlang pushed a change to branch externals/chess
in repository elpa.

  from  3ba4ea4   Fix chess-polyglot to work on 32-bit Emacsen.
   new  6676272   chess-search-position: Use dolist instead of mapc.
   new  4d85c83   Compile chess-perft and dependencies to speed up ert 
tests.
   new  f37f79b   chess-perft requires chess-display.

The 3 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:
 Makefile   |   13 -
 chess-perft.el |1 +
 chess-pos.el   |6 +++---
 3 files changed, 16 insertions(+), 4 deletions(-)



[elpa] 02/03: Compile chess-perft and dependencies to speed up ert tests.

2014-06-03 Thread Mario Lang
mlang pushed a commit to branch externals/chess
in repository elpa.

commit 4d85c83a42e7887a47923b971ba3d32fb2467bdc
Author: Mario Lang 
Date:   Tue Jun 3 11:34:37 2014 +0200

Compile chess-perft and dependencies to speed up ert tests.
---
 Makefile |   13 -
 1 files changed, 12 insertions(+), 1 deletions(-)

diff --git a/Makefile b/Makefile
index f27ef4a..d2661eb 100644
--- a/Makefile
+++ b/Makefile
@@ -12,7 +12,7 @@ INSTALL_INFO = install-info
 
 all: chess-eco.fen chess.info dir
 
-test:
+test: chess-perft.elc
$(EMACS) -L . -l chess-perft -f ert-run-tests-batch
 
 chess-eco.fen: chess-eco.pos
@@ -24,3 +24,14 @@ chess.info: doc/chess.texi
 dir: chess.info
$(INSTALL_INFO) $< $@
 
+chess-perft.elc: chess-fen.elc chess-ply.elc chess-pos.elc
+chess-ply.elc: chess-algebraic.elc
+
+.el.elc:
+   @$(EMACS) --batch -L . \
+   --eval "(defun byte-compile-dest-file (f) \"$@\")" \
+   --eval "(unless (byte-compile-file \"$<\") (kill-emacs 1))"
+
+
+clean:
+   rm -f *.elc



[elpa] 03/03: chess-perft requires chess-display.

2014-06-03 Thread Mario Lang
mlang pushed a commit to branch externals/chess
in repository elpa.

commit f37f79bb60404a1a9487b7e8de8082af0b33c54e
Author: Mario Lang 
Date:   Tue Jun 3 11:36:22 2014 +0200

chess-perft requires chess-display.
---
 chess-perft.el |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/chess-perft.el b/chess-perft.el
index 662d854..a24d584 100644
--- a/chess-perft.el
+++ b/chess-perft.el
@@ -45,6 +45,7 @@
 
 ;;; Code:
 
+(require 'chess-display)
 (require 'chess-fen)
 (require 'chess-ply)
 (require 'chess-pos)



[elpa] 01/03: chess-search-position: Use dolist instead of mapc.

2014-06-03 Thread Mario Lang
mlang pushed a commit to branch externals/chess
in repository elpa.

commit 6676272a5026cf0c7bd95d2d64fa840d46434df0
Author: Mario Lang 
Date:   Tue Jun 3 11:33:41 2014 +0200

chess-search-position: Use dolist instead of mapc.

mapc on a macro fails for obvious reasons.
---
 chess-pos.el |6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/chess-pos.el b/chess-pos.el
index 11a2866..e2cabeb 100644
--- a/chess-pos.el
+++ b/chess-pos.el
@@ -84,8 +84,8 @@
 ;;; Code:
 
 (require 'chess-message)
+(require 'cl-lib)
 (eval-when-compile
-  (require 'cl-lib)
   (cl-proclaim '(optimize (speed 3) (safety 2
 
 (defgroup chess-pos nil
@@ -913,8 +913,8 @@ If NO-CASTLING is non-nil, do not consider castling moves."
 
   ;; test for knights and pawns
   (dolist (p (if piece '(?P ?N) '(?p ?n)))
-   (mapc 'chess--add-candidate
- (chess-search-position position target p check-only no-castling)))
+   (dolist (cand (chess-search-position position target p check-only 
no-castling))
+  (chess--add-candidate cand)))
 
   ;; test whether the rook or king can move to the target by castling
   (unless no-castling



  1   2   3   >