fit-frame-to-buffer

fit-frame-to-buffer is an interactive compiled Lisp function in `window.el'.


(fit-frame-to-buffer &optional FRAME MAX-HEIGHT MIN-HEIGHT MAX-WIDTH MIN-WIDTH ONLY)

Adjust size of FRAME to display the contents of its buffer exactly.
FRAME can be any live frame and defaults to the selected one.
Fit only if FRAME's root window is live. MAX-HEIGHT, MIN-HEIGHT,
MAX-WIDTH and MIN-WIDTH specify bounds on the new total size of
FRAME's root window. MIN-HEIGHT and MIN-WIDTH default to the values of
`window-min-height' and `window-min-width' respectively.

If the optional argument ONLY is `vertically', resize the frame
vertically only. If ONLY is `horizontally', resize the frame
horizontally only.

The new position and size of FRAME can be additionally determined
by customizing the options `fit-frame-to-buffer-sizes' and
`fit-frame-to-buffer-margins' or the corresponding parameters of
FRAME.