# libtmux.query:where-if

- **Package:** libtmux/query
- **Language:** Common Lisp
- **Kind:** function
- **Source:** https://github.com/libtmux/libtmux-lisp/blob/c2e5fc4ed3befda21f45dfa5d5868c38fd138311/src/query.lisp#L769
- **Public owner:** libtmux.query
- **Page:** https://libtmux.org/en/lisp/latest/reference/libtmux-query-where-if/

```
(where-if set function &key (max-items +default-max-selection-items+))
```

Return a new query set selected by native FUNCTION in input order.
FUNCTION is a function object or a symbol naming a global function, resolved
once before traversal. Invalid designators signal LIBTMUX:INVALID-ARGUMENT.
On normal completion it has been called exactly once per item, eagerly and
locally. Its effects and call order are never optimized as declarative data.
The result owns its container and shares the selected items with SET.

See also: `libtmux.query:from`, `libtmux.query:items`, `libtmux.query:order-by`, `libtmux.query:where`.

## Parameters

- `set`
- `function`
- `max-items?`

## Guides

Pages that discuss `where-if`.

- [Native queries](/en/lisp/latest/guides/queries/)
