Commit dcec69ee authored by Colin Walters's avatar Colin Walters
Browse files

Fix previous change.

parent 98418dba
......@@ -407,7 +407,17 @@ static char *noname[] = {
(defun gamegrid-add-score (file score)
"Add the current score to the high score file."
(let ((result nil)
(errbuf (generate-new-buffer " *update-game-score loss*")))
(errbuf (generate-new-buffer " *update-game-score loss*"))
(target (if game-score-directory
(let ((f (expand-file-name "~/.emacs.d/games")))
(unless (eq (car-safe (file-attributes f))
(make-directory f))
(setq f (expand-file-name file f))
(unless (file-exists-p f)
(write-region "" nil f nil 'silent nil 'excl))
(let ((default-directory "/"))
......@@ -426,14 +436,14 @@ static char *noname[] = {
(t ""))
"> "
(if (buffer-modified-p errbuf)
(display-buffer errbuf)
(error "Failed to update game score file"))
(kill-buffer errbuf))))
(kill-buffer errbuf))
(find-file-read-only-other-window (expand-file-name file game-score-directory))))
(find-file-read-only-other-window target))))
;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment