 				    (overlay-end first-overlay))))
     (goto-char (point-max))
     (insert code)
-    (comint-send-string inferior-slate-buffer-name (concat code ".\n"))))
+    (slate-send-input code)))
 
 (defun slate-follow-name-at-point ()
   "Follows a file reference of the form filename:linenumber at/after the point."

      (font-lock-mode))
    (pop-to-buffer "*slate-scratch*")))

(defun slate-run-code-at-point ()
  (interactive)
  (let* ((overlays (overlays-at (point)))
	 (first-overlay (car overlays))

(defun slate-inf-filter (process string)
  "Make sure that the window continues to show the most recently output
text."
  (with-current-buffer (process-buffer process)
    (when (buffer-name (current-buffer))
      (let ((where 0) ch command-str
	    (moving (= (point) (process-mark process))))
	(while (and string where)
	  (when slate-output-buffer
	    (setq string (slate-accum-command string)))
	  (when (and string
		     (setq where (string-match "\C-a\\|\C-b" string)))
	    (setq ch (aref string where))
	    (cond ((= ch ?\C-a)		;strip these out
		   (setq string (concat (substring string 0 where)
					(substring string (1+ where)))))
		  ((= ch ?\C-b)		       ;start of command
		   (setq slate-output-buffer "") ;start this off
		   (setq string (substring string (1+ where)))))))
	(save-excursion
	  (goto-char (point-max))
	  (when string
	    (setq mode-status "Idle")
	    (insert string))
	  (save-excursion	 ; Handle most recent debugger output:
	    (goto-char (point-max))
	    (re-search-backward "^Debugging: " nil t)
	    (save-excursion	    ; Handle debugger file references:
	      (let (fileref-end)
		(while (setq fileref-end (re-search-forward slate-debug-fileref-regexp nil t))
		  (let ((fileref-overlay (slate-overlay (match-beginning 1) fileref-end 'link 'highlight nil "mouse-1: visit this file and line")))
		    (overlay-put fileref-overlay 'keymap slate-fileref-keymap)))))
					; Handle debugger frame references:
	    (while (re-search-forward slate-debug-frame-regexp nil t)
	      (let ((frameref-overlay (slate-overlay (match-beginning 1) (match-end 1) 'button nil nil "mouse-1: navigate to this frame")))
		(overlay-put frameref-overlay 'keymap slate-frameref-keymap)))
					; Handle debugger restart listing:
	    (let (restart-end)
	      (while (setq restart-end (re-search-forward slate-debug-restart-regexp nil t))
		(let ((restart-overlay (slate-overlay (match-beginning 0) restart-end 'button nil nil "mouse-1: select this restart")))
		  (overlay-put restart-overlay 'keymap slate-restart-keymap)))))
	  (when (process-mark process)
	    (set-marker (process-mark process) (point-max))))
	(if moving (goto-char (process-mark process)))
	(sit-for 0)
	(set-window-point (get-buffer-window (current-buffer)) (point-max))))))

(defun slate-inf-filter-redirect (process string)
  )

(defvar slate-interactor-mode-map
  (let ((map (copy-keymap slate-mode-map)))
