summaryrefslogtreecommitdiff
path: root/src/character.h
diff options
context:
space:
mode:
authorNoam Postavsky <npostavs@gmail.com>2018-01-23 18:50:23 -0500
committerNoam Postavsky <npostavs@gmail.com>2018-01-28 10:43:01 -0500
commit36c8128e740ce91af10769bef46a21a72dafc56c (patch)
tree19a2dd3106c0e65b2e12cb4f7e542f6d9e9d2aa1 /src/character.h
parent69a30e8b87fac5888daa26c63663351570e3d533 (diff)
downloademacs-36c8128e740ce91af10769bef46a21a72dafc56c.tar.gz
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 'src/character.h')
-rw-r--r--src/character.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/character.h b/src/character.h
index c716885d46b..d9e2d7bfc67 100644
--- a/src/character.h
+++ b/src/character.h
@@ -682,6 +682,8 @@ extern bool graphicp (int);
extern bool printablep (int);
extern bool blankp (int);
+extern bool confusable_symbol_character_p (int ch);
+
/* Return a translation table of id number ID. */
#define GET_TRANSLATION_TABLE(id) \
(XCDR (XVECTOR (Vtranslation_table_vector)->contents[(id)]))