53 |
|
|
54 |
;;;; Mode definitions for interactive mode |
;;;; Mode definitions for interactive mode |
55 |
|
|
56 |
(defun dun-mode () |
(define-derived-mode dun-mode text-mode "Dungeon" |
57 |
"Major mode for running dunnet." |
"Major mode for running dunnet." |
|
(interactive) |
|
|
(text-mode) |
|
58 |
(make-local-variable 'scroll-step) |
(make-local-variable 'scroll-step) |
59 |
(setq scroll-step 2) |
(setq scroll-step 2)) |
|
(use-local-map dungeon-mode-map) |
|
|
(setq major-mode 'dun-mode) |
|
|
(setq mode-name "Dungeon")) |
|
60 |
|
|
61 |
(defun dun-parse (arg) |
(defun dun-parse (arg) |
62 |
"Function called when return is pressed in interactive mode to parse line." |
"Function called when return is pressed in interactive mode to parse line." |
1361 |
(setq dun-current-room 1) |
(setq dun-current-room 1) |
1362 |
(setq dun-exitf nil) |
(setq dun-exitf nil) |
1363 |
(setq dun-badcd nil) |
(setq dun-badcd nil) |
1364 |
(defvar dungeon-mode-map nil) |
(define-obsolete-variable-alias 'dungeon-mode-map 'dun-mode-map "22.1") |
1365 |
(setq dungeon-mode-map (make-sparse-keymap)) |
(define-key dun-mode-map "\r" 'dun-parse) |
|
(define-key dungeon-mode-map "\r" 'dun-parse) |
|
1366 |
(defvar dungeon-batch-map (make-keymap)) |
(defvar dungeon-batch-map (make-keymap)) |
1367 |
(if (string= (substring emacs-version 0 2) "18") |
(if (string= (substring emacs-version 0 2) "18") |
1368 |
(let (n) |
(let (n) |
2588 |
(if dun-logged-in |
(if dun-logged-in |
2589 |
(progn |
(progn |
2590 |
(setq dungeon-mode 'unix) |
(setq dungeon-mode 'unix) |
2591 |
(define-key dungeon-mode-map "\r" 'dun-unix-parse) |
(define-key dun-mode-map "\r" 'dun-unix-parse) |
2592 |
(dun-mprinc "$ ")))) |
(dun-mprinc "$ ")))) |
2593 |
|
|
2594 |
(defun dun-login () |
(defun dun-login () |
2854 |
(defun dun-uexit (args) |
(defun dun-uexit (args) |
2855 |
(setq dungeon-mode 'dungeon) |
(setq dungeon-mode 'dungeon) |
2856 |
(dun-mprincl "\nYou step back from the console.") |
(dun-mprincl "\nYou step back from the console.") |
2857 |
(define-key dungeon-mode-map "\r" 'dun-parse) |
(define-key dun-mode-map "\r" 'dun-parse) |
2858 |
(if (not dun-batch-mode) |
(if (not dun-batch-mode) |
2859 |
(dun-messages))) |
(dun-messages))) |
2860 |
|
|
3053 |
(defun dun-dos-interface () |
(defun dun-dos-interface () |
3054 |
(dun-dos-boot-msg) |
(dun-dos-boot-msg) |
3055 |
(setq dungeon-mode 'dos) |
(setq dungeon-mode 'dos) |
3056 |
(define-key dungeon-mode-map "\r" 'dun-dos-parse) |
(define-key dun-mode-map "\r" 'dun-dos-parse) |
3057 |
(dun-dos-prompt)) |
(dun-dos-prompt)) |
3058 |
|
|
3059 |
(defun dun-dos-type (args) |
(defun dun-dos-type (args) |
3111 |
(defun dun-dos-exit (args) |
(defun dun-dos-exit (args) |
3112 |
(setq dungeon-mode 'dungeon) |
(setq dungeon-mode 'dungeon) |
3113 |
(dun-mprincl "\nYou power down the machine and step back.") |
(dun-mprincl "\nYou power down the machine and step back.") |
3114 |
(define-key dungeon-mode-map "\r" 'dun-parse) |
(define-key dun-mode-map "\r" 'dun-parse) |
3115 |
(if (not dun-batch-mode) |
(if (not dun-batch-mode) |
3116 |
(dun-messages))) |
(dun-messages))) |
3117 |
|
|