bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#23867: 25.1.50; Doc string containing `\N'


From: Tino Calancha
Subject: bug#23867: 25.1.50; Doc string containing `\N'
Date: Wed, 29 Jun 2016 18:44:51 +0900 (JST)
User-agent: Alpine 2.20 (DEB 67 2015-01-07)


After commit
de7d5f36e0f3261a7300fa3a3d87ae3b758b8a73
a doc string cannot contain `\N'.  It should be
written `\\N'.

For instance:
emacs -Q
;; create a file foo.el with contents:

(defun foo ()
  "Test characters allowed in doc strings.
The following char is not allowed: `\N'
You need to double the slash."
  (interactive)
  (message "Test for doc strings"))

;; Load the file:
;; invalid-read-syntax Expected opening brace after \N

I saw 3rd party code with doc strings containing `\N'.
Should that 3rd party code update to `\\N'?
Or is OK to allow doc strings with `\N'?


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
diff --git a/src/lread.c b/src/lread.c
index 5c47f78..7643d49 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -2390,6 +2390,8 @@ read_escape (Lisp_Object readcharfun, bool stringp)
       /* Named character.  */
       {
         c = READCHAR;
+        if (c == '\'')
+          return c;
         if (c != '{')
           invalid_syntax ("Expected opening brace after \\N");
         char name[UNICODE_CHARACTER_NAME_LENGTH_BOUND + 1];


GNU Emacs 25.1.50.1 (x86_64-pc-linux-gnu, GTK+ Version 3.20.6) of 2016-06-29
Repository revision: 4a2a1eba09e5bbc37b853733708feae17f1425f5






reply via email to

[Prev in Thread] Current Thread [Next in Thread]