 	      ((= ch ?\C-b)		;start of command
 	       (setq slate-output-buffer "") ;start this off
 	       (setq string (substring string (1+ where)))))))
+    
     (save-excursion
       (set-buffer (process-buffer process))
       (goto-char (point-max))
       (when string
 	(setq mode-status "Idle")
 	(insert string))
+      ; Handle debugger file references:
+      (save-excursion
+	(goto-char (point-min))
+	(let (fileref-end)
+	  (while (setq fileref-end (re-search-forward slate-debug-fileref-regexp nil t))
+	    (let* ((fileref-overlay (make-overlay (match-beginning 1) fileref-end))
+		   (fileref (match-string 1))
+		   (lineno-begin (re-search-forward ":" nil t)))
+	      (overlay-put fileref-overlay 'face 'link)
+	      (overlay-put fileref-overlay 'mouse-face 'highlight)
+	      (overlay-put fileref-overlay 'keymap slate-fileref-keymap)
+	      (replace-match "" t t)))))
       (when (process-mark process)
 	(set-marker (process-mark process) (point-max)))))
   (let ((buf (current-buffer)))

    (process-send-string
     inferior-slate-buffer-name
     (if (and (>= (point) 2) (equal (preceding-char) ?.)) "\n" ".\n")))
  (set-process-filter *slate-process* 'slate-filter))

(defun slate-quit ()
  "Terminate the Slate session and associated process."

      (setq mode-name "Slate Workspace")
      (font-lock-mode))
    (pop-to-buffer "*slate-scratch*")))

(defun slate-follow-name-at-point ()
  "Follows a file reference of the form filename:linenumber at/after the point."
  (interactive)
  (push-mark)
  (setq filename
	(save-excursion
	  (skip-chars-forward "^:")
	  (setq end (point))
	  (skip-chars-backward "^ ")
	  (buffer-substring-no-properties (point) end)))
  (setq line-number
	(save-excursion
	  (skip-chars-forward "^:")
	  (forward-char)
	  (string-to-number (buffer-substring-no-properties (point) (progn (forward-word 1) (point))))))
  ;(find-file-at-point)
  (find-file filename)
  (goto-line line-number))

(defun inf-slate (cmd &rest args)
  "Run an inferior Slate process `*slate-process*'.
