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

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

[elpa] externals/gnugo 400e27d 069/357: [gnugo int] Add abstraction: gnu


From: Stefan Monnier
Subject: [elpa] externals/gnugo 400e27d 069/357: [gnugo int] Add abstraction: gnugo--who-is-who
Date: Sun, 29 Nov 2020 14:50:51 -0500 (EST)

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

    [gnugo int] Add abstraction: gnugo--who-is-who
    
    * packages/gnugo/gnugo.el (gnugo--who-is-who): New func.
    (gnugo-read-sgf-file): Use it.
---
 gnugo.el | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/gnugo.el b/gnugo.el
index 6c6c044..00de3f1 100644
--- a/gnugo.el
+++ b/gnugo.el
@@ -1267,6 +1267,13 @@ If FILENAME already exists, Emacs confirms that you wish 
to overwrite it."
   (gnugo/sgf-write-file (gnugo-get :sgf-collection) filename)
   (set-buffer-modified-p nil))
 
+(defun gnugo--who-is-who (wait play samep)
+  (message "GNU Go %splays as %s, you as %s (%s)"
+           (if samep "" "now ")
+           wait play (if samep
+                         "as before"
+                       "NOTE: this is a switch!")))
+
 (defun gnugo-read-sgf-file (filename)
   "Load the first game tree from FILENAME, a file in SGF format."
   (interactive "fSGF file to load: ")
@@ -1341,11 +1348,7 @@ If FILENAME already exists, Emacs confirms that you wish 
to overwrite it."
         (gnugo-close-game nil game-over)))
     (gnugo-refresh t)
     (set-buffer-modified-p nil)
-    (message "GNU Go %splays as %s, you as %s (%s)"
-             (if samep "" "now ")
-             wait play (if samep
-                           "as before"
-                         "NOTE: this is a switch!"))))
+    (gnugo--who-is-who wait play samep)))
 
 (defun gnugo-magic-undo (spec &optional noalt)
   "Undo moves on the GNUGO Board, based on SPEC, a string or number.



reply via email to

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