[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/gnugo d48adca 244/357: [gnugo] On disable, transform in
From: |
Stefan Monnier |
Subject: |
[elpa] externals/gnugo d48adca 244/357: [gnugo] On disable, transform in-flight user-move into suggestion. |
Date: |
Sun, 29 Nov 2020 14:51:31 -0500 (EST) |
branch: externals/gnugo
commit d48adcaad4a339bcc55a3932aea0f600320b9def
Author: Thien-Thi Nguyen <ttn@gnu.org>
Commit: Thien-Thi Nguyen <ttn@gnu.org>
[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.el | 25 +++++++++++++++++--------
1 file changed, 17 insertions(+), 8 deletions(-)
diff --git a/gnugo.el b/gnugo.el
index 30090a9..90a2187 100644
--- a/gnugo.el
+++ b/gnugo.el
@@ -2283,21 +2283,25 @@ If COMMENT is nil or the empty string, remove the
property entirely."
"Toggle abdication, i.e., letting GNU Go play for you.
When enabled, the mode line includes \"Abd\".
Enabling signals error if the game is over.
-Disabling signals error if the color \"to play\" is the user color.
-This is to ensure that the user is the next to play after disabling."
+When disabling, if GNU Go has already started thinking of
+a move to play for you, the thinking is not cancelled but instead
+transformed into a move suggestion (see `gnugo-request-suggestion')."
(interactive)
(let ((last-mover (gnugo-get :last-mover))
(abd (gnugo-get :abd))
- (warning ""))
+ xform)
(if abd
;; disable
- (let ((gcolor (gnugo-get :gnugo-color)))
- (when (string= last-mover gcolor)
- (gnugo--ERR-wait gcolor "Sorry, too soon"))
+ (let* ((gcolor (gnugo-get :gnugo-color))
+ (waiting (gnugo-get :waiting))
+ (userp (string= last-mover gcolor)))
+ (when (and userp waiting)
+ (gnugo--rename-buffer-portion)
+ (setcdr waiting (setq xform 'nowarp)))
(when (timerp abd)
(cancel-timer abd))
(gnugo--forget :abd)
- (unless (gnugo-get :waiting)
+ (unless (or userp waiting)
(gnugo-get-move gcolor)))
;; enable
(gnugo--gate-game-over t)
@@ -2307,7 +2311,12 @@ This is to ensure that the user is the next to play
after disabling."
(if (gnugo-get :abd)
"en"
"dis")
- warning)))
+ (if xform
+ (format " (suggestion for %s forthcoming)"
+ (gnugo-get :user-color))
+ ""))
+ (when xform
+ (sleep-for 2))))
;;;---------------------------------------------------------------------------
;;; Command properties and gnugo-command
- [elpa] externals/gnugo 7114ed6 234/357: [gnugo int] Add abstraction: gnugo--mem-with-played-stone, (continued)
- [elpa] externals/gnugo 7114ed6 234/357: [gnugo int] Add abstraction: gnugo--mem-with-played-stone, Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 9ae1363 236/357: [gnugo] Internalize ‘gnugo-magic-undo’., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo a92e184 255/357: fixup! [gnugo int] Decorate w/ plist instead of alist., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 71e1500 245/357: [gnugo] Fix bug: Use ‘gnugo-gate’ for abdication enable., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 46f49e3 246/357: [gnugo int] Use ‘gnugo-current-player’ more., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 443903e 249/357: [gnugo int] Drop abstraction: pretty, Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo a0ecdea 257/357: [gnugo] Conditionalize xform warping on abdication disable., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 85e3d91 253/357: [gnugo int] Snoop ‘--handicap N’ for empty new board., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 7c7d43c 261/357: [gnugo int] Avoid superfluous ‘gnugo-other’ call., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 6ddf38f 269/357: [gnugo int] Add abstraction: gnugo--assist-state, Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo d48adca 244/357: [gnugo] On disable, transform in-flight user-move into suggestion.,
Stefan Monnier <=
- [elpa] externals/gnugo 764251b 259/357: [gnugo int] Fix bug: Use correct color for "Not your turn yet"., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 16da062 284/357: [gnugo int] Use ‘loop ... collect’ more., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo e2f7c7b 212/357: [gnugo int] Consolidate display scaling factors access., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 2bde4bc 207/357: [gnugo] Add hook: gnugo-start-game-hook, Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 714d3c9 201/357: [gnugo int] Commentary munging; nfc., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo e019871 206/357: [gnugo] Add abstraction: gnugo-current-player, Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 40f7299 225/357: [gnugo] Fix bug: Ensure gametree sync for -l/--infile., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo cedd448 227/357: [gnugo int] Add abstraction: gnugo--prop<-color, Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo dfe75eb 281/357: [gnugo] Replace ‘gnugo-toggle-image-display-command’ w/ ‘gnugo-image-display-mode’., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 88620df 278/357: [gnugo int] Decruft: Drop :local-xpms support., Stefan Monnier, 2020/11/29