       (with-current-buffer
           (or (get-buffer "DevelMain.hs")
               (if (y-or-n-p
-                   "You need to open a buffer named DevelMain.hs. Find now?")
+                   "You need to open a buffer named DevelMain.hs.  Find now? ")
                   (ido-find-file)
-                (error "No DevelMain.hs buffer.")))
+                (error "No DevelMain.hs buffer")))
         (message "Reloading ...")
         (intero-async-call
          'backend

                 (message "[Intero] -> %s" cmd))
               (process-send-string (intero-process worker)
                                    (concat cmd "\n")))
      (error "Intero process is not running. Run M-x intero-restart to start it."))))

(defun intero-buffer (worker)
  "Get the worker buffer for the current directory."
  (let ((buffer (intero-get-buffer-create worker)))
    (if (get-buffer-process buffer)
        buffer
      (intero-get-worker-create worker nil (current-buffer)))))

(defun intero-process (worker)
  "Get the worker process for the current directory."
  (get-buffer-process (intero-buffer worker)))

(defun intero-get-worker-create (worker &optional targets source-buffer)
  "Start an Intero worker."
  (let* ((buffer (intero-get-buffer-create worker)))
    (if (get-buffer-process buffer)
        buffer


(defcustom intero-repl-no-load
  t
  "Pass --no-load when starting the repl.
This causes it to skip loading the files from the selected target."
  :group 'intero
  :type 'boolean)
(make-variable-buffer-local 'intero-repl-no-load)

(defcustom intero-repl-no-build
  t
  "Pass --no-build when starting the repl.
This causes it to skip building the target."
  :group 'intero
  :type 'boolean)
(make-variable-buffer-local 'intero-repl-no-build)
