]> git.eshelyaron.com Git - emacs.git/commitdiff
(doctor-doc): Recognize question words and use qlist.
authorRichard M. Stallman <rms@gnu.org>
Mon, 9 Sep 2002 00:25:09 +0000 (00:25 +0000)
committerRichard M. Stallman <rms@gnu.org>
Mon, 9 Sep 2002 00:25:09 +0000 (00:25 +0000)
Use doctor-shorten's return value.
(doctor-shorten): Compute a return value, don't alter `sent'.
(doctor-hates1): Add a question mark.
(doctor-strangelove): Unused function deleted.

lisp/play/doctor.el

index b9d803e4b1dcafd466b2d9c15b4ffded8e426917..3eecfd2122c8a7661852dcae30d6a03876edcea3 100644 (file)
@@ -909,13 +909,15 @@ Otherwise call the Doctor to parse preceding sentence."
                        'sentence 'used 'was
                        "..."
                        '(// bak))))
+   ((memq (car sent) '(do has have how when where who why))
+    (doctor-type ($ qlist)))
    ;;   ((eq (car sent) 'forget)
    ;;    (set (doctor-cadr sent) nil)
    ;;    (doctor-type '(($ isee)($ please)
    ;;     ($ continue)\.)))
    (t
     (if (doctor-defq sent) (doctor-define sent found))
-    (if (> (length sent) 12)(doctor-shorten sent))
+    (if (> (length sent) 12)(setq sent (doctor-shorten sent)))
     (setq sent (doctor-correct-spelling (doctor-replace sent replist)))
     (cond ((and (not (memq 'me sent))(not (memq 'i sent))
                (memq 'am sent))
@@ -956,17 +958,15 @@ Otherwise call the Doctor to parse preceding sentence."
 (defun doctor-shorten (sent)
   "Make a sentence manageably short using a few hacks."
   (let (foo
-       retval
+       (retval sent)
        (temp '(because but however besides anyway until
                    while that except why how)))
     (while temp
           (setq foo (memq (car temp) sent))
           (if (and foo
                    (> (length foo) 3))
-              (setq sent foo
-                    sent (doctor-fixup sent)
-                    temp nil
-                    retval t)
+              (setq retval (doctor-fixup foo)
+                    temp nil)
               (setq temp (cdr temp))))
     retval))
 
@@ -1540,7 +1540,7 @@ Hack on previous word, setting global variable OWNER to correct result."
   (doctor-hates1))
 
 (defun doctor-hates1 ()
-  (doctor-type '(($ whysay)(list subj verb obj))))
+  (doctor-type '(($ whysay)(list subj verb obj) \?)))
 
 (defun doctor-loves ()
   (doctor-svo sent found 1 t)
@@ -1634,11 +1634,6 @@ Hack on previous word, setting global variable OWNER to correct result."
 
 (defun doctor-chat () (doctor-type ($ chatlst)))
 
-(defun doctor-strangelove ()
-  (interactive)
-  (insert "Mein fuehrer!!\n")
-  (doctor-read-print))
-
 (provide 'doctor)
 
 ;;; doctor.el ends here