     (progn ad-do-it)))
 
 ;; TODO: (defadvice display-buffer-other-frame ...)?
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;; Mode toggling
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+(defun jail-windows--frame-active-p (&optional frame)
+  "[Internal] Read whether jail-windows-mode should be active from the frame
+parameters."
+  (frame-parameter frame 'jail-windows-mode))
+
+(defun jail-windows--set-frame-active (state &optional frame)
+  "[Internal] Set frame parameter for whether jail-windows-mode should be
+active."
+  (modify-frame-parameters nil (list (cons 'jail-windows-mode state))))
 
 ;;;###autoload
 (define-minor-mode jail-windows-mode

  :global t
  :variable ((jail-windows/active-p) .
             (lambda (state)
               (modify-frame-parameters nil `((jail-windows-mode . ,state)))))
  (when (jail-windows/active-p)
    (jail-windows/activate-layout
     (or (jail-windows--get-option nil
                                   'active-layout)

                      "^\\*Locate\\*$"
                      "^\\*magit-\\(diff\\|commit\\)"
                      "^\\*Man "
                      "^\\*Occur\\*$"
                      "^\\*Pp Eval Output\\*$"
                      "^\\*\\(Wo\\)?Man"
                      "^COMMIT_EDITMSG$")
