         (if (-contains? regexp-list buffer-name)
             ;; When it does match, only use windows from this group
             (progn
-              (message "Using windows: %s" window-list)
               (setq matched-group t)
               (setq available-windows window-list))
           ;; When it doesn't, remove this group's windows from the list


    ;; Pick among the remaining windows
    (when available-windows
      ;; TODO: Look for an active one
      (car available-windows))))

(defadvice display-buffer (around jail-window-hook activate)
  "Handles jailing the window"
  (if (jail-windows/active-p)
      (progn (let ((display-buffer-overriding-action
                    '(jail-windows--display-buffer-override)))
               ad-do-it))
    (progn ad-do-it)))

(defadvice display-buffer-other-frame (around jail-window-hook activate)
  "Handles jailing the window"
  (if (jail-windows/active-p)
      (let ((display-buffer-overriding-action
                    '(jail-windows--display-buffer-override)))
               ad-do-it)
    (progn ad-do-it)))


    (modify-frame-parameters (or frame (selected-frame))
                             `((jail-windows-options . ,options)))))

(defun jail-windows--prompt-for-layout (prompt
                                        &optional predicate initial-input)
  "[Internal] Prompt the user for a layout."
  (let ((choices (list (-map #'car jail-windows--registered-layouts)))
        (choice))
    (setq choice (completing-read prompt choices predicate t initial-input))
    (if (equal choice "")
        (car (car choices))
      (intern choice))))
