1 |
@c -*-texinfo-*- |
@c -*-texinfo-*- |
2 |
@c This is part of the GNU Emacs Lisp Reference Manual. |
@c This is part of the GNU Emacs Lisp Reference Manual. |
3 |
@c Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1998, 1999 |
@c Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1998, 1999, 2003 |
4 |
@c Free Software Foundation, Inc. |
@c Free Software Foundation, Inc. |
5 |
@c See the file elisp.texi for copying conditions. |
@c See the file elisp.texi for copying conditions. |
6 |
@setfilename ../info/objects |
@setfilename ../info/objects |
258 |
|
|
259 |
You can use the same syntax for punctuation characters, but it is |
You can use the same syntax for punctuation characters, but it is |
260 |
often a good idea to add a @samp{\} so that the Emacs commands for |
often a good idea to add a @samp{\} so that the Emacs commands for |
261 |
editing Lisp code don't get confused. For example, @samp{?\ } is the |
editing Lisp code don't get confused. For example, @samp{?\(} is the |
262 |
way to write the space character. If the character is @samp{\}, you |
way to write the open-paren character. If the character is @samp{\}, |
263 |
@emph{must} use a second @samp{\} to quote it: @samp{?\\}. |
you @emph{must} use a second @samp{\} to quote it: @samp{?\\}. |
264 |
|
|
265 |
@cindex whitespace |
@cindex whitespace |
266 |
@cindex bell character |
@cindex bell character |
281 |
@cindex @samp{\e} |
@cindex @samp{\e} |
282 |
@cindex space |
@cindex space |
283 |
@cindex @samp{\s} |
@cindex @samp{\s} |
284 |
You can express the characters Control-g, backspace, tab, newline, |
You can express the characters control-g, backspace, tab, newline, |
285 |
vertical tab, formfeed, space, return, del, and escape as @samp{?\a}, |
vertical tab, formfeed, space, return, del, and escape as @samp{?\a}, |
286 |
@samp{?\b}, @samp{?\t}, @samp{?\n}, @samp{?\v}, @samp{?\f}, |
@samp{?\b}, @samp{?\t}, @samp{?\n}, @samp{?\v}, @samp{?\f}, |
287 |
@samp{?\r}, @samp{?\d}, @samp{?\e}, and @samp{?\s}, respectively. Thus, |
@samp{?\s}, @samp{?\r}, @samp{?\d}, and @samp{?\e}, respectively. |
288 |
|
Thus, |
289 |
|
|
290 |
@example |
@example |
291 |
?\a @result{} 7 ; @r{@kbd{C-g}} |
?\a @result{} 7 ; @r{control-g, @kbd{C-g}} |
292 |
?\b @result{} 8 ; @r{backspace, @key{BS}, @kbd{C-h}} |
?\b @result{} 8 ; @r{backspace, @key{BS}, @kbd{C-h}} |
293 |
?\t @result{} 9 ; @r{tab, @key{TAB}, @kbd{C-i}} |
?\t @result{} 9 ; @r{tab, @key{TAB}, @kbd{C-i}} |
294 |
?\n @result{} 10 ; @r{newline, @kbd{C-j}} |
?\n @result{} 10 ; @r{newline, @kbd{C-j}} |
303 |
|
|
304 |
@cindex escape sequence |
@cindex escape sequence |
305 |
These sequences which start with backslash are also known as |
These sequences which start with backslash are also known as |
306 |
@dfn{escape sequences}, because backslash plays the role of an escape |
@dfn{escape sequences}, because backslash plays the role of an |
307 |
character; this usage has nothing to do with the character @key{ESC}. |
``escape character''; this terminology has nothing to do with the |
308 |
|
character @key{ESC}. @samp{\s} is meant for use only in character |
309 |
|
constants; in string constants, just write the space. |
310 |
|
|
311 |
@cindex control characters |
@cindex control characters |
312 |
Control characters may be represented using yet another read syntax. |
Control characters may be represented using yet another read syntax. |
409 |
@cindex hyper characters |
@cindex hyper characters |
410 |
@cindex super characters |
@cindex super characters |
411 |
@cindex alt characters |
@cindex alt characters |
412 |
The X Window System defines three other modifier bits that can be set |
The X Window System defines three other @anchor{modifier bits} |
413 |
|
modifier bits that can be set |
414 |
in a character: @dfn{hyper}, @dfn{super} and @dfn{alt}. The syntaxes |
in a character: @dfn{hyper}, @dfn{super} and @dfn{alt}. The syntaxes |
415 |
for these bits are @samp{\H-}, @samp{\s-} and @samp{\A-}. (Case is |
for these bits are @samp{\H-}, @samp{\s-} and @samp{\A-}. (Case is |
416 |
significant in these prefixes.) Thus, @samp{?\H-\M-\A-x} represents |
significant in these prefixes.) Thus, @samp{?\H-\M-\A-x} represents |
417 |
@kbd{Alt-Hyper-Meta-x}. Note that @samp{\s} (without the @samp{-}) |
@kbd{Alt-Hyper-Meta-x}. (Note that @samp{\s} with no following @samp{-} |
418 |
represents the space character. |
represents the space character.) |
419 |
@tex |
@tex |
420 |
Numerically, the |
Numerically, the |
421 |
bit values are @math{2^{22}} for alt, @math{2^{23}} for super and @math{2^{24}} for hyper. |
bit values are @math{2^{22}} for alt, @math{2^{23}} for super and @math{2^{24}} for hyper. |
461 |
There is no reason to add a backslash before most characters. However, |
There is no reason to add a backslash before most characters. However, |
462 |
you should add a backslash before any of the characters |
you should add a backslash before any of the characters |
463 |
@samp{()\|;'`"#.,} to avoid confusing the Emacs commands for editing |
@samp{()\|;'`"#.,} to avoid confusing the Emacs commands for editing |
464 |
Lisp code. Also add a backslash before whitespace characters such as |
Lisp code. You can also add a backslash before whitespace characters such as |
465 |
space, tab, newline and formfeed. However, it is cleaner to use one of |
space, tab, newline and formfeed. However, it is cleaner to use one of |
466 |
the easily readable escape sequences, such as @samp{\t} or @samp{\s}, |
the easily readable escape sequences, such as @samp{\t} or @samp{\s}, |
467 |
instead of an actual whitespace character such as a tab or a space. |
instead of an actual whitespace character such as a tab or a space. |
468 |
|
(If you do write backslash followed by a space, you should write |
469 |
|
an extra space after the character constant to separate it from the |
470 |
|
following text.) |
471 |
|
|
472 |
@node Symbol Type |
@node Symbol Type |
473 |
@subsection Symbol Type |
@subsection Symbol Type |
515 |
|
|
516 |
Here are several examples of symbol names. Note that the @samp{+} in |
Here are several examples of symbol names. Note that the @samp{+} in |
517 |
the fifth example is escaped to prevent it from being read as a number. |
the fifth example is escaped to prevent it from being read as a number. |
518 |
This is not necessary in the sixth example because the rest of the name |
This is not necessary in the seventh example because the rest of the name |
519 |
makes it invalid as a number. |
makes it invalid as a number. |
520 |
|
|
521 |
@example |
@example |
1903 |
|
|
1904 |
Because of this recursive method, circular lists may therefore cause |
Because of this recursive method, circular lists may therefore cause |
1905 |
infinite recursion (leading to an error). |
infinite recursion (leading to an error). |
1906 |
|
|
1907 |
|
@ignore |
1908 |
|
arch-tag: 9711a66e-4749-4265-9e8c-972d55b67096 |
1909 |
|
@end ignore |