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

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

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

revision 1.34 by ttn, Thu May 12 00:45:41 2005 UTC revision 1.35 by lute, Fri Jun 10 12:03:48 2005 UTC
# Line 59  Line 59 
59      (set what ww)      (set what ww)
60      first))      first))
61    
62  (defvar doctor-mode-map nil)  (define-derived-mode doctor-mode text-mode "Doctor"
 (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 ()  
63    "Major mode for running the Doctor (Eliza) program.    "Major mode for running the Doctor (Eliza) program.
64  Like Text mode with Auto Fill mode  Like Text mode with Auto Fill mode
65  except that RET when point is after a newline, or LFD at any time,  except that RET when point is after a newline, or LFD at any time,
66  reads the sentence before point, and prints the Doctor's answer."  reads the sentence before point, and prints the Doctor's answer."
   (interactive)  
   (text-mode)  
67    (make-doctor-variables)    (make-doctor-variables)
   (use-local-map doctor-mode-map)  
   (setq major-mode 'doctor-mode)  
   (setq mode-name "Doctor")  
68    (turn-on-auto-fill)    (turn-on-auto-fill)
69    (doctor-type '(i am the psychotherapist \.    (doctor-type '(i am the psychotherapist \.
70                   (doc$ please) (doc$ describe) your (doc$ problems) \.                   (doc$ please) (doc$ describe) your (doc$ problems) \.
71                   each time you are finished talking, type \R\E\T twice \.))                   each time you are finished talking, type \R\E\T twice \.))
72    (insert "\n"))    (insert "\n"))
73    
74    (define-key doctor-mode-map "\n" 'doctor-read-print)
75    (define-key doctor-mode-map "\r" 'doctor-ret-or-read)
76    
77  (defun make-doctor-variables ()  (defun make-doctor-variables ()
78    (make-local-variable 'typos)    (make-local-variable 'typos)
79    (setq typos    (setq typos

Legend:
Removed from v.1.34  
changed lines
  Added in v.1.35

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