-;;; dunnet.el --- text adventure for Emacs
+;;; dunnet.el --- text adventure for Emacs -*- byte-compile-warnings: nil -*-
-;; Copyright (C) 1992, 1993, 2001 Free Software Foundation, Inc.
+;; Copyright (C) 1992, 1993, 2001, 2002, 2003, 2004,
+;; 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
;; 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., 59 Temple Place - Suite 330,
-;; Boston, MA 02111-1307, 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
- 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!
(condition-case nil
(dun-rot13)
(error (yank)))
- (eval-current-buffer)
+ (eval-buffer)
(kill-buffer (current-buffer)))
(switch-to-buffer old-buffer)
result))
(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*")
(provide 'dunnet)
-;;; arch-tag: 4cc8e47c-d9e1-4ef4-936b-578e7f529558
+;; arch-tag: 4cc8e47c-d9e1-4ef4-936b-578e7f529558
;;; dunnet.el ends here