[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/gnugo 425731b 196/357: [gnugo int] Add abstraction: gnu
From: |
Stefan Monnier |
Subject: |
[elpa] externals/gnugo 425731b 196/357: [gnugo int] Add abstraction: gnugo--ERR-wait |
Date: |
Sun, 29 Nov 2020 14:51:20 -0500 (EST) |
branch: externals/gnugo
commit 425731b8ed8d09a509952914cac200a171f3c766
Author: Thien-Thi Nguyen <ttn@gnu.org>
Commit: Thien-Thi Nguyen <ttn@gnu.org>
[gnugo int] Add abstraction: gnugo--ERR-wait
* packages/gnugo/gnugo.el (gnugo--ERR-wait): New defun.
(gnugo-gate, gnugo-toggle-abdication): Use it.
---
gnugo.el | 16 +++++++++-------
1 file changed, 9 insertions(+), 7 deletions(-)
diff --git a/gnugo.el b/gnugo.el
index 0224f9f..76544d1 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"))
+(defun gnugo--ERR-wait (color why)
+ (user-error "%s -- please wait for \"(%s to play)\""
+ why color))
+
(defun gnugo-gate (&optional in-progress-p)
(unless (gnugo-board-buffer-p)
(user-error "Wrong buffer -- try M-x gnugo"))
@@ -336,11 +340,10 @@ Handle the big, slow-to-render, and/or uninteresting ones
specially."
(user-error "No \"gnugo\" process!"))
(let ((slow (gnugo-get :waiting)))
(when slow
- (user-error "%s -- please wait for \"\(%s to play\)\""
- (if (cdr slow)
- "Still thinking"
- "Not your turn yet")
- (gnugo-get :user-color))))
+ (gnugo--ERR-wait (gnugo-get :user-color)
+ (if (cdr slow)
+ "Still thinking"
+ "Not your turn yet"))))
(when (and in-progress-p (gnugo-get :game-over))
(user-error "Sorry, game over")))
@@ -2270,8 +2273,7 @@ This is to ensure that the user is the next to play after
disabling."
(gnugo-get :waiting))
(assert (not suggestion))
(when (string= last-mover gcolor)
- (user-error "Sorry, too soon -- please wait for \"(%s to play\)\""
- gcolor))
+ (gnugo--ERR-wait gcolor "Sorry, too soon"))
(when (timerp abd)
(cancel-timer abd))
(gnugo-put :abd nil)
- [elpa] externals/gnugo 5ca7efb 099/357: [gnugo int] Remove redundant game-over condition check., (continued)
- [elpa] externals/gnugo 5ca7efb 099/357: [gnugo int] Remove redundant game-over condition check., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 7fee3b2 104/357: [gnugo] Move "1 or 2" calculation into ‘gnugo-magic-undo’., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo a86327a 108/357: [gnugo] Add command ‘gnugo-frolic-in-the-leaves’ and keybinding., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo f5fbba3 153/357: [gnugo int] Fix bug: Update local var ‘ends’ when branching., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo a4dcef8 150/357: [gnugo frolic int] Parameterize, centralize awakening., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 1b69add 160/357: [gnugo int] Decruft: Drop gametree IR element: KIDS, Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 891a97a 177/357: [gnugo int] Add abstraction: gnugo--decorate, Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 843cd96 163/357: [gnugo frolic int] Add abstraction: gnugo--sideways, Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo eb13b8e 180/357: [gnugo] Dropped command: ‘t’ (gnugo-toggle-dead-group), Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 6c7e102 181/357: [gnugo int] Rename :waitingp to :waiting; save color there., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 425731b 196/357: [gnugo int] Add abstraction: gnugo--ERR-wait,
Stefan Monnier <=
- [elpa] externals/gnugo 3f3af4b 208/357: [gnugo int] Remove from ‘gnugo-state’ instead of setting to nil., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo f28d241 223/357: [gnugo int] Decruft: Don't set provisional :last-user-bpos., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 8211cb9 224/357: [gnugo int] Couple :center-position and :SZ jamming., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 536960c 230/357: [gnugo int] Fix bug: On -l/--infile, inhibit first move if game over., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 50cc2b3 233/357: [gnugo int] Add abstraction: gnugo--q/ue, Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 3903907 235/357: [gnugo] Validate position arg of GTP commands ‘undo’, ‘gg-undo’., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo ab1f4c2 242/357: [gnugo] Fix bug: DTRT for suggestion ‘nowarp’ check., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo e814724 243/357: [gnugo] Allow user to request suggestion for GNU Go., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 5157534 241/357: [gnugo int] Use ‘destructuring-bind’ more., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 6c99d78 251/357: [gnugo int] Add abstraction: gnugo--no-worries, Stefan Monnier, 2020/11/29