From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eric Abrahamsen Newsgroups: gmane.emacs.help Subject: Re: format padding and text properties Date: Wed, 22 Jun 2016 16:06:21 +0800 Message-ID: <87bn2twsua.fsf@ericabrahamsen.net> References: <871t3pye9j.fsf@ericabrahamsen.net> <20160622060829.GA32666@tuxteam.de> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1466582887 26722 80.91.229.3 (22 Jun 2016 08:08:07 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 22 Jun 2016 08:08:07 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Jun 22 10:07:58 2016 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1bFdCY-0001rB-Dp for geh-help-gnu-emacs@m.gmane.org; Wed, 22 Jun 2016 10:07:58 +0200 Original-Received: from localhost ([::1]:56399 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bFdCX-0005CG-JB for geh-help-gnu-emacs@m.gmane.org; Wed, 22 Jun 2016 04:07:57 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:36902) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bFdBD-0004bC-Cc for help-gnu-emacs@gnu.org; Wed, 22 Jun 2016 04:06:36 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bFdB7-00081Q-Dl for help-gnu-emacs@gnu.org; Wed, 22 Jun 2016 04:06:34 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:34986) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bFdB7-00081K-7H for help-gnu-emacs@gnu.org; Wed, 22 Jun 2016 04:06:29 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1bFdB5-0008RR-EQ for help-gnu-emacs@gnu.org; Wed, 22 Jun 2016 10:06:27 +0200 Original-Received: from 123.115.138.47 ([123.115.138.47]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 22 Jun 2016 10:06:27 +0200 Original-Received: from eric by 123.115.138.47 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 22 Jun 2016 10:06:27 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 22 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 123.115.138.47 User-Agent: Gnus/5.130014 (Ma Gnus v0.14) Emacs/25.1.50 (gnu/linux) Cancel-Lock: sha1:wgGNrueMfZn4s+imXbonEUfZl7g= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:110547 Archived-At: 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? :)