unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Dmitry <dgutov@yandex.ru>
To: Michael Heerdegen <michael_heerdegen@web.de>
Cc: help-gnu-emacs@gnu.org
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	[thread overview]
Message-ID: <86d2cg3y3x.fsf@yandex.ru> (raw)
In-Reply-To: <87oaw08hlj.fsf@web.de> (Michael Heerdegen's message of "Mon, 04 Aug 2014 16:17:12 +0200")

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	other threads:[~2014-08-04 18:31 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-04 12:11 How do I get the window height in lines, taking in account line-spacing? Dmitry Gutov
2014-08-04 14:17 ` Michael Heerdegen
2014-08-04 18:31   ` Dmitry [this message]
     [not found]     ` <CAPhAwGyGvNy5rUf2M9jaE=kBrtZNDo_Ey+F6Oq2VqzZB+OoKEA@mail.gmail.com>
2014-08-04 19:16       ` Dmitry Gutov
     [not found]       ` <mailman.6572.1407179803.1147.help-gnu-emacs@gnu.org>
2014-08-05  0:11         ` Emanuel Berg
2014-08-05  0:45           ` Dmitry
2014-08-05  1:41     ` Dmitry
2014-08-05  1:42     ` Dmitry
2014-08-05 11:55       ` Michael Heerdegen
2014-08-05 12:11         ` Dmitry
2014-08-05 12:22           ` Michael Heerdegen
2014-08-06 13:56             ` Dmitry
2014-08-06 14:47               ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=86d2cg3y3x.fsf@yandex.ru \
    --to=dgutov@yandex.ru \
    --cc=help-gnu-emacs@gnu.org \
    --cc=michael_heerdegen@web.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).