Eli Zaretskii writes: >> From: Po Lu >> Cc: emacs-devel@gnu.org >> Date: Sun, 19 Dec 2021 17:16:31 +0800 >> >> > When window-start is inside a display property or overlay (i.e., the >> > first thing shown in the window is the result of that display >> > property/overlay), starting from the underlying buffer position will >> > almost definitely affect the results, because that buffer position >> > could be at a very different position on the screen. For example, >> > what happens if window-start position has a before-string, and that >> > string has a 'display' property specifying an image? This should >> > display the image as the first display element at the window >> > beginning, and the buffer position of window-start will then be to the >> > right and possibly also at a different Y coordinate. >> >> Hmm, perhaps that condition should be removed in this case then. > > Not sure I understand what condition did you allude to here, and how > did you propose to remove it. I wanted to say that I removed the call reseat in that case as we're certainly already at the beginning of a visual line. Sorry for being vague. Anyway, here's a patch that extends the argument to also be able to measure from a certain amount of pixels after a given position, and not just before. Thanks.