[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/gnugo f102d7f 240/357: [gnugo] Allow user to move for G
From: |
Stefan Monnier |
Subject: |
[elpa] externals/gnugo f102d7f 240/357: [gnugo] Allow user to move for GNU Go. |
Date: |
Sun, 29 Nov 2020 14:51:30 -0500 (EST) |
branch: externals/gnugo
commit f102d7f5cc18df40bec890377bd41df4657acc8c
Author: Thien-Thi Nguyen <ttn@gnu.org>
Commit: Thien-Thi Nguyen <ttn@gnu.org>
[gnugo] Allow user to move for GNU Go.
* packages/gnugo/gnugo.el (gnugo--user-play):
Don't hardcode WHO to ‘gnugo-push-move’;
instead, compute it from :last-mover.
---
NEWS | 1 +
gnugo.el | 13 +++++++++----
2 files changed, 10 insertions(+), 4 deletions(-)
diff --git a/NEWS b/NEWS
index a11e43e..6898cf0 100644
--- a/NEWS
+++ b/NEWS
@@ -22,6 +22,7 @@ NB: "RCS: X..Y " means that the particular release includes
- ‘=’ also displays move number of the stone (if any) at that position
- ‘C-u F’ adds the (abbreviated) blurb as a comment to the last node
- new keybinding for ‘gnugo-undo-one-move’: M-u
+ - you can play a move for GNU Go, e.g., after ‘M-u’
- ‘gnugo-undo-one-move’ can optionally arrange for you to play next
- new command: ‘S’ (gnugo-request-suggestion)
- new command: ‘C’ (gnugo-comment)
diff --git a/gnugo.el b/gnugo.el
index 345fd9b..ae962fc 100644
--- a/gnugo.el
+++ b/gnugo.el
@@ -1707,12 +1707,17 @@ cursor to the suggested position. Prefix arg inhibits
warp."
(defun gnugo--user-play (pos-or-pass)
(gnugo-gate t)
- (let ((donep (gnugo-push-move t pos-or-pass))
- (buf (current-buffer)))
+ ;; The "user" in this func's name used to signify both
+ ;; who does the action and for whom the action is done.
+ ;; Now, it signifies only the former.
+ (let* ((gcolor (gnugo-get :gnugo-color))
+ (userp (string= gcolor (gnugo-get :last-mover)))
+ (donep (gnugo-push-move userp pos-or-pass))
+ (buf (current-buffer)))
(gnugo--finish-move buf)
- (unless donep
+ (when (and userp (not donep))
(with-current-buffer buf
- (gnugo-get-move (gnugo-get :gnugo-color))))))
+ (gnugo-get-move gcolor)))))
(defun gnugo-move ()
"Make a move on the GNUGO Board buffer.
- [elpa] externals/gnugo 5e24ee5 182/357: [gnugo int] Use GTP ‘reg_genmove’ instead of ‘genmove’., (continued)
- [elpa] externals/gnugo 5e24ee5 182/357: [gnugo int] Use GTP ‘reg_genmove’ instead of ‘genmove’., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo e387d96 193/357: [gnugo int] Accept color for ‘gnugo-push-move’ 1st arg., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 876e0d3 195/357: [gnugo] New command: ‘C-c C-a’ (gnugo-toggle-abdication), Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 1fa7d59 204/357: [gnugo int] Add abstraction: gnugo--plant-and-climb, Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo d96223f 209/357: [gnugo] Move most of ‘gnugo-board-mode’ to ‘gnugo’., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo eb77485 215/357: [gnugo int] Don't make ‘font-lock-defaults’ buffer-local., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 4d5f998 217/357: [gnugo int] Decruft: Drop unused local var., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo e6c0a07 229/357: [gnugo int] Fix bug: On -l/--infile, don't set :last-mover., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 11543e5 232/357: [gnugo] Reduce modifier key bouncing for "quick peek" frolics., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo dae8f08 231/357: [gnugo] Fix bug: DTRT for :last-user-bpos in undo-one-move ME-NEXT., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo f102d7f 240/357: [gnugo] Allow user to move for GNU Go.,
Stefan Monnier <=
- [elpa] externals/gnugo 9969838 260/357: [gnugo int] Drop abstractions: gnugo--{ERR-wait, gate-game-over}, Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo b9fa668 265/357: [gnugo int] Drop redundant ‘gnugo-gate’ calls., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo a766f0c 282/357: [gnugo] Replace ‘gnugo-toggle-grid’ w/ ‘gnugo-grid-mode’., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 4028102 271/357: [gnugo] Make climb-to-root "GNU Go to play" reaction customizable., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 46eec46 285/357: [gnugo int] Simplify COND expression., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo eaae57d 324/357: [gnugo int] Add Juanma Barranquero to THANKS; nfc., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo bb986d7 323/357: [gnugo] Release: 3.0.2, Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 64bd753 327/357: [gnugo int] Simplify SGF-write subroutine., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo c6eb3d1 325/357: [gnugo maint] Add people from ttn-pers-elisp THANKS file; nfc., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 981d75e 341/357: [gnugo] Fix bug: Don't clobber dead-group indication on refresh., Stefan Monnier, 2020/11/29