Mario Lang [Mon, 28 Jul 2014 10:03:44 +0000 (12:03 +0200)]
* chess-database.el (chess-database-do-open): Require modules here.
(chess-database-open): Instead of only requiring modules from
`chess-database-modules'.
* chess-pgn.el (chess-pgn-read-plies): Avoid copying comments
(annotations in PGN-jargon) to all following positions in a game.
(chess-create-display): Declare.
* chess-ics1.el (chess-debug-position): Use `chess-display-position'
instead of `chess-engine-position'.
* chess-engine.el (chess-pgn): Require it.
* chess-eco.el (chess-algebraic): Same here.
* chess-input.el (chess-input): New custom group.
(chess-input-notation-type): Put into `chess-input' group.
(chess-input-test-move): Use `chess-ply-keyword' to check for
castling plies instead of doing a string-match on the algebraic
notation string.
* chess-images.el (chess-images-determine-size): Don't use
`x-display-pixel-height' and `x-display-pixel-width' directly.
* chess-display.el (chess-display-draw-square): Make third argument
PIECE optional.
Mario Lang [Mon, 23 Jun 2014 23:01:39 +0000 (01:01 +0200)]
Remove obsolete arguments and use more cl-check-type.
* chess-ply.el (chess-ply-p): New function.
Change `cl-assert' to `cl-check-type' based on this predicate.
(chess-ply-final-p): Only call `chess-ply-any-keyword' if we actually
found a preceding ply.
(chess-ply--add): Remove obsolte and unused arguments RANK-ADJ and
FILE-ADJ.
(chess-legal-plies): Adjust for `chess-ply--add' argument removal.
Eli Zaretskii [Thu, 19 Jun 2014 15:15:02 +0000 (18:15 +0300)]
Fix Texinfo usage and markup in the Chess manual.
chess.texi: Proofread and fix the manual. All the Next, Prev,
Up pointers deleted. Markup of 'nil' and other symbols fixed.
Typos and British spellings fixed.
Mario Lang [Mon, 16 Jun 2014 13:50:46 +0000 (15:50 +0200)]
* chess-input.el (chess-input-notation-type): New variable.
(chess-input-test-move, chess-input-display-moves): Use it.
(chess-input-shortcut): Generate initial ply list for numeric
notation.
Mario Lang [Mon, 16 Jun 2014 08:09:43 +0000 (10:09 +0200)]
* chess-input.el (chess-input-display-moves): Highlight valid target
squares if `chess-display-highlight-legal' is non-nil.
(chess-input-shortcut): Redraw board to remove highlights if a ply
was submitted and `chess-display-highlight-legal' is non-nil.
Mario Lang [Sun, 15 Jun 2014 23:08:48 +0000 (01:08 +0200)]
* chess-display.el (chess-display-move): Fix repainting when playing
against the internal engine (AI) which runs off the `post-move' game
event by adding a `redisplay' call just before the `post-move' emision.
(chess-display-select-piece): Use `chess-display-draw-square'.
(chess-display-draw-square): Make PIECE argument optional.
Mario Lang [Sat, 14 Jun 2014 23:10:36 +0000 (01:10 +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.
Mario Lang [Sat, 14 Jun 2014 14:08:04 +0000 (16:08 +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.
Mario Lang [Sat, 14 Jun 2014 11:30:39 +0000 (13:30 +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.
Mario Lang [Fri, 13 Jun 2014 21:37:23 +0000 (23:37 +0200)]
* 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.
* chess-ply.el (chess-ply-pos, chess-ply-changes)
(chess-ply-keyword): Enable use as generalized variables.
(chess-ply-castling-changes): Convert to using
`chess-next-index'.
* chess-polyglot.el (chess-polyglot-pos-to-key): Use logxor to invert
rank instead of two loops to keep rank/file apart.
* chess-algebraic.el (chess-algebraic-figurine-pieces): New constant.
(chess-ply--move-text): Remove and fold into...
(chess-ply-to-algebraic): ...this function.
Rename argument LONG to TYPE and additionally allow to
generate figurine notation.
* chess-var.el (chess-var-add-ply): Fix docstring.
(chess-var-to-algebraic): Adjust argument names.
* doc/chess.texi (Making a move in a variation): Same here.
(Algebraic notation): Mention figurine notation.
Mario Lang [Wed, 4 Jun 2014 22:23:14 +0000 (00:23 +0200)]
* doc/chess.texi (Position coordinates): Document `chess-next-index'
and related constants.
(The sought game display): Update as the mentioned mode name has changed.
* chess-ics.el (chess-ics): Add custom-manual link.
* chess-plain.el (chess-plain): Add custom-manual link.
Mario Lang [Wed, 4 Jun 2014 09:22:14 +0000 (11:22 +0200)]
* chess-pos.el (chess-coord-to-index): Use chess-rf-to-index.
(ches-index-to-coord): Do not concat the result of calls to char-to-string, use
string directly with the characters as arguments.
Mario Lang [Tue, 3 Jun 2014 21:15:03 +0000 (23:15 +0200)]
Let chess-algebraic.el depend on chess-ply.el, not the other way around.
* chess-ply.el (chess-ply-to-string, chess-ply-from-string): Remove as they are
just aliases. Update callers to use chess-ply-to-algebraic and
chess-algebraic-to-ply instead.
Mario Lang [Mon, 26 May 2014 18:21:10 +0000 (20:21 +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.
Mario Lang [Sun, 25 May 2014 14:53:20 +0000 (16:53 +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.
Mario Lang [Sun, 25 May 2014 13:39:46 +0000 (15:39 +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.
Stefan Monnier [Sat, 24 May 2014 20:31:54 +0000 (16:31 -0400)]
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 defsubst so as
to avoid relying on dynamic scoping.
(chess-search-position): Remove unused var `p'.
* chess-polyglot.el (chess-polyglot-book-reload): Simplify, knowing
it's only used for chess-polyglot-book-file.
* chess-ply.el: Don't require `cl'.
(chess-ply--add): Define as a macro rather than a defsubst so as to
avoid relying on dynamic scoping.
* chess-plain.el (chess-plain-draw): Remove unused var `beg'.
* chess-pgn.el (chess-pgn-parse, chess-insert-pgn): Remove unused var
`begin'.
(chess-pgn-mode): Use make-local-variable instead of
make-variable-buffer-local.
(chess-pgn-index): Remove unused var `first-move'.
(chess-game-inhibit-events): Declare.
* chess-module.el: Don't require `cl'.
(chess-module-create): Remove unused var `buffer'.
* chess-kibitz.el (chess-module-game): Declare.
* chess-images.el (chess-images-popup): Remove unused var `display'.
(chess-images-highlight): Remove unused var `inverted'.
(chess-images-init-cache): Remove unused vars `backgrounds' and
`piece-colors'.
* chess-ics1.el (chess-ics1-draw): Remove unused var `beg'.
* chess-ics.el (chess-ics-handle-style12): Remove unused var `plies'.
* chess-engine.el (chess-full-name): Declare.
(chess-engine-filter): Remove unused var `last-point'.
* chess-display.el (chess-display-edit-position): Declare before
first use.
(chess-display-active-p): Define before first use.
(chess-display-search-backward): Remove unused var `err'.
(chess-images-separate-frame, ibuffer-maybe-show-regexps): Declare.
(chess-display-list-buffers): Use cl-letf.
(chess-display-mouse-select-piece): Use (featurep 'xemacs) and simplify.
* chess-crafty.el (chess-crafty-regexp-alist): Remove unused var
`nodes'.
* chess-algebraic.el: Don't require `cl'.
(chess-ply--move-text): Remove unused var `color'.