[gnugo] Decruft: Use ‘gnugo-program’ directly as executable.
* packages/gnugo/gnugo.el (gnugo-program): Rewrite docstring.
(gnugo): Add ‘gnugo-program’ sanity check prior to buffer
switch; drop support for "PROGRAM OPTIONS..." value.
From inception 2014-04-15, "New command:
‘C-c C-a’ (gnugo-toggle-abdication)".
* packages/gnugo/gnugo.el (gnugo-toggle-abdication):
Drop unused local var ‘ucolor’; also, don't bother
destructuring :waiting; instead, just check its truth value.
* packages/gnugo/gnugo.el (gnugo-toggle-image-display):
Save image factors in :imul instead of in :w-imul, :h-imul;
conditionally assign them directly to :mul instead of :wmul,
:hmul, or otherwise reset to ‘(1 . 1)’.
(gnugo-refresh): Update accordingly.
(gnugo): Init :mul to ‘(1 . 1)’.
* packages/gnugo/gnugo.el (gnugo-put): Update docstring.
(gnugo-refresh): Use ‘destructuring-bind’ for paren overlays.
(gnugo): Don't ‘gnugo-put’ overlays in :lparen-ov and
:rparen-ov; instead, cons them and stash the pair in :paren-ov.
* packages/gnugo/gnugo.el (gnugo): ...here,
in the root-node init, by checking for "user plays black"
directly, and inverting the resulting :PB, :PW values.
[gnugo] Move most of ‘gnugo-board-mode’ to ‘gnugo’.
Although the buffer-local hash ‘gnugo-state’ is available
in ‘gnugo-board-mode’, it is empty. This impacts mostly
funcs on ‘gnugo-board-mode-hook’ that use gnugo-{get,put}.
* packages/gnugo/gnugo.el (gnugo-board-mode):
Move buffer switching, options querying, process kicking,
a raft of ‘gnugo-put’ calls, and buffer refreshing from here...
(gnugo): ...to here; also, don't bother to ‘gnugo--forget’.
[gnugo] New command: ‘C-c C-a’ (gnugo-toggle-abdication)
* packages/gnugo/gnugo.el (gnugo-refresh):
Include "Abd" in mode line if abdication enabled.
(gnugo-get-move-insertion-filter): If abdication enabled,
create and save a timer object to call ‘gnugo-get-move’
w/ the opposite of the current ‘color’.
(gnugo-toggle-abdication): New command.
(gnugo-board-mode-map): Add binding for ‘C-c C-a’.
[gnugo int] Accept color for ‘gnugo-push-move’ 1st arg.
* packages/gnugo/gnugo.el (gnugo-push-move):
Rename first arg to WHO; if it is not a boolean, take it
as ‘color’ directly; update "effective userp" ref likewise.
(gnugo-get-move-insertion-filter):
Pass ‘color’ directly to ‘gnugo-push-move’.
[gnugo] New command: ‘S’ (gnugo-request-suggestion)
* packages/gnugo/gnugo.el (gnugo-gate):
If waiting for a suggestion, say "Still thinking"
instead of "Not your turn yet" in error message.
(gnugo--q): If waiting for a suggestion, say
"receive a suggestion" instead of "play" in error message.
(gnugo--rename-buffer-portion): New func.
(gnugo-get-move-insertion-filter): On received suggestion,
rename buffer w/ "to play", warp the cursor unless nonsensical
or inhibited, and display the suggestion in the echo area.
(gnugo-get-move): Take optional arg SUGGESTION;
save it as well as color in :waiting.
(gnugo-request-suggestion): New command.
(gnugo-board-mode-map): Add binding for ‘S’.
[gnugo] Make ‘C-u F’ add the blurb as a comment to the last node.
* packages/gnugo/gnugo.el (gnugo-display-final-score):
...here, if new prefix arg COMMENT is set, with "territory",
"captures", "komi" squashed to "T", "C", "K", respectively.
[gnugo int] Incorporate *-play-stone into ‘gnugo-push-move’.
U (X) ≡ "Don't call X".
* packages/gnugo/gnugo.el (gnugo--play-stone): Delete func.
(gnugo--user-play-stone): Delete defsubst.
(gnugo-push-move): Do GTP "play COLOR MOVE" here.
(gnugo-get-move-insertion-filter): U (gnugo--play-stone);
make USERP arg to ‘gnugo-push-move’ depend on :waiting color.
(gnugo-move, gnugo-pass): U (gnugo--user-play-stone).
(gnugo-okay): U (gnugo--play-stone); decruft local vars.
(gnugo-display-final-score): U (gnugo--play-stone).
[gnugo int] Rename :waitingp to :waiting; save color there.
* packages/gnugo/gnugo.el (gnugo-board-buffer-p)
(gnugo-get-move-insertion-filter, gnugo-display-final-score)
(gnugo-gate, gnugo--q, gnugo-refresh, gnugo-board-mode): Update.
(gnugo-get-move): Save COLOR in :waiting.
* packages/gnugo/gnugo.el (gnugo--play-stone): New func.
(gnugo--user-play-stone): New defsubst.
(gnugo-move, gnugo-pass): Use ‘gnugo--user-play-stone’.
(gnugo-toggle-dead-group, gnugo-okay): Use ‘gnugo--play-stone’.
* packages/gnugo/gnugo.el (gnugo-frolic-in-the-leaves fsi):
Take first arg PROPERTIES, pushing other args later;
use them to ‘propertize’ the formatted string.
(gnugo-frolic-in-the-leaves): Propertize "move" lines
w/ property ‘n’, column text additionally w/ property ‘bx’.
(gnugo--vertical): New func.
(gnugo-frolic-previous-move): New command.
(gnugo-frolic-next-move): Likewise.
(gnugo-frolic-mode-map): Add bindings for ‘C-p’, ‘C-n’.
The debugging aids functionality is now part of gnugo.el.
The various ideas / wishlist items are now realized, except for
"dribble the SGF tree", which is bunk, and "SGF tree traversal",
which awaits a nicer (user-level) node-ref facility.
[gnugo frolic int] Add var selection to awakening parameterization.
This eliminates unused local vars for the affected funcs.
* packages/gnugo/gnugo.el (gnugo--awake):
Check HOW for ‘(omit NAME ...)’ and arrange to omit NAME...
from the return value; return a simple list, w/o ‘values’.
(gnugo--awakened): Use ‘destructuring-bind’ instead of
‘multiple-value-bind’; construct its ARGS parameter
based on ‘(omit NAME ...)’ in HOW.
(gnugo--swiz): Omit ‘tree’.
(gnugo--sideways): Omit ‘tree’, ‘ends’, ‘monkey’, ‘bidx’, ‘line’.
[gnugo int] Fix syntax error in ‘loop’ destructuring.
The destructuring is similar to but not identical to the
facility provided by ‘defmacro’ (info "(cl) For Clauses").
This was caught, btw, while trying to byte-compile w/
‘-*- lexical-binding: t -*-’ on the first line.
[gnugo sgf] Fix bug: Preserve whitespace for ‘text’ values.
* packages/gnugo/gnugo.el (gnugo/sgf-create x):
Take arg PRESERVE-WHITESPACE; when set, don't squeeze whitespace.
(gnugo/sgf-create one): Specify PRESERVE-WHITESPACE
to ‘x’ when ‘type’ is ‘text’.
[gnugo int] Move vectorization into ‘gnugo--set-tree-ends’.
* packages/gnugo/gnugo.el (gnugo--set-tree-ends):
Rename 2nd arg to LS; apply ‘vector’ to it to obtain ENDS.
(gnugo-frolic-prune-branch, gnugo-note): Update accordingly.
* packages/gnugo/gnugo.el (gnugo--awake):
Take arg HOW, a list of forms; vary ‘line’ extraction using HOW;
likewise, conditionally throw "No branch here" user-error.
(gnugo--awakened): Add ‘declare’ form for indentation;
take first arg HOW; pass it quoted to ‘gnugo--awake’.
(gnugo--swiz, gnugo-frolic-prune-branch)
(gnugo-frolic-backward-branch, gnugo-frolic-forward-branch):
Update ‘gnugo--awakened’ call; drop centralized code.
* packages/gnugo/gnugo.el (gnugo-frolic-in-the-leaves):
For ‘header-line-format’, replace constant string
with ‘(:eval ...)’ form that handles left scroll bar,
left fringe, and horizontal scrolling margin, if any.
`version-to-list` doesn't have snapshot support before 24.4. The `-cvs` suffix
is the closest we can get there and it will be interpreted as a snapshot version
on 24.4+ anyways.
* packages/gnugo/gnugo.el (gnugo-frolic-mode-map): New defvar.
<top-level>: Conditionalize ‘gnugo-frolic-mode-map’
init; use same idiom as for ‘gnugo-board-mode-map’.
* packages/gnugo/gnugo.el (gnugo--move-to-bcol): New defsubst.
(gnugo--swiz, gnugo-frolic-prune-branch)
(gnugo-frolic-backward-branch)
(gnugo-frolic-forward-branch): Use it.