Function: window-total-height

window-total-height is a function defined in window.c.

Signature

(window-total-height &optional WINDOW ROUND)

Documentation

Return the height of window WINDOW in lines.

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

The return value includes the heights of WINDOW's mode and header line and its bottom divider, if any. If WINDOW is an internal window, the total height is the height of the screen areas spanned by its children.

If WINDOW's pixel height is not an integral multiple of its frame's character height, the number of lines occupied by WINDOW is rounded internally. This is done in a way such that, if WINDOW is a parent window, the sum of the total heights of all its children internally equals the total height of WINDOW.

If the optional argument ROUND is ceiling, return the smallest integer larger than WINDOW's pixel height divided by the character height of WINDOW's frame. ROUND floor means to return the largest integer smaller than WINDOW's pixel height divided by the character height of WINDOW's frame. Any other value of ROUND means to return the internal total height of WINDOW.

View in manual

Probably introduced at or before Emacs version 24.1.

Aliases

reftex-window-height (obsolete since 30.1) window-height

Source Code

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

  if (! EQ (round, Qfloor) && ! EQ (round, Qceiling))
    return make_fixnum (w->total_lines);
  else
    {
      int unit = FRAME_LINE_HEIGHT (WINDOW_XFRAME (w));

      return make_fixnum (EQ (round, Qceiling)
			  ? ((w->pixel_height + unit - 1) /unit)
			  : (w->pixel_height / unit));
    }
}