Subject: bug#14636: 24.3.50.1; window-line-height doesn't seem to work, unless the point is at the end-of-buffer

From: E Sabof <[email-masked]>
Date: Sun, 16 Jun 2013 17:44:07 +0100

On Sun, Jun 16, 2013 at 5:35 PM, Eli Zaretskii <[email-masked]> wrote:

> > Date: Sun, 16 Jun 2013 16:24:43 +0100
> > From: E Sabof <[email-masked]>
> >
> > In emacs -Q
> >
> > (window-line-height)
> > C-o
> > C-x C-e
> >
> > Results in nil.
>
> That's a documented limitation.  From the doc string:
>
>   Return nil if window display is not up-to-date.  In that case, use
>   `pos-visible-in-window-p' to obtain the information.
>
> > Interestingly enough, I can specify line numbers (or not) and it will
> work,
> > but only as long as (= (point) (point-max))
>
> You cannot easily predict when the window display will be up-to-date
> by the time this function runs.
>
> Closing as not-a-bug.
>

I have also tried

(progn (pos-visible-in-window-p)
       (window-line-height))

but it didn't seem to make any difference.