diff options
| author | Pip Cet <pipcet@protonmail.com> | 2026-05-24 09:17:44 +0000 |
|---|---|---|
| committer | Pip Cet <pipcet@protonmail.com> | 2026-05-24 09:23:05 +0000 |
| commit | c146e3643c4eb2fc52fa730df9388544a31feb40 (patch) | |
| tree | f049bc2ea738c5c858cf98961563d86c51612ce5 /test | |
| parent | 6932c940fda848422cb6c66c81c9d7a108e8320b (diff) | |
Fix off-by-one error in 'styled_format'
This would (rarely) result in composition properties being shared
across the concatenation of two copies of a string.
* src/editfns.c (styled_format): Include the first argument in the
range.
* test/src/editfns-tests.el (editfns-tests--format-composition-property):
New.
Diffstat (limited to 'test')
| -rw-r--r-- | test/src/editfns-tests.el | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/src/editfns-tests.el b/test/src/editfns-tests.el index 9bdd5cf5db6..e6f80d0ef48 100644 --- a/test/src/editfns-tests.el +++ b/test/src/editfns-tests.el @@ -938,4 +938,13 @@ sufficiently large to avoid truncation." (pos-bol 2) (pos-eol 2)) (should (equal (buffer-string) "toto\nEmacs forever!\n")))) +(ert-deftest editfns-tests--format-composition-property () + "Check that composition properties are un-identified by `format'." + (let* ((s (compose-chars ?a ?b ?c)) + (str (format "%s%s%s" s s s))) + (should-not (eq (get-text-property 0 'composition str) + (get-text-property 3 'composition str))) + (should-not (eq (get-text-property 3 'composition str) + (get-text-property 6 'composition str))))) + ;;; editfns-tests.el ends here |
