aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlenn Morris2014-01-23 20:11:48 -0800
committerGlenn Morris2014-01-23 20:11:48 -0800
commit1e548e4056d46414fa30bb6cab1c660fa30ac905 (patch)
tree0d72443d74fad7f47306fb08f302401ca68f3af1
parent96c983e0d3034ae09406c4b1fb76ca4d06008fcf (diff)
downloademacs-1e548e4056d46414fa30bb6cab1c660fa30ac905.tar.gz
emacs-1e548e4056d46414fa30bb6cab1c660fa30ac905.zip
Doc updates for with-demoted-errors
* doc/lispref/control.texi (Handling Errors): Update with-demoted-errors. * lisp/subr.el (with-demoted-errors): Doc fix. * etc/NEWS: Related edit.
-rw-r--r--doc/lispref/ChangeLog2
-rw-r--r--doc/lispref/control.texi7
-rw-r--r--etc/NEWS1
-rw-r--r--lisp/ChangeLog4
-rw-r--r--lisp/subr.el4
5 files changed, 16 insertions, 2 deletions
diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog
index cbbf9127235..6f27e71b7b7 100644
--- a/doc/lispref/ChangeLog
+++ b/doc/lispref/ChangeLog
@@ -1,5 +1,7 @@
12014-01-24 Glenn Morris <rgm@gnu.org> 12014-01-24 Glenn Morris <rgm@gnu.org>
2 2
3 * control.texi (Handling Errors): Update with-demoted-errors.
4
3 * files.texi (File Locks): Every platform supports locking now. 5 * files.texi (File Locks): Every platform supports locking now.
4 6
52014-01-22 Glenn Morris <rgm@gnu.org> 72014-01-22 Glenn Morris <rgm@gnu.org>
diff --git a/doc/lispref/control.texi b/doc/lispref/control.texi
index 0d6aaff81c5..edf60dd5cc8 100644
--- a/doc/lispref/control.texi
+++ b/doc/lispref/control.texi
@@ -1252,10 +1252,13 @@ Here's the example at the beginning of this subsection rewritten using
1252@end example 1252@end example
1253@end defmac 1253@end defmac
1254 1254
1255@defmac with-demoted-errors body@dots{} 1255@defmac with-demoted-errors format body@dots{}
1256This macro is like a milder version of @code{ignore-errors}. Rather 1256This macro is like a milder version of @code{ignore-errors}. Rather
1257than suppressing errors altogether, it converts them into messages. 1257than suppressing errors altogether, it converts them into messages.
1258Use this form around code that is not expected to signal errors, but 1258It uses the string @var{format} to format the message.
1259@var{format} should contain a single @samp{%}-sequence; e.g.,
1260@code{"Error: %S"}. Use @code{with-demoted-errors} around code
1261that is not expected to signal errors, but
1259should be robust if one does occur. Note that this macro uses 1262should be robust if one does occur. Note that this macro uses
1260@code{condition-case-unless-debug} rather than @code{condition-case}. 1263@code{condition-case-unless-debug} rather than @code{condition-case}.
1261@end defmac 1264@end defmac
diff --git a/etc/NEWS b/etc/NEWS
index b4c3b001d16..39fdefeb8f0 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -1080,6 +1080,7 @@ displaying the buffer in a window.
1080+++ 1080+++
1081*** New function `define-error'. 1081*** New function `define-error'.
1082 1082
1083+++
1083*** `with-demoted-errors' takes an additional argument `format'. 1084*** `with-demoted-errors' takes an additional argument `format'.
1084 1085
1085+++ 1086+++
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 738fe6d37be..6743a537744 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,7 @@
12014-01-24 Glenn Morris <rgm@gnu.org>
2
3 * subr.el (with-demoted-errors): Doc fix.
4
12014-01-23 Stefan Monnier <monnier@iro.umontreal.ca> 52014-01-23 Stefan Monnier <monnier@iro.umontreal.ca>
2 6
3 * emacs-lisp/cl-macs.el: Improve type->predicate mapping (bug#16520). 7 * emacs-lisp/cl-macs.el: Improve type->predicate mapping (bug#16520).
diff --git a/lisp/subr.el b/lisp/subr.el
index 6709ebf0d02..e3cc4b05f3f 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -3246,9 +3246,13 @@ even if this catches the signal."
3246 3246
3247(defmacro with-demoted-errors (format &rest body) 3247(defmacro with-demoted-errors (format &rest body)
3248 "Run BODY and demote any errors to simple messages. 3248 "Run BODY and demote any errors to simple messages.
3249FORMAT is a string passed to `message' to format any error message.
3250It should contain a single %-sequence; e.g., \"Error: %S\".
3251
3249If `debug-on-error' is non-nil, run BODY without catching its errors. 3252If `debug-on-error' is non-nil, run BODY without catching its errors.
3250This is to be used around code which is not expected to signal an error 3253This is to be used around code which is not expected to signal an error
3251but which should be robust in the unexpected case that an error is signaled. 3254but which should be robust in the unexpected case that an error is signaled.
3255
3252For backward compatibility, if FORMAT is not a constant string, it 3256For backward compatibility, if FORMAT is not a constant string, it
3253is assumed to be part of BODY, in which case the message format 3257is assumed to be part of BODY, in which case the message format
3254used is \"Error: %S\"." 3258used is \"Error: %S\"."