diff options
| author | Noam Postavsky | 2018-01-23 18:50:23 -0500 |
|---|---|---|
| committer | Noam Postavsky | 2018-01-28 10:43:01 -0500 |
| commit | 36c8128e740ce91af10769bef46a21a72dafc56c (patch) | |
| tree | 19a2dd3106c0e65b2e12cb4f7e542f6d9e9d2aa1 /test/src | |
| parent | 69a30e8b87fac5888daa26c63663351570e3d533 (diff) | |
| download | emacs-36c8128e740ce91af10769bef46a21a72dafc56c.tar.gz emacs-36c8128e740ce91af10769bef46a21a72dafc56c.zip | |
Fix round tripping of read->print for symbols with strange quotes
Since 2017-07-22 "Signal error for symbol names with strange
quotes (Bug#2967)", symbol names beginning with certain quote
characters require an escaping backslash. However, the corresponding
change for printing missed, so that (eq (read (prin1-to-string SYM))
SYM) does not give `t' for such symbols.
* src/character.c (confusable_symbol_character_p): New function,
extracted from test `read1'.
* src/lread.c (read1): Use it.
* src/print.c (print_object): Use it to print a backslash for symbols
starting with characters that `read1' requires to be escaped.
* test/src/print-tests.el (print-read-roundtrip): New test.
* etc/NEWS.26:
* etc/NEWS: Clarify the announcement for the earlier reader
change (Bug#30217).
Diffstat (limited to 'test/src')
| -rw-r--r-- | test/src/print-tests.el | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/test/src/print-tests.el b/test/src/print-tests.el index 46368c69ada..01e65028bc7 100644 --- a/test/src/print-tests.el +++ b/test/src/print-tests.el | |||
| @@ -58,5 +58,9 @@ | |||
| 58 | (buffer-string)) | 58 | (buffer-string)) |
| 59 | "--------\n")))) | 59 | "--------\n")))) |
| 60 | 60 | ||
| 61 | (ert-deftest print-read-roundtrip () | ||
| 62 | (let ((sym '\’bar)) | ||
| 63 | (should (eq (read (prin1-to-string sym)) sym)))) | ||
| 64 | |||
| 61 | (provide 'print-tests) | 65 | (provide 'print-tests) |
| 62 | ;;; print-tests.el ends here | 66 | ;;; print-tests.el ends here |