emacs-devel
[Top][All Lists]
Advanced

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

Re: Pixel scrolling support


From: Eli Zaretskii
Subject: Re: Pixel scrolling support
Date: Fri, 26 Nov 2021 14:42:14 +0200

> From: Po Lu <luangruo@yahoo.com>
> Cc: monnier@iro.umontreal.ca,  emacs-devel@gnu.org
> Date: Fri, 26 Nov 2021 20:09:22 +0800
> 
> Eli Zaretskii <eliz@gnu.org> writes:
> 
> >> I use `posn-at-x-y' to determine the position closest to the first line
> >> to be displayed on screen after the window is vscrolled by DELTA.
> 
> > How do you know which line is "the first line to be displayed on
> > screen after the window is vscrolled by DELTA"?  That's the bit I'm
> > missing, I think.
> 
> Basically, the first line that's displayed in the window (which might
> not be the line at window start if the window is vscrolled).

If that position is outside the window, you should be able to use
window-text-pixel-size to get the information.

> > What is "the delta by which the window is being scrolled"?  Is that
> > the window's vscroll or is that something else?
> 
> It's the pixel delta by which the window will be scrolled vertically.

Sorry, I don't understand how this is relevant pos-visible-in-window-p
can tell you the pixel coordinates of EOB if it is inside the window.
If the EOB is inside the window, you should not scroll at all and
return immediately, so as to avoid the annoying error.

> > Of course, it does.  It might not be exposed to Lisp (I didn't look
> > closely enough), but it is certainly supported on the C level.
> 
> Hmm, it would be great to expose that to Lisp, as right now
> `set-window-hscroll' only accepts columns and not pixels.

Patches welcome.



reply via email to

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