From: Dieter Deyke <dieter.deyke@gmail.com>
To: emacs-devel@gnu.org
Subject: [PATCH] elpa/packages/sokoban/sokoban.el
Date: Thu, 07 Feb 2019 11:51:56 +0100 [thread overview]
Message-ID: <87zhr7zx9v.fsf@gmail.com> (raw)
===== Commit message: =====
* sokoban.el: Switch to lexical-binding
Switch to lexical-binding
Unrelated additional changes:
- Do not make variables buffer-local for easier debugging
===== Patch: =====
diff --git a/sokoban.el b/sokoban.el
index 4698450..f4a3369 100644
--- a/sokoban.el
+++ b/sokoban.el
@@ -1,10 +1,10 @@
-;;; sokoban.el --- Implementation of Sokoban for Emacs.
+;;; sokoban.el --- Implementation of Sokoban for Emacs. -*- lexical-binding: t -*-
-;; Copyright (C) 1998, 2013, 2017 Free Software Foundation, Inc.
+;; Copyright (C) 1998, 2013, 2017, 2019 Free Software Foundation, Inc.
;; Author: Glynn Clements <glynn.clements@xemacs.org>
;; Maintainer: Dieter Deyke <dieter.deyke@gmail.com>
-;; Version: 1.4.6
+;; Version: 1.4.7
;; Package-Requires: ((emacs "23.1"))
;; Created: 1997-09-11
;; Keywords: games
@@ -82,18 +82,7 @@
(and (file-exists-p file) file))
(expand-file-name "sokoban.levels" data-directory))))
-(defvar sokoban-width)
-(defvar sokoban-height)
-
-(defvar sokoban-buffer-width)
-(defvar sokoban-buffer-height)
-
-(defvar sokoban-score-x)
-(defvar sokoban-score-y)
-
-(defvar sokoban-level-data nil)
-
-(defconst sokoban-state-filename (locate-user-emacs-file "sokoban-state"))
+(defvar sokoban-state-filename (locate-user-emacs-file "sokoban-state"))
;; ;;;;;;;;;;;;; constants ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -477,28 +466,24 @@ static char * player_on_target_xpm[] = {
;; ;;;;;;;;;;;;; variables ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+(defvar sokoban-width)
+(defvar sokoban-height)
+(defvar sokoban-buffer-width)
+(defvar sokoban-buffer-height)
+(defvar sokoban-score-x)
+(defvar sokoban-score-y)
+(defvar sokoban-level-data nil)
(defvar sokoban-level 0)
-(make-variable-buffer-local 'sokoban-level)
(defvar sokoban-level-map nil)
-(make-variable-buffer-local 'sokoban-level-map)
(defvar sokoban-targets 0)
-(make-variable-buffer-local 'sokoban-targets)
(defvar sokoban-x 0)
-(make-variable-buffer-local 'sokoban-x)
(defvar sokoban-y 0)
-(make-variable-buffer-local 'sokoban-y)
(defvar sokoban-moves 0)
-(make-variable-buffer-local 'sokoban-moves)
(defvar sokoban-pushes 0)
-(make-variable-buffer-local 'sokoban-pushes)
(defvar sokoban-done 0)
-(make-variable-buffer-local 'sokoban-done)
(defvar sokoban-mouse-x 0)
-(make-variable-buffer-local 'sokoban-mouse-x)
(defvar sokoban-mouse-y 0)
-(make-variable-buffer-local 'sokoban-mouse-y)
(defvar sokoban-undo-list nil)
-(make-variable-buffer-local 'sokoban-undo-list)
;; ;;;;;;;;;;;;; keymaps ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -650,7 +635,7 @@ static char * player_on_target_xpm[] = {
(let ((y sokoban-score-y))
(dolist (string (list (format "Moves: %05d" sokoban-moves)
(format "Pushes: %05d" sokoban-pushes)
- (format "Done: %d/%d"
+ (format "Done: %d/%d "
sokoban-done
sokoban-targets)))
(let* ((len (length string)))
@@ -762,9 +747,8 @@ static char * player_on_target_xpm[] = {
(incf sokoban-done))
(sokoban-add-push dx dy)
(cond ((= sokoban-done sokoban-targets)
- (let ((level sokoban-level))
- (with-temp-file sokoban-state-filename
- (print level (current-buffer))))
+ (with-temp-file sokoban-state-filename
+ (print sokoban-level (current-buffer)))
(sit-for 3)
(sokoban-next-level))))))))))
--
Dieter Deyke
mailto:dieter.deyke@gmail.com
Get my Gnupg key:
gpg --keyserver keys.gnupg.net --recv-keys B116EA20
next reply other threads:[~2019-02-07 10:51 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-07 10:51 Dieter Deyke [this message]
2019-02-07 12:53 ` [PATCH] elpa/packages/sokoban/sokoban.el Clément Pit-Claudel
2019-02-07 14:42 ` Eli Zaretskii
2019-02-07 15:57 ` Dieter Deyke
2019-02-07 16:08 ` Clément Pit-Claudel
2019-02-07 16:11 ` Dieter Deyke
2019-02-07 16:55 ` Andreas Schwab
2019-02-08 3:34 ` Stefan Monnier
2019-02-07 14:56 ` Stefan Monnier
-- strict thread matches above, loose matches on Subject: below --
2019-02-12 12:30 Dieter Deyke
2017-07-25 11:36 Dieter Deyke
2017-07-25 14:24 ` Stefan Monnier
2017-07-16 14:14 Dieter Deyke
2017-07-16 16:01 ` Stefan Monnier
2017-07-16 16:57 ` Dieter Deyke
2017-07-09 13:36 Dieter Deyke
2017-07-09 14:15 ` Eli Zaretskii
2017-07-09 14:34 ` Dieter Deyke
2017-07-09 14:52 ` Eli Zaretskii
2017-07-11 15:17 ` Stefan Monnier
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87zhr7zx9v.fsf@gmail.com \
--to=dieter.deyke@gmail.com \
--cc=emacs-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.