unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#58002: 29.1: Sokoban: obsoletion warnings in gamegrid
@ 2022-09-22 10:06 Mattias Engdegård
  2022-09-22 12:29 ` Dieter Deyke
  0 siblings, 1 reply; 9+ messages in thread
From: Mattias Engdegård @ 2022-09-22 10:06 UTC (permalink / raw)
  To: 58002; +Cc: Dieter Deyke, Stefan Kangas

[-- Attachment #1: Type: text/plain, Size: 685 bytes --]

On Emacs master, starting Sokoban (from GNU ELPA) results in several warnings:

> Warning (gamegrid): Using obsolete XEmacs style "glyph"; convert to an Emacs image-spec instead

which apparently is from

> (defvar sokoban-target-options
>   `(((glyph
>       [xpm :data ,sokoban-target-xpm])
[...]

where (after some digging) it seems that the vector needs to be

      ((:type xpm :data ,sokoban-target-xpm :ascent center)))

somewhat non-intuitively, because of the slightly alarming line

> 	   (find-image data)) ;untested!

in gamegrid.el. Suggested patch attached.
Is this all correct and as desired? Does it break anything when using old Emacs versions?


[-- Attachment #2: sokoban-warning.diff --]
[-- Type: application/octet-stream, Size: 2120 bytes --]

diff --git a/sokoban.el b/sokoban.el
index 128d59ad98..710139b09f 100644
--- a/sokoban.el
+++ b/sokoban.el
@@ -403,7 +403,7 @@ static char * player_on_target_xpm[] = {
 
 (defvar sokoban-floor-options
   `(((glyph
-      [xpm :data ,sokoban-floor-xpm])
+      ((:type xpm :data ,sokoban-floor-xpm :ascent center)))
      (t ?\040))
     ((color-x color-x)
      (mono-x grid-x)
@@ -413,7 +413,7 @@ static char * player_on_target_xpm[] = {
 
 (defvar sokoban-target-options
   `(((glyph
-      [xpm :data ,sokoban-target-xpm])
+      ((:type xpm :data ,sokoban-target-xpm :ascent center)))
      ((mono-x mono-tty emacs-tty) ?\.)
      (t ?\040))
     ((color-x color-x)
@@ -424,7 +424,7 @@ static char * player_on_target_xpm[] = {
 
 (defvar sokoban-wall-options
   `(((glyph
-      [xpm :data ,sokoban-wall-xpm])
+      ((:type xpm :data ,sokoban-wall-xpm :ascent center)))
      (emacs-tty ?\X)
      (t ?\040))
     ((color-x color-x)
@@ -436,7 +436,7 @@ static char * player_on_target_xpm[] = {
 
 (defvar sokoban-block-options
   `(((glyph
-      [xpm :data ,sokoban-block-xpm])
+      ((:type xpm :data ,sokoban-block-xpm :ascent center)))
      ((mono-x mono-tty emacs-tty) ?\O)
      (t ?\040))
     ((color-x color-x)
@@ -447,7 +447,7 @@ static char * player_on_target_xpm[] = {
 
 (defvar sokoban-block-on-target-options
   `(((glyph
-      [xpm :data ,sokoban-block-on-target-xpm])
+      ((:type xpm :data ,sokoban-block-on-target-xpm :ascent center)))
      ((mono-x mono-tty emacs-tty) ?\O)
      (t ?\040))
     ((color-x color-x)
@@ -458,7 +458,7 @@ static char * player_on_target_xpm[] = {
 
 (defvar sokoban-player-options
   `(((glyph
-      [xpm :data ,sokoban-player-xpm])
+      ((:type xpm :data ,sokoban-player-xpm :ascent center)))
      (t ?\*))
     ((color-x color-x)
      (mono-x grid-x)
@@ -468,7 +468,7 @@ static char * player_on_target_xpm[] = {
 
 (defvar sokoban-player-on-target-options
   `(((glyph
-      [xpm :data ,sokoban-player-on-target-xpm])
+      ((:type xpm :data ,sokoban-player-on-target-xpm :ascent center)))
      (t ?\*))
     ((color-x color-x)
      (mono-x grid-x)

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2022-11-13 13:59 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-22 10:06 bug#58002: 29.1: Sokoban: obsoletion warnings in gamegrid Mattias Engdegård
2022-09-22 12:29 ` Dieter Deyke
2022-09-22 12:39   ` Mattias Engdegård
2022-09-22 12:54     ` Dieter Deyke
2022-09-22 14:01       ` Stefan Kangas
2022-09-23  8:56         ` Mattias Engdegård
2022-11-12 21:11       ` Stefan Kangas
2022-11-13  6:17         ` Dieter Deyke
2022-11-13 13:59           ` Stefan Kangas

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).