* 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.
* 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.
[gnugo frolic] Handle invalid branch more consistently.
* packages/gnugo/gnugo.el (gnugo--awake):
If ‘col’ is too big or too small, return nil for ‘a’.
(gnugo--swiz, gnugo-frolic-prune-branch):
Throw error on invalid branch.
(gnugo-frolic-backward-branch): Take invalid branch as ‘width’.
(gnugo-frolic-forward-branch): Take invalid branch as -1.
* packages/gnugo/gnugo.el (gnugo--swiz): Rename arg SHIFT to BLUNT;
if BLUNT is a number, validate and take it as ‘b’ directly.
(gnugo-frolic-set-as-main-line): New command.
(gnugo-frolic-mode-map): Bind ‘C-m’ to it.
[gnugo frolic] Add some branch swizzling commands.
* packages/gnugo/gnugo.el (gnugo-frolic-in-the-leaves):
Set buffer-local ‘gnugo-state’ to that of the parent buffer.
(gnugo--awake): New func.
(gnugo--awakened): New macro.
(gnguo--swiz): New func.
(gnugo-frolic-exchange-left, gnugo-frolic-rotate-left)
(gnugo-frolic-exchange-right, gnugo-frolic-rotate-right):
New commands.
(gnugo-frolic-mode-map): Add bindings for ‘j’, ‘J’, ‘k’, ‘K’.
[gnugo] Add some navigation commands for GNUGO Frolic mode.
* packages/gnugo/gnugo.el (gnugo-frolic-parent-buffer)
(gnugo-frolic-origin): New defvars.
(gnugo-frolic-mode): Don't invoke ‘view-mode’.
(gnugo-frolic-quit, gnugo-frolic-return-to-origin): New commands.
(gnugo-frolic-in-the-leaves): Set as local vars
‘gnugo-frolic-in-the-leaves’, ‘gnugo-frolic-origin’;
use ‘gnugo-frolic-return-to-origin’.
(gnugo-frolic-mode-map): Add bindings for ‘q’, ‘C’, ‘o’.
[gnugo int] Insert frolic xrep starting w/ the leaves.
* packages/gnugo/gnugo.el (gnugo-frolic-in-the-leaves ...)
(... tip-p): New internal func.
[breathe in]: Don't construct root-forward lists to display;
instead, note fork if on tip of orig and side branches.
[breathe out]: Start displaying from ‘max-move-num’ down;
move to ‘point-min’ at initially, before each line; pop from
copy of ‘ends’ directly; use ‘point-marker’ for ‘finish’.
[gnugo int] Move precise fanout computation to "breathe in".
* packages/gnugo/gnugo.el (gnugo-frolic-in-the-leaves link):
Use ‘pushnew’; push the node's branch number directly.
(gnugo-frolic-in-the-leaves): Check for continuation node
prior to appending ‘acc’; link it only on non-empty ‘acc’;
in "breathe out", accumulate into ‘forks’ directly.
* packages/gnugo/gnugo.el (gnugo--tree-mnum): New defsubst.
(gnugo-note): Record new node's move number in the tree MNUM.
(gnugo/sgf-create): Change tree MNUM weakness to ‘key’.
* packages/gnugo/gnugo.el (gnugo--mkht): New defsubst.
(gnugo-frolic-in-the-leaves, gnugo-board-mode)
(gnugo/sgf-create, gnugo/sgf-hang-from-root): Use it.
* packages/gnugo/gnugo.el (gnugo--tree-ends): Rewrite.
(gnugo--set-tree-ends): Likewise, as a defsubst.
(gnugo-describe-internal-properties): Frob :sgf-gametree, too.
(gnugo--root-node): Rewrite.
(gnugo--set-tree-ends-actually): Delete func.
(gnugo/sgf-root-node): Delete func.
(gnugo/sgf-create TREE): Take also MNUM, KIDS;
compute and record move number of ‘node’;
record multiple-kids case in two phases;
update recursive call.
(gnugo/sgf-create): Update call to ‘TREE’;
return [MNUM KIDS ENDS ROOT].
* packages/gnugo/gnugo.el
(gnugo--tree-ends): New defsubst.
(gnugo--set-tree-ends-actually): New func.
(gnugo--set-tree-ends): New macro.
(gnugo-frolic-in-the-leaves, gnugo--no-regrets)
(gnugo-read-sgf-file, gnugo-board-mode, gnugo/sgf-root-node):
Use ‘gnugo--tree-ends’.
(gnugo-note): Likewise, and also ‘gnugo--set-tree-ends’.
* packages/gnugo/gnugo.el
(gnugo-read-sgf-file): Use ‘gnugo/sgf-create’.
(gnugo/sgf-create): Rename from ‘gnugo/sgf-read-file’;
rename 1st arg to FILE-OR-DATA; take optional 2nd arg DATA-P;
if DATA-P set, arrange to parse FILE-OR-DATA directly.
* packages/gnugo/gnugo.el (gnugo-note):
For déjà-vu check, don't start w/ ‘bidx’ if no regrets;
also, copy the old branch immediately to its right,
instead of placing it at the end of the ends vector.
Leo Liu [Fri, 4 Apr 2014 05:02:13 +0000 (13:02 +0800)]
Properly fix the bug by delaying compilation finish functions
Function compilation-auto-jump may trigger running process sentinels
and thus ggtags-global-handle-exit causing itself to fail. This
happens fairly often on remote hosts via tramp due to
accept-process-output.
[gnugo] Add command ‘gnugo-frolic-in-the-leaves’ and keybinding.
* packages/gnugo/gnugo.el: Require ‘ascii-art-to-unicode’.
(gnugo--as-pos-func): New func.
(gnugo-frolic-in-the-leaves): New command.
(gnugo-board-mode-map): Bind ‘L’ to ‘gnugo-frolic-in-the-leaves’.
* packages/ascii-art-to-unicode/ascii-art-to-unicode.el (aa2u):
Take args BEG and END; use "r" in ‘interactive’ spec;
don't bother w/ internal func ‘do-it!’.
Leo Liu [Thu, 3 Apr 2014 08:06:56 +0000 (16:06 +0800)]
Don't reply on excution order of filter and sentinel functions
There is no guarantee ggtags-global-handle-exit will be called after
ggtags-global-filter. So don't rely on this.
For example compile-goto-error on remote file (via tramp) might call
accept-process-output which allows process sentinel functions to run
per (info "(elisp)Sentinels").