   (interactive "P")
   (save-buffer)
   (let ((file (intero-buffer-file-name))
-        (repl-buffer (intero-repl-buffer prompt-options)))
+        (repl-buffer (intero-repl-buffer prompt-options t)))
     (with-current-buffer repl-buffer
       (comint-simple-send
        (get-buffer-process (current-buffer))

  "Start up the REPL for this stack project.
If PROMPT-OPTIONS is non-nil, prompt with an options list."
  (interactive "P")
  (switch-to-buffer (intero-repl-buffer prompt-options)))

(defun intero-repl-buffer (prompt-options)
  "Start the REPL buffer.
If PROMPT-OPTIONS is non-nil, prompt with an options list."
  (let* ((root (intero-project-root))
         (package-name (intero-package-name))
         (name (format "*intero:%s:%s:repl*"
                       (file-name-nondirectory root)
                       package-name))
         (backend-buffer (intero-buffer 'backend)))
    (if (get-buffer name)
        (get-buffer name)
      (with-current-buffer
          (get-buffer-create name)
        (cd root)
        (intero-repl-mode)
        (intero-repl-mode-start backend-buffer
                                (buffer-local-value 'intero-targets backend-buffer)
                                prompt-options)
        (current-buffer)))))

(defvar intero-hyperlink-map

  (if (search-backward-regexp intero-prompt-regexp (line-beginning-position) t 1)
      (goto-char (+ 2 (line-beginning-position)))
    (call-interactively 'move-beginning-of-line)))

(defun intero-repl-switch-back ()
  "Switch back to the buffer from which this REPL buffer was reached."
  (interactive)
  (if intero-repl-previous-buffer
      (switch-to-buffer-other-window intero-repl-previous-buffer)
    (message "No previous buffer.")))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Buffer operations
