;;; gomoku.el --- Gomoku game between you and Emacs
-;; Copyright (C) 1988, 1994, 1996, 2001-2012 Free Software Foundation, Inc.
+;; Copyright (C) 1988, 1994, 1996, 2001-2013 Free Software Foundation,
+;; Inc.
;; Author: Philippe Schnoebelen <phs@lsv.ens-cachan.fr>
;; Maintainer: FSF
(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."
(move-to-column (+ gomoku-x-offset
(* gomoku-square-width (1- gomoku-board-width)))))
-(random t)
-
(provide 'gomoku)
;;; gomoku.el ends here