changeset 44792:4648f6129f7f

(gamegrid-add-score-with-update-game-score): Handle the case where we're already viewing the score file.
author Colin Walters <walters@gnu.org>
date Tue, 23 Apr 2002 20:24:40 +0000
parents 3969f8273bc8
children e3a600209db7
files lisp/play/gamegrid.el
diffstat 1 files changed, 8 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/play/gamegrid.el	Tue Apr 23 20:24:25 2002 +0000
+++ b/lisp/play/gamegrid.el	Tue Apr 23 20:24:40 2002 +0000
@@ -450,8 +450,14 @@
 	  (error "Failed to update game score file"))
       (kill-buffer errbuf))
     (save-excursion
-      (find-file-read-only-other-window target))))
-	
+      (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))))))
+
 (defun gamegrid-add-score-insecure (file score)
   (save-excursion
     (setq file (expand-file-name file temporary-file-directory))