From c83c96545bef192935a4681aa7a9361c8454ea5a Mon Sep 17 00:00:00 2001 From: Lute Kamstra Date: Thu, 26 May 2005 15:26:09 +0000 Subject: [PATCH] * play/5x5.el (5x5-mode): * play/decipher.el (decipher-mode, decipher-stats-mode): * play/gomoku.el (gomoku-mode): * play/snake.el (snake-mode): * play/solitaire.el (solitaire-mode): * play/tetris.el (tetris-mode): Use run-mode-hooks. * play/landmark.el (lm-mode): * play/mpuz.el (mpuz-mode): Use kill-all-local-variables and run-mode-hooks. --- lisp/play/5x5.el | 4 ++-- lisp/play/decipher.el | 4 ++-- lisp/play/gomoku.el | 2 +- lisp/play/landmark.el | 3 ++- lisp/play/mpuz.el | 3 ++- lisp/play/snake.el | 2 +- lisp/play/solitaire.el | 2 +- lisp/play/tetris.el | 2 +- 8 files changed, 12 insertions(+), 10 deletions(-) diff --git a/lisp/play/5x5.el b/lisp/play/5x5.el index a7860244a8a..f012f132352 100644 --- a/lisp/play/5x5.el +++ b/lisp/play/5x5.el @@ -178,10 +178,10 @@ The key bindings for 5x5-mode are: (use-local-map 5x5-mode-map) (setq major-mode '5x5-mode mode-name "5x5") - (run-hooks '5x5-mode-hook) + (run-mode-hooks '5x5-mode-hook) (setq buffer-read-only t truncate-lines t) - (buffer-disable-undo (current-buffer))) + (buffer-disable-undo)) ;;;###autoload (defun 5x5 (&optional size) diff --git a/lisp/play/decipher.el b/lisp/play/decipher.el index f314a10a9e2..9ef8d0fd01f 100644 --- a/lisp/play/decipher.el +++ b/lisp/play/decipher.el @@ -314,7 +314,7 @@ The most useful commands are: (lambda () (setq buffer-read-only nil buffer-undo-list nil)) nil t) - (run-hooks 'decipher-mode-hook) + (run-mode-hooks 'decipher-mode-hook) (setq buffer-read-only t)) (put 'decipher-mode 'mode-class 'special) @@ -998,7 +998,7 @@ Creates the statistics buffer if it doesn't exist." major-mode 'decipher-stats-mode mode-name "Decipher-Stats") (use-local-map decipher-stats-mode-map) - (run-hooks 'decipher-stats-mode-hook)) + (run-mode-hooks 'decipher-stats-mode-hook)) (put 'decipher-stats-mode 'mode-class 'special) ;;-------------------------------------------------------------------- diff --git a/lisp/play/gomoku.el b/lisp/play/gomoku.el index b640c1bbbd8..69ec07496d5 100644 --- a/lisp/play/gomoku.el +++ b/lisp/play/gomoku.el @@ -206,7 +206,7 @@ is non-nil." (make-local-variable 'font-lock-defaults) (setq font-lock-defaults '(gomoku-font-lock-keywords t)) (toggle-read-only t) - (run-hooks 'gomoku-mode-hook)) + (run-mode-hooks 'gomoku-mode-hook)) ;;; ;;; THE BOARD. diff --git a/lisp/play/landmark.el b/lisp/play/landmark.el index 87ebd88fd58..3dc5e8ad320 100644 --- a/lisp/play/landmark.el +++ b/lisp/play/landmark.el @@ -248,6 +248,7 @@ Other useful commands: Entry to this mode calls the value of `lm-mode-hook' if that value is non-nil. One interesting value is `turn-on-font-lock'." (interactive) + (kill-all-local-variables) (setq major-mode 'lm-mode mode-name "Lm") (lm-display-statistics) @@ -255,7 +256,7 @@ is non-nil. One interesting value is `turn-on-font-lock'." (make-local-variable 'font-lock-defaults) (setq font-lock-defaults '(lm-font-lock-keywords t)) (toggle-read-only t) - (run-hooks 'lm-mode-hook)) + (run-mode-hooks 'lm-mode-hook)) ;;;_ + THE SCORE TABLE. diff --git a/lisp/play/mpuz.el b/lisp/play/mpuz.el index a637a2e98d1..849e87a28b0 100644 --- a/lisp/play/mpuz.el +++ b/lisp/play/mpuz.el @@ -129,11 +129,12 @@ To leave the game to do other editing work, just switch buffers. Then you may resume the game with M-x mpuz. You may abort a game by typing \\\\[mpuz-offer-abort]." (interactive) + (kill-all-local-variables) (setq major-mode 'mpuz-mode mode-name "Mult Puzzle" tab-width 30) (use-local-map mpuz-mode-map) - (run-hooks 'mpuz-mode-hook)) + (run-mode-hooks 'mpuz-mode-hook)) ;; Some variables for statistics diff --git a/lisp/play/snake.el b/lisp/play/snake.el index 71c460feae5..e676d734755 100644 --- a/lisp/play/snake.el +++ b/lisp/play/snake.el @@ -385,7 +385,7 @@ Snake mode keybindings: (gamegrid-init (snake-display-options)) - (run-hooks 'snake-mode-hook)) + (run-mode-hooks 'snake-mode-hook)) ;;;###autoload (defun snake () diff --git a/lisp/play/solitaire.el b/lisp/play/solitaire.el index 1dc57b61c65..22dcea47599 100644 --- a/lisp/play/solitaire.el +++ b/lisp/play/solitaire.el @@ -105,7 +105,7 @@ The usual mnemonic keys move the cursor around the board; in addition, (setq truncate-lines t) (setq major-mode 'solitaire-mode) (setq mode-name "Solitaire") - (run-hooks 'solitaire-mode-hook)) + (run-mode-hooks 'solitaire-mode-hook)) (defvar solitaire-stones 0 "Counter for the stones that are still there.") diff --git a/lisp/play/tetris.el b/lisp/play/tetris.el index 045534c2cea..5b8746bb1d7 100644 --- a/lisp/play/tetris.el +++ b/lisp/play/tetris.el @@ -616,7 +616,7 @@ tetris-mode keybindings: (gamegrid-init (tetris-display-options)) - (run-hooks 'tetris-mode-hook)) + (run-mode-hooks 'tetris-mode-hook)) ;;;###autoload (defun tetris () -- 2.39.2