diff options
| author | Eli Zaretskii | 2016-07-08 22:34:34 +0300 |
|---|---|---|
| committer | Eli Zaretskii | 2016-07-08 22:34:34 +0300 |
| commit | d8a9c450cf4c575d21297885d6823920aec0482f (patch) | |
| tree | 35d2299a4dd5779e6c5afe2ed849c4942480c902 /test/src | |
| parent | d0c0b71d889ff223d2e5073b733f4047d541343b (diff) | |
| download | emacs-d8a9c450cf4c575d21297885d6823920aec0482f.tar.gz emacs-d8a9c450cf4c575d21297885d6823920aec0482f.zip | |
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/src')
| -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 c515927cff1..62d7bc4f5be 100644 --- a/test/src/editfns-tests.el +++ b/test/src/editfns-tests.el | |||
| @@ -54,4 +54,14 @@ | |||
| 54 | ;; Bug #23859 | 54 | ;; Bug #23859 |
| 55 | (should (ert-equal-including-properties | 55 | (should (ert-equal-including-properties |
| 56 | (format "%4s" (propertize "hi" 'face 'bold)) | 56 | (format "%4s" (propertize "hi" 'face 'bold)) |
| 57 | #(" hi" 0 4 (face bold))))) | 57 | #(" hi" 0 4 (face bold)))) |
| 58 | |||
| 59 | ;; Bug #23897 | ||
| 60 | (should (ert-equal-including-properties | ||
| 61 | (format "%s" (concat (propertize "01234" 'face 'bold) "56789")) | ||
| 62 | #("0123456789" 0 5 (face bold)))) | ||
| 63 | (should (ert-equal-including-properties | ||
| 64 | (format "%s" (concat (propertize "01" 'face 'bold) | ||
| 65 | (propertize "23" 'face 'underline) | ||
| 66 | "45")) | ||
| 67 | #("012345" 0 2 (face bold) 2 4 (face underline))))) | ||