[elpa] branch externals/chess updated (9295c19 - 3a44294)

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

  from  9295c19   * chess-pos.el (chess-pos-en-passant, chess-pos-status) 
(chess-pos-side-to-move, chess-pos-annotations) (chess-pos-preceding-ply): 
Enable use as generalized variables. (chess-pos-p): New function.
   new  d26ae3b   * chess-algebraic.el (chess-ply-to-algebraic): If TYPE is 
`:numeric', generate ICCF numeric notation.
   new  3a44294   (chess-algebraic-regexp, chess-algebraic-to-ply): 
Optionally allow 0-0 and 0-0-0 in addition to O-O and O-O-O to mean 
castling. (chess-algebraic-regexp, chess-algebraic-to-ply): Handle figurine 
notation.

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:
 ChangeLog  |9 ++
 chess-algebraic.el |   80 ++-
 chess-polyglot.el  |4 +--
 3 files changed, 63 insertions(+), 30 deletions(-)



[elpa] 01/02: * chess-algebraic.el (chess-ply-to-algebraic): If TYPE is `:numeric', generate ICCF numeric notation.

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

commit d26ae3b157f0374e43cef34f798d633107d456d8
Author: Mario Lang ml...@delysid.org
Date:   Sat Jun 14 12:12:20 2014 +0200

* chess-algebraic.el (chess-ply-to-algebraic): If TYPE is `:numeric',
generate ICCF numeric notation.
---
 ChangeLog  |5 +
 chess-algebraic.el |   19 +++
 chess-polyglot.el  |4 +---
 3 files changed, 21 insertions(+), 7 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 1a073c7..2ae3d04 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2014-06-14  Mario Lang  ml...@delysid.org
+
+   * chess-algebraic.el (chess-ply-to-algebraic): If TYPE is `:numeric',
+   generate ICCF numeric notation.
+
 2014-06-13  Mario Lang  ml...@delysid.org
 
