diff --git a/etc/NEWS b/etc/NEWS index cb73e46358a..3a2efcfc2e0 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -2972,15 +2972,6 @@ and if the new behavior breaks your code please email <32252@debbugs.gnu.org>. Because '%o' and '%x' can now format signed integers, they now support the '+' and space flags. -** To avoid confusion caused by "smart quotes", the reader signals an -error when reading Lisp symbols which begin with one of the following -quotation characters: ‘’‛“”‟〞"'. A symbol beginning with such a -character can be written by escaping the quotation character with a -backslash. For example: - - (read "‘smart") => (invalid-read-syntax "strange quote" "‘") - (read "\\‘smart") == (intern "‘smart") - +++ ** Omitting variables after '&optional' and '&rest' is now allowed. For example '(defun foo (&optional))' is no longer an error. This is diff --git a/src/character.c b/src/character.c index 708eb2f7024..55ad49005a0 100644 --- a/src/character.c +++ b/src/character.c @@ -1056,32 +1056,6 @@ blankp (int c) return XFIXNUM (category) == UNICODE_CATEGORY_Zs; /* separator, space */ } - -/* Return true for characters that would read as symbol characters, - but graphically may be confused with some kind of punctuation. We - require an escaping backslash, when such characters begin a - symbol. */ -bool -confusable_symbol_character_p (int ch) -{ - switch (ch) - { - case 0x2018: /* LEFT SINGLE QUOTATION MARK */ - case 0x2019: /* RIGHT SINGLE QUOTATION MARK */ - case 0x201B: /* SINGLE HIGH-REVERSED-9 QUOTATION MARK */ - case 0x201C: /* LEFT DOUBLE QUOTATION MARK */ - case 0x201D: /* RIGHT DOUBLE QUOTATION MARK */ - case 0x201F: /* DOUBLE HIGH-REVERSED-9 QUOTATION MARK */ - case 0x301E: /* DOUBLE PRIME QUOTATION MARK */ - case 0xFF02: /* FULLWIDTH QUOTATION MARK */ - case 0xFF07: /* FULLWIDTH APOSTROPHE */ - return true; - - default: - return false; - } -} - /* hexdigit[C] is one greater than C's numeric value if C is a hexadecimal digit, zero otherwise. */ signed char const hexdigit[UCHAR_MAX + 1] = diff --git a/src/character.h b/src/character.h index 230fc6eab59..3642a540448 100644 --- a/src/character.h +++ b/src/character.h @@ -684,8 +684,6 @@ 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)])) diff --git a/src/lread.c b/src/lread.c index 4ea62029727..e5a9c93c55e 100644 --- a/src/lread.c +++ b/src/lread.c @@ -3571,13 +3571,6 @@ read1 (Lisp_Object readcharfun, int *pch, bool first_in_list) if (! NILP (result) && len == nbytes) return unbind_to (count, result); } - if (!quoted && multibyte) - { - int ch = STRING_CHAR ((unsigned char *) read_buffer); - if (confusable_symbol_character_p (ch)) - xsignal2 (Qinvalid_read_syntax, build_string ("strange quote"), - CALLN (Fstring, make_fixnum (ch))); - } { Lisp_Object result; ptrdiff_t nchars diff --git a/src/print.c b/src/print.c index a2c199c14ad..7105c5dbb92 100644 --- a/src/print.c +++ b/src/print.c @@ -2035,8 +2035,7 @@ print_object (Lisp_Object obj, Lisp_Object printcharfun, bool escapeflag) || c == ',' || c == '.' || c == '`' || c == '[' || c == ']' || c == '?' || c <= 040 || c == NO_BREAK_SPACE - || confusing - || (i == 1 && confusable_symbol_character_p (c))) + || confusing) { printchar ('\\', printcharfun); confusing = false; diff --git a/test/src/lread-tests.el b/test/src/lread-tests.el index 3a2212ef770..0c14a1afdaa 100644 --- a/test/src/lread-tests.el +++ b/test/src/lread-tests.el @@ -144,23 +144,6 @@ literals (Bug#20852)." "`?\\\"', `?\\(', `?\\)', `?\\;', `?\\[', `?\\]' " "expected!"))))) -(ert-deftest lread-tests--funny-quote-symbols () - "Check that `smart quotes' or similar trigger errors in symbol names." - (dolist (quote-char - '(#x2018 ;; LEFT SINGLE QUOTATION MARK - #x2019 ;; RIGHT SINGLE QUOTATION MARK - #x201B ;; SINGLE HIGH-REVERSED-9 QUOTATION MARK - #x201C ;; LEFT DOUBLE QUOTATION MARK - #x201D ;; RIGHT DOUBLE QUOTATION MARK - #x201F ;; DOUBLE HIGH-REVERSED-9 QUOTATION MARK - #x301E ;; DOUBLE PRIME QUOTATION MARK - #xFF02 ;; FULLWIDTH QUOTATION MARK - #xFF07 ;; FULLWIDTH APOSTROPHE - )) - (let ((str (format "%cfoo" quote-char))) - (should-error (read str) :type 'invalid-read-syntax) - (should (eq (read (concat "\\" str)) (intern str)))))) - (ert-deftest lread-test-bug26837 () "Test for https://debbugs.gnu.org/26837 ." (let ((load-path (cons