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

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

Re: Correct way to implement `pixel-point-and-height-at-unseen-line'?


From: Eli Zaretskii
Subject: Re: Correct way to implement `pixel-point-and-height-at-unseen-line'?
Date: Tue, 14 Dec 2021 16:26:01 +0200

> 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?



reply via email to

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