* chess-pos.el (chess-pos-en-passant, chess-pos-status)
diff --git a/chess-algebraic.el b/chess-algebraic.el
index 49a95d6..13ae97b 100644
--- a/chess-algebraic.el
+++ b/chess-algebraic.el
@@ -165,17 +165,28 @@ Figurine notation is currently not supported.
 (defun chess-ply-to-algebraic (ply optional type)
   Convert the given PLY to algebraic notation.
 Optional argument TYPE specifies the kind of algebraic notation to generate.
-`:san' (the default) generates short (or standard) algebraic notation.
-`:lan' generates long algebraic notation (like \Nb1-c3\.
-`:fan' generates figurine algebraic notation (like \♘c3\.
+`:san' (the default) generates short (or standard) algebraic notation
+\(like \Nc3\).  `:lan' generates long algebraic notation (like \Nb1-c3\.
+`:fan' generates figurine algebraic notation (like \♘c3\.
+Finally, `:numeric' generates ICCF numeric notation (like \2133\.
   (cl-check-type ply (and list (not null)))
-  (cl-check-type type (member nil :san :fan :lan))
+  (cl-check-type type (member nil :san :fan :lan :numeric))
   (unless type (setq type :san))
   (or (chess-ply-keyword ply type)
   (and (null (chess-ply-source ply)) )
   (chess-ply-set-keyword
ply type
(or
+   (and (eq type :numeric)
+(apply
+ #'string
+ (+ (chess-index-file (chess-ply-source ply)) ?1)
+ (+ (chess-index-rank (logxor (chess-ply-source ply) #o70)) ?1)
+ (+ (chess-index-file (chess-ply-target ply)) ?1)
+ (+ (chess-index-rank (logxor (chess-ply-target ply) #o70)) ?1)
+ (when (chess-ply-keyword ply :promote)
+   (list (+ (cl-position (chess-ply-keyword ply :promote)
+ '(?Q ?R ?B ?N)) ?1)
(and (chess-ply-keyword ply :castle) O-O)
(and (chess-ply-keyword ply :long-castle) O-O-O)
(let* ((pos (chess-ply-pos ply))
diff --git a/chess-polyglot.el b/chess-polyglot.el
index 717e1c4..96a918c 100644
--- a/chess-polyglot.el
+++ b/chess-polyglot.el
@@ -135,9 +135,7 @@ On reaching end or beginning of buffer, stop and signal 
error.
   Non-nil if the polyglot key LHS is less than or equal to 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
+  (or (and (null lhs) (null rhs)) (= (car lhs) (car rhs
 
 (defun chess-polyglot-read-moves (key)
   Read all moves associated with KEY from the current buffer.



[elpa] 02/02: (chess-algebraic-regexp, chess-algebraic-to-ply): Optionally allow 0-0 and 0-0-0 in addition to O-O and O-O-O to mean castling. (chess-algebraic-regexp, chess-algebraic-to-ply):

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

commit 3a442940cedaf94d4ddd2805b79f8f08b06cd54e
Author: Mario Lang ml...@delysid.org
Date:   Sat Jun 14 13:30:39 2014 +0200

(chess-algebraic-regexp, chess-algebraic-to-ply): Optionally allow 0-0
and 0-0-0 in addition to O-O and O-O-O to mean castling.
(chess-algebraic-regexp, chess-algebraic-to-ply): Handle figurine
notation.
---
 ChangeLog  |4 +++
 chess-algebraic.el |   61 ---
 2 files changed, 42 insertions(+), 23 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 2ae3d04..400a5e6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,10 @@
 
* chess-algebraic.el (chess-ply-to-algebraic): If TYPE is `:numeric',
generate ICCF numeric notation.
+   (chess-algebraic-regexp, chess-algebraic-to-ply): Optionally allow 0-0
+   and 0-0-0 in addition to O-O and O-O-O to mean castling.
+   (chess-algebraic-regexp, chess-algebraic-to-ply): Handle figurine
+   notation.
 
 2014-06-13  Mario Lang  ml...@delysid.org
 
diff --git a/chess-algebraic.el b/chess-algebraic.el
index 13ae97b..5ca7895 100644
--- a/chess-algebraic.el
+++ b/chess-algebraic.el
@@ -52,36 +52,39 @@
 
 ;;; Code:
 
-(eval-when-compile (require 'cl-lib))
-
 (require 'chess-message)
 (require 'chess-ply)
 (require 'chess-pos)
+(require 'cl-lib)
+
+(defconst chess-algebraic-figurine-pieces
+  '((?K . #x2654) (?Q . #x2655) (?R . #x2656)
+(?B . #x2657) (?N . #x2658) (?P . #x2659)
+(?k . #x265A) (?q . #x265B) (?r . #x265C)
+(?b . #x265D) (?n . #x265E) (?p . #x265F))
+  Map internal piece representation to Unicode chess figures (as used in 
figurine
+notation.)
 
 (defconst chess-algebraic-regexp
-  (rx (group (or (or O-O O-O-O)
-(and (optional (group (char ?N ?B ?R ?Q ?K)))
+  (rx (group (or (or O-O O-O-O 0-0 0-0-0)
+(and (optional (group (char ?N ?B ?R ?Q ?K
+?♔ ?♕ ?♖ ?♗ ?♘
+?♚ ?♛ ?♜ ?♝ ?♞)))
  (optional (char ?/))
  (group (optional (char a-h)) (optional (char 1-8)))
  (optional (group (char ?- ?x)))
  (group (char a-h) (char 1-8))
- (optional (group ?= (group (char ?N ?B ?R ?Q ?K)))
+ (optional (group ?= (group (char ?N ?B ?R ?Q ?K
+  ?♔ ?♕ ?♖ ?♗ ?♘
+  ?♚ ?♛ ?♜ ?♝ ?♞)))
   (optional (group (char ?+ ?#
   A regular expression that matches all possible algebraic moves.
-This regexp handles both long and short form.)
+This regexp matches short, long and figurine notation.)
 
 (defconst chess-algebraic-regexp-entire (concat chess-algebraic-regexp $))
 
 (defconst chess-algebraic-regexp-ws (concat chess-algebraic-regexp \\s-))
 
-(defconst chess-algebraic-figurine-pieces
-  '((?K . #x2654) (?Q . #x2655) (?R . #x2656)
-(?B . #x2657) (?N . #x2658) (?P . #x2659)
-(?k . #x265A) (?q . #x265B) (?r . #x265C)
-(?b . #x265D) (?n . #x265E) (?p . #x265F))
-  Map internal piece characters to Unicode chess figures (as used in figurine
-notation.)
-
 (chess-message-catalog 'english
   '((clarify-piece . Clarify piece to move by rank or file)
 (could-not-clarify . Could not determine which piece to use)
@@ -90,9 +93,7 @@ notation.)
 (at-move-string. At algebraic move '%s': %s)))
 
 (defun chess-algebraic-to-ply (position move optional trust)
-  Convert the (short or long) algebraic notation MOVE for POSITION to a ply.
-
-Figurine notation is currently not supported.
+  Convert (short, long or figurine) algebraic notation MOVE for POSITION to a 
ply.
   (cl-check-type position chess-pos)
   (cl-check-type move string)
   (let ((case-fold-search nil))
@@ -100,8 +101,8 @@ Figurine notation is currently not supported.
   (let ((color (chess-pos-side-to-move position))
(mate (match-string 8 move))
(piece (aref move 0))
-   changes long-style)
-   (if (eq piece ?O)
+   changes type)
+   (if (or (eq piece ?O) (eq piece ?0))
(setq changes (chess-ply-castling-changes
   position (= (length (match-string 1 move)) 5)))
  (let ((promotion (match-string 7 move)))
@@ -112,11 +113,17 @@ Figurine notation is currently not supported.
   (if (and source (= (length source) 2))
   (prog1
   (list (chess-coord-to-index source) target)
-(setq long-style t))
+(setq type :lan))
 (if (= (length source) 0)
 (setq source nil)
   (setq source (aref source 0)))
 (let (candidates which)
+  (when (and (not type) ( piece ?a))
+(setq type :san))
+ 

[elpa] branch externals/chess updated (3a44294 - e872564)

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

  from  3a44294   (chess-algebraic-regexp, chess-algebraic-to-ply): 
Optionally allow 0-0 and 0-0-0 in addition to O-O and O-O-O to mean 
castling. (chess-algebraic-regexp, chess-algebraic-to-ply): Handle figurine 
notation.
   new  e872564   * chess-test.el (chess-test): Renamed to... 
(chess-test-database): More descriptive name. (chess-perft): Require as this is 
our entry-point for testing. * doc/chess.texi: Renamed to... * chess.texi: 
Top-level file, keeping doc/ for just one file is useless. * Makefile: Adjust 
and use the predefined MAKEINFO variable from GNU Make. * chess-pgn.el 
(chess-game): Require. (chess-pgn-parse): Use `rx'. * chess-game.el 
(chess-pgn): Do not require. (chess-game-to-string, che [...]

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 -
 ChangeLog|   12 
 Makefile |   13 ++---
 chess-crafty.el  |3 ++-
 chess-file.el|1 +
 chess-game.el|   11 ---
 chess-gnuchess.el|3 ++-
 chess-network.el |3 ++-
 chess-pgn.el |   26 +++---
 chess-sjeng.el   |3 ++-
 chess-test.el|3 ++-
 doc/chess.texi = chess.texi |0
 12 files changed, 48 insertions(+), 31 deletions(-)
 rename doc/chess.texi = chess.texi (100%)



[elpa] 01/01: * chess-test.el (chess-test): Renamed to... (chess-test-database): More descriptive name. (chess-perft): Require as this is our entry-point for testing. * doc/chess.texi: Renamed to... *

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

commit e8725641a89ef55181f9e27750faeb0c44e678ab
Author: Mario Lang ml...@delysid.org
Date:   Sat Jun 14 16:08:04 2014 +0200

* chess-test.el (chess-test): Renamed to...
(chess-test-database): More descriptive name.
(chess-perft): Require as this is our entry-point for testing.
* doc/chess.texi: Renamed to...
* chess.texi: Top-level file, keeping doc/ for just one file is useless.
* Makefile: Adjust and use the predefined MAKEINFO variable from GNU Make.
* chess-pgn.el (chess-game): Require.
(chess-pgn-parse): Use `rx'.
* chess-game.el (chess-pgn): Do not require.
(chess-game-to-string, chess-game-from-string): Remove, all callers
updated to use chess-pgn functions directly.
---
 .elpaignore  |1 -
 ChangeLog|   12 
 Makefile |   13 ++---
 chess-crafty.el  |3 ++-
 chess-file.el|1 +
 chess-game.el|   11 ---
 chess-gnuchess.el|3 ++-
 chess-network.el |3 ++-
 chess-pgn.el |   26 +++---
 chess-sjeng.el   |3 ++-
 chess-test.el|3 ++-
 doc/chess.texi = chess.texi |0
 12 files changed, 48 insertions(+), 31 deletions(-)

diff --git a/.elpaignore b/.elpaignore
index b34bc39..9777460 100644
--- a/.elpaignore
+++ b/.elpaignore
@@ -3,6 +3,5 @@
 .elpaignore
 chess-eco.pos
 chess-test.el
-doc
 ChangeLog
 Makefile
diff --git a/ChangeLog b/ChangeLog
index 400a5e6..798ff02 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,17 @@
 2014-06-14  Mario Lang  ml...@delysid.org
 
+   * chess-test.el (chess-test): Renamed to...
+   (chess-test-database): More descriptive name.
+   (chess-perft): Require as this is our entry-point for testing.
+   * doc/chess.texi: Renamed to...
+   * chess.texi: Top-level file, keeping doc/ for just one file is useless.
+   * Makefile: Adjust and use the predefined MAKEINFO variable from GNU 
Make.
+   * chess-pgn.el (chess-game): Require.
+   (chess-pgn-parse): Use `rx'.
+   * chess-game.el (chess-pgn): Do not require.
+   (chess-game-to-string, chess-game-from-string): Remove, all callers
+   updated to use chess-pgn functions directly.
+
* chess-algebraic.el (chess-ply-to-algebraic): If TYPE is `:numeric',
generate ICCF numeric notation.
(chess-algebraic-regexp, chess-algebraic-to-ply): Optionally allow 0-0
diff --git a/Makefile b/Makefile
index 5b1bfa8..4c9f462 100644
--- a/Makefile
+++ b/Makefile
@@ -4,25 +4,24 @@
 # If you update chess.texi or chess-eco.pos, run make on this file.
 
 EMACS = emacs --batch --no-site-file
-MAKEINFO = makeinfo
+MAKEINFO_FLAGS = --no-split
 INSTALL_INFO = install-info
 
 all: chess-eco.fen chess.info dir
 
-test: chess-perft.elc
-   $(EMACS) -L . -l chess-perft -f ert-run-tests-batch
+test: chess-test.elc
+   $(EMACS) -L . -l chess-test -f ert-run-tests-batch
 
 chess-eco.fen: chess-eco.pos
$(EMACS) -L . -l chess-eco.el -f chess-generate-fen-table $ $@
 
-chess.info: doc/chess.texi
-   $(MAKEINFO) --no-split -o $@ $
-
 dir: chess.info
$(INSTALL_INFO) $ $@
 
+chess-database.elc: chess-message.elc chess-file.elc chess-scid.elc
+chess-file.elc: chess-fen.elc chess-pgn.elc
 chess-perft.elc: chess-fen.elc chess-ply.elc chess-pos.elc
-chess-ply.elc: chess-algebraic.elc
+chess-test.elc: chess-database.elc chess-game.elc chess-perft.elc
 
 .el.elc:
@$(EMACS) -L . -f batch-byte-compile $
diff --git a/chess-crafty.el b/chess-crafty.el
index 24265ed..3335f8e 100644
--- a/chess-crafty.el
+++ b/chess-crafty.el
@@ -23,6 +23,7 @@
 
 (require 'chess-common)
 (require 'chess-fen)
+(require 'chess-pgn)
 (require 'chess-var)
 
 (defgroup chess-crafty nil
@@ -150,7 +151,7 @@
 
  ((eq event 'setup-game)
   (let ((file (chess-with-temp-file
- (insert (chess-game-to-string (car args)) ?\n
+ (chess-insert-pgn (car args)) (insert ?\n
(chess-engine-send nil (format read %s\n file
 
  ((eq event 'set-option)
diff --git a/chess-file.el b/chess-file.el
index 1b3028b..95a5e9e 100644
--- a/chess-file.el
+++ b/chess-file.el
@@ -28,6 +28,7 @@
 ;;; Code:
 
 (require 'chess-fen)
+(require 'chess-pgn)
 
 (defvar chess-file-locations nil
   A list of starting positions of individual records of this collection.)
diff --git a/chess-game.el b/chess-game.el
index a61438a..d86f159 100644
--- a/chess-game.el
+++ b/chess-game.el
@@ -28,7 +28,6 @@
 
 (eval-when-compile (require 'cl-lib))
 (require 'chess-ply)
-(require 'chess-pgn)
 
 (defvar chess-game-inhibit-events nil)
 
@@ -267,16 +266,6 @@ If INDEX is non-nil, the last played ply is returned.
 (and last-ply (chess-ply-final-p last-ply
 
 
-(defsubst chess-game-to-string (game optional indented)
-  Convert GAME to a 

[elpa] 01/01: (chess-pgn-mode-map): New variable, split out from... (chess-pgn-mode): Fix autogenerated docstring to include keymap description.

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

commit 08fc4c6b3dc6ef43e2d6891f9dc40344d907126e
Author: Mario Lang ml...@delysid.org
Date:   Sat Jun 14 16:55:00 2014 +0200

(chess-pgn-mode-map): New variable, split out from...
(chess-pgn-mode): Fix autogenerated docstring to include keymap
description.
---
 ChangeLog|4 
 chess-pgn.el |   39 +++
 2 files changed, 23 insertions(+), 20 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 798ff02..1420d5f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -8,6 +8,10 @@
* Makefile: Adjust and use the predefined MAKEINFO variable from GNU 
Make.
* chess-pgn.el (chess-game): Require.
(chess-pgn-parse): Use `rx'.
+   (chess-pgn-mode-map): New variable, split out from...
+   (chess-pgn-mode): Fix autogenerated docstring to include keymap
+   description.
+
* chess-game.el (chess-pgn): Do not require.
(chess-game-to-string, chess-game-from-string): Remove, all callers
updated to use chess-pgn functions directly.
diff --git a/chess-pgn.el b/chess-pgn.el
index 9c9c647..8001c67 100644
--- a/chess-pgn.el
+++ b/chess-pgn.el
@@ -63,9 +63,7 @@
 (require 'chess-message)
 (require 'mm-decode)
 (require 'mm-view)
-
-(eval-when-compile
-  (require 'pcomplete nil t))
+(require 'pcomplete)
 
 (defvar chess-pgn-fill-column 60)
 
@@ -298,6 +296,18 @@ PGN text.
 game)
   (chess-error 'could-not-read-pgn
 
+(defvar chess-pgn-mode-map
+  (let ((map (make-sparse-keymap)))
+(set-keymap-parent map text-mode-map)
+(define-key map [(control ?c) (control ?c)] 'chess-pgn-show-position)
+(define-key map [mouse-2] 'chess-pgn-mouse-show-position)
+
+;;(define-key map [(control ?m)] 'chess-pgn-move)
+;;(define-key map [space] 'chess-pgn-move)
+(define-key map [? ] 'chess-pgn-insert-and-show-position)
+(define-key map [tab] 'chess-pgn-complete-move)
+map))
+
 ;;;###autoload
 (define-derived-mode chess-pgn-mode text-mode PGN
   A mode for editing chess PGN files.
@@ -310,23 +320,12 @@ PGN text.
 
   (if (fboundp 'font-lock-mode)
   (font-lock-mode 1))
-
-  (let ((map (current-local-map)))
-(define-key map [(control ?c) (control ?c)] 'chess-pgn-show-position)
-(define-key map [mouse-2] 'chess-pgn-mouse-show-position)
-
-;;(define-key map [(control ?m)] 'chess-pgn-move)
-;;(define-key map [space] 'chess-pgn-move)
-(define-key map [? ] 'chess-pgn-insert-and-show-position)
-
-(when (require 'pcomplete nil t)
-  (set (make-local-variable 'pcomplete-default-completion-function)
-   'chess-pgn-completions)
-  (set (make-local-variable 'pcomplete-command-completion-function)
-   'chess-pgn-completions)
-  (set (make-local-variable 'pcomplete-parse-arguments-function)
-   'chess-pgn-current-word)
-  (define-key map [tab] 'chess-pgn-complete-move
+  (set (make-local-variable 'pcomplete-default-completion-function)
+   'chess-pgn-completions)
+  (set (make-local-variable 'pcomplete-command-completion-function)
+   'chess-pgn-completions)
+  (set (make-local-variable 'pcomplete-parse-arguments-function)
+   'chess-pgn-current-word))
 
 ;;;###autoload
 (defalias 'pgn-mode 'chess-pgn-mode)



[elpa] branch externals/chess updated (e872564 - 08fc4c6)

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

  from  e872564   * chess-test.el (chess-test): Renamed to... 
(chess-test-database): More descriptive name. (chess-perft): Require as this is 
our entry-point for testing. * doc/chess.texi: Renamed to... * chess.texi: 
Top-level file, keeping doc/ for just one file is useless. * Makefile: Adjust 
and use the predefined MAKEINFO variable from GNU Make. * chess-pgn.el 
(chess-game): Require. (chess-pgn-parse): Use `rx'. * chess-game.el 
(chess-pgn): Do not require. (chess-game-to-string, che [...]
   new  08fc4c6   (chess-pgn-mode-map): New variable, split out from... 
(chess-pgn-mode): Fix autogenerated docstring to include keymap description.

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:
 ChangeLog|4 
 chess-pgn.el |   39 +++
 2 files changed, 23 insertions(+), 20 deletions(-)



[elpa] branch externals/chess updated (08fc4c6 - aebafa9)

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

  from  08fc4c6   (chess-pgn-mode-map): New variable, split out from... 
(chess-pgn-mode): Fix autogenerated docstring to include keymap description.
   new  aebafa9   * chess-display.el (chess-display-select-piece): Redraw 
legal targets if a move is either accepted or the same piece is selected again. 
This fixes ... (chess-display-highlight-legal): Now set to `t' by default.

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



[elpa] 01/01: * chess-display.el (chess-display-select-piece): Redraw legal targets if a move is either accepted or the same piece is selected again. This fixes ... (chess-display-highlight-legal): No

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

commit aebafa98c17557b889b5a8b1bcb24854fcf9f5e9
Author: Mario Lang ml...@delysid.org
Date:   Sun Jun 15 01:10:36 2014 +0200

* chess-display.el (chess-display-select-piece): Redraw legal targets
if a move is either accepted or the same piece is selected again.
This fixes ...
(chess-display-highlight-legal): Now set to `t' by default.
---
 ChangeLog|7 +++
 chess-display.el |   19 ++-
 2 files changed, 21 insertions(+), 5 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 1420d5f..9d7115d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2014-06-15  Mario Lang  ml...@delysid.org
+
+   * chess-display.el (chess-display-select-piece): Redraw legal targets
+   if a move is either accepted or the same piece is selected again.
+   This fixes ...
+   (chess-display-highlight-legal): Now set to `t' by default.
+
 2014-06-14  Mario Lang  ml...@delysid.org
 
* chess-test.el (chess-test): Renamed to...
diff --git a/chess-display.el b/chess-display.el
index 804f9fc..1fc0295 100644
--- a/chess-display.el
+++ b/chess-display.el
@@ -43,7 +43,7 @@ occurs.
 
 (make-variable-buffer-local 'chess-display-popup)
 
-(defcustom chess-display-highlight-legal nil
+(defcustom chess-display-highlight-legal t
   If non-nil, highlight legal target squares when a piece is selected.
   :type 'boolean
   :group 'chess-display)
@@ -432,8 +432,7 @@ that is supported by most displays, and is the default 
mode.
 (defun chess-display-highlight-legal (display pos)
   Highlight all legal move targets from POS.
   (chess-with-current-buffer display
-(dolist (ply (chess-legal-plies (chess-display-position nil)
-   :index pos))
+(dolist (ply (chess-legal-plies (chess-display-position nil) :index pos))
   (chess-display-highlight nil pale green
   (chess-ply-target ply)
 
@@ -1184,8 +1183,7 @@ Clicking once on a piece selects it; then click on the 
target location.
  (if chess-display-last-selected
  (let ((last-sel chess-display-last-selected))
;; if they select the same square again, just deselect
-   ;; it by redrawing the display and removing all
-   ;; highlights
+   ;; it by redrawing the square to remove highlights.
(if (= (point) (car last-sel))
(funcall chess-display-event-handler 'draw-square
 (car last-sel)
@@ -1212,6 +1210,17 @@ Clicking once on a piece selects it; then click on the 
target location.
  (chess-display-move nil ply)
(error
 (throw 'message (error-message-string err)))
+   ;; Redraw legal targets to clear highlight.
+   (when chess-display-highlight-legal
+ (dolist (index (mapcar #'chess-ply-target
+(chess-legal-plies
+ position
+ :index (cdr last-sel
+   (unless (= index coord)
+ (funcall chess-display-event-handler 'draw-square
+(chess-display-index-pos nil index)
+(chess-pos-piece position index)
+index
(setq chess-display-last-selected nil))
(let ((piece (chess-pos-piece position coord)))
  (cond



[elpa] branch externals/chess updated (aebafa9 - c2e7e1b)

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

  from  aebafa9   * chess-display.el (chess-display-select-piece): Redraw 
legal targets if a move is either accepted or the same piece is selected again. 
This fixes ... (chess-display-highlight-legal): Now set to `t' by default.
   new  294553e   Work on the manual.
   new  c2e7e1b   * chess-display.el (chess-display): Link to info node.

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-display.el |   23 +++---
 chess.info   |  222 ++
 chess.texi   |  149 
 3 files changed, 165 insertions(+), 229 deletions(-)



[elpa] 02/02: * chess-display.el (chess-display): Link to info node.

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

commit c2e7e1b029eceb4c9b9cc512f6b6a8c9afeb0ee7
Author: Mario Lang ml...@delysid.org
Date:   Sun Jun 15 02:17:40 2014 +0200

* chess-display.el (chess-display): Link to info node.
---
 chess-display.el |   23 +++
 1 files changed, 11 insertions(+), 12 deletions(-)

diff --git a/chess-display.el b/chess-display.el
index 1fc0295..a6e675e 100644
--- a/chess-display.el
+++ b/chess-display.el
@@ -32,8 +32,9 @@
 (require 'chess-random)
 
 (defgroup chess-display nil
-  Common code used by chess displays.
-  :group 'chess)
+  Options common to all chessboard displays.
+  :group 'chess
+  :link '(custom-manual (chess)Chessboard displays))
 
 (defcustom chess-display-popup t
   If non-nil (the default), popup displays whenever a significant event
@@ -362,16 +363,14 @@ also view the same game.
(to (cadr ch)))
(funcall chess-display-event-handler 'draw-square
 (chess-display-index-pos nil from) ?  from)
-   (let ((new-piece (chess-ply-keyword ply :promote)))
- (if new-piece
- (funcall chess-display-event-handler 'draw-square
-  (chess-display-index-pos nil to)
-  (if (chess-pos-side-to-move position)
-  new-piece
-(downcase new-piece)) to)
-   (funcall chess-display-event-handler 'draw-square
-(chess-display-index-pos nil to)
-(chess-pos-piece position from) to)))
+   (funcall chess-display-event-handler 'draw-square
+(chess-display-index-pos nil to)
+(or (let ((new-piece (chess-ply-keyword ply :promote)))
+  (when new-piece
+(if (chess-pos-side-to-move position)
+new-piece (downcase new-piece
+(chess-pos-piece position from))
+to)
(when (chess-ply-keyword ply :en-passant)
  (funcall chess-display-event-handler 'draw-square
   (chess-display-index-pos nil (chess-pos-en-passant 
position))



[elpa] 01/02: Work on the manual.

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

commit 294553e21dcae3b95368fa76375b0e717a1f0097
Author: Mario Lang ml...@delysid.org
Date:   Sun Jun 15 01:40:17 2014 +0200

Work on the manual.
---
 chess.info |  222 +---
 chess.texi |  149 +---
 2 files changed, 154 insertions(+), 217 deletions(-)

diff --git a/chess.info b/chess.info
index e29a790..7bd37ca 100644
--- a/chess.info
+++ b/chess.info
@@ -255,7 +255,7 @@ square, or set that square’s value:
  It is only necessary to call this function if setting up a position
  manually.  Note that all newly created positions have full castling
  privileges set, unless the position is created blank, in which case
- castling privileges are unset.  See ‘chess-pos-copy’.
+ castling privileges are unset.  See ‘chess-pos-create’.
 
  -- Function: chess-pos-en-passant position
  Return the index of any pawn on POSITION that can be captured en
@@ -267,8 +267,8 @@ square, or set that square’s value:
 
  -- Function: chess-pos-status position
  Return whether the side to move in the POSITION is in a special
- state.  nil is returned if not, otherwise one of the symbols:
- ‘check’, ‘checkmate’, ‘stalemate’.
+ state.  nil is returned if not, otherwise one of the keywords:
+ ‘:check’, ‘:checkmate’ or ‘:stalemate’.
 
  -- Function: chess-pos-set-status position value
  Set whether the side to move in POSITION is in a special state.
@@ -322,7 +322,7 @@ File: chess.info,  Node: FEN notation,  Next: EPD notation, 
 Prev: Annotations,
 FEN (Forsyth-Edwards Notation) encodes a chess position using a simple
 string.  The format is:
 
-   POSITION SIDE CASTLING EN-PASSANT
+   ‘POSITION SIDE CASTLING EN-PASSANT’
 
The POSITION gives all eight ranks, by specifying a letter for each
 piece on the position, and a number for any intervening spaces, ranks
@@ -547,7 +547,7 @@ File: chess.info,  Node: Ply details,  Next: The next 
position,  Prev: Creatin
 -
 
  -- Function: chess-ply-pos ply
- Returns the base position associated with PLY.
+ Return the base position associated with PLY.
 
  -- Function: chess-ply-set-pos ply position
  Set the base position of PLY.
@@ -606,6 +606,9 @@ function:
  -- Function: chess-algebraic-to-ply position move optional trust
  Convert the algebraic notation MOVE for POSITION to a ply.
 
+ If optional argument TRUST is non-nil, accept check or checkmate
+ symbols (‘+’ and ‘#’) as given.
+
The function also checks if a move is legal, and will raise an error
 if not.
 
@@ -618,7 +621,9 @@ if not.
  generate.  ‘:san’ (the default) generates short (or standard)
  algebraic notation.  ‘:lan’ generates long algebraic notation (like
  ‘Nb1-c3’).  ‘:fan’ generates figurine algebraic notation (uppercase
- letters will be replaced by Unicode chess figures).
+ letters will be replaced by Unicode chess figures).  ‘:numeric’
+ generates ICCF numeric notation as used in corespondence chess
+ (like ‘2133’).
 
Lastly, there is a regexp for quickly checking if a string is in
 algebraic notation or not, or searching out algebraic strings in a
@@ -626,7 +631,7 @@ buffer:
 
  -- Variable: chess-algebraic-regexp
  A regular expression that matches all possible algebraic moves.
- This regexp handles both long and short form.
+ This regexp handles short, long and figurine algebraic notation.
 
 
 File: chess.info,  Node: Variations,  Next: Games,  Prev: Plies,  Up: The 
chess.el library
@@ -911,6 +916,9 @@ File: chess.info,  Node: Opening Databases,  Next: Querying 
Databases,  Prev: Co
  called.
 
  -- Function: chess-database-open file optional module
+ Open a game database specified by FILE.  You can optionally specify
+ the database MODULE to use.
+
  Returns the opened database object, or nil.
 
 
@@ -1020,7 +1028,7 @@ supported.  There is a default polyglot book file shipped 
with chess.el
 to support engines which do not have built-in support for looking up
 positions in opening books (such as some UCI protocol based engines).
 
- -- Variable: chess-polyglot-book-file
+ -- User Option: chess-polyglot-book-file
  Path to default polyglot book file.
 
  -- Variable: chess-polyglot-book
@@ -1212,10 +1220,12 @@ File: chess.info,  Node: Generic display manipulation 
functions,  Next: Chess di
  Setup the current board for editing.
 
  -- Function: chess-display-highlight display rest args
- Highlight the square at INDEX on the current position.  The given
- highlighting MODE is used, or the default if the style you are
- displaying with doesn’t support that mode.  ‘selected’ is a mode
- that is supported by most displays, and is the default mode.
+ In DISPLAY highlight the squares given in ARGS on the current
+ position.
+
+ ARGS is a list of highlighting modes and 

[elpa] branch externals/chess updated (c2e7e1b - 0a5389e)

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

  from  c2e7e1b   * chess-display.el (chess-display): Link to info node.
   new  0a5389e   * chess-display.el (chess-display-draw-square): New 
function. (chess-display-paint-move, chess-display-set-piece): Use it.

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:
 ChangeLog|6 ++
 chess-display.el |   41 ++---
 chess-plain.el   |3 ++-
 3 files changed, 30 insertions(+), 20 deletions(-)



[elpa] 01/01: * chess-display.el (chess-display-draw-square): New function. (chess-display-paint-move, chess-display-set-piece): Use it.

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

commit 0a5389e92c0ba865048b7ef0f433b4f7f0e08e31
Author: Mario Lang ml...@delysid.org
Date:   Sun Jun 15 03:44:40 2014 +0200

* chess-display.el (chess-display-draw-square): New function.
(chess-display-paint-move, chess-display-set-piece): Use it.

* chess-plain.el (chess-plain-handler): Fix error if unknown event
is received.
---
 ChangeLog|6 ++
 chess-display.el |   41 ++---
 chess-plain.el   |3 ++-
 3 files changed, 30 insertions(+), 20 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 9d7115d..2a89732 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2014-06-15  Mario Lang  ml...@delysid.org
 
+   * chess-display.el (chess-display-draw-square): New function.
+   (chess-display-paint-move, chess-display-set-piece): Use it.
+
+   * chess-plain.el (chess-plain-handler): Fix error if unknown event
+   is received.
+
* chess-display.el (chess-display-select-piece): Redraw legal targets
if a move is either accepted or the same piece is selected again.
This fixes ...
diff --git a/chess-display.el b/chess-display.el
index a6e675e..61a3ca2 100644
--- a/chess-display.el
+++ b/chess-display.el
@@ -350,6 +350,14 @@ also view the same game.
  (point-min))
 (aref chess-display-index-positions index)))
 
+(defun chess-display-draw-square (display index piece optional pos)
+  (cl-check-type display (or null buffer))
+  (cl-check-type index (integer 0 63))
+  (chess-with-current-buffer display
+(cl-check-type pos (or null (number ((point-min)) ((point-max)
+(funcall chess-display-event-handler 'draw-square
+(or pos (chess-display-index-pos nil index)) piece index)))
+
 (defun chess-display-paint-move (display ply)
   (chess-with-current-buffer display
 (if chess-display-highlight-last-move
@@ -361,20 +369,15 @@ also view the same game.
(setq ch nil)
  (let ((from (car ch))
(to (cadr ch)))
-   (funcall chess-display-event-handler 'draw-square
-(chess-display-index-pos nil from) ?  from)
-   (funcall chess-display-event-handler 'draw-square
-(chess-display-index-pos nil to)
-(or (let ((new-piece (chess-ply-keyword ply :promote)))
-  (when new-piece
-(if (chess-pos-side-to-move position)
-new-piece (downcase new-piece
-(chess-pos-piece position from))
-to)
+   (chess-display-draw-square nil from ? )
+   (chess-display-draw-square
+nil to (or (let ((new-piece (chess-ply-keyword ply :promote)))
+ (when new-piece
+   (if (chess-pos-side-to-move position)
+   new-piece (downcase new-piece
+   (chess-pos-piece position from)))
(when (chess-ply-keyword ply :en-passant)
- (funcall chess-display-event-handler 'draw-square
-  (chess-display-index-pos nil (chess-pos-en-passant 
position))
-  ?  (chess-pos-en-passant position
+ (chess-display-draw-square nil (chess-pos-en-passant position) ? 
)))
  (setq ch (cddr ch)
 (if chess-display-highlight-last-move
(chess-display-highlight-move display ply
@@ -1116,12 +1119,12 @@ to the end or beginning.
 (defun chess-display-set-piece (optional piece)
   Set the piece under point to command character, or space for clear.
   (interactive)
-  (if (or (null piece) (characterp piece))
-  (let ((index (get-text-property (point) 'chess-coord)))
-   (chess-pos-set-piece chess-display-edit-position index
-(or piece last-command-event))
-   (funcall chess-display-event-handler 'draw-square
-(point) (or piece last-command-event) index
+  (when (or (null piece) (characterp piece))
+(let ((index (get-text-property (point) 'chess-coord)))
+  (chess-pos-set-piece chess-display-edit-position index
+  (or piece last-command-event))
+  (chess-display-draw-square nil index
+(or piece last-command-event) (point)
 
 (unless (fboundp 'event-window)
   (defalias 'event-point 'ignore))
diff --git a/chess-plain.el b/chess-plain.el
index d4cab93..e5e1412 100644
--- a/chess-plain.el
+++ b/chess-plain.el
@@ -245,7 +245,8 @@ modify `chess-plain-piece-chars' to avoid real confusion.)
   (cond
((eq event 'initialize) t)
((eq event 'popup) (funcall chess-plain-popup-function))
-   (t (apply (intern-soft (concat chess-plain- (symbol-name event))) args
+   (t (let ((handler (intern-soft (concat chess-plain- (symbol-name 
event)
+   (when handler (apply 

[elpa] 01/01: (chess-display-highlight-move): Simplify.

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

commit 3fa2b4db0eb930f763353cd3b72623215d30341a
Author: Mario Lang ml...@delysid.org
Date:   Sun Jun 15 04:05:03 2014 +0200

(chess-display-highlight-move): Simplify.
---
 ChangeLog|1 +
 chess-display.el |9 +
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 2a89732..436fe5b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,7 @@
 
* chess-display.el (chess-display-draw-square): New function.
(chess-display-paint-move, chess-display-set-piece): Use it.
+   (chess-display-highlight-move): Simplify.
 
* chess-plain.el (chess-plain-handler): Fix error if unknown event
is received.
diff --git a/chess-display.el b/chess-display.el
index 61a3ca2..f92a213 100644
--- a/chess-display.el
+++ b/chess-display.el
@@ -353,12 +353,14 @@ also view the same game.
 (defun chess-display-draw-square (display index piece optional pos)
   (cl-check-type display (or null buffer))
   (cl-check-type index (integer 0 63))
+  (cl-check-type piece (member ?  ?P ?N ?B ?R ?Q ?K ?p ?n ?b ?r ?q ?k))
   (chess-with-current-buffer display
 (cl-check-type pos (or null (number ((point-min)) ((point-max)
 (funcall chess-display-event-handler 'draw-square
 (or pos (chess-display-index-pos nil index)) piece index)))
 
 (defun chess-display-paint-move (display ply)
+  (cl-check-type display (or null buffer))
   (chess-with-current-buffer display
 (if chess-display-highlight-last-move
(chess-display-redraw))
@@ -440,10 +442,9 @@ that is supported by most displays, and is the default 
mode.
 
 (defun chess-display-highlight-move (display ply)
   Highlight the last move made in the current game.
-  (chess-with-current-buffer display
- (chess-display-highlight nil medium sea green
- (chess-ply-source ply)
- (chess-ply-target ply
+  (chess-display-highlight display medium sea green
+  (chess-ply-source ply)
+  (chess-ply-target ply)))
 
 (defun chess-display-highlight-passed-pawns (optional display)
   (interactive)



[elpa] 01/01: * chess-display.el (chess-fen, chess-pgn): Require.

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

commit f3d3337b2dc1a030d4d87a430d87ddcf56bf65f1
Author: Mario Lang ml...@delysid.org
Date:   Sun Jun 15 04:18:24 2014 +0200

* chess-display.el (chess-fen, chess-pgn): Require.
---
 chess-display.el |6 --
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/chess-display.el b/chess-display.el
index f92a213..0287487 100644
--- a/chess-display.el
+++ b/chess-display.el
@@ -25,11 +25,13 @@
 
 ;;; Code:
 
+(require 'chess-fen)
+(require 'chess-input)
 (require 'chess-message)
 (require 'chess-module)
-(require 'chess-var)
-(require 'chess-input)
+(require 'chess-pgn)
 (require 'chess-random)
+(require 'chess-var)
 
 (defgroup chess-display nil
   Options common to all chessboard displays.



[elpa] branch master updated (c30dafe - 69014aa)

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

  from  c30dafe   [xpm] Release: 1.0.3
   new  69014aa   * company/company-capf.el: Don't ignore things like 
semantic-capf.

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 +
 packages/company/company-capf.el |9 ++---
 2 files changed, 7 insertions(+), 3 deletions(-)



[elpa] 01/01: * company/company-capf.el: Don't ignore things like semantic-capf.

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

commit 69014aa7f585eed4b85b3202146a5c63da58d887
Author: Stefan Monnier monn...@iro.umontreal.ca
Date:   Sat Jun 14 23:20:16 2014 -0400

* company/company-capf.el: Don't ignore things like semantic-capf.
---
 .gitignore   |1 +
 packages/company/company-capf.el |9 ++---
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/.gitignore b/.gitignore
index 5de4b9d..313d9e5 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,4 +1,5 @@
 *.elc
+*.orig
 *~
 ChangeLog
 core
diff --git a/packages/company/company-capf.el b/packages/company/company-capf.el
index 3aaeb13..be7292a 100644
--- a/packages/company/company-capf.el
+++ b/packages/company/company-capf.el
@@ -36,9 +36,12 @@
   (remove-hook 'company-completion-finished-hook 'company--capf-clear-data t))
 
 (defun company--capf-data ()
-  ;; Ignore tags-completion-at-point-function because it subverts company-etags
-  ;; in the default value of company-backends, where the latter comes later.
-  (cl-letf* (((default-value 'completion-at-point-functions) nil)
+  (cl-letf* (((default-value 'completion-at-point-functions)
+  ;; Ignore tags-completion-at-point-function because it subverts
+  ;; company-etags in the default value of company-backends, where
+  ;; the latter comes later.
+  (remove 'tags-completion-at-point-function
+  (default-value 'completion-at-point-functions)))
  (data (run-hook-wrapped 'completion-at-point-functions
  ;; Ignore misbehaving functions.
  #'completion--capf-wrapper 'optimist)))