resize-temp-buffer-window

resize-temp-buffer-window is a compiled Lisp function in `help.el'.

(resize-temp-buffer-window &optional WINDOW)

Resize WINDOW to fit its contents.
WINDOW must be a live window and defaults to the selected one.
Do not resize if WINDOW was not created by `display-buffer'.

If WINDOW is part of a vertical combination, restrain its new
size by `temp-buffer-max-height' and do not resize if its minimum
accessible position is scrolled out of view. If WINDOW is part
of a horizontal combination, restrain its new size by
`temp-buffer-max-width'. In both cases, the value of the option
`fit-window-to-buffer-horizontally' can inhibit resizing.

If WINDOW is the root window of its frame, resize the frame
provided `fit-frame-to-buffer' is non-nil.

This function may call `preserve-window-size' to preserve the
size of WINDOW.