aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEli Zaretskii2008-10-15 12:49:11 +0000
committerEli Zaretskii2008-10-15 12:49:11 +0000
commita33a1f2ac9d4df1d0366784c9e981bc6444bd097 (patch)
tree71709a210bde44c18f0f32707eeed768750429ef
parent4fb04348e54f91a29de30057896bb351b11377a8 (diff)
downloademacs-a33a1f2ac9d4df1d0366784c9e981bc6444bd097.tar.gz
emacs-a33a1f2ac9d4df1d0366784c9e981bc6444bd097.zip
(Handling Errors): Document ignore-errors.
-rw-r--r--doc/lispref/ChangeLog2
-rw-r--r--doc/lispref/control.texi21
-rw-r--r--etc/NEWS1
3 files changed, 23 insertions, 1 deletions
diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog
index 84884e3cbe3..4217dc72c4f 100644
--- a/doc/lispref/ChangeLog
+++ b/doc/lispref/ChangeLog
@@ -1,5 +1,7 @@
12008-10-15 Eli Zaretskii <eliz@gnu.org> 12008-10-15 Eli Zaretskii <eliz@gnu.org>
2 2
3 * control.texi (Handling Errors): Document ignore-errors.
4
3 * frames.texi (Creating Frames): Document frame-inherited-parameters. 5 * frames.texi (Creating Frames): Document frame-inherited-parameters.
4 (Parameter Access): Document set-frame-parameter. 6 (Parameter Access): Document set-frame-parameter.
5 7
diff --git a/doc/lispref/control.texi b/doc/lispref/control.texi
index 1ff1f89cff2..86627323fdb 100644
--- a/doc/lispref/control.texi
+++ b/doc/lispref/control.texi
@@ -891,7 +891,9 @@ establishing an error handler, with the special form
891 891
892@noindent 892@noindent
893This deletes the file named @var{filename}, catching any error and 893This deletes the file named @var{filename}, catching any error and
894returning @code{nil} if an error occurs. 894returning @code{nil} if an error occurs@footnote{
895Actually, you should use @code{ignore-errors} in such a simple case;
896see below.}.
895 897
896 The @code{condition-case} construct is often used to trap errors that 898 The @code{condition-case} construct is often used to trap errors that
897are predictable, such as failure to open a file in a call to 899are predictable, such as failure to open a file in a call to
@@ -1089,6 +1091,23 @@ including those signaled with @code{error}:
1089@end group 1091@end group
1090@end smallexample 1092@end smallexample
1091 1093
1094@defmac ignore-errors body@dots{}
1095This construct executes @var{body}, ignoring any errors that occur
1096during its execution. If the execution is without error,
1097@code{ignore-errors} returns the value of the last form in @var{body};
1098otherwise, it returns @code{nil}.
1099
1100Here's the example at the beginning of this subsection rewritten using
1101@code{ignore-errors}:
1102
1103@smallexample
1104@group
1105 (ignore-errors
1106 (delete-file filename))
1107@end group
1108@end smallexample
1109@end defmac
1110
1092@node Error Symbols 1111@node Error Symbols
1093@subsubsection Error Symbols and Condition Names 1112@subsubsection Error Symbols and Condition Names
1094@cindex error symbol 1113@cindex error symbol
diff --git a/etc/NEWS b/etc/NEWS
index ea0a76e69c3..5f6b67abdcc 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -1128,6 +1128,7 @@ applies before function-key-map. Also it is terminal-local contrary to
1128key-translation-map. Terminal-specific key-sequences are generally added to 1128key-translation-map. Terminal-specific key-sequences are generally added to
1129this map rather than to function-key-map now. 1129this map rather than to function-key-map now.
1130 1130
1131+++
1131** `ignore-errors' is now a standard macro (does not require the CL package). 1132** `ignore-errors' is now a standard macro (does not require the CL package).
1132 1133
1133** `interprogram-paste-function' can now return one string or a list 1134** `interprogram-paste-function' can now return one string or a list