From: Philipp Stephani Date: Sun, 2 Jul 2017 10:31:12 +0000 (+0200) Subject: Adapt Lisp reference to reader changes X-Git-Tag: emacs-26.0.90~521^2~11^2~9 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=95343daa79efecdb32302fa3420a7b838d66d6bb;p=emacs.git Adapt Lisp reference to reader changes The reader now warns about some unescaped character literals, but still allows them for compatibility reasons. Slightly adapt the manual to forbid them officially. * doc/lispref/objects.texi (Basic Char Syntax): Document that backslashes are now required before some characters. --- diff --git a/doc/lispref/objects.texi b/doc/lispref/objects.texi index 1f4c378df18..daa397175c3 100644 --- a/doc/lispref/objects.texi +++ b/doc/lispref/objects.texi @@ -283,11 +283,11 @@ character @kbd{a}. ?Q @result{} 81 ?q @result{} 113 @end example - You can use the same syntax for punctuation characters, but it is -often a good idea to add a @samp{\} so that the Emacs commands for -editing Lisp code don't get confused. For example, @samp{?\(} is the -way to write the open-paren character. If the character is @samp{\}, -you @emph{must} use a second @samp{\} to quote it: @samp{?\\}. + You can use the same syntax for punctuation characters. However, if +the punctuation character has a special syntactic meaning in Lisp, you +must quote it with a @samp{\}. For example, @samp{?\(} is the way to +write the open-paren character. Likewise, if the character is +@samp{\}, you must use a second @samp{\} to quote it: @samp{?\\}. @cindex whitespace @cindex bell character @@ -336,18 +336,19 @@ escape character; this has nothing to do with the character @key{ESC}. @samp{\s} is meant for use in character constants; in string constants, just write the space. - A backslash is allowed, and harmless, preceding any character without -a special escape meaning; thus, @samp{?\+} is equivalent to @samp{?+}. -There is no reason to add a backslash before most characters. However, -you should add a backslash before any of the characters -@samp{()\|;'`"#.,} to avoid confusing the Emacs commands for editing -Lisp code. You can also add a backslash before whitespace characters such as -space, tab, newline and formfeed. However, it is cleaner to use one of -the easily readable escape sequences, such as @samp{\t} or @samp{\s}, -instead of an actual whitespace character such as a tab or a space. -(If you do write backslash followed by a space, you should write -an extra space after the character constant to separate it from the -following text.) + A backslash is allowed, and harmless, preceding any character +without a special escape meaning; thus, @samp{?\+} is equivalent to +@samp{?+}. There is no reason to add a backslash before most +characters. However, you must add a backslash before any of the +characters @samp{()[]\;"}, and you should add a backslash before any +of the characters @samp{|'`#.,} to avoid confusing the Emacs commands +for editing Lisp code. You can also add a backslash before whitespace +characters such as space, tab, newline and formfeed. However, it is +cleaner to use one of the easily readable escape sequences, such as +@samp{\t} or @samp{\s}, instead of an actual whitespace character such +as a tab or a space. (If you do write backslash followed by a space, +you should write an extra space after the character constant to +separate it from the following text.) @node General Escape Syntax @subsubsection General Escape Syntax