163 |
(defvar gomoku-emacs-won () |
(defvar gomoku-emacs-won () |
164 |
"For making font-lock use the winner's face for the line.") |
"For making font-lock use the winner's face for the line.") |
165 |
|
|
166 |
(defcustom gomoku-font-lock-O-face |
(defface gomoku-font-lock-O-face |
167 |
(if (display-color-p) |
'((((class color)) (:foreground "red" :weight bold))) |
168 |
(list (facemenu-get-face 'fg:red) 'bold)) |
"Face to use for Emacs' O." |
|
"*Face to use for Emacs' O." |
|
|
:type '(repeat face) |
|
169 |
:group 'gomoku) |
:group 'gomoku) |
170 |
|
|
171 |
(defcustom gomoku-font-lock-X-face |
(defface gomoku-font-lock-X-face |
172 |
(if (display-color-p) |
'((((class color)) (:foreground "green" :weight bold))) |
173 |
(list (facemenu-get-face 'fg:green) 'bold)) |
"Face to use for your X." |
|
"*Face to use for your X." |
|
|
:type '(repeat face) |
|
174 |
:group 'gomoku) |
:group 'gomoku) |
175 |
|
|
176 |
(defvar gomoku-font-lock-keywords |
(defvar gomoku-font-lock-keywords |
177 |
'(("O" . gomoku-font-lock-O-face) |
'(("O" . 'gomoku-font-lock-O-face) |
178 |
("X" . gomoku-font-lock-X-face) |
("X" . 'gomoku-font-lock-X-face) |
179 |
("[-|/\\]" 0 (if gomoku-emacs-won |
("[-|/\\]" 0 (if gomoku-emacs-won |
180 |
gomoku-font-lock-O-face |
'gomoku-font-lock-O-face |
181 |
gomoku-font-lock-X-face))) |
'gomoku-font-lock-X-face))) |
182 |
"*Font lock rules for Gomoku.") |
"*Font lock rules for Gomoku.") |
183 |
|
|
184 |
(put 'gomoku-mode 'front-sticky |
(put 'gomoku-mode 'front-sticky |