aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorColin Walters2002-04-10 23:16:45 +0000
committerColin Walters2002-04-10 23:16:45 +0000
commitdcec69ee9923ea6cc6ac8ab9b5e9a0b9224c2571 (patch)
tree6f666b78f47d7f2fc5612e837aa09348ffb80f6f
parent98418dbaa78b22098421efb6968a575948f19dad (diff)
downloademacs-dcec69ee9923ea6cc6ac8ab9b5e9a0b9224c2571.tar.gz
emacs-dcec69ee9923ea6cc6ac8ab9b5e9a0b9224c2571.zip
Fix previous change.
-rw-r--r--lisp/play/gamegrid.el28
1 files changed, 19 insertions, 9 deletions
diff --git a/lisp/play/gamegrid.el b/lisp/play/gamegrid.el
index ffb179d52d2..342b7a5cd14 100644
--- a/lisp/play/gamegrid.el
+++ b/lisp/play/gamegrid.el
@@ -407,7 +407,17 @@ static char *noname[] = {
407(defun gamegrid-add-score (file score) 407(defun gamegrid-add-score (file score)
408 "Add the current score to the high score file." 408 "Add the current score to the high score file."
409 (let ((result nil) 409 (let ((result nil)
410 (errbuf (generate-new-buffer " *update-game-score loss*"))) 410 (errbuf (generate-new-buffer " *update-game-score loss*"))
411 (target (if game-score-directory
412 file
413 (let ((f (expand-file-name "~/.emacs.d/games")))
414 (unless (eq (car-safe (file-attributes f))
415 t)
416 (make-directory f))
417 (setq f (expand-file-name file f))
418 (unless (file-exists-p f)
419 (write-region "" nil f nil 'silent nil 'excl))
420 f))))
411 (let ((default-directory "/")) 421 (let ((default-directory "/"))
412 (apply 422 (apply
413 'call-process 423 'call-process
@@ -426,14 +436,14 @@ static char *noname[] = {
426 user-mail-address) 436 user-mail-address)
427 (t "")) 437 (t ""))
428 "> " 438 "> "
429 (current-time-string))))) 439 (current-time-string))))))
430 (if (buffer-modified-p errbuf) 440 (if (buffer-modified-p errbuf)
431 (progn 441 (progn
432 (display-buffer errbuf) 442 (display-buffer errbuf)
433 (error "Failed to update game score file")) 443 (error "Failed to update game score file"))
434 (kill-buffer errbuf)))) 444 (kill-buffer errbuf))
435 (save-excursion 445 (save-excursion
436 (find-file-read-only-other-window (expand-file-name file game-score-directory)))) 446 (find-file-read-only-other-window target))))
437 447
438 448
439;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 449;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;