[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] 01/02: [gnugo int] Add abstraction: gnugo--who-is-who
From: |
Thien-Thi Nguyen |
Subject: |
[elpa] 01/02: [gnugo int] Add abstraction: gnugo--who-is-who |
Date: |
Tue, 11 Mar 2014 04:36:45 +0000 |
ttn pushed a commit to branch master
in repository elpa.
commit dd2916e40fd8422ff5fc25317ed8a2fccb9a52ed
Author: Thien-Thi Nguyen <address@hidden>
Date: Tue Mar 11 05:35:30 2014 +0100
[gnugo int] Add abstraction: gnugo--who-is-who
* packages/gnugo/gnugo.el (gnugo--who-is-who): New func.
(gnugo-read-sgf-file): Use it.
---
packages/gnugo/gnugo.el | 13 ++++++++-----
1 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/packages/gnugo/gnugo.el b/packages/gnugo/gnugo.el
index 6c6c044..00de3f1 100644
--- a/packages/gnugo/gnugo.el
+++ b/packages/gnugo/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.