diff options
| author | Lute Kamstra | 2005-06-10 10:58:59 +0000 |
|---|---|---|
| committer | Lute Kamstra | 2005-06-10 10:58:59 +0000 |
| commit | 313cdfa4ca0841ae303a2732ad159487408fc605 (patch) | |
| tree | 56803f65d4f38f53642a93458ee3a2ae3eaee96e /lisp | |
| parent | c43aed5aeb6fdd8f44027db021c65113a75df470 (diff) | |
| download | emacs-313cdfa4ca0841ae303a2732ad159487408fc605.tar.gz emacs-313cdfa4ca0841ae303a2732ad159487408fc605.zip | |
(dun-mode): Use define-derived-mode.
(dungeon-mode-map): Rename to dun-mode-map. Keep old name as an
obsolete alias.
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/play/dunnet.el | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/lisp/play/dunnet.el b/lisp/play/dunnet.el index 50b8bce5f74..290ee6ebf5d 100644 --- a/lisp/play/dunnet.el +++ b/lisp/play/dunnet.el | |||
| @@ -53,15 +53,10 @@ | |||
| 53 | 53 | ||
| 54 | ;;;; Mode definitions for interactive mode | 54 | ;;;; Mode definitions for interactive mode |
| 55 | 55 | ||
| 56 | (defun dun-mode () | 56 | (define-derived-mode dun-mode text-mode "Dungeon" |
| 57 | "Major mode for running dunnet." | 57 | "Major mode for running dunnet." |
| 58 | (interactive) | ||
| 59 | (text-mode) | ||
| 60 | (make-local-variable 'scroll-step) | 58 | (make-local-variable 'scroll-step) |
| 61 | (setq scroll-step 2) | 59 | (setq scroll-step 2)) |
| 62 | (use-local-map dungeon-mode-map) | ||
| 63 | (setq major-mode 'dun-mode) | ||
| 64 | (setq mode-name "Dungeon")) | ||
| 65 | 60 | ||
| 66 | (defun dun-parse (arg) | 61 | (defun dun-parse (arg) |
| 67 | "Function called when return is pressed in interactive mode to parse line." | 62 | "Function called when return is pressed in interactive mode to parse line." |
| @@ -1366,9 +1361,8 @@ for a moment, then straighten yourself up. | |||
| 1366 | (setq dun-current-room 1) | 1361 | (setq dun-current-room 1) |
| 1367 | (setq dun-exitf nil) | 1362 | (setq dun-exitf nil) |
| 1368 | (setq dun-badcd nil) | 1363 | (setq dun-badcd nil) |
| 1369 | (defvar dungeon-mode-map nil) | 1364 | (define-obsolete-variable-alias 'dungeon-mode-map 'dun-mode-map "22.1") |
| 1370 | (setq dungeon-mode-map (make-sparse-keymap)) | 1365 | (define-key dun-mode-map "\r" 'dun-parse) |
| 1371 | (define-key dungeon-mode-map "\r" 'dun-parse) | ||
| 1372 | (defvar dungeon-batch-map (make-keymap)) | 1366 | (defvar dungeon-batch-map (make-keymap)) |
| 1373 | (if (string= (substring emacs-version 0 2) "18") | 1367 | (if (string= (substring emacs-version 0 2) "18") |
| 1374 | (let (n) | 1368 | (let (n) |
| @@ -2594,7 +2588,7 @@ treasures for points?" "4" "four") | |||
| 2594 | (if dun-logged-in | 2588 | (if dun-logged-in |
| 2595 | (progn | 2589 | (progn |
| 2596 | (setq dungeon-mode 'unix) | 2590 | (setq dungeon-mode 'unix) |
| 2597 | (define-key dungeon-mode-map "\r" 'dun-unix-parse) | 2591 | (define-key dun-mode-map "\r" 'dun-unix-parse) |
| 2598 | (dun-mprinc "$ ")))) | 2592 | (dun-mprinc "$ ")))) |
| 2599 | 2593 | ||
| 2600 | (defun dun-login () | 2594 | (defun dun-login () |
| @@ -2860,7 +2854,7 @@ drwxr-xr-x 3 root staff 2048 Jan 1 1970 ..") | |||
| 2860 | (defun dun-uexit (args) | 2854 | (defun dun-uexit (args) |
| 2861 | (setq dungeon-mode 'dungeon) | 2855 | (setq dungeon-mode 'dungeon) |
| 2862 | (dun-mprincl "\nYou step back from the console.") | 2856 | (dun-mprincl "\nYou step back from the console.") |
| 2863 | (define-key dungeon-mode-map "\r" 'dun-parse) | 2857 | (define-key dun-mode-map "\r" 'dun-parse) |
| 2864 | (if (not dun-batch-mode) | 2858 | (if (not dun-batch-mode) |
| 2865 | (dun-messages))) | 2859 | (dun-messages))) |
| 2866 | 2860 | ||
| @@ -3059,7 +3053,7 @@ drwxr-xr-x 3 root staff 2048 Jan 1 1970 ..") | |||
| 3059 | (defun dun-dos-interface () | 3053 | (defun dun-dos-interface () |
| 3060 | (dun-dos-boot-msg) | 3054 | (dun-dos-boot-msg) |
| 3061 | (setq dungeon-mode 'dos) | 3055 | (setq dungeon-mode 'dos) |
| 3062 | (define-key dungeon-mode-map "\r" 'dun-dos-parse) | 3056 | (define-key dun-mode-map "\r" 'dun-dos-parse) |
| 3063 | (dun-dos-prompt)) | 3057 | (dun-dos-prompt)) |
| 3064 | 3058 | ||
| 3065 | (defun dun-dos-type (args) | 3059 | (defun dun-dos-type (args) |
| @@ -3117,7 +3111,7 @@ File not found"))) | |||
| 3117 | (defun dun-dos-exit (args) | 3111 | (defun dun-dos-exit (args) |
| 3118 | (setq dungeon-mode 'dungeon) | 3112 | (setq dungeon-mode 'dungeon) |
| 3119 | (dun-mprincl "\nYou power down the machine and step back.") | 3113 | (dun-mprincl "\nYou power down the machine and step back.") |
| 3120 | (define-key dungeon-mode-map "\r" 'dun-parse) | 3114 | (define-key dun-mode-map "\r" 'dun-parse) |
| 3121 | (if (not dun-batch-mode) | 3115 | (if (not dun-batch-mode) |
| 3122 | (dun-messages))) | 3116 | (dun-messages))) |
| 3123 | 3117 | ||