aboutsummaryrefslogtreecommitdiffstats
path: root/doc/lispref/objects.texi
diff options
context:
space:
mode:
authorEli Zaretskii2023-11-11 05:31:52 -0500
committerEli Zaretskii2023-11-11 05:31:52 -0500
commitc9d7740574758d47c8864cbada5fd2a2b2ee8911 (patch)
tree8afa0f3ec91bb42f17603fbb5e1d15f9d6be9395 /doc/lispref/objects.texi
parent45942508141bbeacd00479599e21592af42253bd (diff)
parentce0ebb91f25847ebaa2745f47413df24a60f051c (diff)
downloademacs-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.texi29
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
96error @code{invalid-read-syntax} whenever it encounters @samp{#<}. 96error @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
100Lisp data type where we describe that data type, in the following
101sections of this chapter. For example, see @ref{String Type}, and its
102subsections for the read syntax and printed representation of strings;
103see @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
100Lisp, an expression is primarily a Lisp object and only secondarily the 106Lisp, an expression is primarily a Lisp object and only secondarily the
101text that is the object's read syntax. Often there is no need to 107text 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
322other words, characters are represented by their character codes. For 328other words, characters are represented by their character codes. For
323example, the character @kbd{A} is represented as the @w{integer 65}. 329example, the character @kbd{A} is represented as the @w{integer 65}.
330That is also their usual printed representation; see @ref{Basic Char
331Syntax}.
324 332
325 Individual characters are used occasionally in programs, but it is 333 Individual characters are used occasionally in programs, but it is
326more common to work with @emph{strings}, which are sequences composed 334more 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
1106another backslash, like this: @code{"this \\ is a single embedded 1114another backslash, like this: @code{"this \\ is a single embedded
1107backslash"}. 1115backslash"}.
1108 1116
1117 Since a string is an array of characters, you can specify the string
1118characters using the read syntax of characters, but without the
1119leading question mark. This is useful for including in string
1120constants characters that don't stand for themselves. Thus, control
1121characters can be specified as escape sequences that start with a
1122backslash; for example, @code{"foo\r"} yields @samp{foo} followed by
1123the carriage return character. @xref{Basic Char Syntax}, for escape
1124sequences of other control characters. Similarly, you can use the
1125special read syntax for control characters (@pxref{Ctl-Char Syntax}),
1126as in @code{"foo\^Ibar"}, which produces a tab character embedded
1127within a string. You can also use the escape sequences for non-ASCII
1128characters 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
1131Strings}).
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;
1111if you write a new line between the double-quotes, it becomes a 1135if you write a new line between the double-quotes, it becomes a
@@ -1182,8 +1206,9 @@ but it does terminate any preceding hex escape.
1182as in character literals (but do not use the question mark that begins a 1206as in character literals (but do not use the question mark that begins a
1183character constant). For example, you can write a string containing the 1207character constant). For example, you can write a string containing the
1184nonprinting characters tab and @kbd{C-a}, with commas and spaces between 1208nonprinting characters tab and @kbd{C-a}, with commas and spaces between
1185them, like this: @code{"\t, \C-a"}. @xref{Character Type}, for a 1209them, like this: @code{"\t, \C-a"}. @xref{Character Type}, and its
1186description of the read syntax for characters. 1210subsections for a description of the various kinds of read syntax for
1211characters.
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
1189escape-sequences are valid in strings. The only control characters that 1214escape-sequences are valid in strings. The only control characters that