[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#38191: incorrect text properties in result of `format' with multibyt
From: |
Lars Ingebrigtsen |
Subject: |
bug#38191: incorrect text properties in result of `format' with multibyte(?) characters |
Date: |
Thu, 14 Nov 2019 06:30:30 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) |
Paul Pogonyshev <pogonyshev@gmail.com> writes:
> "Multibyte" is a guess, I don't really know the underlying reason.
>
> Examples:
>
> (format (propertize "`foo' %s bar" 'face 'bold) "xxx")
> => #("`foo' xxx bar" 0 13 (face bold))
>
> (format (propertize "‘foo’ %s bar" 'face 'bold) "xxx")
> => #("‘foo’ xxx bar" 0 10 (face bold))
>
> Length of the string is the same in both cases. In the first example
> the face is correctly applied to the whole string, in the second
> example 3 last characters incorrectly lack a face.
>
> This is a regression, it used to work correctly before, but I don't
> know when it became broken.
It's always off by the length of the inserted string, so it's at least
systematic:
(format (propertize "ççfoo %s bar" 'face 'bold) "xxx")
=> #("ççfoo xxx bar" 0 10 (face bold))
(format (propertize "ççfoo %s bar" 'face 'bold) "xxxx")
=> #("ççfoo xxxx bar" 0 10 (face bold))
It doesn't happen if there's just one multibyte character in the format
spec -- there has to be two or more.
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no