[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: format padding and text properties
From: |
tomas |
Subject: |
Re: format padding and text properties |
Date: |
Wed, 22 Jun 2016 08:08:29 +0200 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
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 :-)
regards
- -- t
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)
iEYEARECAAYFAldqK10ACgkQBcgs9XrR2kaLlgCeKWgaxjgec2jD4zRnKIowTtV9
vl4An2hzEejXYD356p5U4CXAqWsP5BWg
=y28V
-----END PGP SIGNATURE-----