[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] 01/08: [gnugo] Allow user to move for GNU Go.
From: |
Thien-Thi Nguyen |
Subject: |
[elpa] 01/08: [gnugo] Allow user to move for GNU Go. |
Date: |
Wed, 23 Apr 2014 09:00:22 +0000 |
ttn pushed a commit to branch master
in repository elpa.
commit ebfc94428eb3bf97c00f317389c6da916f0958a5
Author: Thien-Thi Nguyen <address@hidden>
Date: Tue Apr 22 11:39:07 2014 +0200
[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.
---
packages/gnugo/NEWS | 1 +
packages/gnugo/gnugo.el | 13 +++++++++----
2 files changed, 10 insertions(+), 4 deletions(-)
diff --git a/packages/gnugo/NEWS b/packages/gnugo/NEWS
index a11e43e..6898cf0 100644
--- a/packages/gnugo/NEWS
+++ b/packages/gnugo/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/packages/gnugo/gnugo.el b/packages/gnugo/gnugo.el
index 345fd9b..ae962fc 100644
--- a/packages/gnugo/gnugo.el
+++ b/packages/gnugo/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] branch master updated (8dd2888 -> 2c6fa1d), Thien-Thi Nguyen, 2014/04/23
- [elpa] 02/08: [gnugo int] Use ‘destr ucturing-bind’ more., Thien-Thi Nguyen, 2014/04/23
- [elpa] 03/08: [gnugo] Fix bug: DTRT for s uggestion ‘nowarp’ check., Thien-Thi Nguyen, 2014/04/23
- [elpa] 05/08: [gnugo] On disable, transform in-flight user-move into suggestion., Thien-Thi Nguyen, 2014/04/23
- [elpa] 01/08: [gnugo] Allow user to move for GNU Go.,
Thien-Thi Nguyen <=
- [elpa] 08/08: [gnugo maint] Update HACKING; nfc., Thien-Thi Nguyen, 2014/04/23
- [elpa] 04/08: [gnugo] Allow user to request suggestion for GNU Go., Thien-Thi Nguyen, 2014/04/23
- [elpa] 06/08: [gnugo] Fix bug: Use ‘ gnugo-gate’ for abdication enable., Thien-Thi Nguyen, 2014/04/23
- [elpa] 07/08: [gnugo int] Use ‘gnugo -current-player’ more., Thien-Thi Nguyen, 2014/04/23