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

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

[elpa] externals/gnugo 402bf68 039/357: [gnugo] Don't show underscore in


From: Stefan Monnier
Subject: [elpa] externals/gnugo 402bf68 039/357: [gnugo] Don't show underscore in group-animation message.
Date: Sun, 29 Nov 2020 14:50:43 -0500 (EST)

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

    [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.
---
 gnugo.el | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

diff --git a/gnugo.el b/gnugo.el
index 9e813b7..15143ba 100644
--- a/gnugo.el
+++ b/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]