 (defvar factor--help-history nil)
 
 (defun factor--listener-show-help (&optional see)
+  (unless (factor--listener-process)
+    (error "No running factor listener. Try M-x run-factor"))
   (let* ((def (factor--symbol-at-point))
          (prompt (format "See%s help on%s: " (if see " short" "")
                          (if def (format " (%s)" def) "")))


;;;;; Synchronous interaction:

(defun factor--listener-sync-cmds (cmds &optional vocab)
  (factor--with-vocab vocab
    (mapcar #'(lambda (c)
                (comint-redirect-results-list-from-process
                 (factor--listener-process) c ".+" 0))
            cmds)))

(defsubst factor--listener-sync-cmd (cmd &optional vocab)
  (car (factor--listener-sync-cmds (list cmd) vocab)))

;;;;; Interface: see


  (let ((word (or word (factor--symbol-at-point))))
    (when word
      (let ((answer (factor--listener-send-cmd (format "\\ %s see" word))))
        (and answer (factor--see-ans-to-string answer))))))

(defalias 'factor--eldoc 'factor--see-current-word)

(defun factor-see-current-word (&optional word)
  "Echo in the minibuffer information about word at point."
  (interactive)
  (unless (factor--listener-process)
    (error "No factor listener running. Try M-x run-factor"))
  (let ((word (or word (factor--symbol-at-point)))
        (msg (factor--see-current-word word)))
    (if msg (message "%s" msg)
