From b4b096e4209b289cbb7a2a1d58422c0dd767ca7d Mon Sep 17 00:00:00 2001 From: Stephen Berman Date: Thu, 1 Nov 2012 10:25:08 +0800 Subject: [PATCH] Fix for gomoku-display-statistics. * play/gomoku.el (gomoku-display-statistics): Update mode line only if in Gomoku buffer; don't capitalize "won". Fixes: debbugs:12771 --- lisp/ChangeLog | 5 +++++ lisp/play/gomoku.el | 22 ++++++++++++---------- 2 files changed, 17 insertions(+), 10 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index dc928c35672..ab73a61d9e6 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2012-11-01 Stephen Berman + + * play/gomoku.el (gomoku-display-statistics): Update mode line + only if in Gomoku buffer; don't capitalize "won" (Bug#12771). + 2012-10-31 Martin Rudalics * window.el (quit-restore-window): If the window has been diff --git a/lisp/play/gomoku.el b/lisp/play/gomoku.el index 3dba99d98d5..90f021ab265 100644 --- a/lisp/play/gomoku.el +++ b/lisp/play/gomoku.el @@ -1054,16 +1054,18 @@ If the game is finished, this command requests for another game." (defun gomoku-display-statistics () "Obnoxiously display some statistics about previous games in mode line." - ;; We store this string in the mode-line-process local variable. - ;; This is certainly not the cleanest way out ... - (setq mode-line-process - (format ": Won %d, lost %d%s" - gomoku-number-of-human-wins - gomoku-number-of-emacs-wins - (if (zerop gomoku-number-of-draws) - "" - (format ", drew %d" gomoku-number-of-draws)))) - (force-mode-line-update)) + ;; Update mode line only if Gomoku buffer is current (Bug#12771). + (when (string-equal (buffer-name) gomoku-buffer-name) + ;; We store this string in the mode-line-process local variable. + ;; This is certainly not the cleanest way out ... + (setq mode-line-process + (format ": won %d, lost %d%s" + gomoku-number-of-human-wins + gomoku-number-of-emacs-wins + (if (zerop gomoku-number-of-draws) + "" + (format ", drew %d" gomoku-number-of-draws)))) + (force-mode-line-update))) (defun gomoku-switch-to-window () "Find or create the Gomoku buffer, and display it." -- 2.11.4.GIT