diff options
| author | Joakim Verona | 2012-02-15 15:12:49 +0100 |
|---|---|---|
| committer | Joakim Verona | 2012-02-15 15:12:49 +0100 |
| commit | 02db17e53bf46c91b2cb8ee33b43d8ae252a1681 (patch) | |
| tree | fcafa961e884648e15524130f1dbca55dc7093d0 /doc/lispref | |
| parent | 736ab04e2752e7c3c5b5070a0d62279dcfb12b27 (diff) | |
| parent | 1deeb569b1247db4c0b2eea4906a9e53e5ee7e99 (diff) | |
| download | emacs-02db17e53bf46c91b2cb8ee33b43d8ae252a1681.tar.gz emacs-02db17e53bf46c91b2cb8ee33b43d8ae252a1681.zip | |
upstream
Diffstat (limited to 'doc/lispref')
| -rw-r--r-- | doc/lispref/ChangeLog | 72 | ||||
| -rw-r--r-- | doc/lispref/advice.texi | 101 | ||||
| -rw-r--r-- | doc/lispref/commands.texi | 195 | ||||
| -rw-r--r-- | doc/lispref/compile.texi | 204 | ||||
| -rw-r--r-- | doc/lispref/control.texi | 10 | ||||
| -rw-r--r-- | doc/lispref/debugging.texi | 216 | ||||
| -rw-r--r-- | doc/lispref/display.texi | 157 | ||||
| -rw-r--r-- | doc/lispref/elisp.texi | 7 | ||||
| -rw-r--r-- | doc/lispref/files.texi | 23 | ||||
| -rw-r--r-- | doc/lispref/loading.texi | 173 | ||||
| -rw-r--r-- | doc/lispref/objects.texi | 10 | ||||
| -rw-r--r-- | doc/lispref/streams.texi | 11 | ||||
| -rw-r--r-- | doc/lispref/text.texi | 20 | ||||
| -rw-r--r-- | doc/lispref/vol1.texi | 7 | ||||
| -rw-r--r-- | doc/lispref/vol2.texi | 7 |
15 files changed, 601 insertions, 612 deletions
diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog index a823f4272fc..c5848ca8b2d 100644 --- a/doc/lispref/ChangeLog +++ b/doc/lispref/ChangeLog | |||
| @@ -1,5 +1,77 @@ | |||
| 1 | 2012-02-12 Chong Yidong <cyd@gnu.org> | ||
| 2 | |||
| 3 | * debugging.texi (Debugger Commands): Continuing is now allowed | ||
| 4 | for errors. | ||
| 5 | |||
| 6 | 2012-02-11 Chong Yidong <cyd@gnu.org> | ||
| 7 | |||
| 8 | * display.texi (Fringe Indicators): Add xref to Fringe Bitmaps. | ||
| 9 | Move the list of standard bitmaps there. | ||
| 10 | (Fringe Cursors): Rewrite for clarity. | ||
| 11 | (Fringe Bitmaps): Consolidate the list of standard bitmaps here. | ||
| 12 | |||
| 13 | * commands.texi (Command Overview): Mention read-key. | ||
| 14 | (Using Interactive, Interactive Call): Minor clarifications. | ||
| 15 | (Function Keys, Click Events): Avoid "input stream" terminology. | ||
| 16 | (Click Events): Add xref to Window Sizes and Accessing Mouse. | ||
| 17 | Clarify column and row components. | ||
| 18 | (Accessing Mouse): Add xref to Click Events. Minor fixes. | ||
| 19 | (Special Events): Copyedits. | ||
| 20 | |||
| 21 | * streams.texi (Input Streams): De-document get-file-char. | ||
| 22 | (Output Variables): Don't refer to old backquote syntax. | ||
| 23 | |||
| 24 | * debugging.texi (Debugging): Copyedits. Describe testcover, ERT. | ||
| 25 | (Error Debugging): Note that debug-ignored-errors overrides list | ||
| 26 | values of debug-on-error too. Add xref to Signaling Errors. Note | ||
| 27 | that debug-on-signal is not customizable. Mention | ||
| 28 | condition-case-unless-debug. | ||
| 29 | (Compilation Errors): Node deleted. | ||
| 30 | |||
| 31 | * compile.texi (Compiler Errors): Move a paragraph here from | ||
| 32 | deleted node Compilation Errors. | ||
| 33 | |||
| 34 | 2012-02-10 Leo Liu <sdl.web@gmail.com> | ||
| 35 | |||
| 36 | * control.texi (Handling Errors): Change condition-case-no-debug | ||
| 37 | to condition-case-unless-debug. | ||
| 38 | |||
| 39 | 2012-02-10 Chong Yidong <cyd@gnu.org> | ||
| 40 | |||
| 41 | * advice.texi (Defining Advice): Clarify ad-unadvise. | ||
| 42 | (Activation of Advice): Specifying the ACTIVATE flag in defadvice | ||
| 43 | is not abnormal. | ||
| 44 | (Advising Primitives): Node deleted; ad-define-subr-args has been | ||
| 45 | removed. | ||
| 46 | |||
| 47 | * compile.texi (Speed of Byte-Code): Use float-time in example. | ||
| 48 | (Compilation Functions): Note that the log uses Compilation mode. | ||
| 49 | Don't discuss the contents of byte-code function object here. | ||
| 50 | (Compilation Functions): De-document internal function byte-code. | ||
| 51 | (Docs and Compilation): Minor clarifications. | ||
| 52 | |||
| 53 | * objects.texi (Byte-Code Type): Add xref to Byte-Code Function | ||
| 54 | Objects. | ||
| 55 | |||
| 56 | 2012-02-10 Glenn Morris <rgm@gnu.org> | ||
| 57 | |||
| 58 | * text.texi (Checksum/Hash): Rename node from MD5 Checksum. | ||
| 59 | Mention secure-hash. | ||
| 60 | * elisp.texi, vol1.texi, vol2.texi: Update menu entry. | ||
| 61 | |||
| 62 | 2012-02-10 Chong Yidong <cyd@gnu.org> | ||
| 63 | |||
| 64 | * loading.texi (Loading): Don't emphasize "library" terminology. | ||
| 65 | (Library Search): load-path is not a user option. Mention role of | ||
| 66 | -L option and packages. Improve examples. | ||
| 67 | (Loading Non-ASCII): Don't mention unibyte Emacs, which is | ||
| 68 | obsolete. | ||
| 69 | (Autoload): Minor clarifications. | ||
| 70 | |||
| 1 | 2012-02-10 Glenn Morris <rgm@gnu.org> | 71 | 2012-02-10 Glenn Morris <rgm@gnu.org> |
| 2 | 72 | ||
| 73 | * files.texi (Magic File Names): Tweak remote-file-name-inhibit-cache. | ||
| 74 | |||
| 3 | * modes.texi (Basic Major Modes): Mention tabulated-list-mode. | 75 | * modes.texi (Basic Major Modes): Mention tabulated-list-mode. |
| 4 | 76 | ||
| 5 | 2012-02-08 Glenn Morris <rgm@gnu.org> | 77 | 2012-02-08 Glenn Morris <rgm@gnu.org> |
diff --git a/doc/lispref/advice.texi b/doc/lispref/advice.texi index ee1950a589a..78b4ac9aa2d 100644 --- a/doc/lispref/advice.texi +++ b/doc/lispref/advice.texi | |||
| @@ -13,30 +13,35 @@ for a library to customize functions defined within Emacs---cleaner | |||
| 13 | than redefining the whole function. | 13 | than redefining the whole function. |
| 14 | 14 | ||
| 15 | @cindex piece of advice | 15 | @cindex piece of advice |
| 16 | Each function can have multiple @dfn{pieces of advice}, separately | 16 | Each function can have multiple @dfn{pieces of advice}, each of |
| 17 | defined. Each defined piece of advice can be @dfn{enabled} or | 17 | which can be separately defined and then @dfn{enabled} or |
| 18 | @dfn{disabled} explicitly. All the enabled pieces of advice for any given | 18 | @dfn{disabled}. All the enabled pieces of advice for any given |
| 19 | function actually take effect when you @dfn{activate} advice for that | 19 | function actually take effect when you @dfn{activate advice} for that |
| 20 | function, or when you define or redefine the function. Note that | 20 | function, or when you define or redefine the function. Note that |
| 21 | enabling a piece of advice and activating advice for a function | 21 | enabling a piece of advice and activating advice for a function are |
| 22 | are not the same thing. | 22 | not the same thing. |
| 23 | 23 | ||
| 24 | @strong{Usage Note:} Advice is useful for altering the behavior of | 24 | Advice is useful for altering the behavior of existing calls to an |
| 25 | existing calls to an existing function. If you want the new behavior | 25 | existing function. If you want the new behavior for new function |
| 26 | for new calls, or for key bindings, you should define a new function | 26 | calls or new key bindings, you should define a new function or |
| 27 | (or a new command) which uses the existing function. | 27 | command, and have it use the existing function as a subroutine. |
| 28 | 28 | ||
| 29 | @strong{Usage note:} Advising a function can cause confusion in | 29 | Advising a function can cause confusion in debugging, since people |
| 30 | debugging, since people who debug calls to the original function may | 30 | who debug calls to the original function may not notice that it has |
| 31 | not notice that it has been modified with advice. Therefore, if you | 31 | been modified with advice. Therefore, if you have the possibility to |
| 32 | have the possibility to change the code of that function (or ask | 32 | change the code of that function to run a hook, please solve the |
| 33 | someone to do so) to run a hook, please solve the problem that way. | 33 | problem that way. Advice should be reserved for the cases where you |
| 34 | Advice should be reserved for the cases where you cannot get the | 34 | cannot get the function changed. In particular, Emacs' own source |
| 35 | function changed. | 35 | files should not put advice on functions in Emacs. There are |
| 36 | 36 | currently a few exceptions to this convention, but we aim to correct | |
| 37 | In particular, this means that a file in Emacs should not put advice | 37 | them. |
| 38 | on a function in Emacs. There are currently a few exceptions to this | 38 | |
| 39 | convention, but we aim to correct them. | 39 | Unless you know what you are doing, do @emph{not} advise a primitive |
| 40 | (@pxref{What Is a Function}). Some primitives are used by the advice | ||
| 41 | mechanism; advising them could cause an infinite recursion. Also, | ||
| 42 | many primitives are called directly from C code. Calls to the | ||
| 43 | primitive from Lisp code will take note of the advice, but calls from | ||
| 44 | C code will ignore the advice. | ||
| 40 | 45 | ||
| 41 | @menu | 46 | @menu |
| 42 | * Simple Advice:: A simple example to explain the basics of advice. | 47 | * Simple Advice:: A simple example to explain the basics of advice. |
| @@ -48,7 +53,6 @@ convention, but we aim to correct them. | |||
| 48 | * Preactivation:: Preactivation is a way of speeding up the | 53 | * Preactivation:: Preactivation is a way of speeding up the |
| 49 | loading of compiled advice. | 54 | loading of compiled advice. |
| 50 | * Argument Access in Advice:: How advice can access the function's arguments. | 55 | * Argument Access in Advice:: How advice can access the function's arguments. |
| 51 | * Advising Primitives:: Accessing arguments when advising a primitive. | ||
| 52 | * Combined Definition:: How advice is implemented. | 56 | * Combined Definition:: How advice is implemented. |
| 53 | @end menu | 57 | @end menu |
| 54 | 58 | ||
| @@ -258,7 +262,7 @@ All subroutines used by the advice need to be available when the byte | |||
| 258 | compiler expands the macro. | 262 | compiler expands the macro. |
| 259 | 263 | ||
| 260 | @deffn Command ad-unadvise function | 264 | @deffn Command ad-unadvise function |
| 261 | This command deletes the advice from @var{function}. | 265 | This command deletes all pieces of advice from @var{function}. |
| 262 | @end deffn | 266 | @end deffn |
| 263 | 267 | ||
| 264 | @deffn Command ad-unadvise-all | 268 | @deffn Command ad-unadvise-all |
| @@ -355,13 +359,13 @@ replaced with the new one. | |||
| 355 | @cindex advice, activating | 359 | @cindex advice, activating |
| 356 | 360 | ||
| 357 | By default, advice does not take effect when you define it---only when | 361 | By default, advice does not take effect when you define it---only when |
| 358 | you @dfn{activate} advice for the function that was advised. However, | 362 | you @dfn{activate} advice for the function. However, the advice will |
| 359 | the advice will be activated automatically if you define or redefine | 363 | be activated automatically if you define or redefine the function |
| 360 | the function later. You can request the activation of advice for a | 364 | later. You can request the activation of advice for a function when |
| 361 | function when you define the advice, by specifying the @code{activate} | 365 | you define the advice, by specifying the @code{activate} flag in the |
| 362 | flag in the @code{defadvice}. But normally you activate the advice | 366 | @code{defadvice}; or you can activate the advice separately by calling |
| 363 | for a function by calling the function @code{ad-activate} or one of | 367 | the function @code{ad-activate} or one of the other activation |
| 364 | the other activation commands listed below. | 368 | commands listed below. |
| 365 | 369 | ||
| 366 | Separating the activation of advice from the act of defining it permits | 370 | Separating the activation of advice from the act of defining it permits |
| 367 | you to add several pieces of advice to one function efficiently, without | 371 | you to add several pieces of advice to one function efficiently, without |
| @@ -680,39 +684,6 @@ will be 3, and @var{r} will be @code{(2 1 0)} inside the body of | |||
| 680 | These argument constructs are not really implemented as Lisp macros. | 684 | These argument constructs are not really implemented as Lisp macros. |
| 681 | Instead they are implemented specially by the advice mechanism. | 685 | Instead they are implemented specially by the advice mechanism. |
| 682 | 686 | ||
| 683 | @node Advising Primitives | ||
| 684 | @section Advising Primitives | ||
| 685 | @cindex advising primitives | ||
| 686 | |||
| 687 | Advising a primitive function (@pxref{What Is a Function}) is risky. | ||
| 688 | Some primitive functions are used by the advice mechanism; advising | ||
| 689 | them could cause an infinite recursion. Also, many primitive | ||
| 690 | functions are called directly from C code. Calls to the primitive | ||
| 691 | from Lisp code will take note of the advice, but calls from C code | ||
| 692 | will ignore the advice. | ||
| 693 | |||
| 694 | When the advice facility constructs the combined definition, it needs | ||
| 695 | to know the argument list of the original function. This is not | ||
| 696 | always possible for primitive functions. When advice cannot determine | ||
| 697 | the argument list, it uses @code{(&rest ad-subr-args)}, which always | ||
| 698 | works but is inefficient because it constructs a list of the argument | ||
| 699 | values. You can use @code{ad-define-subr-args} to declare the proper | ||
| 700 | argument names for a primitive function: | ||
| 701 | |||
| 702 | @defun ad-define-subr-args function arglist | ||
| 703 | This function specifies that @var{arglist} should be used as the | ||
| 704 | argument list for function @var{function}. | ||
| 705 | @end defun | ||
| 706 | |||
| 707 | For example, | ||
| 708 | |||
| 709 | @example | ||
| 710 | (ad-define-subr-args 'fset '(sym newdef)) | ||
| 711 | @end example | ||
| 712 | |||
| 713 | @noindent | ||
| 714 | specifies the argument list for the function @code{fset}. | ||
| 715 | |||
| 716 | @node Combined Definition | 687 | @node Combined Definition |
| 717 | @section The Combined Definition | 688 | @section The Combined Definition |
| 718 | 689 | ||
diff --git a/doc/lispref/commands.texi b/doc/lispref/commands.texi index 91e224a439f..f4e7c922331 100644 --- a/doc/lispref/commands.texi +++ b/doc/lispref/commands.texi | |||
| @@ -37,13 +37,13 @@ are done, and the subroutines that allow Lisp programs to do them. | |||
| 37 | @node Command Overview | 37 | @node Command Overview |
| 38 | @section Command Loop Overview | 38 | @section Command Loop Overview |
| 39 | 39 | ||
| 40 | The first thing the command loop must do is read a key sequence, which | 40 | The first thing the command loop must do is read a key sequence, |
| 41 | is a sequence of events that translates into a command. It does this by | 41 | which is a sequence of input events that translates into a command. |
| 42 | calling the function @code{read-key-sequence}. Your Lisp code can also | 42 | It does this by calling the function @code{read-key-sequence}. Lisp |
| 43 | call this function (@pxref{Key Sequence Input}). Lisp programs can also | 43 | programs can also call this function (@pxref{Key Sequence Input}). |
| 44 | do input at a lower level with @code{read-event} (@pxref{Reading One | 44 | They can also read input at a lower level with @code{read-key} or |
| 45 | Event}) or discard pending input with @code{discard-input} | 45 | @code{read-event} (@pxref{Reading One Event}), or discard pending |
| 46 | (@pxref{Event Input Misc}). | 46 | input with @code{discard-input} (@pxref{Event Input Misc}). |
| 47 | 47 | ||
| 48 | The key sequence is translated into a command through the currently | 48 | The key sequence is translated into a command through the currently |
| 49 | active keymaps. @xref{Key Lookup}, for information on how this is done. | 49 | active keymaps. @xref{Key Lookup}, for information on how this is done. |
| @@ -67,12 +67,9 @@ use the minibuffer, so if you call @code{find-file} as a function from | |||
| 67 | Lisp code, you must supply the file name string as an ordinary Lisp | 67 | Lisp code, you must supply the file name string as an ordinary Lisp |
| 68 | function argument. | 68 | function argument. |
| 69 | 69 | ||
| 70 | If the command is a string or vector (i.e., a keyboard macro) then | 70 | If the command is a keyboard macro (i.e.@: a string or vector), |
| 71 | @code{execute-kbd-macro} is used to execute it. You can call this | 71 | Emacs executes it using @code{execute-kbd-macro} (@pxref{Keyboard |
| 72 | function yourself (@pxref{Keyboard Macros}). | 72 | Macros}). |
| 73 | |||
| 74 | To terminate the execution of a running command, type @kbd{C-g}. This | ||
| 75 | character causes @dfn{quitting} (@pxref{Quitting}). | ||
| 76 | 73 | ||
| 77 | @defvar pre-command-hook | 74 | @defvar pre-command-hook |
| 78 | This normal hook is run by the editor command loop before it executes | 75 | This normal hook is run by the editor command loop before it executes |
| @@ -175,8 +172,8 @@ or more arguments. | |||
| 175 | 172 | ||
| 176 | @item | 173 | @item |
| 177 | It may be a string; its contents are a sequence of elements separated | 174 | It may be a string; its contents are a sequence of elements separated |
| 178 | by newlines, one for each parameter@footnote{Some elements actually | 175 | by newlines, one for each argument@footnote{Some elements actually |
| 179 | supply two parameters.}. Each element consists of a code character | 176 | supply two arguments.}. Each element consists of a code character |
| 180 | (@pxref{Interactive Codes}) optionally followed by a prompt (which | 177 | (@pxref{Interactive Codes}) optionally followed by a prompt (which |
| 181 | some code characters use and some ignore). Here is an example: | 178 | some code characters use and some ignore). Here is an example: |
| 182 | 179 | ||
| @@ -575,21 +572,24 @@ the command is a function, @code{command-execute} calls | |||
| 575 | @code{call-interactively}, which reads the arguments and calls the | 572 | @code{call-interactively}, which reads the arguments and calls the |
| 576 | command. You can also call these functions yourself. | 573 | command. You can also call these functions yourself. |
| 577 | 574 | ||
| 578 | @defun commandp object &optional for-call-interactively | 575 | Note that the term ``command'', in this context, refers to an |
| 579 | Returns @code{t} if @var{object} is suitable for calling interactively; | 576 | interactively callable function (or function-like object), or a |
| 580 | that is, if @var{object} is a command. Otherwise, returns @code{nil}. | 577 | keyboard macro. It does not refer to the key sequence used to invoke |
| 581 | 578 | a command (@pxref{Keymaps}). | |
| 582 | Interactively-callable objects include strings and vectors (which are | ||
| 583 | treated as keyboard macros), lambda expressions that contain a | ||
| 584 | top-level @code{interactive} form (@pxref{Using Interactive}), | ||
| 585 | byte-code function objects made from such lambda expressions, autoload | ||
| 586 | objects that are declared as interactive (non-@code{nil} fourth | ||
| 587 | argument to @code{autoload}), and some primitive functions. | ||
| 588 | 579 | ||
| 589 | A symbol satisfies @code{commandp} if it has a non-@code{nil} | 580 | @defun commandp object &optional for-call-interactively |
| 581 | This function returns @code{t} if @var{object} is a command. | ||
| 582 | Otherwise, it returns @code{nil}. | ||
| 583 | |||
| 584 | Commands include strings and vectors (which are treated as keyboard | ||
| 585 | macros), lambda expressions that contain a top-level | ||
| 586 | @code{interactive} form (@pxref{Using Interactive}), byte-code | ||
| 587 | function objects made from such lambda expressions, autoload objects | ||
| 588 | that are declared as interactive (non-@code{nil} fourth argument to | ||
| 589 | @code{autoload}), and some primitive functions. Also, a symbol is | ||
| 590 | considered a command if it has a non-@code{nil} | ||
| 590 | @code{interactive-form} property, or if its function definition | 591 | @code{interactive-form} property, or if its function definition |
| 591 | satisfies @code{commandp}. Keys and keymaps are not commands. | 592 | satisfies @code{commandp}. |
| 592 | Rather, they are used to look up commands (@pxref{Keymaps}). | ||
| 593 | 593 | ||
| 594 | If @var{for-call-interactively} is non-@code{nil}, then | 594 | If @var{for-call-interactively} is non-@code{nil}, then |
| 595 | @code{commandp} returns @code{t} only for objects that | 595 | @code{commandp} returns @code{t} only for objects that |
| @@ -649,14 +649,14 @@ callable function or a keyboard macro. | |||
| 649 | 649 | ||
| 650 | A string or vector as @var{command} is executed with | 650 | A string or vector as @var{command} is executed with |
| 651 | @code{execute-kbd-macro}. A function is passed to | 651 | @code{execute-kbd-macro}. A function is passed to |
| 652 | @code{call-interactively}, along with the optional @var{record-flag} | 652 | @code{call-interactively} (see above), along with the |
| 653 | and @var{keys}. | 653 | @var{record-flag} and @var{keys} arguments. |
| 654 | 654 | ||
| 655 | A symbol is handled by using its function definition in its place. A | 655 | If @var{command} is a symbol, its function definition is used in its |
| 656 | symbol with an @code{autoload} definition counts as a command if it was | 656 | place. A symbol with an @code{autoload} definition counts as a |
| 657 | declared to stand for an interactively callable function. Such a | 657 | command if it was declared to stand for an interactively callable |
| 658 | definition is handled by loading the specified library and then | 658 | function. Such a definition is handled by loading the specified |
| 659 | rechecking the definition of the symbol. | 659 | library and then rechecking the definition of the symbol. |
| 660 | 660 | ||
| 661 | The argument @var{special}, if given, means to ignore the prefix | 661 | The argument @var{special}, if given, means to ignore the prefix |
| 662 | argument and not clear it. This is used for executing special events | 662 | argument and not clear it. This is used for executing special events |
| @@ -1131,9 +1131,9 @@ The | |||
| 1131 | @ifnottex | 1131 | @ifnottex |
| 1132 | 2**22 | 1132 | 2**22 |
| 1133 | @end ifnottex | 1133 | @end ifnottex |
| 1134 | bit in the character code indicates a character typed with | 1134 | bit in the character code indicates a character typed with the alt key |
| 1135 | the alt key held down. (On some terminals, the key labeled @key{ALT} | 1135 | held down. (The key labeled @key{Alt} on most keyboards is actually |
| 1136 | is actually the meta key.) | 1136 | treated as the meta key, not this.) |
| 1137 | @end table | 1137 | @end table |
| 1138 | 1138 | ||
| 1139 | It is best to avoid mentioning specific bit numbers in your program. | 1139 | It is best to avoid mentioning specific bit numbers in your program. |
| @@ -1151,10 +1151,10 @@ specify the characters (@pxref{Changing Key Bindings}). The function | |||
| 1151 | 1151 | ||
| 1152 | @cindex function keys | 1152 | @cindex function keys |
| 1153 | Most keyboards also have @dfn{function keys}---keys that have names or | 1153 | Most keyboards also have @dfn{function keys}---keys that have names or |
| 1154 | symbols that are not characters. Function keys are represented in Emacs | 1154 | symbols that are not characters. Function keys are represented in |
| 1155 | Lisp as symbols; the symbol's name is the function key's label, in lower | 1155 | Emacs Lisp as symbols; the symbol's name is the function key's label, |
| 1156 | case. For example, pressing a key labeled @key{F1} places the symbol | 1156 | in lower case. For example, pressing a key labeled @key{F1} generates |
| 1157 | @code{f1} in the input stream. | 1157 | an input event represented by the symbol @code{f1}. |
| 1158 | 1158 | ||
| 1159 | The event type of a function key event is the event symbol itself. | 1159 | The event type of a function key event is the event symbol itself. |
| 1160 | @xref{Classifying Events}. | 1160 | @xref{Classifying Events}. |
| @@ -1287,6 +1287,11 @@ the marginal areas, @var{position} has this form: | |||
| 1287 | @var{image} (@var{dx} . @var{dy}) (@var{width} . @var{height})) | 1287 | @var{image} (@var{dx} . @var{dy}) (@var{width} . @var{height})) |
| 1288 | @end example | 1288 | @end example |
| 1289 | 1289 | ||
| 1290 | @noindent | ||
| 1291 | The meanings of these list elements are documented below. | ||
| 1292 | @xref{Accessing Mouse}, for functions that let you easily access these | ||
| 1293 | elements. | ||
| 1294 | |||
| 1290 | @table @asis | 1295 | @table @asis |
| 1291 | @item @var{window} | 1296 | @item @var{window} |
| 1292 | This is the window in which the click occurred. | 1297 | This is the window in which the click occurred. |
| @@ -1298,39 +1303,36 @@ which the click occurred. It is one of the symbols @code{mode-line}, | |||
| 1298 | @code{header-line}, @code{vertical-line}, @code{left-margin}, | 1303 | @code{header-line}, @code{vertical-line}, @code{left-margin}, |
| 1299 | @code{right-margin}, @code{left-fringe}, or @code{right-fringe}. | 1304 | @code{right-margin}, @code{left-fringe}, or @code{right-fringe}. |
| 1300 | 1305 | ||
| 1301 | In one special case, @var{pos-or-area} is a list containing a symbol (one | 1306 | In one special case, @var{pos-or-area} is a list containing a symbol |
| 1302 | of the symbols listed above) instead of just the symbol. This happens | 1307 | (one of the symbols listed above) instead of just the symbol. This |
| 1303 | after the imaginary prefix keys for the event are inserted into the | 1308 | happens after the imaginary prefix keys for the event are registered |
| 1304 | input stream. @xref{Key Sequence Input}. | 1309 | by Emacs. @xref{Key Sequence Input}. |
| 1305 | |||
| 1306 | 1310 | ||
| 1307 | @item @var{x}, @var{y} | 1311 | @item @var{x}, @var{y} |
| 1308 | These are the pixel coordinates of the click, relative to | 1312 | These are the relative pixel coordinates of the click. For clicks in |
| 1309 | the top left corner of @var{window}, which is @code{(0 . 0)}. | 1313 | the text area of a window, the coordinate origin @code{(0 . 0)} is |
| 1310 | For a click on text, these are relative to the top left corner of | 1314 | taken to be the top left corner of the text area. @xref{Window |
| 1311 | the window's text area. For the mode or header line, they are | 1315 | Sizes}. For clicks in a mode line or header line, the coordinate |
| 1312 | relative to the top left window edge. For fringes, margins, and the | 1316 | origin is the top left corner of the window itself. For fringes, |
| 1313 | vertical border, @var{x} does not have meaningful data. For fringes | 1317 | margins, and the vertical border, @var{x} does not have meaningful |
| 1314 | and margins, @var{y} is relative to the bottom edge of the header | 1318 | data. For fringes and margins, @var{y} is relative to the bottom edge |
| 1315 | line. | 1319 | of the header line. In all cases, the @var{x} and @var{y} coordinates |
| 1320 | increase rightward and downward respectively. | ||
| 1316 | 1321 | ||
| 1317 | @item @var{timestamp} | 1322 | @item @var{timestamp} |
| 1318 | This is the time at which the event occurred, in milliseconds. | 1323 | This is the time at which the event occurred, in milliseconds. |
| 1319 | 1324 | ||
| 1320 | @item @var{object} | 1325 | @item @var{object} |
| 1321 | This is the object on which the click occurred. It is either | 1326 | This is either @code{nil} if there is no string-type text property at |
| 1322 | @code{nil} if there is no string property, or it has the form | 1327 | the click position, or a cons cell of the form (@var{string} |
| 1323 | (@var{string} . @var{string-pos}) when there is a string-type text | 1328 | . @var{string-pos}) if there is one: |
| 1324 | property at the click position. | ||
| 1325 | 1329 | ||
| 1326 | @table @asis | 1330 | @table @asis |
| 1327 | @item @var{string} | 1331 | @item @var{string} |
| 1328 | This is the string on which the click occurred, including any | 1332 | The string which was clicked on, including any properties. |
| 1329 | properties. | ||
| 1330 | 1333 | ||
| 1331 | @item @var{string-pos} | 1334 | @item @var{string-pos} |
| 1332 | This is the position in the string on which the click occurred, | 1335 | The position in the string where the click occurred. |
| 1333 | relevant if properties at the click need to be looked up. | ||
| 1334 | @end table | 1336 | @end table |
| 1335 | 1337 | ||
| 1336 | @item @var{text-pos} | 1338 | @item @var{text-pos} |
| @@ -1340,14 +1342,17 @@ the window. For other events, it is the current buffer position in | |||
| 1340 | the window. | 1342 | the window. |
| 1341 | 1343 | ||
| 1342 | @item @var{col}, @var{row} | 1344 | @item @var{col}, @var{row} |
| 1343 | These are the actual coordinates of the glyph under the @var{x}, | 1345 | These are the actual column and row coordinate numbers of the glyph |
| 1344 | @var{y} position, possibly padded with default character width | 1346 | under the @var{x}, @var{y} position. If @var{x} lies beyond the last |
| 1345 | glyphs if @var{x} is beyond the last glyph on the line. For clicks on | 1347 | column of actual text on its line, @var{col} is reported by adding |
| 1346 | the header or mode line, these are measured from the top left edge of | 1348 | fictional extra columns that have the default character width. Row 0 |
| 1347 | the header or mode line. For clicks on the fringes and on the | 1349 | is taken to be the header line if the window has one, or the topmost |
| 1348 | vertical border, these have no meaningful data. For clicks on the | 1350 | row of the text area otherwise. Column 0 is taken to be the leftmost |
| 1349 | margins, @var{col} is measured from the left edge of the margin area | 1351 | column of the text area for clicks on a window text area, or the |
| 1350 | and @var{row} is measured from the top of the margin area. | 1352 | leftmost mode line or header line column for clicks there. For clicks |
| 1353 | on fringes or vertical borders, these have no meaningful data. For | ||
| 1354 | clicks on margins, @var{col} is measured from the left edge of the | ||
| 1355 | margin area and @var{row} is measured from the top of the margin area. | ||
| 1351 | 1356 | ||
| 1352 | @item @var{image} | 1357 | @item @var{image} |
| 1353 | This is the image object on which the click occurred. It is either | 1358 | This is the image object on which the click occurred. It is either |
| @@ -1885,7 +1890,7 @@ must be the last element of the list. For example, | |||
| 1885 | a mouse button or motion event. | 1890 | a mouse button or motion event. |
| 1886 | 1891 | ||
| 1887 | These two functions return the starting or ending position of a | 1892 | These two functions return the starting or ending position of a |
| 1888 | mouse-button event, as a list of this form: | 1893 | mouse-button event, as a list of this form (@pxref{Click Events}): |
| 1889 | 1894 | ||
| 1890 | @example | 1895 | @example |
| 1891 | (@var{window} @var{pos-or-area} (@var{x} . @var{y}) @var{timestamp} | 1896 | (@var{window} @var{pos-or-area} (@var{x} . @var{y}) @var{timestamp} |
| @@ -1936,12 +1941,13 @@ Return the pixel-based x and y coordinates in @var{position}, as a | |||
| 1936 | cons cell @code{(@var{x} . @var{y})}. These coordinates are relative | 1941 | cons cell @code{(@var{x} . @var{y})}. These coordinates are relative |
| 1937 | to the window given by @code{posn-window}. | 1942 | to the window given by @code{posn-window}. |
| 1938 | 1943 | ||
| 1939 | This example shows how to convert these window-relative coordinates | 1944 | This example shows how to convert the window-relative coordinates in |
| 1940 | into frame-relative coordinates: | 1945 | the text area of a window into frame-relative coordinates: |
| 1941 | 1946 | ||
| 1942 | @example | 1947 | @example |
| 1943 | (defun frame-relative-coordinates (position) | 1948 | (defun frame-relative-coordinates (position) |
| 1944 | "Return frame-relative coordinates from POSITION." | 1949 | "Return frame-relative coordinates from POSITION. |
| 1950 | POSITION is assumed to lie in a window text area." | ||
| 1945 | (let* ((x-y (posn-x-y position)) | 1951 | (let* ((x-y (posn-x-y position)) |
| 1946 | (window (posn-window position)) | 1952 | (window (posn-window position)) |
| 1947 | (edges (window-inside-pixel-edges window))) | 1953 | (edges (window-inside-pixel-edges window))) |
| @@ -1966,10 +1972,10 @@ window possesses a header line (@pxref{Header Lines}), it is | |||
| 1966 | 1972 | ||
| 1967 | @defun posn-actual-col-row position | 1973 | @defun posn-actual-col-row position |
| 1968 | Return the actual row and column in @var{position}, as a cons cell | 1974 | Return the actual row and column in @var{position}, as a cons cell |
| 1969 | @code{(@var{col} . @var{row})}. The values are the actual row number | 1975 | @code{(@var{col} . @var{row})}. The values are the actual row and |
| 1970 | in the window, and the actual character number in that row. It returns | 1976 | column numbers in the window. @xref{Click Events}, for details. It |
| 1971 | @code{nil} if @var{position} does not include actual positions values. | 1977 | returns @code{nil} if @var{position} does not include actual positions |
| 1972 | You can use @code{posn-col-row} to get approximate values. | 1978 | values. |
| 1973 | @end defun | 1979 | @end defun |
| 1974 | 1980 | ||
| 1975 | @defun posn-string position | 1981 | @defun posn-string position |
| @@ -2680,9 +2686,9 @@ Likewise, incremental search uses this feature to unread events with no | |||
| 2680 | special meaning in a search, because these events should exit the search | 2686 | special meaning in a search, because these events should exit the search |
| 2681 | and then execute normally. | 2687 | and then execute normally. |
| 2682 | 2688 | ||
| 2683 | The reliable and easy way to extract events from a key sequence so as to | 2689 | The reliable and easy way to extract events from a key sequence so as |
| 2684 | put them in @code{unread-command-events} is to use | 2690 | to put them in @code{unread-command-events} is to use |
| 2685 | @code{listify-key-sequence} (@pxref{Strings of Events}). | 2691 | @code{listify-key-sequence} (see below). |
| 2686 | 2692 | ||
| 2687 | Normally you add events to the front of this list, so that the events | 2693 | Normally you add events to the front of this list, so that the events |
| 2688 | most recently unread will be reread first. | 2694 | most recently unread will be reread first. |
| @@ -2787,28 +2793,29 @@ during the sleep. | |||
| 2787 | @section Special Events | 2793 | @section Special Events |
| 2788 | 2794 | ||
| 2789 | @cindex special events | 2795 | @cindex special events |
| 2790 | Special events are handled at a very low level---as soon as they are | 2796 | Certain @dfn{special events} are handled at a very low level---as soon |
| 2791 | read. The @code{read-event} function processes these events itself, and | 2797 | as they are read. The @code{read-event} function processes these |
| 2792 | never returns them. Instead, it keeps waiting for the first event | 2798 | events itself, and never returns them. Instead, it keeps waiting for |
| 2793 | that is not special and returns that one. | 2799 | the first event that is not special and returns that one. |
| 2794 | 2800 | ||
| 2795 | Events that are handled in this way do not echo, they are never grouped | 2801 | Special events do not echo, they are never grouped into key |
| 2796 | into key sequences, and they never appear in the value of | 2802 | sequences, and they never appear in the value of |
| 2797 | @code{last-command-event} or @code{(this-command-keys)}. They do not | 2803 | @code{last-command-event} or @code{(this-command-keys)}. They do not |
| 2798 | discard a numeric argument, they cannot be unread with | 2804 | discard a numeric argument, they cannot be unread with |
| 2799 | @code{unread-command-events}, they may not appear in a keyboard macro, | 2805 | @code{unread-command-events}, they may not appear in a keyboard macro, |
| 2800 | and they are not recorded in a keyboard macro while you are defining | 2806 | and they are not recorded in a keyboard macro while you are defining |
| 2801 | one. | 2807 | one. |
| 2802 | 2808 | ||
| 2803 | These events do, however, appear in @code{last-input-event} immediately | 2809 | Special events do, however, appear in @code{last-input-event} |
| 2804 | after they are read, and this is the way for the event's definition to | 2810 | immediately after they are read, and this is the way for the event's |
| 2805 | find the actual event. | 2811 | definition to find the actual event. |
| 2806 | 2812 | ||
| 2807 | The events types @code{iconify-frame}, @code{make-frame-visible}, | 2813 | The events types @code{iconify-frame}, @code{make-frame-visible}, |
| 2808 | @code{delete-frame}, @code{drag-n-drop}, and user signals like | 2814 | @code{delete-frame}, @code{drag-n-drop}, and user signals like |
| 2809 | @code{sigusr1} are normally handled in this way. The keymap which | 2815 | @code{sigusr1} are normally handled in this way. The keymap which |
| 2810 | defines how to handle special events---and which events are special---is | 2816 | defines how to handle special events---and which events are |
| 2811 | in the variable @code{special-event-map} (@pxref{Active Keymaps}). | 2817 | special---is in the variable @code{special-event-map} (@pxref{Active |
| 2818 | Keymaps}). | ||
| 2812 | 2819 | ||
| 2813 | @node Waiting | 2820 | @node Waiting |
| 2814 | @section Waiting for Elapsed Time or Input | 2821 | @section Waiting for Elapsed Time or Input |
diff --git a/doc/lispref/compile.texi b/doc/lispref/compile.texi index 4e21df78430..90d038c29d6 100644 --- a/doc/lispref/compile.texi +++ b/doc/lispref/compile.texi | |||
| @@ -32,9 +32,6 @@ variable binding for @code{no-byte-compile} into it, like this: | |||
| 32 | ;; -*-no-byte-compile: t; -*- | 32 | ;; -*-no-byte-compile: t; -*- |
| 33 | @end example | 33 | @end example |
| 34 | 34 | ||
| 35 | @xref{Compilation Errors}, for how to investigate errors occurring in | ||
| 36 | byte compilation. | ||
| 37 | |||
| 38 | @menu | 35 | @menu |
| 39 | * Speed of Byte-Code:: An example of speedup from byte compilation. | 36 | * Speed of Byte-Code:: An example of speedup from byte compilation. |
| 40 | * Compilation Functions:: Byte compilation functions. | 37 | * Compilation Functions:: Byte compilation functions. |
| @@ -56,18 +53,16 @@ Here is an example: | |||
| 56 | @example | 53 | @example |
| 57 | @group | 54 | @group |
| 58 | (defun silly-loop (n) | 55 | (defun silly-loop (n) |
| 59 | "Return time before and after N iterations of a loop." | 56 | "Return the time, in seconds, to run N iterations of a loop." |
| 60 | (let ((t1 (current-time-string))) | 57 | (let ((t1 (float-time))) |
| 61 | (while (> (setq n (1- n)) | 58 | (while (> (setq n (1- n)) 0)) |
| 62 | 0)) | 59 | (- (float-time) t1))) |
| 63 | (list t1 (current-time-string)))) | ||
| 64 | @result{} silly-loop | 60 | @result{} silly-loop |
| 65 | @end group | 61 | @end group |
| 66 | 62 | ||
| 67 | @group | 63 | @group |
| 68 | (silly-loop 50000000) | 64 | (silly-loop 50000000) |
| 69 | @result{} ("Wed Mar 11 21:10:19 2009" | 65 | @result{} 10.235304117202759 |
| 70 | "Wed Mar 11 21:10:41 2009") ; @r{22 seconds} | ||
| 71 | @end group | 66 | @end group |
| 72 | 67 | ||
| 73 | @group | 68 | @group |
| @@ -77,18 +72,17 @@ Here is an example: | |||
| 77 | 72 | ||
| 78 | @group | 73 | @group |
| 79 | (silly-loop 50000000) | 74 | (silly-loop 50000000) |
| 80 | @result{} ("Wed Mar 11 21:12:26 2009" | 75 | @result{} 3.705854892730713 |
| 81 | "Wed Mar 11 21:12:32 2009") ; @r{6 seconds} | ||
| 82 | @end group | 76 | @end group |
| 83 | @end example | 77 | @end example |
| 84 | 78 | ||
| 85 | In this example, the interpreted code required 22 seconds to run, | 79 | In this example, the interpreted code required 10 seconds to run, |
| 86 | whereas the byte-compiled code required 6 seconds. These results are | 80 | whereas the byte-compiled code required less than 4 seconds. These |
| 87 | representative, but actual results will vary greatly. | 81 | results are representative, but actual results may vary. |
| 88 | 82 | ||
| 89 | @node Compilation Functions | 83 | @node Compilation Functions |
| 90 | @comment node-name, next, previous, up | 84 | @comment node-name, next, previous, up |
| 91 | @section The Compilation Functions | 85 | @section Byte-Compilation Functions |
| 92 | @cindex compilation functions | 86 | @cindex compilation functions |
| 93 | 87 | ||
| 94 | You can byte-compile an individual function or macro definition with | 88 | You can byte-compile an individual function or macro definition with |
| @@ -96,43 +90,36 @@ the @code{byte-compile} function. You can compile a whole file with | |||
| 96 | @code{byte-compile-file}, or several files with | 90 | @code{byte-compile-file}, or several files with |
| 97 | @code{byte-recompile-directory} or @code{batch-byte-compile}. | 91 | @code{byte-recompile-directory} or @code{batch-byte-compile}. |
| 98 | 92 | ||
| 99 | The byte compiler produces error messages and warnings about each file | 93 | Sometimes, the byte compiler produces warning and/or error messages |
| 100 | in a buffer called @samp{*Compile-Log*}. These report things in your | 94 | (@pxref{Compiler Errors}, for details). These messages are recorded |
| 101 | program that suggest a problem but are not necessarily erroneous. | 95 | in a buffer called @samp{*Compile-Log*}, which uses Compilation mode. |
| 96 | @xref{Compilation Mode,,,emacs, The GNU Emacs Manual}. | ||
| 102 | 97 | ||
| 103 | @cindex macro compilation | 98 | @cindex macro compilation |
| 104 | Be careful when writing macro calls in files that you may someday | 99 | Be careful when writing macro calls in files that you intend to |
| 105 | byte-compile. Macro calls are expanded when they are compiled, so the | 100 | byte-compile. Since macro calls are expanded when they are compiled, |
| 106 | macros must already be defined for proper compilation. For more | 101 | the macros need to be loaded into Emacs or the byte compiler will not |
| 107 | details, see @ref{Compiling Macros}. If a program does not work the | 102 | do the right thing. The usual way to handle this is with |
| 108 | same way when compiled as it does when interpreted, erroneous macro | 103 | @code{require} forms which specify the files containing the needed |
| 109 | definitions are one likely cause (@pxref{Problems with Macros}). | 104 | macro definitions (@pxref{Named Features}). Normally, the |
| 110 | Inline (@code{defsubst}) functions are less troublesome; if you | 105 | byte compiler does not evaluate the code that it is compiling, but it |
| 106 | handles @code{require} forms specially, by loading the specified | ||
| 107 | libraries. To avoid loading the macro definition files when someone | ||
| 108 | @emph{runs} the compiled program, write @code{eval-when-compile} | ||
| 109 | around the @code{require} calls (@pxref{Eval During Compile}). For | ||
| 110 | more details, @xref{Compiling Macros}. | ||
| 111 | |||
| 112 | Inline (@code{defsubst}) functions are less troublesome; if you | ||
| 111 | compile a call to such a function before its definition is known, the | 113 | compile a call to such a function before its definition is known, the |
| 112 | call will still work right, it will just run slower. | 114 | call will still work right, it will just run slower. |
| 113 | 115 | ||
| 114 | Normally, compiling a file does not evaluate the file's contents or | ||
| 115 | load the file. But it does execute any @code{require} calls at top | ||
| 116 | level in the file. One way to ensure that necessary macro definitions | ||
| 117 | are available during compilation is to require the file that defines | ||
| 118 | them (@pxref{Named Features}). To avoid loading the macro definition files | ||
| 119 | when someone @emph{runs} the compiled program, write | ||
| 120 | @code{eval-when-compile} around the @code{require} calls (@pxref{Eval | ||
| 121 | During Compile}). | ||
| 122 | |||
| 123 | @defun byte-compile symbol | 116 | @defun byte-compile symbol |
| 124 | This function byte-compiles the function definition of @var{symbol}, | 117 | This function byte-compiles the function definition of @var{symbol}, |
| 125 | replacing the previous definition with the compiled one. The function | 118 | replacing the previous definition with the compiled one. The function |
| 126 | definition of @var{symbol} must be the actual code for the function; | 119 | definition of @var{symbol} must be the actual code for the function; |
| 127 | i.e., the compiler does not follow indirection to another symbol. | 120 | @code{byte-compile} does not handle function indirection. The return |
| 128 | @code{byte-compile} returns the new, compiled definition of | 121 | value is the byte-code function object which is the compiled |
| 129 | @var{symbol}. | 122 | definition of @var{symbol} (@pxref{Byte-Code Objects}). |
| 130 | |||
| 131 | If @var{symbol}'s definition is a byte-code function object, | ||
| 132 | @code{byte-compile} does nothing and returns @code{nil}. Lisp records | ||
| 133 | only one function definition for any symbol, and if that is already | ||
| 134 | compiled, non-compiled code is not available anywhere. So there is no | ||
| 135 | way to ``compile the same definition again.'' | ||
| 136 | 123 | ||
| 137 | @example | 124 | @example |
| 138 | @group | 125 | @group |
| @@ -153,16 +140,15 @@ way to ``compile the same definition again.'' | |||
| 153 | @end group | 140 | @end group |
| 154 | @end example | 141 | @end example |
| 155 | 142 | ||
| 156 | @noindent | 143 | If @var{symbol}'s definition is a byte-code function object, |
| 157 | The result is a byte-code function object. The string it contains is | 144 | @code{byte-compile} does nothing and returns @code{nil}. It does not |
| 158 | the actual byte-code; each character in it is an instruction or an | 145 | ``compile the symbol's definition again'', since the original |
| 159 | operand of an instruction. The vector contains all the constants, | 146 | (non-compiled) code has already been replaced in the symbol's function |
| 160 | variable names and function names used by the function, except for | 147 | cell by the byte-compiled code. |
| 161 | certain primitives that are coded as special instructions. | 148 | |
| 162 | 149 | The argument to @code{byte-compile} can also be a @code{lambda} | |
| 163 | If the argument to @code{byte-compile} is a @code{lambda} expression, | 150 | expression. In that case, the function returns the corresponding |
| 164 | it returns the corresponding compiled code, but does not store | 151 | compiled code but does not store it anywhere. |
| 165 | it anywhere. | ||
| 166 | @end defun | 152 | @end defun |
| 167 | 153 | ||
| 168 | @deffn Command compile-defun &optional arg | 154 | @deffn Command compile-defun &optional arg |
| @@ -252,19 +238,6 @@ files that have an up-to-date @samp{.elc} file. | |||
| 252 | @end example | 238 | @end example |
| 253 | @end defun | 239 | @end defun |
| 254 | 240 | ||
| 255 | @defun byte-code code-string data-vector max-stack | ||
| 256 | @cindex byte-code interpreter | ||
| 257 | This function actually interprets byte-code. A byte-compiled function | ||
| 258 | is actually defined with a body that calls @code{byte-code}. Don't call | ||
| 259 | this function yourself---only the byte compiler knows how to generate | ||
| 260 | valid calls to this function. | ||
| 261 | |||
| 262 | In Emacs version 18, byte-code was always executed by way of a call to | ||
| 263 | the function @code{byte-code}. Nowadays, byte-code is usually executed | ||
| 264 | as part of a byte-code function object, and only rarely through an | ||
| 265 | explicit call to @code{byte-code}. | ||
| 266 | @end defun | ||
| 267 | |||
| 268 | @node Docs and Compilation | 241 | @node Docs and Compilation |
| 269 | @section Documentation Strings and Compilation | 242 | @section Documentation Strings and Compilation |
| 270 | @cindex dynamic loading of documentation | 243 | @cindex dynamic loading of documentation |
| @@ -290,33 +263,11 @@ then further access to documentation strings in this file will | |||
| 290 | probably give nonsense results. | 263 | probably give nonsense results. |
| 291 | @end itemize | 264 | @end itemize |
| 292 | 265 | ||
| 293 | If your site installs Emacs following the usual procedures, these | 266 | @noindent |
| 294 | problems will never normally occur. Installing a new version uses a new | 267 | These problems normally occur only if you build Emacs yourself and use |
| 295 | directory with a different name; as long as the old version remains | 268 | it from the directory where you built it, and you happen to edit |
| 296 | installed, its files will remain unmodified in the places where they are | 269 | and/or recompile the Lisp source files. They can be easily cured by |
| 297 | expected to be. | 270 | reloading each file after recompiling it. |
| 298 | |||
| 299 | However, if you have built Emacs yourself and use it from the | ||
| 300 | directory where you built it, you will experience this problem | ||
| 301 | occasionally if you edit and recompile Lisp files. When it happens, you | ||
| 302 | can cure the problem by reloading the file after recompiling it. | ||
| 303 | |||
| 304 | You can turn off this feature at compile time by setting | ||
| 305 | @code{byte-compile-dynamic-docstrings} to @code{nil}; this is useful | ||
| 306 | mainly if you expect to change the file, and you want Emacs processes | ||
| 307 | that have already loaded it to keep working when the file changes. | ||
| 308 | You can do this globally, or for one source file by specifying a | ||
| 309 | file-local binding for the variable. One way to do that is by adding | ||
| 310 | this string to the file's first line: | ||
| 311 | |||
| 312 | @example | ||
| 313 | -*-byte-compile-dynamic-docstrings: nil;-*- | ||
| 314 | @end example | ||
| 315 | |||
| 316 | @defvar byte-compile-dynamic-docstrings | ||
| 317 | If this is non-@code{nil}, the byte compiler generates compiled files | ||
| 318 | that are set up for dynamic loading of documentation strings. | ||
| 319 | @end defvar | ||
| 320 | 271 | ||
| 321 | @cindex @samp{#@@@var{count}} | 272 | @cindex @samp{#@@@var{count}} |
| 322 | @cindex @samp{#$} | 273 | @cindex @samp{#$} |
| @@ -328,6 +279,23 @@ string.'' It is usually best not to use these constructs in Lisp source | |||
| 328 | files, since they are not designed to be clear to humans reading the | 279 | files, since they are not designed to be clear to humans reading the |
| 329 | file. | 280 | file. |
| 330 | 281 | ||
| 282 | You can disable the dynamic documentation string feature at compile | ||
| 283 | time by setting @code{byte-compile-dynamic-docstrings} to @code{nil}; | ||
| 284 | this is useful mainly if you expect to change the file, and you want | ||
| 285 | Emacs processes that have already loaded it to keep working when the | ||
| 286 | file changes. You can do this globally, or for one source file by | ||
| 287 | specifying a file-local binding for the variable. One way to do that | ||
| 288 | is by adding this string to the file's first line: | ||
| 289 | |||
| 290 | @example | ||
| 291 | -*-byte-compile-dynamic-docstrings: nil;-*- | ||
| 292 | @end example | ||
| 293 | |||
| 294 | @defvar byte-compile-dynamic-docstrings | ||
| 295 | If this is non-@code{nil}, the byte compiler generates compiled files | ||
| 296 | that are set up for dynamic loading of documentation strings. | ||
| 297 | @end defvar | ||
| 298 | |||
| 331 | @node Dynamic Loading | 299 | @node Dynamic Loading |
| 332 | @section Dynamic Loading of Individual Functions | 300 | @section Dynamic Loading of Individual Functions |
| 333 | 301 | ||
| @@ -477,13 +445,22 @@ to what @code{eval-when-compile} does. | |||
| 477 | Byte compilation outputs all errors and warnings into the buffer | 445 | Byte compilation outputs all errors and warnings into the buffer |
| 478 | @samp{*Compile-Log*}. The messages include file names and line | 446 | @samp{*Compile-Log*}. The messages include file names and line |
| 479 | numbers that identify the location of the problem. The usual Emacs | 447 | numbers that identify the location of the problem. The usual Emacs |
| 480 | commands for operating on compiler diagnostics work properly on | 448 | commands for operating on compiler diagnostics work properly on these |
| 481 | these messages. | 449 | messages. |
| 482 | 450 | ||
| 483 | However, the warnings about functions that were used but not | 451 | When an error is due to invalid syntax in the program, the byte |
| 484 | defined are always ``located'' at the end of the file, so these | 452 | compiler might get confused about the errors' exact location. One way |
| 485 | commands won't find the places they are really used. To do that, | 453 | to investigate is to switch to the buffer @w{@samp{*Compiler Input*}}. |
| 486 | you must search for the function names. | 454 | (This buffer name starts with a space, so it does not show up in |
| 455 | @kbd{M-x list-buffers}.) This buffer contains the program being | ||
| 456 | compiled, and point shows how far the byte compiler was able to read; | ||
| 457 | the cause of the error might be nearby. @xref{Syntax Errors}, for | ||
| 458 | some tips for locating syntax errors. | ||
| 459 | |||
| 460 | When the byte compiler warns about functions that were used but not | ||
| 461 | defined, it always reports the line number for the end of the file, | ||
| 462 | not the locations where the missing functions were called. To find | ||
| 463 | the latter, you must search for the function names. | ||
| 487 | 464 | ||
| 488 | You can suppress the compiler warning for calling an undefined | 465 | You can suppress the compiler warning for calling an undefined |
| 489 | function @var{func} by conditionalizing the function call on an | 466 | function @var{func} by conditionalizing the function call on an |
| @@ -541,17 +518,16 @@ one you intend to suppress. | |||
| 541 | @cindex byte-code function | 518 | @cindex byte-code function |
| 542 | 519 | ||
| 543 | Byte-compiled functions have a special data type: they are | 520 | Byte-compiled functions have a special data type: they are |
| 544 | @dfn{byte-code function objects}. | 521 | @dfn{byte-code function objects}. Whenever such an object appears as |
| 522 | a function to be called, Emacs uses the byte-code interpreter to | ||
| 523 | execute the byte-code. | ||
| 545 | 524 | ||
| 546 | Internally, a byte-code function object is much like a vector; | 525 | Internally, a byte-code function object is much like a vector; its |
| 547 | however, the evaluator handles this data type specially when it appears | 526 | elements can be accessed using @code{aref}. Its printed |
| 548 | as a function to be called. The printed representation for a byte-code | 527 | representation is like that for a vector, with an additional @samp{#} |
| 549 | function object is like that for a vector, with an additional @samp{#} | 528 | before the opening @samp{[}. It must have at least four elements; |
| 550 | before the opening @samp{[}. | 529 | there is no maximum number, but only the first six elements have any |
| 551 | 530 | normal use. They are: | |
| 552 | A byte-code function object must have at least four elements; there is | ||
| 553 | no maximum number, but only the first six elements have any normal use. | ||
| 554 | They are: | ||
| 555 | 531 | ||
| 556 | @table @var | 532 | @table @var |
| 557 | @item arglist | 533 | @item arglist |
| @@ -588,7 +564,7 @@ representation. It is the definition of the command | |||
| 588 | [arg 1 forward-sexp] | 564 | [arg 1 forward-sexp] |
| 589 | 2 | 565 | 2 |
| 590 | 254435 | 566 | 254435 |
| 591 | "p"] | 567 | "^p"] |
| 592 | @end example | 568 | @end example |
| 593 | 569 | ||
| 594 | The primitive way to create a byte-code object is with | 570 | The primitive way to create a byte-code object is with |
| @@ -604,10 +580,6 @@ function yourself, because if they are inconsistent, Emacs may crash | |||
| 604 | when you call the function. Always leave it to the byte compiler to | 580 | when you call the function. Always leave it to the byte compiler to |
| 605 | create these objects; it makes the elements consistent (we hope). | 581 | create these objects; it makes the elements consistent (we hope). |
| 606 | 582 | ||
| 607 | You can access the elements of a byte-code object using @code{aref}; | ||
| 608 | you can also use @code{vconcat} to create a vector with the same | ||
| 609 | elements. | ||
| 610 | |||
| 611 | @node Disassembly | 583 | @node Disassembly |
| 612 | @section Disassembled Byte-Code | 584 | @section Disassembled Byte-Code |
| 613 | @cindex disassembled byte-code | 585 | @cindex disassembled byte-code |
diff --git a/doc/lispref/control.texi b/doc/lispref/control.texi index 3673f753a0a..c23c93300a6 100644 --- a/doc/lispref/control.texi +++ b/doc/lispref/control.texi | |||
| @@ -948,8 +948,8 @@ The effect of @code{debug} here is only to prevent | |||
| 948 | given error will invoke the debugger only if @code{debug-on-error} and | 948 | given error will invoke the debugger only if @code{debug-on-error} and |
| 949 | the other usual filtering mechanisms say it should. @xref{Error Debugging}. | 949 | the other usual filtering mechanisms say it should. @xref{Error Debugging}. |
| 950 | 950 | ||
| 951 | @defmac condition-case-no-debug var protected-form handlers@dots{} | 951 | @defmac condition-case-unless-debug var protected-form handlers@dots{} |
| 952 | The macro @code{condition-case-no-debug} provides another way to | 952 | The macro @code{condition-case-unless-debug} provides another way to |
| 953 | handle debugging of such forms. It behaves exactly like | 953 | handle debugging of such forms. It behaves exactly like |
| 954 | @code{condition-case}, unless the variable @code{debug-on-error} is | 954 | @code{condition-case}, unless the variable @code{debug-on-error} is |
| 955 | non-@code{nil}, in which case it does not handle any errors at all. | 955 | non-@code{nil}, in which case it does not handle any errors at all. |
| @@ -1131,9 +1131,9 @@ Here's the example at the beginning of this subsection rewritten using | |||
| 1131 | @defmac with-demoted-errors body@dots{} | 1131 | @defmac with-demoted-errors body@dots{} |
| 1132 | This macro is like a milder version of @code{ignore-errors}. Rather | 1132 | This macro is like a milder version of @code{ignore-errors}. Rather |
| 1133 | than suppressing errors altogether, it converts them into messages. | 1133 | than suppressing errors altogether, it converts them into messages. |
| 1134 | Use this form around code that is not expected to signal errors, | 1134 | Use this form around code that is not expected to signal errors, but |
| 1135 | but should be robust if one does occur. Note that this macro | 1135 | should be robust if one does occur. Note that this macro uses |
| 1136 | uses @code{condition-case-no-debug} rather than @code{condition-case}. | 1136 | @code{condition-case-unless-debug} rather than @code{condition-case}. |
| 1137 | @end defmac | 1137 | @end defmac |
| 1138 | 1138 | ||
| 1139 | @node Error Symbols | 1139 | @node Error Symbols |
diff --git a/doc/lispref/debugging.texi b/doc/lispref/debugging.texi index cc92fc225f9..6e7d0078e07 100644 --- a/doc/lispref/debugging.texi +++ b/doc/lispref/debugging.texi | |||
| @@ -6,41 +6,46 @@ | |||
| 6 | @node Debugging, Read and Print, Advising Functions, Top | 6 | @node Debugging, Read and Print, Advising Functions, Top |
| 7 | @chapter Debugging Lisp Programs | 7 | @chapter Debugging Lisp Programs |
| 8 | 8 | ||
| 9 | There are three ways to investigate a problem in an Emacs Lisp program, | 9 | There are several ways to find and investigate problems in an Emacs |
| 10 | depending on what you are doing with the program when the problem appears. | 10 | Lisp program. |
| 11 | 11 | ||
| 12 | @itemize @bullet | 12 | @itemize @bullet |
| 13 | @item | 13 | @item |
| 14 | If the problem occurs when you run the program, you can use a Lisp | 14 | If a problem occurs when you run the program, you can use the built-in |
| 15 | debugger to investigate what is happening during execution. In addition | 15 | Emacs Lisp debugger to suspend the Lisp evaluator, and examine and/or |
| 16 | to the ordinary debugger, Emacs comes with a source-level debugger, | 16 | alter its internal state. |
| 17 | Edebug. This chapter describes both of them. | ||
| 18 | 17 | ||
| 19 | @item | 18 | @item |
| 20 | If the problem is syntactic, so that Lisp cannot even read the program, | 19 | You can use Edebug, a source-level debugger for Emacs Lisp. |
| 21 | you can use the Emacs facilities for editing Lisp to localize it. | ||
| 22 | 20 | ||
| 23 | @item | 21 | @item |
| 24 | If the problem occurs when trying to compile the program with the byte | 22 | If a syntactic problem is preventing Lisp from even reading the |
| 25 | compiler, you need to know how to examine the compiler's input buffer. | 23 | program, you can locate it using Lisp editing commands. |
| 24 | |||
| 25 | @item | ||
| 26 | You can look at the error and warning messages produced by the byte | ||
| 27 | compiler when it compiles the program. @xref{Compiler Errors}. | ||
| 28 | |||
| 29 | @item | ||
| 30 | You can use the Testcover package to perform coverage testing on the | ||
| 31 | program. | ||
| 32 | |||
| 33 | @item | ||
| 34 | You can use the ERT package to write regression tests for the program. | ||
| 35 | @xref{Top,the ERT manual,, ERT, ERT: Emacs Lisp Regression Testing}. | ||
| 26 | @end itemize | 36 | @end itemize |
| 27 | 37 | ||
| 38 | Other useful tools for debugging input and output problems are the | ||
| 39 | dribble file (@pxref{Terminal Input}) and the @code{open-termscript} | ||
| 40 | function (@pxref{Terminal Output}). | ||
| 41 | |||
| 28 | @menu | 42 | @menu |
| 29 | * Debugger:: How the Emacs Lisp debugger is implemented. | 43 | * Debugger:: A debugger for the Emacs Lisp evaluator. |
| 30 | * Edebug:: A source-level Emacs Lisp debugger. | 44 | * Edebug:: A source-level Emacs Lisp debugger. |
| 31 | * Syntax Errors:: How to find syntax errors. | 45 | * Syntax Errors:: How to find syntax errors. |
| 32 | * Test Coverage:: Ensuring you have tested all branches in your code. | 46 | * Test Coverage:: Ensuring you have tested all branches in your code. |
| 33 | * Compilation Errors:: How to find errors that show up in byte compilation. | ||
| 34 | @end menu | 47 | @end menu |
| 35 | 48 | ||
| 36 | Another useful debugging tool is the dribble file. When a dribble | ||
| 37 | file is open, Emacs copies all keyboard input characters to that file. | ||
| 38 | Afterward, you can examine the file to find out what input was used. | ||
| 39 | @xref{Terminal Input}. | ||
| 40 | |||
| 41 | For debugging problems in terminal descriptions, the | ||
| 42 | @code{open-termscript} function can be useful. @xref{Terminal Output}. | ||
| 43 | |||
| 44 | @node Debugger | 49 | @node Debugger |
| 45 | @section The Lisp Debugger | 50 | @section The Lisp Debugger |
| 46 | @cindex debugger for Emacs Lisp | 51 | @cindex debugger for Emacs Lisp |
| @@ -76,25 +81,29 @@ happens. This allows you to investigate the immediate causes of the | |||
| 76 | error. | 81 | error. |
| 77 | 82 | ||
| 78 | However, entry to the debugger is not a normal consequence of an | 83 | However, entry to the debugger is not a normal consequence of an |
| 79 | error. Many commands frequently cause Lisp errors when invoked | 84 | error. Many commands signal Lisp errors when invoked inappropriately, |
| 80 | inappropriately, and during ordinary editing it would be very | 85 | and during ordinary editing it would be very inconvenient to enter the |
| 81 | inconvenient to enter the debugger each time this happens. So if you | 86 | debugger each time this happens. So if you want errors to enter the |
| 82 | want errors to enter the debugger, set the variable | 87 | debugger, set the variable @code{debug-on-error} to non-@code{nil}. |
| 83 | @code{debug-on-error} to non-@code{nil}. (The command | 88 | (The command @code{toggle-debug-on-error} provides an easy way to do |
| 84 | @code{toggle-debug-on-error} provides an easy way to do this.) | 89 | this.) |
| 85 | 90 | ||
| 86 | @defopt debug-on-error | 91 | @defopt debug-on-error |
| 87 | This variable determines whether the debugger is called when an error | 92 | This variable determines whether the debugger is called when an error |
| 88 | is signaled and not handled. If @code{debug-on-error} is @code{t}, | 93 | is signaled and not handled. If @code{debug-on-error} is @code{t}, |
| 89 | all kinds of errors call the debugger, except those listed in | 94 | all kinds of errors call the debugger, except those listed in |
| 90 | @code{debug-ignored-errors} (see below). If it is @code{nil}, none | 95 | @code{debug-ignored-errors} (see below). If it is @code{nil}, none |
| 91 | call the debugger. (Note that @code{eval-expression-debug-on-error} | 96 | call the debugger. |
| 92 | affects the setting of this variable in some cases; see below.) | ||
| 93 | 97 | ||
| 94 | The value can also be a list of error conditions that should call the | 98 | The value can also be a list of error conditions (@pxref{Signaling |
| 95 | debugger. For example, if you set it to the list | 99 | Errors}). Then the debugger is called only for error conditions in |
| 96 | @code{(void-variable)}, then only errors about a variable that has no | 100 | this list (except those also listed in @code{debug-ignored-errors}). |
| 97 | value invoke the debugger. | 101 | For example, if you set @code{debug-on-error} to the list |
| 102 | @code{(void-variable)}, the debugger is only called for errors about a | ||
| 103 | variable that has no value. | ||
| 104 | |||
| 105 | Note that @code{eval-expression-debug-on-error} overrides this | ||
| 106 | variable in some cases; see below. | ||
| 98 | 107 | ||
| 99 | When this variable is non-@code{nil}, Emacs does not create an error | 108 | When this variable is non-@code{nil}, Emacs does not create an error |
| 100 | handler around process filter functions and sentinels. Therefore, | 109 | handler around process filter functions and sentinels. Therefore, |
| @@ -102,52 +111,50 @@ errors in these functions also invoke the debugger. @xref{Processes}. | |||
| 102 | @end defopt | 111 | @end defopt |
| 103 | 112 | ||
| 104 | @defopt debug-ignored-errors | 113 | @defopt debug-ignored-errors |
| 105 | This variable specifies certain kinds of errors that should not enter | 114 | This variable specifies errors which should not enter the debugger, |
| 106 | the debugger. Its value is a list of error condition symbols and/or | 115 | regardless of the value of @code{debug-on-error}. Its value is a list |
| 107 | regular expressions. If the error has any of those condition symbols, | 116 | of error condition symbols and/or regular expressions. If the error |
| 108 | or if the error message matches any of the regular expressions, then | 117 | has any of those condition symbols, or if the error message matches |
| 109 | that error does not enter the debugger, regardless of the value of | 118 | any of the regular expressions, then that error does not enter the |
| 110 | @code{debug-on-error}. | 119 | debugger. |
| 111 | 120 | ||
| 112 | The normal value of this variable lists several errors that happen often | 121 | The normal value of this variable lists several errors that happen |
| 113 | during editing but rarely result from bugs in Lisp programs. However, | 122 | often during editing but rarely result from bugs in Lisp programs. |
| 114 | ``rarely'' is not ``never''; if your program fails with an error that | 123 | However, ``rarely'' is not ``never''; if your program fails with an |
| 115 | matches this list, you will need to change this list in order to debug | 124 | error that matches this list, you may try changing this list to debug |
| 116 | the error. The easiest way is usually to set | 125 | the error. The easiest way is usually to set |
| 117 | @code{debug-ignored-errors} to @code{nil}. | 126 | @code{debug-ignored-errors} to @code{nil}. |
| 118 | @end defopt | 127 | @end defopt |
| 119 | 128 | ||
| 120 | @defopt eval-expression-debug-on-error | 129 | @defopt eval-expression-debug-on-error |
| 121 | If this variable has a non-@code{nil} value, then | 130 | If this variable has a non-@code{nil} value (the default), running the |
| 122 | @code{debug-on-error} is set to @code{t} when evaluating with the | 131 | command @code{eval-expression} causes @code{debug-on-error} to be |
| 123 | command @code{eval-expression}. If | 132 | temporarily bound to to @code{t}. @xref{Lisp Eval,, Evaluating |
| 124 | @code{eval-expression-debug-on-error} is @code{nil}, then the value of | ||
| 125 | @code{debug-on-error} is not changed. @xref{Lisp Eval,, Evaluating | ||
| 126 | Emacs-Lisp Expressions, emacs, The GNU Emacs Manual}. | 133 | Emacs-Lisp Expressions, emacs, The GNU Emacs Manual}. |
| 127 | @end defopt | ||
| 128 | 134 | ||
| 129 | @defopt debug-on-signal | 135 | If @code{eval-expression-debug-on-error} is @code{nil}, then the value |
| 130 | Normally, errors that are caught by @code{condition-case} never run the | 136 | of @code{debug-on-error} is not changed during @code{eval-expression}. |
| 131 | debugger, even if @code{debug-on-error} is non-@code{nil}. In other | ||
| 132 | words, @code{condition-case} gets a chance to handle the error before | ||
| 133 | the debugger gets a chance. | ||
| 134 | |||
| 135 | If you set @code{debug-on-signal} to a non-@code{nil} value, then the | ||
| 136 | debugger gets the first chance at every error; an error will invoke the | ||
| 137 | debugger regardless of any @code{condition-case}, if it fits the | ||
| 138 | criteria specified by the values of @code{debug-on-error} and | ||
| 139 | @code{debug-ignored-errors}. | ||
| 140 | |||
| 141 | @strong{Warning:} This variable is strong medicine! Various parts of | ||
| 142 | Emacs handle errors in the normal course of affairs, and you may not | ||
| 143 | even realize that errors happen there. If you set | ||
| 144 | @code{debug-on-signal} to a non-@code{nil} value, those errors will | ||
| 145 | enter the debugger. | ||
| 146 | |||
| 147 | @strong{Warning:} @code{debug-on-signal} has no effect when | ||
| 148 | @code{debug-on-error} is @code{nil}. | ||
| 149 | @end defopt | 137 | @end defopt |
| 150 | 138 | ||
| 139 | @defvar debug-on-signal | ||
| 140 | Normally, errors caught by @code{condition-case} never invoke the | ||
| 141 | debugger. The @code{condition-case} gets a chance to handle the error | ||
| 142 | before the debugger gets a chance. | ||
| 143 | |||
| 144 | If you change @code{debug-on-signal} to a non-@code{nil} value, the | ||
| 145 | debugger gets the first chance at every error, regardless of the | ||
| 146 | presence of @code{condition-case}. (To invoke the debugger, the error | ||
| 147 | must still fulfill the criteria specified by @code{debug-on-error} and | ||
| 148 | @code{debug-ignored-errors}.) | ||
| 149 | |||
| 150 | @strong{Warning:} Setting this variable to non-@code{nil} may have | ||
| 151 | annoying effects. Various parts of Emacs catch errors in the normal | ||
| 152 | course of affairs, and you may not even realize that errors happen | ||
| 153 | there. If you need to debug code wrapped in @code{condition-case}, | ||
| 154 | consider using @code{condition-case-unless-debug} (@pxref{Handling | ||
| 155 | Errors}). | ||
| 156 | @end defvar | ||
| 157 | |||
| 151 | @defopt debug-on-event | 158 | @defopt debug-on-event |
| 152 | If you set @code{debug-on-event} to a special event (@pxref{Special | 159 | If you set @code{debug-on-event} to a special event (@pxref{Special |
| 153 | Events}), Emacs will try to enter the debugger as soon as it receives | 160 | Events}), Emacs will try to enter the debugger as soon as it receives |
| @@ -171,27 +178,26 @@ init file. | |||
| 171 | @cindex stopping an infinite loop | 178 | @cindex stopping an infinite loop |
| 172 | 179 | ||
| 173 | When a program loops infinitely and fails to return, your first | 180 | When a program loops infinitely and fails to return, your first |
| 174 | problem is to stop the loop. On most operating systems, you can do this | 181 | problem is to stop the loop. On most operating systems, you can do |
| 175 | with @kbd{C-g}, which causes a @dfn{quit}. | 182 | this with @kbd{C-g}, which causes a @dfn{quit}. @xref{Quitting}. |
| 176 | 183 | ||
| 177 | Ordinary quitting gives no information about why the program was | 184 | Ordinary quitting gives no information about why the program was |
| 178 | looping. To get more information, you can set the variable | 185 | looping. To get more information, you can set the variable |
| 179 | @code{debug-on-quit} to non-@code{nil}. Quitting with @kbd{C-g} is not | 186 | @code{debug-on-quit} to non-@code{nil}. Once you have the debugger |
| 180 | considered an error, and @code{debug-on-error} has no effect on the | 187 | running in the middle of the infinite loop, you can proceed from the |
| 181 | handling of @kbd{C-g}. Likewise, @code{debug-on-quit} has no effect on | 188 | debugger using the stepping commands. If you step through the entire |
| 182 | errors. | 189 | loop, you may get enough information to solve the problem. |
| 183 | 190 | ||
| 184 | Once you have the debugger running in the middle of the infinite loop, | 191 | Quitting with @kbd{C-g} is not considered an error, and |
| 185 | you can proceed from the debugger using the stepping commands. If you | 192 | @code{debug-on-error} has no effect on the handling of @kbd{C-g}. |
| 186 | step through the entire loop, you will probably get enough information | 193 | Likewise, @code{debug-on-quit} has no effect on errors. |
| 187 | to solve the problem. | ||
| 188 | 194 | ||
| 189 | @defopt debug-on-quit | 195 | @defopt debug-on-quit |
| 190 | This variable determines whether the debugger is called when @code{quit} | 196 | This variable determines whether the debugger is called when |
| 191 | is signaled and not handled. If @code{debug-on-quit} is non-@code{nil}, | 197 | @code{quit} is signaled and not handled. If @code{debug-on-quit} is |
| 192 | then the debugger is called whenever you quit (that is, type @kbd{C-g}). | 198 | non-@code{nil}, then the debugger is called whenever you quit (that |
| 193 | If @code{debug-on-quit} is @code{nil}, then the debugger is not called | 199 | is, type @kbd{C-g}). If @code{debug-on-quit} is @code{nil} (the |
| 194 | when you quit. @xref{Quitting}. | 200 | default), then the debugger is not called when you quit. |
| 195 | @end defopt | 201 | @end defopt |
| 196 | 202 | ||
| 197 | @node Function Debugging | 203 | @node Function Debugging |
| @@ -337,8 +343,8 @@ that exiting that frame will call the debugger again. This is useful | |||
| 337 | for examining the return value of a function. | 343 | for examining the return value of a function. |
| 338 | 344 | ||
| 339 | If a function name is underlined, that means the debugger knows | 345 | If a function name is underlined, that means the debugger knows |
| 340 | where its source code is located. You can click @kbd{Mouse-2} on that | 346 | where its source code is located. You can click with the mouse on |
| 341 | name, or move to it and type @key{RET}, to visit the source code. | 347 | that name, or move to it and type @key{RET}, to visit the source code. |
| 342 | 348 | ||
| 343 | The debugger itself must be run byte-compiled, since it makes | 349 | The debugger itself must be run byte-compiled, since it makes |
| 344 | assumptions about how many stack frames are used for the debugger | 350 | assumptions about how many stack frames are used for the debugger |
| @@ -364,14 +370,10 @@ to step through a primitive function. | |||
| 364 | 370 | ||
| 365 | @table @kbd | 371 | @table @kbd |
| 366 | @item c | 372 | @item c |
| 367 | Exit the debugger and continue execution. When continuing is possible, | 373 | Exit the debugger and continue execution. This resumes execution of |
| 368 | it resumes execution of the program as if the debugger had never been | 374 | the program as if the debugger had never been entered (aside from any |
| 369 | entered (aside from any side-effects that you caused by changing | 375 | side-effects that you caused by changing variable values or data |
| 370 | variable values or data structures while inside the debugger). | 376 | structures while inside the debugger). |
| 371 | |||
| 372 | Continuing is possible after entry to the debugger due to function entry | ||
| 373 | or exit, explicit invocation, or quitting. You cannot continue if the | ||
| 374 | debugger was entered because of an error. | ||
| 375 | 377 | ||
| 376 | @item d | 378 | @item d |
| 377 | Continue execution, but enter the debugger the next time any Lisp | 379 | Continue execution, but enter the debugger the next time any Lisp |
| @@ -790,29 +792,3 @@ never return. If it ever does return, you get a run-time error. | |||
| 790 | Edebug also has a coverage testing feature (@pxref{Coverage | 792 | Edebug also has a coverage testing feature (@pxref{Coverage |
| 791 | Testing}). These features partly duplicate each other, and it would | 793 | Testing}). These features partly duplicate each other, and it would |
| 792 | be cleaner to combine them. | 794 | be cleaner to combine them. |
| 793 | |||
| 794 | @node Compilation Errors | ||
| 795 | @section Debugging Problems in Compilation | ||
| 796 | @cindex debugging byte compilation problems | ||
| 797 | |||
| 798 | When an error happens during byte compilation, it is normally due to | ||
| 799 | invalid syntax in the program you are compiling. The compiler prints a | ||
| 800 | suitable error message in the @samp{*Compile-Log*} buffer, and then | ||
| 801 | stops. The message may state a function name in which the error was | ||
| 802 | found, or it may not. Either way, here is how to find out where in the | ||
| 803 | file the error occurred. | ||
| 804 | |||
| 805 | What you should do is switch to the buffer @w{@samp{ *Compiler Input*}}. | ||
| 806 | (Note that the buffer name starts with a space, so it does not show | ||
| 807 | up in @kbd{M-x list-buffers}.) This buffer contains the program being | ||
| 808 | compiled, and point shows how far the byte compiler was able to read. | ||
| 809 | |||
| 810 | If the error was due to invalid Lisp syntax, point shows exactly where | ||
| 811 | the invalid syntax was @emph{detected}. The cause of the error is not | ||
| 812 | necessarily near by! Use the techniques in the previous section to find | ||
| 813 | the error. | ||
| 814 | |||
| 815 | If the error was detected while compiling a form that had been read | ||
| 816 | successfully, then point is located at the end of the form. In this | ||
| 817 | case, this technique can't localize the error precisely, but can still | ||
| 818 | show you which function to check. | ||
diff --git a/doc/lispref/display.texi b/doc/lispref/display.texi index d5870fd3abb..ae8a5fde29f 100644 --- a/doc/lispref/display.texi +++ b/doc/lispref/display.texi | |||
| @@ -3380,12 +3380,11 @@ indicator. | |||
| 3380 | Used for truncation and continuation lines. | 3380 | Used for truncation and continuation lines. |
| 3381 | 3381 | ||
| 3382 | @item @code{up}, @code{down}, @code{top}, @code{bottom}, @code{top-bottom} | 3382 | @item @code{up}, @code{down}, @code{top}, @code{bottom}, @code{top-bottom} |
| 3383 | Used to indicate buffer boundaries when | 3383 | Used when @code{indicate-buffer-boundaries} is non-@code{nil}: |
| 3384 | @code{indicate-buffer-boundaries} is non-@code{nil}: @code{up} and | 3384 | @code{up} and @code{down} indicate a buffer boundary lying above or |
| 3385 | @code{down} indicate a buffer boundary lying above or below the window | 3385 | below the window edge; @code{top} and @code{bottom} indicate the |
| 3386 | edge; @code{top} and @code{bottom} indicate the topmost and bottommost | 3386 | topmost and bottommost buffer text line; and @code{top-bottom} |
| 3387 | buffer text line; and @code{top-bottom} indicates where there is just | 3387 | indicates where there is just one line of text in the buffer. |
| 3388 | one line of text in the buffer. | ||
| 3389 | 3388 | ||
| 3390 | @item @code{empty-line} | 3389 | @item @code{empty-line} |
| 3391 | Used to indicate empty lines when @code{indicate-empty-lines} is | 3390 | Used to indicate empty lines when @code{indicate-empty-lines} is |
| @@ -3407,24 +3406,9 @@ are used to indicate that the last text line has no final newline. | |||
| 3407 | Alternatively, @var{bitmaps} may be a single symbol which is used in | 3406 | Alternatively, @var{bitmaps} may be a single symbol which is used in |
| 3408 | both left and right fringes. | 3407 | both left and right fringes. |
| 3409 | 3408 | ||
| 3410 | The standard symbols for fringe bitmaps are: | 3409 | @xref{Fringe Bitmaps}, for a list of standard bitmap symbols and how |
| 3411 | 3410 | to define your own. In addition, @code{nil} represents the empty | |
| 3412 | @example | 3411 | bitmap (i.e.@: an indicator that is not shown). |
| 3413 | left-arrow right-arrow up-arrow down-arrow | ||
| 3414 | left-curly-arrow right-curly-arrow | ||
| 3415 | left-triangle right-triangle | ||
| 3416 | top-left-angle top-right-angle | ||
| 3417 | bottom-left-angle bottom-right-angle | ||
| 3418 | left-bracket right-bracket | ||
| 3419 | filled-rectangle hollow-rectangle | ||
| 3420 | filled-square hollow-square | ||
| 3421 | vertical-bar horizontal-bar | ||
| 3422 | empty-line question-mark | ||
| 3423 | @end example | ||
| 3424 | |||
| 3425 | @noindent | ||
| 3426 | In addition, @code{nil} represents the empty bitmap (i.e.@: an | ||
| 3427 | indicator that is not shown). | ||
| 3428 | 3412 | ||
| 3429 | When @code{fringe-indicator-alist} has a buffer-local value, and | 3413 | When @code{fringe-indicator-alist} has a buffer-local value, and |
| 3430 | there is no bitmap defined for a logical indicator, or the bitmap is | 3414 | there is no bitmap defined for a logical indicator, or the bitmap is |
| @@ -3442,16 +3426,6 @@ cursor in the right fringe instead of using two lines. Different | |||
| 3442 | bitmaps are used to represent the cursor in the fringe depending on | 3426 | bitmaps are used to represent the cursor in the fringe depending on |
| 3443 | the current buffer's cursor type. | 3427 | the current buffer's cursor type. |
| 3444 | 3428 | ||
| 3445 | @table @asis | ||
| 3446 | @item Logical cursor types: | ||
| 3447 | @code{box} , @code{hollow}, @code{bar}, | ||
| 3448 | @code{hbar}, @code{hollow-small}. | ||
| 3449 | @end table | ||
| 3450 | |||
| 3451 | The @code{hollow-small} type is used instead of @code{hollow} when the | ||
| 3452 | normal @code{hollow-rectangle} bitmap is too tall to fit on a specific | ||
| 3453 | display line. | ||
| 3454 | |||
| 3455 | @defopt overflow-newline-into-fringe | 3429 | @defopt overflow-newline-into-fringe |
| 3456 | If this is non-@code{nil}, lines exactly as wide as the window (not | 3430 | If this is non-@code{nil}, lines exactly as wide as the window (not |
| 3457 | counting the final newline character) are not continued. Instead, | 3431 | counting the final newline character) are not continued. Instead, |
| @@ -3462,24 +3436,31 @@ fringe. | |||
| 3462 | @defvar fringe-cursor-alist | 3436 | @defvar fringe-cursor-alist |
| 3463 | This variable specifies the mapping from logical cursor type to the | 3437 | This variable specifies the mapping from logical cursor type to the |
| 3464 | actual fringe bitmaps displayed in the right fringe. The value is an | 3438 | actual fringe bitmaps displayed in the right fringe. The value is an |
| 3465 | alist where each element @code{(@var{cursor} . @var{bitmap})} specifies | 3439 | alist where each element has the form @code{(@var{cursor-type} |
| 3466 | the fringe bitmaps used to display a specific logical cursor type in | 3440 | . @var{bitmap})}, which means to use the fringe bitmap @var{bitmap} to |
| 3467 | the fringe. Here, @var{cursor} specifies the logical cursor type and | 3441 | display cursors of type @var{cursor-type}. |
| 3468 | @var{bitmap} is a symbol specifying the fringe bitmap to be displayed | 3442 | |
| 3469 | for that logical cursor type. | 3443 | Each @var{cursor-type} should be one of @code{box}, @code{hollow}, |
| 3444 | @code{bar}, @code{hbar}, or @code{hollow-small}. The first four have | ||
| 3445 | the same meanings as in the @code{cursor-type} frame parameter | ||
| 3446 | (@pxref{Cursor Parameters}). The @code{hollow-small} type is used | ||
| 3447 | instead of @code{hollow} when the normal @code{hollow-rectangle} | ||
| 3448 | bitmap is too tall to fit on a specific display line. | ||
| 3449 | |||
| 3450 | Each @var{bitmap} should be a symbol specifying the fringe bitmap to | ||
| 3451 | be displayed for that logical cursor type. | ||
| 3452 | @iftex | ||
| 3453 | See the next subsection for details. | ||
| 3454 | @end iftex | ||
| 3455 | @ifnottex | ||
| 3456 | @xref{Fringe Bitmaps}. | ||
| 3457 | @end ifnottex | ||
| 3470 | 3458 | ||
| 3471 | When @code{fringe-cursor-alist} has a buffer-local value, and there is | 3459 | When @code{fringe-cursor-alist} has a buffer-local value, and there is |
| 3472 | no bitmap defined for a cursor type, the corresponding value from the | 3460 | no bitmap defined for a cursor type, the corresponding value from the |
| 3473 | default value of @code{fringes-indicator-alist} is used. | 3461 | default value of @code{fringes-indicator-alist} is used. |
| 3474 | @end defvar | 3462 | @end defvar |
| 3475 | 3463 | ||
| 3476 | Standard bitmaps for displaying the cursor in right fringe: | ||
| 3477 | @example | ||
| 3478 | filled-rectangle hollow-rectangle filled-square hollow-square | ||
| 3479 | vertical-bar horizontal-bar | ||
| 3480 | @end example | ||
| 3481 | |||
| 3482 | |||
| 3483 | @node Fringe Bitmaps | 3464 | @node Fringe Bitmaps |
| 3484 | @subsection Fringe Bitmaps | 3465 | @subsection Fringe Bitmaps |
| 3485 | @cindex fringe bitmaps | 3466 | @cindex fringe bitmaps |
| @@ -3487,22 +3468,74 @@ vertical-bar horizontal-bar | |||
| 3487 | 3468 | ||
| 3488 | The @dfn{fringe bitmaps} are the actual bitmaps which represent the | 3469 | The @dfn{fringe bitmaps} are the actual bitmaps which represent the |
| 3489 | logical fringe indicators for truncated or continued lines, buffer | 3470 | logical fringe indicators for truncated or continued lines, buffer |
| 3490 | boundaries, overlay arrow, etc. Fringe bitmap symbols have their own | 3471 | boundaries, overlay arrows, etc. Each bitmap is represented by a |
| 3491 | name space. The fringe bitmaps are shared by all frames and windows. | 3472 | symbol. |
| 3492 | You can redefine the built-in fringe bitmaps, and you can define new | 3473 | @iftex |
| 3493 | fringe bitmaps. | 3474 | These symbols are referred to by the variables |
| 3494 | 3475 | @code{fringe-indicator-alist} and @code{fringe-cursor-alist}, | |
| 3495 | The way to display a bitmap in the left or right fringes for a given | 3476 | described in the previous subsections. |
| 3496 | line in a window is by specifying the @code{display} property for one | 3477 | @end iftex |
| 3497 | of the characters that appears in it. Use a display specification of | 3478 | @ifnottex |
| 3498 | the form @code{(left-fringe @var{bitmap} [@var{face}])} or | 3479 | These symbols are referred to by the variable |
| 3499 | @code{(right-fringe @var{bitmap} [@var{face}])} (@pxref{Display | 3480 | @code{fringe-indicator-alist}, which maps fringe indicators to bitmaps |
| 3500 | Property}). Here, @var{bitmap} is a symbol identifying the bitmap you | 3481 | (@pxref{Fringe Indicators}), and the variable |
| 3501 | want, and @var{face} (which is optional) is the name of the face whose | 3482 | @code{fringe-cursor-alist}, which maps fringe cursors to bitmaps |
| 3502 | colors should be used for displaying the bitmap, instead of the | 3483 | (@pxref{Fringe Cursors}). |
| 3503 | default @code{fringe} face. @var{face} is automatically merged with | 3484 | @end ifnottex |
| 3504 | the @code{fringe} face, so normally @var{face} need only specify the | 3485 | |
| 3505 | foreground color for the bitmap. | 3486 | Lisp programs can also directly display a bitmap in the left or |
| 3487 | right fringe, by using a @code{display} property for one of the | ||
| 3488 | characters appearing in the line (@pxref{Other Display Specs}). Such | ||
| 3489 | a display specification has the form | ||
| 3490 | |||
| 3491 | @example | ||
| 3492 | (left-fringe @var{bitmap} [@var{face}]) | ||
| 3493 | @end example | ||
| 3494 | |||
| 3495 | @noindent | ||
| 3496 | or | ||
| 3497 | |||
| 3498 | @example | ||
| 3499 | (right-fringe @var{bitmap} [@var{face}]) | ||
| 3500 | @end example | ||
| 3501 | |||
| 3502 | @noindent | ||
| 3503 | The symbol @var{bitmap} identifies the bitmap to display. The | ||
| 3504 | optional @var{face} names a face whose foreground color is used to | ||
| 3505 | display the bitmap; this face is automatically merged with the | ||
| 3506 | @code{fringe} face. | ||
| 3507 | |||
| 3508 | Here is a list of the standard fringe bitmaps defined in Emacs, and | ||
| 3509 | how they are currently used in Emacs (via | ||
| 3510 | @code{fringe-indicator-alist} and @code{fringe-cursor-alist}): | ||
| 3511 | |||
| 3512 | @table @asis | ||
| 3513 | @item @code{left-arrow}, @code{right-arrow} | ||
| 3514 | Used to indicate truncated lines. | ||
| 3515 | |||
| 3516 | @item @code{left-curly-arrow}, @code{right-curly-arrow} | ||
| 3517 | Used to indicate continued lines. | ||
| 3518 | |||
| 3519 | @item @code{right-triangle}, @code{left-triangle} | ||
| 3520 | The former is used by overlay arrows. The latter is unused. | ||
| 3521 | |||
| 3522 | @item @code{up-arrow}, @code{down-arrow}, @code{top-left-angle} @code{top-right-angle} | ||
| 3523 | @itemx @code{bottom-left-angle}, @code{bottom-right-angle} | ||
| 3524 | @itemx @code{top-right-angle}, @code{top-left-angle} | ||
| 3525 | @itemx @code{left-bracket}, @code{right-bracket}, @code{top-right-angle}, @code{top-left-angle} | ||
| 3526 | Used to indicate buffer boundaries. | ||
| 3527 | |||
| 3528 | @item @code{filled-rectangle}, @code{hollow-rectangle} | ||
| 3529 | @itemx @code{filled-square}, @code{hollow-square} | ||
| 3530 | @itemx @code{vertical-bar}, @code{horizontal-bar} | ||
| 3531 | Used for different types of fringe cursors. | ||
| 3532 | |||
| 3533 | @item @code{empty-line}, @code{question-mark} | ||
| 3534 | Unused. | ||
| 3535 | @end table | ||
| 3536 | |||
| 3537 | @noindent | ||
| 3538 | The next subsection describes how to define your own fringe bitmaps. | ||
| 3506 | 3539 | ||
| 3507 | @defun fringe-bitmaps-at-pos &optional pos window | 3540 | @defun fringe-bitmaps-at-pos &optional pos window |
| 3508 | This function returns the fringe bitmaps of the display line | 3541 | This function returns the fringe bitmaps of the display line |
diff --git a/doc/lispref/elisp.texi b/doc/lispref/elisp.texi index f69823101d0..42c3613dd0b 100644 --- a/doc/lispref/elisp.texi +++ b/doc/lispref/elisp.texi | |||
| @@ -548,17 +548,14 @@ Advising Emacs Lisp Functions | |||
| 548 | * Preactivation:: Preactivation is a way of speeding up the | 548 | * Preactivation:: Preactivation is a way of speeding up the |
| 549 | loading of compiled advice. | 549 | loading of compiled advice. |
| 550 | * Argument Access in Advice:: How advice can access the function's arguments. | 550 | * Argument Access in Advice:: How advice can access the function's arguments. |
| 551 | * Advising Primitives:: Accessing arguments when advising a primitive. | ||
| 552 | * Combined Definition:: How advice is implemented. | 551 | * Combined Definition:: How advice is implemented. |
| 553 | 552 | ||
| 554 | Debugging Lisp Programs | 553 | Debugging Lisp Programs |
| 555 | 554 | ||
| 556 | * Debugger:: How the Emacs Lisp debugger is implemented. | 555 | * Debugger:: A debugger for the Emacs Lisp evaluator. |
| 557 | * Edebug:: A source-level Emacs Lisp debugger. | 556 | * Edebug:: A source-level Emacs Lisp debugger. |
| 558 | * Syntax Errors:: How to find syntax errors. | 557 | * Syntax Errors:: How to find syntax errors. |
| 559 | * Test Coverage:: Ensuring you have tested all branches in your code. | 558 | * Test Coverage:: Ensuring you have tested all branches in your code. |
| 560 | * Compilation Errors:: How to find errors that show up in | ||
| 561 | byte compilation. | ||
| 562 | 559 | ||
| 563 | The Lisp Debugger | 560 | The Lisp Debugger |
| 564 | 561 | ||
| @@ -1061,7 +1058,7 @@ Text | |||
| 1061 | * Registers:: How registers are implemented. Accessing | 1058 | * Registers:: How registers are implemented. Accessing |
| 1062 | the text or position stored in a register. | 1059 | the text or position stored in a register. |
| 1063 | * Base 64:: Conversion to or from base 64 encoding. | 1060 | * Base 64:: Conversion to or from base 64 encoding. |
| 1064 | * MD5 Checksum:: Compute the MD5 "message digest"/"checksum". | 1061 | * Checksum/Hash:: Computing "message digests"/"checksums"/"hashes". |
| 1065 | * Atomic Changes:: Installing several buffer changes "atomically". | 1062 | * Atomic Changes:: Installing several buffer changes "atomically". |
| 1066 | * Change Hooks:: Supplying functions to be run when text is changed. | 1063 | * Change Hooks:: Supplying functions to be run when text is changed. |
| 1067 | 1064 | ||
diff --git a/doc/lispref/files.texi b/doc/lispref/files.texi index 087eb6ef1db..cf093ba36cb 100644 --- a/doc/lispref/files.texi +++ b/doc/lispref/files.texi | |||
| @@ -2862,24 +2862,21 @@ is a good way to come up with one. | |||
| 2862 | @end defun | 2862 | @end defun |
| 2863 | 2863 | ||
| 2864 | @defopt remote-file-name-inhibit-cache | 2864 | @defopt remote-file-name-inhibit-cache |
| 2865 | Whether to use the remote file-name cache for read access. | 2865 | The attributes of remote files can be cached for better performance. If |
| 2866 | 2866 | they are changed outside of Emacs's control, the cached values become | |
| 2867 | File attributes of remote files are cached for better performance. If | ||
| 2868 | they are changed out of Emacs' control, the cached values become | ||
| 2869 | invalid, and must be reread. | 2867 | invalid, and must be reread. |
| 2870 | 2868 | ||
| 2871 | When set to @code{nil}, cached values are always used. This shall be | 2869 | When this variable is set to @code{nil}, cached values are never |
| 2872 | set with care. When set to @code{t}, cached values are never used. | 2870 | expired. Use this setting with caution, only if you are sure nothing |
| 2873 | ALthough this is the safest value, it could result in performance | 2871 | other than Emacs ever changes the remote files. If it is set to |
| 2874 | degradation. | 2872 | @code{t}, cached values are never used. This is the safest value, but |
| 2873 | could result in performance degradation. | ||
| 2875 | 2874 | ||
| 2876 | A compromise is to set it to a positive number. This means that | 2875 | A compromise is to set it to a positive number. This means that |
| 2877 | cached values are used for that amount of seconds since they were | 2876 | cached values are used for that amount of seconds since they were |
| 2878 | cached. | 2877 | cached. If a remote file is checked regularly, it might be a good |
| 2879 | 2878 | idea to let-bind this variable to a value less than the time period | |
| 2880 | In case a remote file is checked regularly, it might be reasonable to | 2879 | between consecutive checks. For example: |
| 2881 | let-bind this variable to a value less then the time period between | ||
| 2882 | two checks. Example: | ||
| 2883 | 2880 | ||
| 2884 | @example | 2881 | @example |
| 2885 | (defun display-time-file-nonempty-p (file) | 2882 | (defun display-time-file-nonempty-p (file) |
diff --git a/doc/lispref/loading.texi b/doc/lispref/loading.texi index 0b822751df6..3c2fa60248e 100644 --- a/doc/lispref/loading.texi +++ b/doc/lispref/loading.texi | |||
| @@ -10,9 +10,10 @@ | |||
| 10 | @cindex library | 10 | @cindex library |
| 11 | @cindex Lisp library | 11 | @cindex Lisp library |
| 12 | 12 | ||
| 13 | Loading a file of Lisp code means bringing its contents into the Lisp | 13 | Loading a file of Lisp code means bringing its contents into the |
| 14 | environment in the form of Lisp objects. Emacs finds and opens the | 14 | Lisp environment in the form of Lisp objects. Emacs finds and opens |
| 15 | file, reads the text, evaluates each form, and then closes the file. | 15 | the file, reads the text, evaluates each form, and then closes the |
| 16 | file. Such a file is also called a @dfn{Lisp library}. | ||
| 16 | 17 | ||
| 17 | The load functions evaluate all the expressions in a file just | 18 | The load functions evaluate all the expressions in a file just |
| 18 | as the @code{eval-buffer} function evaluates all the | 19 | as the @code{eval-buffer} function evaluates all the |
| @@ -29,11 +30,6 @@ into a buffer and evaluated there. (Indeed, most code is tested this | |||
| 29 | way.) Most often, the forms are function definitions and variable | 30 | way.) Most often, the forms are function definitions and variable |
| 30 | definitions. | 31 | definitions. |
| 31 | 32 | ||
| 32 | A file containing Lisp code is often called a @dfn{library}. Thus, | ||
| 33 | the ``Rmail library'' is a file containing code for Rmail mode. | ||
| 34 | Similarly, a ``Lisp library directory'' is a directory of files | ||
| 35 | containing Lisp code. | ||
| 36 | |||
| 37 | @menu | 33 | @menu |
| 38 | * How Programs Do Loading:: The @code{load} function and others. | 34 | * How Programs Do Loading:: The @code{load} function and others. |
| 39 | * Load Suffixes:: Details about the suffixes that @code{load} tries. | 35 | * Load Suffixes:: Details about the suffixes that @code{load} tries. |
| @@ -88,8 +84,8 @@ this case, you must specify the precise file name you want, except | |||
| 88 | that, if Auto Compression mode is enabled, @code{load} will still use | 84 | that, if Auto Compression mode is enabled, @code{load} will still use |
| 89 | @code{jka-compr-load-suffixes} to find compressed versions. By | 85 | @code{jka-compr-load-suffixes} to find compressed versions. By |
| 90 | specifying the precise file name and using @code{t} for | 86 | specifying the precise file name and using @code{t} for |
| 91 | @var{nosuffix}, you can prevent perverse file names such as | 87 | @var{nosuffix}, you can prevent file names like @file{foo.el.el} from |
| 92 | @file{foo.el.el} from being tried. | 88 | being tried. |
| 93 | 89 | ||
| 94 | If the optional argument @var{must-suffix} is non-@code{nil}, then | 90 | If the optional argument @var{must-suffix} is non-@code{nil}, then |
| 95 | @code{load} insists that the file name used must end in either | 91 | @code{load} insists that the file name used must end in either |
| @@ -238,73 +234,37 @@ it skips the latter group. | |||
| 238 | When Emacs loads a Lisp library, it searches for the library | 234 | When Emacs loads a Lisp library, it searches for the library |
| 239 | in a list of directories specified by the variable @code{load-path}. | 235 | in a list of directories specified by the variable @code{load-path}. |
| 240 | 236 | ||
| 241 | @defopt load-path | 237 | @defvar load-path |
| 242 | @cindex @code{EMACSLOADPATH} environment variable | 238 | @cindex @code{EMACSLOADPATH} environment variable |
| 243 | The value of this variable is a list of directories to search when | 239 | The value of this variable is a list of directories to search when |
| 244 | loading files with @code{load}. Each element is a string (which must be | 240 | loading files with @code{load}. Each element is a string (which must be |
| 245 | a directory name) or @code{nil} (which stands for the current working | 241 | a directory name) or @code{nil} (which stands for the current working |
| 246 | directory). | 242 | directory). |
| 247 | @end defopt | 243 | @end defvar |
| 248 | |||
| 249 | The value of @code{load-path} is initialized from the environment | ||
| 250 | variable @code{EMACSLOADPATH}, if that exists; otherwise its default | ||
| 251 | value is specified in @file{emacs/src/epaths.h} when Emacs is built. | ||
| 252 | Then the list is expanded by adding subdirectories of the directories | ||
| 253 | in the list. | ||
| 254 | |||
| 255 | The syntax of @code{EMACSLOADPATH} is the same as used for @code{PATH}; | ||
| 256 | @samp{:} (or @samp{;}, according to the operating system) separates | ||
| 257 | directory names, and @samp{.} is used for the current default directory. | ||
| 258 | Here is an example of how to set your @code{EMACSLOADPATH} variable from | ||
| 259 | a @code{csh} @file{.login} file: | ||
| 260 | |||
| 261 | @smallexample | ||
| 262 | setenv EMACSLOADPATH .:/user/bil/emacs:/usr/local/share/emacs/20.3/lisp | ||
| 263 | @end smallexample | ||
| 264 | 244 | ||
| 265 | Here is how to set it using @code{sh}: | 245 | Each time Emacs starts up, it sets up the value of @code{load-path} |
| 246 | in several steps. First, it initializes @code{load-path} to the | ||
| 247 | directories specified by the environment variable @env{EMACSLOADPATH}, | ||
| 248 | if that exists. The syntax of @env{EMACSLOADPATH} is the same as used | ||
| 249 | for @code{PATH}; directory names are separated by @samp{:} (or | ||
| 250 | @samp{;}, on some operating systems), and @samp{.} stands for the | ||
| 251 | current default directory. Here is an example of how to set | ||
| 252 | @env{EMACSLOADPATH} variable from @command{sh}: | ||
| 266 | 253 | ||
| 267 | @smallexample | 254 | @smallexample |
| 268 | export EMACSLOADPATH | 255 | export EMACSLOADPATH |
| 269 | EMACSLOADPATH=.:/user/bil/emacs:/usr/local/share/emacs/20.3/lisp | 256 | EMACSLOADPATH=/home/foo/.emacs.d/lisp:/opt/emacs/lisp |
| 270 | @end smallexample | 257 | @end smallexample |
| 271 | 258 | ||
| 272 | Here is an example of code you can place in your init file (@pxref{Init | 259 | @noindent |
| 273 | File}) to add several directories to the front of your default | 260 | Here is how to set it from @code{csh}: |
| 274 | @code{load-path}: | ||
| 275 | 261 | ||
| 276 | @smallexample | 262 | @smallexample |
| 277 | @group | 263 | setenv EMACSLOADPATH /home/foo/.emacs.d/lisp:/opt/emacs/lisp |
| 278 | (setq load-path | ||
| 279 | (append (list nil "/user/bil/emacs" | ||
| 280 | "/usr/local/lisplib" | ||
| 281 | "~/emacs") | ||
| 282 | load-path)) | ||
| 283 | @end group | ||
| 284 | @end smallexample | 264 | @end smallexample |
| 285 | 265 | ||
| 286 | @c Wordy to rid us of an overfull hbox. --rjc 15mar92 | 266 | If @env{EMACSLOADPATH} is not set (which is usually the case), Emacs |
| 287 | @noindent | 267 | initializes @code{load-path} with the following two directories: |
| 288 | In this example, the path searches the current working directory first, | ||
| 289 | followed then by the @file{/user/bil/emacs} directory, the | ||
| 290 | @file{/usr/local/lisplib} directory, and the @file{~/emacs} directory, | ||
| 291 | which are then followed by the standard directories for Lisp code. | ||
| 292 | |||
| 293 | Dumping Emacs uses a special value of @code{load-path}. If the value of | ||
| 294 | @code{load-path} at the end of dumping is unchanged (that is, still the | ||
| 295 | same special value), the dumped Emacs switches to the ordinary | ||
| 296 | @code{load-path} value when it starts up, as described above. But if | ||
| 297 | @code{load-path} has any other value at the end of dumping, that value | ||
| 298 | is used for execution of the dumped Emacs also. | ||
| 299 | |||
| 300 | Therefore, if you want to change @code{load-path} temporarily for | ||
| 301 | loading a few libraries in @file{site-init.el} or @file{site-load.el}, | ||
| 302 | you should bind @code{load-path} locally with @code{let} around the | ||
| 303 | calls to @code{load}. | ||
| 304 | |||
| 305 | The default value of @code{load-path}, when running an Emacs which has | ||
| 306 | been installed on the system, includes two special directories (and | ||
| 307 | their subdirectories as well): | ||
| 308 | 268 | ||
| 309 | @smallexample | 269 | @smallexample |
| 310 | "/usr/local/share/emacs/@var{version}/site-lisp" | 270 | "/usr/local/share/emacs/@var{version}/site-lisp" |
| @@ -319,33 +279,42 @@ and | |||
| 319 | 279 | ||
| 320 | @noindent | 280 | @noindent |
| 321 | The first one is for locally installed packages for a particular Emacs | 281 | The first one is for locally installed packages for a particular Emacs |
| 322 | version; the second is for locally installed packages meant for use with | 282 | version; the second is for locally installed packages meant for use |
| 323 | all installed Emacs versions. | 283 | with all installed Emacs versions. |
| 324 | |||
| 325 | There are several reasons why a Lisp package that works well in one | ||
| 326 | Emacs version can cause trouble in another. Sometimes packages need | ||
| 327 | updating for incompatible changes in Emacs; sometimes they depend on | ||
| 328 | undocumented internal Emacs data that can change without notice; | ||
| 329 | sometimes a newer Emacs version incorporates a version of the package, | ||
| 330 | and should be used only with that version. | ||
| 331 | |||
| 332 | Emacs finds these directories' subdirectories and adds them to | ||
| 333 | @code{load-path} when it starts up. Both immediate subdirectories and | ||
| 334 | subdirectories multiple levels down are added to @code{load-path}. | ||
| 335 | |||
| 336 | Not all subdirectories are included, though. Subdirectories whose | ||
| 337 | names do not start with a letter or digit are excluded. Subdirectories | ||
| 338 | named @file{RCS} or @file{CVS} are excluded. Also, a subdirectory which | ||
| 339 | contains a file named @file{.nosearch} is excluded. You can use these | ||
| 340 | methods to prevent certain subdirectories of the @file{site-lisp} | ||
| 341 | directories from being searched. | ||
| 342 | 284 | ||
| 343 | If you run Emacs from the directory where it was built---that is, an | 285 | If you run Emacs from the directory where it was built---that is, an |
| 344 | executable that has not been formally installed---then @code{load-path} | 286 | executable that has not been formally installed---Emacs puts two more |
| 345 | normally contains two additional directories. These are the @code{lisp} | 287 | directories in @code{load-path}. These are the @code{lisp} and |
| 346 | and @code{site-lisp} subdirectories of the main build directory. (Both | 288 | @code{site-lisp} subdirectories of the main build directory. (Both |
| 347 | are represented as absolute file names.) | 289 | are represented as absolute file names.) |
| 348 | 290 | ||
| 291 | Next, Emacs ``expands'' the initial list of directories in | ||
| 292 | @code{load-path} by adding the subdirectories of those directories. | ||
| 293 | Both immediate subdirectories and subdirectories multiple levels down | ||
| 294 | are added. But it excludes subdirectories whose names do not start | ||
| 295 | with a letter or digit, and subdirectories named @file{RCS} or | ||
| 296 | @file{CVS}, and subdirectories containing a file named | ||
| 297 | @file{.nosearch}. | ||
| 298 | |||
| 299 | Next, Emacs adds any extra load directory that you specify using the | ||
| 300 | @samp{-L} command-line option (@pxref{Action Arguments,,,emacs, The | ||
| 301 | GNU Emacs Manual}). It also adds the directories where optional | ||
| 302 | packages are installed, if any (@pxref{Packaging Basics}). | ||
| 303 | |||
| 304 | It is common to add code to one's init file (@pxref{Init File}) to | ||
| 305 | add one or more directories to @code{load-path}. For example: | ||
| 306 | |||
| 307 | @smallexample | ||
| 308 | (push "~/.emacs.d/lisp" load-path) | ||
| 309 | @end smallexample | ||
| 310 | |||
| 311 | Dumping Emacs uses a special value of @code{load-path}. If the | ||
| 312 | value of @code{load-path} at the end of dumping is unchanged (that is, | ||
| 313 | still the same special value), the dumped Emacs switches to the | ||
| 314 | ordinary @code{load-path} value when it starts up, as described above. | ||
| 315 | But if @code{load-path} has any other value at the end of dumping, | ||
| 316 | that value is used for execution of the dumped Emacs also. | ||
| 317 | |||
| 349 | @deffn Command locate-library library &optional nosuffix path interactive-call | 318 | @deffn Command locate-library library &optional nosuffix path interactive-call |
| 350 | This command finds the precise file name for library @var{library}. It | 319 | This command finds the precise file name for library @var{library}. It |
| 351 | searches for the library in the same way @code{load} does, and the | 320 | searches for the library in the same way @code{load} does, and the |
| @@ -401,30 +370,26 @@ example) is read without decoding, the text of the program will be | |||
| 401 | unibyte text, and its string constants will be unibyte strings. | 370 | unibyte text, and its string constants will be unibyte strings. |
| 402 | @xref{Coding Systems}. | 371 | @xref{Coding Systems}. |
| 403 | 372 | ||
| 404 | The reason Emacs is designed this way is so that Lisp programs give | 373 | In most Emacs Lisp programs, the fact that non-@acronym{ASCII} |
| 405 | predictable results, regardless of how Emacs was started. In addition, | 374 | strings are multibyte strings should not be noticeable, since |
| 406 | this enables programs that depend on using multibyte text to work even | 375 | inserting them in unibyte buffers converts them to unibyte |
| 407 | in a unibyte Emacs. | 376 | automatically. However, if this does make a difference, you can force |
| 408 | 377 | a particular Lisp file to be interpreted as unibyte by writing | |
| 409 | In most Emacs Lisp programs, the fact that non-@acronym{ASCII} strings are | 378 | @samp{-*-unibyte: t;-*-} in a comment on the file's first line. With |
| 410 | multibyte strings should not be noticeable, since inserting them in | 379 | that designator, the file will unconditionally be interpreted as |
| 411 | unibyte buffers converts them to unibyte automatically. However, if | 380 | unibyte, even in an ordinary multibyte Emacs session. This can matter |
| 412 | this does make a difference, you can force a particular Lisp file to be | 381 | when making keybindings to non-@acronym{ASCII} characters written as |
| 413 | interpreted as unibyte by writing @samp{-*-unibyte: t;-*-} in a | 382 | @code{?v@var{literal}}. |
| 414 | comment on the file's first line. With that designator, the file will | ||
| 415 | unconditionally be interpreted as unibyte, even in an ordinary | ||
| 416 | multibyte Emacs session. This can matter when making keybindings to | ||
| 417 | non-@acronym{ASCII} characters written as @code{?v@var{literal}}. | ||
| 418 | 383 | ||
| 419 | @node Autoload | 384 | @node Autoload |
| 420 | @section Autoload | 385 | @section Autoload |
| 421 | @cindex autoload | 386 | @cindex autoload |
| 422 | 387 | ||
| 423 | The @dfn{autoload} facility allows you to make a function or macro | 388 | The @dfn{autoload} facility allows you to register the existence of |
| 424 | known in Lisp, but put off loading the file that defines it. The first | 389 | a function or macro, but put off loading the file that defines it. |
| 425 | call to the function automatically reads the proper file to install the | 390 | The first call to the function automatically reads the proper file, in |
| 426 | real definition and other associated code, then runs the real definition | 391 | order to install the real definition and other associated code, then |
| 427 | as if it had been loaded all along. | 392 | runs the real definition as if it had been loaded all along. |
| 428 | 393 | ||
| 429 | There are two ways to set up an autoloaded function: by calling | 394 | There are two ways to set up an autoloaded function: by calling |
| 430 | @code{autoload}, and by writing a special ``magic'' comment in the | 395 | @code{autoload}, and by writing a special ``magic'' comment in the |
diff --git a/doc/lispref/objects.texi b/doc/lispref/objects.texi index 445cb800d33..995a4d89352 100644 --- a/doc/lispref/objects.texi +++ b/doc/lispref/objects.texi | |||
| @@ -1323,11 +1323,11 @@ with the name of the subroutine. | |||
| 1323 | @node Byte-Code Type | 1323 | @node Byte-Code Type |
| 1324 | @subsection Byte-Code Function Type | 1324 | @subsection Byte-Code Function Type |
| 1325 | 1325 | ||
| 1326 | The byte compiler produces @dfn{byte-code function objects}. | 1326 | @dfn{Byte-code function objects} are produced by byte-compiling Lisp |
| 1327 | Internally, a byte-code function object is much like a vector; however, | 1327 | code (@pxref{Byte Compilation}). Internally, a byte-code function |
| 1328 | the evaluator handles this data type specially when it appears as a | 1328 | object is much like a vector; however, the evaluator handles this data |
| 1329 | function to be called. @xref{Byte Compilation}, for information about | 1329 | type specially when it appears in a function call. @xref{Byte-Code |
| 1330 | the byte compiler. | 1330 | Objects}. |
| 1331 | 1331 | ||
| 1332 | The printed representation and read syntax for a byte-code function | 1332 | The printed representation and read syntax for a byte-code function |
| 1333 | object is like that for a vector, with an additional @samp{#} before the | 1333 | object is like that for a vector, with an additional @samp{#} before the |
diff --git a/doc/lispref/streams.texi b/doc/lispref/streams.texi index 36691624405..1628f32aa29 100644 --- a/doc/lispref/streams.texi +++ b/doc/lispref/streams.texi | |||
| @@ -266,12 +266,6 @@ reader encountered the open parenthesis, decided that it ended the | |||
| 266 | input, and unread it. Another attempt to read from the stream at this | 266 | input, and unread it. Another attempt to read from the stream at this |
| 267 | point would read @samp{()} and return @code{nil}. | 267 | point would read @samp{()} and return @code{nil}. |
| 268 | 268 | ||
| 269 | @defun get-file-char | ||
| 270 | This function is used internally as an input stream to read from the | ||
| 271 | input file opened by the function @code{load}. Don't use this function | ||
| 272 | yourself. | ||
| 273 | @end defun | ||
| 274 | |||
| 275 | @node Input Functions | 269 | @node Input Functions |
| 276 | @section Input Functions | 270 | @section Input Functions |
| 277 | 271 | ||
| @@ -702,9 +696,8 @@ The default is @code{t}, meaning display in the echo area. | |||
| 702 | 696 | ||
| 703 | @defvar print-quoted | 697 | @defvar print-quoted |
| 704 | If this is non-@code{nil}, that means to print quoted forms using | 698 | If this is non-@code{nil}, that means to print quoted forms using |
| 705 | abbreviated reader syntax. @code{(quote foo)} prints as @code{'foo}, | 699 | abbreviated reader syntax, e.g.@: @code{(quote foo)} prints as |
| 706 | @code{(function foo)} as @code{#'foo}, and backquoted forms print | 700 | @code{'foo}, and @code{(function foo)} as @code{#'foo}. |
| 707 | using modern backquote syntax. | ||
| 708 | @end defvar | 701 | @end defvar |
| 709 | 702 | ||
| 710 | @defvar print-escape-newlines | 703 | @defvar print-escape-newlines |
diff --git a/doc/lispref/text.texi b/doc/lispref/text.texi index 8e7434de2ed..416bfef4a60 100644 --- a/doc/lispref/text.texi +++ b/doc/lispref/text.texi | |||
| @@ -56,7 +56,7 @@ the character after point. | |||
| 56 | * Registers:: How registers are implemented. Accessing the text or | 56 | * Registers:: How registers are implemented. Accessing the text or |
| 57 | position stored in a register. | 57 | position stored in a register. |
| 58 | * Base 64:: Conversion to or from base 64 encoding. | 58 | * Base 64:: Conversion to or from base 64 encoding. |
| 59 | * MD5 Checksum:: Compute the MD5 "message digest"/"checksum". | 59 | * Checksum/Hash:: Computing "message digests"/"checksums"/"hashes". |
| 60 | * Parsing HTML:: Parsing HTML and XML. | 60 | * Parsing HTML:: Parsing HTML and XML. |
| 61 | * Atomic Changes:: Installing several buffer changes "atomically". | 61 | * Atomic Changes:: Installing several buffer changes "atomically". |
| 62 | * Change Hooks:: Supplying functions to be run when text is changed. | 62 | * Change Hooks:: Supplying functions to be run when text is changed. |
| @@ -4071,9 +4071,11 @@ decoded text. | |||
| 4071 | The decoding functions ignore newline characters in the encoded text. | 4071 | The decoding functions ignore newline characters in the encoded text. |
| 4072 | @end defun | 4072 | @end defun |
| 4073 | 4073 | ||
| 4074 | @node MD5 Checksum | 4074 | @node Checksum/Hash |
| 4075 | @section MD5 Checksum | 4075 | @section Checksum/Hash |
| 4076 | @cindex MD5 checksum | 4076 | @cindex MD5 checksum |
| 4077 | @cindex hashing, secure | ||
| 4078 | @cindex SHA-1 | ||
| 4077 | @cindex message digest computation | 4079 | @cindex message digest computation |
| 4078 | 4080 | ||
| 4079 | MD5 cryptographic checksums, or @dfn{message digests}, are 128-bit | 4081 | MD5 cryptographic checksums, or @dfn{message digests}, are 128-bit |
| @@ -4084,7 +4086,7 @@ RFC@footnote{ | |||
| 4084 | For an explanation of what is an RFC, see the footnote in @ref{Base | 4086 | For an explanation of what is an RFC, see the footnote in @ref{Base |
| 4085 | 64}. | 4087 | 64}. |
| 4086 | }1321. This section describes the Emacs facilities for computing | 4088 | }1321. This section describes the Emacs facilities for computing |
| 4087 | message digests. | 4089 | message digests and other forms of ``secure hash''. |
| 4088 | 4090 | ||
| 4089 | @defun md5 object &optional start end coding-system noerror | 4091 | @defun md5 object &optional start end coding-system noerror |
| 4090 | This function returns the MD5 message digest of @var{object}, which | 4092 | This function returns the MD5 message digest of @var{object}, which |
| @@ -4119,6 +4121,16 @@ using the specified or chosen coding system. However, if | |||
| 4119 | coding instead. | 4121 | coding instead. |
| 4120 | @end defun | 4122 | @end defun |
| 4121 | 4123 | ||
| 4124 | @defun secure-hash algorithm object &optional start end binary | ||
| 4125 | This function provides a general interface to a variety of secure | ||
| 4126 | hashing algorithms. As well as the MD5 algorithm, it supports SHA-1, | ||
| 4127 | SHA-2, SHA-224, SHA-256, SHA-384 and SHA-512. The argument | ||
| 4128 | @var{algorithm} is a symbol stating which hash to compute. The | ||
| 4129 | arguments @var{object}, @var{start}, and @var{end} are as for the | ||
| 4130 | @code{md5} function. If the optional argument @var{binary} is | ||
| 4131 | non-@code{nil}, returns a string in binary form. | ||
| 4132 | @end defun | ||
| 4133 | |||
| 4122 | @node Parsing HTML | 4134 | @node Parsing HTML |
| 4123 | @section Parsing HTML | 4135 | @section Parsing HTML |
| 4124 | @cindex parsing html | 4136 | @cindex parsing html |
diff --git a/doc/lispref/vol1.texi b/doc/lispref/vol1.texi index 0f4a4447ed3..cc96726745f 100644 --- a/doc/lispref/vol1.texi +++ b/doc/lispref/vol1.texi | |||
| @@ -568,17 +568,14 @@ Advising Emacs Lisp Functions | |||
| 568 | * Preactivation:: Preactivation is a way of speeding up the | 568 | * Preactivation:: Preactivation is a way of speeding up the |
| 569 | loading of compiled advice. | 569 | loading of compiled advice. |
| 570 | * Argument Access in Advice:: How advice can access the function's arguments. | 570 | * Argument Access in Advice:: How advice can access the function's arguments. |
| 571 | * Advising Primitives:: Accessing arguments when advising a primitive. | ||
| 572 | * Combined Definition:: How advice is implemented. | 571 | * Combined Definition:: How advice is implemented. |
| 573 | 572 | ||
| 574 | Debugging Lisp Programs | 573 | Debugging Lisp Programs |
| 575 | 574 | ||
| 576 | * Debugger:: How the Emacs Lisp debugger is implemented. | 575 | * Debugger:: A debugger for the Emacs Lisp evaluator. |
| 577 | * Edebug:: A source-level Emacs Lisp debugger. | 576 | * Edebug:: A source-level Emacs Lisp debugger. |
| 578 | * Syntax Errors:: How to find syntax errors. | 577 | * Syntax Errors:: How to find syntax errors. |
| 579 | * Test Coverage:: Ensuring you have tested all branches in your code. | 578 | * Test Coverage:: Ensuring you have tested all branches in your code. |
| 580 | * Compilation Errors:: How to find errors that show up in | ||
| 581 | byte compilation. | ||
| 582 | 579 | ||
| 583 | The Lisp Debugger | 580 | The Lisp Debugger |
| 584 | 581 | ||
| @@ -1082,7 +1079,7 @@ Text | |||
| 1082 | * Registers:: How registers are implemented. Accessing | 1079 | * Registers:: How registers are implemented. Accessing |
| 1083 | the text or position stored in a register. | 1080 | the text or position stored in a register. |
| 1084 | * Base 64:: Conversion to or from base 64 encoding. | 1081 | * Base 64:: Conversion to or from base 64 encoding. |
| 1085 | * MD5 Checksum:: Compute the MD5 "message digest"/"checksum". | 1082 | * Checksum/Hash:: Computing "message digests"/"checksums"/"hashes". |
| 1086 | * Atomic Changes:: Installing several buffer changes "atomically". | 1083 | * Atomic Changes:: Installing several buffer changes "atomically". |
| 1087 | * Change Hooks:: Supplying functions to be run when text is changed. | 1084 | * Change Hooks:: Supplying functions to be run when text is changed. |
| 1088 | 1085 | ||
diff --git a/doc/lispref/vol2.texi b/doc/lispref/vol2.texi index 241728fd1d2..33246cb567d 100644 --- a/doc/lispref/vol2.texi +++ b/doc/lispref/vol2.texi | |||
| @@ -567,17 +567,14 @@ Advising Emacs Lisp Functions | |||
| 567 | * Preactivation:: Preactivation is a way of speeding up the | 567 | * Preactivation:: Preactivation is a way of speeding up the |
| 568 | loading of compiled advice. | 568 | loading of compiled advice. |
| 569 | * Argument Access in Advice:: How advice can access the function's arguments. | 569 | * Argument Access in Advice:: How advice can access the function's arguments. |
| 570 | * Advising Primitives:: Accessing arguments when advising a primitive. | ||
| 571 | * Combined Definition:: How advice is implemented. | 570 | * Combined Definition:: How advice is implemented. |
| 572 | 571 | ||
| 573 | Debugging Lisp Programs | 572 | Debugging Lisp Programs |
| 574 | 573 | ||
| 575 | * Debugger:: How the Emacs Lisp debugger is implemented. | 574 | * Debugger:: A debugger for the Emacs Lisp evaluator. |
| 576 | * Edebug:: A source-level Emacs Lisp debugger. | 575 | * Edebug:: A source-level Emacs Lisp debugger. |
| 577 | * Syntax Errors:: How to find syntax errors. | 576 | * Syntax Errors:: How to find syntax errors. |
| 578 | * Test Coverage:: Ensuring you have tested all branches in your code. | 577 | * Test Coverage:: Ensuring you have tested all branches in your code. |
| 579 | * Compilation Errors:: How to find errors that show up in | ||
| 580 | byte compilation. | ||
| 581 | 578 | ||
| 582 | The Lisp Debugger | 579 | The Lisp Debugger |
| 583 | 580 | ||
| @@ -1081,7 +1078,7 @@ Text | |||
| 1081 | * Registers:: How registers are implemented. Accessing | 1078 | * Registers:: How registers are implemented. Accessing |
| 1082 | the text or position stored in a register. | 1079 | the text or position stored in a register. |
| 1083 | * Base 64:: Conversion to or from base 64 encoding. | 1080 | * Base 64:: Conversion to or from base 64 encoding. |
| 1084 | * MD5 Checksum:: Compute the MD5 "message digest"/"checksum". | 1081 | * Checksum/Hash:: Computing "message digests"/"checksums"/"hashes". |
| 1085 | * Atomic Changes:: Installing several buffer changes "atomically". | 1082 | * Atomic Changes:: Installing several buffer changes "atomically". |
| 1086 | * Change Hooks:: Supplying functions to be run when text is changed. | 1083 | * Change Hooks:: Supplying functions to be run when text is changed. |
| 1087 | 1084 | ||