diff options
author | Philipp Stephani <phst@google.com> | 2017-06-03 11:16:21 +0200 |
---|---|---|
committer | Philipp Stephani <phst@google.com> | 2017-06-03 11:19:02 +0200 |
commit | 7d413cb4da89e0bdd70068e6a5e1dbc57190ed10 (patch) | |
tree | 6ca93c8b51c29a3189d00abdc5d1f419981b8b81 /test/src | |
parent | 0147cdd4d96f1eaeef720ee0b89bddd27eaf4233 (diff) | |
download | emacs-7d413cb4da89e0bdd70068e6a5e1dbc57190ed10.tar.gz |
Fix a bug when using format field numbers
Previously styled_format overwrite the argument vector. This is no
longer possible because there might be more than one specification per
argument. Use the existing auxiliary info array instead.
* src/editfns.c (styled_format): Record arguments in the info
structure instead of overwriting them.
* test/src/editfns-tests.el (format-with-field): Add unit test.
Diffstat (limited to 'test/src')
-rw-r--r-- | test/src/editfns-tests.el | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/test/src/editfns-tests.el b/test/src/editfns-tests.el index 54fb743e192..3073e371933 100644 --- a/test/src/editfns-tests.el +++ b/test/src/editfns-tests.el @@ -205,6 +205,7 @@ (should (equal (should-error (format "a %$s b" 11)) '(error "Invalid format operation %$"))) (should (equal (should-error (format "a %-1$s b" 11)) - '(error "Invalid format operation %$")))) + '(error "Invalid format operation %$"))) + (should (equal (format "%1$c %1$s" ?±) "± 177"))) ;;; editfns-tests.el ends here |