 
 ;; Utilities for creating repls using comint.
 
-(defun sm/comint-print-and-send (proc str)
+(defface sm/comint-echo '((t :inherit font-lock-comment-face))
+  "Face for text echoed in the comint buffer.")
+
+(defun sm/comint-echo-and-send (proc str)
   "Send STR to PROC.  STR will be echoed after the prompt."
   (let ((lines (split-string str "\n" nil)))
     (with-current-buffer (process-buffer proc)
-      (mapcar (lambda (line)
-                (goto-char (process-mark proc))
-                (insert-before-markers (concat line "\n"))
-                (move-marker comint-last-input-end (point))
-                (comint-send-string proc (concat line "\n")))
-              lines))))
+      (let ((echo (lambda (s)
+                    (goto-char (process-mark proc))
+                    (insert-before-markers (propertize (concat s "\n")
+                                                       'font-lock-face 'sm/comint-echo))
+                    (move-marker comint-last-input-end (point)))))
+        (mapcar #'(lambda (line)
+                    (funcall echo line)
+                    (comint-send-string proc (concat line "\n")))
+                lines)))))
 
 (defun sm/comint-send-region (proc beg end)
   "Send the selected region BEG to END to some PROC."
   (unless (and beg end)
     (user-error "No region selected"))
   (let ((region (buffer-substring-no-properties beg end)))
-    (sm/comint-print-and-send proc (string-trim region))))
+    (sm/comint-echo-and-send proc (string-trim region))))
 
 (defun sm/comint-send-line (proc)
   "Send the current line to PROC."
   (let ((str (thing-at-point 'line t)))
-    (sm/comint-print-and-send proc (string-trim str))))
+    (sm/comint-echo-and-send proc (string-trim str))))
 
 (defun sm/comint-send-region-or-line (proc)
   "Send region if active, send the current line otherwise."

    (interactive)
    (let* ((sym (thing-at-point 'symbol t))
           (str (concat "@doc " sym)))
      (sm/comint-print-and-send (sm/julia-process) str)))

  (defun sm/julia-edit ()
    (interactive)
    ;; TODO: Should be getting expression, but line is close enough for now.
    (let* ((line (thing-at-point 'line t))
           (str (concat "@edit " line)))
      (sm/comint-print-and-send (sm/julia-process) str)))

  (defun sm/julia-macroexpand ()
    "Expand macro on the current line, or region if selected."


  (defun sm/iex-recompile-project ()
    (interactive)
    (sm/comint-echo-and-send (sm/iex-process) "recompile"))

  (defun sm/elixir-current-module ()
    (save-excursion
