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: Eli Zaretskii
Subject: bug#23859: 25.1.50; Inconsistent behavior of (format "%_width_s" string-has-text-property)
Date: Tue, 28 Jun 2016 19:11:12 +0300

> 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.





reply via email to

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