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

From: Eli Zaretskii <[email-masked]>
Date: Thu, 13 Feb 2025 11:28:40 +0200

> Cc: [email-masked]
> Date: Mon, 10 Feb 2025 18:42:10 +0200
> From: Eli Zaretskii <[email-masked]>
> 
> > Still, here's my best shot.  I have attached a version of
> > `scan_for_column' which uses `move_it_in_display_line', which I've
> > written with my very limited understanding of how this is all supposed
> > to work.  I can't even test it, since I don't know how I would go about
> > recovering all the `prev*' values, but is it at least _somewhat_ in the
> > right direction?
> 
> It is in the right direction, yes.  But I see now that we can make it
> even simpler: we don't need move_it_in_display_line, we only need to
> call produce_image_glyph (after setting up the 'struct it' object as
> produce_image_glyph expects).  Then the width of the image on display
> will be in it->pixel_width, and all that's left is convert that to
> columns.
> 
> Then we just need to call this new code from check_display_width when
> we find an image display property.  The rest of the code in
> scan_for_column is okay and doesn't need to be replaced with move_it_*
> functions.
> 
> So if you can implement this idea, feel free to show the resulting
> patch.  Alternatively, wait for a few days until I find enough free
> time to sit down and code this myself.

Please tell me if you are or will be working on this, or you are
waiting for me to do it?  I'd like to avoid duplicate work.