diff options
| author | Lars Ingebrigtsen | 2019-06-19 23:59:54 +0200 |
|---|---|---|
| committer | Lars Ingebrigtsen | 2019-06-20 12:51:38 +0200 |
| commit | 1f6e6ee4f78457dca0165773b964874229005e9c (patch) | |
| tree | c28436f62d6e09cc854ccabbe9da5376ec387430 | |
| parent | ec45664d281e343035f2162e7f9d76754d110423 (diff) | |
| download | emacs-1f6e6ee4f78457dca0165773b964874229005e9c.tar.gz emacs-1f6e6ee4f78457dca0165773b964874229005e9c.zip | |
Remove XEmacs and old Emacs compat code from gamegrid.el
* lisp/play/gamegrid.el (gamegrid-event-x, gamegrid-event-y)
(gamegrid-make-glyph, image-size, gamegrid-initialize-display)
(gamegrid-start-timer, gamegrid-set-timer)
(gamegrid-kill-timer)
(gamegrid-add-score-with-update-game-score-1)
(gamegrid-add-score-insecure): Removed XEmacs compat code.
(gamegrid-characterp, gamegrid-set-display-table): Removed functions.
| -rw-r--r-- | lisp/play/gamegrid.el | 69 |
1 files changed, 13 insertions, 56 deletions
diff --git a/lisp/play/gamegrid.el b/lisp/play/gamegrid.el index 54eeafd2b53..2d19c145b0a 100644 --- a/lisp/play/gamegrid.el +++ b/lisp/play/gamegrid.el | |||
| @@ -240,20 +240,11 @@ format." | |||
| 240 | 240 | ||
| 241 | ;; ;;;;;;;;;;;;;;;; miscellaneous functions ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | 241 | ;; ;;;;;;;;;;;;;;;; miscellaneous functions ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
| 242 | 242 | ||
| 243 | (defsubst gamegrid-characterp (arg) | ||
| 244 | (if (fboundp 'characterp) | ||
| 245 | (characterp arg) | ||
| 246 | (integerp arg))) | ||
| 247 | |||
| 248 | (defsubst gamegrid-event-x (event) | 243 | (defsubst gamegrid-event-x (event) |
| 249 | (if (fboundp 'event-x) | 244 | (car (posn-col-row (event-end event)))) |
| 250 | (event-x event) | ||
| 251 | (car (posn-col-row (event-end event))))) | ||
| 252 | 245 | ||
| 253 | (defsubst gamegrid-event-y (event) | 246 | (defsubst gamegrid-event-y (event) |
| 254 | (if (fboundp 'event-y) | 247 | (cdr (posn-col-row (event-end event)))) |
| 255 | (event-y event) | ||
| 256 | (cdr (posn-col-row (event-end event))))) | ||
| 257 | 248 | ||
| 258 | ;; ;;;;;;;;;;;;; display functions ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | 249 | ;; ;;;;;;;;;;;;; display functions ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
| 259 | 250 | ||
| @@ -365,7 +356,7 @@ format." | |||
| 365 | (defun gamegrid-make-glyph (data-spec-list color-spec-list) | 356 | (defun gamegrid-make-glyph (data-spec-list color-spec-list) |
| 366 | (let ((data (gamegrid-match-spec-list data-spec-list)) | 357 | (let ((data (gamegrid-match-spec-list data-spec-list)) |
| 367 | (color (gamegrid-match-spec-list color-spec-list))) | 358 | (color (gamegrid-match-spec-list color-spec-list))) |
| 368 | (cond ((gamegrid-characterp data) | 359 | (cond ((characterp data) |
| 369 | (vector data)) | 360 | (vector data)) |
| 370 | ((eq data 'colorize) | 361 | ((eq data 'colorize) |
| 371 | (gamegrid-colorize-glyph color)) | 362 | (gamegrid-colorize-glyph color)) |
| @@ -399,15 +390,6 @@ format." | |||
| 399 | (t | 390 | (t |
| 400 | 'emacs-tty))) | 391 | 'emacs-tty))) |
| 401 | 392 | ||
| 402 | (defun gamegrid-set-display-table () | ||
| 403 | (if (featurep 'xemacs) | ||
| 404 | (add-spec-to-specifier current-display-table | ||
| 405 | gamegrid-display-table | ||
| 406 | (current-buffer) | ||
| 407 | nil | ||
| 408 | 'remove-locale) | ||
| 409 | (setq buffer-display-table gamegrid-display-table))) | ||
| 410 | |||
| 411 | (declare-function image-size "image.c" (spec &optional pixels frame)) | 393 | (declare-function image-size "image.c" (spec &optional pixels frame)) |
| 412 | 394 | ||
| 413 | (defun gamegrid-setup-default-font () | 395 | (defun gamegrid-setup-default-font () |
| @@ -444,7 +426,7 @@ format." | |||
| 444 | (aset gamegrid-face-table c face) | 426 | (aset gamegrid-face-table c face) |
| 445 | (aset gamegrid-display-table c glyph))) | 427 | (aset gamegrid-display-table c glyph))) |
| 446 | (gamegrid-setup-default-font) | 428 | (gamegrid-setup-default-font) |
| 447 | (gamegrid-set-display-table) | 429 | (setq buffer-display-table gamegrid-display-table) |
| 448 | (setq cursor-type nil)) | 430 | (setq cursor-type nil)) |
| 449 | 431 | ||
| 450 | 432 | ||
| @@ -506,34 +488,19 @@ format." | |||
| 506 | 488 | ||
| 507 | (defun gamegrid-start-timer (period func) | 489 | (defun gamegrid-start-timer (period func) |
| 508 | (setq gamegrid-timer | 490 | (setq gamegrid-timer |
| 509 | (if (featurep 'xemacs) | 491 | (run-with-timer period period func (current-buffer)))) |
| 510 | (start-itimer "Gamegrid" | ||
| 511 | func | ||
| 512 | period | ||
| 513 | period | ||
| 514 | nil | ||
| 515 | t | ||
| 516 | (current-buffer)) | ||
| 517 | (run-with-timer period | ||
| 518 | period | ||
| 519 | func | ||
| 520 | (current-buffer))))) | ||
| 521 | 492 | ||
| 522 | (defun gamegrid-set-timer (delay) | 493 | (defun gamegrid-set-timer (delay) |
| 523 | (if gamegrid-timer | 494 | (if gamegrid-timer |
| 524 | (if (fboundp 'set-itimer-restart) | 495 | (timer-set-time gamegrid-timer |
| 525 | (set-itimer-restart gamegrid-timer delay) | 496 | (list (aref gamegrid-timer 1) |
| 526 | (timer-set-time gamegrid-timer | 497 | (aref gamegrid-timer 2) |
| 527 | (list (aref gamegrid-timer 1) | 498 | (aref gamegrid-timer 3)) |
| 528 | (aref gamegrid-timer 2) | 499 | delay))) |
| 529 | (aref gamegrid-timer 3)) | ||
| 530 | delay)))) | ||
| 531 | 500 | ||
| 532 | (defun gamegrid-kill-timer () | 501 | (defun gamegrid-kill-timer () |
| 533 | (if gamegrid-timer | 502 | (if gamegrid-timer |
| 534 | (if (featurep 'xemacs) | 503 | (cancel-timer gamegrid-timer)) |
| 535 | (delete-itimer gamegrid-timer) | ||
| 536 | (cancel-timer gamegrid-timer))) | ||
| 537 | (setq gamegrid-timer nil)) | 504 | (setq gamegrid-timer nil)) |
| 538 | 505 | ||
| 539 | ;; ;;;;;;;;;;;;;;; high score functions ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | 506 | ;; ;;;;;;;;;;;;;;; high score functions ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
| @@ -627,13 +594,7 @@ FILE is created there." | |||
| 627 | (errbuf (generate-new-buffer " *update-game-score loss*")) | 594 | (errbuf (generate-new-buffer " *update-game-score loss*")) |
| 628 | (marker-string (concat | 595 | (marker-string (concat |
| 629 | (user-full-name) | 596 | (user-full-name) |
| 630 | " <" | 597 | " <" user-mail-address "> " |
| 631 | (cond ((fboundp 'user-mail-address) | ||
| 632 | (user-mail-address)) | ||
| 633 | ((boundp 'user-mail-address) | ||
| 634 | user-mail-address) | ||
| 635 | (t "")) | ||
| 636 | "> " | ||
| 637 | (current-time-string)))) | 598 | (current-time-string)))) |
| 638 | ;; This can be called from a timer, so enable local quits. | 599 | ;; This can be called from a timer, so enable local quits. |
| 639 | (with-local-quit | 600 | (with-local-quit |
| @@ -681,11 +642,7 @@ FILE is created there." | |||
| 681 | score | 642 | score |
| 682 | (current-time-string) | 643 | (current-time-string) |
| 683 | (user-full-name) | 644 | (user-full-name) |
| 684 | (cond ((fboundp 'user-mail-address) | 645 | user-mail-address)) |
| 685 | (user-mail-address)) | ||
| 686 | ((boundp 'user-mail-address) | ||
| 687 | user-mail-address) | ||
| 688 | (t "")))) | ||
| 689 | (sort-fields 1 (point-min) (point-max)) | 646 | (sort-fields 1 (point-min) (point-max)) |
| 690 | (reverse-region (point-min) (point-max)) | 647 | (reverse-region (point-min) (point-max)) |
| 691 | (goto-char (point-min)) | 648 | (goto-char (point-min)) |