diff options
| -rw-r--r-- | doc/lispintro/ChangeLog | 7 | ||||
| -rw-r--r-- | doc/lispintro/emacs-lisp-intro.texi | 52 |
2 files changed, 35 insertions, 24 deletions
diff --git a/doc/lispintro/ChangeLog b/doc/lispintro/ChangeLog index 46709e2d888..0d6df0d5433 100644 --- a/doc/lispintro/ChangeLog +++ b/doc/lispintro/ChangeLog | |||
| @@ -1,3 +1,10 @@ | |||
| 1 | 2012-05-04 Glenn Morris <rgm@gnu.org> | ||
| 2 | |||
| 3 | * emacs-lisp-intro.texi (Making Errors): Don't mention Emacs 20. | ||
| 4 | (Void Function, Wrong Type of Argument, Recursion with list) | ||
| 5 | (Simple Extension): Assume a non-ancient Emacs. | ||
| 6 | (Void Variable, Switching Buffers): Improve page breaks. | ||
| 7 | |||
| 1 | 2012-05-03 Glenn Morris <rgm@gnu.org> | 8 | 2012-05-03 Glenn Morris <rgm@gnu.org> |
| 2 | 9 | ||
| 3 | * emacs-lisp-intro.texi: Update GNU Press contact details. | 10 | * emacs-lisp-intro.texi: Update GNU Press contact details. |
diff --git a/doc/lispintro/emacs-lisp-intro.texi b/doc/lispintro/emacs-lisp-intro.texi index 81a0edd7aba..9446333db2a 100644 --- a/doc/lispintro/emacs-lisp-intro.texi +++ b/doc/lispintro/emacs-lisp-intro.texi | |||
| @@ -1426,6 +1426,7 @@ C-e}: | |||
| 1426 | (this is an unquoted list) | 1426 | (this is an unquoted list) |
| 1427 | @end smallexample | 1427 | @end smallexample |
| 1428 | 1428 | ||
| 1429 | @ignore | ||
| 1429 | @noindent | 1430 | @noindent |
| 1430 | What you see depends on which version of Emacs you are running. GNU | 1431 | What you see depends on which version of Emacs you are running. GNU |
| 1431 | Emacs version 22 provides more information than version 20 and before. | 1432 | Emacs version 22 provides more information than version 20 and before. |
| @@ -1436,6 +1437,10 @@ earlier, version 20 result. | |||
| 1436 | @noindent | 1437 | @noindent |
| 1437 | In GNU Emacs version 22, a @file{*Backtrace*} window will open up and | 1438 | In GNU Emacs version 22, a @file{*Backtrace*} window will open up and |
| 1438 | you will see the following in it: | 1439 | you will see the following in it: |
| 1440 | @end ignore | ||
| 1441 | |||
| 1442 | A @file{*Backtrace*} window will open up and you should see the | ||
| 1443 | following in it: | ||
| 1439 | 1444 | ||
| 1440 | @smallexample | 1445 | @smallexample |
| 1441 | @group | 1446 | @group |
| @@ -1514,19 +1519,24 @@ evaluating @code{(+ 2 2)}, we can infer that the symbol @code{+} must | |||
| 1514 | have a set of instructions for the computer to obey and those | 1519 | have a set of instructions for the computer to obey and those |
| 1515 | instructions must be to add the numbers that follow the @code{+}. | 1520 | instructions must be to add the numbers that follow the @code{+}. |
| 1516 | 1521 | ||
| 1517 | @need 1250 | 1522 | It is possible to prevent Emacs entering the debugger in cases like |
| 1518 | In GNU Emacs version 20, and in earlier versions, you will see only | 1523 | this. We do not explain how to do that here, but we will mention what |
| 1519 | one line of error message; it will appear in the echo area and look | 1524 | the result looks like, because you may encounter a similar situation |
| 1520 | like this: | 1525 | if there is a bug in some Emacs code that you are using. In such |
| 1526 | cases, you will see only one line of error message; it will appear in | ||
| 1527 | the echo area and look like this: | ||
| 1521 | 1528 | ||
| 1522 | @smallexample | 1529 | @smallexample |
| 1523 | Symbol's function definition is void:@: this | 1530 | Symbol's function definition is void:@: this |
| 1524 | @end smallexample | 1531 | @end smallexample |
| 1525 | 1532 | ||
| 1526 | @noindent | 1533 | @noindent |
| 1534 | @ignore | ||
| 1527 | (Also, your terminal may beep at you---some do, some don't; and others | 1535 | (Also, your terminal may beep at you---some do, some don't; and others |
| 1528 | blink. This is just a device to get your attention.) The message goes | 1536 | blink. This is just a device to get your attention.) |
| 1529 | away as soon as you type another key, even just to move the cursor. | 1537 | @end ignore |
| 1538 | The message goes away as soon as you type a key, even just to | ||
| 1539 | move the cursor. | ||
| 1530 | 1540 | ||
| 1531 | We know the meaning of the word @samp{Symbol}. It refers to the first | 1541 | We know the meaning of the word @samp{Symbol}. It refers to the first |
| 1532 | atom of the list, the word @samp{this}. The word @samp{function} | 1542 | atom of the list, the word @samp{this}. The word @samp{function} |
| @@ -1862,8 +1872,7 @@ Try evaluating this: | |||
| 1862 | 1872 | ||
| 1863 | @need 1250 | 1873 | @need 1250 |
| 1864 | @noindent | 1874 | @noindent |
| 1865 | In GNU Emacs version 22, you will create a @file{*Backtrace*} buffer | 1875 | You will create a @file{*Backtrace*} buffer that says: |
| 1866 | that says: | ||
| 1867 | 1876 | ||
| 1868 | @smallexample | 1877 | @smallexample |
| 1869 | @group | 1878 | @group |
| @@ -1929,7 +1938,7 @@ Debugger entered--Lisp error: (void-variable +) | |||
| 1929 | @end smallexample | 1938 | @end smallexample |
| 1930 | 1939 | ||
| 1931 | @noindent | 1940 | @noindent |
| 1932 | (As with the other times we entered the debugger, you can quit by | 1941 | (Again, you can quit the debugger by |
| 1933 | typing @kbd{q} in the @file{*Backtrace*} buffer.) | 1942 | typing @kbd{q} in the @file{*Backtrace*} buffer.) |
| 1934 | 1943 | ||
| 1935 | This backtrace is different from the very first error message we saw, | 1944 | 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 | |||
| 1943 | variable instead of the function definition. We did this by placing the | 1952 | variable instead of the function definition. We did this by placing the |
| 1944 | cursor right after the symbol rather than after the parenthesis of the | 1953 | cursor right after the symbol rather than after the parenthesis of the |
| 1945 | enclosing list as we did before. As a consequence, the Lisp interpreter | 1954 | enclosing list as we did before. As a consequence, the Lisp interpreter |
| 1946 | evaluated the preceding s-expression, which in this case was the | 1955 | evaluated the preceding s-expression, which in this case was |
| 1947 | @code{+} by itself. | 1956 | @code{+} by itself. |
| 1948 | 1957 | ||
| 1949 | Since @code{+} does not have a value bound to it, just the function | 1958 | 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 | |||
| 2183 | could not carry out its addition. | 2192 | could not carry out its addition. |
| 2184 | 2193 | ||
| 2185 | @need 1250 | 2194 | @need 1250 |
| 2186 | In GNU Emacs version 22, you will create and enter a | 2195 | You will create and enter a @file{*Backtrace*} buffer that says: |
| 2187 | @file{*Backtrace*} buffer that says: | ||
| 2188 | 2196 | ||
| 2189 | @noindent | 2197 | @noindent |
| 2190 | @smallexample | 2198 | @smallexample |
| @@ -2912,7 +2920,7 @@ rather, to save typing, you probably only typed @kbd{RET} if the | |||
| 2912 | default buffer was @file{*scratch*}, or if it was different, then you | 2920 | default buffer was @file{*scratch*}, or if it was different, then you |
| 2913 | typed just part of the name, such as @code{*sc}, pressed your | 2921 | typed just part of the name, such as @code{*sc}, pressed your |
| 2914 | @kbd{TAB} key to cause it to expand to the full name, and then typed | 2922 | @kbd{TAB} key to cause it to expand to the full name, and then typed |
| 2915 | your @kbd{RET} key.} when prompted in the minibuffer for the name of | 2923 | @kbd{RET}.} when prompted in the minibuffer for the name of |
| 2916 | the buffer to which you wanted to switch. The keystrokes, @kbd{C-x | 2924 | the buffer to which you wanted to switch. The keystrokes, @kbd{C-x |
| 2917 | b}, cause the Lisp interpreter to evaluate the interactive function | 2925 | b}, cause the Lisp interpreter to evaluate the interactive function |
| 2918 | @code{switch-to-buffer}. As we said before, this is how Emacs works: | 2926 | @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, | |||
| 2922 | 2930 | ||
| 2923 | By writing @code{switch-to-buffer} in an expression, and giving it a | 2931 | By writing @code{switch-to-buffer} in an expression, and giving it a |
| 2924 | buffer to switch to, we can switch buffers just the way @kbd{C-x b} | 2932 | buffer to switch to, we can switch buffers just the way @kbd{C-x b} |
| 2925 | does. | 2933 | does: |
| 2926 | |||
| 2927 | @need 1000 | ||
| 2928 | Here is the Lisp expression: | ||
| 2929 | 2934 | ||
| 2930 | @smallexample | 2935 | @smallexample |
| 2931 | (switch-to-buffer (other-buffer)) | 2936 | (switch-to-buffer (other-buffer)) |
| @@ -7722,6 +7727,7 @@ retrieved. @xref{Yanking, , Yanking Text Back}. | |||
| 7722 | @section @code{zap-to-char} | 7727 | @section @code{zap-to-char} |
| 7723 | @findex zap-to-char | 7728 | @findex zap-to-char |
| 7724 | 7729 | ||
| 7730 | @c FIXME remove obsolete stuff | ||
| 7725 | The @code{zap-to-char} function changed little between GNU Emacs | 7731 | The @code{zap-to-char} function changed little between GNU Emacs |
| 7726 | version 19 and GNU Emacs version 22. However, @code{zap-to-char} | 7732 | version 19 and GNU Emacs version 22. However, @code{zap-to-char} |
| 7727 | calls another function, @code{kill-region}, which enjoyed a major | 7733 | 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 | |||
| 11508 | of numbers can be written recursively. Here is the code, including | 11514 | of numbers can be written recursively. Here is the code, including |
| 11509 | an expression to set the value of the variable @code{animals} to a list. | 11515 | an expression to set the value of the variable @code{animals} to a list. |
| 11510 | 11516 | ||
| 11511 | If you are using GNU Emacs 20 or before, this example must be copied | 11517 | If you are reading this in Info in Emacs, you can evaluate this |
| 11512 | to the @file{*scratch*} buffer and each expression must be evaluated | 11518 | expression directly in Info. Otherwise, you must copy the example |
| 11513 | there. Use @kbd{C-u C-x C-e} to evaluate the | 11519 | to the @file{*scratch*} buffer and evaluate each expression there. |
| 11520 | Use @kbd{C-u C-x C-e} to evaluate the | ||
| 11514 | @code{(print-elements-recursively animals)} expression so that the | 11521 | @code{(print-elements-recursively animals)} expression so that the |
| 11515 | results are printed in the buffer; otherwise the Lisp interpreter will | 11522 | results are printed in the buffer; otherwise the Lisp interpreter will |
| 11516 | try to squeeze the results into the one line of the echo area. | 11523 | 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 | |||
| 11519 | of the @code{print-elements-recursively} function, before the comment. | 11526 | of the @code{print-elements-recursively} function, before the comment. |
| 11520 | Otherwise, the Lisp interpreter will try to evaluate the comment. | 11527 | Otherwise, the Lisp interpreter will try to evaluate the comment. |
| 11521 | 11528 | ||
| 11522 | If you are using a more recent version of Emacs, you can evaluate this | ||
| 11523 | expression directly in Info. | ||
| 11524 | |||
| 11525 | @findex print-elements-recursively | 11529 | @findex print-elements-recursively |
| 11526 | @smallexample | 11530 | @smallexample |
| 11527 | @group | 11531 | @group |
| @@ -17949,7 +17953,7 @@ the following conditional: | |||
| 17949 | @end group | 17953 | @end group |
| 17950 | @end smallexample | 17954 | @end smallexample |
| 17951 | 17955 | ||
| 17952 | For example, in contrast to version 20, more recent versions blink | 17956 | For example, recent versions blink |
| 17953 | their cursors by default. I hate such blinking, as well as other | 17957 | their cursors by default. I hate such blinking, as well as other |
| 17954 | features, so I placed the following in my @file{.emacs} | 17958 | features, so I placed the following in my @file{.emacs} |
| 17955 | file@footnote{When I start instances of Emacs that do not load my | 17959 | file@footnote{When I start instances of Emacs that do not load my |