Thien-Thi Nguyen [Fri, 9 May 2014 16:06:42 +0000 (18:06 +0200)]
[aa2u] Make weight dynamically customizable.
* packages/ascii-art-to-unicode/ascii-art-to-unicode.el
(aa2u-uniform-weight): New defvar.
(aa2u-ucs-bd-uniform-name): Don't take arg WEIGHT;
instead, consult ‘aa2u-uniform-weight’.
(aa2u-phase-1, aa2u-replacement):
Update calls to ‘aa2u-ucs-bd-uniform-name’.
(aa2u): Mention new var in docstring.
* packages/ascii-art-to-unicode/ascii-art-to-unicode.el (aa2u):
Take optional arg INTERACTIVE; add "p" to ‘interactive’ form;
when INTERACTIVE and region is not active, set BEG, END.
Thien-Thi Nguyen [Sat, 3 May 2014 10:04:55 +0000 (12:04 +0200)]
[gnugo] Fix bug: For GTP "help COMMAND", leave point in right place.
* packages/gnugo/gnugo.el (:gnugo-gtp-command-spec help):
When COMMANd is specified and found, use a marker to hold its
position, and after moving point there, make it point nowhere.
Thien-Thi Nguyen [Fri, 2 May 2014 09:23:29 +0000 (11:23 +0200)]
[gnugo] Handle function for ‘gnugo-xpms’ value.
* packages/gnugo/gnugo.el (gnugo-xpms): Update docstring.
(gnugo-toggle-image-display): If ‘gnugo-xpms’
is a function, call it with the board size and
take its rv as the set of XPM images to use.
Eric Schulte [Thu, 1 May 2014 19:13:53 +0000 (15:13 -0400)]
remove coding conversion from main network process
This fixes a serious bug on windows in which the required \r\n line
endings were being automatically converted to a single \n. Thanks to
thesoftwarebin on github for identifying and diagnosing this problem,
and then confirming the fix.
Thien-Thi Nguyen [Thu, 1 May 2014 17:49:59 +0000 (19:49 +0200)]
[gnugo] Make climb-to-root "GNU Go to play" reaction customizable.
* packages/gnugo/gnugo.el (gnugo-undo-reaction): New defvar.
(gnugo--user-play): Inhibit karmic error for one-shot.
(gnugo--climb-towards-root): Don't take 2nd arg NOALT;
instead, take 2nd arg REACTION; drop "POS not occupied by COLOR"
check and error; rewrite handling for "GNU Go to play" case.
(gnugo-undo-one-move): Call ‘gnugo--climb-towards-root’ w/
‘gnugo-undo-reaction’ value clamped to ‘zombie’/‘one-shot’.
[gnugo] Replace abdication w/ Assist and Zombie minor modes.
* packages/gnugo/gnugo.el (gnugo--instant-karma): Delete func.
(gnugo--turn-the-wheel): New func.
(gnugo--finish-move): Take optional arg NOW;
call ‘gnugo--turn-the-wheel’ with it at end.
(gnugo-get-move-insertion-filter): Don't do :abd update.
(gnugo--karma): New func.
(gnugo--:karma): New defsubst.
(gnugo--user-play): Signal ‘user-error’ if current player karmic;
don't call ‘gnugo-get-move’; call ‘gnugo--finish-move’ w/ NOW ‘t’.
(gnugo--dance-dance): New func.
(gnugo--who-is-who): On switch, also flip karma.
(gnugo--climb-towards-root): Don't call ‘gnugo-get-move’;
instead, temporarily make :gnugo-color unkarmic
around call to ‘gnugo--turn-the-wheel’.
(gnugo-toggle-abdication): Delete command.
(gnugo--struggle): New func.
(gnugo-assist-mode, gnugo-zombie-mode): New commands.
(gnugo): Init :wheel; don't call ‘gnugo-get-move’;
instead, call ‘gnugo--turn-the-wheel’.
(gnugo-board-mode-map): Bind ‘C-c C-a’ to ‘gnugo-assist-mode’;
add binding for ‘C-c C-z’.
[gnugo int] Maintain current buffer in ‘gnugo--finish-move’.
* packages/gnugo/gnugo.el (gnugo--finish-move):
Don't take arg BUF; instead, note and restore
the current buffer around the call to ‘run-hooks’.
(gnugo-get-move-insertion-filter)
(gnugo-user-play): Update accordingly.
Stefan Monnier [Tue, 29 Apr 2014 05:13:19 +0000 (01:13 -0400)]
* nlinum.el (nlinum-format): New custom variable.
(nlinum--region): Change calling convention of nlinum-format-function.
(nlinum-format-function): Change default value accordingly; Use nlinum-format;
Try to generate less garbage.
[gnugo int] Compute "Abd" in mode-line at time of change.
* packages/gnugo/gnugo.el (gnugo-btw): New var.
(gnugo--instant-karma): New func.
(gnugo-refresh): Don't compute "Abd" here.
(gnugo-toggle-abdication): Use ‘gnugo--instant-karma’.
(gnugo-board-mode): Init ‘gnugo-btw’ as
buffer-local var; include it in ‘minor-mode-alist’.
That tends to persist in the echo area, which is
both annoying and misleading should the game end.
* packages/gnugo/gnugo.el (gnugo--display-suggestion): New func.
(gnugo-get-move-insertion-filter): Use it.
(gnugo-toggle-abdication): Use ‘force-mode-line-update’;
don't ‘message’ state; however, retain "suggestion
forthcoming" message via ‘gnugo--display-suggestion’.
[gnugo] Make undo commands silently handle overkill.
It's impolite to reflect impoliteness. :-D
* packages/gnugo/gnugo.el (gnugo--climb-towards-root):
Don't use ‘gnugo--q/ue’ for GTP "undo"; instead,
use ‘gnugo--q’, detect overkill, and stop looping.
* packages/gnugo/gnugo.el (gnugo-move-history pretty):
Delete internal func.
(gnugo-move-history next): Revert to pre-‘pretty’ code.
(gnugo-move-history): For ‘bpos’ RSEL, convert search
condition from two negated string comparisons to one
"normal CC" position detection, and delay ‘as-pos’
call to rv computation.
[gnugo] On disable, transform in-flight user-move into suggestion.
* packages/gnugo/gnugo.el (gnugo-toggle-abdication):
Don't signal "too soon" error; instead, transform scheduled
user-move into a suggestion, include extra info in the
status message and sleep for 2 sec after message display;
update condition for ‘(gnugo-get-move gcolor)’ accordingly.
[gnugo] Allow user to request suggestion for GNU Go.
* packages/gnugo/gnugo.el (gnugo-get-move-insertion-filter):
Include color in suggestion message.
(gnugo-request-suggestion): Use ‘gnugo-current-player’.
[gnugo] Fix bug: DTRT for suggestion ‘nowarp’ check.
From inception 2014-04-15, "New
command: ‘S’ (gnugo-request-suggestion)".
* packages/gnugo/gnugo.el (gnugo-get-move-insertion-filter):
Don't feed ‘cons’ rv to ‘destructuring-bind’; instead,
drop var ‘pos-or-pass’, repurpose var ‘full’ -- surely
succumbing to Bad Style :-/, and access :waiting directly.
* packages/gnugo/gnugo.el (gnugo--climb-towards-root):
...into here if SPEC is neither number nor string.
(gnugo-oops, gnugo-fancy-undo): Update accordingly.
[gnugo int] Centralize some "No stone at POS" errors.
* packages/gnugo/gnugo.el (gnugo--mem-with-played-stone):
Take optional arg NOERROR; if clear, when no ‘color’
found, signal "No stone at POS" error.
(gnugo--climb-towards-root): Drop "POS already clear" error
handling; use ‘gnugo--mem-with-played-stone’ rv directly.
(gnugo--node-with-played-stone): Take optional arg NOERROR;
pass it to ‘gnugo--mem-with-played-stone’.
(gnugo-describe-position): Specify
NOERROR to ‘gnugo--node-with-played-stone’.
(gnugo-comment): Drop "No stone at POS" error handling;
use ‘gnugo--node-with-played-stone’ rv directly.
* packages/gnugo/gnugo.el (gnugo--climb-towards-root):
Don't construct local func ‘done’; instead, pre-compute
final MEM and loop until it's reached, as per ‘eq’.
[gnugo] On SGF load, leave cursor at last user board position.
* packages/gnugo/gnugo.el (gnugo-move-history):
Take optional second arg COLOR.
(gnugo-move-history remem): New internal func.
(gnugo-move-history pretty): New internal func.
(gnugo-move-history next): Use ‘remem’, ‘pretty’.
(gnugo-move-history): If RSEL is ‘bpos’, return
the position of the last stone placed by COLOR.
(gnugo-read-sgf-file): Set :last-user-bpos.
(gnugo): After refresh, prefer :last-user-bpos
to :center-position for cursor position.