aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/play/gomoku.el13
1 files changed, 9 insertions, 4 deletions
diff --git a/lisp/play/gomoku.el b/lisp/play/gomoku.el
index d81b2e79c17..28c829d2ac4 100644
--- a/lisp/play/gomoku.el
+++ b/lisp/play/gomoku.el
@@ -192,7 +192,7 @@ One useful value to include is `turn-on-font-lock' to highlight the pieces."
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.
197You and Emacs play in turn by marking a free square. You mark it with X 197You and Emacs play in turn by marking a free square. You mark it with X
198and Emacs marks it with O. The winner is the first to get five contiguous 198and Emacs marks it with O. The winner is the first to get five contiguous
@@ -204,10 +204,15 @@ Other useful commands:
204\\{gomoku-mode-map} 204\\{gomoku-mode-map}
205Entry to this mode calls the value of `gomoku-mode-hook' if that value 205Entry to this mode calls the value of `gomoku-mode-hook' if that value
206is non-nil. One interesting value is `turn-on-font-lock'." 206is 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.