[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] 01/02: [gnugo] Don't display "Abdication {en,dis}abled".
From: |
Thien-Thi Nguyen |
Subject: |
[elpa] 01/02: [gnugo] Don't display "Abdication {en,dis}abled". |
Date: |
Fri, 25 Apr 2014 13:04:32 +0000 |
ttn pushed a commit to branch master
in repository elpa.
commit 3e20cfbc32dc949f0a1561adc0346855c3592d83
Author: Thien-Thi Nguyen <address@hidden>
Date: Fri Apr 25 13:18:16 2014 +0200
[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’.
---
packages/gnugo/gnugo.el | 19 ++++++++-----------
1 files changed, 8 insertions(+), 11 deletions(-)
diff --git a/packages/gnugo/gnugo.el b/packages/gnugo/gnugo.el
index 67fec6b..b54ce2b 100644
--- a/packages/gnugo/gnugo.el
+++ b/packages/gnugo/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))))
;;;---------------------------------------------------------------------------