diff options
| author | Richard M. Stallman | 2001-11-21 11:03:35 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 2001-11-21 11:03:35 +0000 |
| commit | 5ca809a7b69932b749919b801db80432a8eee301 (patch) | |
| tree | 94c4df50f21c7ecc00af56efc77acd3fe6014f9b | |
| parent | 23d107d750ce2efe24658e9e96a98fecac9f7e66 (diff) | |
| download | emacs-5ca809a7b69932b749919b801db80432a8eee301.tar.gz emacs-5ca809a7b69932b749919b801db80432a8eee301.zip | |
(gomoku-mode): Don't use define-derived-mode.
| -rw-r--r-- | lisp/play/gomoku.el | 13 |
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. |
| 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 |
| @@ -204,10 +204,15 @@ 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. |