aboutsummaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
authorNoam Postavsky2018-01-23 18:50:23 -0500
committerNoam Postavsky2018-01-28 10:43:01 -0500
commit36c8128e740ce91af10769bef46a21a72dafc56c (patch)
tree19a2dd3106c0e65b2e12cb4f7e542f6d9e9d2aa1 /etc
parent69a30e8b87fac5888daa26c63663351570e3d533 (diff)
downloademacs-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 'etc')
-rw-r--r--etc/NEWS9
-rw-r--r--etc/NEWS.265
2 files changed, 9 insertions, 5 deletions
diff --git a/etc/NEWS b/etc/NEWS
index 2888acd4dcb..80ddf10488c 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -229,6 +229,15 @@ as new-style, bind the new variable 'force-new-style-backquotes' to t.
229** 'print-quoted' now defaults to t, so if you want to see 229** 'print-quoted' now defaults to t, so if you want to see
230(quote x) instead of 'x you will have to bind it to nil where applicable. 230(quote x) instead of 'x you will have to bind it to nil where applicable.
231 231
232** To avoid confusion caused by "smart quotes", the reader signals an
233error when reading Lisp symbols which begin with one of the following
234quotation characters: ‘’‛“”‟〞"'. A symbol beginning with such a
235character can be written by escaping the quotation character with a
236backslash. For example:
237
238 (read "‘smart") => (invalid-read-syntax "strange quote" "‘")
239 (read "\\‘smart") == (intern "‘smart")
240
232** Internal parsing commands now use syntax-ppss and disregard 241** Internal parsing commands now use syntax-ppss and disregard
233open-paren-in-column-0-is-defun-start. This affects mostly things like 242open-paren-in-column-0-is-defun-start. This affects mostly things like
234forward-comment, scan-sexps, and forward-sexp when parsing backward. 243forward-comment, scan-sexps, and forward-sexp when parsing backward.
diff --git a/etc/NEWS.26 b/etc/NEWS.26
index 46762d65e18..76e6316ca2e 100644
--- a/etc/NEWS.26
+++ b/etc/NEWS.26
@@ -1377,11 +1377,6 @@ second argument instead of its first.
1377renamed to 'lread--old-style-backquotes'. No user code should use 1377renamed to 'lread--old-style-backquotes'. No user code should use
1378this variable. 1378this variable.
1379 1379
1380---
1381** To avoid confusion caused by "smart quotes", the reader no longer
1382accepts Lisp symbols which begin with the following quotation
1383characters: ‘’‛“”‟〞"', unless they are escaped with backslash.
1384
1385+++ 1380+++
1386** 'default-file-name-coding-system' now defaults to a coding system 1381** 'default-file-name-coding-system' now defaults to a coding system
1387that does not process CRLF. For example, it defaults to 'utf-8-unix' 1382that does not process CRLF. For example, it defaults to 'utf-8-unix'