diff options
Diffstat (limited to 'lispref')
| -rw-r--r-- | lispref/ChangeLog | 19 | ||||
| -rw-r--r-- | lispref/control.texi | 49 | ||||
| -rw-r--r-- | lispref/display.texi | 5 | ||||
| -rw-r--r-- | lispref/files.texi | 9 |
4 files changed, 64 insertions, 18 deletions
diff --git a/lispref/ChangeLog b/lispref/ChangeLog index 5c25f0945a9..5102e723566 100644 --- a/lispref/ChangeLog +++ b/lispref/ChangeLog | |||
| @@ -1,6 +1,23 @@ | |||
| 1 | 2007-07-14 Richard Stallman <rms@gnu.org> | ||
| 2 | |||
| 3 | * control.texi (Handling Errors): Document `debug' in handler list. | ||
| 4 | |||
| 5 | 2007-07-10 Richard Stallman <rms@gnu.org> | ||
| 6 | |||
| 7 | * display.texi (Defining Faces): Explain C-M-x feature for defface. | ||
| 8 | |||
| 9 | 2007-07-09 Richard Stallman <rms@gnu.org> | ||
| 10 | |||
| 11 | * files.texi (Magic File Names): Rewrite previous change. | ||
| 12 | |||
| 13 | 2007-07-08 Michael Albinus <michael.albinus@gmx.de> | ||
| 14 | |||
| 15 | * files.texi (Magic File Names): Introduce optional parameter | ||
| 16 | CONNECTED for `file-remote-p'. | ||
| 17 | |||
| 1 | 2007-07-07 Michael Albinus <michael.albinus@gmx.de> | 18 | 2007-07-07 Michael Albinus <michael.albinus@gmx.de> |
| 2 | 19 | ||
| 3 | * process.texi (Asynchronous Processes): | 20 | * processes.texi (Asynchronous Processes): |
| 4 | * files.texi (Magic File Names): Add `start-file-process'. | 21 | * files.texi (Magic File Names): Add `start-file-process'. |
| 5 | 22 | ||
| 6 | 2007-06-27 Richard Stallman <rms@gnu.org> | 23 | 2007-06-27 Richard Stallman <rms@gnu.org> |
diff --git a/lispref/control.texi b/lispref/control.texi index 4c469a10368..e99a6329f3e 100644 --- a/lispref/control.texi +++ b/lispref/control.texi | |||
| @@ -893,6 +893,12 @@ establishing an error handler, with the special form | |||
| 893 | This deletes the file named @var{filename}, catching any error and | 893 | This deletes the file named @var{filename}, catching any error and |
| 894 | returning @code{nil} if an error occurs. | 894 | returning @code{nil} if an error occurs. |
| 895 | 895 | ||
| 896 | The @code{condition-case} construct is often used to trap errors that | ||
| 897 | are predictable, such as failure to open a file in a call to | ||
| 898 | @code{insert-file-contents}. It is also used to trap errors that are | ||
| 899 | totally unpredictable, such as when the program evaluates an expression | ||
| 900 | read from the user. | ||
| 901 | |||
| 896 | The second argument of @code{condition-case} is called the | 902 | The second argument of @code{condition-case} is called the |
| 897 | @dfn{protected form}. (In the example above, the protected form is a | 903 | @dfn{protected form}. (In the example above, the protected form is a |
| 898 | call to @code{delete-file}.) The error handlers go into effect when | 904 | call to @code{delete-file}.) The error handlers go into effect when |
| @@ -920,15 +926,33 @@ the two gets to handle it. | |||
| 920 | If an error is handled by some @code{condition-case} form, this | 926 | If an error is handled by some @code{condition-case} form, this |
| 921 | ordinarily prevents the debugger from being run, even if | 927 | ordinarily prevents the debugger from being run, even if |
| 922 | @code{debug-on-error} says this error should invoke the debugger. | 928 | @code{debug-on-error} says this error should invoke the debugger. |
| 923 | @xref{Error Debugging}. If you want to be able to debug errors that are | ||
| 924 | caught by a @code{condition-case}, set the variable | ||
| 925 | @code{debug-on-signal} to a non-@code{nil} value. | ||
| 926 | 929 | ||
| 927 | When an error is handled, control returns to the handler. Before this | 930 | If you want to be able to debug errors that are caught by a |
| 928 | happens, Emacs unbinds all variable bindings made by binding constructs | 931 | @code{condition-case}, set the variable @code{debug-on-signal} to a |
| 929 | that are being exited and executes the cleanups of all | 932 | non-@code{nil} value. You can also specify that a particular handler |
| 930 | @code{unwind-protect} forms that are exited. Once control arrives at | 933 | should let the debugger run first, by writing @code{debug} among the |
| 931 | the handler, the body of the handler is executed. | 934 | conditions, like this: |
| 935 | |||
| 936 | @example | ||
| 937 | @group | ||
| 938 | (condition-case nil | ||
| 939 | (delete-file filename) | ||
| 940 | ((debug error) nil)) | ||
| 941 | @end group | ||
| 942 | @end example | ||
| 943 | |||
| 944 | @noindent | ||
| 945 | The effect of @code{debug} here is only to prevent | ||
| 946 | @code{condition-case} from suppressing the call to the debugger. Any | ||
| 947 | given error will invoke the debugger only if @code{debug-on-error} and | ||
| 948 | the other usual filtering mechanisms say it should. @xref{Error Debugging}. | ||
| 949 | |||
| 950 | Once Emacs decides that a certain handler handles the error, it | ||
| 951 | returns control to that handler. To do so, Emacs unbinds all variable | ||
| 952 | bindings made by binding constructs that are being exited, and | ||
| 953 | executes the cleanups of all @code{unwind-protect} forms that are | ||
| 954 | being exited. Once control arrives at the handler, the body of the | ||
| 955 | handler executes normally. | ||
| 932 | 956 | ||
| 933 | After execution of the handler body, execution returns from the | 957 | After execution of the handler body, execution returns from the |
| 934 | @code{condition-case} form. Because the protected form is exited | 958 | @code{condition-case} form. Because the protected form is exited |
| @@ -937,12 +961,6 @@ execution at the point of the error, nor can it examine variable | |||
| 937 | bindings that were made within the protected form. All it can do is | 961 | bindings that were made within the protected form. All it can do is |
| 938 | clean up and proceed. | 962 | clean up and proceed. |
| 939 | 963 | ||
| 940 | The @code{condition-case} construct is often used to trap errors that | ||
| 941 | are predictable, such as failure to open a file in a call to | ||
| 942 | @code{insert-file-contents}. It is also used to trap errors that are | ||
| 943 | totally unpredictable, such as when the program evaluates an expression | ||
| 944 | read from the user. | ||
| 945 | |||
| 946 | Error signaling and handling have some resemblance to @code{throw} and | 964 | Error signaling and handling have some resemblance to @code{throw} and |
| 947 | @code{catch} (@pxref{Catch and Throw}), but they are entirely separate | 965 | @code{catch} (@pxref{Catch and Throw}), but they are entirely separate |
| 948 | facilities. An error cannot be caught by a @code{catch}, and a | 966 | facilities. An error cannot be caught by a @code{catch}, and a |
| @@ -960,7 +978,8 @@ error occurs during @var{protected-form}. | |||
| 960 | 978 | ||
| 961 | Each of the @var{handlers} is a list of the form @code{(@var{conditions} | 979 | Each of the @var{handlers} is a list of the form @code{(@var{conditions} |
| 962 | @var{body}@dots{})}. Here @var{conditions} is an error condition name | 980 | @var{body}@dots{})}. Here @var{conditions} is an error condition name |
| 963 | to be handled, or a list of condition names; @var{body} is one or more | 981 | to be handled, or a list of condition names (which can include @code{debug} |
| 982 | to allow the debugger to run before the handler); @var{body} is one or more | ||
| 964 | Lisp expressions to be executed when this handler handles an error. | 983 | Lisp expressions to be executed when this handler handles an error. |
| 965 | Here are examples of handlers: | 984 | Here are examples of handlers: |
| 966 | 985 | ||
diff --git a/lispref/display.texi b/lispref/display.texi index 664ad1d2c15..f4d7a5dbcdb 100644 --- a/lispref/display.texi +++ b/lispref/display.texi | |||
| @@ -1760,6 +1760,11 @@ When @code{defface} executes, it defines the face according to | |||
| 1760 | @var{spec}, then uses any customizations that were read from the | 1760 | @var{spec}, then uses any customizations that were read from the |
| 1761 | init file (@pxref{Init File}) to override that specification. | 1761 | init file (@pxref{Init File}) to override that specification. |
| 1762 | 1762 | ||
| 1763 | When you evaluate a @code{defcustom} form with @kbd{C-M-x} in Emacs | ||
| 1764 | Lisp mode (@code{eval-defun}), a special feature of @code{eval-defun} | ||
| 1765 | overrides any customizations of the face. This way, the face reflects | ||
| 1766 | exactly what the @code{defcustom} says. | ||
| 1767 | |||
| 1763 | The purpose of @var{spec} is to specify how the face should appear on | 1768 | The purpose of @var{spec} is to specify how the face should appear on |
| 1764 | different kinds of terminals. It should be an alist whose elements | 1769 | different kinds of terminals. It should be an alist whose elements |
| 1765 | have the form @code{(@var{display} @var{atts})}. Each element's | 1770 | have the form @code{(@var{display} @var{atts})}. Each element's |
diff --git a/lispref/files.texi b/lispref/files.texi index 5af77fafc31..343a6bc5e39 100644 --- a/lispref/files.texi +++ b/lispref/files.texi | |||
| @@ -2768,7 +2768,7 @@ nothing and returns @code{nil}. Otherwise it returns the file name | |||
| 2768 | of the local copy file. | 2768 | of the local copy file. |
| 2769 | @end defun | 2769 | @end defun |
| 2770 | 2770 | ||
| 2771 | @defun file-remote-p filename | 2771 | @defun file-remote-p filename &optional connected |
| 2772 | This function tests whether @var{filename} is a remote file. If | 2772 | This function tests whether @var{filename} is a remote file. If |
| 2773 | @var{filename} is local (not remote), the return value is @code{nil}. | 2773 | @var{filename} is local (not remote), the return value is @code{nil}. |
| 2774 | If @var{filename} is indeed remote, the return value is a string that | 2774 | If @var{filename} is indeed remote, the return value is a string that |
| @@ -2777,7 +2777,7 @@ identifies the remote system. | |||
| 2777 | This identifier string can include a host name and a user name, as | 2777 | This identifier string can include a host name and a user name, as |
| 2778 | well as characters designating the method used to access the remote | 2778 | well as characters designating the method used to access the remote |
| 2779 | system. For example, the remote identifier string for the filename | 2779 | system. For example, the remote identifier string for the filename |
| 2780 | @code{/ssh:user@@host:/some/file} is @code{/ssh:user@@host:}. | 2780 | @code{/sudo::/some/file} is @code{/sudo:root@@localhost:}. |
| 2781 | 2781 | ||
| 2782 | If @code{file-remote-p} returns the same identifier for two different | 2782 | If @code{file-remote-p} returns the same identifier for two different |
| 2783 | filenames, that means they are stored on the same file system and can | 2783 | filenames, that means they are stored on the same file system and can |
| @@ -2785,6 +2785,11 @@ be accessed locally with respect to each other. This means, for | |||
| 2785 | example, that it is possible to start a remote process accessing both | 2785 | example, that it is possible to start a remote process accessing both |
| 2786 | files at the same time. Implementors of file handlers need to ensure | 2786 | files at the same time. Implementors of file handlers need to ensure |
| 2787 | this principle is valid. | 2787 | this principle is valid. |
| 2788 | |||
| 2789 | If @var{connected} is non-@code{nil}, this function returns @code{nil} | ||
| 2790 | even if @var{filename} is remote, if Emacs has no network connection | ||
| 2791 | to its host. This is useful when you want to avoid the delay of | ||
| 2792 | making connections when they don't exist. | ||
| 2788 | @end defun | 2793 | @end defun |
| 2789 | 2794 | ||
| 2790 | @defun unhandled-file-name-directory filename | 2795 | @defun unhandled-file-name-directory filename |