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

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

[elpa] externals/gnugo 57faa71 256/357: [gnugo] Don't display "Abdicatio


From: Stefan Monnier
Subject: [elpa] externals/gnugo 57faa71 256/357: [gnugo] Don't display "Abdication {en, dis}abled".
Date: Sun, 29 Nov 2020 14:51:34 -0500 (EST)

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

    [gnugo] Don't display "Abdication {en,dis}abled".
    
    That tends to persist in the echo area, which is
    both annoying and misleading should the game end.
    
    * packages/gnugo/gnugo.el (gnugo--display-suggestion): New func.
    (gnugo-get-move-insertion-filter): Use it.
    (gnugo-toggle-abdication): Use ‘force-mode-line-update’;
    don't ‘message’ state; however, retain "suggestion
    forthcoming" message via ‘gnugo--display-suggestion’.
---
 gnugo.el | 19 ++++++++-----------
 1 file changed, 8 insertions(+), 11 deletions(-)

diff --git a/gnugo.el b/gnugo.el
index 67fec6b..b54ce2b 100644
--- a/gnugo.el
+++ b/gnugo.el
@@ -1638,6 +1638,11 @@ its move."
       (when (string-match old name)
         (rename-buffer (replace-match new t t name))))))
 
+(defun gnugo--display-suggestion (color suggestion)
+  (message "%sSuggestion for %s: %s"
+           (gnugo-get :diamond)
+           color suggestion))
+
 (defun gnugo-get-move-insertion-filter (proc string)
   (with-current-buffer (process-buffer proc)
     (let* ((so-far (gnugo-get :get-move-string))
@@ -1654,9 +1659,7 @@ its move."
                 (unless (or (gnugo--passp full)
                             (eq 'nowarp suggestion))
                   (gnugo-goto-pos full))
-                (message "%sSuggestion for %s: %s"
-                         (gnugo-get :diamond)
-                         color full))
+                (gnugo--display-suggestion color full))
             (let* ((donep (gnugo-push-move color full))
                    (buf (current-buffer)))
               (gnugo--finish-move buf)
@@ -2319,15 +2322,9 @@ transformed into a move suggestion (see 
`gnugo-request-suggestion')."
       (gnugo-gate t)
       (gnugo-put :abd t)
       (gnugo-get-move (gnugo-other last-mover)))
-    (message "Abdication %sabled%s"
-             (if (gnugo-get :abd)
-                 "en"
-               "dis")
-             (if xform
-                 (format " (suggestion for %s forthcoming)"
-                         (gnugo-get :user-color))
-               ""))
+    (force-mode-line-update)            ; hmm
     (when xform
+      (gnugo--display-suggestion (gnugo-get :user-color) "forthcoming")
       (sleep-for 2))))
 
 ;;;---------------------------------------------------------------------------



reply via email to

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