comparison lisp/play/gomoku.el @ 44081:55e461345aba

(gomoku-font-lock-O-face): Convert to use `defface'. (gomoku-font-lock-X-face): Likewise. (gomoku-font-lock-keywords): Use faces instead of variables.
author Juanma Barranquero <lekktu@gmail.com>
date Fri, 22 Mar 2002 09:43:59 +0000
parents 7308bbc423d5
children 8fbfc7c3386c
comparison
equal deleted inserted replaced
44080:d6dc55c34307 44081:55e461345aba
161 gomoku-mode-map (current-global-map))) 161 gomoku-mode-map (current-global-map)))
162 162
163 (defvar gomoku-emacs-won () 163 (defvar gomoku-emacs-won ()
164 "For making font-lock use the winner's face for the line.") 164 "For making font-lock use the winner's face for the line.")
165 165
166 (defcustom gomoku-font-lock-O-face 166 (defface gomoku-font-lock-O-face
167 (if (display-color-p) 167 '((((class color)) (:foreground "red" :weight bold)))
168 (list (facemenu-get-face 'fg:red) 'bold)) 168 "Face to use for Emacs' O."
169 "*Face to use for Emacs' O."
170 :type '(repeat face)
171 :group 'gomoku) 169 :group 'gomoku)
172 170
173 (defcustom gomoku-font-lock-X-face 171 (defface gomoku-font-lock-X-face
174 (if (display-color-p) 172 '((((class color)) (:foreground "green" :weight bold)))
175 (list (facemenu-get-face 'fg:green) 'bold)) 173 "Face to use for your X."
176 "*Face to use for your X."
177 :type '(repeat face)
178 :group 'gomoku) 174 :group 'gomoku)
179 175
180 (defvar gomoku-font-lock-keywords 176 (defvar gomoku-font-lock-keywords
181 '(("O" . gomoku-font-lock-O-face) 177 '(("O" . 'gomoku-font-lock-O-face)
182 ("X" . gomoku-font-lock-X-face) 178 ("X" . 'gomoku-font-lock-X-face)
183 ("[-|/\\]" 0 (if gomoku-emacs-won 179 ("[-|/\\]" 0 (if gomoku-emacs-won
184 gomoku-font-lock-O-face 180 'gomoku-font-lock-O-face
185 gomoku-font-lock-X-face))) 181 'gomoku-font-lock-X-face)))
186 "*Font lock rules for Gomoku.") 182 "*Font lock rules for Gomoku.")
187 183
188 (put 'gomoku-mode 'front-sticky 184 (put 'gomoku-mode 'front-sticky
189 (put 'gomoku-mode 'rear-nonsticky '(intangible))) 185 (put 'gomoku-mode 'rear-nonsticky '(intangible)))
190 (put 'gomoku-mode 'intangible 1) 186 (put 'gomoku-mode 'intangible 1)