From unknown Wed Jun 25 03:55:40 2025 X-Loop: help-debbugs@gnu.org Subject: bug#12771: 24.2.50; Gomoku displays statistics in other buffers Resent-From: Stephen Berman Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 31 Oct 2012 11:29:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 12771 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 12771@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.135168291125091 (code B ref -1); Wed, 31 Oct 2012 11:29:02 +0000 Received: (at submit) by debbugs.gnu.org; 31 Oct 2012 11:28:31 +0000 Received: from localhost ([127.0.0.1]:40881 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TTWTH-0006Wd-BP for submit@debbugs.gnu.org; Wed, 31 Oct 2012 07:28:31 -0400 Received: from eggs.gnu.org ([208.118.235.92]:54265) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TTWTF-0006WW-3p for submit@debbugs.gnu.org; Wed, 31 Oct 2012 07:28:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TTWQc-0004zR-UK for submit@debbugs.gnu.org; Wed, 31 Oct 2012 07:25:52 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.2 Received: from lists.gnu.org ([208.118.235.17]:37326) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TTWQc-0004wu-Qs for submit@debbugs.gnu.org; Wed, 31 Oct 2012 07:25:46 -0400 Received: from eggs.gnu.org ([208.118.235.92]:34989) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TTWOq-0001Zq-JB for bug-gnu-emacs@gnu.org; Wed, 31 Oct 2012 07:24:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TTWOf-0003rx-RV for bug-gnu-emacs@gnu.org; Wed, 31 Oct 2012 07:23:56 -0400 Received: from mailout-de.gmx.net ([213.165.64.23]:52876) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1TTWOf-0003qH-GF for bug-gnu-emacs@gnu.org; Wed, 31 Oct 2012 07:23:45 -0400 Received: (qmail invoked by alias); 31 Oct 2012 11:23:42 -0000 Received: from i59F5416E.versanet.de (EHLO rosalinde.fritz.box) [89.245.65.110] by mail.gmx.net (mp069) with SMTP; 31 Oct 2012 12:23:42 +0100 X-Authenticated: #20778731 X-Provags-ID: V01U2FsdGVkX19b+UoNte1bIU/nZJ//anoJCUfEKQvrEZxKsLTZ0I aZ/MBIEw9NJibt From: Stephen Berman Date: Wed, 31 Oct 2012 12:23:41 +0100 Message-ID: <87hapalwaq.fsf@rosalinde.fritz.box> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Y-GMX-Trusted: 0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 208.118.235.17 X-Spam-Score: -4.2 (----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -4.2 (----) 0. emacs -Q 1. M-x gomoku 2. Answer the question to start playing, or type C-g. 3. C-x k to kill the *Gomoku* buffer. => Now the current buffer is *scratch*; note the mode line text: " U:**- *scratch* All L5 (Lisp Interaction) " 4. M-x gomoku => The mode line of *scratch* now looks like this: " U:**- *scratch* All L5 (Lisp Interaction: Won 0, lost 0) " As a result of killing the *Gomoku* buffer in step 3, the gomoku command in step 4 tests gomoku-game-in-progress, and because its value is still t (since the game was not finished), gomoku-terminate-game is called, which in turn calls gomoku-display-statistics, which changes the mode line of the current buffer, which is still *scratch* here. The patch below prevents this by ensuring the mode line is only changed if the *Gomoku* buffer is current. In addition, the patch changes "Won" to "won", which I believe conforms to standard practice in English for use of capitalization after a colon (cf. http://en.wikipedia.org/wiki/Colon_%28punctuation%29) and looks better to me. (However, the patch doesn't change the use of mode-line-process for displaying the statistics, despite the comment acknowledging that this is not clean.) In GNU Emacs 24.2.50.1 (x86_64-suse-linux-gnu, GTK+ Version 3.4.4) of 2012-10-27 on rosalinde Bzr revision: 110689 eliz@gnu.org-20121027112126-wznlfl8la6gwukh6 Windowing system distributor `The X.Org Foundation', version 11.0.11203000 System Description: openSUSE 12.2 (x86_64) 2012-10-31 Stephen Berman * play/gomoku.el (gomoku-display-statistics): Update mode line only when Gomoku buffer is current. Don't capitalize "won", to conform to standard practice. (Bug#xxxxxx) === modified file 'lisp/play/gomoku.el' --- lisp/play/gomoku.el 2012-09-01 01:04:26 +0000 +++ lisp/play/gomoku.el 2012-10-31 10:25:10 +0000 @@ -1054,16 +1054,18 @@ (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 when Gomoku buffer is current (bug#xxxxxx). + (when (string= (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." From unknown Wed Jun 25 03:55:40 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.428 (Entity 5.428) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Stephen Berman Subject: bug#12771: closed (Re: bug#12771: 24.2.50; Gomoku displays statistics in other buffers) Message-ID: References: <87bofif49d.fsf@gnu.org> <87hapalwaq.fsf@rosalinde.fritz.box> X-Gnu-PR-Message: they-closed 12771 X-Gnu-PR-Package: emacs Reply-To: 12771@debbugs.gnu.org Date: Thu, 01 Nov 2012 02:29:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1351736942-16210-1" This is a multi-part message in MIME format... ------------=_1351736942-16210-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #12771: 24.2.50; Gomoku displays statistics in other buffers which was filed against the emacs package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 12771@debbugs.gnu.org. --=20 12771: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D12771 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1351736942-16210-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 12771-done) by debbugs.gnu.org; 1 Nov 2012 02:28:39 +0000 Received: from localhost ([127.0.0.1]:42129 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TTkWM-0004Cq-KL for submit@debbugs.gnu.org; Wed, 31 Oct 2012 22:28:38 -0400 Received: from mail-pb0-f44.google.com ([209.85.160.44]:58109) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TTkWK-0004Cj-Ix for 12771-done@debbugs.gnu.org; Wed, 31 Oct 2012 22:28:37 -0400 Received: by mail-pb0-f44.google.com with SMTP id ro8so1408187pbb.3 for <12771-done@debbugs.gnu.org>; Wed, 31 Oct 2012 19:25:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type; bh=n7NWkHeawc2CfmBl659BEKCkdXhLMBTcUNw3dpSiuT4=; b=gDfn+kYCPtR4lYsHCgN84n2EwnMX2nFA75Wyqo8I5Og3aTGn0MTTsdKgrKHzdNshPK kn8Hf+6UsxeEYcQYs83coca+29yR+Dpnk4MlrzMFIvhvq0kgMiI80WEoCkKqKvR2FNJU nd6BWFDetntqI0oPUSRzMEgHyt2qrEBwSGeQarIDzDLkQq85cEkj9moPDd5HqD6NosYW 7SM71FN0W2nU/DS3/6C3Oowzn68rpLkceytBMqExebiwoxgqUTXAbaXfShfJ+R0wasJi yJStDS77Z9PyqiK7fznAjJp2GdtQxuKMXj5bx+PgGpvnGHpmNNCRdmN4hcti7wDjZ6Zl NmBg== Received: by 10.68.204.103 with SMTP id kx7mr10146585pbc.33.1351736755607; Wed, 31 Oct 2012 19:25:55 -0700 (PDT) Received: from ulysses ([155.69.17.190]) by mx.google.com with ESMTPS id a4sm3126260pax.12.2012.10.31.19.25.52 (version=SSLv3 cipher=OTHER); Wed, 31 Oct 2012 19:25:54 -0700 (PDT) From: Chong Yidong To: Stephen Berman Subject: Re: bug#12771: 24.2.50; Gomoku displays statistics in other buffers References: <87hapalwaq.fsf@rosalinde.fritz.box> Date: Thu, 01 Nov 2012 10:25:50 +0800 In-Reply-To: <87hapalwaq.fsf@rosalinde.fritz.box> (Stephen Berman's message of "Wed, 31 Oct 2012 12:23:41 +0100") Message-ID: <87bofif49d.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.1 (/) X-Debbugs-Envelope-To: 12771-done Cc: 12771-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: 0.1 (/) Stephen Berman writes: > As a result of killing the *Gomoku* buffer in step 3, the gomoku command > in step 4 tests gomoku-game-in-progress, and because its value is still > t (since the game was not finished), gomoku-terminate-game is called, > which in turn calls gomoku-display-statistics, which changes the mode > line of the current buffer, which is still *scratch* here. The patch > below prevents this by ensuring the mode line is only changed if the > *Gomoku* buffer is current. Committed, thanks. ------------=_1351736942-16210-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 31 Oct 2012 11:28:31 +0000 Received: from localhost ([127.0.0.1]:40881 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TTWTH-0006Wd-BP for submit@debbugs.gnu.org; Wed, 31 Oct 2012 07:28:31 -0400 Received: from eggs.gnu.org ([208.118.235.92]:54265) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TTWTF-0006WW-3p for submit@debbugs.gnu.org; Wed, 31 Oct 2012 07:28:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TTWQc-0004zR-UK for submit@debbugs.gnu.org; Wed, 31 Oct 2012 07:25:52 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.2 Received: from lists.gnu.org ([208.118.235.17]:37326) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TTWQc-0004wu-Qs for submit@debbugs.gnu.org; Wed, 31 Oct 2012 07:25:46 -0400 Received: from eggs.gnu.org ([208.118.235.92]:34989) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TTWOq-0001Zq-JB for bug-gnu-emacs@gnu.org; Wed, 31 Oct 2012 07:24:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TTWOf-0003rx-RV for bug-gnu-emacs@gnu.org; Wed, 31 Oct 2012 07:23:56 -0400 Received: from mailout-de.gmx.net ([213.165.64.23]:52876) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1TTWOf-0003qH-GF for bug-gnu-emacs@gnu.org; Wed, 31 Oct 2012 07:23:45 -0400 Received: (qmail invoked by alias); 31 Oct 2012 11:23:42 -0000 Received: from i59F5416E.versanet.de (EHLO rosalinde.fritz.box) [89.245.65.110] by mail.gmx.net (mp069) with SMTP; 31 Oct 2012 12:23:42 +0100 X-Authenticated: #20778731 X-Provags-ID: V01U2FsdGVkX19b+UoNte1bIU/nZJ//anoJCUfEKQvrEZxKsLTZ0I aZ/MBIEw9NJibt From: Stephen Berman To: bug-gnu-emacs@gnu.org Subject: 24.2.50; Gomoku displays statistics in other buffers Date: Wed, 31 Oct 2012 12:23:41 +0100 Message-ID: <87hapalwaq.fsf@rosalinde.fritz.box> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Y-GMX-Trusted: 0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 208.118.235.17 X-Spam-Score: -4.2 (----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -4.2 (----) 0. emacs -Q 1. M-x gomoku 2. Answer the question to start playing, or type C-g. 3. C-x k to kill the *Gomoku* buffer. => Now the current buffer is *scratch*; note the mode line text: " U:**- *scratch* All L5 (Lisp Interaction) " 4. M-x gomoku => The mode line of *scratch* now looks like this: " U:**- *scratch* All L5 (Lisp Interaction: Won 0, lost 0) " As a result of killing the *Gomoku* buffer in step 3, the gomoku command in step 4 tests gomoku-game-in-progress, and because its value is still t (since the game was not finished), gomoku-terminate-game is called, which in turn calls gomoku-display-statistics, which changes the mode line of the current buffer, which is still *scratch* here. The patch below prevents this by ensuring the mode line is only changed if the *Gomoku* buffer is current. In addition, the patch changes "Won" to "won", which I believe conforms to standard practice in English for use of capitalization after a colon (cf. http://en.wikipedia.org/wiki/Colon_%28punctuation%29) and looks better to me. (However, the patch doesn't change the use of mode-line-process for displaying the statistics, despite the comment acknowledging that this is not clean.) In GNU Emacs 24.2.50.1 (x86_64-suse-linux-gnu, GTK+ Version 3.4.4) of 2012-10-27 on rosalinde Bzr revision: 110689 eliz@gnu.org-20121027112126-wznlfl8la6gwukh6 Windowing system distributor `The X.Org Foundation', version 11.0.11203000 System Description: openSUSE 12.2 (x86_64) 2012-10-31 Stephen Berman * play/gomoku.el (gomoku-display-statistics): Update mode line only when Gomoku buffer is current. Don't capitalize "won", to conform to standard practice. (Bug#xxxxxx) === modified file 'lisp/play/gomoku.el' --- lisp/play/gomoku.el 2012-09-01 01:04:26 +0000 +++ lisp/play/gomoku.el 2012-10-31 10:25:10 +0000 @@ -1054,16 +1054,18 @@ (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 when Gomoku buffer is current (bug#xxxxxx). + (when (string= (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." ------------=_1351736942-16210-1--