unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Tino Calancha <tino.calancha@gmail.com>
To: 23867@debbugs.gnu.org
Subject: bug#23867: 25.1.50; Doc string containing `\N'
Date: Wed, 29 Jun 2016 18:44:51 +0900 (JST)	[thread overview]
Message-ID: <alpine.DEB.2.20.1606291842210.1391@calancha-pc> (raw)


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	other threads:[~2016-06-29  9:44 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-29  9:44 Tino Calancha [this message]
2016-06-29  9:52 ` bug#23867: 25.1.50; Doc string containing `\N' Andreas Schwab
2016-06-29 10:01   ` Tino Calancha
2016-06-29 14:00     ` Drew Adams
2016-06-29 14:15       ` Andreas Schwab
2016-06-29 14:44       ` Noam Postavsky
2016-07-04 16:43 ` Glenn Morris
2016-07-06 14:56 ` Paul Eggert
2016-07-06 15:35   ` Glenn Morris

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.DEB.2.20.1606291842210.1391@calancha-pc \
    --to=tino.calancha@gmail.com \
    --cc=23867@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).