aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEli Zaretskii2007-03-03 12:18:56 +0000
committerEli Zaretskii2007-03-03 12:18:56 +0000
commit94430ab7fd416800665b3d38f05b7c6ab4c9c8a5 (patch)
tree7c8e4c6e28a86aa8339050489cdb9baac7ccb109
parent297a6dcaff55833a5eed29dc47d37a854d9fe80e (diff)
downloademacs-94430ab7fd416800665b3d38f05b7c6ab4c9c8a5.tar.gz
emacs-94430ab7fd416800665b3d38f05b7c6ab4c9c8a5.zip
(gamegrid-add-score-with-update-game-score-1): Jump to the line where new score
has been uploaded.
-rw-r--r--lisp/ChangeLog9
-rw-r--r--lisp/play/gamegrid.el41
2 files changed, 33 insertions, 17 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index f53ec074cbb..df19625578d 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,12 @@
12007-03-03 Christopher Allan Webber <cwebber@dustycloud.org> (tiny change)
2
3 * play/gamegrid.el (gamegrid-add-score-with-update-game-score-1):
4 jump to the line where new score has been uploaded.
5
6 * play/tetris.el (tetris-move-bottom, tetris-move-left)
7 (tetris-move-right, tetris-rotate-prev, tetris-rotate-next): Do
8 nothing when the game is paused.
9
12007-03-03 Carsten Dominik <dominik@science.uva.nl> 102007-03-03 Carsten Dominik <dominik@science.uva.nl>
2 11
3 * textmodes/org.el (org-set-tags): Prevent slipping of point during 12 * textmodes/org.el (org-set-tags): Prevent slipping of point during
diff --git a/lisp/play/gamegrid.el b/lisp/play/gamegrid.el
index 1a2b8c31ef4..a5689e6f0ea 100644
--- a/lisp/play/gamegrid.el
+++ b/lisp/play/gamegrid.el
@@ -514,7 +514,17 @@ FILE is created there."
514 514
515(defun gamegrid-add-score-with-update-game-score-1 (file target score) 515(defun gamegrid-add-score-with-update-game-score-1 (file target score)
516 (let ((default-directory "/") 516 (let ((default-directory "/")
517 (errbuf (generate-new-buffer " *update-game-score loss*"))) 517 (errbuf (generate-new-buffer " *update-game-score loss*"))
518 (marker-string (concat
519 (user-full-name)
520 " <"
521 (cond ((fboundp 'user-mail-address)
522 (user-mail-address))
523 ((boundp 'user-mail-address)
524 user-mail-address)
525 (t ""))
526 "> "
527 (current-time-string))))
518 ;; This can be called from a timer, so enable local quits. 528 ;; This can be called from a timer, so enable local quits.
519 (with-local-quit 529 (with-local-quit
520 (apply 530 (apply
@@ -529,28 +539,25 @@ FILE is created there."
529 (file-name-directory target)) 539 (file-name-directory target))
530 file 540 file
531 (int-to-string score) 541 (int-to-string score)
532 (concat 542 marker-string))))
533 (user-full-name)
534 " <"
535 (cond ((fboundp 'user-mail-address)
536 (user-mail-address))
537 ((boundp 'user-mail-address)
538 user-mail-address)
539 (t ""))
540 "> "
541 (current-time-string))))))
542 (if (buffer-modified-p errbuf) 543 (if (buffer-modified-p errbuf)
543 (progn 544 (progn
544 (display-buffer errbuf) 545 (display-buffer errbuf)
545 (error "Failed to update game score file")) 546 (error "Failed to update game score file"))
546 (kill-buffer errbuf)) 547 (kill-buffer errbuf))
547 (let ((buf (find-buffer-visiting target))) 548 (let ((buf (find-buffer-visiting target)))
548 (if buf 549 (save-excursion
549 (progn 550 (if buf
550 (with-current-buffer buf 551 (progn
551 (revert-buffer nil t nil)) 552 (switch-to-buffer buf)
552 (display-buffer buf)) 553 (revert-buffer nil t nil)
553 (find-file-read-only-other-window target))))) 554 (display-buffer buf))
555 (find-file-read-only target))
556 (goto-char (point-min))
557 (search-forward (concat (int-to-string score)
558 " " (user-login-name) " "
559 marker-string))
560 (beginning-of-line)))))
554 561
555(defun gamegrid-add-score-insecure (file score &optional directory) 562(defun gamegrid-add-score-insecure (file score &optional directory)
556 (save-excursion 563 (save-excursion