GNU bug report logs - #23730
24.5; format removes text properties

Previous Next

Package: emacs;

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


View this message in rfc822 format

From: Eli Zaretskii <eliz <at> gnu.org>
To: ynyaaa <at> gmail.com
Cc: 23730 <at> debbugs.gnu.org
Subject: bug#23730: 24.5; format removes text properties
Date: Wed, 08 Jun 2016 19:57:10 +0300
> 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.