# HG changeset patch # User Stefan Monnier # Date 1002997691 0 # Node ID e1334fb129a2e32e1149f14cd0a6bcc6304b2f79 # Parent 91b2bb6856b04fb737d9477f89ea7a7cd0e136be (gomoku-mode): Use define-derived-mode. diff -r 91b2bb6856b0 -r e1334fb129a2 lisp/play/gomoku.el --- a/lisp/play/gomoku.el Sat Oct 13 13:16:33 2001 +0000 +++ b/lisp/play/gomoku.el Sat Oct 13 18:28:11 2001 +0000 @@ -1,6 +1,6 @@ ;;; gomoku.el --- Gomoku game between you and Emacs -;; Copyright (C) 1988, 1994, 1996 Free Software Foundation, Inc. +;; Copyright (C) 1988, 1994, 1996, 2001 Free Software Foundation, Inc. ;; Author: Philippe Schnoebelen ;; Adapted-By: ESR, Daniel Pfeiffer @@ -168,7 +168,7 @@ (put 'gomoku-mode 'rear-nonsticky '(intangible))) (put 'gomoku-mode 'intangible 1) -(defun gomoku-mode () +(define-derived-mode gomoku-mode nil "Gomoku" "Major mode for playing Gomoku against Emacs. You and Emacs play in turn by marking a free square. You mark it with X and Emacs marks it with O. The winner is the first to get five contiguous @@ -180,15 +180,10 @@ \\{gomoku-mode-map} Entry to this mode calls the value of `gomoku-mode-hook' if that value is non-nil. One interesting value is `turn-on-font-lock'." - (interactive) - (setq major-mode 'gomoku-mode - mode-name "Gomoku") (gomoku-display-statistics) - (use-local-map gomoku-mode-map) - (make-local-variable 'font-lock-defaults) - (setq font-lock-defaults '(gomoku-font-lock-keywords t)) - (toggle-read-only t) - (run-hooks 'gomoku-mode-hook)) + (set (make-local-variable 'font-lock-defaults) + '(gomoku-font-lock-keywords t)) + (toggle-read-only t)) ;;; ;;; THE BOARD.