]> git.eshelyaron.com Git - emacs.git/commitdiff
(make-doctor-variables): Fix some local var names.
authorRichard M. Stallman <rms@gnu.org>
Thu, 23 Dec 1993 03:36:02 +0000 (03:36 +0000)
committerRichard M. Stallman <rms@gnu.org>
Thu, 23 Dec 1993 03:36:02 +0000 (03:36 +0000)
(doctor-adverbp): Don't die if doctor-make-string
gives a string of length < 2.

lisp/play/doctor.el

index b6a6a3a9bcc7a3ef85fbe1005567b80a1e7b2d9e..7d9fc4632b9163ce8067f6ce6d7b98f774758d65 100644 (file)
@@ -220,13 +220,13 @@ reads the sentence before point, and prints the Doctor's answer."
          (i don\'t understand \.)
          (($ thlst))
          (($ areyou) ($ afraidof) that \?)))
-  (make-local-variable 'feelings)
+  (make-local-variable 'feelings-about)
   (setq feelings-about
        '((feelings about)
          (aprehensions toward)
          (thoughts on)
          (emotions toward)))
-  (make-local-variable 'random)
+  (make-local-variable 'random-adjective)
   (setq random-adjective
        '((vivid)
          (emotionally stimulating)
@@ -1183,7 +1183,9 @@ the subject noun, and return the portion of the sentence following it."
       (doctor-possessivepronounp x)))
 
 (defun doctor-adverbp (xx)
-  (string-equal (substring (doctor-make-string xx) -2) "ly"))
+  (let ((xxstr (doctor-make-string xx)))
+    (and (>= (length xxstr) 2)
+        (string-equal (substring (doctor-make-string xx) -2) "ly"))))
 
 (defun doctor-articlep (x)
   (memq x '(the a an)))