Subject: Re: bug#76107: Consider image specs when scanning for a column

From: Eli Zaretskii <[email-masked]>
Date: Fri, 07 Feb 2025 21:55:56 +0200

> From: Thuna <[email-masked]>
> Cc: [email-masked]
> Date: Fri, 07 Feb 2025 18:37:00 +0100
> 
> > But everything is _not_ visible.  For example, if the image is at the
> > left edge of the window and the window is hscrolled, part of the image
> > will be invisible, and the columns of characters after it will be
> > incorrect.
> 
> Maybe I have this all wrong, but shouldn't we be scanning from the very
> beginning of the line, and not just the _visible_ beginning?
> 
> When we have a row with the contents
> 
>   "some long text with a lot of characters that we need to scroll to see properly"
> 
> and we have it hscrolled until the visible row starts at "characters",
> current-column at the start of "characters" is still 29 and not 0.
> 
> Similarly, I would think that given
> 
>   "#<image :width 10em>foo bar"
> 
> with the buffer hscrolled until it only shows "foo bar", we would want
> current-column at the start of "foo" to be 10 and not 0, even though the
> display width of the image is 0 (since it's not visible), because the
> "actual" width of the image (that is, what its width _would_ be if we
> could see it all) is 10.

Maybe you are right.  But anyway, this is not the main point I was
trying to make.  The main point is that using image-size is not
accurately reproduce the actual horizontal coordinate on the screen.

Can you tell why you need image support in current-column and friends?
E.g., why posn-col-row and vertical-motion cannot do what you need?