diff options
| author | Stephen Berman | 2012-11-01 10:25:08 +0800 |
|---|---|---|
| committer | Chong Yidong | 2012-11-01 10:25:08 +0800 |
| commit | b4b096e4209b289cbb7a2a1d58422c0dd767ca7d (patch) | |
| tree | 6d362e1db906331ed6166b2c9bf962d5ff610082 | |
| parent | df43dd5361372fffb5d1618228a9c6a55db96169 (diff) | |
| download | emacs-b4b096e4209b289cbb7a2a1d58422c0dd767ca7d.tar.gz emacs-b4b096e4209b289cbb7a2a1d58422c0dd767ca7d.zip | |
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
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | 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 @@ | |||
| 1 | 2012-11-01 Stephen Berman <stephen.berman@gmx.net> | ||
| 2 | |||
| 3 | * play/gomoku.el (gomoku-display-statistics): Update mode line | ||
| 4 | only if in Gomoku buffer; don't capitalize "won" (Bug#12771). | ||
| 5 | |||
| 1 | 2012-10-31 Martin Rudalics <rudalics@gmx.at> | 6 | 2012-10-31 Martin Rudalics <rudalics@gmx.at> |
| 2 | 7 | ||
| 3 | * window.el (quit-restore-window): If the window has been | 8 | * 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." | |||
| 1054 | 1054 | ||
| 1055 | (defun gomoku-display-statistics () | 1055 | (defun gomoku-display-statistics () |
| 1056 | "Obnoxiously display some statistics about previous games in mode line." | 1056 | "Obnoxiously display some statistics about previous games in mode line." |
| 1057 | ;; We store this string in the mode-line-process local variable. | 1057 | ;; Update mode line only if Gomoku buffer is current (Bug#12771). |
| 1058 | ;; This is certainly not the cleanest way out ... | 1058 | (when (string-equal (buffer-name) gomoku-buffer-name) |
| 1059 | (setq mode-line-process | 1059 | ;; We store this string in the mode-line-process local variable. |
| 1060 | (format ": Won %d, lost %d%s" | 1060 | ;; This is certainly not the cleanest way out ... |
| 1061 | gomoku-number-of-human-wins | 1061 | (setq mode-line-process |
| 1062 | gomoku-number-of-emacs-wins | 1062 | (format ": won %d, lost %d%s" |
| 1063 | (if (zerop gomoku-number-of-draws) | 1063 | gomoku-number-of-human-wins |
| 1064 | "" | 1064 | gomoku-number-of-emacs-wins |
| 1065 | (format ", drew %d" gomoku-number-of-draws)))) | 1065 | (if (zerop gomoku-number-of-draws) |
| 1066 | (force-mode-line-update)) | 1066 | "" |
| 1067 | (format ", drew %d" gomoku-number-of-draws)))) | ||
| 1068 | (force-mode-line-update))) | ||
| 1067 | 1069 | ||
| 1068 | (defun gomoku-switch-to-window () | 1070 | (defun gomoku-switch-to-window () |
| 1069 | "Find or create the Gomoku buffer, and display it." | 1071 | "Find or create the Gomoku buffer, and display it." |