diff options
| author | Eli Zaretskii | 2023-11-11 05:31:52 -0500 |
|---|---|---|
| committer | Eli Zaretskii | 2023-11-11 05:31:52 -0500 |
| commit | c9d7740574758d47c8864cbada5fd2a2b2ee8911 (patch) | |
| tree | 8afa0f3ec91bb42f17603fbb5e1d15f9d6be9395 /doc/lispref/objects.texi | |
| parent | 45942508141bbeacd00479599e21592af42253bd (diff) | |
| parent | ce0ebb91f25847ebaa2745f47413df24a60f051c (diff) | |
| download | emacs-c9d7740574758d47c8864cbada5fd2a2b2ee8911.tar.gz emacs-c9d7740574758d47c8864cbada5fd2a2b2ee8911.zip | |
Merge from origin/emacs-29
ce0ebb91f25 Improve documentation of read syntax and printed represen...
81f84b00a5d ; * doc/lispref/modes.texi (Other Font Lock Variables): A...
434592b0746 ; * lisp/dired.el (dired-use-ls-dired): Doc fix (bug#67053).
fe000236cf2 Improve documentation of signaling errors in batch mode
103ca678ac1 Fix treesit-simple-indent-presets docstring (bug#67007)
b7871cefe7b Prevent an infinite loop in todo-mode (bug#66994)
fa8cc4c9ee2 Fix cmake-ts-mode indentation (Bug#66845)
5bdc61bc0ef Update to Org 9.6.11
18e2de1bec9 ; * lisp/bindings.el (right-word, left-word): Doc fix.
4f0fc3bfda3 ; Document core input events problems with XInput2
Diffstat (limited to 'doc/lispref/objects.texi')
| -rw-r--r-- | doc/lispref/objects.texi | 29 |
1 files changed, 27 insertions, 2 deletions
diff --git a/doc/lispref/objects.texi b/doc/lispref/objects.texi index 9febcbefa33..17961ffadfa 100644 --- a/doc/lispref/objects.texi +++ b/doc/lispref/objects.texi | |||
| @@ -96,6 +96,12 @@ Hash notation cannot be read at all, so the Lisp reader signals the | |||
| 96 | error @code{invalid-read-syntax} whenever it encounters @samp{#<}. | 96 | error @code{invalid-read-syntax} whenever it encounters @samp{#<}. |
| 97 | @kindex invalid-read-syntax | 97 | @kindex invalid-read-syntax |
| 98 | 98 | ||
| 99 | We describe the read syntax and the printed representation of each | ||
| 100 | Lisp data type where we describe that data type, in the following | ||
| 101 | sections of this chapter. For example, see @ref{String Type}, and its | ||
| 102 | subsections for the read syntax and printed representation of strings; | ||
| 103 | see @ref{Vector Type} for the same information about vectors; etc. | ||
| 104 | |||
| 99 | In other languages, an expression is text; it has no other form. In | 105 | In other languages, an expression is text; it has no other form. In |
| 100 | Lisp, an expression is primarily a Lisp object and only secondarily the | 106 | Lisp, an expression is primarily a Lisp object and only secondarily the |
| 101 | text that is the object's read syntax. Often there is no need to | 107 | text that is the object's read syntax. Often there is no need to |
| @@ -321,6 +327,8 @@ number whose value is 1500. They are all equivalent. | |||
| 321 | A @dfn{character} in Emacs Lisp is nothing more than an integer. In | 327 | A @dfn{character} in Emacs Lisp is nothing more than an integer. In |
| 322 | other words, characters are represented by their character codes. For | 328 | other words, characters are represented by their character codes. For |
| 323 | example, the character @kbd{A} is represented as the @w{integer 65}. | 329 | example, the character @kbd{A} is represented as the @w{integer 65}. |
| 330 | That is also their usual printed representation; see @ref{Basic Char | ||
| 331 | Syntax}. | ||
| 324 | 332 | ||
| 325 | Individual characters are used occasionally in programs, but it is | 333 | Individual characters are used occasionally in programs, but it is |
| 326 | more common to work with @emph{strings}, which are sequences composed | 334 | more common to work with @emph{strings}, which are sequences composed |
| @@ -1106,6 +1114,22 @@ character. Likewise, you can include a backslash by preceding it with | |||
| 1106 | another backslash, like this: @code{"this \\ is a single embedded | 1114 | another backslash, like this: @code{"this \\ is a single embedded |
| 1107 | backslash"}. | 1115 | backslash"}. |
| 1108 | 1116 | ||
| 1117 | Since a string is an array of characters, you can specify the string | ||
| 1118 | characters using the read syntax of characters, but without the | ||
| 1119 | leading question mark. This is useful for including in string | ||
| 1120 | constants characters that don't stand for themselves. Thus, control | ||
| 1121 | characters can be specified as escape sequences that start with a | ||
| 1122 | backslash; for example, @code{"foo\r"} yields @samp{foo} followed by | ||
| 1123 | the carriage return character. @xref{Basic Char Syntax}, for escape | ||
| 1124 | sequences of other control characters. Similarly, you can use the | ||
| 1125 | special read syntax for control characters (@pxref{Ctl-Char Syntax}), | ||
| 1126 | as in @code{"foo\^Ibar"}, which produces a tab character embedded | ||
| 1127 | within a string. You can also use the escape sequences for non-ASCII | ||
| 1128 | characters described in @ref{General Escape Syntax}, as in | ||
| 1129 | @w{@code{"\N@{LATIN SMALL LETTER A WITH GRAVE@}"}} and @code{"\u00e0"} | ||
| 1130 | (however, see a caveat with non-ASCII characters in @ref{Non-ASCII in | ||
| 1131 | Strings}). | ||
| 1132 | |||
| 1109 | @cindex newline in strings | 1133 | @cindex newline in strings |
| 1110 | The newline character is not special in the read syntax for strings; | 1134 | The newline character is not special in the read syntax for strings; |
| 1111 | if you write a new line between the double-quotes, it becomes a | 1135 | if you write a new line between the double-quotes, it becomes a |
| @@ -1182,8 +1206,9 @@ but it does terminate any preceding hex escape. | |||
| 1182 | as in character literals (but do not use the question mark that begins a | 1206 | as in character literals (but do not use the question mark that begins a |
| 1183 | character constant). For example, you can write a string containing the | 1207 | character constant). For example, you can write a string containing the |
| 1184 | nonprinting characters tab and @kbd{C-a}, with commas and spaces between | 1208 | nonprinting characters tab and @kbd{C-a}, with commas and spaces between |
| 1185 | them, like this: @code{"\t, \C-a"}. @xref{Character Type}, for a | 1209 | them, like this: @code{"\t, \C-a"}. @xref{Character Type}, and its |
| 1186 | description of the read syntax for characters. | 1210 | subsections for a description of the various kinds of read syntax for |
| 1211 | characters. | ||
| 1187 | 1212 | ||
| 1188 | However, not all of the characters you can write with backslash | 1213 | However, not all of the characters you can write with backslash |
| 1189 | escape-sequences are valid in strings. The only control characters that | 1214 | escape-sequences are valid in strings. The only control characters that |