Mercurial > emacs
comparison lisp/play/gomoku.el @ 21363:f1fc193b6958
Customized.
author | Stephen Eglen <stephen@gnu.org> |
---|---|
date | Sun, 05 Apr 1998 16:14:58 +0000 |
parents | 2f60572de4d1 |
children | 8d2bb5d1416a |
comparison
equal
deleted
inserted
replaced
21362:a45af443a262 | 21363:f1fc193b6958 |
---|---|
64 ;; parameters may be modified if you want to change the style exhibited by the | 64 ;; parameters may be modified if you want to change the style exhibited by the |
65 ;; program. | 65 ;; program. |
66 | 66 |
67 ;;; Code: | 67 ;;; Code: |
68 | 68 |
69 (defgroup gomoku nil | |
70 "Gomoku game between you and Emacs." | |
71 :prefix "gomoku-" | |
72 :group 'games) | |
69 ;;; | 73 ;;; |
70 ;;; GOMOKU MODE AND KEYMAP. | 74 ;;; GOMOKU MODE AND KEYMAP. |
71 ;;; | 75 ;;; |
72 (defvar gomoku-mode-hook nil | 76 (defcustom gomoku-mode-hook nil |
73 "If non-nil, its value is called on entry to Gomoku mode.") | 77 "If non-nil, its value is called on entry to Gomoku mode. |
78 One useful value to include is `turn-on-font-lock' to highlight the pieces." | |
79 :type 'hook | |
80 :group 'gomoku) | |
74 | 81 |
75 (defvar gomoku-mode-map nil | 82 (defvar gomoku-mode-map nil |
76 "Local keymap to use in Gomoku mode.") | 83 "Local keymap to use in Gomoku mode.") |
77 | 84 |
78 (if gomoku-mode-map nil | 85 (if gomoku-mode-map nil |
131 gomoku-mode-map (current-global-map)) | 138 gomoku-mode-map (current-global-map)) |
132 (substitute-key-definition 'advertised-undo 'gomoku-human-takes-back | 139 (substitute-key-definition 'advertised-undo 'gomoku-human-takes-back |
133 gomoku-mode-map (current-global-map))) | 140 gomoku-mode-map (current-global-map))) |
134 | 141 |
135 (defvar gomoku-emacs-won () | 142 (defvar gomoku-emacs-won () |
136 "*For making font-lock use the winner's face for the line.") | 143 "For making font-lock use the winner's face for the line.") |
137 | 144 |
138 (defvar gomoku-font-lock-O-face | 145 (defcustom gomoku-font-lock-O-face |
139 (if window-system | 146 (if window-system |
140 (list (facemenu-get-face 'fg:red) 'bold)) | 147 (list (facemenu-get-face 'fg:red) 'bold)) |
141 "*Face to use for Emacs' O.") | 148 "*Face to use for Emacs' O." |
142 | 149 :type '(repeat face) |
143 (defvar gomoku-font-lock-X-face | 150 :group 'gomoku) |
151 | |
152 (defcustom gomoku-font-lock-X-face | |
144 (if window-system | 153 (if window-system |
145 (list (facemenu-get-face 'fg:green) 'bold)) | 154 (list (facemenu-get-face 'fg:green) 'bold)) |
146 "*Face to use for your X.") | 155 "*Face to use for your X." |
156 :type '(repeat face) | |
157 :group 'gomoku) | |
147 | 158 |
148 (defvar gomoku-font-lock-keywords | 159 (defvar gomoku-font-lock-keywords |
149 '(("O" . gomoku-font-lock-O-face) | 160 '(("O" . gomoku-font-lock-O-face) |
150 ("X" . gomoku-font-lock-X-face) | 161 ("X" . gomoku-font-lock-X-face) |
151 ("[-|/\\]" 0 (if gomoku-emacs-won | 162 ("[-|/\\]" 0 (if gomoku-emacs-won |