Function: window-buffer-height

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

Signature

(window-buffer-height WINDOW)

Documentation

Return the height (in screen lines) of the buffer that WINDOW is displaying.

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

Probably introduced at or before Emacs version 21.1.

Source Code

;; Defined in /usr/src/emacs/lisp/window.el.gz
(defun window-buffer-height (window)
  "Return the height (in screen lines) of the buffer that WINDOW is displaying.
WINDOW must be a live window and defaults to the selected one."
  (setq window (window-normalize-window window t))
  (with-current-buffer (window-buffer window)
    (max 1
	 (count-screen-lines (point-min) (point-max)
			     ;; If buffer ends with a newline, ignore it when
			     ;; counting height unless point is after it.
			     (eobp)
			     window))))