From: Eli Zaretskii <eliz@gnu.org>
To: help-gnu-emacs@gnu.org
Subject: Re: Correct way to implement `pixel-point-and-height-at-unseen-line'?
Date: Tue, 14 Dec 2021 16:26:01 +0200 [thread overview]
Message-ID: <835yrrl0ue.fsf@gnu.org> (raw)
In-Reply-To: <871r2fthzg.fsf@yahoo.com> (message from Po Lu on Tue, 14 Dec 2021 21:48:35 +0800)
> From: Po Lu <luangruo@yahoo.com>
> Cc: help-gnu-emacs@gnu.org
> Date: Tue, 14 Dec 2021 21:48:35 +0800
>
> 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.
But if you always need the line before window-start, i.e. use N = 1,
then why is that a problem?
next prev parent reply other threads:[~2021-12-14 14:26 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
2021-12-14 14:26 ` Eli Zaretskii [this message]
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=835yrrl0ue.fsf@gnu.org \
--to=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).