]> code.delx.au - gnu-emacs/blobdiff - lisp/play/dunnet.el
(completion-setup-function):
[gnu-emacs] / lisp / play / dunnet.el
index 2c6a75da03e0caf8c2af141514c06bbca327b432..43b8ce4f3ce2496046b0cfd2abad722c44c7e135 100644 (file)
@@ -1,7 +1,7 @@
-;;; dunnet.el --- text adventure for Emacs
+;;; dunnet.el --- text adventure for Emacs -*-  byte-compile-warnings: nil -*-
 
 ;; Copyright (C) 1992, 1993, 2001, 2002, 2003, 2004,
-;;   2005, 2006 Free Software Foundation, Inc.
+;;   2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
 
 ;; Author: Ron Schnell <ronnie@driver-aces.com>
 ;; Created: 25 Jul 1992
 
 ;; This file is part of GNU Emacs.
 
-;; GNU Emacs is free software; you can redistribute it and/or modify
+;; GNU Emacs is free software: you can redistribute it and/or modify
 ;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 2, or (at your option)
-;; any later version.
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
 
 ;; GNU Emacs is distributed in the hope that it will be useful,
 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -21,9 +21,7 @@
 ;; GNU General Public License for more details.
 
 ;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs; see the file COPYING.  If not, write to the
-;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-;; Boston, MA 02110-1301, USA.
+;; along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.
 
 ;;; Commentary:
 
   :type 'file
   :group 'dunnet)
 
-(if nil
-    (eval-and-compile (setq byte-compile-warnings nil)))
-
-(eval-when-compile
- (require 'cl))
-
 ;;;; Mode definitions for interactive mode
 
 (define-derived-mode dun-mode text-mode "Dungeon"
   "Function called when return is pressed in interactive mode to parse line."
   (interactive "*p")
   (beginning-of-line)
-  (setq beg (+ (point) 1))
-  (end-of-line)
-  (if (and (not (= beg (point))) (not (< (point) beg))
-          (string= ">" (buffer-substring (- beg 1) beg)))
-      (progn
-       (setq line (downcase (buffer-substring beg (point))))
-       (princ line)
-       (if (eq (dun-vparse dun-ignore dun-verblist line) -1)
-           (dun-mprinc "I don't understand that.\n")))
+  (let ((beg (1+ (point)))
+        line)
+    (end-of-line)
+    (if (and (not (= beg (point))) (not (< (point) beg))
+             (string= ">" (buffer-substring (- beg 1) beg)))
+        (progn
+          (setq line (downcase (buffer-substring beg (point))))
+          (princ line)
+          (if (eq (dun-vparse dun-ignore dun-verblist line) -1)
+              (dun-mprinc "I don't understand that.\n")))
     (goto-char (point-max))
-    (dun-mprinc "\n"))
-    (dun-messages))
+    (dun-mprinc "\n")))
+  (dun-messages))
 
 (defun dun-messages ()
   (if dun-dead
@@ -935,7 +928,7 @@ or more clues in here):
 - If you go down a hole in the floor without an aid such as a ladder,
   you probably won't be able to get back up the way you came, if at all.
 
-- To run this game in batch mode (no emacs window), use:
+- To run this game in batch mode (no Emacs window), use:
      emacs -batch -l dunnet
 NOTE: This game *should* be run in batch mode!
 
@@ -1304,7 +1297,7 @@ for a moment, then straighten yourself up.
       (condition-case nil
          (dun-rot13)
        (error (yank)))
-      (eval-current-buffer)
+      (eval-buffer)
       (kill-buffer (current-buffer)))
       (switch-to-buffer old-buffer)
     result))
@@ -2576,7 +2569,7 @@ treasures for points?" "4" "four")
     (insert ")")
     (setq eval-error nil)
     (condition-case nil
-       (eval-current-buffer)
+       (eval-buffer)
       (error (setq eval-error t)))
     (kill-buffer (current-buffer))
     (switch-to-buffer "*dungeon*")
@@ -3364,5 +3357,5 @@ File not found")))
 
 (provide 'dunnet)
 
-;;; arch-tag: 4cc8e47c-d9e1-4ef4-936b-578e7f529558
+;; arch-tag: 4cc8e47c-d9e1-4ef4-936b-578e7f529558
 ;;; dunnet.el ends here