X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/bd358779861f265a7acff31ead40172735af693e..aae436e2d898a8c8cc243c73d6cec5a8c566a061:/lisp/play/snake.el diff --git a/lisp/play/snake.el b/lisp/play/snake.el index 85acfb116d..243f0190ee 100644 --- a/lisp/play/snake.el +++ b/lisp/play/snake.el @@ -1,6 +1,6 @@ ;;; snake.el --- implementation of Snake for Emacs -;; Copyright (C) 1997, 2001-2013 Free Software Foundation, Inc. +;; Copyright (C) 1997, 2001-2016 Free Software Foundation, Inc. ;; Author: Glynn Clements ;; Created: 1997-09-10 @@ -353,21 +353,13 @@ Argument SNAKE-BUFFER is the name of the buffer." (put 'snake-mode 'mode-class 'special) -(defun snake-mode () - "A mode for playing Snake. - -Snake mode keybindings: - \\{snake-mode-map} -" - (kill-all-local-variables) +(define-derived-mode snake-mode special-mode "Snake" + "A mode for playing Snake." (add-hook 'kill-buffer-hook 'gamegrid-kill-timer nil t) (use-local-map snake-null-map) - (setq major-mode 'snake-mode) - (setq mode-name "Snake") - (unless (featurep 'emacs) (setq mode-popup-menu '("Snake Commands" @@ -382,9 +374,7 @@ Snake mode keybindings: (setq gamegrid-use-glyphs snake-use-glyphs-flag) (setq gamegrid-use-color snake-use-color-flag) - (gamegrid-init (snake-display-options)) - - (run-mode-hooks 'snake-mode-hook)) + (gamegrid-init (snake-display-options))) ;;;###autoload (defun snake ()