     (error "You probably meant to run: M-x intero-repl"))
   (set (make-local-variable 'comint-prompt-regexp) intero-prompt-regexp))
 
-(defun intero-repl-mode-start (buffer targets)
-  "Start the process for the repl buffer."
+(defun intero-repl-mode-start (backend-buffer targets prompt-options)
+  "Start the process for the repl in the current buffer, using
+BACKEND-BUFFER for options, TARGETS to load, and prompting with
+an options list if PROMPT-OPTIONS is t."
   (setq intero-targets targets)
+  (when prompt-options
+    (intero-repl-options backend-buffer))
   (let ((arguments (intero-make-options-list
                     (or targets
-                        (let ((package-name (buffer-local-value 'intero-package-name buffer)))
+                        (let ((package-name (buffer-local-value 'intero-package-name
+                                                                backend-buffer)))
                           (unless (equal "" package-name)
                             (list package-name))))
-                    intero-repl-no-build
-                    intero-repl-no-load)))
+                    (buffer-local-value 'intero-repl-no-build backend-buffer)
+                    (buffer-local-value 'intero-repl-no-load backend-buffer))))
     (insert (propertize
              (format "Starting:\n  stack ghci %s\n" (combine-and-quote-strings arguments))
              'face 'font-lock-comment-face))

    (message "Intero mode is now %s on all future Haskell buffers."
             (if intero-global-mode
                 "enabled" "disabled"))))

(defvar intero-repl-no-load t
  "When starting the repl, pass --no-load to skip loading the files
  from the selected target")

(defvar intero-repl-no-build t
  "When starting the repl, pass --no-build to skip building the target")

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Buffer-local variables/state

        (cd root)
        (intero-repl-mode)
        (intero-repl-mode-start backend-buffer
                                (buffer-local-value 'intero-targets backend-buffer)
                                prompt-options)
        (current-buffer)))))

(define-derived-mode intero-repl-mode comint-mode "Intero-REPL"
