[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: format padding and text properties
From: |
Eric Abrahamsen |
Subject: |
Re: format padding and text properties |
Date: |
Wed, 22 Jun 2016 16:06:21 +0800 |
User-agent: |
Gnus/5.130014 (Ma Gnus v0.14) Emacs/25.1.50 (gnu/linux) |
<tomas@tuxteam.de> writes:
> On Wed, Jun 22, 2016 at 01:38:16PM +0800, Eric Abrahamsen wrote:
>> I'm trying to pad out a string that has had a face applied to it, and
>> it's not quite going as I'd hoped. In a nutshell:
>>
>> (setq ss "bubba")
>> (put-text-property 0 (length ss) 'face 'my-face ss)
>> (format "%10s" ss)
>>
>> --> #(" bubba" 0 5 (face my-face))
>>
>> I'd like the face to stay with the actual string, not the spaces! Does
>> text property stickiness have anything to do with this? Does anyone have
>> any clever tips?
>
> This is remarkable. I didn't even know that text properties made it
> through format (admittedly in a strange way).
>
> Learnt something new today :-)
So you're saying I shouldn't expect this to Just Work? :)