bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#23859: 25.1.50; Inconsistent behavior of (format "%_width_s" string-


From: Chunyang Xu
Subject: bug#23859: 25.1.50; Inconsistent behavior of (format "%_width_s" string-has-text-property)
Date: Wed, 29 Jun 2016 00:28:46 +0800

On Wed, Jun 29, 2016 at 12:11 AM, Eli Zaretskii <eliz@gnu.org> wrote:
>
> > From: Chunyang Xu <xuchunyang.me@gmail.com>
> > Date: Tue, 28 Jun 2016 12:32:57 +0800
> >
> > ;; 24.5
> > (format "%4s" (propertize "hi" 'face 'bold))
> >     ⇒ #("  hi" 2 4 (face bold))
> >
> > ;; master
> > (format "%4s" (propertize "hi" 'face 'bold))
> >     ⇒ #("  hi" 0 2 (face bold))
> >
> > is the new behavior wanted? I have code relying on the old behavior.
>
> The change in behavior is intended, but its result in this case
> reveals a 6-year old bug, now fixed on master.  After fixing the bug
> the result is
>
> (format "%4s" (propertize "hi" 'face 'bold))
>     ⇒ #("  hi" 0 4 (face bold))
>
> If this still breaks your code, I'm sorry, but you will have to adapt.
> The old behavior was buggy and inconsistent (see bug#23730), and the
> only way to make the behavior consistent and easily predictable was to
> copy the properties onto the entire text produced from a given
> argument, including any padding.  Which is what should be expected to
> happen on master now.


Thanks. It works as you described. My code now works as usual without
any changes, since white spaces (with the text properties I want)
still remains invisible.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]