 (defun intero-targets ()
   "Set the targets to use for stack ghci."
   (interactive)
-  (let ((targets (split-string (read-from-minibuffer "Targets: ")
-                               " "
-                               t)))
+  (let* ((old-targets
+          (with-current-buffer (intero-buffer 'backend)
+            intero-targets))
+         (available-targets (intero-get-targets))
+         (targets (if available-targets
+                      (intero-multiswitch
+                       "Targets:"
+                       (mapcar (lambda (target)
+                                 (list :key target
+                                       :title target
+                                       :default (member target old-targets)))
+                               available-targets))
+                    (split-string (read-from-minibuffer "Targets: " nil nil nil nil old-targets)
+                                  " "
+                                  t))))
     (intero-destroy)
     (intero-get-worker-create 'backend targets (current-buffer))))
 

                            "--verbosity" "silent"))
            (buffer-substring (line-beginning-position) (line-end-position))))))

(defun intero-package-name (&optional cabal-file)
  "Get the current package name from a nearby .cabal file. If
there is none, return empty string."


(defun intero-multiswitch (title options)
  "Read multiple flags from a list of OPTIONS each of which is a
  plist of (:key :default :title). :key should be something
  comparable with EQUAL, :title should be a
  string, :default (boolean) specifies the default checkedness."
  (let ((available-width (window-total-width)))
    (save-window-excursion
      (with-temp-buffer
