unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Po Lu <luangruo@yahoo.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: help-gnu-emacs@gnu.org
Subject: Re: Correct way to implement `pixel-point-and-height-at-unseen-line'?
Date: Tue, 14 Dec 2021 21:48:35 +0800	[thread overview]
Message-ID: <871r2fthzg.fsf@yahoo.com> (raw)
In-Reply-To: <83bl1jl3ej.fsf@gnu.org> (Eli Zaretskii's message of "Tue, 14 Dec 2021 15:30:44 +0200")

Eli Zaretskii <eliz@gnu.org> writes:

> Did you try something like this:
>
>   (save-excursion
>     (goto-char (window-start))
>     (vertical-motion (- (ceiling N (frame-char-height))))
>     (point))
>
> where N is your number of pixels?

That won't always work correctly with lines of different height: for
example, if the line above start is smaller than the default character
height of the frame, the number of lines by which to move upwards could
be too small.



  reply	other threads:[~2021-12-14 13:48 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <87pmq1wag9.fsf.ref@yahoo.com>
2021-12-13  1:38 ` Correct way to implement `pixel-point-and-height-at-unseen-line'? Po Lu
2021-12-13  2:20   ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-12-13  2:49     ` Po Lu
2021-12-13  3:04       ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-12-13  3:18         ` Po Lu
2021-12-13 23:41           ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-12-14  0:41             ` Po Lu
2021-12-13 14:32   ` Eli Zaretskii
2021-12-14  0:41     ` Po Lu
2021-12-14 13:30       ` Eli Zaretskii
2021-12-14 13:48         ` Po Lu [this message]
2021-12-14 14:26           ` Eli Zaretskii
2021-12-15  0:40             ` Po Lu
2021-12-15 13:11               ` 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=871r2fthzg.fsf@yahoo.com \
    --to=luangruo@yahoo.com \
    --cc=eliz@gnu.org \
    --cc=help-gnu-emacs@gnu.org \
    /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).