GNU bug report logs - #72185
31.0.50; Indicate most recent score in game high score tables

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: "Peder O. Klingenberg" <peder@HIDDEN>; Keywords: patch; dated Thu, 18 Jul 2024 21:21:01 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.
Added tag(s) patch. Request was from "Peder O. Klingenberg" <peder@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 18 Jul 2024 21:20:04 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Jul 18 17:20:04 2024
Received: from localhost ([127.0.0.1]:38190 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sUYXi-0006dE-SO
	for submit <at> debbugs.gnu.org; Thu, 18 Jul 2024 17:20:04 -0400
Received: from lists.gnu.org ([209.51.188.17]:52090)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <peder@HIDDEN>) id 1sUYXf-0006ck-Kw
 for submit <at> debbugs.gnu.org; Thu, 18 Jul 2024 17:20:01 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10])
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <peder@HIDDEN>)
 id 1sUYXa-0008EW-UJ
 for bug-gnu-emacs@HIDDEN; Thu, 18 Jul 2024 17:19:55 -0400
Received: from s17612523434.blix.com ([176.125.234.34]
 helo=castor.klingenberg.no)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <peder@HIDDEN>)
 id 1sUYXY-0001uK-5p
 for bug-gnu-emacs@HIDDEN; Thu, 18 Jul 2024 17:19:54 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
 d=klingenberg.no; s=20200407; h=Content-Type:MIME-Version:Message-ID:Date:
 Subject:To:From:Sender:Reply-To:Cc:Content-Transfer-Encoding:Content-ID:
 Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc
 :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:
 List-Subscribe:List-Post:List-Owner:List-Archive;
 bh=DSgj2FuPM3uJ1ajeBwKNQ2QcmwFJYmiovntZKlFswGY=; b=mnHsLI/yjCPmQrBZ42+FHzF2mO
 TCPgIAzwj8uIicttoiNzRk338nVMXBaEzPT39SxHKVBDRs05xjYHOy/UOQL03/beVc2khydgsAFPj
 pXt15DsLYm2HYxYBy2lPphQo3djyZwqO83e500ROEQm0+svfgDRv3NOs9nDSAcuEky1W8YLOCplXO
 qA2Vvnckyd/LcwVAa8rE6+YTvPL5Pw9KNXBre4N170tq69wOeIWLopoa7PqITrKRm046oQG009t8S
 D4ddH7sobB0XTDgBPlDXIfo3Ab9EFaSFW68jLuWIu+8BzkWQdbbgR+70LZwXezktk1CYqHDvunxUj
 yDBW2wQQ==;
Received: from 77.18.49.139.tmi.telenormobil.no ([77.18.49.139] helo=PedersHP)
 by castor.klingenberg.no with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92)
 (envelope-from <peder@HIDDEN>) id 1sUYAN-0001sG-Jp
 for bug-gnu-emacs@HIDDEN; Thu, 18 Jul 2024 22:55:56 +0200
From: "Peder O. Klingenberg" <peder@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: 31.0.50; Indicate most recent score in game high score tables
X-Debbugs-Cc: 
Date: Thu, 18 Jul 2024 22:55:51 +0200
Message-ID: <87bk2uzag8.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
Received-SPF: pass client-ip=176.125.234.34; envelope-from=peder@HIDDEN;
 helo=castor.klingenberg.no
X-Spam_score_int: -20
X-Spam_score: -2.1
X-Spam_bar: --
X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001,
 SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -1.3 (-)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.3 (--)

--=-=-=
Content-Type: text/plain


In this age of pointless zoom calls, I would go crazy without M-x tetris
or M-x snake to pass the time.  Because I'm a sad old bastard with no
friends, I mean because I have the computational power of what used to
be a supercomputer for my sole use, I have the high scores stored in my
user directory, not shared, and the usernames are identical for all
fifty entries.

I'm competitive, and would like to see how I did when a game ends, but
that means manually scanning the list to find the most recent date, or
if the game window is still visible, the line matching my score.

