summaryrefslogtreecommitdiff
path: root/lisp/play
diff options
context:
space:
mode:
authorLute Kamstra <lute@gnu.org>2005-06-10 12:06:05 +0000
committerLute Kamstra <lute@gnu.org>2005-06-10 12:06:05 +0000
commit2aa8e74af09da63f7e702bc342d4350ba81ff0ab (patch)
tree76881ec6aa3bc6f3063f3c310d97ed954b776666 /lisp/play
parent09e9987080371fbab84d6fdca5e5c38ef1b590ba (diff)
downloademacs-2aa8e74af09da63f7e702bc342d4350ba81ff0ab.tar.gz
(doctor-mode-map): Remove defvar.
(doctor-mode): Use define-derived-mode.
Diffstat (limited to 'lisp/play')
-rw-r--r--lisp/play/doctor.el17
1 files changed, 4 insertions, 13 deletions
diff --git a/lisp/play/doctor.el b/lisp/play/doctor.el
index 798abbc790a..7b81daa7782 100644
--- a/lisp/play/doctor.el
+++ b/lisp/play/doctor.el
@@ -59,30 +59,21 @@
(set what ww)
first))
-(defvar doctor-mode-map nil)
-(if doctor-mode-map
- nil
- (setq doctor-mode-map (make-sparse-keymap))
- (define-key doctor-mode-map "\n" 'doctor-read-print)
- (define-key doctor-mode-map "\r" 'doctor-ret-or-read))
-
-(defun doctor-mode ()
+(define-derived-mode doctor-mode text-mode "Doctor"
"Major mode for running the Doctor (Eliza) program.
Like Text mode with Auto Fill mode
except that RET when point is after a newline, or LFD at any time,
reads the sentence before point, and prints the Doctor's answer."
- (interactive)
- (text-mode)
(make-doctor-variables)
- (use-local-map doctor-mode-map)
- (setq major-mode 'doctor-mode)
- (setq mode-name "Doctor")
(turn-on-auto-fill)
(doctor-type '(i am the psychotherapist \.
(doc$ please) (doc$ describe) your (doc$ problems) \.
each time you are finished talking, type \R\E\T twice \.))
(insert "\n"))
+(define-key doctor-mode-map "\n" 'doctor-read-print)
+(define-key doctor-mode-map "\r" 'doctor-ret-or-read)
+
(defun make-doctor-variables ()
(make-local-variable 'typos)
(setq typos