GNU bug report logs -
#23730
24.5; format removes text properties
Previous Next
Reported by: ynyaaa <at> gmail.com
Date: Wed, 8 Jun 2016 13:43:02 UTC
Severity: normal
Found in version 24.5
Fixed in version 26.1
Done: Glenn Morris <rgm <at> gnu.org>
Bug is archived. No further changes may be made.
Full log
Message #8 received at 23730 <at> debbugs.gnu.org (full text, mbox):
> From: ynyaaa <at> gmail.com
> Date: Wed, 08 Jun 2016 22:41:46 +0900
>
>
> `format' may remove text properties.
> Second form is an example.
>
> (format (propertize "%d" 'face '(:background "red")) 1)
> =>#("1" 0 1 (face (:background "red")))
>
> (format (propertize "%2d" 'face '(:background "red")) 1)
> =>" 1"
>
> (format (propertize "%02d" 'face '(:background "red")) 1)
> =>#("01" 0 2 (face (:background "red")))
Why did you expect the properties of the format specifier to be
preserved? The documentation only promises that the characters
_other_ than the format specifier are copied with their properties,
but makes no such promises about the specifier.
IOW, this is the intended behavior. If you want the result of the
conversion to have some properties, you should propertize the return
value.
This bug report was last modified 8 years and 166 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.