window-width

window-width is an alias for `window-body-width' in `window.el'.

(window-width &optional WINDOW PIXELWISE)

Return the width of WINDOW's text area.
WINDOW must be a live window and defaults to the selected one. Optional
argument PIXELWISE non-nil means return the width in pixels. The return
value does not include any vertical dividers, fringes or marginal areas,
or scroll bars.

If PIXELWISE is nil, return the largest integer smaller than WINDOW's
pixel width divided by the character width of WINDOW's frame. This
means that if a column at the right of the text area is only partially
visible, that column is not counted.