comparison lisp/play/gomoku.el @ 41347:809d8f73caaf

(gomoku-mode): Don't use define-derived-mode.
author Richard M. Stallman <rms@gnu.org>
date Wed, 21 Nov 2001 11:03:35 +0000
parents b195fc749600
children 7308bbc423d5
comparison
equal deleted inserted replaced
41346:42d60301f16a 41347:809d8f73caaf
190 (put 'gomoku-mode 'intangible 1) 190 (put 'gomoku-mode 'intangible 1)
191 ;; This one is for when they set view-read-only to t: Gomoku cannot 191 ;; This one is for when they set view-read-only to t: Gomoku cannot
192 ;; allow View Mode to be activated in its buffer. 192 ;; allow View Mode to be activated in its buffer.
193 (put 'gomoku-mode 'mode-class 'special) 193 (put 'gomoku-mode 'mode-class 'special)
194 194
195 (define-derived-mode gomoku-mode nil "Gomoku" 195 (defun gomoku-mode ()
196 "Major mode for playing Gomoku against Emacs. 196 "Major mode for playing Gomoku against Emacs.
197 You and Emacs play in turn by marking a free square. You mark it with X 197 You and Emacs play in turn by marking a free square. You mark it with X
198 and Emacs marks it with O. The winner is the first to get five contiguous 198 and Emacs marks it with O. The winner is the first to get five contiguous
199 marks horizontally, vertically or in diagonal. 199 marks horizontally, vertically or in diagonal.
200 200
202 202
203 Other useful commands: 203 Other useful commands:
204 \\{gomoku-mode-map} 204 \\{gomoku-mode-map}
205 Entry to this mode calls the value of `gomoku-mode-hook' if that value 205 Entry to this mode calls the value of `gomoku-mode-hook' if that value
206 is non-nil. One interesting value is `turn-on-font-lock'." 206 is non-nil. One interesting value is `turn-on-font-lock'."
207 (interactive)
208 (setq major-mode 'gomoku-mode
209 mode-name "Gomoku")
207 (gomoku-display-statistics) 210 (gomoku-display-statistics)
208 (set (make-local-variable 'font-lock-defaults) 211 (use-local-map gomoku-mode-map)
209 '(gomoku-font-lock-keywords t)) 212 (make-local-variable 'font-lock-defaults)
210 (toggle-read-only t)) 213 (setq font-lock-defaults '(gomoku-font-lock-keywords t))
214 (toggle-read-only t)
215 (run-hooks 'gomoku-mode-hook))
211 216
212 ;;; 217 ;;;
213 ;;; THE BOARD. 218 ;;; THE BOARD.
214 ;;; 219 ;;;
215 220