 
 ;;; Factor listener mode
 
+;;;###autoload
 (define-derived-mode factor-listener-mode comint-mode "Factor Listener")
 
 (define-key factor-listener-mode-map [f8] 'factor-refresh-all)
 
+;;;###autoload
 (defun run-factor ()
+  "Start a factor listener inside emacs, or switch to it if it
+already exists."
   (interactive)
   (switch-to-buffer
    (make-comint-in-buffer "factor" nil (expand-file-name factor-binary) nil


;;; Factor mode indentation:

(defvar factor-indent-width factor-default-indent-width
  "Indentation width in factor buffers. A local variable.")

(make-variable-buffer-local 'factor-indent-width)

(defconst factor--regexp-word-start
  (let ((sws '("" ":" "TUPLE" "MACRO" "MACRO:" "M")))

  (factor-listener-mode))

(defun factor-refresh-all ()
  "Reload source files and documentation for all loaded
vocabularies which have been modified on disk."
  (interactive)
  (comint-send-string "*factor*" "refresh-all\n"))

