Subject: bug#64696: 30.0.50; indent-to inherits preceding text properties, including 'invisible

From: Ihor Radchenko <[email-masked]>
Date: Fri, 28 Jul 2023 08:06:54 +0000

Eli Zaretskii <[email-masked]> writes:

>> Using :align-to space spec and font-lock-keywords.
>> This can work, although it is unfortunate that there is no "stretch"
>> space that will automatically occupy as much space as possible without
>> pushing the line across right fringe.
>
> Of course, there is: use the 'right' position with a negative offset.

This indeed works, but the annoying part is calculating the offset. One
needs to use `string-pixel-width', which is not always reliable.(Org has
its own `org-string-width', but it is still not good enough and
sometimes creates a few pixel overflows leading to line wraps).

The most robust way would be delegating offset calculation to the
redisplay of the actual line being displayed. That will guarantee
absence of inconsistencies. That's why I asked for "stretch" space
feature.

>> I think that the main source of the confusion is the first line "Return
>> width of STRING when displayed in the current buffer", which sounds like
>> certain buffer-specific display things are affecting the result.
>
> Feel free to suggest a single short enough sentence which doesn't have
> this issue, and yet does explain that the value is not just the count
> of characters in the string.

Return width of STRING when displayed using fixed width font.

However, if I look into the code, it looks like buffer-display-table is
also taking into account. And string_char_and_length, which I do not
fully understand. And glyphs appear to honor variable pitch font, if it
is default.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>