;;;; Mode definitions for interactive mode
-(defun dun-mode ()
+(define-derived-mode dun-mode text-mode "Dungeon"
"Major mode for running dunnet."
- (interactive)
- (text-mode)
(make-local-variable 'scroll-step)
- (setq scroll-step 2)
- (use-local-map dungeon-mode-map)
- (setq major-mode 'dun-mode)
- (setq mode-name "Dungeon"))
+ (setq scroll-step 2))
(defun dun-parse (arg)
"Function called when return is pressed in interactive mode to parse line."
(setq dun-current-room 1)
(setq dun-exitf nil)
(setq dun-badcd nil)
-(defvar dungeon-mode-map nil)
-(setq dungeon-mode-map (make-sparse-keymap))
-(define-key dungeon-mode-map "\r" 'dun-parse)
+(define-obsolete-variable-alias 'dungeon-mode-map 'dun-mode-map "22.1")
+(define-key dun-mode-map "\r" 'dun-parse)
(defvar dungeon-batch-map (make-keymap))
(if (string= (substring emacs-version 0 2) "18")
(let (n)
(if dun-logged-in
(progn
(setq dungeon-mode 'unix)
- (define-key dungeon-mode-map "\r" 'dun-unix-parse)
+ (define-key dun-mode-map "\r" 'dun-unix-parse)
(dun-mprinc "$ "))))
(defun dun-login ()
(defun dun-uexit (args)
(setq dungeon-mode 'dungeon)
(dun-mprincl "\nYou step back from the console.")
- (define-key dungeon-mode-map "\r" 'dun-parse)
+ (define-key dun-mode-map "\r" 'dun-parse)
(if (not dun-batch-mode)
(dun-messages)))
(defun dun-dos-interface ()
(dun-dos-boot-msg)
(setq dungeon-mode 'dos)
- (define-key dungeon-mode-map "\r" 'dun-dos-parse)
+ (define-key dun-mode-map "\r" 'dun-dos-parse)
(dun-dos-prompt))
(defun dun-dos-type (args)
(defun dun-dos-exit (args)
(setq dungeon-mode 'dungeon)
(dun-mprincl "\nYou power down the machine and step back.")
- (define-key dungeon-mode-map "\r" 'dun-parse)
+ (define-key dun-mode-map "\r" 'dun-parse)
(if (not dun-batch-mode)
(dun-messages)))