emacs-devel
[Top][All Lists]
Advanced

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

Re: move_it_vertically_backward question


From: Eli Zaretskii
Subject: Re: move_it_vertically_backward question
Date: Thu, 16 Dec 2021 15:27:10 +0200

> From: Po Lu <luangruo@yahoo.com>
> Cc: emacs-devel@gnu.org
> Date: Thu, 16 Dec 2021 20:17:45 +0800
> 
> Po Lu <luangruo@yahoo.com> writes:
> 
> > I can't think of anything better.
> 
> Now that I think of it, how about this: we introduce a primitive
> `line-above-point-by', which returns the line N pixels above a given
> point in the current window

What would such a primitive be used for, except for your specific use
case?

And even in that use case, it's better to have a single primitive that
does both this job and the text-dimension measuring job than having 2
separate primitives that you'd need to call from Lisp.  If nothing
else, you lose the information collected by the iterator in the first
call, and cannot use it in the second.  Moreover, position found by
the iterator cannot be always easily communicated to another
primitive, because that position could be inside a display or overlay
string, not at a buffer position.

> and a new `no-ascent-descent' argument to window-text-pixel-size,
> that avoids adding the ascent and descent of the iterator to the
> height before returning it?

Since ascent+descent are the line height, I don't understand why this
would be useful.



reply via email to

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