It would be a slight improvement if the point in the buffer displaying
the score file moved to the most recently added score.

Attached is a patch to accomplish this.


In GNU Emacs 31.0.50 (build 1, x86_64-pc-linux-gnu, X toolkit, cairo
 version 1.16.0, Xaw3d scroll bars) of 2024-07-17 built on PedersHP
Repository revision: 3a790abd869ddadc343710deb0c4368227ba6611
Repository branch: master
Windowing system distributor 'HC-Consult', version 11.0.12009000
System Description: Ubuntu 20.04.6 LTS

Configured using:
 'configure --with-x-toolkit=lucid --with-native-compilation
 --with-tree-sitter --with-small-ja-dic --prefix=/usr/local/emacs-git
 CC=gcc-10'

Configured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG
LCMS2 LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 M17N_FLT MODULES NATIVE_COMP
NOTIFY INOTIFY PDUMPER PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF
TOOLKIT_SCROLL_BARS TREE_SITTER WEBP X11 XAW3D XDBE XIM XINPUT2 XPM
LUCID ZLIB

Important settings:
  value of $LANG: C.UTF-8
  locale-coding-system: utf-8-unix

Major mode: ELisp/l

Minor modes in effect:
  display-line-numbers-mode: t
  smartparens-strict-mode: t
  smartparens-mode: t
  which-key-mode: t
  marginalia-mode: t
  csv-field-index-mode: t
  sly-symbol-completion-mode: t
  pyvenv-mode: t
  beacon-mode: t
  global-git-gutter-mode: t
  git-gutter-mode: t
  bug-reference-prog-mode: t
  global-git-commit-mode: t
  magit-auto-revert-mode: t
  auto-revert-mode: t
  server-mode: t
  global-corfu-mode: t
  corfu-mode: t
  override-global-mode: t
  vertico-mode: t
  savehist-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  eldoc-mode: t
  show-paren-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  minibuffer-regexp-mode: t
  column-number-mode: t
  line-number-mode: t
  transient-mark-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t

Load-path shadows:
/home/pok/.emacs.d/elpa/emacsql-sqlite-20240623.1340/emacsql-sqlite hides /home/pok/.emacs.d/elpa/emacsql-20240714.1824/emacsql-sqlite
/home/pok/.emacs.d/elpa/bind-key-20230203.2004/bind-key hides /usr/local/emacs-git/share/emacs/31.0.50/lisp/bind-key
/home/pok/.emacs.d/elpa/transient-20240713.2102/transient hides /usr/local/emacs-git/share/emacs/31.0.50/lisp/transient
/home/pok/.emacs.d/elpa/which-key-20240620.2145/which-key hides /usr/local/emacs-git/share/emacs/31.0.50/lisp/which-key
/home/pok/.emacs.d/elpa/use-package-20230426.2324/use-package hides /usr/local/emacs-git/share/emacs/31.0.50/lisp/use-package/use-package
/home/pok/.emacs.d/elpa/use-package-20230426.2324/use-package-diminish hides /usr/local/emacs-git/share/emacs/31.0.50/lisp/use-package/use-package-diminish
/home/pok/.emacs.d/elpa/use-package-20230426.2324/use-package-core hides /usr/local/emacs-git/share/emacs/31.0.50/lisp/use-package/use-package-core
/home/pok/.emacs.d/elpa/use-package-20230426.2324/use-package-jump hides /usr/local/emacs-git/share/emacs/31.0.50/lisp/use-package/use-package-jump
/home/pok/.emacs.d/elpa/use-package-20230426.2324/use-package-lint hides /usr/local/emacs-git/share/emacs/31.0.50/lisp/use-package/use-package-lint
/home/pok/.emacs.d/elpa/use-package-20230426.2324/use-package-delight hides /usr/local/emacs-git/share/emacs/31.0.50/lisp/use-package/use-package-delight
/home/pok/.emacs.d/elpa/use-package-20230426.2324/use-package-ensure hides /usr/local/emacs-git/share/emacs/31.0.50/lisp/use-package/use-package-ensure
/home/pok/.emacs.d/elpa/use-package-20230426.2324/use-package-bind-key hides /usr/local/emacs-git/share/emacs/31.0.50/lisp/use-package/use-package-bind-key
/home/pok/.emacs.d/elpa/eglot-20220726.1405/eglot hides /usr/local/emacs-git/share/emacs/31.0.50/lisp/progmodes/eglot
/home/pok/.emacs.d/elpa/csharp-mode-20221126.2005/csharp-mode hides /usr/local/emacs-git/share/emacs/31.0.50/lisp/progmodes/csharp-mode

