]> git.eshelyaron.com Git - emacs.git/commitdiff
(gamegrid-add-score-with-update-game-score-1): Jump to the line where new score
authorEli Zaretskii <eliz@gnu.org>
Sat, 3 Mar 2007 12:18:56 +0000 (12:18 +0000)
committerEli Zaretskii <eliz@gnu.org>
Sat, 3 Mar 2007 12:18:56 +0000 (12:18 +0000)
has been uploaded.

lisp/ChangeLog
lisp/play/gamegrid.el

index f53ec074cbbce5af9e4a7142f256ddcf6bc64fd2..df19625578d7508f6be3346dee3df62d1f9f289f 100644 (file)
@@ -1,3 +1,12 @@
+2007-03-03  Christopher Allan Webber  <cwebber@dustycloud.org>  (tiny change)
+
+       * play/gamegrid.el (gamegrid-add-score-with-update-game-score-1):
+       jump to the line where new score has been uploaded.
+
+       * play/tetris.el (tetris-move-bottom, tetris-move-left)
+       (tetris-move-right, tetris-rotate-prev, tetris-rotate-next): Do
+       nothing when the game is paused.
+
 2007-03-03  Carsten Dominik  <dominik@science.uva.nl>
 
        * textmodes/org.el (org-set-tags): Prevent slipping of point during
index 1a2b8c31ef44e2661a34990c449a48c6891e4200..a5689e6f0eaf774584b0512bc7ea2ecd8731e741 100644 (file)
@@ -514,7 +514,17 @@ FILE is created there."
 
 (defun gamegrid-add-score-with-update-game-score-1 (file target score)
   (let ((default-directory "/")
-       (errbuf (generate-new-buffer " *update-game-score loss*")))
+       (errbuf (generate-new-buffer " *update-game-score loss*"))
+        (marker-string (concat
+                       (user-full-name)
+                       " <"
+                       (cond ((fboundp 'user-mail-address)
+                              (user-mail-address))
+                             ((boundp 'user-mail-address)
+                              user-mail-address)
+                             (t ""))
+                       ">  "
+                       (current-time-string))))
     ;; This can be called from a timer, so enable local quits.
     (with-local-quit
       (apply
@@ -529,28 +539,25 @@ FILE is created there."
                (file-name-directory target))
         file
         (int-to-string score)
-        (concat
-         (user-full-name)
-         " <"
-         (cond ((fboundp 'user-mail-address)
-                (user-mail-address))
-               ((boundp 'user-mail-address)
-                user-mail-address)
-               (t ""))
-         ">  "
-         (current-time-string))))))
+        marker-string))))
     (if (buffer-modified-p errbuf)
        (progn
          (display-buffer errbuf)
          (error "Failed to update game score file"))
       (kill-buffer errbuf))
     (let ((buf (find-buffer-visiting target)))
-      (if buf
-         (progn
-           (with-current-buffer buf
-             (revert-buffer nil t nil))
-           (display-buffer buf))
-       (find-file-read-only-other-window target)))))
+      (save-excursion
+        (if buf
+           (progn
+             (switch-to-buffer buf)
+             (revert-buffer nil t nil)
+             (display-buffer buf))
+         (find-file-read-only target))
+        (goto-char (point-min))
+        (search-forward (concat (int-to-string score)
+                               " " (user-login-name) " "
+                               marker-string))
+        (beginning-of-line)))))
 
 (defun gamegrid-add-score-insecure (file score &optional directory)
   (save-excursion