/[emacs]/emacs/lisp/play/dunnet.el
ViewVC logotype

Diff of /emacs/lisp/play/dunnet.el

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.21 by miles, Mon Sep 1 15:45:34 2003 UTC revision 1.22 by lute, Fri Jun 10 10:58:59 2005 UTC
# Line 53  Line 53 
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."
# Line 1366  for a moment, then straighten yourself u Line 1361  for a moment, then straighten yourself u
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)
# Line 2594  treasures for points?" "4" "four") Line 2588  treasures for points?" "4" "four")
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 ()
# Line 2860  drwxr-xr-x  3 root     staff          20 Line 2854  drwxr-xr-x  3 root     staff          20
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    
# Line 3059  drwxr-xr-x  3 root     staff          20 Line 3053  drwxr-xr-x  3 root     staff          20
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)
# Line 3117  File not found"))) Line 3111  File not found")))
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    

Legend:
Removed from v.1.21  
changed lines
  Added in v.1.22

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26