diff options
author | Eli Zaretskii <eliz@gnu.org> | 2016-07-08 22:34:34 +0300 |
---|---|---|
committer | Eli Zaretskii <eliz@gnu.org> | 2016-07-08 22:34:34 +0300 |
commit | d8a9c450cf4c575d21297885d6823920aec0482f (patch) | |
tree | 35d2299a4dd5779e6c5afe2ed849c4942480c902 /test | |
parent | d0c0b71d889ff223d2e5073b733f4047d541343b (diff) |
Yet another fix for copying properties by 'format'
* src/textprop.c (extend_property_ranges): Accept an additional
argument OLD_END, and only extend the end of a property range if
its original end is at OLD_END; all the other ranges are left
intact. (Bug#23897)
* src/editfns.c (styled_format): Pass the original length of the
string to 'extend_property_ranges'.
* src/intervals.h (extend_property_ranges): Adjust prototype.
* test/src/editfns-tests.el (format-properties): Add tests for
bug#23897.
Diffstat (limited to 'test')
-rw-r--r-- | test/src/editfns-tests.el | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/test/src/editfns-tests.el b/test/src/editfns-tests.el index c515927cff..62d7bc4f5b 100644 --- a/test/src/editfns-tests.el +++ b/test/src/editfns-tests.el @@ -54,4 +54,14 @@ ;; Bug #23859 (should (ert-equal-including-properties (format "%4s" (propertize "hi" 'face 'bold)) - #(" hi" 0 4 (face bold))))) + #(" hi" 0 4 (face bold)))) + + ;; Bug #23897 + (should (ert-equal-including-properties + (format "%s" (concat (propertize "01234" 'face 'bold) "56789")) + #("0123456789" 0 5 (face bold)))) + (should (ert-equal-including-properties + (format "%s" (concat (propertize "01" 'face 'bold) + (propertize "23" 'face 'underline) + "45")) + #("012345" 0 2 (face bold) 2 4 (face underline))))) |