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: Po Lu
Subject: Re: Correct way to implement `pixel-point-and-height-at-unseen-line'?
Date: Mon, 13 Dec 2021 10:49:53 +0800
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.60 (gnu/linux)

Emanuel Berg via Users list for the GNU Emacs text editor
<help-gnu-emacs@gnu.org> writes:

> Po Lu wrote:
>
>> I don't know how to make
>> `pixel-point-and-height-at-unseen-line' work correctly: if
>> I use `line-pixel-height', it will only report the height
>> the first individual line inside a display string if there
>> is one above window start, but if I use
>> `window-text-pixel-size', I have to determine the region to
>> measure, which is quite troublesome.
>>
>> For example, window start is often not the beginning of
>> a visual line
>
> `window-start', `beginning-of-visual-line' ...
>
> You can post the code instead ... that way you don't have to
> remove the dashes.
>
>> This works okay until there is a `line-prefix' property at
>> window start: in this case, window start is the beginning of
>> a visual line, but it does not display at the beginning of
>> the line, which means `window-text-pixel-size' will add the
>> height of the current line to that of the previous line.
>> I will add a workaround to pixel-scroll.el, but there must
>> be a cleaner way to implement this.
>
> Sounds pretty clean to me but difficult to say since you are
> not posting the actual code.

It's in pixel-scroll.el inside the lisp folder on master.  See
`pixel-point-and-height-at-unseen-lie'.

Thanks.


reply via email to

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