emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[ELPA-diffs] ELPA branch, master, updated. 3ce7e03656204ec93d6de42cdbb14


From: Stefan Monnier
Subject: [ELPA-diffs] ELPA branch, master, updated. 3ce7e03656204ec93d6de42cdbb14beaaa23aa4d
Date: Fri, 10 Jan 2014 13:53:59 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "ELPA".

The branch, master has been updated
       via  3ce7e03656204ec93d6de42cdbb14beaaa23aa4d (commit)
       via  a2ad712048b34296b15d371a46ca89611831faf2 (commit)
      from  13e0d3fb8052812a7477dea7ec1a335918de0820 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 3ce7e03656204ec93d6de42cdbb14beaaa23aa4d
Merge: a2ad712 13e0d3f
Author: Stefan Monnier <address@hidden>
Date:   Fri Jan 10 08:53:45 2014 -0500

    Merge branch 'master' of git+ssh://git.sv.gnu.org/srv/git/emacs/elpa


commit a2ad712048b34296b15d371a46ca89611831faf2
Author: Stefan Monnier <address@hidden>
Date:   Fri Jan 10 08:53:33 2014 -0500

    * wpuzzle.el: Minor cleanup.  Run checkdoc-current-buffer.
    
    (100secwp-high-score-file): Use expand-file-name.
    (100secwp-add): Remove redundant `progn'.
    (100secwp-retrieve-high-score, 100secwp-end-game): Don't use find-file.

diff --git a/packages/wpuzzle/wpuzzle.el b/packages/wpuzzle/wpuzzle.el
index 5602c72..5a1d05e 100644
--- a/packages/wpuzzle/wpuzzle.el
+++ b/packages/wpuzzle/wpuzzle.el
@@ -22,7 +22,7 @@
 
 ;;; Commentary:
 
-;; Find as many word as possible in a 100 seconds. Words are scored by
+;; Find as many word as possible in a 100 seconds.  Words are scored by
 ;; length and the scrablle letter value.
 
 ;; M-x 100secwp to start the game
@@ -41,7 +41,7 @@
 
 ;; Use ELPA
 
-;; install aspell english dictionary. On Ubuntu or Debian type the following:
+;; install aspell english dictionary.  On Ubuntu or Debian type the following:
 
 ;; sudo apt-get install aspell aspell-en
 
@@ -67,10 +67,6 @@
 
 ;; search for TODO within the file
 
-;;;; VERSION
-
-;; version 1
-
 ;;; Code:
 
 (require 'thingatpt)
@@ -86,11 +82,11 @@
   "A directory for storing game high score.")
 
 (defvar 100secwp-high-score-file
-  (concat 100secwp-high-score-directory 100secwp-high-score-buffer)
+  (expand-file-name 100secwp-high-score-buffer 100secwp-high-score-directory)
   "Full path to file used for storing game high score.")
 
 (defvar 100secwp-buffer "*100secwp*"
-  "Game buffer")
+  "Game buffer.")
 
 (defvar 100secwp-state
   '((deck-letter)
@@ -141,7 +137,7 @@
 
 (defmacro 100secwp-add (place number)
   "Append number PLACE with CHAR."
-  `(progn (setf ,place (+ ,place ,number))))
+  `(setf ,place (+ ,place ,number)))
 
 (defmacro 100secwp-append (place element)
   "Append to list PLACE with ELEMENT."
@@ -341,17 +337,16 @@ The resulting list contains all items that appear in 
LIST1 but not LIST2."
 (defun 100secwp-retrieve-high-score ()
   (when (not (file-exists-p 100secwp-high-score-directory))
     (make-directory 100secwp-high-score-directory))
-  (save-window-excursion
-    (let ((buffer (find-file 100secwp-high-score-file)) high-score)
-      (goto-char (point-min))
-      (setq high-score
-            (if (word-at-point)
-                (string-to-number (word-at-point))
-              (erase-buffer)
-              (insert "0")
-              (save-buffer) 0))
-      (kill-buffer buffer)
-      high-score)))
+  (with-current-buffer (find-file-noselect 100secwp-high-score-file)
+    (goto-char (point-min))
+    (prog1
+        (if (word-at-point)
+            (string-to-number (word-at-point))
+          (erase-buffer)
+          (insert "0")
+          (save-buffer)
+          0)
+      (kill-buffer))))
 
 (defun 100secwp-end-game ()
   (let ((max-length 1)
@@ -369,14 +364,14 @@ The resulting list contains all items that appear in 
LIST1 but not LIST2."
               (int-to-string score) "\n")
       (when (> (100secwp-state score) (100secwp-retrieve-high-score))
         (insert "\nCongratulation, you beat the high score!\n")
-        (save-window-excursion
-          ;; TODO there is duplication with 100secwp-retrieve-high-score
-          ;; maybe it could be refactored in one function setter and getter
-          (let ((buffer (find-file 100secwp-high-score-file)))
-            (erase-buffer)
-            (insert (int-to-string score))
-            (save-buffer)
-            (kill-buffer buffer)))))))
+        ;; TODO there is duplication with 100secwp-retrieve-high-score
+        ;; maybe it could be refactored in one function setter and getter.
+        (with-current-buffer
+            (find-file-noselect 100secwp-high-score-file)
+          (erase-buffer)
+          (insert (int-to-string score))
+          (save-buffer)
+          (kill-buffer))))))
 
 (defun 100secwp-read-input ()
   "Read input from player."
@@ -436,3 +431,6 @@ Press any key to start." 100secwp-time-limit 
100secwp-time-limit))
 ;; Local Variables:
 ;; compile-command: "make"
 ;; End:
+
+(provide 'wpuzzle)
+;;; wpuzzle.el ends here

-----------------------------------------------------------------------

Summary of changes:
 packages/wpuzzle/wpuzzle.el |   54 ++++++++++++++++++++----------------------
 1 files changed, 26 insertions(+), 28 deletions(-)


hooks/post-receive
-- 
ELPA



reply via email to

[Prev in Thread] Current Thread [Next in Thread]