diff options
| author | Philipp Stephani | 2017-07-02 12:31:12 +0200 |
|---|---|---|
| committer | Philipp Stephani | 2017-07-02 12:32:23 +0200 |
| commit | 95343daa79efecdb32302fa3420a7b838d66d6bb (patch) | |
| tree | 2ac161fbe4ba8a1afbb34c0419ef779c11071511 /doc/lispref | |
| parent | 4383ff87a124bfbb5ef07751c12d42a743fccdc5 (diff) | |
| download | emacs-95343daa79efecdb32302fa3420a7b838d66d6bb.tar.gz emacs-95343daa79efecdb32302fa3420a7b838d66d6bb.zip | |
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.
Diffstat (limited to 'doc/lispref')
| -rw-r--r-- | doc/lispref/objects.texi | 35 |
1 files changed, 18 insertions, 17 deletions
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}. | |||
| 283 | ?Q @result{} 81 ?q @result{} 113 | 283 | ?Q @result{} 81 ?q @result{} 113 |
| 284 | @end example | 284 | @end example |
| 285 | 285 | ||
| 286 | You can use the same syntax for punctuation characters, but it is | 286 | You can use the same syntax for punctuation characters. However, if |
| 287 | often a good idea to add a @samp{\} so that the Emacs commands for | 287 | the punctuation character has a special syntactic meaning in Lisp, you |
| 288 | editing Lisp code don't get confused. For example, @samp{?\(} is the | 288 | must quote it with a @samp{\}. For example, @samp{?\(} is the way to |
| 289 | way to write the open-paren character. If the character is @samp{\}, | 289 | write the open-paren character. Likewise, if the character is |
| 290 | you @emph{must} use a second @samp{\} to quote it: @samp{?\\}. | 290 | @samp{\}, you must use a second @samp{\} to quote it: @samp{?\\}. |
| 291 | 291 | ||
| 292 | @cindex whitespace | 292 | @cindex whitespace |
| 293 | @cindex bell character | 293 | @cindex bell character |
| @@ -336,18 +336,19 @@ escape character; this has nothing to do with the | |||
| 336 | character @key{ESC}. @samp{\s} is meant for use in character | 336 | character @key{ESC}. @samp{\s} is meant for use in character |
| 337 | constants; in string constants, just write the space. | 337 | constants; in string constants, just write the space. |
| 338 | 338 | ||
| 339 | A backslash is allowed, and harmless, preceding any character without | 339 | A backslash is allowed, and harmless, preceding any character |
| 340 | a special escape meaning; thus, @samp{?\+} is equivalent to @samp{?+}. | 340 | without a special escape meaning; thus, @samp{?\+} is equivalent to |
| 341 | There is no reason to add a backslash before most characters. However, | 341 | @samp{?+}. There is no reason to add a backslash before most |
| 342 | you should add a backslash before any of the characters | 342 | characters. However, you must add a backslash before any of the |
| 343 | @samp{()\|;'`"#.,} to avoid confusing the Emacs commands for editing | 343 | characters @samp{()[]\;"}, and you should add a backslash before any |
| 344 | Lisp code. You can also add a backslash before whitespace characters such as | 344 | of the characters @samp{|'`#.,} to avoid confusing the Emacs commands |
| 345 | space, tab, newline and formfeed. However, it is cleaner to use one of | 345 | for editing Lisp code. You can also add a backslash before whitespace |
| 346 | the easily readable escape sequences, such as @samp{\t} or @samp{\s}, | 346 | characters such as space, tab, newline and formfeed. However, it is |
| 347 | instead of an actual whitespace character such as a tab or a space. | 347 | cleaner to use one of the easily readable escape sequences, such as |
| 348 | (If you do write backslash followed by a space, you should write | 348 | @samp{\t} or @samp{\s}, instead of an actual whitespace character such |
| 349 | an extra space after the character constant to separate it from the | 349 | as a tab or a space. (If you do write backslash followed by a space, |
| 350 | following text.) | 350 | you should write an extra space after the character constant to |
| 351 | separate it from the following text.) | ||
| 351 | 352 | ||
| 352 | @node General Escape Syntax | 353 | @node General Escape Syntax |
| 353 | @subsubsection General Escape Syntax | 354 | @subsubsection General Escape Syntax |