Commit 8f4ea8e0 authored by Glenn Morris's avatar Glenn Morris
Browse files

Small lispintro edits

* emacs-lisp-intro.texi (Making Errors): Don't mention Emacs 20.
(Void Function, Wrong Type of Argument, Recursion with list)
(Simple Extension): Assume a non-ancient Emacs.
(Void Variable, Switching Buffers): Improve page breaks.
parent d1714b94
2012-05-04 Glenn Morris <rgm@gnu.org>
* emacs-lisp-intro.texi (Making Errors): Don't mention Emacs 20.
(Void Function, Wrong Type of Argument, Recursion with list)
(Simple Extension): Assume a non-ancient Emacs.
(Void Variable, Switching Buffers): Improve page breaks.
2012-05-03 Glenn Morris <rgm@gnu.org>
* emacs-lisp-intro.texi: Update GNU Press contact details.
......
......@@ -1426,6 +1426,7 @@ C-e}:
(this is an unquoted list)
@end smallexample
 
@ignore
@noindent
What you see depends on which version of Emacs you are running. GNU
Emacs version 22 provides more information than version 20 and before.
......@@ -1436,6 +1437,10 @@ earlier, version 20 result.
@noindent
In GNU Emacs version 22, a @file{*Backtrace*} window will open up and
you will see the following in it:
@end ignore
A @file{*Backtrace*} window will open up and you should see the
following in it:
 
@smallexample
@group
......@@ -1514,19 +1519,24 @@ evaluating @code{(+ 2 2)}, we can infer that the symbol @code{+} must
have a set of instructions for the computer to obey and those
instructions must be to add the numbers that follow the @code{+}.
 
@need 1250
In GNU Emacs version 20, and in earlier versions, you will see only
one line of error message; it will appear in the echo area and look
like this:
It is possible to prevent Emacs entering the debugger in cases like
this. We do not explain how to do that here, but we will mention what
the result looks like, because you may encounter a similar situation
if there is a bug in some Emacs code that you are using. In such
cases, you will see only one line of error message; it will appear in
the echo area and look like this:
 
@smallexample
Symbol's function definition is void:@: this
@end smallexample
 
@noindent
@ignore
(Also, your terminal may beep at you---some do, some don't; and others
blink. This is just a device to get your attention.) The message goes
away as soon as you type another key, even just to move the cursor.
blink. This is just a device to get your attention.)
@end ignore
The message goes away as soon as you type a key, even just to
move the cursor.
 
We know the meaning of the word @samp{Symbol}. It refers to the first
atom of the list, the word @samp{this}. The word @samp{function}
......@@ -1862,8 +1872,7 @@ Try evaluating this:
 
@need 1250
@noindent
In GNU Emacs version 22, you will create a @file{*Backtrace*} buffer
that says:
You will create a @file{*Backtrace*} buffer that says:
 
@smallexample
@group
......@@ -1929,7 +1938,7 @@ Debugger entered--Lisp error: (void-variable +)
@end smallexample
 
@noindent
(As with the other times we entered the debugger, you can quit by
(Again, you can quit the debugger by
typing @kbd{q} in the @file{*Backtrace*} buffer.)
 
This backtrace is different from the very first error message we saw,
......@@ -1943,7 +1952,7 @@ interpreter to evaluate the @code{+} and look for the value of the
variable instead of the function definition. We did this by placing the
cursor right after the symbol rather than after the parenthesis of the
enclosing list as we did before. As a consequence, the Lisp interpreter
evaluated the preceding s-expression, which in this case was the
evaluated the preceding s-expression, which in this case was
@code{+} by itself.
 
Since @code{+} does not have a value bound to it, just the function
......@@ -2183,8 +2192,7 @@ is that @code{+} has tried to add the 2 to the value returned by
could not carry out its addition.
 
@need 1250
In GNU Emacs version 22, you will create and enter a
@file{*Backtrace*} buffer that says:
You will create and enter a @file{*Backtrace*} buffer that says:
 
@noindent
@smallexample
......@@ -2912,7 +2920,7 @@ rather, to save typing, you probably only typed @kbd{RET} if the
default buffer was @file{*scratch*}, or if it was different, then you
typed just part of the name, such as @code{*sc}, pressed your
@kbd{TAB} key to cause it to expand to the full name, and then typed
your @kbd{RET} key.} when prompted in the minibuffer for the name of
@kbd{RET}.} when prompted in the minibuffer for the name of
the buffer to which you wanted to switch. The keystrokes, @kbd{C-x
b}, cause the Lisp interpreter to evaluate the interactive function
@code{switch-to-buffer}. As we said before, this is how Emacs works:
......@@ -2922,10 +2930,7 @@ different keystrokes call or run different functions. For example,
 
By writing @code{switch-to-buffer} in an expression, and giving it a
buffer to switch to, we can switch buffers just the way @kbd{C-x b}
does.
@need 1000
Here is the Lisp expression:
does:
 
@smallexample
(switch-to-buffer (other-buffer))
......@@ -7722,6 +7727,7 @@ retrieved. @xref{Yanking, , Yanking Text Back}.
@section @code{zap-to-char}
@findex zap-to-char
 
@c FIXME remove obsolete stuff
The @code{zap-to-char} function changed little between GNU Emacs
version 19 and GNU Emacs version 22. However, @code{zap-to-char}
calls another function, @code{kill-region}, which enjoyed a major
......@@ -11508,9 +11514,10 @@ The example of a @code{while} loop that printed the elements of a list
of numbers can be written recursively. Here is the code, including
an expression to set the value of the variable @code{animals} to a list.
 
If you are using GNU Emacs 20 or before, this example must be copied
to the @file{*scratch*} buffer and each expression must be evaluated
there. Use @kbd{C-u C-x C-e} to evaluate the
If you are reading this in Info in Emacs, you can evaluate this
expression directly in Info. Otherwise, you must copy the example
to the @file{*scratch*} buffer and evaluate each expression there.
Use @kbd{C-u C-x C-e} to evaluate the
@code{(print-elements-recursively animals)} expression so that the
results are printed in the buffer; otherwise the Lisp interpreter will
try to squeeze the results into the one line of the echo area.
......@@ -11519,9 +11526,6 @@ Also, place your cursor immediately after the last closing parenthesis
of the @code{print-elements-recursively} function, before the comment.
Otherwise, the Lisp interpreter will try to evaluate the comment.
 
If you are using a more recent version of Emacs, you can evaluate this
expression directly in Info.
@findex print-elements-recursively
@smallexample
@group
......@@ -17949,7 +17953,7 @@ the following conditional:
@end group
@end smallexample
 
For example, in contrast to version 20, more recent versions blink
For example, recent versions blink
their cursors by default. I hate such blinking, as well as other
features, so I placed the following in my @file{.emacs}
file@footnote{When I start instances of Emacs that do not load my
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment