Function: get-window-with-predicate

Return a live window satisfying PREDICATE.
More precisely, cycle through all windows calling the function
PREDICATE on each one of them with the window as its sole
argument. Return the first window for which PREDICATE returns
non-nil. Windows are scanned starting with the window following
the selected window. If no window satisfies PREDICATE, return
DEFAULT.

MINIBUF t means include the minibuffer window even if the
minibuffer is not active. MINIBUF nil or omitted means include
the minibuffer window only if the minibuffer is active. Any
other value means do not include the minibuffer window even if
the minibuffer is active.

ALL-FRAMES nil or omitted means consider all windows on the selected
frame, plus the minibuffer window if specified by the MINIBUF
argument. If the minibuffer counts, consider all windows on all
frames that share that minibuffer too. The following non-nil
values of ALL-FRAMES have special meanings:

- t means consider all windows on all existing frames.

- `visible' means consider all windows on all visible frames on
the current terminal.

- 0 (the number zero) means consider all windows on all visible
and iconified frames on the current terminal.

- A frame means consider all windows on that frame only. Anything else means consider all windows on the selected frame and no others.