[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/gnugo 66c29d0 197/357: [gnugo int] Add abstraction: gnu
From: |
Stefan Monnier |
Subject: |
[elpa] externals/gnugo 66c29d0 197/357: [gnugo int] Add abstraction: gnugo--gate-game-over |
Date: |
Sun, 29 Nov 2020 14:51:20 -0500 (EST) |
branch: externals/gnugo
commit 66c29d0104a38814469eba395b32bd270f8ea593
Author: Thien-Thi Nguyen <ttn@gnu.org>
Commit: Thien-Thi Nguyen <ttn@gnu.org>
[gnugo int] Add abstraction: gnugo--gate-game-over
* packages/gnugo/gnugo.el (gnugo--gate-game-over): New defsubst.
(gnugo-gate, gnugo-toggle-abdication): Use it.
---
gnugo.el | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/gnugo.el b/gnugo.el
index 76544d1..77d6946 100644
--- a/gnugo.el
+++ b/gnugo.el
@@ -329,6 +329,10 @@ Handle the big, slow-to-render, and/or uninteresting ones
specially."
(defun gnugo-other (color)
(if (gnugo--blackp color) "white" "black"))
+(defsubst gnugo--gate-game-over (enable)
+ (when (and enable (gnugo-get :game-over))
+ (user-error "Sorry, game over")))
+
(defun gnugo--ERR-wait (color why)
(user-error "%s -- please wait for \"(%s to play)\""
why color))
@@ -344,8 +348,7 @@ Handle the big, slow-to-render, and/or uninteresting ones
specially."
(if (cdr slow)
"Still thinking"
"Not your turn yet"))))
- (when (and in-progress-p (gnugo-get :game-over))
- (user-error "Sorry, game over")))
+ (gnugo--gate-game-over in-progress-p))
(defun gnugo-sentinel (proc string)
(let ((status (process-status proc)))
@@ -2280,8 +2283,7 @@ This is to ensure that the user is the next to play after
disabling."
(unless color
(gnugo-get-move gcolor)))
;; enable
- (when (gnugo-get :game-over)
- (user-error "Sorry, game over"))
+ (gnugo--gate-game-over t)
(gnugo-put :abd t)
(gnugo-get-move (gnugo-other last-mover)))
(message "Abdication %sabled%s"
- [elpa] externals/gnugo 3e3fbea 155/357: [gnugo sgf] Fix bug: Preserve whitespace for ‘text’ values., (continued)
- [elpa] externals/gnugo 3e3fbea 155/357: [gnugo sgf] Fix bug: Preserve whitespace for ‘text’ values., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 0f3f4b6 165/357: [gnugo int] Use ‘ignore’ to avoid byte-compiler warnings., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 082d56c 178/357: [gnugo int] Use ‘gnugo--decorate’ more., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo e382633 190/357: [gnugo] Drop var: gnugo-inhibit-refresh, Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo dd6b6f8 186/357: [gnugo] New command: ‘C’ (gnugo-comment), Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo cba406b 176/357: [gnugo] Include root node in :sgf-gametree description., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 1ac646f 172/357: [gnugo] New command: ‘O’ (gnugo-okay), Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 3f13bbf 168/357: [gnugo] Make ‘=’ also display move number., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo f3c90cd 187/357: [gnugo] Make ‘C-u F’ add the blurb as a comment to the last node., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo bcc912b 164/357: [gnugo frolic int] Add var selection to awakening parameterization., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 66c29d0 197/357: [gnugo int] Add abstraction: gnugo--gate-game-over,
Stefan Monnier <=
- [elpa] externals/gnugo 5bbec0e 179/357: [gnugo int] Incorporate ‘gnugo-note’ into unique caller., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 82b6000 198/357: [gnugo] Mention ‘gnugo-frolic-mode-hook’., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 32e8547 199/357: [gnugo int] Add abstraction: gnugo--user-play, Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 001228c 205/357: [gnugo] Drop support for ‘(gnugo-move-history 'count)’., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 106a279 211/357: [gnugo int] Consolidate paren overlays access., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 17d907d 210/357: [gnugo int] Shave one ‘gnugo-other’ call., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 1d6b241 214/357: [gnugo] Use ‘define-derived-mode’ for GNUGO Board mode., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 167ba89 213/357: [gnugo int] Decruft: Streamline game-over handling on SGF load., Stefan Monnier, 2020/11/29
- [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