emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/play/gamegrid.el


From: Richard M . Stallman
Subject: [Emacs-diffs] Changes to emacs/lisp/play/gamegrid.el
Date: Sat, 16 Jul 2005 14:34:22 -0400

Index: emacs/lisp/play/gamegrid.el
diff -c emacs/lisp/play/gamegrid.el:1.20 emacs/lisp/play/gamegrid.el:1.21
*** emacs/lisp/play/gamegrid.el:1.20    Mon Jul  4 17:04:18 2005
--- emacs/lisp/play/gamegrid.el Sat Jul 16 18:34:22 2005
***************
*** 179,187 ****
  
  (defun gamegrid-make-mono-tty-face ()
    (let ((face (make-face 'gamegrid-mono-tty-face)))
!     (condition-case nil
!       (set-face-property face 'reverse t)
!       (error nil))
      face))
  
  (defun gamegrid-make-color-tty-face (color)
--- 179,185 ----
  
  (defun gamegrid-make-mono-tty-face ()
    (let ((face (make-face 'gamegrid-mono-tty-face)))
!     (set-face-inverse-video-p face t)
      face))
  
  (defun gamegrid-make-color-tty-face (color)
***************
*** 298,304 ****
           'emacs-tty)))
  
  (defun gamegrid-set-display-table ()
!   (if (fboundp 'specifierp)
        (add-spec-to-specifier current-display-table
                             gamegrid-display-table
                             (current-buffer)
--- 296,302 ----
           'emacs-tty)))
  
  (defun gamegrid-set-display-table ()
!   (if (featurep 'xemacs)
        (add-spec-to-specifier current-display-table
                             gamegrid-display-table
                             (current-buffer)
***************
*** 409,415 ****
  
  (defun gamegrid-set-timer (delay)
    (if gamegrid-timer
!       (if (featurep 'itimer)
          (set-itimer-restart gamegrid-timer delay)
        (timer-set-time gamegrid-timer
                        (list (aref gamegrid-timer 1)
--- 407,413 ----
  
  (defun gamegrid-set-timer (delay)
    (if gamegrid-timer
!       (if (fboundp 'set-itimer-restart)
          (set-itimer-restart gamegrid-timer delay)
        (timer-set-time gamegrid-timer
                        (list (aref gamegrid-timer 1)
***************
*** 475,499 ****
  ;;        FILE in the user's home directory.  There is presumably no
  ;;        shared game directory.
  
  (defun gamegrid-add-score-with-update-game-score (file score)
    (let* ((result nil) ;; What is this good for? -- os
!        (have-shared-game-dir
          (not (zerop (logand (file-modes
                               (expand-file-name "update-game-score"
                                                 exec-directory))
                              #o4000)))))
      (cond ((file-name-absolute-p file)
           (gamegrid-add-score-insecure file score))
!         ((and have-shared-game-dir
                (file-exists-p (expand-file-name file 
shared-game-score-directory)))
           ;; Use the setuid "update-game-score" program to update a
           ;; system-wide score file.
!          (gamegrid-add-score-with-update-game-score-1
            (expand-file-name file shared-game-score-directory) score))
          ;; Else: Add the score to a score file in the user's home
          ;; directory.
!         (have-shared-game-dir
!          ;; If `have-shared-game-dir' is non-nil, then
           ;; "update-gamescore" program is setuid, so don't use it.
           (unless (file-exists-p
                    (directory-file-name gamegrid-user-score-file-directory))
--- 473,499 ----
  ;;        FILE in the user's home directory.  There is presumably no
  ;;        shared game directory.
  
+ (defvar gamegrid-shared-game-dir)
+ 
  (defun gamegrid-add-score-with-update-game-score (file score)
    (let* ((result nil) ;; What is this good for? -- os
!        (gamegrid-shared-game-dir
          (not (zerop (logand (file-modes
                               (expand-file-name "update-game-score"
                                                 exec-directory))
                              #o4000)))))
      (cond ((file-name-absolute-p file)
           (gamegrid-add-score-insecure file score))
!         ((and gamegrid-shared-game-dir
                (file-exists-p (expand-file-name file 
shared-game-score-directory)))
           ;; Use the setuid "update-game-score" program to update a
           ;; system-wide score file.
!          (gamegrid-add-score-with-update-game-score-1 file
            (expand-file-name file shared-game-score-directory) score))
          ;; Else: Add the score to a score file in the user's home
          ;; directory.
!         (gamegrid-shared-game-dir
!          ;; If `gamegrid-shared-game-dir' is non-nil, then
           ;; "update-gamescore" program is setuid, so don't use it.
           (unless (file-exists-p
                    (directory-file-name gamegrid-user-score-file-directory))
***************
*** 509,517 ****
                 (setq f (expand-file-name file f))
                 (unless (file-exists-p f)
                   (write-region "" nil f nil 'silent nil 'excl)))
!              (gamegrid-add-score-with-update-game-score-1 f score))))))
  
! (defun gamegrid-add-score-with-update-game-score-1 (target score)
    (let ((default-directory "/")
        (errbuf (generate-new-buffer " *update-game-score loss*")))
      (apply
--- 509,517 ----
                 (setq f (expand-file-name file f))
                 (unless (file-exists-p f)
                   (write-region "" nil f nil 'silent nil 'excl)))
!              (gamegrid-add-score-with-update-game-score-1 file f score))))))
  
! (defun gamegrid-add-score-with-update-game-score-1 (file target score)
    (let ((default-directory "/")
        (errbuf (generate-new-buffer " *update-game-score loss*")))
      (apply
***************
*** 521,527 ****
         (expand-file-name "update-game-score" exec-directory)
         nil errbuf nil
         "-m" (int-to-string gamegrid-score-file-length)
!        "-d" (if have-shared-game-dir
                (expand-file-name shared-game-score-directory)
              (file-name-directory target))
         file
--- 521,527 ----
         (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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]