summaryrefslogtreecommitdiff
path: root/lisp/play/gamegrid.el
diff options
context:
space:
mode:
authorChong Yidong <cyd@stupidchicken.com>2007-01-28 19:40:31 +0000
committerChong Yidong <cyd@stupidchicken.com>2007-01-28 19:40:31 +0000
commitd33ca4d437218a26d9d85428b7046df19149535e (patch)
treead0456a09a99b51ca4c93b6aeaef742c6595f79e /lisp/play/gamegrid.el
parentd46b940851f2529a1ffd1cd198db2b158aa19b37 (diff)
downloademacs-d33ca4d437218a26d9d85428b7046df19149535e.tar.gz
(gamegrid-kill-timer): Cancel timer directly.
(gamegrid-add-score-with-update-game-score-1): Allow local quits when calling update-game-score program. Remove unnecessary save-excursion.
Diffstat (limited to 'lisp/play/gamegrid.el')
-rw-r--r--lisp/play/gamegrid.el63
1 files changed, 32 insertions, 31 deletions
diff --git a/lisp/play/gamegrid.el b/lisp/play/gamegrid.el
index 41f04ea27cb..1a2b8c31ef4 100644
--- a/lisp/play/gamegrid.el
+++ b/lisp/play/gamegrid.el
@@ -420,7 +420,7 @@ static unsigned char gamegrid_bits[] = {
(if gamegrid-timer
(if (featurep 'itimer)
(delete-itimer gamegrid-timer)
- (timer-set-time gamegrid-timer '(0 0 0) nil)))
+ (cancel-timer gamegrid-timer)))
(setq gamegrid-timer nil))
;; ;;;;;;;;;;;;;;; high score functions ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -515,41 +515,42 @@ 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*")))
- (apply
- 'call-process
- (append
- (list
- (expand-file-name "update-game-score" exec-directory)
- nil errbuf nil
- "-m" (int-to-string gamegrid-score-file-length)
- "-d" (if gamegrid-shared-game-dir
- (expand-file-name shared-game-score-directory)
- (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)))))
+ ;; This can be called from a timer, so enable local quits.
+ (with-local-quit
+ (apply
+ 'call-process
+ (append
+ (list
+ (expand-file-name "update-game-score" exec-directory)
+ nil errbuf nil
+ "-m" (int-to-string gamegrid-score-file-length)
+ "-d" (if gamegrid-shared-game-dir
+ (expand-file-name shared-game-score-directory)
+ (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))))))
(if (buffer-modified-p errbuf)
(progn
(display-buffer errbuf)
(error "Failed to update game score file"))
(kill-buffer errbuf))
- (save-excursion
- (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))))))
+ (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 &optional directory)
(save-excursion