Subject: bug#71605: 30.0.50; [PATCH] Support variable-width text in 'visual-wrap-prefix-mode'

From: Eli Zaretskii <[email-masked]>
Date: Tue, 18 Jun 2024 14:37:40 +0300

> Date: Mon, 17 Jun 2024 11:44:47 -0700
> Cc: [email-masked]
> From: Jim Porter <[email-masked]>
> 
> Replying to your individual points below, but in the other subthread, I 
> had the idea that maybe a better way to do this would be for the wrap 
> prefix to always be the first-line prefix but to make it transparent 
> when desired. So for the "* some text" example, the wrap-prefix would be 
> "* " but fontified(?) such that you can't see it.

I don't think I understand how would this do the job.  Surely, the
indentation space should be visible?

> A face transparency attribute might do the trick, and be useful for 
> other things too: 

It isn't universally supported, AFAIK.

> Or maybe :align-to could take a string value, which would mean "use the 
> pixel-width of this string as the value".

How is that different from using a column (as opposed to pixel) value
for :align-to?

> >> If I set that correctly, then the pixel-size should adjust as the
> >> text scales. It wouldn't handle the case where the actual font
> >> changes though.
> > 
> > Why not?
> 
> I was planning to set :relative-width to <first_line_prefix_width> / 
> <width_of_one_space>. If the font changes, the result of that 
> calculation can change.

The idea is to set it to the multiple of the character's width, which
will then scale with the font.

> > If you can pass a window, you can use window-text-pixel-size instead.
> 
> I think 'window-text-pixel-size' would compute the size of the text 
> already in the buffer

Yes, and we have with-current-buffer...