ttn pushed a commit to branch master in repository elpa. commit 6018b9b984e9d96e11f92305812126aab0b39795 Author: Thien-Thi Nguyen <t...@gnu.org> Date: Thu Apr 24 20:05:58 2014 +0200
[gnugo int] Snoop ‘--handicap N’ for empty new board. Regression introduced from 2014-04-19, "Fix bug: Ensure gametree sync for -l/--infile". * packages/gnugo/gnugo.el (gnugo): ...here. --- packages/gnugo/gnugo.el | 10 ++++++++++ 1 files changed, 10 insertions(+), 0 deletions(-) diff --git a/packages/gnugo/gnugo.el b/packages/gnugo/gnugo.el index e8e7a71..92ccf0b 100644 --- a/packages/gnugo/gnugo.el +++ b/packages/gnugo/gnugo.el @@ -2517,6 +2517,16 @@ See `gnugo-board-mode' for a full list of commands." komi (gnugo--nquery "get_komi") handicap (gnugo--nquery "get_handicap") board-size (gnugo--nquery "query_boardsize"))) + ;; Work around a GNU Go 3.8 (and possibly earlier/later) + ;; bug whereby GTP command ‘get_handicap’ fails to return + ;; the N set by ‘--handicap N’ on the command line. + (let ((actually (member "--handicap" args))) + ;; Checking ‘(zerop handicap)’ first is not strictly + ;; necessary; it represents a hope that some day GNU Go + ;; will DTRT (or provide rationale for this weird behavior) + ;; and become worthy of our trust. + (when (and (zerop handicap) actually) + (setq handicap (string-to-number (cadr actually))))) (r! :SZ board-size :DT (format-time-string "%Y-%m-%d") :RU (if (member "--chinese-rules" args)