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

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

[elpa] 39/51: [gnugo] Don't show underscore in group-animation message.


From: Thien-Thi Nguyen
Subject: [elpa] 39/51: [gnugo] Don't show underscore in group-animation message.
Date: Mon, 24 Feb 2014 12:30:24 +0000

ttn pushed a commit to branch master
in repository elpa.

commit 257598c91ac9d3b9655a8fe68c6fbb3cf6d53366
Author: Thien-Thi Nguyen <address@hidden>
Date:   Mon Feb 17 11:33:56 2014 +0100

    [gnugo] Don't show underscore in group-animation message.
    
    * packages/gnugo/gnugo.el (gnugo-animate-group):
    Don't take COMMAND; instead, take W/D, a symbol;
    construct command w/ it; rework messages accordingly.
    (gnugo-worm-stones): Update call to ‘gnugo-animate-group’.
    (gnugo-dragon-stones): Likewise.
---
 packages/gnugo/gnugo.el |   18 ++++++++++--------
 1 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/packages/gnugo/gnugo.el b/packages/gnugo/gnugo.el
index 9e813b7..15143ba 100644
--- a/packages/gnugo/gnugo.el
+++ b/packages/gnugo/gnugo.el
@@ -1074,14 +1074,16 @@ To start a game try M-x gnugo."
     (gnugo-push-move t "resign")
     (gnugo-refresh)))
 
-(defun gnugo-animate-group (command)
-  (message "Computing %s ..." command)
+(defun gnugo-animate-group (w/d)
+  ;; W/D is a symbol, either ‘worm’ or ‘dragon’.
   (let* ((pos (gnugo-position))
          (orig-b-m-p (buffer-modified-p))
-         (stones (if (memq (char-after) '(?X ?O))
-                     (gnugo-lsquery "%s %s" command pos)
-                   (user-error "No stone at %s" pos))))
-    (message "Computing %s ... %s in group." command (length stones))
+         blurb stones)
+    (unless (memq (char-after) '(?X ?O))
+      (user-error "No stone at %s" pos))
+    (setq blurb (message "Computing %s stones ..." w/d)
+          stones (gnugo-lsquery "%s_stones %s" w/d pos))
+    (message "%s %s in group." blurb (length stones))
     (setplist (gnugo-f 'anim) nil)
     (let* ((spec (let ((spec (split-string gnugo-animation-string "" t)))
                    (cond ((gnugo-get :display-using-images)
@@ -1129,7 +1131,7 @@ Signal error if done out-of-turn or if game-over.
 See variable `gnugo-animation-string' for customization."
   (interactive)
   (gnugo-gate)
-  (gnugo-animate-group "worm_stones"))
+  (gnugo-animate-group 'worm))
 
 (defun gnugo-worm-data ()
   "Display in another buffer data from \"worm\" at current position.
@@ -1144,7 +1146,7 @@ Signal error if done out-of-turn or if game-over.
 See variable `gnugo-animation-string' for customization."
   (interactive)
   (gnugo-gate)
-  (gnugo-animate-group "dragon_stones"))
+  (gnugo-animate-group 'dragon))
 
 (defun gnugo-dragon-data ()
   "Display in another buffer data from \"dragon\" at current position.



reply via email to

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