[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/gnugo a0ecdea 257/357: [gnugo] Conditionalize xform war
From: |
Stefan Monnier |
Subject: |
[elpa] externals/gnugo a0ecdea 257/357: [gnugo] Conditionalize xform warping on abdication disable. |
Date: |
Sun, 29 Nov 2020 14:51:34 -0500 (EST) |
branch: externals/gnugo
commit a0ecdea4b53485e83f77c4d2af48dc4db4d11f70
Author: Thien-Thi Nguyen <ttn@gnu.org>
Commit: Thien-Thi Nguyen <ttn@gnu.org>
[gnugo] Conditionalize xform warping on abdication disable.
* packages/gnugo/gnugo.el (gnugo-toggle-abdication):
For xform, don't specify ‘nowarp’ unconditionally; instead,
if user appears to be "following along", specify ‘t’;
move xform path completely inside disable path.
---
gnugo.el | 23 ++++++++++++++---------
1 file changed, 14 insertions(+), 9 deletions(-)
diff --git a/gnugo.el b/gnugo.el
index b54ce2b..81c4361 100644
--- a/gnugo.el
+++ b/gnugo.el
@@ -2303,29 +2303,34 @@ 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))
- xform)
+ (abd (gnugo-get :abd)))
(if abd
;; disable
(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)
+ (when (and userp waiting)
+ (let ((u (gnugo-get :user-color)))
+ (gnugo--rename-buffer-portion)
+ (setcdr waiting
+ ;; heuristic: Warp only if it appears
+ ;; that the user is "following along".
+ (or (ignore-errors
+ (string= (gnugo-position)
+ (gnugo-move-history 'bpos u)))
+ 'nowarp))
+ (gnugo--display-suggestion u "forthcoming")
+ (sleep-for 2)))
(unless (or userp waiting)
(gnugo-get-move gcolor)))
;; enable
(gnugo-gate t)
(gnugo-put :abd t)
(gnugo-get-move (gnugo-other last-mover)))
- (force-mode-line-update) ; hmm
- (when xform
- (gnugo--display-suggestion (gnugo-get :user-color) "forthcoming")
- (sleep-for 2))))
+ (force-mode-line-update)))
;;;---------------------------------------------------------------------------
;;; Command properties and gnugo-command
- [elpa] externals/gnugo b3d3da0 220/357: [gnugo int] Use functional style more., (continued)
- [elpa] externals/gnugo b3d3da0 220/357: [gnugo int] Use functional style more., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo e96b88b 218/357: [gnugo] Decruft: Use ‘gnugo-program’ directly as executable., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 3670b0b 228/357: [gnugo] On SGF load, leave cursor at last user board position., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 1020a7f 237/357: [gnugo int] Simplify towards-root loop termination check., Stefan Monnier, 2020/11/29
- [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 <=
- [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, 2020/11/29
- [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