Features:
(shadow footnote ecomplete mail-extr emacsbug magit-patch magit-subtree
magit-gitignore magit-ediff ediff ediff-merg ediff-mult ediff-wind
ediff-diff ediff-help ediff-init ediff-util goto-addr rect ispell
vc-annotate log-view magit-extras emacsql-sqlite-builtin sqlite
whitespace misearch multi-isearch mule-util display-line-numbers
smartparens-config smartparens-org smartparens-python
smartparens-markdown smartparens-text smartparens-c smartparens loadhist
wheatgrass-theme which-key marginalia php-mode mode-local consult-imenu
consult-yasnippet consult speedbar ezimage dframe cc-mode cc-fonts
cc-guess cc-menus cc-cmds cc-styles cc-align php-face php php-project
projectile lisp-mnt cc-engine cc-vars cc-defs csv-mode sort multi-vterm
vterm magit-bookmark bookmark tramp trampver tramp-integration
tramp-message tramp-compat xdg tramp-loaddefs face-remap term disp-table
ehelp vterm-module term/xterm xterm restclient sly sly-completion
sly-buttons sly-messages sly-common apropos arc-mode archive-mode
hyperspec gradle-mode groovy-mode debbugs soap-client rng-xsd rng-dt
rng-util xsd-regexp xml virtualenvwrapper gud highlight-indentation
flymake company-capf company-jedi jedi-core python-environment epc
ctable concurrent deferred company help-fns radix-tree elpy elpy-rpc
pyvenv eshell esh-cmd esh-ext esh-proc esh-opt esh-io esh-arg esh-module
esh-module-loaddefs esh-util elpy-shell elpy-profile elpy-django s
elpy-refactor ido hideshow etags fileloop generator xref
markdown-preview-eww yasnippet easy-kill ace-window avy beacon
git-timemachine vc-git git-gutter forge-repos forge-tablist hl-line
forge-topics forge-commands forge-semi forge-bitbucket buck forge-gogs
gogs forge-gitea gtea forge-gitlab glab forge-github ghub-graphql treepy
gsexp ghub url-http url-gw nsm url-auth let-alist gnutls forge-notify
forge-revnote forge-pullreq forge-issue forge-topic yaml parse-time
iso8601 eieio-custom bug-reference forge-post markdown-mode color
forge-repo forge forge-core forge-db closql emacsql-sqlite-common
emacsql emacsql-compiler eieio-base magit-submodule magit-blame
magit-stash magit-reflog magit-bisect magit-push magit-pull magit-fetch
magit-clone magit-remote magit-commit magit-sequence magit-notes
magit-worktree magit-tag magit-merge magit-branch magit-reset
magit-files magit-refs magit-status magit magit-repos magit-apply
magit-wip magit-log which-func imenu magit-diff smerge-mode diff
diff-mode track-changes git-commit log-edit message sendmail yank-media
puny dired dired-loaddefs rfc822 mml mml-sec epa derived epg rfc6068
epg-config gnus-util mm-decode mm-bodies mm-encode mail-parse rfc2231
rfc2047 rfc2045 mm-util ietf-drums mail-prsvr mailabbrev mail-utils
gmm-utils mailheader pcvs-util add-log magit-core magit-autorevert
autorevert filenotify magit-margin magit-transient magit-process
with-editor server magit-mode benchmark magit-git magit-base
magit-section cursor-sensor crm dash exec-path-from-shell try
xterm-color ob-python python project ob-lisp ob-perl ob-shell shell
org-tempo tempo rg files-x vc vc-dispatcher rg-info-hack advice rg-menu
transient rg-ibuffer rg-result wgrep-rg wgrep rg-history rg-header
ibuf-ext ibuffer ibuffer-loaddefs grep compile text-property-search
cus-edit pp cus-load wid-edit orderless corfu edmacro kmacro
use-package-bind-key bind-key easy-mmode vertico compat savehist comp
comp-cstr cl-extra help-mode warnings comp-run comp-common org ob
ob-tangle ob-ref ob-lob ob-table ob-exp org-macro org-src sh-script smie
treesit executable ob-comint org-pcomplete pcomplete comint ansi-osc
ansi-color ring org-list org-footnote org-faces org-entities time-date
noutline outline ob-emacs-lisp ob-core ob-eval org-cycle org-table ol rx
org-fold org-fold-core org-keys oc org-loaddefs thingatpt find-func
cal-menu calendar cal-loaddefs org-version org-compat org-macs
format-spec use-package-ensure use-package-core finder-inf
bbdb-autoloads beacon-autoloads consult-eglot-autoloads
consult-yasnippet-autoloads corfu-autoloads csv-mode-autoloads
debbugs-autoloads easy-kill-autoloads eglot-autoloads elpy-autoloads
company-autoloads emacsql-sqlite-autoloads embark-consult-autoloads
consult-autoloads embark-autoloads exec-path-from-shell-autoloads
forge-autoloads closql-autoloads ghub-autoloads git-gutter-autoloads
git-timemachine-autoloads groovy-mode-autoloads concurrent-autoloads
marginalia-autoloads markdown-mode-autoloads multi-vterm-autoloads
f-autoloads csharp-mode-autoloads auto-complete-autoloads
flycheck-autoloads orderless-autoloads org-roam-autoloads
emacsql-autoloads ox-hugo-autoloads php-mode-autoloads popup-autoloads
restclient-autoloads rg-autoloads sly-autoloads smartparens-autoloads
tomelr-autoloads treemacs-icons-dired-autoloads treemacs-magit-autoloads
magit-autoloads pcase magit-section-autoloads git-commit-autoloads
transient-autoloads treemacs-projectile-autoloads treemacs-autoloads
posframe-autoloads ht-autoloads hydra-autoloads pfuture-autoloads
ace-window-autoloads avy-autoloads projectile-autoloads treepy-autoloads
use-package-autoloads bind-key-autoloads vertico-autoloads s-autoloads
dash-autoloads vterm-autoloads wgrep-autoloads which-key-autoloads info
with-editor-autoloads xterm-color-autoloads yaml-autoloads
yaml-mode-autoloads yasnippet-autoloads package browse-url url url-proxy
url-privacy url-expand url-methods url-history url-cookie
generate-lisp-file url-domsuf url-util mailcap url-handlers url-parse
auth-source cl-seq eieio eieio-core cl-macs icons password-cache json
subr-x map byte-opt gv bytecomp byte-compile url-vars cl-loaddefs cl-lib
rmc iso-transl tooltip cconv eldoc paren electric uniquify ediff-hook
vc-hooks lisp-float-type elisp-mode mwheel term/x-win x-win
term/common-win x-dnd touch-screen tool-bar dnd fontset image regexp-opt
fringe tabulated-list replace newcomment text-mode lisp-mode prog-mode
register page tab-bar menu-bar rfn-eshadow isearch easymenu timer select
scroll-bar mouse jit-lock font-lock syntax font-core term/tty-colors
frame minibuffer nadvice seq simple cl-generic indonesian philippine
cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao
korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech
european ethiopic indian cyrillic chinese composite emoji-zwj charscript
charprop case-table epa-hook jka-cmpr-hook help abbrev obarray oclosure
cl-preloaded button loaddefs theme-loaddefs faces cus-face macroexp
files window text-properties overlay sha1 md5 base64 format env
code-pages mule custom widget keymap hashtable-print-readable backquote
threads dbusbind inotify lcms2 dynamic-setting system-font-setting
font-render-setting cairo x-toolkit xinput2 x multi-tty move-toolbar
make-network-process native-compile emacs)

