help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How do I get the window height in lines, taking in account line-spac


From: Dmitry
Subject: Re: How do I get the window height in lines, taking in account line-spacing?
Date: Mon, 04 Aug 2014 22:31:46 +0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.92 (gnu/linux)

Michael Heerdegen <michael_heerdegen@web.de> writes:

> There's `window-screen-lines', but it's also not reliable when the
> window displays different fonts or images etc.

This would be fine, except even in the simple case it returns the same
mistaken result as my alternative solution in the option 1.

For example, with line-spacing 0.2 I see 48.5 text lines visible in my
maximized window, but (window-screen-lines) evaluates to 46.66(6).

> You maybe want to use `window-end' combined with
> `pos-visible-in-window-p'.

Yep, this seems to be the most accurate approach, although probably the
slowest one. Thanks.

> What's the problem you want to solve, btw?

Count the screen lines in order to determine in which direction to
render the completion popup (below or above the current line).

I've linked to the related issue in the initial message.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]