summaryrefslogtreecommitdiff
path: root/lisp/play/gamegrid.el
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2007-03-03 12:18:56 +0000
committerEli Zaretskii <eliz@gnu.org>2007-03-03 12:18:56 +0000
commit94430ab7fd416800665b3d38f05b7c6ab4c9c8a5 (patch)
tree7c8e4c6e28a86aa8339050489cdb9baac7ccb109 /lisp/play/gamegrid.el
parent297a6dcaff55833a5eed29dc47d37a854d9fe80e (diff)
downloademacs-94430ab7fd416800665b3d38f05b7c6ab4c9c8a5.tar.gz
(gamegrid-add-score-with-update-game-score-1): Jump to the line where new score
has been uploaded.
Diffstat (limited to 'lisp/play/gamegrid.el')
-rw-r--r--lisp/play/gamegrid.el41
1 files changed, 24 insertions, 17 deletions
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."
(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