diff options
| author | Richard M. Stallman | 1994-05-05 07:21:27 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1994-05-05 07:21:27 +0000 |
| commit | 3e099569a8216bb980d45a366e75f7ceab4c5ead (patch) | |
| tree | 40e4f5ed4806b1dfc20ca47563940a4190983e77 | |
| parent | 2e00781a52fd9b7723e9beb5205a7e52696288a0 (diff) | |
| download | emacs-3e099569a8216bb980d45a366e75f7ceab4c5ead.tar.gz emacs-3e099569a8216bb980d45a366e75f7ceab4c5ead.zip | |
*** empty log message ***
| -rw-r--r-- | lispref/control.texi | 129 | ||||
| -rw-r--r-- | lispref/elisp.texi | 17 | ||||
| -rw-r--r-- | lispref/lists.texi | 4 | ||||
| -rw-r--r-- | lispref/minibuf.texi | 32 | ||||
| -rw-r--r-- | lispref/objects.texi | 10 |
5 files changed, 102 insertions, 90 deletions
diff --git a/lispref/control.texi b/lispref/control.texi index 7fa06693e4d..60fe2d56117 100644 --- a/lispref/control.texi +++ b/lispref/control.texi | |||
| @@ -11,22 +11,27 @@ | |||
| 11 | A Lisp program consists of expressions or @dfn{forms} (@pxref{Forms}). | 11 | A Lisp program consists of expressions or @dfn{forms} (@pxref{Forms}). |
| 12 | We control the order of execution of the forms by enclosing them in | 12 | We control the order of execution of the forms by enclosing them in |
| 13 | @dfn{control structures}. Control structures are special forms which | 13 | @dfn{control structures}. Control structures are special forms which |
| 14 | control when, whether, or how many times to execute the forms they contain. | 14 | control when, whether, or how many times to execute the forms they |
| 15 | contain. | ||
| 15 | 16 | ||
| 16 | The simplest control structure is sequential execution: first form | 17 | The simplest order of execution is sequential execution: first form |
| 17 | @var{a}, then form @var{b}, and so on. This is what happens when you | 18 | @var{a}, then form @var{b}, and so on. This is what happens when you |
| 18 | write several forms in succession in the body of a function, or at top | 19 | write several forms in succession in the body of a function, or at top |
| 19 | level in a file of Lisp code---the forms are executed in the order they | 20 | level in a file of Lisp code---the forms are executed in the order |
| 20 | are written. We call this @dfn{textual order}. For example, if a | 21 | written. We call this @dfn{textual order}. For example, if a function |
| 21 | function body consists of two forms @var{a} and @var{b}, evaluation of | 22 | body consists of two forms @var{a} and @var{b}, evaluation of the |
| 22 | the function evaluates first @var{a} and then @var{b}, and the | 23 | function evaluates first @var{a} and then @var{b}, and the function's |
| 23 | function's value is the value of @var{b}. | 24 | value is the value of @var{b}. |
| 25 | |||
| 26 | Explicit control structures make possible an order of execution other | ||
| 27 | than sequential. | ||
| 24 | 28 | ||
| 25 | Emacs Lisp provides several kinds of control structure, including | 29 | Emacs Lisp provides several kinds of control structure, including |
| 26 | other varieties of sequencing, function calls, conditionals, iteration, | 30 | other varieties of sequencing, conditionals, iteration, and (controlled) |
| 27 | and (controlled) jumps. The built-in control structures are special | 31 | jumps---all discussed below. The built-in control structures are |
| 28 | forms since their subforms are not necessarily evaluated. You can use | 32 | special forms since their subforms are not necessarily evaluated or not |
| 29 | macros to define your own control structure constructs (@pxref{Macros}). | 33 | evaluated sequentially. You can use macros to define your own control |
| 34 | structure constructs (@pxref{Macros}). | ||
| 30 | 35 | ||
| 31 | @menu | 36 | @menu |
| 32 | * Sequencing:: Evaluation in textual order. | 37 | * Sequencing:: Evaluation in textual order. |
| @@ -39,10 +44,11 @@ macros to define your own control structure constructs (@pxref{Macros}). | |||
| 39 | @node Sequencing | 44 | @node Sequencing |
| 40 | @section Sequencing | 45 | @section Sequencing |
| 41 | 46 | ||
| 42 | Evaluating forms in the order they are written is the most common | 47 | Evaluating forms in the order they appear is the most common way |
| 43 | control structure. Sometimes this happens automatically, such as in a | 48 | control passes from one form to another. In some contexts, such as in a |
| 44 | function body. Elsewhere you must use a control structure construct to | 49 | function body, this happens automatically. Elsewhere you must use a |
| 45 | do this: @code{progn}, the simplest control construct of Lisp. | 50 | control structure construct to do this: @code{progn}, the simplest |
| 51 | control construct of Lisp. | ||
| 46 | 52 | ||
| 47 | A @code{progn} special form looks like this: | 53 | A @code{progn} special form looks like this: |
| 48 | 54 | ||
| @@ -67,8 +73,8 @@ the body of a function was made into an ``implicit @code{progn}'': | |||
| 67 | several forms are allowed just as in the body of an actual @code{progn}. | 73 | several forms are allowed just as in the body of an actual @code{progn}. |
| 68 | Many other control structures likewise contain an implicit @code{progn}. | 74 | Many other control structures likewise contain an implicit @code{progn}. |
| 69 | As a result, @code{progn} is not used as often as it used to be. It is | 75 | As a result, @code{progn} is not used as often as it used to be. It is |
| 70 | needed now most often inside of an @code{unwind-protect}, @code{and}, | 76 | needed now most often inside an @code{unwind-protect}, @code{and}, |
| 71 | @code{or}, or the @var{else}-part of an @code{if}. | 77 | @code{or}, or in the @var{then}-part of an @code{if}. |
| 72 | 78 | ||
| 73 | @defspec progn forms@dots{} | 79 | @defspec progn forms@dots{} |
| 74 | This special form evaluates all of the @var{forms}, in textual | 80 | This special form evaluates all of the @var{forms}, in textual |
| @@ -151,7 +157,7 @@ an example of an implicit @code{progn}. @xref{Sequencing}.) | |||
| 151 | If @var{condition} has the value @code{nil}, and no @var{else-forms} are | 157 | If @var{condition} has the value @code{nil}, and no @var{else-forms} are |
| 152 | given, @code{if} returns @code{nil}. | 158 | given, @code{if} returns @code{nil}. |
| 153 | 159 | ||
| 154 | @code{if} is a special form because the branch which is not selected is | 160 | @code{if} is a special form because the branch that is not selected is |
| 155 | never evaluated---it is ignored. Thus, in the example below, | 161 | never evaluated---it is ignored. Thus, in the example below, |
| 156 | @code{true} is not printed because @code{print} is never called. | 162 | @code{true} is not printed because @code{print} is never called. |
| 157 | 163 | ||
| @@ -224,7 +230,7 @@ For example, | |||
| 224 | 230 | ||
| 225 | @example | 231 | @example |
| 226 | @group | 232 | @group |
| 227 | (cond ((eq a 1) 'foo) | 233 | (cond ((eq a 'hack) 'foo) |
| 228 | (t "default")) | 234 | (t "default")) |
| 229 | @result{} "default" | 235 | @result{} "default" |
| 230 | @end group | 236 | @end group |
| @@ -235,9 +241,9 @@ This expression is a @code{cond} which returns @code{foo} if the value | |||
| 235 | of @code{a} is 1, and returns the string @code{"default"} otherwise. | 241 | of @code{a} is 1, and returns the string @code{"default"} otherwise. |
| 236 | @end defspec | 242 | @end defspec |
| 237 | 243 | ||
| 238 | Both @code{cond} and @code{if} can usually be written in terms of the | 244 | Any conditional construct can be expressed with @code{cond} or with |
| 239 | other. Therefore, the choice between them is a matter of style. For | 245 | @code{if}. Therefore, the choice between them is a matter of style. |
| 240 | example: | 246 | For example: |
| 241 | 247 | ||
| 242 | @example | 248 | @example |
| 243 | @group | 249 | @group |
| @@ -418,8 +424,9 @@ first argument of @code{while}, as shown here: | |||
| 418 | @end example | 424 | @end example |
| 419 | 425 | ||
| 420 | @noindent | 426 | @noindent |
| 421 | This moves forward one line and continues moving by lines until an empty | 427 | This moves forward one line and continues moving by lines until it |
| 422 | line is reached. | 428 | reaches an empty. It is unusual in that the @code{while} has no body, |
| 429 | just the end test (which also does the real work of moving point). | ||
| 423 | @end defspec | 430 | @end defspec |
| 424 | 431 | ||
| 425 | @node Nonlocal Exits | 432 | @node Nonlocal Exits |
| @@ -454,7 +461,7 @@ that @code{catch}. For example: | |||
| 454 | (catch 'foo | 461 | (catch 'foo |
| 455 | (progn | 462 | (progn |
| 456 | @dots{} | 463 | @dots{} |
| 457 | (throw 'foo t) | 464 | (throw 'foo t) |
| 458 | @dots{})) | 465 | @dots{})) |
| 459 | @end group | 466 | @end group |
| 460 | @end example | 467 | @end example |
| @@ -481,7 +488,8 @@ and position saved by @code{save-excursion} (@pxref{Excursions}), and | |||
| 481 | the narrowing status saved by @code{save-restriction} and the window | 488 | the narrowing status saved by @code{save-restriction} and the window |
| 482 | selection saved by @code{save-window-excursion} (@pxref{Window | 489 | selection saved by @code{save-window-excursion} (@pxref{Window |
| 483 | Configurations}). It also runs any cleanups established with the | 490 | Configurations}). It also runs any cleanups established with the |
| 484 | @code{unwind-protect} special form when it exits that form. | 491 | @code{unwind-protect} special form when it exits that form |
| 492 | (@pxref{Cleanups}). | ||
| 485 | 493 | ||
| 486 | The @code{throw} need not appear lexically within the @code{catch} | 494 | The @code{throw} need not appear lexically within the @code{catch} |
| 487 | that it jumps to. It can equally well be called from another function | 495 | that it jumps to. It can equally well be called from another function |
| @@ -489,11 +497,11 @@ called within the @code{catch}. As long as the @code{throw} takes place | |||
| 489 | chronologically after entry to the @code{catch}, and chronologically | 497 | chronologically after entry to the @code{catch}, and chronologically |
| 490 | before exit from it, it has access to that @code{catch}. This is why | 498 | before exit from it, it has access to that @code{catch}. This is why |
| 491 | @code{throw} can be used in commands such as @code{exit-recursive-edit} | 499 | @code{throw} can be used in commands such as @code{exit-recursive-edit} |
| 492 | which throw back to the editor command loop (@pxref{Recursive Editing}). | 500 | that throw back to the editor command loop (@pxref{Recursive Editing}). |
| 493 | 501 | ||
| 494 | @cindex CL note---only @code{throw} in Emacs | 502 | @cindex CL note---only @code{throw} in Emacs |
| 495 | @quotation | 503 | @quotation |
| 496 | @b{Common Lisp note:} most other versions of Lisp, including Common Lisp, | 504 | @b{Common Lisp note:} Most other versions of Lisp, including Common Lisp, |
| 497 | have several ways of transferring control nonsequentially: @code{return}, | 505 | have several ways of transferring control nonsequentially: @code{return}, |
| 498 | @code{return-from}, and @code{go}, for example. Emacs Lisp has only | 506 | @code{return-from}, and @code{go}, for example. Emacs Lisp has only |
| 499 | @code{throw}. | 507 | @code{throw}. |
| @@ -607,11 +615,11 @@ printed. Finally the second body form in the outer @code{catch}, which is | |||
| 607 | @end example | 615 | @end example |
| 608 | 616 | ||
| 609 | @noindent | 617 | @noindent |
| 610 | We still have two return points, but this time only the outer one has the | 618 | We still have two return points, but this time only the outer one has |
| 611 | tag @code{hack}; the inner one has the tag @code{quux} instead. Therefore, | 619 | the tag @code{hack}; the inner one has the tag @code{quux} instead. |
| 612 | the @code{throw} returns the value @code{yes} from the outer return point. | 620 | Therefore, @code{throw} makes the outer @code{catch} return the value |
| 613 | The function @code{print} is never called, and the body-form @code{'no} is | 621 | @code{yes}. The function @code{print} is never called, and the |
| 614 | never evaluated. | 622 | body-form @code{'no} is never evaluated. |
| 615 | 623 | ||
| 616 | @node Errors | 624 | @node Errors |
| 617 | @subsection Errors | 625 | @subsection Errors |
| @@ -627,13 +635,13 @@ the end of the buffer. | |||
| 627 | 635 | ||
| 628 | In complicated programs, simple termination may not be what you want. | 636 | In complicated programs, simple termination may not be what you want. |
| 629 | For example, the program may have made temporary changes in data | 637 | For example, the program may have made temporary changes in data |
| 630 | structures, or created temporary buffers which should be deleted before | 638 | structures, or created temporary buffers that should be deleted before |
| 631 | the program is finished. In such cases, you would use | 639 | the program is finished. In such cases, you would use |
| 632 | @code{unwind-protect} to establish @dfn{cleanup expressions} to be | 640 | @code{unwind-protect} to establish @dfn{cleanup expressions} to be |
| 633 | evaluated in case of error. Occasionally, you may wish the program to | 641 | evaluated in case of error. (@xref{Cleanups}.) Occasionally, you may |
| 634 | continue execution despite an error in a subroutine. In these cases, | 642 | wish the program to continue execution despite an error in a subroutine. |
| 635 | you would use @code{condition-case} to establish @dfn{error handlers} to | 643 | In these cases, you would use @code{condition-case} to establish |
| 636 | recover control in case of error. | 644 | @dfn{error handlers} to recover control in case of error. |
| 637 | 645 | ||
| 638 | Resist the temptation to use error handling to transfer control from | 646 | Resist the temptation to use error handling to transfer control from |
| 639 | one part of the program to another; use @code{catch} and @code{throw} | 647 | one part of the program to another; use @code{catch} and @code{throw} |
| @@ -643,7 +651,7 @@ instead. @xref{Catch and Throw}. | |||
| 643 | * Signaling Errors:: How to report an error. | 651 | * Signaling Errors:: How to report an error. |
| 644 | * Processing of Errors:: What Emacs does when you report an error. | 652 | * Processing of Errors:: What Emacs does when you report an error. |
| 645 | * Handling Errors:: How you can trap errors and continue execution. | 653 | * Handling Errors:: How you can trap errors and continue execution. |
| 646 | * Error Names:: How errors are classified for trapping them. | 654 | * Error Symbols:: How errors are classified for trapping them. |
| 647 | @end menu | 655 | @end menu |
| 648 | 656 | ||
| 649 | @node Signaling Errors | 657 | @node Signaling Errors |
| @@ -703,12 +711,12 @@ errors. | |||
| 703 | 711 | ||
| 704 | The number and significance of the objects in @var{data} depends on | 712 | The number and significance of the objects in @var{data} depends on |
| 705 | @var{error-symbol}. For example, with a @code{wrong-type-arg} error, | 713 | @var{error-symbol}. For example, with a @code{wrong-type-arg} error, |
| 706 | there are two objects in the list: a predicate which describes the type | 714 | there are two objects in the list: a predicate that describes the type |
| 707 | that was expected, and the object which failed to fit that type. | 715 | that was expected, and the object that failed to fit that type. |
| 708 | @xref{Error Names}, for a description of error symbols. | 716 | @xref{Error Symbols}, for a description of error symbols. |
| 709 | 717 | ||
| 710 | Both @var{error-symbol} and @var{data} are available to any error | 718 | Both @var{error-symbol} and @var{data} are available to any error |
| 711 | handlers which handle the error: @code{condition-case} binds a local | 719 | handlers that handle the error: @code{condition-case} binds a local |
| 712 | variable to a list of the form @code{(@var{error-symbol} .@: | 720 | variable to a list of the form @code{(@var{error-symbol} .@: |
| 713 | @var{data})} (@pxref{Handling Errors}). If the error is not handled, | 721 | @var{data})} (@pxref{Handling Errors}). If the error is not handled, |
| 714 | these two values are used in printing the error message. | 722 | these two values are used in printing the error message. |
| @@ -743,7 +751,7 @@ When an error is signaled, @code{signal} searches for an active | |||
| 743 | expressions designated to be executed if an error happens in part of the | 751 | expressions designated to be executed if an error happens in part of the |
| 744 | Lisp program. If the error has an applicable handler, the handler is | 752 | Lisp program. If the error has an applicable handler, the handler is |
| 745 | executed, and control resumes following the handler. The handler | 753 | executed, and control resumes following the handler. The handler |
| 746 | executes in the environment of the @code{condition-case} which | 754 | executes in the environment of the @code{condition-case} that |
| 747 | established it; all functions called within that @code{condition-case} | 755 | established it; all functions called within that @code{condition-case} |
| 748 | have already been exited, and the handler cannot return to them. | 756 | have already been exited, and the handler cannot return to them. |
| 749 | 757 | ||
| @@ -788,8 +796,8 @@ returning @code{nil} if an error occurs. | |||
| 788 | call to @code{delete-file}.) The error handlers go into effect when | 796 | call to @code{delete-file}.) The error handlers go into effect when |
| 789 | this form begins execution and are deactivated when this form returns. | 797 | this form begins execution and are deactivated when this form returns. |
| 790 | They remain in effect for all the intervening time. In particular, they | 798 | They remain in effect for all the intervening time. In particular, they |
| 791 | are in effect during the execution of subroutines called by this form, | 799 | are in effect during the execution of functions called by this form, in |
| 792 | and their subroutines, and so on. This is a good thing, since, strictly | 800 | their subroutines, and so on. This is a good thing, since, strictly |
| 793 | speaking, errors can be signaled only by Lisp primitives (including | 801 | speaking, errors can be signaled only by Lisp primitives (including |
| 794 | @code{signal} and @code{error}) called by the protected form, not by the | 802 | @code{signal} and @code{error}) called by the protected form, not by the |
| 795 | protected form itself. | 803 | protected form itself. |
| @@ -830,7 +838,7 @@ read from the user. | |||
| 830 | @code{catch}, but they are entirely separate facilities. An error | 838 | @code{catch}, but they are entirely separate facilities. An error |
| 831 | cannot be caught by a @code{catch}, and a @code{throw} cannot be handled | 839 | cannot be caught by a @code{catch}, and a @code{throw} cannot be handled |
| 832 | by an error handler (though using @code{throw} when there is no suitable | 840 | by an error handler (though using @code{throw} when there is no suitable |
| 833 | @code{catch} signals an error which can be handled). | 841 | @code{catch} signals an error that can be handled). |
| 834 | 842 | ||
| 835 | @defspec condition-case var protected-form handlers@dots{} | 843 | @defspec condition-case var protected-form handlers@dots{} |
| 836 | This special form establishes the error handlers @var{handlers} around | 844 | This special form establishes the error handlers @var{handlers} around |
| @@ -858,10 +866,10 @@ Here are examples of handlers: | |||
| 858 | @end group | 866 | @end group |
| 859 | @end smallexample | 867 | @end smallexample |
| 860 | 868 | ||
| 861 | Each error that occurs has an @dfn{error symbol} which describes what | 869 | Each error that occurs has an @dfn{error symbol} that describes what |
| 862 | kind of error it is. The @code{error-conditions} property of this | 870 | kind of error it is. The @code{error-conditions} property of this |
| 863 | symbol is a list of condition names (@pxref{Error Names}). Emacs | 871 | symbol is a list of condition names (@pxref{Error Symbols}). Emacs |
| 864 | searches all the active @code{condition-case} forms for a handler which | 872 | searches all the active @code{condition-case} forms for a handler that |
| 865 | specifies one or more of these condition names; the innermost matching | 873 | specifies one or more of these condition names; the innermost matching |
| 866 | @code{condition-case} handles the error. Within this | 874 | @code{condition-case} handles the error. Within this |
| 867 | @code{condition-case}, the first applicable handler handles the error. | 875 | @code{condition-case}, the first applicable handler handles the error. |
| @@ -941,7 +949,7 @@ including those signaled with @code{error}: | |||
| 941 | @end group | 949 | @end group |
| 942 | @end smallexample | 950 | @end smallexample |
| 943 | 951 | ||
| 944 | @node Error Names | 952 | @node Error Symbols |
| 945 | @subsubsection Error Symbols and Condition Names | 953 | @subsubsection Error Symbols and Condition Names |
| 946 | @cindex error symbol | 954 | @cindex error symbol |
| 947 | @cindex error name | 955 | @cindex error name |
| @@ -966,7 +974,7 @@ classifications. | |||
| 966 | 974 | ||
| 967 | In order for a symbol to be an error symbol, it must have an | 975 | In order for a symbol to be an error symbol, it must have an |
| 968 | @code{error-conditions} property which gives a list of condition names. | 976 | @code{error-conditions} property which gives a list of condition names. |
| 969 | This list defines the conditions which this kind of error belongs to. | 977 | This list defines the conditions that this kind of error belongs to. |
| 970 | (The error symbol itself, and the symbol @code{error}, should always be | 978 | (The error symbol itself, and the symbol @code{error}, should always be |
| 971 | members of this list.) Thus, the hierarchy of condition names is | 979 | members of this list.) Thus, the hierarchy of condition names is |
| 972 | defined by the @code{error-conditions} properties of the error symbols. | 980 | defined by the @code{error-conditions} properties of the error symbols. |
| @@ -999,8 +1007,8 @@ classification; @code{my-own-errors}, which we imagine is a wider | |||
| 999 | classification; and @code{error}, which is the widest of all. | 1007 | classification; and @code{error}, which is the widest of all. |
| 1000 | 1008 | ||
| 1001 | Naturally, Emacs will never signal @code{new-error} on its own; only | 1009 | Naturally, Emacs will never signal @code{new-error} on its own; only |
| 1002 | an explicit call to @code{signal} (@pxref{Errors}) in your code can do | 1010 | an explicit call to @code{signal} (@pxref{Signaling Errors}) in your |
| 1003 | this: | 1011 | code can do this: |
| 1004 | 1012 | ||
| 1005 | @example | 1013 | @example |
| 1006 | @group | 1014 | @group |
| @@ -1094,12 +1102,13 @@ write another @code{save-excursion} around the body, to ensure that the | |||
| 1094 | temporary buffer becomes current in time to kill it.) | 1102 | temporary buffer becomes current in time to kill it.) |
| 1095 | 1103 | ||
| 1096 | @findex ftp-login | 1104 | @findex ftp-login |
| 1097 | Here is an actual example taken from the file @file{ftp.el}. It creates | 1105 | Here is an actual example taken from the file @file{ftp.el}. It |
| 1098 | a process (@pxref{Processes}) to try to establish a connection to a remote | 1106 | creates a process (@pxref{Processes}) to try to establish a connection |
| 1099 | machine. As the function @code{ftp-login} is highly susceptible to | 1107 | to a remote machine. As the function @code{ftp-login} is highly |
| 1100 | numerous problems which the writer of the function cannot anticipate, it is | 1108 | susceptible to numerous problems that the writer of the function cannot |
| 1101 | protected with a form that guarantees deletion of the process in the event | 1109 | anticipate, it is protected with a form that guarantees deletion of the |
| 1102 | of failure. Otherwise, Emacs might fill up with useless subprocesses. | 1110 | process in the event of failure. Otherwise, Emacs might fill up with |
| 1111 | useless subprocesses. | ||
| 1103 | 1112 | ||
| 1104 | @smallexample | 1113 | @smallexample |
| 1105 | @group | 1114 | @group |
diff --git a/lispref/elisp.texi b/lispref/elisp.texi index 3b54cb66444..d9984ebfcc2 100644 --- a/lispref/elisp.texi +++ b/lispref/elisp.texi | |||
| @@ -69,7 +69,7 @@ instead of in the original English. | |||
| 69 | @c The edition number appears in several places in this file | 69 | @c The edition number appears in several places in this file |
| 70 | @c and also in the file intro.texi. | 70 | @c and also in the file intro.texi. |
| 71 | @subtitle Second Edition, June 1993 | 71 | @subtitle Second Edition, June 1993 |
| 72 | @subtitle Revision 2.3, April 1994 | 72 | @subtitle Revision 2.3, May 1994 |
| 73 | 73 | ||
| 74 | @author by Bil Lewis, Dan LaLiberte, Richard Stallman | 74 | @author by Bil Lewis, Dan LaLiberte, Richard Stallman |
| 75 | @author and the GNU Manual Group | 75 | @author and the GNU Manual Group |
| @@ -80,7 +80,7 @@ Copyright @copyright{} 1990, 1991, 1992, 1993, 1994 Free Software Foundation, In | |||
| 80 | @sp 2 | 80 | @sp 2 |
| 81 | Second Edition @* | 81 | Second Edition @* |
| 82 | Revised for Emacs Version 19.23,@* | 82 | Revised for Emacs Version 19.23,@* |
| 83 | April 1994.@* | 83 | May 1994.@* |
| 84 | @sp 2 | 84 | @sp 2 |
| 85 | ISBN 1-882114-40-X | 85 | ISBN 1-882114-40-X |
| 86 | 86 | ||
| @@ -121,7 +121,7 @@ Reference Manual, corresponding to GNU Emacs version 19.23. | |||
| 121 | * Copying:: Conditions for copying and changing GNU Emacs. | 121 | * Copying:: Conditions for copying and changing GNU Emacs. |
| 122 | * Introduction:: Introduction and conventions used. | 122 | * Introduction:: Introduction and conventions used. |
| 123 | 123 | ||
| 124 | * Types of Lisp Object:: Data types in Emacs Lisp. | 124 | * Lisp Data Types:: Data types of objects in Emacs Lisp. |
| 125 | * Numbers:: Numbers and arithmetic functions. | 125 | * Numbers:: Numbers and arithmetic functions. |
| 126 | * Strings and Characters:: Strings, and functions that work on them. | 126 | * Strings and Characters:: Strings, and functions that work on them. |
| 127 | * Lists:: Lists, cons cells, and related functions. | 127 | * Lists:: Lists, cons cells, and related functions. |
| @@ -141,7 +141,7 @@ Reference Manual, corresponding to GNU Emacs version 19.23. | |||
| 141 | * Byte Compilation:: Compilation makes programs run faster. | 141 | * Byte Compilation:: Compilation makes programs run faster. |
| 142 | * Debugging:: Tools and tips for debugging Lisp programs. | 142 | * Debugging:: Tools and tips for debugging Lisp programs. |
| 143 | 143 | ||
| 144 | * Streams:: Converting Lisp objects to text and back. | 144 | * Read and Print:: Converting Lisp objects to text and back. |
| 145 | * Minibuffers:: Using the minibuffer to read input. | 145 | * Minibuffers:: Using the minibuffer to read input. |
| 146 | * Command Loop:: How the editor command loop works, | 146 | * Command Loop:: How the editor command loop works, |
| 147 | and how you can call its subroutines. | 147 | and how you can call its subroutines. |
| @@ -229,14 +229,14 @@ Programming Types | |||
| 229 | * Character Type:: The representation of letters, numbers and | 229 | * Character Type:: The representation of letters, numbers and |
| 230 | control characters. | 230 | control characters. |
| 231 | * Sequence Type:: Both lists and arrays are classified as sequences. | 231 | * Sequence Type:: Both lists and arrays are classified as sequences. |
| 232 | * List Type:: Lists gave Lisp its name (not to mention reputation). | 232 | * Cons Cell Type:: Cons cells, and lists (which are made from cons cells). |
| 233 | * Array Type:: Arrays include strings and vectors. | 233 | * Array Type:: Arrays include strings and vectors. |
| 234 | * String Type:: An (efficient) array of characters. | 234 | * String Type:: An (efficient) array of characters. |
| 235 | * Vector Type:: One-dimensional arrays. | 235 | * Vector Type:: One-dimensional arrays. |
| 236 | * Symbol Type:: A multi-use object that refers to a function, | 236 | * Symbol Type:: A multi-use object that refers to a function, |
| 237 | variable, property list, or itself. | 237 | variable, property list, or itself. |
| 238 | * Lisp Function Type:: A piece of executable code you can call from elsewhere. | 238 | * Function Type:: A piece of executable code you can call from elsewhere. |
| 239 | * Lisp Macro Type:: A method of expanding an expression into another | 239 | * Macro Type:: A method of expanding an expression into another |
| 240 | expression, more fundamental but less pretty. | 240 | expression, more fundamental but less pretty. |
| 241 | * Primitive Function Type:: A function written in C, callable from Lisp. | 241 | * Primitive Function Type:: A function written in C, callable from Lisp. |
| 242 | * Byte-Code Type:: A function written in Lisp, then compiled. | 242 | * Byte-Code Type:: A function written in Lisp, then compiled. |
| @@ -356,7 +356,7 @@ Errors | |||
| 356 | * Signaling Errors:: How to report an error. | 356 | * Signaling Errors:: How to report an error. |
| 357 | * Processing of Errors:: What Emacs does when you report an error. | 357 | * Processing of Errors:: What Emacs does when you report an error. |
| 358 | * Handling Errors:: How you can trap errors and continue execution. | 358 | * Handling Errors:: How you can trap errors and continue execution. |
| 359 | * Error Names:: How errors are classified for trapping them. | 359 | * Error Symbols:: How errors are classified for trapping them. |
| 360 | 360 | ||
| 361 | Variables | 361 | Variables |
| 362 | 362 | ||
| @@ -699,7 +699,6 @@ Text | |||
| 699 | * Columns:: Computing horizontal positions, and using them. | 699 | * Columns:: Computing horizontal positions, and using them. |
| 700 | * Case Changes:: Case conversion of parts of the buffer. | 700 | * Case Changes:: Case conversion of parts of the buffer. |
| 701 | * Substitution:: Replacing a given character wherever it appears. | 701 | * Substitution:: Replacing a given character wherever it appears. |
| 702 | * Underlining:: Inserting or deleting underlining-by-overstrike. | ||
| 703 | * Registers:: How registers are implemented. Accessing | 702 | * Registers:: How registers are implemented. Accessing |
| 704 | the text or position stored in a register. | 703 | the text or position stored in a register. |
| 705 | 704 | ||
diff --git a/lispref/lists.texi b/lispref/lists.texi index 1ec45ab20ca..7f0fc818ce2 100644 --- a/lispref/lists.texi +++ b/lispref/lists.texi | |||
| @@ -1408,12 +1408,12 @@ the new alist without changing the old one. | |||
| 1408 | (cdr (car (cdr copy)))) | 1408 | (cdr (car (cdr copy)))) |
| 1409 | @result{} t | 1409 | @result{} t |
| 1410 | @end group | 1410 | @end group |
| 1411 | @end example | 1411 | @end smallexample |
| 1412 | 1412 | ||
| 1413 | This example shows how @code{copy-alist} makes it possible to change | 1413 | This example shows how @code{copy-alist} makes it possible to change |
| 1414 | the associations of one copy without affecting the other: | 1414 | the associations of one copy without affecting the other: |
| 1415 | 1415 | ||
| 1416 | @example | 1416 | @smallexample |
| 1417 | @group | 1417 | @group |
| 1418 | (setcdr (assq 3 needles-per-cluster) | 1418 | (setcdr (assq 3 needles-per-cluster) |
| 1419 | '("Martian Vacuum Pine")) | 1419 | '("Martian Vacuum Pine")) |
diff --git a/lispref/minibuf.texi b/lispref/minibuf.texi index ab7590ed705..b285e5a2a3f 100644 --- a/lispref/minibuf.texi +++ b/lispref/minibuf.texi | |||
| @@ -3,7 +3,7 @@ | |||
| 3 | @c Copyright (C) 1990, 1991, 1992, 1993, 1994 Free Software Foundation, Inc. | 3 | @c Copyright (C) 1990, 1991, 1992, 1993, 1994 Free Software Foundation, Inc. |
| 4 | @c See the file elisp.texi for copying conditions. | 4 | @c See the file elisp.texi for copying conditions. |
| 5 | @setfilename ../info/minibuf | 5 | @setfilename ../info/minibuf |
| 6 | @node Minibuffers, Command Loop, Streams, Top | 6 | @node Minibuffers, Command Loop, Read and Print, Top |
| 7 | @chapter Minibuffers | 7 | @chapter Minibuffers |
| 8 | @cindex arguments, reading | 8 | @cindex arguments, reading |
| 9 | @cindex complex arguments | 9 | @cindex complex arguments |
| @@ -766,7 +766,7 @@ The list of completions is displayed as text in a buffer named | |||
| 766 | 766 | ||
| 767 | @defun display-completion-list completions | 767 | @defun display-completion-list completions |
| 768 | This function displays @var{completions} to the stream in | 768 | This function displays @var{completions} to the stream in |
| 769 | @code{standard-output}, usually a buffer. (@xref{Streams}, for more | 769 | @code{standard-output}, usually a buffer. (@xref{Read and Print}, for more |
| 770 | information about streams.) The argument @var{completions} is normally | 770 | information about streams.) The argument @var{completions} is normally |
| 771 | a list of completions just returned by @code{all-completions}, but it | 771 | a list of completions just returned by @code{all-completions}, but it |
| 772 | does not have to be. Each element may be a symbol or a string, either | 772 | does not have to be. Each element may be a symbol or a string, either |
| @@ -1099,6 +1099,14 @@ will not have serious consequences. @code{yes-or-no-p} is suitable for | |||
| 1099 | more momentous questions, since it requires three or four characters to | 1099 | more momentous questions, since it requires three or four characters to |
| 1100 | answer. | 1100 | answer. |
| 1101 | 1101 | ||
| 1102 | If either of these functions is called in a command that was invoked | ||
| 1103 | using the mouse---more precisely, if @code{last-nonmenu-event} | ||
| 1104 | (@pxref{Command Loop Info}) is either @code{nil} or a list---then it | ||
| 1105 | uses a dialog box or pop-up menu to ask the question. Otherwise, it | ||
| 1106 | uses keyboard input. You can force use of the mouse or use of keyboard | ||
| 1107 | input by binding @code{last-nonmenu-event} to a suitable value around | ||
| 1108 | the call. | ||
| 1109 | |||
| 1102 | Strictly speaking, @code{yes-or-no-p} uses the minibuffer and | 1110 | Strictly speaking, @code{yes-or-no-p} uses the minibuffer and |
| 1103 | @code{y-or-n-p} does not; but it seems best to describe them together. | 1111 | @code{y-or-n-p} does not; but it seems best to describe them together. |
| 1104 | 1112 | ||
| @@ -1127,12 +1135,6 @@ The answers and their meanings, even @samp{y} and @samp{n}, are not | |||
| 1127 | hardwired. The keymap @code{query-replace-map} specifies them. | 1135 | hardwired. The keymap @code{query-replace-map} specifies them. |
| 1128 | @xref{Search and Replace}. | 1136 | @xref{Search and Replace}. |
| 1129 | 1137 | ||
| 1130 | If @code{y-or-n-p} is called in a command that was invoked using the | ||
| 1131 | mouse---more precisely, if @code{last-nonmenu-event} (@pxref{Command | ||
| 1132 | Loop Info}) is either @code{nil} or a mouse event---then it uses a | ||
| 1133 | dialog box or pop-up menu to ask the question. In this case, it does | ||
| 1134 | not use keyboard input or the echo area. | ||
| 1135 | |||
| 1136 | In the following example, the user first types @kbd{q}, which is | 1138 | In the following example, the user first types @kbd{q}, which is |
| 1137 | invalid. At the next prompt the user types @kbd{y}. | 1139 | invalid. At the next prompt the user types @kbd{y}. |
| 1138 | 1140 | ||
| @@ -1187,12 +1189,6 @@ yes or no.}, waits about two seconds and repeats the request. | |||
| 1187 | @code{yes-or-no-p} requires more work from the user than | 1189 | @code{yes-or-no-p} requires more work from the user than |
| 1188 | @code{y-or-n-p} and is appropriate for more crucial decisions. | 1190 | @code{y-or-n-p} and is appropriate for more crucial decisions. |
| 1189 | 1191 | ||
| 1190 | If @code{yes-or-no-p} is called in a command that was invoked using | ||
| 1191 | the mouse---more precisely, if @code{last-nonmenu-event} (@pxref{Command | ||
| 1192 | Loop Info}) is either @code{nil} or a mouse event---then it uses a | ||
| 1193 | dialog box or pop-up menu to ask the question. In this case, it does | ||
| 1194 | not use keyboard input or the echo area. | ||
| 1195 | |||
| 1196 | Here is an example: | 1192 | Here is an example: |
| 1197 | 1193 | ||
| 1198 | @smallexample | 1194 | @smallexample |
| @@ -1301,6 +1297,14 @@ When the user responds with @var{char}, @code{map-y-or-n-p} calls | |||
| 1301 | @var{list}. If it returns @code{nil}, the prompt is repeated for the | 1297 | @var{list}. If it returns @code{nil}, the prompt is repeated for the |
| 1302 | same object. | 1298 | same object. |
| 1303 | 1299 | ||
| 1300 | If @code{map-y-or-n-p} is called in a command that was invoked using the | ||
| 1301 | mouse---more precisely, if @code{last-nonmenu-event} (@pxref{Command | ||
| 1302 | Loop Info}) is either @code{nil} or a list---then it uses a dialog box | ||
| 1303 | or pop-up menu to ask the question. In this case, it does not use | ||
| 1304 | keyboard input or the echo area. You can force use of the mouse or use | ||
| 1305 | of keyboard input by binding @code{last-nonmenu-event} to a suitable | ||
| 1306 | value around the call. | ||
| 1307 | |||
| 1304 | The return value of @code{map-y-or-n-p} is the number of objects acted on. | 1308 | The return value of @code{map-y-or-n-p} is the number of objects acted on. |
| 1305 | @end defun | 1309 | @end defun |
| 1306 | 1310 | ||
diff --git a/lispref/objects.texi b/lispref/objects.texi index 6dd8912671c..ede4d2cb554 100644 --- a/lispref/objects.texi +++ b/lispref/objects.texi | |||
| @@ -131,15 +131,15 @@ latter are unique to Emacs Lisp. | |||
| 131 | * Floating Point Type:: Numbers with fractional parts and with a large range. | 131 | * Floating Point Type:: Numbers with fractional parts and with a large range. |
| 132 | * Character Type:: The representation of letters, numbers and | 132 | * Character Type:: The representation of letters, numbers and |
| 133 | control characters. | 133 | control characters. |
| 134 | * Symbol Type:: A multi-use object that refers to a function, | ||
| 135 | variable, or property list, and has a unique identity. | ||
| 134 | * Sequence Type:: Both lists and arrays are classified as sequences. | 136 | * Sequence Type:: Both lists and arrays are classified as sequences. |
| 135 | * Cons Cell Type:: Cons cells, and lists (which are made from cons cells). | 137 | * Cons Cell Type:: Cons cells, and lists (which are made from cons cells). |
| 136 | * Array Type:: Arrays include strings and vectors. | 138 | * Array Type:: Arrays include strings and vectors. |
| 137 | * String Type:: An (efficient) array of characters. | 139 | * String Type:: An (efficient) array of characters. |
| 138 | * Vector Type:: One-dimensional arrays. | 140 | * Vector Type:: One-dimensional arrays. |
| 139 | * Symbol Type:: A multi-use object that refers to a function, | 141 | * Function Type:: A piece of executable code you can call from elsewhere. |
| 140 | variable, property list, or itself. | 142 | * Macro Type:: A method of expanding an expression into another |
| 141 | * Lisp Function Type:: A piece of executable code you can call from elsewhere. | ||
| 142 | * Lisp Macro Type:: A method of expanding an expression into another | ||
| 143 | expression, more fundamental but less pretty. | 143 | expression, more fundamental but less pretty. |
| 144 | * Primitive Function Type:: A function written in C, callable from Lisp. | 144 | * Primitive Function Type:: A function written in C, callable from Lisp. |
| 145 | * Byte-Code Type:: A function written in Lisp, then compiled. | 145 | * Byte-Code Type:: A function written in Lisp, then compiled. |
| @@ -1150,7 +1150,7 @@ Area}). | |||
| 1150 | Streams have no special printed representation or read syntax, and | 1150 | Streams have no special printed representation or read syntax, and |
| 1151 | print as whatever primitive type they are. | 1151 | print as whatever primitive type they are. |
| 1152 | 1152 | ||
| 1153 | @xref{Streams, Reading and Printing}, for a description of functions | 1153 | @xref{Read and Print}, for a description of functions |
| 1154 | related to streams, including parsing and printing functions. | 1154 | related to streams, including parsing and printing functions. |
| 1155 | 1155 | ||
| 1156 | @node Keymap Type | 1156 | @node Keymap Type |