Memory information:
((conses 16 838068 144361) (symbols 48 52485 4)
 (strings 32 241377 10064) (string-bytes 1 7996317) (vectors 16 92598)
 (vector-slots 8 1099473 173070) (floats 8 561 2440)
 (intervals 56 6905 2129) (buffers 992 26))

...Peder...
-- 

--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
 filename=0001-Visualize-ranking-of-last-game-when-adding-scores.patch

From 3dd4aee83dfbdf44babecd8ad19f059779026eeb Mon Sep 17 00:00:00 2001
From: "Peder O. Klingenberg" <peder@HIDDEN>
Date: Thu, 18 Jul 2024 22:34:54 +0200
Subject: [PATCH] Visualize ranking of last game when adding scores

* lisp/play/gamegrid.el (gamegrid-add-score-insecure): Move point
to the score just added, or end of buffer if the new score did not
make the list.  Makes it easier to see where the last game ranked.
---
 lisp/play/gamegrid.el | 46 +++++++++++++++++++++++--------------------
 1 file changed, 25 insertions(+), 21 deletions(-)

diff --git a/lisp/play/gamegrid.el b/lisp/play/gamegrid.el
index a098d0f6f69..0089404d87a 100644
--- a/lisp/play/gamegrid.el
+++ b/lisp/play/gamegrid.el
@@ -639,27 +639,31 @@ gamegrid-add-score-with-update-game-score-1
 
 (defun gamegrid-add-score-insecure (file score &optional directory reverse)
   (save-excursion
-    (setq file (expand-file-name file (or directory
-					  temporary-file-directory)))
-    (unless (file-exists-p (file-name-directory file))
-      (make-directory (file-name-directory file) t))
-    (find-file-other-window file)
-    (setq buffer-read-only nil)
-    (goto-char (point-max))
-    (insert (format "%05d\t%s\t%s <%s>\n"
-		    score
-		    (current-time-string)
-		    (user-full-name)
-		    user-mail-address))
-    (sort-fields 1 (point-min) (point-max))
-    (unless reverse
-      (reverse-region (point-min) (point-max)))
-    (goto-char (point-min))
-    (forward-line gamegrid-score-file-length)
-    (delete-region (point) (point-max))
-    (setq buffer-read-only t)
-    (save-buffer)
-    (view-mode)))
+    (let ((score-line (format "%05d\t%s\t%s <%s>\n"
+		              score
+		              (current-time-string)
+		              (user-full-name)
+		              user-mail-address)))
+      (setq file (expand-file-name file (or directory
+					    temporary-file-directory)))
+      (unless (file-exists-p (file-name-directory file))
+        (make-directory (file-name-directory file) t))
+      (find-file-other-window file)
+      (setq buffer-read-only nil)
+      (goto-char (point-max))
+      (insert score-line)
+      (sort-fields 1 (point-min) (point-max))
+      (unless reverse
+        (reverse-region (point-min) (point-max)))
+      (goto-char (point-min))
+      (forward-line gamegrid-score-file-length)
+      (delete-region (point) (point-max))
+      (setq buffer-read-only t)
+      (save-buffer)
+      (view-mode)
+      (goto-char (point-min))
+      (when (search-forward score-line nil 'end)
+        (forward-line -1)))))
 
 
 ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-- 
2.25.1


--=-=-=--




Acknowledgement sent to "Peder O. Klingenberg" <peder@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#72185; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Thu, 18 Jul 2024 21:30:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.