Function: frame-height

frame-height is a byte-compiled function defined in frame.el.gz.

Signature

(frame-height &optional FRAME)

Documentation

Return number of lines available for display on FRAME.

If FRAME is omitted, describe the currently selected frame. Exactly what is included in the return value depends on the window-system and toolkit in use - see frame-pixel-height for more details. The lines are in units of the default font height.

The result is roughly related to the frame pixel height via height in pixels = height in lines * frame-char-height. However, this is only approximate, and is complicated e.g. by the fact that individual window lines and menu bar lines can have differing font heights.

View in manual

Probably introduced at or before Emacs version 29.1.

Source Code

;; Defined in /usr/src/emacs/lisp/frame.el.gz
;;;; Convenience functions for accessing and interactively changing
;;;; frame parameters.

(defun frame-height (&optional frame)
  "Return number of lines available for display on FRAME.
If FRAME is omitted, describe the currently selected frame.
Exactly what is included in the return value depends on the
window-system and toolkit in use - see `frame-pixel-height' for
more details.  The lines are in units of the default font height.

The result is roughly related to the frame pixel height via
height in pixels = height in lines * `frame-char-height'.
However, this is only approximate, and is complicated e.g. by the
fact that individual window lines and menu bar lines can have
differing font heights."
  (cdr (assq 'height (frame-parameters frame))))