summaryrefslogtreecommitdiff
path: root/lisp/play/gamegrid.el
diff options
context:
space:
mode:
authorColin Walters <walters@gnu.org>2002-05-03 19:30:58 +0000
committerColin Walters <walters@gnu.org>2002-05-03 19:30:58 +0000
commit3d43e48ad4698987107b10078357b9e8e43d50b0 (patch)
treec36e8dbcf1962116e12c9332a7ea0c7951e32a4e /lisp/play/gamegrid.el
parentf28a17956870fc77c1926ad319a93711d260fc45 (diff)
downloademacs-3d43e48ad4698987107b10078357b9e8e43d50b0.tar.gz
(gamegrid-user-score-file-directory): New variable.
(gamegrid-add-score-with-update-game-score): Use `shared-game-score-directory'. Correctly handle non-setuid case.
Diffstat (limited to 'lisp/play/gamegrid.el')
-rw-r--r--lisp/play/gamegrid.el15
1 files changed, 12 insertions, 3 deletions
diff --git a/lisp/play/gamegrid.el b/lisp/play/gamegrid.el
index 054358940d0..de005b40891 100644
--- a/lisp/play/gamegrid.el
+++ b/lisp/play/gamegrid.el
@@ -61,6 +61,11 @@
(defvar gamegrid-score-file-length 50
"Number of high scores to keep")
+(defvar gamegrid-user-score-file-directory "~/.emacs.d/games"
+ "A directory for game scores which can't be shared.
+If Emacs was built without support for shared game scores, then this
+directory will be used.")
+
(make-variable-buffer-local 'gamegrid-use-glyphs)
(make-variable-buffer-local 'gamegrid-use-color)
(make-variable-buffer-local 'gamegrid-font)
@@ -421,8 +426,9 @@ static char *noname[] = {
exec-directory))
#o4000))))
(target (if have-shared-game-dir
- (expand-file-name file game-score-directory)
- (let ((f (expand-file-name game-score-directory)))
+ (expand-file-name file shared-game-score-directory)
+ (let ((f (expand-file-name
+ gamegrid-user-score-file-directory)))
(when (file-writable-p f)
(unless (eq (car-safe (file-attributes f))
t)
@@ -439,7 +445,10 @@ static char *noname[] = {
(expand-file-name "update-game-score" exec-directory)
nil errbuf nil
"-m" (int-to-string gamegrid-score-file-length)
- "-d" (expand-file-name game-score-directory) file
+ "-d" (if have-shared-game-dir
+ (expand-file-name shared-game-score-directory)
+ (file-name-directory target))
+ file
(int-to-string score)
(concat
(user-full-name)