Function: window-text-width

window-text-width is a function defined in window.c.

Signature

(window-text-width &optional WINDOW PIXELWISE)

Documentation

Return the width in columns of the text display area of WINDOW.

WINDOW must be a live window and defaults to the selected one.

The returned width does not include dividers, scrollbars, margins, fringes, nor any partial-width columns at the right of the text area.

Optional argument PIXELWISE non-nil, means to return the width in pixels.

Source Code

// Defined in /usr/src/emacs/src/window.c
{
  struct window *w = decode_live_window (window);

  if (NILP (pixelwise))
    return make_fixnum (window_box_width (w, TEXT_AREA)
			/ FRAME_COLUMN_WIDTH (WINDOW_XFRAME (w)));
  else
    return make_fixnum (window_box_width (w, TEXT_AREA));
}