From unknown Wed Jun 25 03:52:26 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#12771 <12771@debbugs.gnu.org> To: bug#12771 <12771@debbugs.gnu.org> Subject: Status: 24.2.50; Gomoku displays statistics in other buffers Reply-To: bug#12771 <12771@debbugs.gnu.org> Date: Wed, 25 Jun 2025 10:52:26 +0000 retitle 12771 24.2.50; Gomoku displays statistics in other buffers reassign 12771 emacs submitter 12771 Stephen Berman severity 12771 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Wed Oct 31 07:28:31 2012 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." From debbugs-submit-bounces@debbugs.gnu.org Wed Oct 31 22:28:39 2012 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. From unknown Wed Jun 25 03:52:26 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Thu, 29 Nov 2012 12:24:03 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator