@comment node-name, next, previous, up
@section Buffer Basics
-@ifinfo
+@ifnottex
A @dfn{buffer} is a Lisp object containing text to be edited. Buffers
are used to hold the contents of files that are being visited; there may
also be buffers that are not visiting files. Although several buffers
buffer} at any time. Most editing commands act on the contents of the
current buffer. Each buffer, including the current buffer, may or may
not be displayed in any windows.
-@end ifinfo
+@end ifnottex
Buffers in Emacs editing are objects that have distinct names and hold
text that can be edited. Buffers appear to Lisp programs as a special
@tex
@math{2^{27}}
@end tex
-@ifinfo
+@ifnottex
2**27
-@end ifinfo
+@end ifnottex
bit in the character code indicates a character
typed with the meta key held down.
@tex
@math{2^{26}}
@end tex
-@ifinfo
+@ifnottex
2**26
-@end ifinfo
+@end ifnottex
bit in the character code indicates a non-@sc{ascii}
control character.
@tex
@math{2^{26}}
@end tex
-@ifinfo
+@ifnottex
2**26
-@end ifinfo
+@end ifnottex
(assuming the terminal supports non-@sc{ascii}
control characters).
@tex
@math{2^{25}}
@end tex
-@ifinfo
+@ifnottex
2**25
-@end ifinfo
+@end ifnottex
bit in the character code indicates an @sc{ascii} control
character typed with the shift key held down.
@tex
@math{2^{25}}
@end tex
-@ifinfo
+@ifnottex
2**25
-@end ifinfo
+@end ifnottex
bit for those characters.
However, @sc{ascii} provides no way to distinguish @kbd{C-A} from
@tex
@math{2^{25}}
@end tex
-@ifinfo
+@ifnottex
2**25
-@end ifinfo
+@end ifnottex
bit in @kbd{C-A} and not in
@kbd{C-a}.
@tex
@math{2^{24}}
@end tex
-@ifinfo
+@ifnottex
2**24
-@end ifinfo
+@end ifnottex
bit in the character code indicates a character
typed with the hyper key held down.
@tex
@math{2^{23}}
@end tex
-@ifinfo
+@ifnottex
2**23
-@end ifinfo
+@end ifnottex
bit in the character code indicates a character
typed with the super key held down.
@tex
@math{2^{22}}
@end tex
-@ifinfo
+@ifnottex
2**22
-@end ifinfo
+@end ifnottex
bit in the character code indicates a character typed with
the alt key held down. (On some terminals, the key labeled @key{ALT}
is actually the meta key.)
@tex
@math{2^{27}}
@end tex
-@ifinfo
+@ifnottex
2**27
-@end ifinfo
+@end ifnottex
and such numbers cannot be included in a string.
To support programs with @samp{\M-} in string constants, there are
@tex
@math{2^{27}}
@end tex
-@ifinfo
+@ifnottex
2**27
-@end ifinfo
+@end ifnottex
to
@tex
@math{2^{27} + 127},
@end tex
-@ifinfo
+@ifnottex
2**27+127,
-@end ifinfo
+@end ifnottex
can also go in the string, but you must change their
numeric values. You must set the
@tex
@math{2^{7}}
@end tex
-@ifinfo
+@ifnottex
2**7
-@end ifinfo
+@end ifnottex
bit instead of the
@tex
@math{2^{27}}
@end tex
-@ifinfo
+@ifnottex
2**27
-@end ifinfo
+@end ifnottex
bit, resulting in a value between 128 and 255. Only a unibyte string
can include these codes.
mod 524288 is the character to output, and the glyph code divided by
524288 specifies the face number (@pxref{Face Functions}) to use while
outputting it. (524288 is
-@ifinfo
+@ifnottex
2**19.)
-@end ifinfo
+@end ifnottex
@tex
$2^{19}$.)
@end tex
@smallbook
-@ifinfo
+@ifnottex
This Info file contains edition 2.6 of the GNU Emacs Lisp
Reference Manual, corresponding to Emacs version 21.1.
@c Please REMEMBER to update edition number in *four* places in this file
except that the section entitled ``GNU General Public License'' may be
included in a translation approved by the Free Software Foundation
instead of in the original English.
-@end ifinfo
+@end ifnottex
@c Combine indices.
@synindex cp fn
@node Top, Copying, (dir), (dir)
-@ifinfo
+@ifnottex
This Info file contains edition 2.6 of the GNU Emacs Lisp
Reference Manual, corresponding to GNU Emacs version 21.1.
-@end ifinfo
+@end ifnottex
@menu
* Copying:: Conditions for copying and changing GNU Emacs.
your program, but can also be called explicitly via the Lisp primitive
function @code{eval}.
-@ifinfo
+@ifnottex
@menu
* Intro Eval:: Evaluation in the scheme of things.
* Forms:: How various sorts of objects are evaluated.
How the evaluator handles an object depends primarily on the data
type of the object.
-@end ifinfo
+@end ifnottex
@cindex forms
@cindex expression
Here are the operations that a magic file name handler gets to handle:
-@ifinfo
+@ifnottex
@noindent
@code{add-name-to-file}, @code{copy-file}, @code{delete-directory},
@code{delete-file},
@code{vc-registered},
@code{verify-visited-file-modtime},@*
@code{write-region}.
-@end ifinfo
+@end ifnottex
@iftex
@noindent
@flushleft
@item lambda expression
A @dfn{lambda expression} is a function written in Lisp.
These are described in the following section.
-@ifinfo
+@ifnottex
@xref{Lambda Expressions}.
-@end ifinfo
+@end ifnottex
@item special form
A @dfn{special form} is a primitive that is like a function but does not
@node Lambda Components
@subsection Components of a Lambda Expression
-@ifinfo
+@ifnottex
A function written in Lisp (a ``lambda expression'') is a list that
looks like this:
[@var{interactive-declaration}]
@var{body-forms}@dots{})
@end example
-@end ifinfo
+@end ifnottex
@cindex lambda list
The first element of a lambda expression is always the symbol
@iftex
@unnumberedsec TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
@end iftex
-@ifinfo
+@ifnottex
@center TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-@end ifinfo
+@end ifnottex
@enumerate 0
@item
@iftex
@heading NO WARRANTY
@end iftex
-@ifinfo
+@ifnottex
@center NO WARRANTY
-@end ifinfo
+@end ifnottex
@item
BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
@iftex
@heading END OF TERMS AND CONDITIONS
@end iftex
-@ifinfo
+@ifnottex
@center END OF TERMS AND CONDITIONS
-@end ifinfo
+@end ifnottex
@page
@unnumberedsec How to Apply These Terms to Your New Programs
trouble finding the text you are talking about. Also state the number
of the edition you are criticizing.
@end iftex
-@ifinfo
+@ifnottex
As you use this manual, we ask that you send corrections as soon as you
find them. If you think of a simple, real life example for a function
in. Please reference any comments to the node name and function or
variable name, as appropriate. Also state the number of the edition
you are criticizing.
-@end ifinfo
+@end ifnottex
Please mail comments and corrections to
forms are described in this manual in a uniform format. The first
line of a description contains the name of the item followed by its
arguments, if any.
-@ifinfo
+@ifnottex
The category---function, variable, or whatever---appears at the
beginning of the line.
-@end ifinfo
+@end ifnottex
@iftex
The category---function, variable, or whatever---is printed next to the
right margin.
to them as arguments, relinking their cons cells to form a new list that
is the returned value.
-@ifinfo
+@ifnottex
See @code{delq}, in @ref{Sets And Lists}, for another function
that modifies cons cells.
-@end ifinfo
+@end ifnottex
@iftex
The function @code{delq} in the following section is another example
of destructive list manipulation.
If the library uses @code{provide} to provide a named feature, you can
use @code{featurep} earlier in the file to test whether the
@code{provide} call has been executed before.
-@ifinfo
+@ifnottex
@xref{Named Features}.
-@end ifinfo
+@end ifnottex
@node Named Features
@section Features
@node Surprising Local Vars
@subsection Local Variables in Macro Expansions
-@ifinfo
+@ifnottex
In the previous section, the definition of @code{for} was fixed as
follows to make the expansion evaluate the macro arguments the proper
number of times:
(inc ,var))))
@end group
@end smallexample
-@end ifinfo
+@end ifnottex
The new definition of @code{for} has a new problem: it introduces a
local variable named @code{max} which the user does not expect. This
The range of values for an integer depends on the machine. The
minimum range is @minus{}134217728 to 134217727 (28 bits; i.e.,
-@ifinfo
+@ifnottex
-2**27
-@end ifinfo
+@end ifnottex
@tex
@math{-2^{27}}
@end tex
to
-@ifinfo
+@ifnottex
2**27 - 1),
-@end ifinfo
+@end ifnottex
@tex
@math{2^{27}-1}),
@end tex
@defun asin arg
The value of @code{(asin @var{arg})} is a number between
-@ifinfo
+@ifnottex
@minus{}pi/2
-@end ifinfo
+@end ifnottex
@tex
@math{-\pi/2}
@end tex
and
-@ifinfo
+@ifnottex
pi/2
-@end ifinfo
+@end ifnottex
@tex
@math{\pi/2}
@end tex
@defun acos arg
The value of @code{(acos @var{arg})} is a number between 0 and
-@ifinfo
+@ifnottex
pi
-@end ifinfo
+@end ifnottex
@tex
@math{\pi}
@end tex
@defun atan arg
The value of @code{(atan @var{arg})} is a number between
-@ifinfo
+@ifnottex
@minus{}pi/2
-@end ifinfo
+@end ifnottex
@tex
@math{-\pi/2}
@end tex
and
-@ifinfo
+@ifnottex
pi/2
-@end ifinfo
+@end ifnottex
@tex
@math{\pi/2}
@end tex
@tex
@math{e}
@end tex
-@ifinfo
+@ifnottex
@i{e}
-@end ifinfo
+@end ifnottex
to the power @var{arg}.
@tex
@math{e}
@end tex
-@ifinfo
+@ifnottex
@i{e}
-@end ifinfo
+@end ifnottex
is a fundamental mathematical constant also called the base of natural
logarithms.
@end defun
@tex
@math{e}
@end tex
-@ifinfo
+@ifnottex
@i{e}
-@end ifinfo
+@end ifnottex
is used. If @var{arg}
is negative, the result is a NaN.
@end defun
The range of values for integers in Emacs Lisp is @minus{}134217728 to
134217727 (28 bits; i.e.,
-@ifinfo
+@ifnottex
-2**27
-@end ifinfo
+@end ifnottex
@tex
@math{-2^{27}}
@end tex
to
-@ifinfo
+@ifnottex
2**27 - 1)
-@end ifinfo
+@end ifnottex
@tex
@math{2^{28}-1})
@end tex
@tex
@math{2^{26}}
@end tex
-@ifinfo
+@ifnottex
2**26
-@end ifinfo
+@end ifnottex
bit as well as the code for the corresponding non-control
character. Ordinary terminals have no way of generating non-@sc{ascii}
control characters, but you can generate them straightforwardly using X
@tex
@math{2^{27}}
@end tex
-@ifinfo
+@ifnottex
2**27
-@end ifinfo
+@end ifnottex
bit set (which on most machines makes it a negative number). We
use high bits for this and other modifiers to make possible a wide range
of basic character codes.
@tex
@math{2^{7}}
@end tex
-@ifinfo
+@ifnottex
2**7
-@end ifinfo
+@end ifnottex
bit attached to an ASCII character indicates a meta character; thus, the
meta characters that can fit in a string have codes in the range from
128 to 255, and are the meta versions of the ordinary @sc{ascii}
@tex
@math{2^{25}}
@end tex
-@ifinfo
+@ifnottex
2**25
-@end ifinfo
+@end ifnottex
bit to indicate that the shift key was used in typing a control
character. This distinction is possible only when you use X terminals
or other special terminals; ordinary terminals do not report the
Numerically, the
bit values are @math{2^{22}} for alt, @math{2^{23}} for super and @math{2^{24}} for hyper.
@end tex
-@ifinfo
+@ifnottex
Numerically, the
bit values are 2**22 for alt, 2**23 for super and 2**24 for hyper.
-@end ifinfo
+@end ifnottex
@cindex @samp{\} in character constant
@cindex backslash in character constant
@iftex
@samp{@`a}.
@end iftex
-@ifinfo
+@ifnottex
@samp{a} with grave accent.
-@end ifinfo
+@end ifnottex
A backslash is allowed, and harmless, preceding any character without
a special escape meaning; thus, @samp{?\+} is equivalent to @samp{?+}.
Similarly, the three-element list @code{(rose violet buttercup)}
is equivalent to @code{(rose . (violet . (buttercup)))}.
-@ifinfo
+@ifnottex
It looks like this:
@example
--> rose --> violet --> buttercup
@end group
@end example
-@end ifinfo
+@end ifnottex
@node Association List Type
@comment node-name, next, previous, up
@tex
@math{2^{7}}
@end tex
-@ifinfo
+@ifnottex
2**7
-@end ifinfo
+@end ifnottex
bit of the character in the string. If the string is used in
@code{define-key} or @code{lookup-key}, this numeric code is translated
into the equivalent meta character. @xref{Character Type}.
integers: @code{(@var{high} @var{low} @var{microsec})}. The integers
@var{high} and @var{low} combine to give the number of seconds since
0:00 January 1, 1970 (local time), which is
-@ifinfo
+@ifnottex
@var{high} * 2**16 + @var{low}.
-@end ifinfo
+@end ifnottex
@tex
$high*2^{16}+low$.
@end tex
system-specific keysym. Each element has the form @code{(@var{code}
. @var{symbol})}, where @var{code} is the numeric keysym code (not
including the ``vendor specific'' bit,
-@ifinfo
+@ifnottex
-2**28),
-@end ifinfo
+@end ifnottex
@tex
$-2^{28}$),
@end tex
For example @code{(168 . mute-acute)} defines a system-specific key (used
by HP X servers) whose numeric code is
-@ifinfo
+@ifnottex
-2**28
-@end ifinfo
+@end ifnottex
@tex
$-2^{28}$
@end tex
@tindex inhibit-field-text-motion
If this variable is non-@code{nil}, certain motion functions including
@code{forward-word}, @code{forward-sentence}, and
-@codef{forward-paragraph} ignore field boundaries.
+@code{forward-paragraph} ignore field boundaries.
@end defvar
@node Buffer End Motion
one is the position of the end of the match for the expression. The
next two elements are the positions of the beginning and end of the
match for the first subexpression, and so on. In general, element
-@ifinfo
+@ifnottex
number 2@var{n}
-@end ifinfo
+@end ifnottex
@tex
number {\mathsurround=0pt $2n$}
@end tex
corresponds to @code{(match-beginning @var{n})}; and
element
-@ifinfo
+@ifnottex
number 2@var{n} + 1
-@end ifinfo
+@end ifnottex
@tex
number {\mathsurround=0pt $2n+1$}
@end tex
@node Syntax Basics
@section Syntax Table Concepts
-@ifinfo
+@ifnottex
A @dfn{syntax table} provides Emacs with the information that
determines the syntactic use of each character in a buffer. This
information is used by the parsing commands, the complex movement
the meaning of the word motion functions (@pxref{Word Motion}) and the
list motion functions (@pxref{List Motion}) as well as the functions in
this chapter.
-@end ifinfo
+@end ifnottex
A syntax table is a char-table (@pxref{Char-Tables}). The element at
index @var{c} describes the character with code @var{c}. The element's
around it. For example: @samp{`lambda'}. There are two exceptions:
write @code{t} and @code{nil} without single-quotes.
@end iftex
-@ifinfo
+@ifnottex
When a documentation string refers to a Lisp symbol, write it as it
would be printed (which usually means in lower case), with single-quotes
around it. For example: @samp{lambda}. There are two exceptions: write
t and nil without single-quotes. (In this manual, we use a different
convention, with single-quotes for all symbols.)
-@end ifinfo
+@end ifnottex
Help mode automatically creates a hyperlink when a documentation string
uses a symbol name inside single quotes, if the symbol has either a
@iftex
See the following section for
@end iftex
-@ifinfo
+@ifnottex
@xref{Displaying Buffers}, for
-@end ifinfo
+@end ifnottex
related functions that find a window to use and specify a buffer for it.
The functions described there are easier to use than these, but they
employ heuristics in choosing or creating a window; use these functions
@iftex
See the preceding section for
@end iftex
-@ifinfo
+@ifnottex
@xref{Buffers and Windows}, for
-@end ifinfo
+@end ifnottex
low-level functions that give you more precise control. All of these
functions work by calling @code{set-window-buffer}.