emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/gnugo 9969838 260/357: [gnugo int] Drop abstractions: g


From: Stefan Monnier
Subject: [elpa] externals/gnugo 9969838 260/357: [gnugo int] Drop abstractions: gnugo--{ERR-wait, gate-game-over}
Date: Sun, 29 Nov 2020 14:51:34 -0500 (EST)

branch: externals/gnugo
commit 9969838404b766b5811f91c82652b49783ec25e4
Author: Thien-Thi Nguyen <ttn@gnu.org>
Commit: Thien-Thi Nguyen <ttn@gnu.org>

    [gnugo int] Drop abstractions: gnugo--{ERR-wait,gate-game-over}
    
    * packages/gnugo/gnugo.el (gnugo--gate-game-over)
    (gnugo--ERR-wait): Delete, incorporating them into...
    (gnugo-gate): ...here.
---
 gnugo.el | 22 ++++++++--------------
 1 file changed, 8 insertions(+), 14 deletions(-)

diff --git a/gnugo.el b/gnugo.el
index 160cfa0..bf7b120 100644
--- a/gnugo.el
+++ b/gnugo.el
@@ -355,14 +355,6 @@ Handle the big, slow-to-render, and/or uninteresting ones 
specially."
 (defsubst gnugo--prop<-color (color)
   (if (gnugo--blackp color) :B :W))
 
-(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))
-
 (defun gnugo-gate (&optional in-progress-p)
   (unless (gnugo-board-buffer-p)
     (user-error "Wrong buffer -- try M-x gnugo"))
@@ -371,13 +363,15 @@ Handle the big, slow-to-render, and/or uninteresting ones 
specially."
   (destructuring-bind (&optional color . suggestion)
       (gnugo-get :waiting)
     (when color
-      (apply 'gnugo--ERR-wait
+      (apply 'user-error
+             "%s -- please wait for \"(%s to play)\""
              (if suggestion
-                 (list color
-                       "Still thinking")
-               (list (gnugo-other color)
-                     "Not your turn yet")))))
-  (gnugo--gate-game-over in-progress-p))
+                 (list "Still thinking"
+                       color)
+               (list "Not your turn yet"
+                     (gnugo-other color))))))
+  (when (and in-progress-p (gnugo-get :game-over))
+    (user-error "Sorry, game over")))
 
 (defun gnugo-sentinel (proc string)
   (let ((status (process-status proc)))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]